/* V33.10.11 — Final eye-comfort contrast contract. Loaded after legacy CSS. */
:root{
  --page-bg:#f4f7fa;--bg:#f4f7fa;--panel:#fcfdfd;--card:#fcfdfd;
  --text:#1f2937;--ink:#1f2937;--muted:#6b7280;--line:#e1e7ee;--border:#e1e7ee;
  --input-bg:#ffffff;--header-bg:#173b68;--header-text:#f3f4f6;
}
html[data-theme="light"] body,html[data-theme="system"] body{background:var(--page-bg);color:var(--text)}
html[data-theme="light"] .panel,html[data-theme="light"] .card,html[data-theme="light"] .metric,html[data-theme="light"] .stat,html[data-theme="light"] .topbar,
html[data-theme="system"] .panel,html[data-theme="system"] .card,html[data-theme="system"] .metric,html[data-theme="system"] .stat,html[data-theme="system"] .topbar{background:#fcfdfd;color:var(--text);border-color:var(--border)}
html[data-theme="light"] .timeline-body,html[data-theme="system"] .timeline-body{background:#fafbfd;border-color:#e4e9f0;color:#263241}
html[data-theme="light"] .timeline-title,html[data-theme="system"] .timeline-title{color:#1f2937}
html[data-theme="light"] .timeline-detail,html[data-theme="system"] .timeline-detail{color:#374151}
html[data-theme="light"] .timeline-time,html[data-theme="system"] .timeline-time{color:#6b7280}
html[data-theme="light"] input,html[data-theme="light"] select,html[data-theme="light"] textarea,html[data-theme="system"] input,html[data-theme="system"] select,html[data-theme="system"] textarea{background:#ffffff;color:#1f2937;border-color:#d7e0ea}

html[data-theme="dark"]{
  --page-bg:#0f172a;--bg:#0f172a;--panel:#1e293b;--card:#1e293b;
  --text:#f3f4f6;--ink:#f3f4f6;--muted:#9ca3af;--line:#374151;--border:#374151;
  --input-bg:#172033;--header-bg:#15253c;--header-text:#f3f4f6;color-scheme:dark;
}
html[data-theme="dark"] body{background:radial-gradient(circle at 84% -20%,#26395d 0,transparent 35%),#0f172a!important;color:#f3f4f6!important}
html[data-theme="dark"] .topbar{background:linear-gradient(90deg,#15253c,#1a2d47)!important;color:#f3f4f6!important;border-color:#374151!important}
html[data-theme="dark"] .sidebar{background:linear-gradient(180deg,#142238,#172a43)!important;color:#e5e7eb!important}
html[data-theme="dark"] .sidebar nav a{color:#cbd5e1!important}
html[data-theme="dark"] .sidebar nav a:hover,html[data-theme="dark"] .sidebar nav a.active{background:rgba(148,163,184,.16)!important;color:#f3f4f6!important}
html[data-theme="dark"] .panel,html[data-theme="dark"] .card,html[data-theme="dark"] .metric,html[data-theme="dark"] .stat,html[data-theme="dark"] .content-card,html[data-theme="dark"] .table-card,html[data-theme="dark"] .report-card{background:linear-gradient(145deg,#1e293b,#1b2638)!important;color:#f3f4f6!important;border-color:#374151!important}
html[data-theme="dark"] .panel-head,html[data-theme="dark"] .section-head,html[data-theme="dark"] .table-head,html[data-theme="dark"] thead th{background:#223047!important;color:#e5e7eb!important;border-color:#374151!important}
html[data-theme="dark"] h1,html[data-theme="dark"] h2,html[data-theme="dark"] h3,html[data-theme="dark"] h4,html[data-theme="dark"] h5,html[data-theme="dark"] h6,html[data-theme="dark"] strong{color:#f3f4f6!important}
html[data-theme="dark"] p,html[data-theme="dark"] label,html[data-theme="dark"] small,html[data-theme="dark"] .muted,html[data-theme="dark"] .subtext,html[data-theme="dark"] .message-meta,html[data-theme="dark"] .timeline-time{color:#9ca3af!important}
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]),html[data-theme="dark"] select,html[data-theme="dark"] textarea{background:#172033!important;color:#f3f4f6!important;border-color:#475569!important}
html[data-theme="dark"] input::placeholder,html[data-theme="dark"] textarea::placeholder{color:#94a3b8!important;opacity:1}
html[data-theme="dark"] .timeline:before{background:#374151!important}
html[data-theme="dark"] .timeline-dot{border-color:#1e293b!important;box-shadow:0 0 0 2px #475569!important}
html[data-theme="dark"] .timeline-body,html[data-theme="dark"] .case-message{background:#202d40!important;color:#e5e7eb!important;border-color:#3d4c62!important}
html[data-theme="dark"] .timeline-title{color:#f3f4f6!important}
html[data-theme="dark"] .timeline-detail,html[data-theme="dark"] .case-message>div:last-child{color:#d1d5db!important}
html[data-theme="dark"] .message.in{background:#202d40!important}
html[data-theme="dark"] .message.internal{background:#3a311b!important;color:#f8e7af!important}
html[data-theme="dark"] .status-new{background:#4a2932!important;color:#fecdd3!important}
html[data-theme="dark"] .status-in_progress{background:#40351d!important;color:#fde68a!important}
html[data-theme="dark"] .status-waiting_customer{background:#342b4b!important;color:#ddd6fe!important}
html[data-theme="dark"] .status-resolved,html[data-theme="dark"] .status-closed{background:#1f4336!important;color:#bbf7d0!important}
html[data-theme="dark"] .priority-critical{background:#4a2932!important;color:#fecaca!important}
html[data-theme="dark"] .priority-high{background:#49341f!important;color:#fed7aa!important}
html[data-theme="dark"] .priority-normal{background:#203d5c!important;color:#bfdbfe!important}
html[data-theme="dark"] .priority-low{background:#1f4336!important;color:#bbf7d0!important}
html[data-theme="dark"] .badge,html[data-theme="dark"] .status-pill{border:1px solid rgba(148,163,184,.22)!important}

/* Wallboard: preserve hierarchy without black/white glare. */
html[data-theme="dark"] .wallboard,html[data-theme="dark"] .wallboard-main,html[data-theme="dark"] .wallboard-shell{background:linear-gradient(135deg,#101b30,#182044)!important;color:#f3f4f6!important}
html[data-theme="dark"] .wallboard .metric-card,html[data-theme="dark"] .wallboard .wall-stat,html[data-theme="dark"] .wallboard .wall-card,html[data-theme="dark"] .wallboard .wall-table,html[data-theme="dark"] .wallboard .plan-strip{background:linear-gradient(145deg,#1e293b,#1a2537)!important;border-color:#41516a!important;color:#f3f4f6!important}
html[data-theme="dark"] .wallboard .wall-card small,html[data-theme="dark"] .wallboard .wall-table small,html[data-theme="dark"] .wallboard .plan-strip small{color:#aeb9c8!important;opacity:1!important}
html[data-theme="dark"] .wallboard .plan-card,html[data-theme="dark"] .wallboard .ma-plan-card,html[data-theme="dark"] .wallboard .os-plan-card{background:#243248!important;border-color:#46566e!important;color:#e5e7eb!important}
html[data-theme="light"] .wallboard,html[data-theme="light"] .wallboard-main,html[data-theme="light"] .wallboard-shell{background:#f4f7fa!important;color:#1f2937!important}
html[data-theme="light"] .wallboard .metric-card,html[data-theme="light"] .wallboard .wall-stat,html[data-theme="light"] .wallboard .wall-card,html[data-theme="light"] .wallboard .wall-table,html[data-theme="light"] .wallboard .plan-strip{background:#fcfdfd!important;border-color:#dce5ef!important;color:#1f2937!important}
html[data-theme="light"] .wallboard .plan-card,html[data-theme="light"] .wallboard .ma-plan-card,html[data-theme="light"] .wallboard .os-plan-card{background:#f8fbff!important;border-color:#cfe0f2!important;color:#263241!important}
