/* Unified visual language for everyday operations. */
:root { --control-radius:10px; }
.sidebar { padding:8px 24px; gap:6px 16px; background:var(--surface); backdrop-filter:none; }
.sidebar .brand { min-height:40px; gap:9px; }
.sidebar .brand-mark { height:46px; width:46px; }
.sidebar .brand small { font-weight:var(--fw-medium); }
.sidebar .nav-links { padding:2px 0; gap:5px; }
.nav-links a { border-radius:7px; font-size:var(--fs-sm); font-weight:var(--fw-strong); }
.sidebar .task-scope-select { font-size:var(--fs-md); font-weight:var(--fw-strong); min-width:190px; }
.workspace { padding-top:22px; }
button, input, select { font-size:var(--fs-md); }
.primary-button,.secondary-button,.icon-button,.account-settings > summary,.board-more > summary { border-radius:var(--control-radius); min-height:40px; font-size:var(--fs-md); font-weight:var(--fw-strong); }
.primary-button { background:var(--primary-strong); border:1px solid transparent; box-shadow:0 2px 3px #0b4f5510; }
.primary-button:hover { filter:brightness(1.08); transform:none; }
.secondary-button { box-shadow:none; }
.secondary-button:hover,.icon-button:hover { background:var(--active-surface); border-color:var(--active-border-soft); transform:none; }
.ui-icon { width:18px; height:18px; flex-shrink:0; vertical-align:middle; }
.account-settings > summary { display:flex; gap:7px; align-items:center; padding:8px 12px; }
.notification-button-symbol { border:0; background:transparent; color:inherit; display:grid; place-items:center; width:24px; height:24px; }
.notification-button { background:var(--surface); border:1px solid var(--line); border-radius:10px; }
:root[data-theme="dark"] .notification-button { color:var(--ink); }
:root[data-theme="dark"] .notification-button.has-alerts { background:var(--surface); color:#ffaaa5; border-color:#98504d; }
:root[data-theme="dark"] .notification-button.has-items:not(.has-alerts) { background:var(--active-surface-subtle); color:var(--primary-strong); }
:root[data-theme="dark"] .notification-button:hover { background:var(--surface-soft); }
.notification-button:focus-visible { outline:2px solid var(--primary-strong); outline-offset:3px; }
.board-toolbar { margin-bottom:16px; }
.board-toolbar .filters { gap:10px; align-items:center; }
.board-toolbar #personalActionsToggle { min-width:0; padding:0 12px; font-size:var(--fs-sm); color:var(--muted); }
.board-toolbar #personalActionsToggle[aria-pressed="true"] { color:var(--primary-strong); background:var(--active-surface); }
.board-toolbar #searchInput { border-radius:10px; font-size:var(--fs-md); padding-left:14px; }
.board-toolbar #calendarToggleButton { min-width:0; background:transparent; border-color:transparent; padding:0 10px; font-size:var(--fs-sm); }
.calendar-toggle::before { content:""; display:inline-block; width:17px; height:17px; background:currentColor; mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M7 3v4m10-4v4M3 11h18'/%3E%3C/g%3E%3C/svg%3E") center/contain no-repeat; }
.board-more > summary { border-color:transparent; background:transparent; font-size:var(--fs-sm); padding:10px; }
.view-segments { display:flex; align-items:center; flex-shrink:0; gap:3px; padding:3px; border-radius:10px; background:var(--surface-soft); border:1px solid var(--line); }
.view-segments button { border:0; background:transparent; color:var(--muted); padding:7px 12px; min-height:32px; border-radius:7px; font-size:var(--fs-sm); cursor:pointer; }
.view-segments button[aria-pressed="true"] { background:var(--surface); color:var(--primary-strong); box-shadow:0 1px 3px #17202f18; }
.task-type-segments { width:100%; }
.task-type-segments button { flex:1; min-height:36px; }
.task-type-segments button:disabled { cursor:default; }
.board { gap:16px; }
.board-column { border:0; border-top:3px solid color-mix(in srgb,var(--column-accent) 60%,transparent); border-radius:12px; background:color-mix(in srgb,var(--column-accent) 3%,var(--surface-soft)); padding:12px; }
.column-title { text-transform:none; font-size:var(--fs-md); font-weight:var(--fw-strong); padding:2px 0 8px; margin-bottom:8px; }
.column-name::before { width:7px; height:7px; box-shadow:none; }
.column-count { background:transparent; color:var(--muted); font-weight:var(--fw-medium); }
.task-card { border-radius:10px; border-color:var(--line); box-shadow:0 2px 5px #17202f06; transition:box-shadow .15s,border-color .15s; }
.task-card:hover { border-color:var(--active-border-soft); box-shadow:0 4px 12px #17202f0b; }
.compact-task-main > strong { font-size:var(--fs-md); font-weight:var(--fw-strong); letter-spacing:-.1px; }
.compact-task-meta { color:var(--muted); }
.task-extra > summary { min-height:32px!important; padding-top:7px!important; padding-bottom:7px!important; background:transparent!important; color:var(--muted)!important; }
.task-card .chip.High { background:var(--surface-soft); color:var(--ink); }
.task-card-tools button { width:32px; height:32px; border-radius:8px; }
.task-card-tools button svg { width:17px; height:17px; }
.task-card .task-meta { line-height:1.6; }
.empty-state { font-size:var(--fs-sm); font-weight:var(--fw-regular); border-color:var(--line); background:transparent; color:var(--muted); }
.metric { border:1px solid var(--line); background:var(--surface); box-shadow:none; border-radius:12px; padding:18px 20px; }
.metric::before { width:3px; background:var(--blue); }
.metric:nth-child(2)::before { background:var(--green); }
.metric:nth-child(3)::before,.metric:nth-child(4)::before { background:var(--line-strong); }
.metric.has-risk::before { background:var(--coral); }
.metric span { font-weight:var(--fw-medium); font-size:var(--fs-sm); }
.metric strong { font-size:var(--fs-3xl); font-weight:var(--fw-strong); }
.metric em { font-size:var(--fs-sm); }
.section-heading h2 { font-size:var(--fs-xl); font-weight:var(--fw-strong); letter-spacing:-.35px; }
.eyebrow { font-size:var(--fs-xs); letter-spacing:.7px; font-weight:var(--fw-strong); }
.customer-table { border-radius:12px; }
.customer-column-headings { display:grid; grid-template-columns:minmax(200px,2fr) minmax(140px,1fr) minmax(200px,1fr); gap:16px; padding:12px 18px; color:var(--muted); background:var(--surface-soft); font-size:var(--fs-xs); font-weight:var(--fw-strong); border-bottom:1px solid var(--line); }
.customer-table .customer-card strong { font-weight:var(--fw-strong); }
.customer-table .customer-card { min-height:54px; }
.task-dialog { border-radius:16px; border:1px solid var(--line); }
.task-dialog label > span { font-weight:var(--fw-medium); font-size:var(--fs-sm); }
.task-dialog input,.task-dialog select { border-radius:9px; font-weight:var(--fw-regular); }
.task-dialog input:focus,.task-dialog select:focus { outline:2px solid var(--active-border-strong); outline-offset:2px; box-shadow:none; }
#taskType { width:100%; }
#taskType:only-child { width:100%; }
#taskForm .form-row:has(#taskType) { grid-template-columns:1fr; }
.optional-fields summary { font-size:var(--fs-sm); }
.recurring-card,.employee-kpi-card,.analytics-card,.work-panel { border-radius:12px; }
@media(min-width:1360px) { .sidebar .brand small { max-width:130px; } .nav-links a { padding:0 8px; } .sidebar { gap:10px; } }
@media(max-width:620px) {
  .sidebar { padding:8px 12px; }
  .workspace { padding-top:56px; }
  .sidebar .task-scope-select { min-width:0; }
  .view-segments { width:100%; }
  .view-segments button { flex:1; padding:6px!important; min-height:32px!important; }
  .board-toolbar #personalActionsToggle,.board-toolbar #calendarToggleButton { min-height:40px; }
  .customer-column-headings { display:none; }
  .task-extra > summary { min-height:40px!important; }
  .section-heading h2 { font-size:var(--fs-xl); }
}
@media(prefers-reduced-motion:reduce) { .task-card { transition:none; } }

/* Dark palette: neutral surfaces, one action accent, semantic status colors. */
:root[data-theme="dark"] {
  --canvas:#111519; --canvas-warm:#111519;
  --surface:#1c2228; --surface-soft:#242c33;
  --ink:#e8edf0; --muted:#b2bdc5; --quiet:#96a3ad;
  --line:#343e47; --line-strong:#4a5863;
  --primary:#69d5c0; --primary-strong:#69d5c0;
  --button-primary-bg:#69d5c0; --button-primary-hover:#85e1cf;
  --button-primary-text:#102a26; --button-primary-shadow:none;
  --body-background:#111519; --card-bg:#1c2228; --metric-bg:#1c2228;
  --panel-bg:#1c2228; --panel-surface:#1c2228; --panel-surface-strong:#242c33;
  --panel-border:#343e47; --card-border:#343e47; --card-glass-border:#343e47;
  --active-surface:#253c38; --active-surface-subtle:#20332f;
  --active-border:#3f6b61; --active-border-strong:#69d5c0;
  --active-border-soft:#4a8577; --active-border-faint:#3f6b61;
  --button-hover-bg:#2b353d; --button-hover-border:#61727f;
  --placeholder:#96a3ad; --focus-ring:#69d5c0;
  --danger-bg:#3b2528; --danger-bg-soft:#302327; --danger-bg-pale:#302327;
  --danger-border:#96565c; --danger-text:#ffb1b6; --danger-text-strong:#ffb1b6;
  --dialog-backdrop:rgba(4,8,11,.72); --dialog-shadow:0 24px 70px #0008;
}
:root[data-theme="dark"] .primary-button { background:var(--button-primary-bg); color:var(--button-primary-text); box-shadow:none; }
:root[data-theme="dark"] .primary-button:hover { background:var(--button-primary-hover); filter:none; }
:root[data-theme="dark"] .board-column { background:#171d22; border-top-width:2px; }
:root[data-theme="dark"] .task-card { background:var(--surface); box-shadow:none; }
:root[data-theme="dark"] .task-card:hover { border-color:var(--active-border-soft); box-shadow:none; }
:root[data-theme="dark"] :is(.task-dialog,.inbox-confirm,.reopen-confirm-dialog,.notification-panel,.account-settings-panel,.board-more-menu) { background:var(--surface-soft); color:var(--ink); border:1px solid var(--line-strong); box-shadow:var(--dialog-shadow); }
:root[data-theme="dark"] dialog::backdrop { background:var(--dialog-backdrop); }
:root[data-theme="dark"] :is(input,select,textarea) { background:var(--surface); color:var(--ink); border-color:var(--line-strong); }
:root[data-theme="dark"] :is(input,textarea)::placeholder { color:var(--placeholder); opacity:1; }
:root[data-theme="dark"] :is(button,a,summary,input,select,textarea):focus-visible { outline:2px solid var(--primary); outline-offset:3px; }
:root[data-theme="dark"] :is(.task-meta,.recurring-meta,.compact-task-meta,.project-completion-note,button.content-badge) { font-size:var(--fs-xs); line-height:1.5; font-weight:var(--fw-regular); }
:root[data-theme="dark"] :is(.role-badge,.chip) { font-weight:var(--fw-strong); font-size:var(--fs-xs); }
:root[data-theme="dark"] .role-badge { background:var(--surface-soft); color:var(--muted); }
:root[data-theme="dark"] .inbox-card.selected { border-color:var(--primary); background:var(--active-surface-subtle); }
:root[data-theme="dark"] .inbox-confirm-icon { background:var(--danger-bg); color:var(--danger-text); }
:root[data-theme="dark"] #inboxEditForm:has([value="save"]:not([hidden])) #deleteInbox { color:var(--danger-text); border-color:var(--danger-border); background:var(--danger-bg-soft); }
:root[data-theme="dark"] #inboxEditForm:has([value="save"]:not([hidden])) #deleteInbox:hover { background:var(--danger-bg); border-color:var(--danger-text); }
:root[data-theme="dark"] .inbox-confirm-delete { background:#ae2935; border-color:#d55360; color:#fff; }
:root[data-theme="dark"] .inbox-confirm-delete:hover { background:#c03240; }
:root[data-theme="dark"] .notification-button.has-alerts { background:var(--danger-bg-soft); color:var(--danger-text); border-color:var(--danger-border); }
:root[data-theme="dark"] .notification-button.is-muted { opacity:1; color:var(--muted); }
:root[data-theme="dark"] :is(.icon-button,.notification-button,.task-card-tools button) { min-width:36px; min-height:36px; }
:root[data-theme="dark"] button:disabled { opacity:.5; cursor:not-allowed; }

/* Light themes: neutral working surfaces with restrained accent colors. */
:root:not([data-theme="dark"]) {
  --quiet:#657184; --placeholder:#657184;
  --body-background:#f3f5f6; --canvas:#f3f5f6;
  --card-bg:#ffffff; --metric-bg:#ffffff;
}
:root[data-theme="calm"] {
  --canvas:#f1f0ee; --canvas-warm:#f1f0ee; --body-background:#f1f0ee;
  --surface:#fcfbfa; --surface-soft:#f3f1f0;
  --ink:#343034; --muted:#6d6469; --quiet:#756b71; --placeholder:#756b71;
  --primary:#ae788d; --primary-strong:#8b506a; --button-primary-hover:#77435a;
  --line:#e0dbdc; --line-strong:#c7bdc2;
  --card-bg:#fcfbfa; --metric-bg:#fcfbfa; --card-border:#e0dbdc;
  --card-glass-border:#e0dbdc; --panel-bg:#fcfbfa;
  --panel-surface:#fcfbfa; --panel-surface-strong:#fcfbfa;
  --panel-border:#e0dbdc; --sidebar-border:#e0dbdc;
  --active-surface:#f2e7ec; --active-surface-subtle:#f8f2f5;
  --active-border:#e2cbd5; --active-border-strong:#ae788d;
  --active-border-soft:#bd98a7; --active-border-faint:#e2cbd5;
  --button-hover-bg:#f2eeee; --button-hover-border:#b6a4ae;
  --tool-button-bg:#f7f5f4; --tool-button-border:#c7bdc2;
  --meta-bg:#f3f1f0; --track-bg:#e5dfe2; --track-soft:#f3f1f0;
  --ring-rest:#e5dfe2; --column-muted:#756b71;
  --entry-background:#f1f0ee;
  --danger-bg:#fee9e7; --danger-bg-soft:#fff3f1; --danger-bg-pale:#fff3f1;
  --danger-text:#a12a20; --danger-text-strong:#94251c; --danger-border:#e6aaa3;
  --coral:#bd352a;
  --risk-bg:#fcfbfa; --risk-warning-bg:#fcfbfa; --risk-good-bg:#fcfbfa;
}
:root:not([data-theme="dark"]) .board-column { background:var(--surface-soft); }
:root:not([data-theme="dark"]) :is(input,textarea)::placeholder { color:var(--placeholder); opacity:1; }
:root:not([data-theme="dark"]) .primary-button { background:var(--button-primary-bg); color:var(--button-primary-text); }
:root:not([data-theme="dark"]) .primary-button:hover { background:var(--button-primary-hover); filter:none; }
:root:not([data-theme="dark"]) :is(button,a,summary,input,select,textarea):focus-visible { outline:2px solid var(--primary-strong); outline-offset:3px; }
:root[data-theme="calm"] .inbox-card.selected { border-color:var(--primary-strong); background:var(--active-surface-subtle); }
:root[data-theme="calm"] .role-badge { background:var(--surface-soft); color:var(--muted); }
:root[data-theme="calm"] :is(.task-meta,.recurring-meta,.compact-task-meta,.project-completion-note,button.content-badge) { font-size:var(--fs-xs); line-height:1.5; }
:root[data-theme="calm"] .notification-button.has-alerts { background:var(--danger-bg-soft); color:var(--danger-text); border-color:var(--danger-border); }
