/* PMS design system — follow docs/DESIGN.md. Global styles only; module-specific styles are prefixed .mod-<module>.
   Solid colours, 1px borders, 4/6/8px radii, no gradients/glow/decorative motion. */

/* ---------- Brand tokens (source of truth: docs/DESIGN.md §3 — keep in sync) ---------- */
:root {
  --primary: #315AE7; --primary-hover: #0032B4; --primary-soft: #D6DEFA; --primary-tint: #E9F6FF;
  --accent-violet: #7550E6; --accent-violet-tint: #F1EDFC; --accent-teal-tint: #CAEFE5; --accent-coral-tint: #FFE0DB;
  --bg-app: #EEF1FC; --surface: #FFFFFF; --surface-glass: rgba(255,255,255,0.6); --surface-subtle: #F7F7FC;
  --line: #E2E4F0; --line-2: #EFF0F6;
  --ink: #14142B; --ink-2: #4E4B66; --ink-muted: #6E7191; --ink-placeholder: #A0A3BD;
  --danger: #EA3F4A; --danger-soft: #F8D4D7; --danger-ink: #B3202A;
  --radius-xs: 4px; --radius-md: 8px; --radius-lg: 12px; --radius-xl: 20px; --radius-full: 9999px;
  --shadow-primary: 0 10px 20px rgba(37,79,229,0.15);
  --shadow-card: 0 5px 24px rgba(65,67,78,0.10);
  --shadow-raised: 0 8px 20px rgba(78,75,102,0.15);
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-6: 24px; --space-10: 40px;
  --font-sans: "Helvetica Neue", Helvetica, Arial, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* derived inks for tint badges (contrast ≥ 4.5:1 on their tint) */
  --teal-ink: #0B6B53; --coral-ink: #9A3B1F;
  /* Semantic extension (docs/DESIGN.md §3a — colour psychology): caution = amber, healthy = green */
  --warning: #D97706; --warning-tint: #FEF3C7; --warning-ink: #8A4B00;
  --success: #0E9F6E; --success-tint: var(--accent-teal-tint); --success-ink: var(--teal-ink);
  /* Label colours for solid status / priority cells (F-027). White text on each passes WCAG AA (≥ 5:1); see DESIGN.md §3c. */
  --label-todo: #DCDFEA; --label-progress: #315AE7; --label-review: #7550E6; --label-done: #047857;
  --label-low: #E2E8F0; --label-low-ink: #334155; --label-medium: #475569; --label-high: #C2410C; --label-urgent: #C81E2B; --label-hold: #B45309; --label-support: #0E7490;

  /* Internal aliases used by the component rules below — always point at brand tokens */
  --app-font: var(--font-sans);
  --app-bg: var(--bg-app);
  --app-surface: var(--surface);
  --app-subtle: var(--surface-subtle);
  --app-border: var(--line);
  --app-divider: var(--line-2);
  --app-text: var(--ink);
  --app-muted: var(--ink-muted);
  --app-faint: var(--ink-placeholder);
  --app-primary: var(--primary);
  --app-primary-rgb: 49, 90, 231;
  --app-primary-hover: var(--primary-hover);
  --app-primary-soft: var(--primary-soft);
  --app-sidebar-w: 236px;
  --app-topbar-h: 56px;
  --r-sm: var(--radius-xs); --r-md: var(--radius-md); --r-lg: var(--radius-lg); --r-card: var(--radius-xl);
  --focus: 0 0 0 3px rgba(49, 90, 231, .25);
  --layer-shadow: var(--shadow-raised);

  --bs-body-font-family: var(--app-font);
  --bs-body-font-size: .875rem;
  --bs-body-line-height: 1.5;
  --bs-body-color: var(--app-text);
  --bs-body-bg: var(--app-bg);
  --bs-secondary-color: var(--app-muted);
  --bs-border-color: var(--app-border);
  --bs-border-radius: var(--r-md);
  --bs-border-radius-sm: var(--r-sm);
  --bs-border-radius-lg: var(--r-lg);
  --bs-primary: var(--app-primary);
  --bs-primary-rgb: var(--app-primary-rgb);
  --bs-link-color: var(--app-primary);
  --bs-link-color-rgb: var(--app-primary-rgb);
  --bs-link-hover-color: var(--app-primary-hover);
  --bs-link-hover-color-rgb: 0, 50, 180;
  --bs-link-decoration: none;
  --bs-box-shadow-sm: none;
  --bs-primary-bg-subtle: var(--app-primary-soft);
  --bs-primary-text-emphasis: var(--primary-hover);
  --bs-primary-border-subtle: var(--primary-soft);
}
body { -webkit-font-smoothing: antialiased; background: var(--bg-app); color: var(--ink); font-family: var(--font-sans); }
a { text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
.text-muted { color: var(--app-muted) !important; }
.overdue { color: var(--danger-ink); font-weight: 500; }
.min-w-0 { min-width: 0; }
.ms-n1 { margin-left: -.25rem; }
h1, h2, h3, .h4, .h5, .h6 { color: var(--app-text); letter-spacing: -.01em; }
h1.h4 { font-size: 1.25rem; font-weight: 600; }
h2.h6 { font-size: .9375rem; font-weight: 600; }

/* ---------- Shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.app-sidebar { background: var(--bg-app); border-right: 1px solid var(--line); }
@media (min-width: 992px) {
  .app-sidebar { position: sticky; top: 0; height: 100vh; width: var(--app-sidebar-w); flex: 0 0 var(--app-sidebar-w); overflow-y: auto; }
  .sidebar-hidden .app-sidebar { display: none; }
  .sidebar-hidden .topbar-logo { display: inline-flex; }
}
@media (max-width: 991.98px) { .app-sidebar { --bs-offcanvas-width: 260px; } }
.app-brand { display: flex; align-items: center; height: var(--app-topbar-h); padding: 0 1rem; }
.app-logo { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: var(--radius-md); background: var(--primary); color: #fff; font-size: .875rem; }
.app-brand-name { font-weight: 600; color: var(--app-text); font-size: .9375rem; }
.app-nav { padding: .5rem .5rem 1.25rem; }
.app-nav-label { margin: 1rem .625rem .375rem; font-size: .75rem; font-weight: 500; color: var(--ink-muted); }
.app-nav-link { display: flex; align-items: center; gap: .65rem; height: 36px; padding: 0 .625rem; margin-bottom: 2px; border-radius: var(--radius-md);
  color: var(--ink-muted); font-weight: 500; font-size: .875rem; transition: background-color .12s, color .12s; }
.app-nav-link i { font-size: 1rem; color: var(--ink-muted); width: 1.1rem; text-align: center; }
.app-nav-link:hover { background: var(--surface-glass); color: var(--ink); text-decoration: none; }
.app-nav-link.active { background: var(--surface); color: var(--primary); font-weight: 600; }
.app-nav-link.active i { color: var(--app-primary); }
.topbar-logo { display: none; }
.app-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.app-topbar { position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: .5rem; height: var(--app-topbar-h);
  padding: 0 1.5rem; background: var(--bg-app); border-bottom: 1px solid var(--line); }
.app-topbar-title { font-weight: 500; color: var(--app-muted); font-size: .8125rem; }
.app-content { padding: 1.5rem 1.5rem 3rem; max-width: 1440px; width: 100%; }
.sidebar-hidden .app-content { max-width: 1680px; }
@media (max-width: 575.98px) { .app-content { padding: 1rem .875rem 2rem; } .app-topbar { padding: 0 .75rem; } }

.btn-icon { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border-radius: var(--r-md); color: var(--app-muted);
  border: 1px solid transparent; background: transparent; }
.btn-icon:hover { background: var(--surface-glass); color: var(--ink); }
.btn-icon i { font-size: 1rem; }
.btn-icon.btn-sm { width: 28px; height: 28px; }
.btn-icon.btn-sm i { font-size: .875rem; }
.btn-icon:disabled { opacity: .35; border-color: transparent; }
.notif-dot { position: absolute; top: 2px; right: 0; font-size: .625rem; padding: .15em .4em; border-radius: var(--radius-full) !important; background: var(--danger) !important; color: #fff; }
.notif-menu { width: 22rem; max-width: calc(100vw - 2rem); }
.user-chip { display: flex; align-items: center; gap: .5rem; padding: .25rem .4rem; border: 1px solid transparent; border-radius: var(--r-md); background: none; }
.user-chip:hover { background: var(--surface-glass); }
.timer-chip { display: flex; align-items: center; gap: .4rem; max-width: 26rem; padding: .125rem .125rem .125rem .625rem; border-radius: var(--radius-md);
  background: var(--primary-tint); border: 1px solid var(--primary-soft); }
.timer-chip a { color: var(--primary-hover); font-size: .8125rem; display: flex; align-items: center; gap: .4rem; }
.timer-chip .btn { padding: .1rem .4rem; }
.timer-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.app-flash { border-radius: var(--r-lg); font-size: .875rem; padding: .625rem 2.5rem .625rem .875rem; }
.app-flash .btn-close { padding: .8rem .9rem; }

/* ---------- Avatars (avatar() helper): circles, quiet tints ---------- */
.avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-subtle); color: var(--ink-2);
  font-weight: 600; font-size: .6875rem; flex: 0 0 auto; }
.avatar-sm { width: 22px; height: 22px; font-size: .5625rem; vertical-align: middle; }
.avatar-lg { width: 40px; height: 40px; font-size: .875rem; }
.avatar-c1, .avatar-c5 { background: var(--primary-soft); color: var(--primary-hover); }
.avatar-c2, .avatar-c6 { background: var(--accent-violet-tint); color: var(--accent-violet); }
.avatar-c3, .avatar-c7 { background: var(--accent-teal-tint); color: var(--teal-ink); }
.avatar-c4, .avatar-c8 { background: var(--accent-coral-tint); color: var(--coral-ink); }

/* ---------- Guest pages ---------- */
.guest-body { background: var(--app-bg); min-height: 100vh; }
.guest-content { width: 100%; max-width: 380px; margin: 0 auto; padding: 12vh 1rem 3rem; }
.guest-brand { display: flex; align-items: center; justify-content: center; gap: .5rem; font-weight: 600; font-size: .9375rem; margin-bottom: 1.5rem; }
.auth-card { background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-card); padding: 2rem; }
.auth-card h1 { font-size: 1.125rem; font-weight: 600; }

/* ---------- Page structure ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: .75rem 1rem; margin-bottom: 1.25rem; }
.page-head .subtitle { color: var(--app-muted); font-size: .8125rem; margin: .125rem 0 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .625rem; }
.section-head h2 { margin: 0; }
.section-head a, .section-head .small { font-size: .8125rem; }

/* Every legacy "bg-white rounded shadow-sm" block and .panel: bordered, flat */
.rounded { border-radius: var(--radius-xl) !important; }
.shadow-sm { box-shadow: var(--shadow-card) !important; }
.bg-white.rounded, .panel, .card { border: 0; box-shadow: var(--shadow-card); }
.card { --bs-card-border-radius: var(--radius-xl); --bs-card-border-width: 0; }
.panel { background: var(--surface); border-radius: var(--radius-xl); margin-bottom: 1.25rem; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 52px; padding: .75rem 1.25rem;
  border-bottom: 1px solid var(--line-2); }
.panel-head h2 { margin: 0; font-size: 1rem; font-weight: 600; }
.panel-head .meta, .panel-head a { font-size: .8125rem; }
.panel-body { padding: 1.25rem; }
.panel-foot { padding: .75rem 1.25rem; border-top: 1px solid var(--line-2); font-size: .8125rem; }
.panel > .table-responsive > .table, .panel > .table { margin: 0; }

/* ---------- Buttons & forms ---------- */
.btn { --bs-btn-font-weight: 500; --bs-btn-font-size: .875rem; --bs-btn-border-radius: var(--radius-md); --bs-btn-padding-y: .4375rem; --bs-btn-padding-x: .875rem;
  --bs-btn-focus-box-shadow: var(--focus); line-height: 1.25rem; transition: background-color .12s, border-color .12s, color .12s; }
.btn-sm { --bs-btn-font-size: .8125rem; --bs-btn-padding-y: .3125rem; --bs-btn-padding-x: .75rem; --bs-btn-border-radius: var(--radius-md); line-height: 1.125rem; }
.btn-lg { --bs-btn-font-size: .9375rem; }
.btn-primary { --bs-btn-bg: var(--app-primary); --bs-btn-border-color: var(--app-primary); --bs-btn-hover-bg: var(--app-primary-hover); --bs-btn-hover-border-color: var(--app-primary-hover);
  --bs-btn-active-bg: var(--primary-hover); --bs-btn-active-border-color: var(--primary-hover); --bs-btn-disabled-bg: var(--primary); --bs-btn-disabled-border-color: var(--primary); box-shadow: var(--shadow-primary); }
.btn-outline-primary { --bs-btn-color: var(--primary-hover); --bs-btn-border-color: var(--primary-soft); --bs-btn-bg: var(--primary-soft); --bs-btn-hover-bg: var(--primary-soft); --bs-btn-hover-color: var(--primary);
  --bs-btn-hover-border-color: var(--primary); --bs-btn-active-bg: var(--primary-soft); --bs-btn-active-color: var(--primary); --bs-btn-active-border-color: var(--primary); box-shadow: var(--shadow-primary); }
.btn-outline-secondary, .btn-light { --bs-btn-color: var(--ink-2); --bs-btn-border-color: var(--line); --bs-btn-bg: var(--surface); --bs-btn-hover-bg: var(--surface-subtle); --bs-btn-hover-color: var(--ink);
  --bs-btn-hover-border-color: var(--line); --bs-btn-active-bg: var(--surface-subtle); --bs-btn-active-color: var(--ink); --bs-btn-active-border-color: var(--line); }
.btn-outline-danger { --bs-btn-color: var(--danger-ink); --bs-btn-border-color: var(--danger-soft); --bs-btn-bg: var(--surface); --bs-btn-hover-bg: var(--danger-soft); --bs-btn-hover-color: var(--danger-ink); --bs-btn-hover-border-color: var(--danger-soft); }
.btn-group > .btn-outline-secondary.active, .btn-group > .btn-outline-secondary[aria-current] { background: var(--primary-soft); color: var(--primary-hover); border-color: var(--primary-soft); }
.btn-link { --bs-btn-color: var(--app-primary); text-decoration: none; }
.btn-chip { --bs-btn-color: var(--ink-2); --bs-btn-border-color: var(--line); --bs-btn-bg: var(--surface); --bs-btn-hover-bg: var(--surface-subtle); --bs-btn-hover-border-color: var(--line); }
.btn-check:checked + .btn-chip { background: var(--primary-soft); color: var(--primary-hover); border-color: var(--primary-soft); }
.form-label { font-weight: 500; font-size: .8125rem; color: var(--ink-2); margin-bottom: .375rem; }
.form-control, .form-select { font-size: .875rem; color: var(--ink); border-color: var(--line); border-radius: var(--radius-md); background-color: var(--surface); min-height: 38px; padding-top: .4375rem; padding-bottom: .4375rem; }
.form-control-sm, .form-select-sm { font-size: .8125rem; min-height: 32px; padding-top: .3125rem; padding-bottom: .3125rem; }
.form-control::placeholder { color: var(--app-faint); }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: var(--primary); box-shadow: var(--focus); }
.btn:focus-visible, a:focus-visible, .page-link:focus-visible { box-shadow: var(--focus); outline: none; }
.form-check-input:checked { background-color: var(--app-primary); border-color: var(--app-primary); }
.form-text { font-size: .75rem; color: var(--app-muted); }
.invalid-feedback { font-size: .75rem; }
.input-group-text { background: var(--surface-subtle); border-color: var(--line); color: var(--ink-muted); font-size: .8125rem; }

/* ---------- Tables ---------- */
.table { --bs-table-bg: transparent; margin-bottom: 0; font-size: .8125rem; }
.table > :not(caption) > * > * { padding: .625rem .75rem; border-bottom-color: var(--app-divider); vertical-align: middle; }
.table thead th, .table-light th { background: var(--surface-subtle) !important; color: var(--ink-muted); font-size: .75rem; font-weight: 500;
  border-bottom: 1px solid var(--app-border); white-space: nowrap; text-transform: none; letter-spacing: 0; }
.table tbody tr:hover > * { background: var(--surface-subtle); }
.table a { color: var(--app-text); font-weight: 500; }
.table a:hover { color: var(--app-primary); }
.table-sm > :not(caption) > * > * { padding: .4375rem .625rem; }
.table-responsive.bg-white { overflow: auto; }

/* ---------- Badges ---------- */
.badge { font-weight: 500; border-radius: var(--r-sm); }
.badge-soft { display: inline-flex; align-items: center; gap: .3rem; padding: .125rem .4rem; border-radius: var(--r-sm); font-size: .75rem; font-weight: 500;
  line-height: 1.125rem; white-space: nowrap; border: 1px solid transparent; }
.badge-soft::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-soft.no-dot::before { display: none; }
.badge-soft-primary { background: var(--primary-soft); color: var(--primary-hover); }
.badge-soft-info { background: var(--primary-tint); color: var(--primary-hover); border-color: var(--primary-soft); }
.badge-soft-success { background: var(--accent-teal-tint); color: var(--teal-ink); }
.badge-soft-danger { background: var(--danger-soft); color: var(--danger-ink); }
.badge-soft-warning { background: var(--warning-tint); color: var(--warning-ink); }
.badge-soft-critical { background: var(--danger); color: #fff; font-weight: 600; }
.badge-soft-critical::before { background: #fff; }
.badge-soft-violet { background: var(--accent-violet-tint); color: var(--accent-violet); }
.badge-soft-secondary, .badge-soft-light { background: var(--surface-subtle); color: var(--ink-2); border-color: var(--line-2); }
.badge-soft-dark { background: var(--line); color: var(--ink); }

/* ---------- Tabs, filters ---------- */
.status-tabs { --bs-nav-underline-gap: 1.5rem; --bs-nav-underline-border-width: 2px; border-bottom: 1px solid var(--line); flex-wrap: nowrap; overflow-x: auto; }
.status-tabs .nav-link { color: var(--app-muted); font-weight: 500; font-size: .8125rem; white-space: nowrap; padding: .5rem 0; }
.status-tabs .nav-link:hover { color: var(--app-text); text-decoration: none; }
.status-tabs .nav-link.active { color: var(--primary); border-bottom-color: var(--primary); }
.status-tabs button.nav-link { background: none; border-left: 0; border-right: 0; border-top: 0; }
.tab-count { display: inline-block; min-width: 1.25rem; margin-left: .25rem; padding: 0 .35rem; border-radius: var(--radius-full); background: var(--surface);
  color: var(--app-muted); font-size: .6875rem; font-weight: 500; text-align: center; }
.tab-pane:focus { outline: none; }
.tab-pane:focus-visible { box-shadow: var(--focus); border-radius: var(--r-lg); }
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.input-icon { position: relative; min-width: 14rem; }
.input-icon > i { position: absolute; left: .6rem; top: 50%; transform: translateY(-50%); color: var(--app-faint); font-size: .8125rem; pointer-events: none; }
.input-icon > .form-control { padding-left: 1.85rem; }

/* ---------- Pagination ---------- */
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: .75rem 0 0; }
.pager-info { margin-right: auto; font-size: .8125rem; }
.pagination { --bs-pagination-font-size: .8125rem; --bs-pagination-border-color: var(--line); --bs-pagination-color: var(--ink-2); --bs-pagination-bg: var(--surface); --bs-pagination-hover-bg: var(--surface-subtle);
  --bs-pagination-hover-color: var(--ink); --bs-pagination-active-bg: var(--primary); --bs-pagination-active-color: #fff;
  --bs-pagination-active-border-color: var(--primary); --bs-pagination-focus-box-shadow: var(--focus); --bs-pagination-disabled-color: var(--ink-placeholder); gap: 4px; }
.pagination .page-link { border-radius: var(--radius-md) !important; min-width: 2rem; text-align: center; }
.pagination .page-item.active .page-link { font-weight: 600; }

/* ---------- Progress, KPIs, callouts ---------- */
.progress { --bs-progress-bg: var(--line-2); --bs-progress-border-radius: var(--radius-full); --bs-progress-bar-bg: var(--primary); }
.kpi-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-card); overflow: hidden; }
.kpi { padding: 1.125rem 1.25rem; border-right: 1px solid var(--line-2); color: inherit; }
a.kpi:hover { background: var(--surface-subtle); text-decoration: none; }
.kpi:last-child { border-right: 0; }
.kpi-label { font-size: .75rem; font-weight: 500; color: var(--app-muted); }
.kpi-value { font-size: 1.5rem; font-weight: 600; color: var(--ink); letter-spacing: -.01em; margin-top: .125rem; line-height: 1.3; }
.kpi-of { font-size: .8125rem; font-weight: 400; color: var(--app-muted); }
.kpi-sub { font-size: .75rem; color: var(--app-muted); margin-top: .125rem; }
.kpi .progress { height: 4px; margin-top: .5rem; }
@media (max-width: 575.98px) { .kpi { border-right: 0; border-bottom: 1px solid var(--app-border); } .kpi:last-child { border-bottom: 0; } }
.callout { display: flex; gap: .5rem; align-items: flex-start; padding: .75rem 1rem; border-radius: var(--radius-md); font-size: .8125rem; border: 1px solid transparent; }
.callout > i { margin-top: .1rem; }
.callout-danger { background: var(--danger-soft); color: var(--danger-ink); }
.callout-warning { background: var(--warning-tint); color: var(--warning-ink); }
.callout-info { background: var(--primary-tint); color: var(--primary-hover); }

/* ---------- Lists, empty states, dropdowns ---------- */
.list-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .625rem 0; border-bottom: 1px solid var(--app-divider); }
.list-row:last-child { border-bottom: 0; }
.list-group { --bs-list-group-bg: transparent; --bs-list-group-border-color: var(--app-divider); }
.row-actions { gap: 2px; }
.empty-state { text-align: center; padding: 2rem 1rem; color: var(--app-muted); }
.empty-state .empty-icon { color: var(--app-faint); font-size: 1.25rem; margin-bottom: .5rem; }
.dropdown-menu { --bs-dropdown-border-color: var(--line-2); --bs-dropdown-border-radius: var(--radius-lg); --bs-dropdown-link-active-bg: var(--primary-soft);
  --bs-dropdown-link-active-color: var(--primary-hover); --bs-dropdown-link-hover-bg: var(--surface-subtle); --bs-dropdown-font-size: .8125rem; --bs-dropdown-item-padding-y: .375rem; box-shadow: var(--layer-shadow); }
.modal-content { border-radius: var(--radius-xl); border: 0; box-shadow: var(--shadow-raised); }
.alert { border-radius: var(--radius-md); border: 0; }
.alert-success { background: var(--accent-teal-tint); color: var(--teal-ink); }
.alert-danger { background: var(--danger-soft); color: var(--danger-ink); }
.alert-warning { background: var(--warning-tint); color: var(--warning-ink); }
.alert-info { background: var(--primary-tint); color: var(--primary-hover); }

/* ---------- Sectioned forms ---------- */
.form-narrow { max-width: 1040px; }
.form-section { display: grid; grid-template-columns: 220px 1fr; gap: 1.5rem; padding: 1.25rem 0; border-top: 1px solid var(--app-border); }
.form-section:first-of-type { border-top: 0; padding-top: 0; }
.form-section-head h2 { margin-bottom: .25rem; font-size: .875rem; }
.form-section-head p { color: var(--app-muted); font-size: .8125rem; margin: 0; }
.form-section .bg-white { padding: 1.25rem 1.25rem .5rem !important; }
@media (max-width: 991.98px) { .form-section { grid-template-columns: 1fr; gap: .5rem; } }
.form-actions { display: flex; justify-content: flex-end; gap: .5rem; padding: 1rem 0 0; border-top: 1px solid var(--app-border); }
.member-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .375rem; max-height: 260px; overflow-y: auto; padding-bottom: .75rem; }
.member-option { display: flex; align-items: center; gap: .5rem; padding: .5rem .625rem; border: 1px solid var(--line); border-radius: var(--radius-md); cursor: pointer; font-size: .8125rem; }
.member-option:hover { background: var(--surface-subtle); }
.member-option:has(input:checked) { border-color: var(--primary-soft); background: var(--primary-tint); }
.member-option .form-check-input { margin: 0; flex: 0 0 auto; }

/* ---------- Charts (dataviz rules: validated palette, thin marks, legend/table view) ---------- */
.viz { --series-1: #257de0; --series-2: #f47230; --series-3: #00b894; --series-4: #f2a600; --series-5: #ee7fac; --series-6: #008a17; }
.seg-bar { display: flex; gap: 2px; height: 10px; border-radius: 2px; overflow: hidden; }
.seg-bar > span { min-width: 3px; }
.viz-legend { display: grid; grid-template-columns: 1fr; gap: .25rem; margin-top: .75rem; font-size: .8125rem; }
.viz-legend a { display: flex; align-items: center; color: var(--app-text); padding: .125rem 0; }
.viz-legend .sw { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: .5rem; }
.viz-legend .n { margin-left: auto; font-weight: 500; font-variant-numeric: tabular-nums; }
.cols { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; align-items: end; height: 130px; padding-top: 1.1rem; border-bottom: 1px solid var(--line); }
.col { position: relative; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; padding: 0 22%; outline: none; }
.col .bar { width: 100%; border-radius: 4px 4px 0 0; background: var(--primary-soft); }
.col .bar.zero { height: 1px !important; background: var(--line); }
.col.is-today .bar { background: var(--primary); }
.col .val { position: absolute; left: 0; right: 0; text-align: center; font-size: .6875rem; font-weight: 500; color: var(--app-text); margin-bottom: 2px; }
.col .tip { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); white-space: nowrap; background: var(--ink); color: #fff;
  font-size: .75rem; padding: .25rem .5rem; border-radius: var(--r-sm); opacity: 0; pointer-events: none; z-index: 5; }
.col:hover .tip, .col:focus-visible .tip { opacity: 1; }
.col:focus-visible { box-shadow: var(--focus); border-radius: var(--r-sm); }
.col-labels { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-top: .375rem; font-size: .6875rem; color: var(--app-muted); text-align: center; }
.col-labels .is-today { color: var(--app-text); font-weight: 600; }

/* ---------- Kanban (Tasks) ---------- */

/* ---------- Ticket conversation (Support/_thread) ---------- */
.thread-item { display: flex; gap: .75rem; padding: .75rem 0; border-bottom: 1px solid var(--app-divider); }
.thread-internal { background: var(--accent-coral-tint); margin: 0 -1rem; padding-left: 1rem; padding-right: 1rem; border-bottom-color: transparent; }
.thread-body { margin-top: .25rem; overflow-wrap: anywhere; }
.attach-chip { display: inline-flex; align-items: center; gap: .35rem; margin: 0 .35rem .35rem 0; padding: .25rem .5rem; border: 1px solid var(--app-border);
  border-radius: var(--r-md); font-size: .8125rem; color: var(--ink); background: var(--surface); }
.attach-chip:hover { background: var(--surface-subtle); text-decoration: none; }
.thread-form { border-top: 1px solid var(--app-border); padding-top: .75rem; margin-top: .25rem; }
#documents .list-row, #team .list-row { padding: .5rem 0; }
.milestone-row { border-color: var(--app-divider); }

/* F-200 Gantt / timeline (Deadlines/gantt). Bars are positioned with inline left/width percentages. */
.mod-deadlines.gantt { --label-w: 16rem; font-size: .8rem; }
.mod-deadlines .gantt-row { display: flex; align-items: center; min-height: 1.9rem; border-bottom: 1px solid var(--bs-border-color-translucent); }
.mod-deadlines .gantt-label { flex: 0 0 var(--label-w); padding: .15rem .5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mod-deadlines .gantt-label.sub { padding-left: 1.5rem; }
.mod-deadlines .gantt-track { position: relative; flex: 1 1 auto; height: 1.9rem; }
.mod-deadlines .gantt-bar { position: absolute; top: .45rem; height: 1rem; border-radius: .25rem; min-width: 4px; }
.mod-deadlines .gantt-bar.overdue { outline: 2px solid var(--bs-danger); outline-offset: 1px; }
.mod-deadlines .gantt-bar.window-planned { background: var(--bs-secondary-bg); border: 1px dashed var(--bs-secondary); }
.mod-deadlines .gantt-bar.window-actual { background: var(--bs-info-bg-subtle); border: 1px solid var(--bs-info); }
.mod-deadlines .gantt-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--bs-danger); opacity: .6; pointer-events: none; z-index: 2; }
.mod-deadlines .gantt-ms { position: absolute; top: .5rem; width: .8rem; height: .8rem; transform: translateX(-50%) rotate(45deg); border: 1px solid var(--bs-dark); z-index: 3; }
.mod-deadlines .gantt-months .gantt-track { height: 1.5rem; }
.mod-deadlines .gantt-month { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--bs-border-color); padding-left: .25rem; color: var(--bs-secondary-color); white-space: nowrap; overflow: hidden; }
.mod-deadlines .gantt-body { position: relative; }


/* ---------- Legacy module cards → panel look (title row becomes a header bar) ----------
   Matches "bg-white rounded … p-3" blocks whose first child is the title (h2.h6) or a title row (d-flex justify-content-between). */
h2.h6 { font-size: 1rem; }
.bg-white.rounded.p-3 { padding: 1.25rem; margin-bottom: 1.25rem; }
.bg-white.rounded.p-3 > h2.h6:first-child,
.bg-white.rounded.p-3 > .d-flex.justify-content-between:first-child { margin: -1.25rem -1.25rem 1rem !important; padding: .75rem 1.25rem; min-height: 52px;
  border-bottom: 1px solid var(--line-2); align-items: center !important; }
.bg-white.rounded.p-3 > h2.h6:first-child { display: flex; align-items: center; }
.bg-white.rounded.p-3 > .d-flex.justify-content-between:first-child h2 { margin: 0; }
.bg-white.rounded.p-3 > .d-flex.justify-content-between:first-child a:not(.btn) { font-size: .8125rem; }

/* ---------- F-035 / F-090 work controls (Attendance/_worktime) ---------- */
.font-tabular { font-variant-numeric: tabular-nums; }
.idle-chip { display: inline-flex; align-items: center; gap: .35rem; height: 32px; padding: 0 .625rem; border-radius: var(--radius-md);
  background: var(--warning-tint); color: var(--warning-ink); font-size: .8125rem; border: 1px solid #FDE68A; }
.quick-start { width: 20rem; max-width: calc(100vw - 2rem); }
.timer-chip .btn-light { --bs-btn-bg: var(--surface); --bs-btn-border-color: transparent; color: var(--danger-ink); }

/* ---------- SweetAlert2 pop-ups (App.swal / toast / message / confirm) — brand tokens, no animation ---------- */
.swal2-container { font-family: var(--font-sans); }
.swal2-container.swal2-backdrop-show { background: rgba(20, 20, 43, .35); }
.swal-app.swal2-popup { width: 26rem; padding: 1.5rem 1.5rem 1.25rem; border-radius: var(--radius-xl); background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-raised); animation: none !important; }
.swal-app .swal-app-icon.swal2-icon { width: 44px; height: 44px; margin: .25rem auto .75rem; border: 0; border-radius: var(--radius-lg); font-size: 1.35rem; animation: none !important; }
.swal-app .swal-app-icon .swal2-icon-content { font-size: 1.35rem; }
.swal-app-icon-success { background: var(--accent-teal-tint); color: var(--teal-ink) !important; }
.swal-app-icon-danger, .swal-app-icon-error { background: var(--danger-soft); color: var(--danger-ink) !important; }
.swal-app-icon-warning { background: var(--warning-tint); color: var(--warning-ink) !important; }
.swal-app-icon-info, .swal-app-icon-question { background: var(--primary-tint); color: var(--primary-hover) !important; }
.swal-app .swal-app-title { padding: 0; font-size: 1.0625rem; font-weight: 600; color: var(--ink); }
.swal-app .swal-app-text { margin: .5rem 0 0; padding: 0; font-size: .875rem; color: var(--ink-2); white-space: pre-line; }
.swal-app .swal-app-actions { gap: .5rem; margin-top: 1.25rem; width: 100%; justify-content: center; }
.swal-app .swal-app-actions .btn { min-width: 6.5rem; }
.btn-danger { --bs-btn-bg: var(--danger); --bs-btn-border-color: var(--danger); --bs-btn-hover-bg: var(--danger-ink); --bs-btn-hover-border-color: var(--danger-ink);
  --bs-btn-active-bg: var(--danger-ink); --bs-btn-active-border-color: var(--danger-ink); }
/* toast */
.swal2-container.swal2-top-end { padding: 1rem; }
.swal-app-toast.swal2-popup.swal2-toast { width: 22rem; max-width: calc(100vw - 2rem); padding: .625rem .875rem; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-raised); animation: none !important; }
.swal-app-toast .swal-app-icon.swal2-icon { width: 28px; height: 28px; min-width: 28px; margin: 0 .625rem 0 0; font-size: .95rem; border-radius: var(--radius-md); }
.swal-app-toast .swal-app-icon .swal2-icon-content { font-size: .95rem; }
.swal-app-toast .swal-app-title { margin: 0; padding: 0; font-size: .875rem; font-weight: 500; text-align: left; align-self: center; }
.swal2-toast .swal2-timer-progress-bar { display: none; }

/* ======================================================================
   Modern inputs (all fields share one look) + searchable selects + date picker
   ====================================================================== */
.form-control, .form-select, .flatpickr-input.form-control {
  min-height: 40px; padding: .5rem .75rem; border: 1px solid var(--line); border-radius: var(--radius-md); background-color: var(--surface);
  color: var(--ink); font-size: .875rem; transition: border-color .12s, box-shadow .12s; }
.form-control-sm, .form-select-sm { min-height: 34px; padding: .3125rem .625rem; font-size: .8125rem; }
.form-control:hover, .form-select:hover { border-color: #C9CCE0; }
.form-control:focus, .form-select:focus, .ts-wrapper.form-select.focus { border-color: var(--primary); box-shadow: var(--focus); outline: 0; }
.form-control:disabled, .form-select:disabled { background: var(--surface-subtle); color: var(--ink-placeholder); }
textarea.form-control { min-height: 96px; line-height: 1.5; }
.form-control[type="file"] { padding: .3125rem; }
.form-control::file-selector-button { margin: -.3125rem .75rem -.3125rem -.3125rem; padding: .5rem .875rem; border: 0; border-right: 1px solid var(--line);
  background: var(--primary-tint); color: var(--primary-hover); font-weight: 500; }
.form-control:hover:not(:disabled)::file-selector-button { background: var(--primary-soft) !important; }
.form-check-input { width: 1.125rem; height: 1.125rem; border: 1.5px solid #C2C5DA; border-radius: 5px; margin-top: .15em; }
.form-check-input[type="radio"] { border-radius: 50%; }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.form-switch .form-check-input { width: 2.25rem; border-radius: var(--radius-full); }
.form-check-label { color: var(--ink-2); }
.invalid-feedback.d-block { color: var(--danger-ink); font-weight: 500; }
.form-control.is-invalid, .was-validated .form-control:invalid { border-color: var(--danger); }

/* Tom Select (searchable dropdowns) */
.ts-wrapper.form-select { padding: 0 !important; min-height: 40px; }   /* the wrapper is the bordered box; chevron comes from .form-select */
.ts-wrapper.form-select-sm { min-height: 34px; }
.filter-bar .ts-wrapper.form-select { min-width: 9.5rem; }
.ts-wrapper.form-select .ts-control { min-height: 38px; padding: .5rem .75rem; border: 0; background: transparent; color: var(--ink); cursor: pointer; box-shadow: none; }
.ts-wrapper.form-select-sm .ts-control { min-height: 32px; padding: .3125rem .625rem; font-size: .8125rem; }
.ts-wrapper.form-select.multi .ts-control { padding: .3125rem .5rem; }
.ts-wrapper .ts-control > input { font-size: inherit; color: var(--ink); }
.ts-wrapper .ts-control > input::placeholder, .ts-wrapper .ts-control .placeholder { color: var(--ink-placeholder); }
.ts-wrapper.multi .ts-control { gap: 4px; }
.ts-wrapper.multi .ts-control > .item { margin: 0; padding: .125rem .25rem .125rem .5rem; border: 0; border-radius: var(--radius-xs); background: var(--primary-tint);
  color: var(--primary-hover); font-size: .8125rem; font-weight: 500; }
.ts-wrapper.multi .ts-control > .item .remove { border-left: 0; margin-left: .25rem; padding: 0 .25rem; color: var(--primary-hover); }
.ts-wrapper.multi .ts-control > .item .remove:hover { background: var(--primary-soft); }
.ts-dropdown { margin-top: 4px; border: 1px solid var(--line-2); border-radius: var(--radius-lg); box-shadow: var(--shadow-raised); background: var(--surface);
  font-size: .875rem; z-index: 1080; overflow: hidden; }
.ts-dropdown .ts-dropdown-content { max-height: 280px; padding: .25rem; }
.ts-dropdown .option { padding: .5rem .625rem; border-radius: var(--radius-md); color: var(--ink); }
.ts-dropdown .option.active { background: var(--primary-tint); color: var(--primary-hover); }
.ts-dropdown .option.selected { font-weight: 600; }
.ts-dropdown .optgroup-header { padding: .5rem .625rem .25rem; font-size: .75rem; font-weight: 600; color: var(--ink-muted); background: none; }
.ts-dropdown .dropdown-input-wrap { padding: .5rem .5rem 0; }
.ts-dropdown .dropdown-input { border: 1px solid var(--line); border-radius: var(--radius-md); padding: .4375rem .625rem; }
.ts-dropdown .no-results { padding: .625rem; color: var(--ink-muted); }
.ts-dropdown .option .form-check-input, .ts-dropdown [data-selectable] .form-check-input { margin-right: .5rem; }

/* flatpickr (date picker) */
.flatpickr-calendar { border: 1px solid var(--line-2); border-radius: var(--radius-lg); box-shadow: var(--shadow-raised); font-family: var(--font-sans); }
.flatpickr-calendar.arrowTop::before, .flatpickr-calendar.arrowTop::after { display: none; }
.flatpickr-months .flatpickr-month { color: var(--ink); height: 40px; }
.flatpickr-current-month { font-size: .9375rem; font-weight: 600; }
.flatpickr-weekday { color: var(--ink-muted); font-weight: 500; font-size: .75rem; }
.flatpickr-day { border-radius: var(--radius-md); color: var(--ink); font-size: .8125rem; }
.flatpickr-day:hover { background: var(--surface-subtle); border-color: var(--surface-subtle); }
.flatpickr-day.today { border-color: var(--primary-soft); }
.flatpickr-day.selected, .flatpickr-day.selected:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.flatpickr-day.flatpickr-disabled, .flatpickr-day.prevMonthDay, .flatpickr-day.nextMonthDay { color: var(--ink-placeholder); }
.flatpickr-months .flatpickr-prev-month:hover svg, .flatpickr-months .flatpickr-next-month:hover svg { fill: var(--primary); }

/* ======================================================================
   Colour psychology — one meaning per colour (docs/DESIGN.md §3a)
   red = critical / overdue / destructive · amber = caution / due soon / idle · blue = in progress / action ·
   green = done / healthy · grey = not started / low
   ====================================================================== */
.text-critical { color: var(--danger-ink) !important; font-weight: 600; }
.text-caution { color: var(--warning-ink) !important; font-weight: 600; }
.text-healthy { color: var(--success-ink) !important; font-weight: 600; }
.overdue { color: var(--danger-ink); font-weight: 600; }
/* row accents: a 3px bar on the first cell so problem rows stand out when scanning */
tr.row-overdue > *:first-child { box-shadow: inset 3px 0 0 var(--danger); }
tr.row-attention > *:first-child { box-shadow: inset 3px 0 0 var(--warning); }
tr.row-done > * { color: var(--ink-muted); }
/* KPI cells that need action */
.kpi.is-critical { box-shadow: inset 0 3px 0 var(--danger); }
.kpi.is-critical .kpi-value { color: var(--danger-ink); }
.kpi.is-caution { box-shadow: inset 0 3px 0 var(--warning); }
.kpi.is-caution .kpi-value { color: var(--warning-ink); }
.kpi.is-healthy .kpi-value { color: var(--success-ink); }
/* progress meaning */
.progress-bar.is-done { background: var(--success) !important; }
.progress-bar.is-caution { background: var(--warning) !important; }
.progress-bar.is-critical { background: var(--danger) !important; }


/* ======================================================================
   F-027 Task table — grouped, edit-in-place list (Tasks/index, task-table.js)
   ====================================================================== */
.btn-ghost { background: transparent; border: 1px solid transparent; color: var(--ink-2); font-weight: 500; display: inline-flex; align-items: center; gap: .375rem; }
.btn-ghost:hover, .btn-ghost[aria-expanded="true"] { background: var(--surface-subtle); color: var(--ink); }
.btn-ghost.is-active { background: var(--primary-tint); color: var(--primary-hover); }
.avatar-xs { width: 20px; height: 20px; font-size: .5rem; }

/* label colours (cells, legend dots, summary bars, pickers) */
.cell-status-todo { --fill: var(--label-todo); --fill-ink: var(--ink); background: var(--fill); color: var(--fill-ink); }
.cell-status-in_progress { --fill: var(--label-progress); --fill-ink: #fff; background: var(--fill); color: var(--fill-ink); }
.cell-status-review { --fill: var(--label-review); --fill-ink: #fff; background: var(--fill); color: var(--fill-ink); }
.cell-status-done { --fill: var(--label-done); --fill-ink: #fff; background: var(--fill); color: var(--fill-ink); }
.cell-priority-low { --fill: var(--label-low); --fill-ink: var(--label-low-ink); background: var(--fill); color: var(--fill-ink); }
.cell-priority-medium { --fill: var(--label-medium); --fill-ink: #fff; background: var(--fill); color: var(--fill-ink); }
.cell-priority-high { --fill: var(--label-high); --fill-ink: #fff; background: var(--fill); color: var(--fill-ink); }
.cell-priority-urgent { --fill: var(--label-urgent); --fill-ink: #fff; background: var(--fill); color: var(--fill-ink); }
.tone-status-todo { --tone: #A0A3BD; --tone-ink: var(--ink-2); }
.tone-status-in_progress { --tone: var(--label-progress); }
.tone-status-review { --tone: var(--label-review); }
.tone-status-done { --tone: var(--label-done); }
.tone-priority-urgent { --tone: var(--label-urgent); }
.tone-priority-high { --tone: var(--label-high); }
.tone-priority-medium { --tone: var(--label-medium); }
.tone-priority-low { --tone: #94A3B8; --tone-ink: var(--label-medium); }
.tone-project, .tone-all { --tone: var(--primary); }
.tt-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; margin-right: .5rem; vertical-align: -1px; }

/* toolbar */
.tt-board > .panel-body { padding: 1.25rem 1.5rem 1.5rem; }
.tt-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem .5rem; margin-bottom: 1.25rem; }
.tt-toolbar .btn-group > .btn { box-shadow: none; }
.tt-search { position: relative; }
.tt-search > i { position: absolute; left: .625rem; top: 50%; transform: translateY(-50%); color: var(--ink-muted); font-size: .8125rem; pointer-events: none; }
.tt-search .form-control { width: 150px; padding-left: 1.875rem; min-height: 32px; border-color: transparent; background: transparent; }
.tt-search .form-control:hover { background: var(--surface-subtle); }
.tt-search .form-control:focus, .tt-search .form-control:not(:placeholder-shown) { width: 240px; background: var(--surface); border-color: var(--line); }
.tt-menu { min-width: 220px; max-height: 360px; overflow-y: auto; padding: .375rem; }
.tt-menu .dropdown-item { display: flex; align-items: center; border-radius: var(--radius-md); padding: .4375rem .625rem; font-size: .8125rem; }
.tt-menu .dropdown-item.active { background: var(--primary-tint); color: var(--primary-hover); font-weight: 500; }
.tt-hide-item { display: flex; align-items: center; gap: .5rem; padding: .375rem .5rem; border-radius: var(--radius-md); font-size: .8125rem; cursor: pointer; }
.tt-hide-item:hover { background: var(--surface-subtle); }
.tt-filter-panel { width: min(860px, calc(100vw - 2rem)); padding: 1rem 1.25rem 1.25rem; }
.tt-panel-head { display: flex; align-items: baseline; gap: .75rem; margin-bottom: 1rem; font-size: .8125rem; }
.tt-panel-head strong { font-size: .9375rem; }
.tt-facets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.25rem; }
.tt-facets h3 { font-size: .75rem; font-weight: 600; color: var(--ink-muted); margin: 0 0 .5rem; }
.tt-facet-scroll { max-height: 260px; overflow-y: auto; }
.tt-facet { display: flex; align-items: center; gap: .25rem; padding: .4375rem .625rem; margin-bottom: .25rem; border-radius: var(--radius-md); background: var(--surface-subtle);
  color: var(--ink); font-size: .8125rem; border: 1px solid transparent; }
.tt-facet:hover { background: var(--line-2); text-decoration: none; color: var(--ink); }
.tt-facet.is-on { background: var(--primary-tint); border-color: var(--primary-soft); color: var(--primary-hover); font-weight: 500; }
.tt-facet-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-facet-n { margin-left: auto; padding-left: .5rem; color: var(--ink-muted); font-variant-numeric: tabular-nums; font-weight: 400; }
@media (max-width: 767.98px) { .tt-facets { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* groups */
.tt-group { margin-top: 1.75rem; }
.tt-group:first-of-type, .tt-toolbar + .tt-group { margin-top: 0; }
.tt-group-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.tt-collapse { display: inline-grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: var(--radius-xs); background: none; color: var(--tone-ink, var(--tone)); }
.tt-collapse:hover { background: var(--surface-subtle); }
.tt-group.is-collapsed .tt-collapse i { transform: rotate(-90deg); }
.tt-group-title { margin: 0; font-size: 1rem; font-weight: 600; color: var(--tone-ink, var(--tone)); }
.tt-group-count { font-size: .8125rem; color: var(--ink-muted); }
.tt-group.is-collapsed .tt-scroll { display: none; }
.tt-group.is-collapsed .tt-group-head { padding: .5rem .5rem .5rem .375rem; border: 1px solid var(--line); border-left: 4px solid var(--tone); border-radius: 0; }

/* the table */
.tt-scroll { overflow-x: auto; }
.tt-table { width: 100%; min-width: 1110px; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: .8125rem; }
.tt-table th, .tt-table td { height: 40px; padding: 0; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); background: var(--surface); vertical-align: middle; }
.tt-table thead th { height: 36px; padding: 0 .5rem; text-align: center; font-weight: 500; color: var(--ink-muted); border-top: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-table thead th.tt-name { text-align: left; padding-left: .75rem; }
.tt-table th:last-child, .tt-table td:last-child { border-right: 0; }
.tt-check { width: 44px; text-align: center; box-shadow: inset 4px 0 0 var(--tone); position: sticky; left: 0; z-index: 2; }
.tt-check .form-check-input { margin: 0; }
.tt-name { position: sticky; left: 44px; z-index: 1; }
.tt-updates-cell { width: 52px; }
.tt-table [data-col="project"] { width: 132px; }
.tt-table [data-col="owner"] { width: 80px; }
.tt-table [data-col="status"] { width: 120px; }
.tt-table [data-col="due"] { width: 96px; }
.tt-table [data-col="timeline"] { width: 132px; }
.tt-table [data-col="priority"] { width: 104px; }
.tt-table [data-col="time"] { width: 124px; }
.tt-row:hover > td:not(.tt-fill), .tt-row:focus-within > td:not(.tt-fill) { background: var(--surface-subtle); }
.tt-row.is-selected > td:not(.tt-fill), .tt-row.is-open > td:not(.tt-fill) { background: var(--primary-tint); }
.tt-row.is-saving { opacity: .55; pointer-events: none; }
.tt-name-in { display: flex; align-items: center; gap: .25rem; padding: 0 .375rem 0 .75rem; min-width: 0; }
.tt-name-text { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tt-parent { color: var(--ink-muted); font-size: .75rem; margin-right: .375rem; }
.tt-title { color: var(--ink); font-size: .875rem; }
.tt-title:hover { color: var(--primary); text-decoration: underline; }
.tt-row.is-done .tt-title { color: var(--ink-muted); }
.tt-meta { margin-left: .5rem; color: var(--ink-muted); font-size: .75rem; }
.tt-icon { display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: var(--radius-xs); background: none; color: var(--ink-muted); }
.tt-icon:hover { background: var(--line-2); color: var(--ink); }
.tt-rename { opacity: 0; }
.tt-row:hover .tt-rename, .tt-rename:focus-visible { opacity: 1; }
.tt-rename-input { min-height: 28px !important; height: 28px; padding: 0 .5rem !important; font-size: .875rem !important; }
.tt-updates { display: inline-flex; align-items: center; justify-content: center; gap: .25rem; width: 100%; height: 39px; border: 0; background: none; color: var(--ink-placeholder); font-size: .75rem; }
.tt-updates i { font-size: 1rem; }
.tt-updates:hover { color: var(--primary); }
.tt-updates.has-updates { color: var(--primary); font-weight: 600; }
.tt-text { padding: 0 .75rem !important; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-sub { display: block; font-size: .75rem; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.tt-num { padding: 0 .5rem !important; text-align: right; font-variant-numeric: tabular-nums; }

/* editable cells */
.tt-cell { display: flex; align-items: center; justify-content: center; gap: .375rem; width: 100%; height: 39px; padding: 0 .5rem; border: 0; background: transparent; color: inherit; font: inherit; white-space: nowrap; overflow: hidden; }
.tt-cell:not(:disabled) { cursor: pointer; }
.tt-cell:not(:disabled):hover { box-shadow: inset 0 0 0 1px var(--ink-placeholder); }
.tt-cell:focus-visible, .tt-cell[aria-expanded="true"] { outline: 0; box-shadow: inset 0 0 0 2px var(--primary); }
.tt-table td.tt-fill { background: var(--fill); color: var(--fill-ink); border-bottom-color: var(--surface); }
.tt-fill .tt-cell { font-weight: 500; }
.tt-fill .tt-cell:not(:disabled):hover { box-shadow: inset 0 0 0 999px rgba(20, 20, 43, .08); }
.tt-fill .tt-cell:focus-visible, .tt-fill .tt-cell[aria-expanded="true"] { box-shadow: inset 0 0 0 2px var(--ink); }
.tt-placeholder { color: var(--ink-placeholder); }
.tt-due { color: var(--ink-2); }
.tt-due.is-late { color: var(--danger-ink); font-weight: 600; }
.tt-due s { color: var(--ink-muted); }
.tt-avatars { display: inline-flex; }
.tt-avatars .avatar { box-shadow: 0 0 0 2px var(--surface); }
.tt-avatars .avatar + .avatar { margin-left: -6px; }
.avatar-more { background: var(--surface-subtle); color: var(--ink-2); }
.tt-avatar-empty { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1px dashed var(--ink-placeholder); color: var(--ink-placeholder); font-size: .75rem; }
.tt-span { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: 24px; overflow: hidden; border-radius: 0;
  background: var(--surface-subtle); border: 1px solid var(--line); }
.tt-span-fill { position: absolute; inset: 0 auto 0 0; background: var(--primary-soft); }
.tt-span.is-late { border-color: var(--danger-soft); }
.tt-span.is-late .tt-span-fill { background: var(--danger-soft); }
.tt-span.is-done .tt-span-fill { background: var(--success-tint); }
.tt-span-label { position: relative; font-size: .75rem; font-weight: 500; color: var(--ink); }

/* add-task row + summary */
.tt-add td { height: 40px; }
.tt-add-form { display: flex; align-items: center; gap: .5rem; padding: 0 .5rem 0 .75rem; }
.tt-add-input { flex: 1; min-width: 0; height: 32px; padding: 0 .25rem; border: 0; border-radius: 0; background: transparent; color: var(--ink); font-size: .8125rem; }
.tt-add-input::placeholder { color: var(--ink-muted); }
.tt-add-input:focus { outline: 0; background: var(--surface-subtle); }
.tt-add-form .ts-wrapper, .tt-add-project { width: 220px; flex: none; }
.tt-add-input:placeholder-shown ~ .ts-wrapper, .tt-add-input:placeholder-shown ~ select, .tt-add-input:placeholder-shown ~ .tt-add-btn { display: none; }
.tt-summary td { height: 36px; border: 0; background: transparent; box-shadow: none; }
.tt-summary td[data-sum] { padding: 0 .5rem; text-align: center; }
.tt-summary .tt-check, .tt-summary .tt-name { background: transparent; }
.tt-mix { display: flex; gap: 2px; height: 20px; overflow: hidden; }
.tt-mix > span { min-width: 4px; }
.tt-sum-text { font-size: .75rem; font-weight: 500; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tt-group.is-empty .tt-summary { display: none; }

/* hidden columns (Hide menu; Project is implied when grouped by project) */
.tt-board.hide-project [data-col="project"], .tt-board.hide-owner [data-col="owner"], .tt-board.hide-status [data-col="status"],
.tt-board.hide-due [data-col="due"], .tt-board.hide-timeline [data-col="timeline"], .tt-board.hide-priority [data-col="priority"],
.tt-board.hide-time [data-col="time"] { display: none; }

/* pickers */
.tt-pop { position: absolute; z-index: 1080; min-width: 200px; padding: .5rem; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-lg); box-shadow: var(--shadow-raised); }
.tt-pop-labels { display: grid; gap: .375rem; width: 220px; padding: .75rem; }
.tt-label { height: 36px; border: 0; border-radius: var(--radius-xs); font-weight: 500; font-size: .8125rem; }
.tt-label:hover { box-shadow: inset 0 0 0 999px rgba(20, 20, 43, .08); }
.tt-label:focus-visible, .tt-label[aria-current="true"] { outline: 2px solid var(--ink); outline-offset: 2px; }
.tt-pop-people { width: 280px; }
.tt-people { max-height: 260px; overflow-y: auto; margin-top: .5rem; }
.tt-person { display: flex; align-items: center; gap: .5rem; padding: .375rem .5rem; border-radius: var(--radius-md); font-size: .8125rem; cursor: pointer; }
.tt-person:hover { background: var(--surface-subtle); }
.tt-person .form-check-input { margin: 0; }
.tt-pop-note { margin: .5rem .25rem 0; font-size: .75rem; color: var(--ink-muted); }
.tt-pop-date .tt-pop-note { margin: 0 .25rem .5rem; }
.tt-pop .flatpickr-calendar.inline { box-shadow: none; border: 0; padding: 0; }
.tt-pop-foot { display: flex; justify-content: space-between; gap: .5rem; padding-top: .5rem; margin-top: .25rem; border-top: 1px solid var(--line-2); }

/* bulk bar */
.tt-bulk { position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%); z-index: 1040; display: flex; align-items: center; gap: .25rem;
  padding: .5rem .5rem .5rem .625rem; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-lg); box-shadow: var(--shadow-raised); }
.tt-bulk[hidden] { display: none; }
.tt-bulk-count { display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 .375rem; border-radius: var(--radius-md); background: var(--primary); color: #fff; font-weight: 600; }
.tt-bulk-label { margin: 0 .75rem 0 .5rem; font-weight: 500; white-space: nowrap; }
.tt-bulk-close { margin-left: .25rem; border-left: 1px solid var(--line) !important; border-radius: 0 var(--radius-md) var(--radius-md) 0; }
@media (max-width: 767.98px) { .tt-bulk { left: .75rem; right: .75rem; transform: none; flex-wrap: wrap; } }

/* side panel */
.tt-drawer.offcanvas-end { width: min(560px, 100vw); border-left: 1px solid var(--line); }
.tt-drawer-head { display: flex; align-items: flex-start; gap: .75rem; padding: 1.25rem 1.5rem .75rem; }
.tt-drawer-title { flex: 1; min-width: 0; }
.tt-drawer-title h2 { overflow-wrap: anywhere; }
.tt-drawer-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem .75rem; font-size: .8125rem; color: var(--ink-muted); }
.tt-drawer-tabs { padding: 0 1.5rem; }
.tt-drawer-body { padding: 1.25rem 1.5rem; }
.tt-drawer-loading { padding: 2rem 1.5rem; color: var(--ink-muted); }
@media (max-width: 767.98px) { .tt-name { left: 0; } .tt-check { position: static; } .tt-board > .panel-body { padding: 1rem; } }
.tt-comments .ts-wrapper { min-width: 200px; }
.tt-pop > .flatpickr-input { display: none !important; }
.tt-sum-text { white-space: nowrap; }

/* ======================================================================
   Project pages — labels, list table, schedule bar (F-010..F-015 restyle; same look as the task table)
   ====================================================================== */
.cell-project-not_started { --fill: var(--label-todo); --fill-ink: var(--ink); background: var(--fill); color: var(--fill-ink); }
.cell-project-in_progress { --fill: var(--label-progress); --fill-ink: #fff; background: var(--fill); color: var(--fill-ink); }
.cell-project-on_hold { --fill: var(--label-hold); --fill-ink: #fff; background: var(--fill); color: var(--fill-ink); }
.cell-project-completed { --fill: var(--label-done); --fill-ink: #fff; background: var(--fill); color: var(--fill-ink); }
.cell-project-cancelled { --fill: var(--label-medium); --fill-ink: #fff; background: var(--fill); color: var(--fill-ink); }
.cell-project-in_support { --fill: var(--label-support); --fill-ink: #fff; background: var(--fill); color: var(--fill-ink); }
.tone-project-not_started { --tone: #A0A3BD; } .tone-project-in_progress { --tone: var(--label-progress); } .tone-project-on_hold { --tone: var(--label-hold); }
.tone-project-completed { --tone: var(--label-done); } .tone-project-cancelled { --tone: var(--label-medium); } .tone-project-in_support { --tone: var(--label-support); }
.label-chip { display: inline-flex; align-items: center; height: 24px; padding: 0 .625rem; border-radius: var(--radius-xs); font-size: .75rem; font-weight: 600; white-space: nowrap; }

/* list */
.tt-board > .tt-scroll { padding: 1.25rem 1.5rem; }
.tt-table.tt-auto { table-layout: auto; min-width: 920px; }
.tt-projects td { height: 52px; }
.tt-projects .tt-name { position: sticky; left: 0; box-shadow: inset 4px 0 0 var(--tone); }
.tt-projects thead .tt-name { box-shadow: none; padding-left: 1rem; }
.tt-projects .tt-name-in { padding-left: 1rem; }
.tt-projects .tt-sub { margin-top: 2px; }
.tt-projects .pl-manager { width: 200px; } .tt-projects .pl-status { width: 128px; } .tt-projects .pl-priority { width: 108px; }
.tt-projects .pl-timeline { width: 210px; } .tt-projects .pl-progress { width: 170px; }
.tt-projects .tt-summary td[data-sum] { padding: 0 .5rem; text-align: center; }
.tt-board.hide-manager [data-col="manager"], .tt-board.hide-timeline [data-col="timeline"], .tt-board.hide-progress [data-col="progress"] { display: none; }
.tt-projects .tt-fill .tt-cell { height: 51px; }
.pl-timeline-cell, .pl-progress-cell { padding: 0 .75rem !important; text-align: center; }
.pl-progress-cell .progress { height: 6px; border-radius: 0; }
.pl-progress-cell .progress-bar { border-radius: 0; }

/* bordered grid table (small reference tables, e.g. project schedule) */
.table-grid { border-top: 1px solid var(--line); }
.table-grid > :not(caption) > * > * { border: 0; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); background: var(--surface); }
.table-grid > :not(caption) > * > *:last-child { border-right: 0; }
.table-grid thead th { background: var(--surface); color: var(--ink-muted); font-weight: 500; }

/* schedule bar (project overview) */
.sched { padding: .25rem 0 .5rem; }
.sched-track { position: relative; height: 28px; background: var(--surface-subtle); border: 1px solid var(--line); }
.sched-track > div { position: absolute; top: 0; bottom: 0; left: 0; }
.sched-plan { background: var(--primary-soft); }
.sched-done { background: var(--primary); }
.sched-over { background: repeating-linear-gradient(135deg, var(--danger-soft) 0 6px, #F3B8BD 6px 12px); }
.sched-today { width: 2px; background: var(--ink); top: -6px !important; bottom: -6px !important; }
.sched-today span { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: .6875rem; font-weight: 600; color: var(--ink); white-space: nowrap; }
.sched-scale { position: relative; display: flex; justify-content: space-between; margin-top: .375rem; font-size: .75rem; color: var(--ink-muted); min-height: 1.1rem; }
.sched-legend { display: flex; flex-wrap: wrap; gap: .375rem 1rem; margin-top: .75rem; font-size: .75rem; color: var(--ink-2); }
.sched-legend .sw { display: inline-block; width: 10px; height: 10px; margin-right: .375rem; vertical-align: -1px; position: static; }
.tt-projects .tt-summary .tt-name { box-shadow: none; }

/* ======================================================================
   F-040 Deadline table (same grid as the task table)
   ====================================================================== */
.cell-milestone-upcoming { --fill: var(--label-todo); --fill-ink: var(--ink); background: var(--fill); color: var(--fill-ink); }
.cell-milestone-due_soon { --fill: var(--label-hold); --fill-ink: #fff; background: var(--fill); color: var(--fill-ink); }
.cell-milestone-overdue { --fill: var(--label-urgent); --fill-ink: #fff; background: var(--fill); color: var(--fill-ink); }
.cell-milestone-completed { --fill: var(--label-done); --fill-ink: #fff; background: var(--fill); color: var(--fill-ink); }
.tone-when-overdue { --tone: var(--label-urgent); } .tone-when-today { --tone: var(--label-hold); }
.tone-when-week { --tone: var(--label-progress); } .tone-when-later { --tone: #A0A3BD; --tone-ink: var(--ink-2); }
.tone-kind-task { --tone: var(--label-progress); } .tone-kind-milestone { --tone: var(--label-review); } .tone-kind-project { --tone: var(--label-support); }
.tone-dot-overdue { background: var(--label-urgent); } .tone-dot-today { background: var(--label-hold); }
.tone-dot-week { background: var(--label-progress); } .tone-dot-later { background: #A0A3BD; }
.tt-deadlines td { height: 44px; }
.tt-deadlines .tt-name { position: sticky; left: 0; box-shadow: inset 4px 0 0 var(--tone); }
.tt-deadlines thead .tt-name { box-shadow: none; padding-left: 1rem; }
.tt-deadlines .tt-summary .tt-name { box-shadow: none; }
.tt-deadlines .tt-name-in { padding-left: 1rem; }
.tt-deadlines .dl-project { width: 220px; } .tt-deadlines .dl-who { width: 220px; } .tt-deadlines .dl-status { width: 128px; } .tt-deadlines .dl-due { width: 200px; }
.tt-deadlines .tt-fill .tt-cell { height: 43px; }
.tt-deadlines .tt-summary td[data-sum] { padding: 0 .5rem; text-align: center; }
.tt-kind { color: var(--ink-muted); margin-right: .5rem; }
.tt-board.hide-who [data-col="who"] { display: none; }

/* ======================================================================
   F-022 Kanban board — columns with a status header, white cards on a tinted lane
   ====================================================================== */
.kb { display: grid; grid-template-columns: repeat(var(--kb-cols, 4), minmax(260px, 1fr)); gap: 1rem; overflow-x: auto; padding-bottom: .25rem; }
.kanban-col { display: flex; flex-direction: column; min-width: 0; background: var(--bg-app); border-top: 3px solid var(--tone); }
.kanban-col.is-over { background: var(--primary-tint); box-shadow: inset 0 0 0 2px var(--primary); }
.kb-head { display: flex; align-items: center; gap: .5rem; padding: .75rem .75rem .625rem; }
.kb-head .tt-dot { margin: 0; }
.kb-title { margin: 0; font-size: .875rem; font-weight: 600; color: var(--ink); }
.kb-count { min-width: 1.5rem; padding: 0 .375rem; border-radius: var(--radius-xs); background: var(--surface); color: var(--ink-2); font-size: .75rem; font-weight: 600; text-align: center; }
.kb-cards { display: flex; flex-direction: column; gap: .5rem; padding: 0 .625rem .75rem; min-height: 120px; max-height: calc(100vh - 300px); overflow-y: auto; }
.kanban-card { position: relative; padding: .75rem .75rem .625rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
  box-shadow: 0 1px 2px rgba(20, 20, 43, .06); }
.kanban-card[draggable="true"] { cursor: grab; }
.kanban-card:hover { border-color: #C9CCE0; box-shadow: 0 4px 12px rgba(20, 20, 43, .08); }
.kanban-card.is-dragging { opacity: .45; }
.kanban-col:not([data-status="done"]) .kanban-card.is-late { box-shadow: inset 3px 0 0 var(--danger), 0 1px 2px rgba(20, 20, 43, .06); }
.kb-card-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .375rem; }
.kb-project { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .6875rem; font-weight: 600; letter-spacing: .02em; color: var(--ink-muted); text-transform: uppercase; }
.label-chip-sm { height: 20px; padding: 0 .5rem; font-size: .6875rem; flex: none; }
.kb-parent { font-size: .75rem; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-card-title { display: block; color: var(--ink); font-size: .875rem; font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.kb-card-title:hover { color: var(--primary); }
.kanban-col[data-status="done"] .kb-card-title { color: var(--ink-muted); text-decoration: line-through; text-decoration-color: var(--ink-placeholder); }
.kb-meta { display: flex; flex-wrap: wrap; gap: .25rem .75rem; margin-top: .5rem; font-size: .75rem; color: var(--ink-muted); }
.kb-meta i { margin-right: .125rem; }
.kb-due.is-late { color: var(--danger-ink); font-weight: 600; }
.kanban-col[data-status="done"] .kb-due.is-late { color: var(--ink-muted); font-weight: 400; }
.kb-due.is-today { color: var(--warning-ink); font-weight: 600; }
.kb-card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: .625rem; padding-top: .5rem; border-top: 1px solid var(--line-2); min-height: 22px; }
.kb-unassigned { font-size: .75rem; color: var(--ink-placeholder); }
.kb-empty { display: none; margin: 0; padding: 1.25rem .5rem; border: 1px dashed var(--ink-placeholder); color: var(--ink-muted); font-size: .8125rem; text-align: center; }
.kanban-col.is-empty .kb-empty { display: block; }
.kanban-card .tt-avatars, .kanban-card .kb-meta span[title] { position: relative; z-index: 2; }
@media (max-width: 991.98px) { .kb { grid-template-columns: repeat(var(--kb-cols, 4), 280px); } .kb-cards { max-height: none; } }

/* ======================================================================
   All tables — one look (same grid as the task / project / deadline tables). DESIGN.md §3e.
   ====================================================================== */
.table { font-size: .8125rem; border-collapse: separate; border-spacing: 0; border-top: 1px solid var(--line); }
.table > :not(caption) > * > * { height: 44px; padding: .5rem .75rem; border: 0; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); background-color: var(--surface); }
.table > :not(caption) > * > *:last-child { border-right: 0; }
.table thead th, .table-light th, .table > thead > tr > th { height: 38px; background: var(--surface) !important; color: var(--ink-muted); font-size: .8125rem; font-weight: 500; text-transform: none; letter-spacing: 0; white-space: nowrap; }
.table-sm > :not(caption) > * > * { height: 38px; padding: .375rem .625rem; }
.table tbody tr:hover > * { background-color: var(--surface-subtle); }
.table tfoot > tr > * { font-weight: 600; color: var(--ink); }
.table-bordered > :not(caption) > * { border-width: 0; }
/* table containers: a white panel with the square table inside */
.table-responsive.bg-white { padding: 1.25rem 1.5rem; border-radius: var(--radius-xl) !important; box-shadow: var(--shadow-card) !important; }
.panel > .table-responsive, .panel > .table { padding: 1rem 1.5rem 1.25rem; }
.panel > .table { width: calc(100% - 3rem); margin: 1rem 1.5rem 1.25rem; padding: 0; }
.panel-body .table-responsive.bg-white, .bg-white.rounded .table-responsive.bg-white { padding: 0; box-shadow: none !important; }
/* state badges inside tables → solid square labels (task-table colours) */
.table .badge-soft:not(.no-dot) { min-width: 6.5rem; height: 26px; justify-content: center; padding: 0 .625rem; border: 0; border-radius: 0; font-size: .75rem; font-weight: 600; }
.table .badge-soft:not(.no-dot)::before { display: none; }
.table .badge-soft-primary:not(.no-dot) { background: var(--label-progress); color: #fff; }
.table .badge-soft-success:not(.no-dot) { background: var(--label-done); color: #fff; }
.table .badge-soft-warning:not(.no-dot) { background: var(--label-hold); color: #fff; }
.table .badge-soft-danger:not(.no-dot), .table .badge-soft-critical:not(.no-dot) { background: var(--label-urgent); color: #fff; }
.table .badge-soft-violet:not(.no-dot) { background: var(--label-review); color: #fff; }
.table .badge-soft-info:not(.no-dot) { background: var(--label-support); color: #fff; }
.table .badge-soft-secondary:not(.no-dot), .table .badge-soft-light:not(.no-dot) { background: var(--label-todo); color: var(--ink); }
.table .badge-soft-dark:not(.no-dot) { background: var(--label-medium); color: #fff; }
.table .badge-soft[data-label="task-review"] { background: var(--label-review); color: #fff; }
.table .badge-soft[data-label="priority-low"] { background: var(--label-low); color: var(--label-low-ink); }
.table .badge-soft[data-label="priority-medium"] { background: var(--label-medium); color: #fff; }
.table .badge-soft[data-label="priority-high"] { background: var(--label-high); color: #fff; }
.table .badge-soft[data-label="project-in_support"] { background: var(--label-support); color: #fff; }
/* a state label placed after a name in the same cell: compact, with a gap */
.table td > a + .badge-soft:not(.no-dot), .table td > span + .badge-soft:not(.no-dot) { min-width: 0; height: 22px; margin-left: .5rem; vertical-align: 1px; }

/* ======================================================================
   F-093 Attendance register — person × day grid with status codes (same label colours as the tables)
   ====================================================================== */
.day-full_day { --fill: var(--label-done); --fill-ink: #fff; } .day-half_day { --fill: var(--label-hold); --fill-ink: #fff; }
.day-present { --fill: var(--label-progress); --fill-ink: #fff; } .day-absent { --fill: var(--label-urgent); --fill-ink: #fff; }
.day-leave { --fill: var(--label-medium); --fill-ink: #fff; } .day-paid_leave { --fill: var(--label-review); --fill-ink: #fff; }
.day-week_off { --fill: var(--label-todo); --fill-ink: var(--ink-2); }
.reg-code { display: inline-grid; place-items: center; width: 30px; height: 26px; padding: 0; border: 0; background: var(--fill, transparent); color: var(--fill-ink, var(--ink-muted));
  font-size: .6875rem; font-weight: 700; line-height: 1; position: relative; }
button.reg-code:not(:disabled) { cursor: pointer; }
button.reg-code:not(:disabled):hover { box-shadow: inset 0 0 0 999px rgba(20, 20, 43, .12); }
button.reg-code:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.reg-code.is-blank { background: transparent; }
button.reg-code.is-blank:not(:disabled)::after { content: "+"; color: var(--ink-placeholder); font-weight: 400; font-size: .875rem; }
.reg-code.is-marked::before, .reg-code-marked::before { content: ""; position: absolute; top: 0; right: 0; border: 4px solid transparent; border-top-color: var(--ink); border-right-color: var(--ink); }
.reg-code-marked { background: var(--surface-subtle); color: transparent; }
.reg { border-collapse: separate; border-spacing: 0; font-size: .8125rem; border-top: 1px solid var(--line); }
.reg th, .reg td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line-2); background: var(--surface); text-align: center; vertical-align: middle; padding: 3px; }
.reg thead th { height: 44px; color: var(--ink-muted); font-weight: 500; }
.reg-day { min-width: 36px; } .reg-day span { display: block; color: var(--ink); font-weight: 600; } .reg-day small { font-size: .625rem; }
.reg-day.is-weekend { background: var(--surface-subtle); }
.reg .is-today { box-shadow: inset 2px 0 0 var(--primary), inset -2px 0 0 var(--primary); }
.reg thead .is-today span { color: var(--primary); }
.reg-person { position: sticky; left: 0; z-index: 1; min-width: 220px; text-align: left !important; padding: .5rem .75rem !important; border-right: 1px solid var(--line) !important; }
.reg tbody .reg-person { font-weight: 500; }
.reg-count { min-width: 40px; font-weight: 600; color: var(--ink); } .reg-count.is-zero { color: var(--ink-placeholder); font-weight: 400; }
.reg thead .reg-count .reg-code { width: 26px; height: 22px; }
.reg-hours { min-width: 150px; white-space: nowrap; padding: 0 .75rem !important; }
.reg-legend { display: flex; flex-wrap: wrap; gap: .375rem 1rem; font-size: .75rem; color: var(--ink-2); }
.reg-legend > span { display: inline-flex; align-items: center; gap: .375rem; }
.reg-legend .reg-code { width: 26px; height: 20px; }
.reg-mark > summary { list-style: none; cursor: pointer; }
.reg-mark > summary::-webkit-details-marker { display: none; }
.reg-mark:not([open]) > summary { border-bottom: 0; }
.reg .reg-sep { border-right: 2px solid var(--line) !important; }

/* ======================================================================
   White work area (DESIGN.md §3f): the content area is white, the sidebar keeps the tint. No box-in-box:
   list pages put their toolbar + table straight on the page; grouping panels get a hairline border instead of a shadow.
   ====================================================================== */
.app-main, .app-topbar { background: var(--surface); }
.app-content .panel, .app-content .bg-white.rounded, .app-content .card, .app-content .kpi-strip, .app-content .table-responsive.bg-white {
  box-shadow: none !important; border: 1px solid var(--line); }
.app-content .shadow-sm { box-shadow: none !important; }
.app-content .panel, .app-content .kpi-strip, .app-content .bg-white.rounded, .app-content .card { border-radius: var(--radius-lg) !important; }
/* list pages: the panel is only a wrapper → remove it */
.app-content .panel.tt-board, .app-content .panel.kb-panel, .app-content .table-responsive.bg-white {
  border: 0 !important; border-radius: 0 !important; background: transparent; padding: 0; overflow: visible; }
.app-content .panel.tt-board > .panel-body, .app-content .panel.kb-panel > .panel-body, .app-content .tt-board > .tt-scroll { padding: 0; }
.app-content .panel.tt-board > .panel-head { padding: 0 0 .75rem; border-bottom: 0; min-height: 0; }
.app-content .tt-board .tt-toolbar { margin-bottom: 1rem; }
/* small surfaces that sat on the tint now need their own edge */
.app-content .kb-count, .app-content .tab-count { background: var(--surface-subtle); }
.app-content .kpi.is-critical { box-shadow: inset 0 3px 0 var(--danger) !important; }
.app-content .kpi.is-caution { box-shadow: inset 0 3px 0 var(--warning) !important; }
.app-content .kpi.is-healthy { box-shadow: inset 0 3px 0 var(--success) !important; }
.app-content .empty-state { border: 1px dashed var(--line) !important; box-shadow: none !important; }
/* a table inside a bordered panel runs edge to edge (the panel's border is the frame) */
.app-content .panel > .table-responsive, .app-content .panel > .panel-body > .table-responsive:only-child { padding: 0; }
.app-content .panel > .panel-body:has(> .table-responsive:only-child) { padding: 0; }
.app-content .panel > .table-responsive > .table, .app-content .panel > .panel-body > .table-responsive:only-child > .table { border-top: 0; }
.app-content .panel > .table-responsive > .table > :not(caption) > tr > :first-child,
.app-content .panel > .table-responsive > .table > :not(caption) > * > tr > :first-child { padding-left: 1.25rem; }
.app-content .panel > .table-responsive > .table > :not(caption) > * > tr > :last-child { padding-right: 1.25rem; }
.app-content .panel > .table-responsive:last-child > .table > tbody > tr:last-child > * { border-bottom: 0; }
.app-content .panel > .table { width: 100%; margin: 0; border-top: 0; }

/* F-006 impersonation bar — on top of every page while an admin views the app as someone else */
.imp-bar { position: sticky; top: 0; z-index: 1030; display: flex; align-items: center; gap: .625rem; padding: .5rem 1.5rem;
  background: var(--warning-tint); color: var(--warning-ink); border-bottom: 1px solid #F5D78E; font-size: .8125rem; }
.imp-bar > i { font-size: 1rem; }
.imp-bar-btn { background: var(--warning-ink); color: #fff; border: 0; font-weight: 600; white-space: nowrap; }
.imp-bar-btn:hover { background: #6B3A00; color: #fff; }
.imp-bar ~ .app-topbar { top: 41px; }

/* Attendance status fills the whole cell, like the task table's Status column */
.table tbody tr > td.day-fill { width: 132px; padding: 0 .5rem; background: var(--fill, var(--surface)); color: var(--fill-ink, var(--ink)); text-align: center; font-size: .75rem; font-weight: 600; }
.table tbody tr > td.day-fill.is-filled { border-bottom-color: var(--surface); }
.table tbody tr > td.day-fill .text-muted { color: var(--ink-placeholder) !important; font-weight: 400; }
.reg tbody td.reg-cell { height: 52px; padding: 0; background: var(--fill, var(--surface)); border-bottom-color: var(--surface); border-right-color: var(--surface); }
.reg tbody td.reg-cell:not([class*="day-"]) { border-bottom-color: var(--line); border-right-color: var(--line-2); }
.reg tbody td.reg-cell .reg-code { display: grid; width: 100%; height: 51px; background: transparent; color: var(--fill-ink, var(--ink-muted)); font-size: .75rem; }
.reg tbody td.reg-cell.is-today { box-shadow: none; }
.reg tbody td.reg-cell.is-today .reg-code { box-shadow: inset 2px 0 0 var(--primary), inset -2px 0 0 var(--primary); }
.reg tbody td.reg-cell .reg-code.is-marked::before { border-width: 5px; }

/* Search box at the top of long menus / filter columns (App.menuSearch) and inside open dropdowns (Tom Select) */
.menu-search { position: relative; margin: 0 0 .375rem; }
.dropdown-menu > .menu-search { margin: 0 0 .375rem; padding: 0; }
.menu-search > i { position: absolute; left: .625rem; top: 15px; transform: translateY(-50%); color: var(--ink-muted); font-size: .75rem; pointer-events: none; }
.menu-search .form-control { min-height: 30px; height: 30px; padding-left: 1.75rem; font-size: .8125rem; }
.menu-search-empty { margin: .5rem .25rem 0; font-size: .8125rem; color: var(--ink-muted); }
.ts-dropdown .dropdown-input-wrap { padding: .375rem .375rem .25rem; }
.ts-dropdown .dropdown-input { width: 100%; min-height: 32px; padding: .375rem .625rem .375rem 1.75rem; font-size: .8125rem;
  background: var(--surface) url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%236E7191'%3e%3cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0'/%3e%3c/svg%3e") no-repeat .625rem center / 12px 12px; }
.ts-dropdown .dropdown-input:focus { border-color: var(--primary); box-shadow: var(--focus); outline: 0; }
.ts-dropdown .highlight { background: var(--warning-tint); color: inherit; border-radius: 2px; }
.is-filtered { display: none !important; }

/* F-007 Settings → Lists */
.set-list .set-move { width: 88px; white-space: nowrap; } .set-list .set-preview { width: 170px; } .set-list .set-color { width: 170px; }
.set-list .set-key { width: 150px; } .set-list .set-key code { font-size: .75rem; color: var(--ink-muted); } .set-list .set-act { width: 90px; text-align: center; }
.set-add .form-control { max-width: 240px; } .set-add .form-select { max-width: 150px; }
.set-chips { display: flex; flex-wrap: wrap; gap: .375rem; }
.form-switch .form-check-label { margin-left: .5rem; }
/* F-008 permission matrix */
.perm-matrix .perm-col { width: 132px; vertical-align: top; }
.perm-matrix .perm-group > th { background: var(--surface-subtle) !important; color: var(--ink); font-weight: 600; font-size: .75rem; letter-spacing: .02em; height: 32px; }
.perm-matrix td .form-check-input { margin: 0; }

/* Full-cell "pick one" values in plain tables (Users role / status) — same look as the task table's Status column */
.cell-userstatus-1 { --fill: var(--label-done); --fill-ink: #fff; background: var(--fill); color: var(--fill-ink); }
.cell-userstatus-0 { --fill: var(--label-todo); --fill-ink: var(--ink); background: var(--fill); color: var(--fill-ink); }
.table tbody tr > td.fill-cell { padding: 0; width: 150px; background: var(--fill); color: var(--fill-ink); border-bottom-color: var(--surface); }
.fill-btn { display: grid; place-items: center; width: 100%; min-height: 51px; padding: 0 .5rem; border: 0; background: transparent; color: inherit; font-size: .75rem; font-weight: 600; }
.fill-btn:not(:disabled) { cursor: pointer; }
.fill-btn:not(:disabled):hover { box-shadow: inset 0 0 0 999px rgba(20, 20, 43, .08); }
.fill-btn:focus-visible, .fill-btn[aria-expanded="true"] { outline: 0; box-shadow: inset 0 0 0 2px var(--ink); }
.fill-btn:disabled { cursor: not-allowed; }
.users-table td { height: 52px; }
.table a.num-link, a.num-link { color: var(--primary); font-weight: 600; text-decoration: underline; text-decoration-color: var(--primary-soft); text-underline-offset: 3px; }
.table a.num-link:hover, a.num-link:hover { color: var(--primary-hover); text-decoration-color: currentColor; }

/* F-110 client portal */
.pf-kpi-text { font-size: 1.25rem; line-height: 1.6; }
.pf-attention { border-color: #F5D78E !important; }
.pf-attention .panel-head { background: var(--warning-tint); color: var(--warning-ink); }
.pf-list { list-style: none; margin: 0; padding: 0; }
.pf-list li { display: flex; align-items: center; gap: .75rem; padding: .625rem 1.25rem; border-bottom: 1px solid var(--line-2); font-size: .875rem; }
.pf-list li:last-child { border-bottom: 0; }
.pf-list li > a { flex: 1; min-width: 0; color: var(--ink); font-weight: 500; }
.pf-list li > a:hover { color: var(--primary); }
.pf-meta { color: var(--ink-muted); font-size: .75rem; white-space: nowrap; }
.pf-card { display: block; height: 100%; padding: 1rem 1.125rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); }
.pf-card:hover { border-color: var(--primary-soft); box-shadow: 0 4px 12px rgba(20, 20, 43, .06); text-decoration: none; color: var(--ink); }
.pf-card-title { font-size: .9375rem; }
.pf-card-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem .75rem; padding-top: .625rem; border-top: 1px solid var(--line-2); font-size: .75rem; color: var(--ink-2); }
.pf-feed { list-style: none; margin: 0; padding: 0; }
.pf-feed li { display: grid; grid-template-columns: 28px 1fr; column-gap: .625rem; padding: .5rem 0; border-bottom: 1px solid var(--line-2); }
.pf-feed li:last-child { border-bottom: 0; }
.pf-icon { grid-row: span 2; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--primary-tint); color: var(--primary); font-size: .8125rem; }
.pf-text { color: var(--ink); font-size: .8125rem; font-weight: 500; line-height: 1.35; }
.pf-text:hover { color: var(--primary); }
.pf-feed .pf-meta { white-space: normal; margin-top: 2px; }
.pf-mix { display: flex; gap: 2px; height: 14px; margin-bottom: .75rem; }
.pf-mix > span { min-width: 4px; }
.pf-legend { display: flex; flex-wrap: wrap; gap: .375rem 1.25rem; font-size: .8125rem; color: var(--ink-2); }
.pf-legend .tt-dot { margin-right: .375rem; }
.pf-signoff { border-color: var(--success-tint) !important; }
.pf-signoff .panel-head { background: var(--success-tint); color: var(--success-ink); }
.callout-success { background: var(--success-tint); color: var(--success-ink); }

/* F-112 client review */
.rv-chip { display: inline-flex; align-items: center; gap: .25rem; margin-left: .5rem; padding: 0 .375rem; height: 20px; border-radius: var(--radius-xs); font-size: .6875rem; font-weight: 600; vertical-align: 1px; }
.rv-pending { background: var(--warning-tint); color: var(--warning-ink); }
.rv-approved { background: var(--success-tint); color: var(--success-ink); }
.rv-changes_requested { background: var(--danger-soft); color: var(--danger-ink); }
.rv-history { list-style: none; margin: 0; padding: 0; }
.rv-history li { padding: .5rem 0; border-top: 1px solid var(--line-2); }
.rv-quote { margin: .375rem 0 0; padding: .375rem .625rem; border-left: 3px solid var(--line); background: var(--surface-subtle); font-size: .8125rem; color: var(--ink-2); }
.rv-decide { border-color: var(--primary-soft) !important; } .pf-list li > .btn { flex: 0 0 auto; }

/* F-113 — client collaboration on tasks: comment tags (task page + portal thread), "waiting for client" chip */
.cm-tag { display: inline-flex; align-items: center; gap: .25rem; margin-left: .375rem; padding: 0 .375rem; border-radius: var(--r-sm);
  font-size: .6875rem; font-weight: 500; line-height: 1.25rem; background: var(--surface-subtle); color: var(--ink-2); border: 1px solid var(--line-2); }
.cm-tag-client { background: var(--accent-violet-tint); color: var(--accent-violet); border-color: transparent; }
.cm-client { border-left: 2px solid var(--accent-violet); padding-left: .75rem; }
.chip-waiting { display: inline-flex; align-items: center; gap: .25rem; padding: 0 .375rem; border-radius: var(--r-sm); font-size: .6875rem;
  font-weight: 500; line-height: 1.25rem; background: var(--warning-tint); color: var(--warning-ink); white-space: nowrap; }

/* F-036 — time approvals: Approve + Reject (reason form opens in place) */
.ta-actions { display: flex; align-items: flex-start; gap: .25rem; justify-content: flex-end; }
.ta-reject > summary { list-style: none; }
.ta-reject > summary::-webkit-details-marker { display: none; }
.ta-reject[open] > summary { display: none; }
.ta-reject form { display: flex; gap: .25rem; min-width: 16rem; }
.text-warning-ink { color: var(--warning-ink) !important; }

/* F-094 — My attendance: days per status in the period (click to filter) */
.att-counts { display: flex; flex-wrap: wrap; gap: .5rem; }
.att-count { display: inline-flex; align-items: center; gap: .5rem; padding: .25rem .625rem .25rem .25rem; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink-2); font-size: .8125rem; text-decoration: none; }
.att-count:hover { border-color: var(--line-strong, var(--ink-placeholder)); color: var(--ink); text-decoration: none; }
.att-count.is-on { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); color: var(--ink); }
.att-count .reg-code { width: 26px; height: 22px; }
.att-count strong { color: var(--ink); font-variant-numeric: tabular-nums; }
/* multi-select filters (people, statuses) stay compact in a filter bar instead of taking the whole row */
.filter-bar .ts-wrapper.multi { flex: 0 1 15rem; min-width: 11rem; }
