/* Admin visual system. Presentation only; production authority lives in the API. */
:root {
    --md3-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --md3-primary: #b8b2ff;
    --md3-on-primary: #191536;
    --md3-background: #0c0e14;
    --md3-surface: #11141d;
    --md3-on-surface: #edf0f8;
    --md3-on-background: #edf0f8;
    --md3-on-surface-variant: #a2a9bd;
    --md3-surface-container-high: #151924;
    --md3-surface-container-highest: #1e2331;
    --md3-outline-variant: #272d3d;
    --md3-outline: #454e65;
    --glass-border: #272d3d;
    --glass-bg: #151924;
    --text-primary: #edf0f8;
    --text-secondary: #a2a9bd;
    --md3-radius-lg: 12px;
    --md3-radius-xl: 16px;
    --gradient-primary: linear-gradient(135deg, #7770e8, #6860cc);
}
body { background: var(--md3-background); font-size: 14px; letter-spacing: 0; }
button, input, select, textarea { font: inherit; }
.material-symbols-outlined { font-size: 21px; }
.md3-main-content { background: var(--md3-background); }
.md3-navigation-drawer { background: #10121a; border-right-color: #242837; height: 100dvh; overflow-y: hidden; }
.md3-navigation-drawer-header { padding: 26px 22px 18px; min-height: 88px; }
.logo { gap: 10px; }
.logo-icon { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #282342; color: #c1baff; font-size: 24px; }
.logo-text { font-size: 22px; letter-spacing: -.8px; font-weight: 750; }
.brand-caption { display: block; color: #7e879f; font-size: 9px; font-weight: 650; letter-spacing: 2.4px; line-height: 1; margin-top: 6px; }
.backend-badge { margin: 0 18px 10px; padding: 10px 12px; border: 1px solid #294136; border-radius: 9px; background: #15211c; color: #9ed7b8; font-size: 11px; font-weight: 600; line-height: 1.7; }
.backend-badge span { color: #8da99b; font-size: 10px; font-weight: 400; }
.backend-badge::before { content: ''; display: inline-block; width: 6px; height: 6px; background: #6fc99a; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }
.md3-navigation-drawer-content { padding: 0 0 18px; scrollbar-width: thin; }
.nav-section + .nav-section { margin-top: 10px; }
.nav-section-title { padding: 18px 24px 7px; font-size: 9px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: #7d869f; }
.md3-navigation-drawer-item { width: calc(100% - 28px); max-width: calc(100% - 28px); min-height: 44px; margin: 2px 14px; padding: 10px 13px; gap: 12px; border: 1px solid transparent; border-radius: 8px; color: #a7aec1; }
.md3-navigation-drawer-label { font-size: 12px; font-weight: 500; letter-spacing: .1px; }
.md3-navigation-drawer-icon { font-size: 19px; color: #818ba5; }
.md3-navigation-drawer-item.active { background: #25213b; border-color: #383050; color: #ddd7ff; }
.md3-navigation-drawer-item.active .md3-navigation-drawer-icon { color: #c4b8ff; }
.md3-navigation-drawer-item.active::before { display: none; }
.md3-navigation-drawer-item:hover:not(.active) { background: #1b1e2b; }
.md3-navigation-drawer-footer { padding: 12px 16px; border-top: 1px solid #242837; background: #10121a; }
.user-info-card { border: 0; background: transparent; padding: 8px 0; }
.user-avatar { width: 32px; height: 32px; background: #27233d; color: #c9c0ff; border-radius: 9px; }
.md3-navigation-drawer-footer #logout-btn { min-height: 36px; padding: 7px 10px; font-size: 11px; }
.md3-top-app-bar { background: #10121ae8; border-bottom: 1px solid #242837; box-shadow: none; backdrop-filter: blur(12px); }
.md3-top-app-bar-content { padding: 18px 34px; min-height: 76px; gap: 16px; }
.md3-top-app-bar .page-title-dynamic { color: #bbc1d0; font-size: 13px; font-weight: 500; letter-spacing: 0; }
.topbar-context { color: #707a92; font-size: 11px; margin-bottom: 2px; }
.topbar-runtime-pill { background: #181d28; border-color: #2c3447; color: #acb8d4; font-size: 10px; font-weight: 500; padding: 5px 10px; }
.tab-content { padding: 32px 36px 64px !important; background: transparent; }
.content-header { margin-bottom: 26px; align-items: center; }
.page-title { font-size: clamp(26px, 2.5vw, 34px); line-height: 1.2; letter-spacing: -1px; font-weight: 680; margin-bottom: 7px; }
.page-description { color: #949eb5; font-size: 13px; line-height: 1.65; }
.section-kicker, .profile-kicker { font-size: 10px; letter-spacing: 1.8px; font-weight: 650; color: #a89ce5; text-transform: uppercase; margin-bottom: 9px; }
.workspace-note { display: inline-flex; gap: 7px; align-items: center; border: 1px solid #303749; border-radius: 7px; padding: 7px 10px; color: #a4aec6; font-size: 11px; }
.workspace-note .material-symbols-outlined { font-size: 16px; }
.md3-card, .card, .stat-card, .glass-card { background: #151924; border: 1px solid #272d3d; border-radius: 12px; box-shadow: 0 4px 16px #0000000c; backdrop-filter: none; }
.md3-card:hover, .card:hover, .stat-card:hover { transform: none; box-shadow: 0 4px 16px #0000000c; border-color: #333b50; }
.card-header { padding: 20px 22px 16px; margin: 0; border-bottom: 1px solid #272d3d; }
.card-title { font-size: 14px; font-weight: 650; letter-spacing: -.2px; }
.card-body { padding: 22px; }
.card-subtitle { font-size: 12px; color: #949eb5; }
.md3-stat-card, .stat-card { padding: 22px; }
.stat-label { font-size: 11px; color: #a2a9bd; font-weight: 500; }
.stat-value { font-variant-numeric: tabular-nums; letter-spacing: -.8px; }
.md3-stat-icon { font-size: 20px; border-radius: 9px; }
.md3-button { border-radius: 8px; text-transform: none; font-weight: 550; letter-spacing: 0; font-size: 12px; padding: 10px 16px; min-height: 40px; box-shadow: none; gap: 8px; }
.md3-button-filled { background: #8a80e8; color: #100e20; border: 1px solid #9c93f0; box-shadow: none; }
.md3-button-filled:hover:not(:disabled) { background: #a397f6; box-shadow: none; filter: none; }
.md3-button-tonal { background: #24293a; border: 1px solid #333b50; color: #d2d7e5; backdrop-filter: none; }
.md3-button-outlined { border: 1px solid #3b4359; color: #bdc5da; }
.md3-button-text { color: #c2b8ff; }
.md3-button-filled.danger { background: #4b242d; border: 1px solid #733b48; color: #ffb2be; box-shadow: none; }
button:disabled { opacity: .42; }
input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea {
    color: #edf0f8; background: #0f121b; border: 1px solid #343c50; border-radius: 8px; min-height: 42px; padding: 10px 12px; box-shadow: none;
}
input::placeholder, textarea::placeholder { color: #79839d; }
input:focus, select:focus, textarea:focus { border-color: #aa9bf4; box-shadow: 0 0 0 3px #a99bf419; outline: 0; }
label, .md3-input-group label { color: #bac1d3; font-size: 12px; font-weight: 500; margin-bottom: 7px; }
:where(button, a, input, select, textarea):focus-visible { outline: 2px solid #c6b6ff; outline-offset: 3px; }
.player-search-card { border-top: 2px solid #8375d0; }
.player-search-card .card-header { display: flex; align-items: center; gap: 12px; border-bottom: 0; padding-bottom: 0; }
.card-heading-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; color: #c2b4ff; background: #29243f; flex-shrink: 0; }
.player-search-layout { display: flex; align-items: flex-end; gap: 12px; }
.player-search-layout .md3-input-group { margin: 0; flex: 1; min-width: 0; }
.player-search-layout .md3-button { min-height: 44px; flex-shrink: 0; }
.search-hint { margin-top: 11px; font-size: 11px; color: #8691aa; }
#player-search { width: 100%; min-height: 44px; }
#player-results { border: 1px solid #272d3d; border-radius: 12px; background: #11151f; overflow: hidden; }
#player-results > p { padding: 34px 20px; font-size: 12px; }
.table-wrapper { border-radius: 9px; scrollbar-width: thin; }
.md3-data-table, .md3-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.md3-data-table th, .md3-table th { padding: 12px 18px; background: #1c2130; color: #97a3bc; font-size: 10px; font-weight: 600; letter-spacing: .55px; text-transform: uppercase; white-space: nowrap; border-bottom: 1px solid #30384c; }
.md3-data-table td, .md3-table td { padding: 16px 18px; line-height: 1.65; border-bottom: 1px solid #242b3b; font-variant-numeric: tabular-nums; color: #c4ccde; }
.md3-data-table td strong { color: #f0f2fa; font-size: 13px; font-weight: 600; }
.md3-data-table tbody tr:hover { background: #b7a7f506; }
code { font-family: var(--md3-font-family-mono); font-size: .82em; color: #8f9ab3; background: #1d2230; border-radius: 4px; padding: 2px 5px; }
#player-results td:first-child { color: #929eb7; line-height: 1.9; }
#player-results td:first-child code { background: none; padding: 0; font-size: 10px; }
.player-pagination { padding: 12px 16px; border-top: 1px solid #272d3d; background: #171b27; font-size: 11px; color: #929eb7; }
.diagnostic-scope { background: #1d2030; color: #c0bfdc; border-color: #3c3b58; font-size: 12px; }
.profile-overlay { background: #060912bf; backdrop-filter: blur(5px); }
.modal-overlay .modal-content { background: #11151f; border: 1px solid #394259; border-radius: 16px; box-shadow: 0 32px 90px #0008; max-height: 92dvh; }
.player-profile { width: min(100%, 1160px); }
.modal-content .modal-header { background: #151a26; padding: 17px 26px; border-bottom: 1px solid #2b3345; }
.modal-content .modal-header h2 { font-size: 14px; font-weight: 550; letter-spacing: -.1px; }
.modal-content .modal-close { background: #252c3c; color: #aeb9ce; min-height: 36px; min-width: 36px; border-radius: 8px; font-size: 22px; }
.modal-content .modal-body { padding: 26px; }
.player-profile section { margin-bottom: 30px; }
.player-profile h3 { font-size: 14px; font-weight: 600; letter-spacing: -.2px; margin-bottom: 14px; }
.profile-hero { display: flex; align-items: center; gap: 16px; padding: 4px 0 24px; }
.profile-avatar { display: grid; place-items: center; width: 62px; height: 62px; flex-shrink: 0; border-radius: 16px; background: #302743; border: 1px solid #524264; color: #dbbfff; font-size: 24px; font-weight: 650; }
.profile-hero h3, .profile-hero h2 { font-size: 25px; letter-spacing: -.6px; margin: 0 0 5px; }
.profile-hero p { color: #a1aec7; font-size: 12px; overflow-wrap: anywhere; }
.profile-hero .profile-kicker { color: #aa9ae6; font-size: 9px; margin-bottom: 5px; }
.profile-wallet-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 24px; }
.profile-wallet-card { background: #1b2030; border: 1px solid #30384c; border-radius: 10px; padding: 17px; min-width: 0; }
.profile-wallet-card dt, .profile-wallet-card .profile-wallet-label { font-size: 10px; color: #9faac2; margin-bottom: 8px; }
.profile-wallet-card dd, .profile-wallet-card .profile-wallet-value { font-size: clamp(15px,1.7vw,21px); font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.6px; color: #f0edf9; overflow-wrap: anywhere; margin: 0; }
.profile-metadata, .profile-overview { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 0 24px; border: 1px solid #2a3245; border-radius: 10px; padding: 6px 18px; background: #141925; }
.profile-metadata > div, .profile-overview > div { min-width: 0; padding: 14px 0; border-bottom: 1px solid #252d40; }
.profile-metadata dt, .profile-overview dt { color: #8592ad; font-size: 10px; }
.profile-metadata dd, .profile-overview dd { font-size: 12px; line-height: 1.7; margin-top: 5px; color: #c5cfe3; overflow-wrap: anywhere; }
.profile-actions { background: #25191e; border-color: #58313f; border-radius: 10px; padding: 18px; }
.profile-actions p { color: #c1a6b0; font-size: 12px; }
.profile-actions h3 { color: #e3bbc6; }
.player-profile .text-secondary { font-size: 11px; line-height: 1.7; }
#gift-all-controls { border-top-color: #733b48; }
@media (min-width: 769px) {
    .sidebar-close { display: none; }
}
@media (max-width: 1100px) {
    .profile-wallet-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .profile-metadata, .profile-overview { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 768px) {
    .md3-top-app-bar-content { padding: 15px 18px 15px 65px; min-height: 72px; }
    .topbar-context { display: none; }
    .topbar-runtime-pill { font-size: 9px; padding: 5px 8px; }
    .tab-content { padding: 24px 16px 48px !important; }
    .content-header { gap: 14px; margin-bottom: 22px; }
    .workspace-note { display: none; }
    .page-title { font-size: 28px; }
    .card-header { padding: 17px; }
    .card-body { padding: 17px; }
    .player-search-layout { flex-wrap: wrap; }
    .player-search-layout .md3-input-group { flex-basis: 100%; }
    .player-search-layout .md3-button { width: 100%; }
    .modal-content .modal-header { padding: 14px 17px; }
    .modal-content .modal-body { padding: 18px; }
    .profile-hero { gap: 12px; }
    .profile-avatar { width: 48px; height: 48px; border-radius: 12px; font-size: 20px; }
    .profile-hero h3, .profile-hero h2 { font-size: 22px; }
    .profile-wallet-grid { gap: 9px; }
    .profile-wallet-card { padding: 13px; }
    .profile-wallet-card dd, .profile-wallet-card .profile-wallet-value { font-size: 16px; }
    .profile-metadata, .profile-overview { grid-template-columns: 1fr; padding: 4px 15px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* The legacy shell does not define a flex layout for the top bar. */
:root { color-scheme: dark; }
.md3-top-app-bar-content { display: flex; align-items: center; justify-content: space-between; }
.player-search-card .card-header { justify-content: flex-start; }
.player-profile h4 { margin-bottom: 12px; font-size: 12px; color: #b7c2d9; font-weight: 500; }

/* Manual operator monitoring: accountability and daily pipeline health. */
.monitor-toolbar, .monitor-health-summary, .monitor-pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.monitor-toolbar { margin-bottom: 20px; color: #929fb8; font-size: 12px; }
.monitor-filters { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)) auto; gap: 14px; align-items: end; }
.monitor-filters .form-group { margin: 0; min-width: 0; }
.monitor-filters input { min-width: 0; }
.monitor-note, .monitor-status { color: #a1aec7; font-size: 12px; line-height: 1.7; }
.monitor-note { margin-top: 16px; overflow-wrap: anywhere; }
.monitor-status { margin: 20px 0 12px; }
.monitor-empty { padding: 24px; color: #a1aec7; }
.monitor-table-scroll { width: 100%; max-width: 100%; overflow-x: auto; border-radius: 12px; }
.monitor-table { min-width: 900px; width: 100%; }
.monitor-table td { max-width: 300px; white-space: normal; overflow-wrap: anywhere; vertical-align: top; }
.monitor-table small { display: block; margin-top: 6px; color: #8e9bb5; font-size: 11px; overflow-wrap: anywhere; }
.monitor-table code { font-size: 11px; }
.monitor-chip { display: inline-flex; align-items: center; padding: 5px 9px; border: 1px solid #3c455b; border-radius: 999px; font-size: 11px; font-weight: 550; line-height: 1.4; overflow-wrap: anywhere; }
.monitor-chip-good { color: #9cdbba; background: #142e27; border-color: #305344; }
.monitor-chip-bad { color: #ffb4b4; background: #36212a; border-color: #70414d; }
.monitor-chip-neutral { color: #d8c99e; background: #302b22; border-color: #554a34; }
.monitor-pagination { margin-top: 18px; justify-content: flex-end; }
.monitor-health-content { padding: 24px; min-width: 0; }
.monitor-health-summary h2 { margin-bottom: 8px; font-size: 24px; }
.monitor-health-summary p:not(.section-kicker) { color: #9eacc5; font-size: 12px; line-height: 1.6; }
.monitor-metric-grid { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 12px; margin: 22px 0; }
.monitor-metric { padding: 16px; background: #1b2030; border: 1px solid #30384c; border-radius: 10px; min-width: 0; }
.monitor-metric dt { color: #9faac2; font-size: 11px; margin-bottom: 9px; }
.monitor-metric dd { margin: 0; color: #f0edf9; font-size: 23px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.monitor-readiness { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.monitor-section { margin-top: 32px; }
.monitor-section h2 { margin-bottom: 14px; font-size: 18px; }
.monitor-retry-dialog { width: min(95%, 560px); }
.monitor-retry-dialog p { margin-bottom: 14px; line-height: 1.65; overflow-wrap: anywhere; }
@media (max-width: 1100px) { .monitor-filters { grid-template-columns: repeat(2,minmax(0,1fr)); } .monitor-metric-grid { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media (max-width: 600px) { .monitor-filters { grid-template-columns: 1fr; } .monitor-metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .monitor-health-content { padding: 16px; } .monitor-pagination { justify-content: stretch; } .monitor-pagination button { flex: 1; } }

.monitor-chip { white-space: nowrap; overflow-wrap: normal; flex-shrink: 0; }
.monitor-history-table td { white-space: nowrap; overflow-wrap: normal; }

/* Canonical NextWave brand asset, shared by the sidebar and sign-in screen. */
.nextwave-brand-mark { display: block; width: 40px; height: 40px; flex-shrink: 0; object-fit: contain; border-radius: 10px; }
.nextwave-login-mark { display: block; width: 80px; height: 80px; object-fit: contain; margin: 0 auto 16px; border-radius: 18px; }

/* Keep the real brand mark and drawer controls in one unobstructed header. */
.md3-navigation-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 20px 18px;
    min-height: 92px;
    flex-shrink: 0;
}
.md3-navigation-drawer-header .logo { display: flex; align-items: center; gap: 10px; min-width: 0; }
.md3-navigation-drawer-header .logo-text { display: block; white-space: nowrap; }
.md3-navigation-drawer-header .sidebar-close {
    display: none;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid #343c50;
    border-radius: 9px;
    background: #202635;
    color: #c5cee1;
    cursor: pointer;
}
.mobile-menu-toggle {
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid #343c50;
    border-radius: 9px;
    color: #c5cee1;
}
@media (max-width: 768px) {
    .md3-navigation-drawer-header .sidebar-close { display: inline-flex; }
    .mobile-menu-toggle.active { visibility: hidden; pointer-events: none; }
}
