/**
 * NMB Finance — admin UI.
 *
 * All styles are scoped under `.nmb-app` so they don't leak into other admin
 * pages. The `--nmb-primary`, `--nmb-secondary`, `--nmb-accent` CSS variables
 * are injected from PHP based on Settings → Branding.
 */

.nmb-app {
    --nmb-primary: #0a4d8c;
    --nmb-secondary: #ffffff;
    --nmb-accent: #ffd400;
    --nmb-text: #0f172a;
    --nmb-muted: #64748b;
    --nmb-border: #e2e8f0;
    --nmb-surface: #ffffff;
    --nmb-bg: #f8fafc;
    --nmb-shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
    --nmb-shadow-lg: 0 10px 30px rgba(15, 23, 42, .08);
    --nmb-radius: 10px;
    --nmb-radius-sm: 6px;
    color: var(--nmb-text);
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Reset some WP admin defaults inside our wrapper */
.nmb-app h1,
.nmb-app h2,
.nmb-app h3 { color: var(--nmb-text); margin: 0; }

/* Page title */
.nmb-app__page-title {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0 0 6px;
}
.nmb-app__page-subtitle {
    color: var(--nmb-muted);
    font-size: 14px;
    margin: 0 0 24px;
}

/* Header bar — page title + actions on a single row */
.nmb-app__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin: 8px 0 28px;
    flex-wrap: wrap;
}
.nmb-app__header-actions { display: flex; gap: 8px; }

/* Metric grid for the dashboard */
.nmb-app__metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.nmb-app__metric-card {
    background: var(--nmb-surface);
    border: 1px solid var(--nmb-border);
    border-radius: var(--nmb-radius);
    padding: 20px 24px;
    box-shadow: var(--nmb-shadow);
}
.nmb-app__metric-card--accent {
    border-top: 4px solid var(--nmb-primary);
    padding-top: 16px;
}
.nmb-app__metric-label {
    color: var(--nmb-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 8px;
    font-weight: 600;
}
.nmb-app__metric {
    font-size: 30px;
    font-weight: 600;
    margin: 0;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--nmb-text);
}
.nmb-app__metric span {
    font-size: 18px;
    color: var(--nmb-muted);
    margin-right: 4px;
    font-weight: 500;
}
.nmb-app__metric--positive { color: #15803d; }
.nmb-app__metric--negative { color: #b91c1c; }
.nmb-app__metric-trend {
    margin-top: 6px;
    font-size: 12px;
    color: var(--nmb-muted);
}

/* Panels */
.nmb-app__panel {
    background: var(--nmb-surface);
    border: 1px solid var(--nmb-border);
    border-radius: var(--nmb-radius);
    box-shadow: var(--nmb-shadow);
    margin-bottom: 24px;
    overflow: hidden;
}
.nmb-app__panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--nmb-border);
    gap: 16px;
}
.nmb-app__panel-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}
.nmb-app__panel-body { padding: 0; }
.nmb-app__panel-body--padded { padding: 20px 24px; }

/* Two-column layout */
.nmb-app__cols {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}
@media (max-width: 980px) { .nmb-app__cols { grid-template-columns: 1fr; } }

/* Tables */
.nmb-app__table {
    width: 100%;
    border-collapse: collapse;
    background: var(--nmb-surface);
    font-size: 14px;
}
.nmb-app__table th {
    text-align: left;
    padding: 12px 16px;
    background: #f8fafc;
    color: var(--nmb-muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--nmb-border);
}
.nmb-app__table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--nmb-border);
    vertical-align: middle;
}
.nmb-app__table tbody tr:hover { background: #f8fafc; }
.nmb-app__table tbody tr:last-child td { border-bottom: 0; }
.nmb-app__table .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }

/* Status pills */
.nmb-app__pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #e2e8f0;
    color: #475569;
}
.nmb-app__pill--draft     { background: #f1f5f9; color: #475569; }
.nmb-app__pill--sent      { background: #dbeafe; color: #1e40af; }
.nmb-app__pill--paid      { background: #d1fae5; color: #065f46; }
.nmb-app__pill--partial   { background: #fef3c7; color: #92400e; }
.nmb-app__pill--overdue   { background: #fee2e2; color: #991b1b; }
.nmb-app__pill--cancelled { background: #f1f5f9; color: #64748b; }

/* Muted text */
.nmb-app__muted { color: var(--nmb-muted); font-size: 13px; }

/* Filter bar above tables */
.nmb-app__filter-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px 24px;
    background: #f8fafc;
    border-bottom: 1px solid var(--nmb-border);
    flex-wrap: wrap;
    margin: 0 -24px 20px;
}
.nmb-app__filter-bar label { font-size: 13px; color: var(--nmb-muted); display: flex; gap: 8px; align-items: center; }


/* Filter row � add nmb-app__filter to any panel-body--padded that mixes
   labeled fields with buttons. Zeroes child margin-bottom so flex
   align-items:flex-end keeps input bottoms and button bottoms on one line.
   Never use inline display/align-items on these containers instead. */
.nmb-app__filter {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}
.nmb-app__filter > * {
    margin-bottom: 0;
}
.nmb-app__filter .nmb-app__field {
    margin-bottom: 0;
}
.nmb-app__filter .button {
    margin-bottom: 0;
}

/* Bar chart */
.nmb-app__bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 200px;
    padding: 16px 0 30px;
    border-bottom: 1px solid var(--nmb-border);
    margin-bottom: 16px;
    overflow-x: auto;
}
.nmb-app__bar {
    flex: 1 0 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    position: relative;
}
.nmb-app__bar-fill {
    width: 100%;
    max-width: 28px;
    background: linear-gradient(180deg, var(--nmb-primary) 0%, color-mix(in srgb, var(--nmb-primary) 70%, white) 100%);
    border-radius: 3px 3px 0 0;
    min-height: 2px;
}
.nmb-app__bar-label {
    position: absolute;
    bottom: -22px;
    font-size: 10px;
    color: var(--nmb-muted);
    white-space: nowrap;
}

/* Buttons (override WP defaults inside our wrapper) */
/* ================================================
   BUTTON SYSTEM � comprehensive WP override
   All .button variants inside .nmb-app are reset
   here. Do not add per-context button size rules.
   ================================================ */

/* 1. Base reset */
.nmb-app .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 5px 14px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    height: auto;
    min-height: 0;
    border-radius: var(--nmb-radius-sm);
    border: 1px solid #c3c4c7;
    background: #fff;
    color: var(--nmb-text);
    text-decoration: none;
    text-shadow: none;
    box-shadow: none;
    cursor: pointer;
    white-space: nowrap;
    vertical-align: middle;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.nmb-app .button:hover {
    background: #f6f7f7;
    border-color: #8c8f94;
    color: var(--nmb-text);
    text-decoration: none;
}

/* 2. Primary */
.nmb-app .button.button-primary,
.nmb-app .button-primary {
    background: var(--nmb-primary);
    border-color: var(--nmb-primary);
    color: #fff;
}
.nmb-app .button.button-primary:hover,
.nmb-app .button-primary:hover {
    background: color-mix(in srgb, var(--nmb-primary) 88%, black);
    border-color: color-mix(in srgb, var(--nmb-primary) 88%, black);
    color: #fff;
}

/* 3. Secondary � outlined NMB blue */
.nmb-app .button.button-secondary,
.nmb-app .button-secondary {
    background: #fff;
    border-color: var(--nmb-primary);
    color: var(--nmb-primary);
}
.nmb-app .button.button-secondary:hover,
.nmb-app .button-secondary:hover {
    background: color-mix(in srgb, var(--nmb-primary) 6%, white);
    border-color: color-mix(in srgb, var(--nmb-primary) 88%, black);
    color: color-mix(in srgb, var(--nmb-primary) 88%, black);
}

/* 4. Auto-promote to secondary in header action bars */
.nmb-app__header-actions .button:not(.button-primary):not(.button-link):not(.button-link-delete) {
    border-color: var(--nmb-primary);
    color: var(--nmb-primary);
}
.nmb-app__header-actions .button:not(.button-primary):not(.button-link):not(.button-link-delete):hover {
    background: color-mix(in srgb, var(--nmb-primary) 6%, white);
    border-color: color-mix(in srgb, var(--nmb-primary) 88%, black);
    color: color-mix(in srgb, var(--nmb-primary) 88%, black);
}

/* 5. Sidebar action panel */
.nmb-app__actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.nmb-app__actions .button {
    width: 100%;
    justify-content: flex-start;
}

/* Hero invoice header */
.nmb-app__invoice-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.nmb-app__invoice-hero h1 {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 16px;
}
.nmb-app__invoice-hero .nmb-app__pill { font-size: 13px; padding: 4px 14px; }

/* Form rows inside our panels */
.nmb-app .form-table th { padding: 14px 0; color: var(--nmb-muted); font-weight: 500; }
.nmb-app .form-table td { padding: 12px 0; }
.nmb-app input[type="text"],
.nmb-app input[type="email"],
.nmb-app input[type="number"],
.nmb-app input[type="date"],
.nmb-app textarea,
.nmb-app select {
    border-radius: var(--nmb-radius-sm);
    border-color: var(--nmb-border);
}

/* Sidebar menu icon — make our entry stand out */
#adminmenu li.toplevel_page_nmb-finance .wp-menu-image::before { color: var(--nmb-accent, #ffd400); }

/* Recent invoices list (dashboard) */
.nmb-app__recent { margin: 0; padding: 0; list-style: none; }
.nmb-app__recent li {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 12px;
    padding: 14px 24px;
    border-bottom: 1px solid var(--nmb-border);
    align-items: center;
}
.nmb-app__recent li:last-child { border-bottom: 0; }
.nmb-app__recent-title { font-weight: 600; }
.nmb-app__recent-sub { font-size: 12px; color: var(--nmb-muted); margin-top: 2px; }

/* WP admin-style notices look out of place — round and shadow them */
.nmb-app .notice {
    border-radius: var(--nmb-radius-sm);
    box-shadow: var(--nmb-shadow);
    border-left-width: 4px;
}

/* Money figures */
.nmb-app .money { font-variant-numeric: tabular-nums; font-weight: 500; }
.nmb-app .money--negative { color: #b91c1c; }
.nmb-app .money--positive { color: #15803d; }

/* Modal — used for inline payment recording */
.nmb-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.nmb-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .55);
    cursor: pointer;
}
.nmb-modal__panel {
    position: relative;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .25);
    width: 100%;
    max-width: 460px;
    max-height: 90vh;
    overflow: auto;
    display: flex;
    flex-direction: column;
}
.nmb-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid #e2e8f0;
}
.nmb-modal__head h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #0f172a;
}
.nmb-modal__close {
    background: transparent;
    border: 0;
    font-size: 24px;
    cursor: pointer;
    color: #64748b;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 6px;
}
.nmb-modal__close:hover { background: #f1f5f9; color: #0f172a; }
.nmb-modal__body {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.nmb-modal__body label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    font-weight: 600;
}
.nmb-modal__body input,
.nmb-modal__body select,
.nmb-modal__body textarea {
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    color: #0f172a;
    text-transform: none;
    letter-spacing: normal;
    font-weight: normal;
}
.nmb-modal__body input:focus,
.nmb-modal__body select:focus,
.nmb-modal__body textarea:focus {
    outline: 2px solid var(--nmb-primary, #0a4d8c);
    outline-offset: 0;
    border-color: var(--nmb-primary, #0a4d8c);
}
.nmb-modal__context {
    margin: 0 0 4px;
    font-size: 14px;
}
.nmb-modal__footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 1px solid #e2e8f0;
    margin-top: 6px;
}
.nmb-modal__notice {
    padding: 8px 10px;
    border-radius: 6px;
    background: #fee2e2;
    font-size: 13px;
}

/* Pay button visual nudge */
.nmb-pay-btn { font-weight: 600; }

/* =====================================================================
 * Settings screen — side-rail nav + tab body
 * ===================================================================== */
.nmb-app__settings {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 24px;
    align-items: flex-start;
}
@media ( max-width: 880px ) {
    .nmb-app__settings { grid-template-columns: 1fr; }
}
.nmb-app__settings-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--nmb-surface);
    border: 1px solid var(--nmb-border);
    border-radius: var(--nmb-radius);
    padding: 8px;
    box-shadow: var(--nmb-shadow);
    position: sticky;
    top: 42px;
}
.nmb-app__settings-tab {
    display: block;
    padding: 9px 12px;
    border-radius: var(--nmb-radius-sm);
    color: var(--nmb-text);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.2;
    transition: background-color .12s, color .12s;
}
.nmb-app__settings-tab:hover { background: #f1f5f9; color: var(--nmb-text); }
.nmb-app__settings-tab.is-active {
    background: color-mix( in srgb, var(--nmb-primary) 10%, white );
    color: var(--nmb-primary);
    font-weight: 600;
}
.nmb-app__settings-body { min-width: 0; }

/* =====================================================================
 * Form primitives (used on settings + batch creator)
 * ===================================================================== */
.nmb-app__form .form-table { margin: 0; }
.nmb-app__form .form-table th { padding: 16px 16px 16px 0; vertical-align: top; width: 220px; }
.nmb-app__form .form-table td { padding: 14px 0; }
.nmb-app__form .form-table label,
.nmb-app__form .form-table th label { color: var(--nmb-text); font-weight: 500; font-size: 14px; }
.nmb-app__form input[type="text"],
.nmb-app__form input[type="email"],
.nmb-app__form input[type="number"],
.nmb-app__form input[type="date"],
.nmb-app__form input[type="url"],
.nmb-app__form textarea,
.nmb-app__form select,
.nmb-app__input {
    padding: 8px 12px;
    border: 1px solid var(--nmb-border);
    border-radius: var(--nmb-radius-sm);
    background: #fff;
    color: var(--nmb-text);
    font-size: 14px;
    line-height: 1.4;
    box-shadow: none;
    transition: border-color .12s, box-shadow .12s;
}
.nmb-app__form input:focus,
.nmb-app__form textarea:focus,
.nmb-app__form select:focus,
.nmb-app__input:focus {
    border-color: var(--nmb-primary);
    box-shadow: 0 0 0 3px color-mix( in srgb, var(--nmb-primary) 18%, transparent );
    outline: none;
}
.nmb-app__form .description,
.nmb-app__field-help {
    color: var(--nmb-muted);
    font-size: 12.5px;
    margin: 6px 0 0;
    line-height: 1.4;
}
.nmb-app__form input[type="color"] {
    height: 38px;
    width: 64px;
    padding: 2px;
    border: 1px solid var(--nmb-border);
    border-radius: var(--nmb-radius-sm);
    background: #fff;
}

.nmb-app__field {
    display: block;
    margin-bottom: 4px;
}
.nmb-app__field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--nmb-text);
    margin-bottom: 6px;
    letter-spacing: 0.01em;
}
.nmb-app__field-grid {
    display: grid;
    grid-template-columns: repeat( auto-fit, minmax( 180px, 1fr ) );
    gap: 16px;
}
.nmb-app__form-actions {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--nmb-border);
}
.nmb-app__form-actions .button { margin-right: 8px; }

/* Toggle row (checkbox + label) */
.nmb-app__toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--nmb-border);
    border-radius: var(--nmb-radius-sm);
    background: #f8fafc;
    cursor: pointer;
    font-size: 14px;
    color: var(--nmb-text);
}
.nmb-app__toggle input[type="checkbox"] { margin: 0; }

/* =====================================================================
 * Batch Creator — numbered steps, mode picker, line items, chips
 * ===================================================================== */
.nmb-app__batch-form .nmb-app__panel { margin-bottom: 16px; }
.nmb-app__step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--nmb-primary);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    vertical-align: middle;
}

/* Targeting mode — card-style radio group */
.nmb-app__mode-grid {
    display: grid;
    grid-template-columns: repeat( auto-fit, minmax( 200px, 1fr ) );
    gap: 12px;
    border: 0;
    padding: 0;
    margin: 0 0 4px;
}
.nmb-app__mode-grid legend { padding: 0; margin-bottom: 8px; }
.nmb-app__mode-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border: 1.5px solid var(--nmb-border);
    border-radius: var(--nmb-radius);
    padding: 12px 14px;
    cursor: pointer;
    background: #fff;
    transition: border-color .12s, background-color .12s, box-shadow .12s;
    position: relative;
}
.nmb-app__mode-card:hover { border-color: color-mix( in srgb, var(--nmb-primary) 35%, var(--nmb-border) ); }
.nmb-app__mode-card.is-active,
.nmb-app__mode-card:has( input:checked ) {
    border-color: var(--nmb-primary);
    background: color-mix( in srgb, var(--nmb-primary) 5%, white );
    box-shadow: 0 0 0 3px color-mix( in srgb, var(--nmb-primary) 12%, transparent );
}
.nmb-app__mode-card input[type="radio"] {
    position: absolute;
    top: 12px;
    right: 12px;
    margin: 0;
}
.nmb-app__mode-card-title { font-weight: 600; font-size: 14px; color: var(--nmb-text); }
.nmb-app__mode-card-hint  { font-size: 12px; color: var(--nmb-muted); line-height: 1.35; }

/* Age-group chips (toggles) */
.nmb-app__chip-toggles { display: flex; flex-wrap: wrap; gap: 8px; }
.nmb-app__chip-toggle {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1.5px solid var(--nmb-border);
    background: #fff;
    color: var(--nmb-text);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all .12s;
}
.nmb-app__chip-toggle input { display: none; }
.nmb-app__chip-toggle:hover { border-color: color-mix( in srgb, var(--nmb-primary) 35%, var(--nmb-border) ); }
.nmb-app__chip-toggle.is-active,
.nmb-app__chip-toggle:has( input:checked ) {
    background: var(--nmb-primary);
    border-color: var(--nmb-primary);
    color: #fff;
}

/* Player picker — autocomplete input + selected-chip list */
.nmb-app__player-picker { position: relative; }
.nmb-app__player-picker .nmb-app__input { width: 100%; max-width: 520px; }
.nmb-app__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    min-height: 0;
}
.nmb-app__chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px 4px 12px;
    border-radius: 999px;
    background: color-mix( in srgb, var(--nmb-primary) 10%, white );
    color: var(--nmb-primary);
    font-size: 13px;
    font-weight: 500;
    border: 1px solid color-mix( in srgb, var(--nmb-primary) 30%, var(--nmb-border) );
}
.nmb-app__chip-label { line-height: 1.2; }
.nmb-app__chip-remove {
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 16px;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0.6;
}
.nmb-app__chip-remove:hover { opacity: 1; background: color-mix( in srgb, var(--nmb-primary) 22%, white ); }

/* jQuery UI autocomplete dropdown — match our design */
.ui-autocomplete {
    border: 1px solid var(--nmb-border) !important;
    border-radius: var(--nmb-radius-sm) !important;
    background: #fff !important;
    box-shadow: var(--nmb-shadow-lg) !important;
    padding: 4px !important;
    z-index: 100001 !important;
    max-height: 320px;
    overflow-y: auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif !important;
}
.ui-autocomplete .ui-menu-item { list-style: none; }
.ui-autocomplete .ui-menu-item-wrapper,
.ui-autocomplete .ui-menu-item > div {
    padding: 8px 10px !important;
    border-radius: var(--nmb-radius-sm) !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--nmb-text) !important;
    cursor: pointer;
}
.ui-autocomplete .ui-menu-item-wrapper.ui-state-active,
.ui-autocomplete .ui-menu-item > div.ui-state-active,
.ui-autocomplete .ui-menu-item-wrapper:hover {
    background: color-mix( in srgb, var(--nmb-primary) 10%, white ) !important;
    color: var(--nmb-primary) !important;
    margin: 0 !important;
}
.nmb-app__ac-item { display: flex; align-items: center; gap: 8px; }
.nmb-app__ac-name { font-weight: 500; }
.nmb-app__ac-age {
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    background: #e2e8f0;
    padding: 2px 8px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.nmb-app__ac-inactive {
    font-size: 10px;
    font-weight: 600;
    color: #b45309;
    background: #fef3c7;
    padding: 2px 6px;
    border-radius: 999px;
    text-transform: uppercase;
}

/* Line-items table — nicer than widefat for our context */
.nmb-app__lines-table { border: 1px solid var(--nmb-border); border-radius: var(--nmb-radius-sm); overflow: hidden; }
.nmb-app__lines-table td { padding: 8px 10px; }
.nmb-app__lines-table input.nmb-app__input { width: 100%; padding: 6px 10px; }
.nmb-app__row-remove {
    border: 0;
    background: transparent;
    color: #94a3b8;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 50%;
}
.nmb-app__row-remove:hover { background: #fee2e2; color: #b91c1c; }

/* Sticky action bar at the bottom of the batch form */
.nmb-app__sticky-actions {
    position: sticky;
    bottom: 0;
    margin-top: 20px;
    background: var(--nmb-surface);
    border: 1px solid var(--nmb-border);
    border-radius: var(--nmb-radius);
    box-shadow: 0 -4px 14px rgba(15, 23, 42, .06);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    z-index: 50;
}
.nmb-app__sticky-actions-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Success card after batch creation */
.nmb-app__success-card { border-left: 4px solid #15803d; }

/* =====================================================================
 * Team Roster panel
 * ===================================================================== */
.nmb-roster { display: flex; flex-direction: column; gap: 18px; }
.nmb-roster__section {
    border: 1px solid var(--nmb-border);
    border-radius: var(--nmb-radius);
    background: #fff;
    overflow: hidden;
}
.nmb-roster__section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f8fafc;
    border-bottom: 1px solid var(--nmb-border);
}
.nmb-roster__section-title { font-size: 13px; font-weight: 600; margin: 0; color: var(--nmb-text); }
.nmb-roster__list { list-style: none; margin: 0; padding: 0; }
.nmb-roster__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 14px;
    border-bottom: 1px solid var(--nmb-border);
    font-size: 14px;
}
.nmb-roster__row:last-child { border-bottom: 0; }
.nmb-roster__list--suggested .nmb-roster__row { background: #fafbfc; }
.nmb-roster__row:hover { background: color-mix( in srgb, var(--nmb-primary) 4%, white ); }
.nmb-roster__row-name { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.nmb-roster__row-actions { display: flex; align-items: center; gap: 6px; }
.nmb-roster__remove {
    color: #b91c1c !important;
    border-color: #fecaca !important;
    background: #fff !important;
    padding: 2px 10px !important;
    font-weight: 700 !important;
}
.nmb-roster__remove:hover { background: #fee2e2 !important; }
.nmb-roster__flash {
    background: #d1fae5;
    color: #065f46;
    padding: 8px 14px;
    border-radius: var(--nmb-radius-sm);
    font-size: 13px;
    margin-bottom: 10px;
    border-left: 3px solid #15803d;
}

/* =====================================================================
 * Full-screen app shell — hides the WP admin chrome on NMB pages and
 * replaces it with our own header.
 * ===================================================================== */
body.nmb-finance-fullscreen #wpadminbar,
body.nmb-finance-fullscreen #adminmenuback,
body.nmb-finance-fullscreen #adminmenuwrap,
body.nmb-finance-fullscreen #wpfooter,
body.nmb-finance-fullscreen #screen-meta,
body.nmb-finance-fullscreen #screen-meta-links { display: none !important; }

body.nmb-finance-fullscreen { margin-top: 0 !important; min-height: 100vh; }
body.nmb-finance-fullscreen html.wp-toolbar,
html.wp-toolbar:has( body.nmb-finance-fullscreen ) { padding-top: 0 !important; }
body.nmb-finance-fullscreen #wpwrap { min-height: 100vh; background: var(--nmb-bg, #f8fafc); }
body.nmb-finance-fullscreen #wpcontent {
    margin-left: 0 !important;
    padding-left: 0 !important;
    background: var(--nmb-bg, #f8fafc);
}
body.nmb-finance-fullscreen #wpbody { padding-top: 0 !important; }
body.nmb-finance-fullscreen #wpbody-content { padding-bottom: 0 !important; padding-top: 0 !important; }
body.nmb-finance-fullscreen #wpbody-content .wrap {
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
}
body.nmb-finance-fullscreen .notice,
body.nmb-finance-fullscreen .updated,
body.nmb-finance-fullscreen .error {
    margin: 0 0 16px 0 !important;
}

/* The shell wrapper itself */
.nmb-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--nmb-bg, #f8fafc);
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
    color: var(--nmb-text, #0f172a);
}

.nmb-shell__header {
    display: grid;
    grid-template-columns: 160px 1fr auto;
    gap: 24px;
    align-items: center;
    padding: 12px 24px;
    background: #ffffff;
    border-bottom: 1px solid var(--nmb-border, #e2e8f0);
    box-shadow: 0 1px 0 rgba( 15, 23, 42, .03 );
    position: sticky;
    top: 0;
    z-index: 100;
}

.nmb-shell__brand { display: flex; align-items: center; gap: 12px; }
.nmb-shell__logo {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--nmb-primary, #0a4d8c);
}
.nmb-shell__logo--fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}
.nmb-shell__logo--fallback .dashicons { color: #fff; }
.nmb-shell__brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.nmb-shell__brand-title { font-size: 15px; font-weight: 700; color: var(--nmb-text, #0f172a); letter-spacing: -0.01em; }
.nmb-shell__brand-sub   { font-size: 11px; color: var(--nmb-muted, #64748b); text-transform: uppercase; letter-spacing: 0.06em; }

.nmb-shell__nav {
    display: flex;
    align-items: center;
    gap: 2px;
    /* overflow must stay visible so the People / Content dropdowns are not
       clipped (overflow-x:auto forces overflow-y to compute to auto too). */
    overflow: visible;
    flex-wrap: wrap;
}
.nmb-shell__nav-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 8px;
    color: var(--nmb-text, #0f172a);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    transition: background-color .12s, color .12s;
    position: relative;
}
.nmb-shell__nav-item .dashicons { font-size: 17px; width: 17px; height: 17px; color: currentColor; opacity: .75; }
.nmb-shell__nav-item:hover { background: #f1f5f9; color: var(--nmb-text); }
.nmb-shell__nav-item.is-active {
    background: color-mix( in srgb, var(--nmb-primary, #0a4d8c) 12%, white );
    color: var(--nmb-primary, #0a4d8c);
}
.nmb-shell__nav-item.is-active .dashicons { opacity: 1; }
.nmb-shell__nav-badge {
    background: #ef4444;
    color: #fff;
    border-radius: 999px;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    text-align: center;
}

/* Grouped nav items (People, Content) with hover/focus dropdowns. */
.nmb-shell__nav-group { position: relative; }
.nmb-shell__nav-caret {
    font-size: 14px !important;
    width: 14px !important;
    height: 14px !important;
    opacity: .55;
    margin-left: -3px;
    transition: transform .12s;
}
.nmb-shell__nav-group:hover .nmb-shell__nav-caret,
.nmb-shell__nav-group:focus-within .nmb-shell__nav-caret { transform: rotate( 180deg ); }
.nmb-shell__nav-dropdown {
    position: absolute;
    top: calc( 100% + 5px );
    left: 0;
    min-width: 196px;
    background: #fff;
    border: 1px solid var(--nmb-border, #e2e8f0);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba( 15, 23, 42, .14 );
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 200;
    /* Hidden by default, revealed on hover/focus. We use visibility+opacity
       (not display:none) so we can add a grace period on close: the menu
       lingers ~0.3s before hiding, so it doesn't vanish while the cursor
       travels down from the button. */
    visibility: hidden;
    opacity: 0;
    transform: translateY( 4px );
    transition: opacity .14s ease .3s, transform .14s ease .3s, visibility 0s linear .45s;
}
/* Invisible bridge spanning the gap between the button and the menu so the
   group stays hovered while the cursor crosses it (no dead zone). */
.nmb-shell__nav-dropdown::before {
    content: '';
    position: absolute;
    top: -9px;
    left: 0;
    right: 0;
    height: 9px;
}
.nmb-shell__nav-group:hover .nmb-shell__nav-dropdown,
.nmb-shell__nav-group:focus-within .nmb-shell__nav-dropdown {
    visibility: visible;
    opacity: 1;
    transform: translateY( 0 );
    transition: opacity .14s ease, transform .14s ease, visibility 0s;
}
.nmb-shell__nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 12px;
    border-radius: 7px;
    color: var(--nmb-text, #0f172a);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    transition: background-color .12s, color .12s;
}
.nmb-shell__nav-dropdown-item .dashicons {
    font-size: 17px;
    width: 17px;
    height: 17px;
    color: currentColor;
    opacity: .7;
}
.nmb-shell__nav-dropdown-item:hover { background: #f1f5f9; }
.nmb-shell__nav-dropdown-item.is-active {
    background: color-mix( in srgb, var(--nmb-primary, #0a4d8c) 12%, white );
    color: var(--nmb-primary, #0a4d8c);
}
.nmb-shell__nav-dropdown-item.is-active .dashicons { opacity: 1; }
.nmb-shell__nav-dropdown-label { flex: 1; }

.nmb-shell__user { display: flex; align-items: center; gap: 12px; justify-self: end; }
.nmb-shell__user-name { font-size: 13px; color: var(--nmb-muted, #64748b); font-weight: 500; }
.nmb-shell__exit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid var(--nmb-border, #e2e8f0);
    color: var(--nmb-muted, #64748b);
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 500;
}
.nmb-shell__exit:hover { background: #f1f5f9; color: var(--nmb-text, #0f172a); }
.nmb-shell__exit .dashicons { font-size: 15px; width: 15px; height: 15px; }

.nmb-shell__main {
    flex: 1;
    padding: 24px 28px;
    overflow-x: hidden;
}
.nmb-shell__main .nmb-app { max-width: 1400px; margin: 0 auto; }

@media ( max-width: 1100px ) {
    .nmb-shell__header { grid-template-columns: auto 1fr auto; gap: 12px; padding: 10px 14px; }
    .nmb-shell__brand-text { display: none; }
    .nmb-shell__nav-label { display: none; }
    .nmb-shell__nav-item { padding: 9px 10px; }
    .nmb-shell__exit-label { display: none; }
    .nmb-shell__user-name { display: none; }
    .nmb-shell__main { padding: 16px; }
}

/* Hide top-margin notices on app pages — we put them inside our shell */
body.nmb-finance-fullscreen #wpbody-content > .notice:not(.below-h2) { display: none; }

/* -- List / Calendar toggle -------------------------------------------------
 * The schedule view renders this toggle in BOTH list and calendar modes, but
 * calendar.css only loads in calendar mode. These rules live here (admin.css,
 * which always loads on the admin Matches screen and is reused by the portal)
 * so the toggle is styled in list mode too, instead of falling back to raw
 * "ListCalendar" links. Kept in sync with assets/calendar.css. */
.nmb-view-toggle {
    display: inline-flex;
    border: 1px solid var(--nmb-border, #cbd5e1);
    border-radius: 8px;
    overflow: hidden;
    margin: 0 0 18px;
}

.nmb-view-toggle a {
    display: inline-block;
    padding: 8px 16px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--nmb-text, #0f172a);
    background: var(--nmb-surface, #ffffff);
}

.nmb-view-toggle a + a {
    border-left: 1px solid var(--nmb-border, #cbd5e1);
}

.nmb-view-toggle a.is-active {
    background: var(--nmb-primary, #0a4d8c);
    color: #fff;
}

/* -----------------------------------------------------------------------
 *  Venue + directions control (NMB_Finance_Venue_Map::render).
 *
 *  A <details> popover, so there's no JS to load or break. On phones the
 *  menu drops to a static block instead of an absolute popover — an
 *  absolutely-positioned panel inside a narrow table cell reliably runs off
 *  the edge of the viewport (same failure mode as the old bell dropdown).
 * --------------------------------------------------------------------- */
.nmb-venue {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.nmb-venue--empty { color: var(--nmb-muted); }

.nmb-venue__dir {
    position: relative;
    display: inline-block;
}

.nmb-venue__trigger {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px 2px 5px;
    font-size: 12px;
    line-height: 1.6;
    font-weight: 600;
    color: var(--nmb-primary);
    background: rgba(10, 77, 140, .07);
    border: 1px solid rgba(10, 77, 140, .18);
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
    list-style: none;
    user-select: none;
}

/* Kill the native disclosure triangle in every engine. */
.nmb-venue__trigger::-webkit-details-marker { display: none; }
.nmb-venue__trigger::marker { content: ''; }

.nmb-venue__trigger:hover,
.nmb-venue__dir[open] > .nmb-venue__trigger {
    background: rgba(10, 77, 140, .14);
    border-color: rgba(10, 77, 140, .32);
}

.nmb-venue__trigger .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    line-height: 14px;
}

.nmb-venue--compact .nmb-venue__trigger { padding: 2px 5px; }

.nmb-venue__menu {
    position: absolute;
    z-index: 40;
    top: calc(100% + 6px);
    left: 0;
    display: flex;
    flex-direction: column;
    min-width: 190px;
    max-width: min(280px, 80vw);
    padding: 6px;
    background: var(--nmb-surface);
    border: 1px solid var(--nmb-border);
    border-radius: var(--nmb-radius-sm);
    box-shadow: var(--nmb-shadow-lg);
    text-align: left;
}

.nmb-venue__addr {
    padding: 5px 8px 7px;
    margin-bottom: 4px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--nmb-muted);
    border-bottom: 1px solid var(--nmb-border);
}

.nmb-venue__link {
    padding: 7px 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--nmb-text);
    text-decoration: none;
    border-radius: var(--nmb-radius-sm);
}

.nmb-venue__link:hover,
.nmb-venue__link:focus {
    background: var(--nmb-bg);
    color: var(--nmb-primary);
}

/* venue-map.js switches the open panel to position:fixed and clamps it to the
 * viewport — the absolute rules above are the no-JS fallback. */
@media (max-width: 600px) {
    .nmb-venue__menu { max-width: calc(100vw - 24px); }
}
