/* V33.10.94 — final dark-mode palette.  Loaded after legacy styles deliberately. */
html[data-theme="dark"]{--bg-main:#161b22;--bg-card:#21262d;--text-primary:#c9d1d9;--text-secondary:#a0a0a0;--text-muted:#8b949e;--border-color:#30363d;--saas-surface:#21262d;--saas-text:#c9d1d9;--saas-muted:#8b949e;--saas-border:#30363d}
html[data-theme="dark"] body,html[data-theme="dark"] .shell,html[data-theme="dark"] main{background:#161b22!important;color:#c9d1d9!important}
html[data-theme="dark"] .sidebar{background:#0d1117!important;border-color:#30363d!important}html[data-theme="dark"] .topbar{background:#161b22!important;border-color:#30363d!important}
html[data-theme="dark"] .sidebar nav a{color:#c9d1d9!important}html[data-theme="dark"] .sidebar nav a:hover,html[data-theme="dark"] .sidebar nav a.active{background:#30363d!important;color:#e0e0e0!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"] .table-card,html[data-theme="dark"] .ref-card,html[data-theme="dark"] .case-reader .panel,html[data-theme="dark"] .case-reader .timeline-body,html[data-theme="dark"] .case-reader .case-message,html[data-theme="dark"] .message{background:#21262d!important;border-color:#30363d!important;color:#c9d1d9!important;box-shadow:none!important}
html[data-theme="dark"] .panel:hover,html[data-theme="dark"] .card:hover,html[data-theme="dark"] .case-reader .timeline-body:hover,html[data-theme="dark"] .case-reader .case-message:hover{background:#30363d!important}
html[data-theme="dark"] .panel-head,html[data-theme="dark"] .section-head,html[data-theme="dark"] .table-head{background:#21262d!important;border-color:#30363d!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:#8b949e!important}
html[data-theme="dark"] h1,html[data-theme="dark"] h2,html[data-theme="dark"] h3,html[data-theme="dark"] b,html[data-theme="dark"] strong,html[data-theme="dark"] .case-reader .timeline-title{color:#c9d1d9!important}
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]),html[data-theme="dark"] select,html[data-theme="dark"] textarea{background:#21262d!important;color:#c9d1d9!important;border-color:#444c56!important}
html[data-theme="dark"] input:focus,html[data-theme="dark"] select:focus,html[data-theme="dark"] textarea:focus{border-color:#58a6ff!important;box-shadow:0 0 0 3px rgba(88,166,255,.15)!important}
html[data-theme="dark"] .case-hero{background:linear-gradient(135deg,#21262d,#1b2027)!important;border-color:#30363d!important;box-shadow:none!important}html[data-theme="dark"] .case-hero h1{color:#e0e0e0!important}html[data-theme="dark"] .case-kicker,html[data-theme="dark"] .case-back,html[data-theme="dark"] .case-meta,html[data-theme="dark"] .case-status small{color:#a0a0a0!important}
html[data-theme="dark"] .case-reader .timeline-detail,html[data-theme="dark"] .case-reader .case-message>div:last-child{color:#c9d1d9!important;border-color:#30363d!important}html[data-theme="dark"] .case-reader .case-message.out,html[data-theme="dark"] .case-reader .timeline-ai-detail div{background:#2d333b!important;color:#c9d1d9!important}
/* Alerts and informational blocks are a subtle lifted surface, never white. */
html[data-theme="dark"] .flash,html[data-theme="dark"] .message.internal,html[data-theme="dark"] .audit-source-note,html[data-theme="dark"] .case-admin-warning,html[data-theme="dark"] .timeline-readonly-bar,html[data-theme="dark"] .inbox-live-ticket-state{background:#2d333b!important;color:#c9d1d9!important;border-color:#444c56!important}
html[data-theme="dark"] .audit-source-note,html[data-theme="dark"] .timeline-readonly-bar{border-left:4px solid #58a6ff!important}html[data-theme="dark"] .case-admin-warning{border-left:4px solid #d29922!important}
/* The control rail mirrors Wallboard's semantic state colours. */
html[data-theme="dark"] .quick-status-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}html[data-theme="dark"] .quick-status-grid form{min-width:0}.quick-status-grid .quick-action{width:100%;min-height:42px!important;border:1px solid transparent!important;border-radius:9px!important;font-weight:800!important;white-space:normal!important;line-height:1.2!important}
html[data-theme="dark"] .quick-status-grid .start{background:rgba(56,189,248,.14)!important;border-color:#38bdf8!important;color:#7dd3fc!important}html[data-theme="dark"] .quick-status-grid .waiting{background:rgba(251,191,36,.14)!important;border-color:#fbbf24!important;color:#fcd34d!important}html[data-theme="dark"] .quick-status-grid .resolved,html[data-theme="dark"] .quick-status-grid .closed{background:rgba(74,222,128,.14)!important;border-color:#4ade80!important;color:#86efac!important}html[data-theme="dark"] .quick-status-grid .reopen{background:rgba(248,113,113,.14)!important;border-color:#f87171!important;color:#fca5a5!important}
html[data-theme="dark"] .status-new{background:rgba(248,113,113,.14)!important;border-color:#f87171!important;color:#fca5a5!important}html[data-theme="dark"] .status-in_progress{background:rgba(56,189,248,.14)!important;border-color:#38bdf8!important;color:#7dd3fc!important}html[data-theme="dark"] .status-waiting_customer{background:rgba(251,191,36,.14)!important;border-color:#fbbf24!important;color:#fcd34d!important}html[data-theme="dark"] .status-resolved,html[data-theme="dark"] .status-closed{background:rgba(74,222,128,.14)!important;border-color:#4ade80!important;color:#86efac!important}
/* Do not let the “move to another Ticket” action collapse into one character per line. */
.case-reader .timeline-attach-existing{display:grid!important;grid-template-columns:minmax(240px,1fr) auto!important;gap:8px!important;align-items:center!important}.case-reader .timeline-attach-existing select{width:100%!important;max-width:none!important;min-width:0!important;height:38px!important}.case-reader .timeline-attach-existing .btn{min-width:132px!important;min-height:38px!important;white-space:nowrap!important}.case-reader .timeline-attach-existing .attach-result{grid-column:1/-1!important;overflow-wrap:anywhere}
@media(max-width:620px){html[data-theme="dark"] .quick-status-grid{grid-template-columns:1fr!important}.case-reader .timeline-attach-existing{grid-template-columns:1fr!important}.case-reader .timeline-attach-existing .btn{width:100%}.case-reader .timeline-attach-existing .attach-result{grid-column:auto!important}}

/* Light mode: a low-glare workspace with white reserved for reading surfaces. */
html[data-theme="light"]{--bg-main:#f3f4f6;--bg-card:#ffffff;--text-primary:#1f2937;--text-secondary:#6b7280;--text-muted:#6b7280;--border-color:#e5e7eb;--saas-surface:#ffffff;--saas-text:#1f2937;--saas-muted:#6b7280;--saas-border:#e5e7eb}
html[data-theme="light"] body,html[data-theme="light"] .shell,html[data-theme="light"] main{background:#f3f4f6!important;color:#1f2937!important}
html[data-theme="light"] .sidebar{background:#ffffff!important;border-color:#e5e7eb!important}html[data-theme="light"] .topbar{background:#f8f9fa!important;border-color:#e5e7eb!important}
html[data-theme="light"] .sidebar nav a{color:#374151!important}html[data-theme="light"] .sidebar nav a:hover,html[data-theme="light"] .sidebar nav a.active{background:#eef4ff!important;color:#1d4ed8!important}
html[data-theme="light"] .panel,html[data-theme="light"] .card,html[data-theme="light"] .metric,html[data-theme="light"] .stat,html[data-theme="light"] .table-card,html[data-theme="light"] .ref-card,html[data-theme="light"] .case-reader .panel,html[data-theme="light"] .case-reader .timeline-body,html[data-theme="light"] .case-reader .case-message,html[data-theme="light"] .message{background:#fff!important;border-color:#e5e7eb!important;color:#1f2937!important;box-shadow:0 5px 16px rgba(31,41,55,.055)!important}
html[data-theme="light"] .panel-head,html[data-theme="light"] .section-head,html[data-theme="light"] .table-head{background:#fff!important;border-color:#e5e7eb!important}
html[data-theme="light"] p,html[data-theme="light"] label,html[data-theme="light"] small,html[data-theme="light"] .muted,html[data-theme="light"] .subtext,html[data-theme="light"] .message-meta,html[data-theme="light"] .timeline-time{color:#6b7280!important}
html[data-theme="light"] h1,html[data-theme="light"] h2,html[data-theme="light"] h3,html[data-theme="light"] b,html[data-theme="light"] strong,html[data-theme="light"] .case-reader .timeline-title{color:#1f2937!important}
html[data-theme="light"] .case-hero{background:linear-gradient(135deg,#ffffff,#f8fafc)!important;border-color:#e5e7eb!important;box-shadow:0 8px 20px rgba(31,41,55,.07)!important}html[data-theme="light"] .case-hero h1{color:#1f2937!important}html[data-theme="light"] .case-kicker,html[data-theme="light"] .case-back,html[data-theme="light"] .case-meta,html[data-theme="light"] .case-status small{color:#6b7280!important}
html[data-theme="light"] .case-reader .timeline-detail,html[data-theme="light"] .case-reader .case-message>div:last-child{color:#333!important;border-color:#e5e7eb!important}html[data-theme="light"] .case-reader .case-message.out,html[data-theme="light"] .case-reader .timeline-ai-detail div{background:#f8f9fa!important;color:#333!important}

/* V33.10.95 — the regular Helpdesk light workspace shares Wallboard's warm, low-glare surface. */
html[data-theme="light"]{--bg-main:#ece8e1;--bg-card:#f8f5ef;--text-primary:#243244;--text-secondary:#627084;--text-muted:#718096;--border-color:#d8d2c8;--saas-surface:#f8f5ef;--saas-text:#243244;--saas-muted:#718096;--saas-border:#d8d2c8}
html[data-theme="light"] body,html[data-theme="light"] .shell,html[data-theme="light"] main{background:#ece8e1!important;color:#243244!important}
html[data-theme="light"] .topbar{background:#f2eee7!important;border-color:#d8d2c8!important}html[data-theme="light"] .sidebar{background:#f8f5ef!important;border-color:#d8d2c8!important}
html[data-theme="light"] .panel,html[data-theme="light"] .card,html[data-theme="light"] .metric,html[data-theme="light"] .stat,html[data-theme="light"] .table-card,html[data-theme="light"] .ref-card,html[data-theme="light"] .case-reader .panel,html[data-theme="light"] .case-reader .timeline-body,html[data-theme="light"] .case-reader .case-message,html[data-theme="light"] .message{background:#f8f5ef!important;border-color:#d8d2c8!important;box-shadow:0 3px 12px rgba(74,62,47,.09)!important}
html[data-theme="light"] .panel-head,html[data-theme="light"] .section-head,html[data-theme="light"] .table-head{background:#f2eee7!important;border-color:#d8d2c8!important}
html[data-theme="light"] .case-hero{background:linear-gradient(135deg,#f8f5ef,#f2eee7)!important;border-color:#d8d2c8!important;box-shadow:0 5px 15px rgba(74,62,47,.1)!important}html[data-theme="light"] .case-reader .case-message.out,html[data-theme="light"] .case-reader .timeline-ai-detail div{background:#f2eee7!important}
/* Semantic status controls: solid, readable colours in every theme. */
.quick-status-grid .quick-action.start{background:#2563eb!important;border-color:#1d4ed8!important;color:#fff!important}.quick-status-grid .quick-action.waiting{background:#e87916!important;border-color:#c95f08!important;color:#fff!important}.quick-status-grid .quick-action.resolved,.quick-status-grid .quick-action.closed{background:#16804b!important;border-color:#0e693d!important;color:#fff!important}.quick-status-grid .quick-action.reopen{background:#2563eb!important;border-color:#1d4ed8!important;color:#fff!important}
.quick-status-grid .quick-action:hover{filter:brightness(1.08)!important;transform:translateY(-1px)}
