/* Theme toggle button (public menu and back-office header) */
.theme-toggle{margin-left:auto;align-self:center;display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;padding:0;border:1px solid var(--line);border-radius:50%;background:transparent;color:var(--ink);font-size:17px;line-height:1;cursor:pointer;flex-shrink:0}
.theme-toggle:hover{border-color:var(--blue);color:var(--blue)}
.masthead .theme-toggle,.admin-header .theme-toggle,.panel-links .theme-toggle{border-color:rgba(255,255,255,.45);color:#fff}
.masthead .theme-toggle:hover,.admin-header .theme-toggle:hover,.panel-links .theme-toggle:hover{background:rgba(255,255,255,.12);color:#fff}
.masthead-inner{display:flex;align-items:center}

/* ---------- Dark mode ---------- */
:root[data-theme="dark"]{
  color-scheme:dark;
  --blue:#5b9bff;--blue-dark:#0b2a63;--cyan:#38c9ee;
  --ink:#e4e9f1;--muted:#9aa8ba;--line:#2a3648;--wash:#162133;
  --green:#3fcf8e;--red:#ff6b78;
  --win:#43d394;--win-bg:#123528;--loss:#ff7480;--loss-bg:#3a1a20;--draw:#f2c14e;--draw-bg:#3a2f12;
  --surface:#131b28;--surface-2:#1a2435;--surface-3:#22304a;
  background:#0d131d;color:var(--ink);
}
:root[data-theme="dark"] body{background:#0d131d;color:var(--ink)}
:root[data-theme="dark"] a{color:inherit}

/* public site surfaces */
:root[data-theme="dark"] .main-nav,:root[data-theme="dark"] .sidebar-news-card,:root[data-theme="dark"] .sidebar-tips{background:var(--surface)}
:root[data-theme="dark"] .main-nav a{color:var(--ink)}
:root[data-theme="dark"] .main-nav a.active,:root[data-theme="dark"] .main-nav a[aria-current=page]{color:var(--blue)}
:root[data-theme="dark"] .masthead{background:#0a2a6b}
:root[data-theme="dark"] .notice{background:var(--surface-2);border-bottom-color:var(--line)}
:root[data-theme="dark"] .notice-inner{color:var(--muted)}
:root[data-theme="dark"] .icon-button,:root[data-theme="dark"] .league-select,:root[data-theme="dark"] .date-controls input,:root[data-theme="dark"] .skip-link{background:var(--surface-2);color:var(--ink);border-color:var(--line)}
:root[data-theme="dark"] .today-button{background:var(--surface-3);border-color:#35507a;color:var(--ink)}
:root[data-theme="dark"] .label,:root[data-theme="dark"] .league-row td,:root[data-theme="dark"] .nav-label{background:var(--surface-3);color:var(--ink)}
:root[data-theme="dark"] .segmented{background:var(--surface-2)}
:root[data-theme="dark"] tbody tr:hover{background:var(--surface-2)}
:root[data-theme="dark"] footer{background:var(--surface)}
:root[data-theme="dark"] .footer-inner p{color:var(--muted)}
:root[data-theme="dark"] .footer-logo img,:root[data-theme="dark"] .brand-image.footer-logo img{filter:brightness(0) invert(1)}
:root[data-theme="dark"] .history-empty,:root[data-theme="dark"] .article-demo,:root[data-theme="dark"] .article-attribution,:root[data-theme="dark"] .text-lead{background:var(--surface-2);color:var(--ink);border-color:var(--line)}
:root[data-theme="dark"] .result.win{background:var(--win-bg);color:var(--win)}
:root[data-theme="dark"] .result.loss{background:var(--loss-bg);color:var(--loss)}
:root[data-theme="dark"] .result.pending,:root[data-theme="dark"] .result.void{background:var(--surface-3);color:var(--muted)}
:root[data-theme="dark"] .sidebar-news-card>img,:root[data-theme="dark"] .sidebar-tips>img,:root[data-theme="dark"] .article>img,:root[data-theme="dark"] .analysis-thumb{background:var(--surface-2)}
:root[data-theme="dark"] .tip-item,:root[data-theme="dark"] .stat{border-color:var(--line)}

/* fixture table */
:root[data-theme="dark"] .goal-slate-title{background:var(--surface-3);border-color:#35507a;color:var(--ink)}
:root[data-theme="dark"] .goal-table-wrap{border-color:#35507a}
:root[data-theme="dark"] .goal-table th,:root[data-theme="dark"] .goal-table td{border-color:#2b3b55}
:root[data-theme="dark"] .goal-table .goal-league th{background:#0b3f96;border-color:#0b3f96}
:root[data-theme="dark"] .goal-table .goal-columns th{background:#1d2c45;color:#bcd0ee}
:root[data-theme="dark"] .goal-table .goal-match td{background:var(--surface)}
:root[data-theme="dark"] .goal-table .goal-match.alternate td{background:#172234}
:root[data-theme="dark"] .goal-table .goal-match:hover td{background:#1f2d45}
:root[data-theme="dark"] .goal-table .goal-detail td{background:var(--surface-2)}
:root[data-theme="dark"] .goal-table .rank,:root[data-theme="dark"] .goal-table .goal-half,:root[data-theme="dark"] .goal-time small,:root[data-theme="dark"] .goal-table .goal-live{color:var(--muted)}
:root[data-theme="dark"] .goal-table .favorite{color:#ff7a86}
:root[data-theme="dark"] .goal-table .is-live{color:var(--green)}
:root[data-theme="dark"] .goal-table .goal-score,:root[data-theme="dark"] .goal-tip a,:root[data-theme="dark"] .goal-table .goal-verdict strong{color:#8fb8ff}
:root[data-theme="dark"] .goal-table .goal-odds{color:#c3cfdf}
:root[data-theme="dark"] .goal-tip>span,:root[data-theme="dark"] .goal-table .goal-verdict small{color:var(--muted)}
:root[data-theme="dark"] .goal-table .goal-verdict.quick strong{color:#c9d6ea}
:root[data-theme="dark"] .table-icon{color:#8fb8ff}
:root[data-theme="dark"] .table-icon:hover{background:#1f2d45;color:#cfe0ff}
:root[data-theme="dark"] .flag-img{border-color:#3a4a63}

/* back office */
:root[data-theme="dark"] .admin-body{background:#0d131d;color:var(--ink)}
:root[data-theme="dark"] .admin-header{background:#0a2a6b}
:root[data-theme="dark"] .admin-nav{background:var(--surface)}
:root[data-theme="dark"] .admin-icon,:root[data-theme="dark"] .admin-button{background:var(--surface-2);color:var(--ink);border-color:var(--line)}
:root[data-theme="dark"] .admin-button.primary{background:var(--blue);border-color:var(--blue);color:#06142c}
:root[data-theme="dark"] .admin-button.danger{color:var(--red)}
:root[data-theme="dark"] .admin-icon:hover,:root[data-theme="dark"] .admin-table .selected td{background:var(--surface-3)}
:root[data-theme="dark"] .admin-body input,:root[data-theme="dark"] .admin-body select,:root[data-theme="dark"] .admin-body textarea{background:var(--surface-2);color:var(--ink);border-color:#36445b}
:root[data-theme="dark"] .admin-table th{background:var(--surface-2);color:#b6c3d6}
:root[data-theme="dark"] .admin-table .post-row-title{color:var(--ink)}
:root[data-theme="dark"] .admin-field>span{color:#b6c3d6}
:root[data-theme="dark"] .admin-status{background:var(--surface-3);color:#b6c3d6}
:root[data-theme="dark"] .admin-status.published,:root[data-theme="dark"] .admin-status.finished,:root[data-theme="dark"] .admin-status.success,:root[data-theme="dark"] .admin-status.win{background:var(--win-bg);color:var(--win)}
:root[data-theme="dark"] .admin-status.draft,:root[data-theme="dark"] .admin-status.pending,:root[data-theme="dark"] .admin-status.scheduled,:root[data-theme="dark"] .admin-status.idle{background:#16294a;color:#9dc0ff}
:root[data-theme="dark"] .admin-status.failed,:root[data-theme="dark"] .admin-status.error,:root[data-theme="dark"] .admin-status.loss{background:var(--loss-bg);color:var(--loss)}
:root[data-theme="dark"] .admin-status.review,:root[data-theme="dark"] .admin-status.running,:root[data-theme="dark"] .admin-status.live,:root[data-theme="dark"] .admin-status.unapproved{background:var(--draw-bg);color:var(--draw)}
:root[data-theme="dark"] .admin-status.archived,:root[data-theme="dark"] .admin-status.void,:root[data-theme="dark"] .admin-status.cancelled,:root[data-theme="dark"] .admin-status.disabled{background:var(--surface-3);color:var(--muted)}
:root[data-theme="dark"] .studio-cover{background:var(--surface-2)}
:root[data-theme="dark"] .command-card{background:var(--surface);border-color:var(--line)}
:root[data-theme="dark"] .command-control{background:linear-gradient(135deg,#0a3a9a,#0b4fc4)}
:root[data-theme="dark"] .control-row .admin-button.go{background:#fff;color:#0a3a9a;border-color:#fff}
:root[data-theme="dark"] .control-row .admin-button.ghost{background:transparent;color:#fff;border-color:#8fb3f0}
:root[data-theme="dark"] .progress{background:var(--surface-3)}
:root[data-theme="dark"] .fatal{background:var(--loss-bg);color:#ffc2c8}
:root[data-theme="dark"] .provider-option{border-color:var(--line)}
:root[data-theme="dark"] .provider-option:has(input:checked){background:#16294a;border-color:var(--blue)}
:root[data-theme="dark"] .warning-note{background:var(--draw-bg);color:#f5d68a}
:root[data-theme="dark"] .task-list,:root[data-theme="dark"] .task,:root[data-theme="dark"] .league-list{border-color:var(--line)}
:root[data-theme="dark"] .login-card{border-color:var(--line);background:var(--surface)}
