/* ══════════════════════════════════════════════════════════════════
   light-theme.css — authoritative light palette (load LAST).
   Replaces the "sparkling white" surfaces with a low-glare grey stack.
   Specificity html[data-theme="light"] beats every earlier
   [data-theme="light"] !important rule.
   ══════════════════════════════════════════════════════════════════ */

html[data-theme="light"]{
  color-scheme: light;

  --bg-app:#E7EBF1;   --bg-primary:#E7EBF1;
  --bg-secondary:#F2F4F8;
  --bg-surface:#E9ECF2;
  --bg-surface-1:#F2F4F8; --bg-surface-2:#E9ECF2; --bg-surface-3:#DDE2EA;
  --bg-input:#F8F9FC;
  --bg-row-alt:rgba(23,32,46,.038);

  --border:#C7CFDB; --border-subtle:#DBE1EA;
  --border-default:#C7CFDB; --border-strong:#A4AFC0;

  --text-primary:#18212F; --text-secondary:#39465A; --text-tertiary:#5B6879;
  --text-subtle:#5B6879;  --text-muted:#6A7787;    --text-disabled:#93A0B2;

  --accent:#4A54D2; --accent-light:#5A65E6; --accent-2:#C4307A;
  --brand-primary:#4A54D2; --brand-primary-hover:#5A65E6;
  --success:#0E8A56; --color-success:#0E8A56; --color-success-bg:rgba(14,138,86,.10);
  --warning:#A9660A; --color-warning:#A9660A; --color-warning-bg:rgba(169,102,10,.10);
  --error:#C42B2B;   --color-error:#C42B2B;   --color-error-bg:rgba(196,43,43,.10);
  --color-info:#2B5BD7; --color-info-bg:rgba(43,91,215,.10);

  --shadow-xs:0 1px 2px rgba(24,33,47,.06);
  --shadow-sm:0 1px 3px rgba(24,33,47,.08),0 1px 2px rgba(24,33,47,.05);
  --shadow-md:0 4px 12px rgba(24,33,47,.09),0 2px 4px rgba(24,33,47,.05);
  --shadow-lg:0 12px 32px rgba(24,33,47,.12);
  --shadow-xl:0 20px 48px rgba(24,33,47,.16);
  --shadow-glow:0 0 0 3px rgba(74,84,210,.18);

  --sb-track:#D5DBE6; --sb-thumb:#8B96AB;
  --sb-thumb-hover:#6B7891; --sb-thumb-active:#525F77; --sb-border:#E7EBF1;
}

/* ── App background: matte grey, no glare, no animated gradient ── */
html[data-theme="light"] body{
  background:
    radial-gradient(1100px 700px at 10% 0%, rgba(74,84,210,.045), transparent 60%),
    radial-gradient(900px 700px at 100% 10%, rgba(196,48,122,.035), transparent 55%),
    #E7EBF1 !important;
  color: var(--text-primary) !important;
}
html[data-theme="light"] body::before{ display:none !important; }

/* ── Panels / cards / dialogs ── */
html[data-theme="light"] .panel,
html[data-theme="light"] .results-section,
html[data-theme="light"] .user-status-panel,
html[data-theme="light"] .data-entry-panel,
html[data-theme="light"] .subadmin-panel,
html[data-theme="light"] .sidebar-shell,
html[data-theme="light"] .modal-dialog,
html[data-theme="light"] .stats-modal-dialog,
html[data-theme="light"] .export-dialog,
html[data-theme="light"] .sa-modal,
html[data-theme="light"] .fb-group,
html[data-theme="light"] .udlg-box,
html[data-theme="light"] .frd-content,
html[data-theme="light"] .fcd-content,
html[data-theme="light"] .id-popover,
html[data-theme="light"] .ma-cnic-popover,
html[data-theme="light"] .maxpro-scope-dlg,
html[data-theme="light"] .maxpro-colmenu,
html[data-theme="light"] .notif-panel,
html[data-theme="light"] .cp-dialog{
  background:#F2F4F8 !important;
  background-image:none !important;
  color:var(--text-primary) !important;
  border-color:var(--border) !important;
  box-shadow:var(--shadow-sm) !important;
}

/* ── Section headers ── */
html[data-theme="light"] .panel-header,
html[data-theme="light"] .de-header,
html[data-theme="light"] .ss-topbar,
html[data-theme="light"] .results-header,
html[data-theme="light"] .fuse-results-header,
html[data-theme="light"] .modal-header,
html[data-theme="light"] .export-dialog-header,
html[data-theme="light"] .stats-modal-header,
html[data-theme="light"] .fb-group-head{
  background:#E6EAF1 !important;
  background-image:none !important;
  border-bottom-color:var(--border) !important;
}

/* ── Inner surfaces (chips, quota, wallet, cards) ── */
html[data-theme="light"] .status-info-item,
html[data-theme="light"] .quota-chip,
html[data-theme="light"] .quota-detail,
html[data-theme="light"] .file-chip,
html[data-theme="light"] .de-mini-chip,
html[data-theme="light"] .de-summary-chip,
html[data-theme="light"] .kpi-card,
html[data-theme="light"] .card,
html[data-theme="light"] .fb-card,
html[data-theme="light"] .sa-row,
html[data-theme="light"] .cs-item,
html[data-theme="light"] .ct-row,
html[data-theme="light"] .cp-item:hover,
html[data-theme="light"] .fuse-chip,
html[data-theme="light"] .export-stats-chips,
html[data-theme="light"] .ss-tabbar,
html[data-theme="light"] .cost-tabs,
html[data-theme="light"] .de-header-tabs,
html[data-theme="light"] .de-tabgroup .de-header-tabs{
  background:#E4E8F0 !important;
  border-color:var(--border-subtle) !important;
}

/* ── Inputs ── */
html[data-theme="light"] .form-input,
html[data-theme="light"] #manualInput,
html[data-theme="light"] .textarea-wrapper,
html[data-theme="light"] select.server-select,
html[data-theme="light"] .search-box input,
html[data-theme="light"] .fuse-term-input,
html[data-theme="light"] .fuse-field-select,
html[data-theme="light"] .fuse-mode-select,
html[data-theme="light"] .fuse-filter-input,
html[data-theme="light"] .maxpro-filter-box,
html[data-theme="light"] .maxpro-filter-input,
html[data-theme="light"] .col-filter,
html[data-theme="light"] .search-input,
html[data-theme="light"] .sa-input,
html[data-theme="light"] .sa-amt,
html[data-theme="light"] #searchFilter{
  background:#F8F9FC !important;
  color:var(--text-primary) !important;
  border-color:var(--border) !important;
  box-shadow:inset 0 1px 2px rgba(24,33,47,.06) !important;
}
html[data-theme="light"] #lineNumbers{ background:rgba(23,32,46,.05) !important; }
html[data-theme="light"] ::placeholder{ color:#8A96A8 !important; opacity:1; }

/* ── Tables ── */
html[data-theme="light"] .table-container,
html[data-theme="light"] .fuse-table-container,
html[data-theme="light"] .fuse-results-scroll,
html[data-theme="light"] .fuse-basic-container,
html[data-theme="light"] #addrResultsScroll,
html[data-theme="light"] #addrResultsTableWrap,
html[data-theme="light"] .data-table-wrap{
  background:#F2F4F8 !important;
}
html[data-theme="light"] #resultsTableMain thead th,
html[data-theme="light"] #fuseResultsTable thead th,
html[data-theme="light"] #addrResultsTable.maxpro-table thead th,
html[data-theme="light"] .data-compact-table thead th,
html[data-theme="light"] .stats-rel-table thead th,
html[data-theme="light"] table.bt thead th,
html[data-theme="light"] th{
  background:#DEE4EE !important;
  background-image:none !important;
  color:#26313F !important;
  border-bottom-color:var(--accent) !important;
}
html[data-theme="light"] #resultsTableMain tbody td,
html[data-theme="light"] #fuseResultsTable tbody td,
html[data-theme="light"] #addrResultsTable.maxpro-table tbody td,
html[data-theme="light"] .data-compact-table tbody td,
html[data-theme="light"] td{
  color:var(--text-primary) !important;
  border-bottom-color:var(--border-subtle) !important;
  border-right-color:var(--border-subtle) !important;
}
html[data-theme="light"] #resultsTableMain tbody tr:nth-child(even) td,
html[data-theme="light"] #fuseResultsTable tbody tr:nth-child(even) td,
html[data-theme="light"] #addrResultsTable.maxpro-table tbody tr:nth-child(even) td,
html[data-theme="light"] .data-compact-table tbody tr:nth-child(even) td{
  background:rgba(23,32,46,.032) !important;
}
html[data-theme="light"] #resultsTableMain tr:hover td,
html[data-theme="light"] #fuseResultsTable tr:hover td,
html[data-theme="light"] #addrResultsTable.maxpro-table tbody tr:hover td{
  background:rgba(74,84,210,.10) !important;
}
/* status stripes stay, tint removed */
html[data-theme="light"] tr.row-found td{    background-image:linear-gradient(90deg,rgba(14,138,86,.09) 0%,transparent 12%) !important; }
html[data-theme="light"] tr.row-notfound td{ background-image:linear-gradient(90deg,rgba(196,43,43,.08) 0%,transparent 12%) !important; }
html[data-theme="light"] tr.row-error td{    background-image:linear-gradient(90deg,rgba(169,102,10,.09) 0%,transparent 12%) !important; }

/* ── Bars / footers ── */
html[data-theme="light"] .export-bar{
  background:linear-gradient(180deg,rgba(20,184,166,.05),#E6EAF1 60%) !important;
  border-top-color:#0E9384 !important;
}
html[data-theme="light"] .fuse-export-bar,
html[data-theme="light"] .modal-footer,
html[data-theme="light"] .export-dialog-footer,
html[data-theme="light"] .stats-actions,
html[data-theme="light"] .sa-modal-foot{
  background:#E6EAF1 !important;
  box-shadow:0 -3px 10px rgba(24,33,47,.06) !important;
}

/* ── Text hierarchy (kills the low-contrast washed-out look) ── */
html[data-theme="light"] .de-section-label,
html[data-theme="light"] .ss-sub-title,
html[data-theme="light"] .fuse-label-text,
html[data-theme="light"] .si-label,
html[data-theme="light"] .kpi-lbl,
html[data-theme="light"] .qd-k,
html[data-theme="light"] .form-label,
html[data-theme="light"] .stats-section-title,
html[data-theme="light"] .ul-group-title,
html[data-theme="light"] .sa-lbl{ color:#46536A !important; opacity:1 !important; }
html[data-theme="light"] .form-hint,
html[data-theme="light"] .quota-detail-note,
html[data-theme="light"] .fuse-info-line,
html[data-theme="light"] #rateLimitText,
html[data-theme="light"] .status-msg{ color:#5B6879 !important; }

/* ── Overlays ── */
html[data-theme="light"] .udlg-overlay,
html[data-theme="light"] .export-dialog-overlay,
html[data-theme="light"] .stats-modal-overlay,
html[data-theme="light"] .modal-backdrop,
html[data-theme="light"] .sa-modal-bd,
html[data-theme="light"] #creditInfoOverlay,
html[data-theme="light"] #maskedInfoOverlay,
html[data-theme="light"] .fuse-cooldown-dialog,
html[data-theme="light"] .fuse-result-dialog{
  background:rgba(28,36,50,.42) !important;
  backdrop-filter:blur(4px) !important;
}
html[data-theme="light"] dialog.maxpro-scope-dlg::backdrop{ background:rgba(28,36,50,.40) !important; }

/* ── Scrollbars ── */
html[data-theme="light"] *{ scrollbar-color:#8B96AB #D5DBE6; }
html[data-theme="light"] *::-webkit-scrollbar-track{ background:#D5DBE6 !important; }
html[data-theme="light"] *::-webkit-scrollbar-thumb{
  background:linear-gradient(180deg,#9BA6B9,#7C8AA1) !important;
  border:2px solid #E7EBF1 !important; box-shadow:none !important;
}
html[data-theme="light"] *::-webkit-scrollbar-thumb:hover{ background:linear-gradient(180deg,#7C8AA1,#65738C) !important; }
html[data-theme="light"] .table-container::-webkit-scrollbar-thumb,
html[data-theme="light"] .fuse-table-container::-webkit-scrollbar-thumb{
  background:linear-gradient(180deg,#5A65E6,#4A54D2) !important; border-color:#E7EBF1 !important;
}

/* ── Highlight pill: keep it readable, not neon ── */
html[data-theme="light"] .maxpro-term-hl,
html[data-theme="light"] mark.maxpro-term-hl,
html[data-theme="light"] .fuse-hl,
html[data-theme="light"] mark.fuse-hl{
  background:#D8F0A8 !important; color:#1E3305 !important;
  box-shadow:0 0 0 1px #7CA33A !important; animation:none !important;
}

/* ── Admin panel parity ── */
html[data-theme="light"] .users-table tbody tr:nth-child(even) td{ background:rgba(23,32,46,.032) !important; }
html[data-theme="light"] .users-table tbody tr:hover td{ background:rgba(74,84,210,.09) !important; }
html[data-theme="light"] .usr-tabbar{ background:#E6EAF1 !important; }
html[data-theme="light"] .usr-subtabbar,
html[data-theme="light"] .server-acl-list,
html[data-theme="light"] .addr-db-col-list,
html[data-theme="light"] .addr-col-order-list,
html[data-theme="light"] .fuse-fields-grid,
html[data-theme="light"] .addr-field-grid{ background:#E4E8F0 !important; }
html[data-theme="light"] .server-acl-row,
html[data-theme="light"] .addr-db-group,
html[data-theme="light"] .addr-col-order-item,
html[data-theme="light"] .fuse-field-pick,
html[data-theme="light"] .addr-col-pick{ background:#F2F4F8 !important; }
