/* theme-professional.css - the "Professional" palette.
 *
 * HOW IT ATTACHES (see js/theme.js for the full explanation)
 * Professional is a DARK scheme with a different palette, so the page carries
 * BOTH attributes:  <html data-theme="dark" data-palette="professional">
 *
 * `data-theme="dark"` makes the forty existing dark-mode rules in index.html
 * apply, so nothing has to be duplicated. This file then re-tunes the design
 * tokens, plus the handful of places where index.html hardcoded a dark colour
 * instead of using a token. Because this stylesheet is linked AFTER the inline
 * <style> block, equal-specificity rules here win.
 *
 * The palette: deep slate rather than near-black, a lifted Aventa blue that
 * still reads as Aventa at low luminance, and restrained status accents. Every
 * text/background pair below meets WCAG AA (4.5:1).
 */

[data-palette="professional"] {
  --surface:     #10141C;   /* page base      */
  --white:       #171C26;   /* panels, cards  */
  --border:      #262E3D;
  --dark:        #E6EAF2;   /* primary text - 13.9:1 on --white  */
  --grey:        #9AA5B8;   /* secondary text - 6.4:1 on --white */
  --blue:        #4A90E2;
  --blue-light:  #1C2A3E;
  --green:       #2FA36B;
  --orange:      #E8A33D;
  --red:         #E05A5A;

  /* NOTE: the project swatches are deliberately NOT overridden here. They carry
     white text on a small badge, so they are tuned for contrast against white
     ink rather than against the page - a lighter "nicer on dark" set was tried
     and dropped it to 3.3:1. The shared set in workspace.css is used in all
     four themes. */
}

/* ── Retune the hardcoded dark colours from index.html ──────────────────── */

[data-palette="professional"] body { background: var(--surface); }
[data-palette="professional"] header { background: #141A24; border-bottom: 1px solid var(--border); }
[data-palette="professional"] .sidebar { background: #141A24 !important; border-right-color: var(--border); }

[data-palette="professional"] thead tr { background: #1C2330 !important; }
[data-palette="professional"] tr:hover td { background: #1C2330 !important; }
[data-palette="professional"] td, [data-palette="professional"] th { border-color: var(--border) !important; }

[data-palette="professional"] .date-input {
  background: #1C2330 !important;
  color: var(--dark) !important;
  border-color: var(--border) !important;
}

[data-palette="professional"] .section-header h2,
[data-palette="professional"] h2,
[data-palette="professional"] h3,
[data-palette="professional"] #ai-panel h3 { color: #7FB4FF !important; }

[data-palette="professional"] .btn-action {
  background: #1C2330 !important;
  color: #7FB4FF !important;
  border-color: var(--border) !important;
}
[data-palette="professional"] .btn-action:hover {
  background: #232C3C !important;
  border-color: #7FB4FF !important;
}
[data-palette="professional"] .btn-action.rules:hover {
  background: #232C3C !important;
  border-color: var(--grey) !important;
}
[data-palette="professional"] .btn-primary {
  background: var(--blue) !important;
  color: #0B0F16 !important;
  box-shadow: 0 4px 6px rgba(74, 144, 226, .22) !important;
}
[data-palette="professional"] .btn-primary:hover { background: #5C9EE8 !important; }

[data-palette="professional"] #ai-result { background: #1C2330 !important; color: var(--dark) !important; }
[data-palette="professional"] .md-table th {
  background: #1C2330 !important; color: var(--grey) !important; border-color: var(--border) !important;
}
[data-palette="professional"] .md-table td { border-color: var(--border) !important; color: var(--dark) !important; }

[data-palette="professional"] .badge-ok     { background: #12301F !important; color: #4FC489 !important; }
[data-palette="professional"] .badge-recent { background: #33280F !important; color: #E8B75C !important; }

[data-palette="professional"] .sp-pick:hover { background: #1C2A3E !important; }

/* ── v4.1 surfaces ──────────────────────────────────────────────────────── */

[data-palette="professional"] .sc-good { background: #12301F; color: #4FC489; }
[data-palette="professional"] .sc-warn { background: #33280F; color: #E8B75C; }
[data-palette="professional"] .sc-poor { background: #33220F; color: #E89B5C; }
[data-palette="professional"] .sc-bad  { background: #331A18; color: #EE8078; }
[data-palette="professional"] .sc-none { background: #1C2330; color: var(--grey); }

[data-palette="professional"] .q-due.due-overdue { background: #331A18; color: #EE8078; }
[data-palette="professional"] .q-due.due-soon    { background: #33280F; color: #E8B75C; }
[data-palette="professional"] .q-stale           { background: #33280F; color: #E8B75C; }
[data-palette="professional"] .rd-warn { background: #2B2211; border-color: #5C4A20; color: #E8C98A; }
[data-palette="professional"] .rd-dl-chip.due-overdue { background: #331A18; color: #EE8078; }
[data-palette="professional"] .rd-dl-chip.due-soon    { background: #33280F; color: #E8B75C; }

[data-palette="professional"] .queue-group { background: #141A24; }
[data-palette="professional"] .q-row:hover,
[data-palette="professional"] .q-row.on { background: #1C2A3E; }

[data-palette="professional"] :focus-visible { outline-color: #7FB4FF; }

/* ── White-on-blue does not survive the lifted accent ───────────────────────
 * Professional raises --blue from #0052CC to #4A90E2 so it stays visible on a
 * dark page. That makes it too LIGHT to carry white text: white on #4A90E2 is
 * 3.29:1, under the 4.5:1 minimum. Every control that fills itself with --blue
 * and writes in white therefore flips to dark ink here, which measures 5.9:1.
 * (The header is deliberately not in this list - it fills with #141A24, not
 * --blue, so its text stays white.) */
[data-palette="professional"] .btn-rd.primary,
[data-palette="professional"] .chip.on,
[data-palette="professional"] .asg-tab.is-on,
[data-palette="professional"] .rd-step.done .rd-dot { color: #0B0F16; }
/* v6.24, found by the Aventa Sign browser sweep: the shared hover fill
   (#0041A8, workspace.css) under that dark ink measured 2.12:1. The palette's
   own light accent carries it at 9.0:1. */
[data-palette="professional"] .btn-rd.primary:hover:not(:disabled) { background: #7FB4FF; }
/* v6.26: the mail pair's filled Send, the same two rules. */
[data-palette="professional"] .mail-btn.mail-send { color: #0B0F16; }
[data-palette="professional"] #confirm-modal.is-send .btn-confirm { color: #0B0F16; }
[data-palette="professional"] #confirm-modal.is-send .btn-confirm:hover { background: #7FB4FF; }
[data-palette="professional"] .mail-btn.mail-send:hover:not(:disabled) { background: #7FB4FF; border-color: #7FB4FF; }

/* The identity avatar is the inverse case: blue ink on a white disc, which is
   the same 3.29:1. It becomes a dark disc with light-blue ink (9.0:1). */
[data-palette="professional"] .identity-wrap .who-icon {
  background: #0B0F16;
  color: #7FB4FF;
}
[data-palette="professional"] .role-pill { background: #0B0F16; color: #7FB4FF; }
[data-palette="professional"] .role-pill.mgr { background: #E8B75C; color: #2B1F06; }
