/* ============================================================================
   Timero · Booking module — LAYOUT & SCREEN CSS
   ----------------------------------------------------------------------------
   Load AFTER timero-booking.css (tokens + primitives).

     <link rel="stylesheet" href=".../timero-booking.css">
     <link rel="stylesheet" href=".../timero-booking-module.css">

   Source: extracted from Timero Booking (standalone).html — block "Booking module styles".
   Visual reference: same standalone file. Specs: redlines.md, ux-spec.md.

   Scope: wrap /time pages in .timero-booking-module to avoid clashing with CRM .btn / #modal.
   ============================================================================ */

.timero-booking-module {
  /* optional hook for future overrides */
}
.timero-booking-module .hidden { display: none !important; }

/* CRM shell override: on /time we want a single full-width column.
   The CRM layout uses a `body > main` grid with fixed side columns. */
body.timero-page-time > main {
  display: block !important;
  grid-template-columns: none !important;
  gap: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  min-height: auto !important;
  margin: 0 !important;
}

/* App-level layout for booking (header + subnav + content) */
.tapp {
  display: grid;
  grid-template-rows: 56px 44px 1fr;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ─── 2. Module header ──────────────────────────────────────── */
.theader {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  z-index: 20;
}
.theader-left { display: flex; align-items: center; gap: 16px; }
.tmodule-tag {
  font-size: 12px; font-weight: 500;
  color: var(--ink-2);
  padding: 4px 10px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  display: inline-flex; align-items: center; gap: 6px;
}
.tmodule-tag .dotmark { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* Module switch (admin) */
.module-switch {
  display: inline-flex;
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 2px;
  gap: 1px;
}
.module-switch button {
  height: 28px; padding: 0 12px;
  border: 0; background: transparent;
  border-radius: 7px;
  font-size: 12.5px; font-weight: 500;
  color: var(--ink-3);
  display: inline-flex; align-items: center; gap: 6px;
}
.module-switch button:hover { color: var(--ink-1); }
.module-switch button.active {
  background: var(--bg-surface);
  color: var(--ink-1);
  box-shadow: var(--shadow-1);
}
.module-switch button.active .dotmark { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

.theader-right { display: flex; align-items: center; gap: 8px; }

/* Theme + role toggles (prototype controls — styled to fit) */
.toggle-btn {
  height: 32px; min-width: 32px; padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--ink-2);
  font-size: 12px; font-weight: 500;
}
.toggle-btn:hover { background: var(--bg-hover); color: var(--ink-1); }

.proto-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--ink-4);
  padding: 0 8px;
  border-right: 1px solid var(--border);
  margin-right: 4px;
  height: 20px;
}

/* ─── 3. Sub-nav ────────────────────────────────────────────── */
.tsubnav {
  display: flex; align-items: stretch;
  padding: 0 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  height: 44px; /* standalone uses 44px row in .tapp grid */
}
.tsubnav::-webkit-scrollbar { display: none; }
.tsubnav-item {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 0 14px;
  border: 0; background: transparent;
  font-size: 13px; font-weight: 500;
  color: var(--ink-3);
  position: relative;
  white-space: nowrap;
  height: 44px; /* stretch to full subnav height */
}
.tsubnav-item:hover { color: var(--ink-1); }
.tsubnav-item.active { color: var(--ink-1); font-weight: 600; }
.tsubnav-item.active::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: -1px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
}
.tsubnav-item .count-chip {
  font-size: 10.5px; font-weight: 600;
  padding: 0 6px; height: 16px;
  display: inline-flex; align-items: center;
  border-radius: 999px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.tsubnav-item.warn .count-chip { background: var(--danger-soft); color: var(--danger); border-color: transparent; }

/* ─── 4. Content shell ──────────────────────────────────────── */
.tcontent {
  overflow: visible;
  background: var(--bg-app);
  min-height: 0;
}
.tcontent::-webkit-scrollbar { width: 10px; }
.tcontent::-webkit-scrollbar-thumb {
  background: var(--border-2); border-radius: 5px;
  border: 2px solid transparent; background-clip: content-box;
}
.tpage {
  max-width: 1280px;
  margin: 0 auto;
  padding: 22px 28px 60px;
}

/* When rendered inside CRM shell, allow scrolling inside booking content. */
.timero-booking-module {
  min-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  height: auto;
}
.timero-booking-module .tcontent {
  flex: 1;
}
.tpage-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
.tpage-head h1 {
  margin: 0;
  font-size: 22px; font-weight: 600; letter-spacing: -0.02em;
  color: var(--ink-1);
}
.tpage-head .sub {
  margin-top: 3px;
  font-size: 13px; color: var(--ink-3);
}
.tpage-head .tools { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.tpage-head--with-tools {
  align-items: flex-end;
  flex-wrap: wrap;
}
.tpage-head--with-tools .tpage-head-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.tpage-head--with-tools .my-view-toggle {
  flex-shrink: 0;
}

/* ─── 5. Toolbar / filters ──────────────────────────────────── */
.tbar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.tbar .spacer { flex: 1; }

.tbar--filters { align-items: flex-end; }
.tbar-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tbar-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-3);
  line-height: 1;
}
.finput--toolbar {
  min-width: 220px;
  height: 34px;
}
.tbar-field .month-picker { align-self: flex-start; }

.tbar .my-view-toggle {
  flex-shrink: 0;
}
.my-view-toggle .seg-btn {
  width: 34px;
  height: 30px;
  padding: 0;
  justify-content: center;
}
.my-view-toggle .seg-btn svg {
  display: block;
  flex-shrink: 0;
}
.matrix-unit-toggle .seg-btn {
  width: 34px;
  height: 30px;
  padding: 0;
  justify-content: center;
}

.tpage-head--matrix {
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-bottom: 6px;
}
.tpage-head--matrix .tpage-head-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink-1);
  flex-shrink: 0;
  line-height: 1.2;
}
.tpage-head--matrix .tpage-head-tools.matrix-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
  min-width: 0;
  justify-content: flex-end;
}
.matrix-head-sub {
  margin: 0 0 14px;
  font-size: 11.5px;
  color: var(--ink-3);
}
.matrix-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.matrix-refresh-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.matrix-period-presets .seg-btn {
  height: 30px;
  padding: 0 10px;
  font-size: 11.5px;
  white-space: nowrap;
}
.matrix-project-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.matrix-project-filter-lbl {
  font-size: 11.5px;
  color: var(--ink-3);
  white-space: nowrap;
}
.matrix-project-select {
  min-width: 160px;
  max-width: 220px;
  height: 30px;
  font-size: 12px;
}
.matrix-period-custom {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.matrix-date-input {
  width: 132px;
  height: 30px;
  padding: 4px 8px;
  font-size: 12px;
}
.matrix-period-sep {
  color: var(--ink-3);
  font-size: 12px;
  user-select: none;
}

.month-picker {
  display: inline-flex; align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
}
.month-picker button {
  width: 32px; height: 34px;
  border: 0; background: transparent;
  color: var(--ink-2);
  display: grid; place-items: center;
}
.month-picker button:hover { background: var(--bg-hover); color: var(--ink-1); }
.month-picker .mlabel {
  padding: 0 14px;
  font-size: 13px; font-weight: 600;
  color: var(--ink-1);
  min-width: 130px; text-align: center;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  height: 34px; display: inline-flex; align-items: center; justify-content: center;
  text-transform: capitalize;
}

/* Toggle h/$ */
.unit-toggle {
  display: inline-flex;
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
}
.unit-toggle button {
  height: 28px; min-width: 40px; padding: 0 12px;
  border: 0; background: transparent;
  border-radius: 6px;
  font-size: 12.5px; font-weight: 600;
  color: var(--ink-3);
}
.unit-toggle button.active {
  background: var(--bg-surface);
  color: var(--accent-2);
  box-shadow: var(--shadow-1);
}

/* ─── 6. Cards & stat tiles ─────────────────────────────────── */
.tcard {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
}
.tcard-pad { padding: 16px 18px; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.stat-tile {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 3px;
}
.stat-tile .lbl { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em; }
.stat-tile .val {
  font-size: 24px; font-weight: 600; letter-spacing: -0.02em;
  color: var(--ink-1); font-variant-numeric: tabular-nums; line-height: 1.1;
}
.stat-tile .val .unit { font-size: 14px; font-weight: 500; color: inherit; margin-left: 3px; }
.stat-tile .delta { font-size: 11.5px; color: var(--ink-3); }
.stat-tile .delta.up { color: var(--success); }
.stat-tile .delta.down { color: var(--danger); }
.stat-tile.accent { background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%); border-color: transparent; }
.stat-tile.accent .lbl { color: rgba(255,255,255,0.8); }
.stat-tile.accent .val { color: #fff; }
.stat-tile.accent .delta { color: rgba(255,255,255,0.85); }

/* ─── 7. Tables ─────────────────────────────────────────────── */
.ttable-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-1);
}
.ttable { width: 100%; border-collapse: collapse; font-size: 13px; }
.ttable thead th {
  text-align: left;
  font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--ink-3);
  padding: 10px 14px;
  background: var(--bg-surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.ttable thead th.num, .ttable td.num { text-align: right; font-variant-numeric: tabular-nums; }
.ttable tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--ink-1);
  vertical-align: middle;
}
.ttable tbody tr:last-child td { border-bottom: 0; }
.ttable tbody tr:hover td { background: var(--bg-hover); }
.ttable tbody tr.locked td { background: var(--planned-soft); color: var(--ink-3); }
.ttable .cell-strong { font-weight: 600; color: var(--ink-1); }
.ttable .entry-project-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.ttable .entry-project-stack .proj-client-sub {
  font-size: 11px;
  line-height: 1.35;
}
.ttable .cell-mono { font-family: var(--font-mono); font-size: 12px; }
.ttable tfoot td {
  padding: 12px 14px;
  border-top: 2px solid var(--border-2);
  font-weight: 600;
  background: var(--bg-surface-2);
  font-variant-numeric: tabular-nums;
}
.ttable .row-act { opacity: 0; transition: opacity 100ms; display: inline-flex; gap: 1px; }
.ttable tbody tr:hover .row-act { opacity: 1; }

.tbl-empty-pad { padding: 48px 20px; }

/* Day-grouped booking table */
.ttable tbody.day-group { border-bottom: 2px solid var(--border-2); }
.ttable tbody.day-group:last-of-type { border-bottom: 0; }
.ttable td.day-cell {
  width: 150px;
  vertical-align: top;
  padding: 12px 14px;
  background: var(--bg-surface-2);
  border-right: 1px solid var(--border);
  border-bottom: 2px solid var(--border-2);
}
.ttable tbody.day-group:last-of-type td.day-cell { border-bottom: 0; }
.day-date { display: flex; align-items: baseline; gap: 7px; margin-bottom: 8px; }
.day-date .day-dow {
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--ink-3);
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: 5px; padding: 1px 5px;
}
.day-date .day-num { font-size: 13px; font-weight: 600; color: var(--ink-1); }
.day-total { display: flex; flex-direction: column; gap: 1px; }
.day-total .dt-h {
  font-size: 17px; font-weight: 700; letter-spacing: -0.02em;
  color: var(--ink-1); font-variant-numeric: tabular-nums; line-height: 1.1;
}
.day-total.over .dt-h { color: var(--danger); }
.day-total .dt-a { font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.day-total .tbadge { align-self: flex-start; margin-top: 2px; }

.ttable tr.day-entry td { border-bottom: 1px solid var(--border); }
.ttable tr.day-subtotal td {
  background: var(--bg-surface-2);
  border-bottom: 0;
  padding: 6px 14px;
  font-size: 11.5px;
  color: var(--ink-3);
}
.ttable tr.day-subtotal td.cell-strong { color: var(--ink-2); font-weight: 600; }
.ttable tbody.day-group:hover td.day-cell { background: var(--bg-hover); }

/* ─── 8. Badges / pills (module) ────────────────────────────── */
.tbadge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px; font-weight: 500;
  border: 1px solid;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.tbadge.ok { background: var(--success-soft); color: var(--success); border-color: transparent; }
.tbadge.warn { background: var(--warning-soft); color: #8a6a0a; border-color: transparent; }
.tbadge.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.tbadge.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.tbadge.muted { background: var(--bg-surface-2); color: var(--ink-3); border-color: var(--border); }
.tbadge.accent { background: var(--accent-soft); color: var(--accent-2); border-color: transparent; }
body.dark-mode .tbadge.warn { color: var(--warning); }
.tbadge.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.jira-badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 18px; padding: 0 6px;
  border-radius: 5px;
  font-size: 10.5px; font-weight: 600;
  background: var(--info-soft); color: var(--info);
  font-family: var(--font-mono);
}
.jira-badge-epic {
  background: var(--purple-soft);
  color: var(--purple);
}
.jira-badge-epic.muted {
  background: var(--bg-surface-2);
  color: var(--ink-3);
  border: 1px solid var(--border);
}
a.jira-badge-link {
  text-decoration: none;
  color: inherit;
}
a.jira-badge-link:hover .jira-badge {
  text-decoration: underline;
}

/* ─── 9. Buttons (module-scoped helpers reuse styles.css .btn) ── */
.seg-pills { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.seg-pills button {
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-surface-2);
  font: 500 12px/1 var(--font);
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background 100ms, color 100ms, border-color 100ms;
}
.seg-pills button:hover { color: var(--ink-1); background: var(--bg-hover); }
.seg-pills button.active {
  background: var(--bg-surface);
  color: var(--ink-1);
  border-color: var(--border-2);
  box-shadow: 0 1px 0 rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.06);
}
.seg-pills button.jira-tab-alert {
  border-color: var(--warning);
  background: var(--warning-soft);
  color: #8a6a0a;
}
body.dark-mode .seg-pills button.jira-tab-alert { color: var(--warning); }
.seg-pills button.jira-tab-alert:not(.active):hover {
  background: var(--warning-soft);
  color: var(--warning);
}

/* ─── Jira admin page ─────────────────────────────────────────── */
.jira-page-card { max-width: 1180px; }
.jira-page-hd { margin-bottom: 16px; }
.jira-page-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink-1);
}
.jira-page-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--ink-3);
}
.jira-tabs { margin-bottom: 16px; }
.jira-panel { margin-top: 4px; }
.jira-panel-hd {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.jira-panel-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-1);
}
.jira-panel-sub {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 2px;
}
.jira-unmatched-badge { margin-left: 2px; }
.jira-empty {
  padding: 28px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-3);
  background: var(--bg-surface-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.jira-rules-table code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: var(--bg-surface-2);
  padding: 2px 6px;
  border-radius: 4px;
}
.jira-executions-table .jira-exec-rule-cell {
  min-width: 140px;
  max-width: 220px;
  font-size: 11.5px;
  line-height: 1.35;
}
.jira-exec-rule-pattern {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  word-break: break-word;
}
.jira-exec-payload-cell {
  min-width: 72px;
  vertical-align: top;
}
.jira-exec-payload {
  margin: 6px 0 0;
  padding: 8px 10px;
  max-width: 280px;
  max-height: 200px;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.jira-summary-cell {
  max-width: 200px;
  font-size: 11px;
  line-height: 1.35;
}
.jira-rule-prompt-lead {
  margin: 0 0 12px;
  line-height: 1.5;
  color: var(--ink-2);
}
.jira-rule-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.jira-rule-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface-2);
  cursor: pointer;
}
.jira-rule-option input { margin-top: 3px; flex-shrink: 0; }
.jira-rule-option strong {
  display: block;
  font-size: 13px;
  color: var(--ink-1);
}
.jira-rule-option-sub {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--ink-3);
  font-family: var(--font-mono);
  word-break: break-word;
}
.jira-rule-option-editable .jira-rule-pattern-input {
  display: block;
  width: 100%;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.bmodal.jira-rule-modal {
  width: min(640px, calc(100vw - 32px));
}
.jira-rule-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.jira-rule-form-name { display: block; }
.jira-rule-mode-pills { margin: 2px 0 4px; }
.jira-rule-compound-lead {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-3);
}
.jira-rule-compound-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.jira-compound-builder { display: flex; flex-direction: column; gap: 8px; }
.jira-compound-group {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-2, rgba(0, 0, 0, 0.02));
}
.jira-compound-group-hd {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.jira-compound-group-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 8px;
  border-left: 2px solid var(--border);
}
.jira-compound-leaf {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: 8px;
  align-items: center;
}
.jira-compound-group-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.jira-rule-simple-fields .fgrid,
.jira-rule-compound-fields .fgrid,
.jira-rule-form-target {
  gap: 12px;
}

/* ─── Profile / booking modals (inside #modal on /time) ─────── */
.bmodal-hd {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}
.bmodal-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink-1);
}
.bmodal-sub {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 2px;
}
.bmodal-x {
  width: 32px;
  height: 32px;
  padding: 0;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}
.bmodal-bd {
  padding: 16px 18px;
  overflow: auto;
  flex: 1;
  min-height: 0;
}
.bmodal-ft {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.bmodal.profile-modal { width: min(720px, calc(100vw - 32px)); }
.bmodal.rates-modal { width: min(520px, calc(100vw - 32px)); }
.bmodal.team-modal {
  width: min(520px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  max-height: min(88vh, 640px);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  overflow: hidden;
}
.team-section { margin-bottom: 16px; }
.team-section:last-child { margin-bottom: 0; }
.team-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  margin-bottom: 8px;
}
.team-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.team-empty { font-size: 12px; color: var(--ink-3); }
.team-person--inactive { opacity: 0.75; }
.team-person-tag {
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-3);
  margin-left: 4px;
}
.team-person {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms, border-color 120ms, color 120ms;
}
.team-person:hover { border-color: var(--accent); color: var(--ink-1); }
.team-person--in {
  background: var(--accent-soft, rgba(59, 130, 246, 0.12));
  border-color: var(--accent);
  color: var(--accent);
}
.team-person--out { background: var(--bg-surface); }
.proj-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}

.projects-page-hd {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.projects-page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.projects-client-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  max-width: min(52vw, 640px);
}
.projects-client-filter-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-surface, #fff);
  color: var(--ink-2);
  font-size: 11px;
  line-height: 1.2;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.projects-client-filter-btn:hover {
  color: var(--ink-1);
  background: var(--bg-hover);
}
.projects-client-filter-btn.active {
  color: var(--accent-contrast, #fff);
  background: var(--accent);
  border-color: var(--accent);
}

.proj-rows-wrap { margin-top: 4px; }
.proj-rows {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.proj-rows thead th {
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  color: var(--ink-3);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.proj-rows tbody td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.proj-row-check { width: 36px; text-align: center; }
.proj-row-check input { cursor: pointer; }
.proj-row-name { min-width: 160px; }
.proj-row-name-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.proj-client-sub {
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-secondary, #64748b);
  font-weight: 400;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.proj-row-name .proj-client-sub {
  padding-left: 0;
}
.proj-row-name .proj-row-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--ink-1);
  cursor: pointer;
  text-align: left;
}
.proj-row-name .proj-row-link:hover { color: var(--accent); text-decoration: underline; }
.proj-row-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.proj-row.proj-row--ok { box-shadow: inset 3px 0 0 var(--success); }
.proj-row.proj-row--over { box-shadow: inset 3px 0 0 var(--danger); }
.proj-row.proj-row--archived { box-shadow: none; }
.proj-archive-section {
  margin-top: 44px;
  padding: 20px 18px 18px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface-2, #f0eeeb);
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.proj-archive-section--rows .proj-rows-wrap {
  margin-top: 4px;
  background: color-mix(in srgb, var(--bg-surface) 55%, var(--bg-surface-2));
  border-color: color-mix(in srgb, var(--border) 55%, transparent);
}
.proj-archive-section .proj-card {
  background: color-mix(in srgb, var(--bg-surface) 88%, var(--bg-surface-2));
  border-color: color-mix(in srgb, var(--border) 80%, transparent);
}
.proj-section-hd {
  margin: 0 0 14px 2px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-3, #94a3b8);
}
.proj-row-archive { color: var(--ink-2, #64748b); }
.proj-row-archive:hover { background: color-mix(in srgb, var(--ink-2, #64748b) 12%, transparent); }
.proj-row-del { color: var(--danger); }
.proj-row-del:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); }

.proj-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 1180px) {
  .proj-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .proj-cards { grid-template-columns: 1fr; }
}
.proj-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-1);
  min-height: 360px;
  aspect-ratio: 1 / 1.05;
  max-height: 460px;
  display: flex;
  flex-direction: column;
}
.proj-card.proj-card--ok {
  border-color: var(--success);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--success) 35%, transparent);
}
.proj-card.proj-card--over {
  border-color: var(--danger);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--danger) 35%, transparent);
}
.proj-card.proj-card--archived {
  border-style: dashed;
  box-shadow: none;
  aspect-ratio: auto;
  min-height: 280px;
  max-height: none;
}
.proj-card-hd {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.proj-card-title-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.proj-card-title-wrap .proj-client-sub {
  padding: 0 2px 0 14px;
  font-size: 10px;
}
.proj-open-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-1);
  cursor: pointer;
  text-align: left;
  letter-spacing: -0.01em;
  line-height: 1.25;
  max-width: 100%;
  transition: border-color 120ms, color 120ms, background 120ms;
}
.proj-open-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft, rgba(59, 130, 246, 0.08));
}
.proj-card-hd .proj-row-actions { margin-left: auto; flex-shrink: 0; }
.proj-card-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.proj-card-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  flex-shrink: 0;
}
@media (max-width: 420px) {
  .proj-card-top { grid-template-columns: 1fr; }
}
.proj-budget-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
  max-width: 100%;
}
.proj-bar-row { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.proj-bar-line {
  font-size: 10px;
  color: var(--ink-3);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.proj-bar-line strong { color: var(--ink-2); font-weight: 600; }
.proj-bar-track {
  height: 6px;
  border-radius: 3px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: row;
  align-items: stretch;
}
.proj-bar-fill {
  height: 100%;
  min-width: 0;
  transition: width 200ms ease;
}
.proj-bar-fill.ok {
  border-radius: 2px 0 0 2px;
  background: linear-gradient(90deg, var(--success) 0%, color-mix(in srgb, var(--success) 82%, #fff) 100%);
}
.proj-bar-fill.over {
  border-radius: 0 2px 2px 0;
  background: linear-gradient(90deg, var(--danger) 0%, #e85d5d 100%);
}
.proj-bar-fill.neutral {
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2, var(--accent)) 100%);
}
.proj-bar-fill.ok:only-child { border-radius: 2px; }
.proj-bar-fill.none { width: 0 !important; min-width: 0; display: none; }
.proj-time-chart-wrap {
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.proj-time-chart-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  margin-bottom: 4px;
  flex-shrink: 0;
}
.proj-spend-chart-wrap {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: flex-end;
}
.proj-spend-chart {
  width: 100%;
  height: auto;
  min-height: 120px;
  max-height: 100%;
  display: block;
}
.proj-chart-grid {
  stroke: var(--border);
  stroke-width: 0.5;
  vector-effect: non-scaling-stroke;
}
.proj-chart-axis {
  stroke: var(--ink-3);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.proj-chart-y,
.proj-chart-x {
  fill: var(--ink-3);
  font-size: 10px;
  font-family: var(--font-sans, system-ui, sans-serif);
}
.proj-chart-area {
  stroke: none;
}
.proj-chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.proj-chart-plan {
  stroke: var(--ink-2);
  stroke-width: 1.25;
  stroke-dasharray: 5 4;
  opacity: 0.7;
  vector-effect: non-scaling-stroke;
}
.proj-chart-dot {
  fill: var(--accent);
  stroke: var(--bg-surface);
  stroke-width: 1;
}
.proj-bookers-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  margin-bottom: 4px;
}
.proj-bookers-wrap {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  align-self: stretch;
}
.proj-plan-link {
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: inherit;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
  display: inline;
  vertical-align: baseline;
}
.proj-plan-link:hover { color: var(--accent-2, var(--accent)); }
.bmodal.plan-modal { width: min(360px, calc(100vw - 32px)); }
.plan-form-grid {
  display: grid;
  gap: 12px;
}
.plan-form-grid label.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-2);
}
.proj-bookers {
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--ink-2);
  overflow: visible;
}
.proj-booker-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 0;
  border-bottom: 1px solid var(--border);
}
.proj-booker-row:last-child { border-bottom: none; }
.proj-booker-row .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-booker-row .val { color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.proj-chart-empty { font-size: 11px; color: var(--ink-3); font-style: italic; }

.profile-form-grid {
  display: grid;
  gap: 10px;
}
.profile-form-grid label.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-2);
}
.profile-form-grid .finput,
.profile-form-grid .fselect {
  width: 100%;
}
.profile-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.profile-sso-status { margin-bottom: 4px; }
.profile-sso-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 999px;
}
.profile-sso-badge.ok { background: #e8f5ee; color: #1a7f4b; }
.profile-sso-badge.warn { background: #fff4e5; color: #b45309; }
.profile-sso-badge.off { background: var(--surface-2, #f3f4f6); color: var(--ink-3); }
.profile-sso-hint { font-size: 11px; color: var(--ink-3); margin: 6px 0 0; line-height: 1.45; }
.profile-sso-check { flex-direction: row !important; align-items: center; gap: 8px !important; }
.profile-sso-check input { width: auto; }
.profile-sso-actions { margin-top: 8px; }
.profile-users-wrap {
  max-height: min(52vh, 420px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.profile-users-table { width: 100%; table-layout: fixed; }
.profile-users-table th,
.profile-users-table td {
  padding: 8px 10px;
  font-size: 12px;
  vertical-align: middle;
}
.profile-users-table .col-name { width: 28%; }
.profile-users-table .col-email { width: 36%; }
.profile-users-table .col-role { width: 22%; white-space: normal; word-break: break-word; }
.profile-users-table .col-admin { width: 52px; text-align: center; }
.profile-users-table .col-act { width: 132px; text-align: right; }
.profile-users-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}
.profile-user-actions {
  display: inline-flex;
  gap: 4px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.profile-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 13px;
  color: var(--ink-1);
  cursor: pointer;
}
.profile-check-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}
.profile-users-table .cell-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-rate-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.profile-rate-form label.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-2);
}

/* ─── Entry modals (add / edit booking) ─────────────────────── */
.bmodal.batch-entry-modal,
.bmodal.entry-edit-modal {
  width: 80vw;
  max-width: calc(100vw - 32px);
}
.entry-form-row--top {
  display: grid;
  grid-template-columns: minmax(140px, 22%) minmax(160px, 1fr);
  gap: 12px;
  align-items: start;
}
.entry-comment-textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  line-height: 1.45;
}

/* ─── Batch add entries modal ───────────────────────────────── */
.batch-entry-table-wrap {
  overflow: auto;
  max-height: min(56vh, 480px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.batch-entry-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.batch-entry-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg-surface-2);
  text-align: left;
  padding: 8px 10px;
  font-weight: 600;
  color: var(--ink-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.batch-entry-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.batch-entry-table tr.batch-row-warn td {
  background: var(--warning-soft);
}
.batch-entry-table .col-project { width: 140px; min-width: 120px; max-width: 160px; }
.batch-entry-table .col-date { width: 130px; }
.batch-entry-table .col-time { width: 120px; }
.batch-entry-table .col-comment { min-width: 280px; width: 40%; }
.batch-entry-table .col-comment { vertical-align: top; }
.batch-entry-table .col-amount { width: 110px; min-width: 110px; }
.batch-rate-hint {
  font-size: 10.5px;
  color: var(--ink-3);
  margin-top: 4px;
  line-height: 1.2;
}
.batch-entry-table select.finput,
.batch-entry-table input.finput,
.batch-entry-table textarea.finput {
  width: 100%;
  min-width: 0;
}
.batch-entry-table textarea.batch-comment {
  min-height: 72px;
  resize: vertical;
  line-height: 1.45;
}
.batch-time-inputs {
  display: flex;
  align-items: center;
  gap: 4px;
}
.batch-time-inputs .finput {
  width: 52px;
  text-align: center;
  padding-left: 6px;
  padding-right: 6px;
}
.batch-entry-hint {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 10px;
}

/* ─── 10. Matrix heatmap ────────────────────────────────────── */
.matrix-wrap {
  --matrix-namecol-w: 180px;
  --matrix-sumcol-w: 72px;
  --matrix-head-row-h: 48px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: auto;
  box-shadow: var(--shadow-1);
  max-height: min(72vh, 820px);
}
.matrix {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: 12px;
}
.matrix th, .matrix td { border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); }
.matrix thead th {
  background: var(--bg-surface-2);
  padding: 8px 6px;
  font-size: 10.5px; font-weight: 600;
  color: var(--ink-3);
  text-align: center;
  min-width: 38px;
}
.matrix thead tr.matrix-head-days th {
  position: sticky;
  top: 0;
  z-index: 3;
}
.matrix thead tr.matrix-head-total th {
  position: sticky;
  top: var(--matrix-head-row-h);
  z-index: 3;
  background: var(--bg-surface-2);
  border-bottom: 2px solid var(--border-2);
  color: var(--ink-1);
  font-size: 11.5px;
}
.matrix thead tr.matrix-head-total th.namecol {
  text-align: left;
  padding-left: 12px;
}
.matrix thead th.weekend { color: var(--ink-4); }
.matrix thead th.namecol,
.matrix tbody td.namecol {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--bg-surface);
  text-align: left;
  min-width: var(--matrix-namecol-w);
  width: var(--matrix-namecol-w);
  padding: 8px 12px;
  box-shadow: 1px 0 0 var(--border);
}
.matrix thead th.sumcol,
.matrix tbody td.sumcol {
  position: sticky;
  left: var(--matrix-namecol-w);
  z-index: 2;
  background: var(--bg-surface);
  text-align: center;
  min-width: var(--matrix-sumcol-w);
  width: var(--matrix-sumcol-w);
  padding: 8px 6px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  box-shadow: 1px 0 0 var(--border);
}
.matrix thead th.namecol,
.matrix thead th.sumcol {
  background: var(--bg-surface-2);
}
.matrix thead tr.matrix-head-days th.namecol,
.matrix thead tr.matrix-head-days th.sumcol,
.matrix thead tr.matrix-head-total th.namecol,
.matrix thead tr.matrix-head-total th.sumcol {
  z-index: 5;
}
.matrix tbody td {
  text-align: center;
  padding: 0;
  height: 38px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-1);
  cursor: default;
  position: relative;
}
.matrix tbody td.sumcol {
  padding: 8px 6px;
  height: auto;
}
.matrix .hcell {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  font-size: 11.5px; font-weight: 500;
  transition: outline 80ms;
}
.matrix .hcell:hover { outline: 2px solid var(--accent); outline-offset: -2px; z-index: 1; }
.matrix .namecol .who { display: flex; align-items: center; gap: 8px; }
.matrix .avatar-sm {
  width: 24px; height: 24px; border-radius: 7px;
  display: grid; place-items: center;
  color: #fff; font-size: 10px; font-weight: 600; flex-shrink: 0;
}
.matrix tfoot:empty { display: none; }
/* heat levels */
.heat-0 { background: transparent; color: var(--ink-4); }
.heat-1 { background: var(--accent-soft); }
.heat-2 { background: var(--accent-soft-2); }
.heat-3 { background: var(--accent); color: #fff; }
.heat-4 { background: var(--accent-2); color: #fff; }
.heat-over { background: var(--danger-soft); color: var(--danger); box-shadow: inset 0 0 0 1.5px var(--danger); font-weight: 700; }
.matrix td.weekendcol { background: var(--bg-surface-2); }

.matrix-admin-panel {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.matrix-admin-title {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 600;
}
.matrix-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.matrix-admin-card h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}
.matrix-admin-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.matrix-admin-hint {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.45;
}
.matrix-admin-hint code {
  font-size: 11px;
  background: var(--bg-surface-2);
  padding: 1px 5px;
  border-radius: 4px;
}
.matrix-admin-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.matrix-admin-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-2);
}
.matrix-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.matrix-admin-result {
  margin: 12px 0 0;
  padding: 10px 12px;
  font-size: 11px;
  line-height: 1.45;
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  max-height: 160px;
  overflow: auto;
  white-space: pre-wrap;
}
.matrix-admin-result-detail {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 10px;
  line-height: 1.4;
  color: var(--text-secondary, #64748b);
  white-space: normal;
}
.matrix-help-btn {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-surface-2);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}
.matrix-help-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Мій букінг — календар (проекти × дні) */
.my-booking-matrix thead th .day-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-1);
  line-height: 1.2;
}
.my-booking-matrix thead th .day-dow {
  font-size: 10px;
  color: var(--ink-3);
  margin-top: 2px;
}
.my-booking-matrix tbody tr.summary-row td.namecol {
  font-weight: 600;
  font-size: 11.5px;
  color: var(--ink-2);
  background: var(--bg-surface-2);
}
.my-booking-matrix tbody tr.summary-row td.valcell {
  font-weight: 600;
  font-size: 11.5px;
  padding: 6px 4px;
  background: var(--bg-surface-2);
}
.my-booking-matrix tr.row-spacer td {
  height: 8px;
  padding: 0;
  border-bottom: none;
  background: var(--bg-app);
}
.my-booking-matrix tr.row-spacer td.namecol {
  background: var(--bg-app);
  box-shadow: none;
}
.my-booking-matrix tr.row-spacer td.spacer-cell {
  background: var(--bg-app);
}
.my-booking-matrix tr.project-row td.namecol .project-name-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  max-width: 200px;
}
.my-booking-matrix tr.project-row td.namecol .project-label {
  font-weight: 500;
  font-size: 12px;
  color: var(--ink-1);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.my-booking-matrix tr.project-row td.namecol .proj-client-sub {
  font-size: 10px;
  line-height: 1.3;
  max-width: 100%;
}
.my-booking-matrix tr.project-row.no-booking td.namecol .project-label {
  color: var(--ink-4);
}
.my-booking-matrix tr.project-row td.valcell {
  font-size: 11.5px;
  padding: 6px 4px;
}
.my-booking-matrix tr.summary-hours td.valcell[title],
.my-booking-matrix tr.project-row td.valcell[title] {
  cursor: help;
}
.my-booking-matrix thead th.namecol,
.my-booking-matrix tbody td.namecol {
  min-width: 120px;
  max-width: 200px;
}

.heat-legend { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ink-3); }
.heat-legend .sw { width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--border); }

/* ─── 11. Drawer ────────────────────────────────────────────── */
.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(20,15,5,0.4);
  backdrop-filter: blur(2px);
  z-index: 900;
  animation: fadeIn 120ms;
}
body.dark-mode .drawer-overlay { background: rgba(0,0,0,0.55); }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 420px; max-width: 90vw;
  background: var(--bg-surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-pop);
  z-index: 901;
  display: flex; flex-direction: column;
  animation: drawer-in 200ms cubic-bezier(0.2,0.8,0.2,1);
}
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0.4; } to { transform: translateX(0); opacity: 1; } }
.drawer-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.drawer-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.drawer-head .sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 18px; }
.drawer-foot { padding: 12px 18px; border-top: 1px solid var(--border); background: var(--bg-surface-2); display: flex; gap: 8px; justify-content: flex-end; }

/* ─── 12. Kanban (funnel) ───────────────────────────────────── */
.kanban {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 1fr);
  gap: 14px;
  align-items: start;
  padding-bottom: 8px;
  overflow-x: auto;
}
.kanban::-webkit-scrollbar { height: 10px; }
.kanban::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 5px; border: 2px solid transparent; background-clip: content-box; }
.kcol {
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex; flex-direction: column;
  min-height: 200px;
}
.kcol-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px 10px;
}
.kcol-head .ktitle { font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.kcol-head .kdot { width: 8px; height: 8px; border-radius: 50%; }
.kcol-head .ksum { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.kcol-body { padding: 0 10px 10px; display: flex; flex-direction: column; gap: 8px; }
.kcard {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
  box-shadow: var(--shadow-1);
  cursor: grab;
  transition: transform 80ms, box-shadow 80ms, border-color 80ms;
}
.kcard:hover { box-shadow: var(--shadow-2); border-color: var(--border-2); transform: translateY(-1px); }
.kcard:active { cursor: grabbing; }
.kcard .kc-title { font-size: 13px; font-weight: 600; color: var(--ink-1); margin-bottom: 4px; line-height: 1.3; }
.kcard .kc-client { font-size: 11.5px; color: var(--ink-3); display: flex; align-items: center; gap: 5px; margin-bottom: 8px; }
.kcard .kc-foot { display: flex; align-items: center; justify-content: space-between; }
.kcard .kc-val { font-size: 13px; font-weight: 600; color: var(--ink-1); font-variant-numeric: tabular-nums; }
.kcard .kc-prob { font-size: 11px; color: var(--ink-3); }
.kcard .kc-owner {
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font-size: 9.5px; font-weight: 600;
}
.kprogress { height: 4px; border-radius: 2px; background: var(--bg-surface-2); overflow: hidden; margin-top: 8px; border: 1px solid var(--border); }
.kprogress > span { display: block; height: 100%; }
.kadd {
  margin: 0 10px 10px;
  height: 32px; border: 1px dashed var(--border-2);
  border-radius: 8px; background: transparent;
  color: var(--ink-3); font-size: 12px; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.kadd:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.kempty {
  margin: 4px 10px 12px; padding: 24px 12px;
  border: 1px dashed var(--border-2);
  border-radius: 8px;
  text-align: center;
  font-size: 12px; color: var(--ink-4);
}

/* Funnel modal + archive */
.funnel-modal {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}
.funnel-modal-lg { width: 100%; max-width: 100%; box-sizing: border-box; }
/* Lead / project funnel cards — stable 2/3 viewport width (beats CRM max-w-chart-* leftovers) */
body.timero-page-time #modal-content:has(.funnel-modal:not(.funnel-modal-sm)),
body.timero-page-time #modal-content:has(.project-edit-modal),
body.timero-page-time #modal-content:has(.funnel-modal-lg),
body.timero-page-time #modal-content:has(.funnel-modal-chart) {
  width: min(66.6667vw, calc(100vw - 32px)) !important;
  max-width: min(66.6667vw, calc(100vw - 32px)) !important;
  overflow-x: hidden !important;
  box-sizing: border-box !important;
}
body.timero-page-time #modal-content:has(.funnel-modal-sm) {
  width: min(420px, calc(100vw - 32px)) !important;
  max-width: calc(100vw - 32px) !important;
  overflow-x: hidden !important;
  box-sizing: border-box !important;
}
.funnel-form-1col { grid-template-columns: 1fr !important; width: 100%; min-width: 0; }
.funnel-form-1col .fgrid-span-2 { grid-column: 1 / -1; }
.funnel-form-1col label,
.funnel-form.fgrid label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
}
.funnel-form-1col .finput,
.funnel-form-1col .fselect,
.funnel-form-1col textarea,
.funnel-form-1col select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
}
.funnel-card-tabs.seg-pills { width: 100%; max-width: 100%; }
.funnel-modal-foot-split { flex-wrap: wrap; gap: 8px; }
.funnel-modal-foot-split .funnel-modal-foot-right { flex-wrap: wrap; }
.funnel-history-forms .funnel-file-form,
.funnel-history-forms .funnel-comment-form {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.funnel-history-forms .funnel-file-form.funnel-file-form-inline {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
.funnel-history-forms .funnel-file-form-inline .funnel-history-file-input,
.funnel-history-forms .funnel-file-form-inline .funnel-history-file-comment-input {
  flex: 1 1 0;
  min-width: 0;
  width: 0;
}
.funnel-history-forms .funnel-file-form-inline .funnel-history-file-comment-input {
  min-height: 36px;
  max-height: 56px;
  resize: none;
}
.funnel-history-forms .funnel-file-form-inline .btn,
.funnel-history-forms .funnel-comment-form .btn {
  align-self: auto;
  flex-shrink: 0;
}
.funnel-history-forms .funnel-comment-form .btn { align-self: flex-start; }
.funnel-history-comment-input {
  min-height: 0;
  resize: vertical;
  line-height: 1.45;
}
.funnel-history-file-comment-input {
  resize: vertical;
  font-size: 12.5px;
  line-height: 1.4;
}
.funnel-history-file-input { font-size: 12.5px; }
.funnel-history-divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 4px 0 14px;
}
.funnel-history-v-files .v-files { display: flex; flex-direction: column; gap: 3px; }
.funnel-history-v-files .v-file,
.funnel-history-item .v-file {
  display: grid;
  grid-template-columns: 28px auto 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 4px 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.funnel-history-v-files .v-file:hover,
.funnel-history-item .v-file:hover {
  border-color: var(--border-2);
}
.funnel-history-v-files .v-file-leading-actions,
.funnel-history-item .v-file-leading-actions {
  display: flex;
  gap: 1px;
  flex-shrink: 0;
}
.funnel-history-v-files .v-file-ext,
.funnel-history-item .v-file-ext {
  width: 28px;
  height: 22px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 600;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-2);
  color: var(--ink-2);
}
.funnel-history-v-files .v-file-ext.ext-pdf,
.funnel-history-item .v-file-ext.ext-pdf { background: var(--danger-soft); border-color: #f3b6b6; color: var(--danger); }
.funnel-history-v-files .v-file-ext.ext-xlsx,
.funnel-history-v-files .v-file-ext.ext-xls,
.funnel-history-item .v-file-ext.ext-xlsx,
.funnel-history-item .v-file-ext.ext-xls { background: var(--success-soft); border-color: #b8e0c9; color: var(--success); }
.funnel-history-v-files .v-file-ext.ext-docx,
.funnel-history-v-files .v-file-ext.ext-doc,
.funnel-history-v-files .v-file-ext.ext-odt,
.funnel-history-item .v-file-ext.ext-docx,
.funnel-history-item .v-file-ext.ext-doc,
.funnel-history-item .v-file-ext.ext-odt { background: #e1ebff; border-color: #c3d4f6; color: #2854b6; }
.funnel-history-v-files .v-file-ext.ext-dwg,
.funnel-history-item .v-file-ext.ext-dwg { background: #f3e8ff; border-color: #d6c3f6; color: #5a2dc5; }
.funnel-history-v-files .v-file-ext.ext-jpg,
.funnel-history-v-files .v-file-ext.ext-png,
.funnel-history-item .v-file-ext.ext-jpg,
.funnel-history-item .v-file-ext.ext-png { background: var(--accent-soft); border-color: var(--accent-soft-2); color: var(--accent-2); }
.funnel-history-v-files .v-file-name,
.funnel-history-item .v-file-name {
  font-size: 11.5px;
  color: var(--ink-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.funnel-history-v-files .v-file-size,
.funnel-history-item .v-file-size {
  font-size: 10px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.funnel-history-v-files .v-file-leading-actions .act,
.funnel-history-item .v-file-leading-actions .act {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  cursor: pointer;
  text-decoration: none;
}
.funnel-history-v-files .v-file-leading-actions .act:hover,
.funnel-history-item .v-file-leading-actions .act:hover {
  background: var(--bg-hover);
  color: var(--ink-1);
}
.funnel-history-file-comment {
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-2);
  white-space: pre-wrap;
  line-height: 1.45;
}
.funnel-attachment-image-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  max-height: 70vh;
  overflow: auto;
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.funnel-attachment-image-preview img {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  width: auto;
  height: auto;
  object-fit: contain;
}
.funnel-modal-sm { min-width: min(420px, 92vw); }
.funnel-modal-title { margin: 0 0 4px; font-size: 18px; font-weight: 600; }
.project-edit-modal {
  display: flex;
  flex-direction: column;
  max-height: min(58vh, 520px);
  min-height: 0;
}
.project-modal-hd {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-surface);
}
.project-modal-title {
  margin: 0;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-modal-hd-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.project-modal-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
}
.funnel-lead-process-charts-wrap { grid-column: 1 / -1; margin-bottom: 8px; }
.funnel-lead-process-toolbar-row { grid-column: 1 / -1; margin-bottom: 12px; }
.funnel-lead-process-toolbar-row-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}
.funnel-lead-process-pick {
  flex: 0 1 240px;
  width: min(240px, 52%);
  min-width: 0;
  max-width: 100%;
}
.funnel-lead-process-toolbar-row-inner .timero-btn-quick-chart {
  flex-shrink: 0;
}
.funnel-lead-process-charts {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.funnel-lead-process-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-surface);
}
.funnel-lead-process-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.funnel-lead-process-head-main { min-width: 0; flex: 1; }
.funnel-lead-process-chart-view .gantt-scroll {
  max-height: min(42vh, 360px);
}
.funnel-modal-sub { margin: 0 0 16px; font-size: 13px; color: var(--ink-3); }
.funnel-form { gap: 12px; }
.funnel-form-2col { grid-template-columns: 1fr; }
.funnel-process-link {
  background: none; border: none; padding: 0; font: inherit; font-weight: 600;
  color: var(--accent); cursor: pointer; text-align: left;
}
.funnel-process-link:hover { text-decoration: underline; }
.project-processes-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.funnel-form .fgrid-span-2 { grid-column: 1 / -1; }
.funnel-form-hint { margin: 0; font-size: 12px; color: var(--ink-3); line-height: 1.45; }
.funnel-linked-project-actions { margin-top: 8px; }
.funnel-card-tabs { margin: 12px 0 14px; }
.funnel-lead-card-modal .funnel-modal-title { margin: 0 0 10px; }
.funnel-lead-modal-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.funnel-lead-modal-hd .funnel-card-tabs {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}
.funnel-lead-modal-hd .funnel-card-tabs.seg-pills {
  /* Prevent tabs from forcing actions to wrap under them. */
  width: auto;
  max-width: none;
}
.funnel-lead-modal-hd .funnel-modal-hd-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.funnel-card-panel { min-height: 180px; max-height: 52vh; overflow-y: auto; padding-right: 2px; }
.funnel-modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.funnel-modal-foot-split { justify-content: space-between; }
.funnel-modal-foot-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.funnel-modal-foot-right { display: flex; align-items: center; gap: 8px; }
.funnel-comment-item { padding: 10px 0; border-bottom: 1px solid var(--border); }
.funnel-comment-meta { font-size: 12px; color: var(--ink-3); margin-bottom: 4px; }
.funnel-comment-form { display: flex; gap: 8px; margin-top: 12px; }
.funnel-comment-form .finput { flex: 1; }
.funnel-process-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.funnel-process-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--bg-surface);
}
.funnel-process-name { font-size: 13px; font-weight: 600; }
.funnel-process-meta { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.funnel-process-assign { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.funnel-process-assign .finput { flex: 1 1 100%; min-width: 0; }
.funnel-card-panel { max-height: min(58vh, 520px); overflow-y: auto; overflow-x: hidden; }
.funnel-process-create { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.funnel-process-create .finput { flex: 1; }
.funnel-history-forms { display: flex; flex-direction: column; gap: 12px; margin-bottom: 0; }
.funnel-file-form, .funnel-comment-form { display: flex; gap: 8px; align-items: center; }
.funnel-file-form .finput, .funnel-comment-form .finput { flex: 1; }
.funnel-history-list { display: flex; flex-direction: column; gap: 10px; }
.funnel-history-item { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-surface); }
.funnel-history-meta { font-size: 12px; color: var(--ink-3); margin-bottom: 6px; }
.funnel-history-body { font-size: 13px; color: var(--ink-1); white-space: pre-wrap; }
.project-processes-block { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.project-processes-title { margin: 0 0 10px; font-size: 14px; font-weight: 600; }
.worker-expenses-block { margin-top: 16px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-surface); }
.worker-expenses-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.worker-expenses-head h2 { margin: 0; font-size: 14px; font-weight: 600; }
.worker-expenses-hint { margin: 0 0 10px; font-size: 12px; color: var(--ink-3); }
.booking-calendar-hint {
  margin: 0 0 12px;
  padding: 10px 14px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-2);
  background: var(--planned-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.matrix-exp-note { font-size: 10px; color: var(--warning); font-weight: 500; margin-top: 2px; }
.matrix-exp-cell { font-size: 10px; color: var(--warning); font-weight: 600; margin-top: 2px; line-height: 1.2; }

.matrix-view-panels { margin-top: 0; }
.matrix-entries-wrap { margin-top: 0; }
.matrix-entries-table .matrix-worker-head td,
.matrix-entries-table .matrix-jira-head td,
.matrix-entries-table .matrix-epic-head td {
  background: var(--bg-surface-2);
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
}
.matrix-group-head-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.matrix-worker-head-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.matrix-worker-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--ink-1);
}
.matrix-group-total-h,
.matrix-group-total-a {
  font-weight: 700;
  font-size: 13px;
  color: var(--ink-1);
}
.matrix-worker-total {
  margin-left: auto;
  font-size: 12px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.matrix-group-col-head {
  cursor: pointer;
  user-select: none;
  transition: color 0.12s ease;
}
.matrix-group-col-head:hover {
  color: var(--accent);
}
.matrix-group-col-head--active {
  color: var(--accent-2);
  font-weight: 700;
}
.matrix-issue-empty-label {
  font-weight: 700;
  font-size: 13px;
  color: var(--ink-2);
}
.matrix-entries-table--by-issue .matrix-jira-head .matrix-group-head-inner,
.matrix-entries-table--by-issue .matrix-epic-head .matrix-group-head-inner {
  gap: 8px;
}
.matrix-entry-user-cell {
  vertical-align: top;
  min-width: 150px;
}
.matrix-entry-user {
  display: flex;
  align-items: center;
  gap: 8px;
}
.matrix-entry-user-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--ink-1);
  line-height: 1.3;
}
.matrix-entry-date {
  margin-top: 4px;
  font-size: 11px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.matrix-entries-table--by-issue .matrix-issue-entry td {
  vertical-align: top;
}
.matrix-issue-separator td {
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
}
.matrix-issue-sep-bar {
  height: 4px;
  margin: 14px 0 2px;
  border-radius: 2px;
  background: var(--border-strong);
}
.matrix-issue-summary-head td {
  border-bottom: 2px solid var(--border-strong) !important;
}
.matrix-issue-summary-kicker {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  margin-right: 4px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-2);
  background: var(--accent-soft);
}
.matrix-entries-table--by-issue .matrix-issue-summary-head .matrix-group-total-h,
.matrix-entries-table--by-issue .matrix-issue-summary-head .matrix-group-total-a {
  color: var(--accent-2);
  font-size: 14px;
}
.matrix-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 10px 2px 0;
}
.matrix-pagination-meta {
  font-size: 12px;
  color: var(--ink-3);
}
.matrix-pagination-actions {
  display: flex;
  gap: 8px;
}
.stat-tile.expenses .val { font-size: 20px; }

/* Stacked modal layer (process chart over lead form) */
.modal-stack-layer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: rgba(15, 23, 42, 0.55);
  overflow-y: auto;
}
.modal-stack-panel {
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  overflow-x: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-3);
  padding: 20px 22px;
  box-sizing: border-box;
}
.modal-stack-panel.modal-stack-panel--wide {
  width: min(960px, calc(100vw - 32px));
}
.modal-stack-layer.modal-stack-layer--crm-chart {
  background: rgba(20, 15, 5, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
  z-index: 100;
}
body.timero-crm-embed-open #modal {
  visibility: hidden !important;
  pointer-events: none !important;
}
.modal-stack-panel.modal-stack-panel--crm-chart {
  width: min(84.6vw, 1548px);
  max-width: none;
  max-height: min(82.8vh, 1062px);
  height: min(82.8vh, 1062px);
  padding: 0;
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-3);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  flex-shrink: 0;
}
.modal-stack-panel.modal-stack-panel--crm-chart .crm-process-chart-frame--embed {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  line-height: normal;
}


/* Inline / draft process mini-chart */
.time-process-chart {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface-2);
  padding: 12px;
  overflow-x: auto;
}
.time-process-chart-inline { margin-bottom: 14px; }
.time-chart-scale {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--ink-3);
  margin-bottom: 8px;
  padding-left: 120px;
}
.time-chart-row {
  display: grid;
  grid-template-columns: 112px minmax(200px, 1fr);
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.time-chart-label { font-size: 12px; font-weight: 500; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.time-chart-track {
  position: relative;
  height: 28px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.time-chart-bar {
  position: absolute;
  top: 4px;
  height: 20px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  min-width: 4px;
}
.time-chart-empty { font-size: 12px; color: var(--ink-3); padding: 8px 0; }
.time-chart-draft-tasks { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.time-chart-draft-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px 72px;
  gap: 8px;
  align-items: end;
}
.time-chart-draft-row label { font-size: 11px; color: var(--ink-3); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.funnel-archive-section { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }
.funnel-archive-panel { margin-top: 12px; }

/* ─── 13. Toasts ────────────────────────────────────────────── */
.toast-stack {
  position: fixed; bottom: 20px; right: 20px;
  z-index: 2000;
  display: flex; flex-direction: column; gap: 10px;
  align-items: flex-end;
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  min-width: 280px; max-width: 380px;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--ink-4);
  border-radius: 10px;
  box-shadow: var(--shadow-pop);
  animation: toast-in 200ms cubic-bezier(0.2,0.8,0.2,1);
}
@keyframes toast-in { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toast.ok { border-left-color: var(--success); }
.toast.err { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--info); }
.toast .ticon { flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; }
.toast.ok .ticon { color: var(--success); }
.toast.err .ticon { color: var(--danger); }
.toast.info .ticon { color: var(--info); }
.toast .tbody { flex: 1; }
.toast .ttitle { font-size: 13px; font-weight: 600; color: var(--ink-1); }
.toast .tmsg { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.toast .tclose { border: 0; background: transparent; color: var(--ink-4); width: 20px; height: 20px; border-radius: 5px; display: grid; place-items: center; }
.toast .tclose:hover { background: var(--bg-hover); color: var(--ink-1); }

/* ─── 14. Loading / skeleton ────────────────────────────────── */
.skel { background: linear-gradient(90deg, var(--bg-surface-2) 25%, var(--bg-hover) 50%, var(--bg-surface-2) 75%); background-size: 200% 100%; animation: skel 1.3s infinite; border-radius: 6px; }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid var(--border-2);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── 15. Empty / error states ──────────────────────────────── */
.tstate {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 56px 24px;
  text-align: center;
}
.tstate .ic {
  width: 52px; height: 52px; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  color: var(--ink-4);
  margin-bottom: 14px;
}
.tstate.error .ic { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.tstate .st-title { font-size: 15px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.tstate .st-sub { font-size: 13px; color: var(--ink-3); max-width: 360px; margin-bottom: 16px; }

/* ─── 16. Forms (reuse styles.css, add inline-grid helpers) ──── */
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fgrid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.frow { display: flex; flex-direction: column; gap: 5px; }
.frow > label { font-size: 11.5px; font-weight: 500; color: var(--ink-2); }
.finput, .fselect, .ftextarea {
  height: 36px; padding: 0 11px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-surface); color: var(--ink-1);
  font-size: 13px; outline: none; width: 100%;
}
.ftextarea { height: auto; padding: 9px 11px; min-height: 76px; resize: vertical; line-height: 1.5; }
.finput:focus, .fselect:focus, .ftextarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.finput::placeholder, .ftextarea::placeholder { color: var(--ink-4); }
.finput.err, .fselect.err { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.field-err { font-size: 11px; color: var(--danger); display: flex; align-items: center; gap: 4px; }
.field-hint { font-size: 11px; color: var(--ink-3); }
.finput:disabled, .fselect:disabled { background: var(--planned-soft); color: var(--ink-4); cursor: not-allowed; }
.input-prefix { position: relative; display: flex; align-items: center; }
.input-prefix .pfx { position: absolute; left: 11px; color: var(--ink-3); font-size: 13px; pointer-events: none; }
.input-prefix .finput { padding-left: 26px; }

/* payroll accrued warning */
.payroll-warning-banner {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px;
  background: var(--warn-soft, #fff8e6);
  border: 1px solid var(--warn-border, #f0d78c);
  border-radius: 10px;
  font-size: 12.5px; color: var(--ink-2);
  margin-bottom: 14px;
}

/* locked banner */
.locked-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--planned-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 12.5px; color: var(--ink-2);
  margin-bottom: 14px;
}
.locked-banner .lk { color: var(--ink-3); flex-shrink: 0; }

/* avatar generic */
.avatar-chip {
  width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 600; flex-shrink: 0;
}
.who-cell { display: flex; align-items: center; gap: 10px; }
.who-cell .nm { font-weight: 500; color: var(--ink-1); }
.who-cell .rl { font-size: 11px; color: var(--ink-3); }

/* accordion */
.accordion { display: flex; flex-direction: column; gap: 10px; }
.acc-item { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-1); }
.acc-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: default; }
.acc-head:hover { background: var(--bg-hover); }
.acc-head .ac-month { font-size: 13.5px; font-weight: 600; text-transform: capitalize; }
.acc-head .ac-meta { font-size: 12px; color: var(--ink-3); margin-left: auto; display: flex; gap: 14px; font-variant-numeric: tabular-nums; }
.acc-head .chev { color: var(--ink-3); transition: transform 150ms; }
.acc-item.collapsed .chev { transform: rotate(-90deg); }

/* mini progress bar for budget */
.budget-bar { height: 6px; border-radius: 3px; background: var(--bg-surface-2); overflow: hidden; border: 1px solid var(--border); min-width: 90px; }
.budget-bar > span { display: block; height: 100%; background: var(--success); }
.budget-bar.warn > span { background: var(--warning); }
.budget-bar.over > span { background: var(--danger); }

/* tabs inside panel/drawer */
.mini-tabs { display: inline-flex; gap: 2px; background: var(--bg-surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 2px; }
.mini-tabs button { height: 28px; padding: 0 12px; border: 0; background: transparent; border-radius: 7px; font-size: 12.5px; font-weight: 500; color: var(--ink-3); }
.mini-tabs button.active { background: var(--bg-surface); color: var(--ink-1); box-shadow: var(--shadow-1); }

/* simple bar chart (project stats) */
.minibars { display: flex; align-items: flex-end; gap: 6px; height: 80px; }
.minibars .mb { flex: 1; background: var(--accent-soft); border-radius: 4px 4px 0 0; position: relative; min-height: 4px; }
.minibars .mb.cur { background: var(--accent); }

/* funnel project panel value cards */
.kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kv { background: var(--bg-surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.kv .k { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em; }
.kv .v { font-size: 16px; font-weight: 600; color: var(--ink-1); font-variant-numeric: tabular-nums; margin-top: 2px; }

/* ─── Payroll adjustments ───────────────────────────────────── */
.adj-btn {
  border: 0; background: transparent; padding: 0;
  display: inline-flex; align-items: center;
}
.adj-add {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 500;
  color: var(--ink-3);
  padding: 3px 9px;
  border: 1px dashed var(--border-2);
  border-radius: 7px;
}
.adj-btn:hover .adj-add { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.adj-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600;
  padding: 3px 6px 3px 9px;
  border-radius: 7px;
  font-variant-numeric: tabular-nums;
  border: 1px solid;
}
.adj-chip.pos { background: var(--success-soft); color: var(--success); border-color: transparent; }
.adj-chip.neg { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.adj-chip .adj-count {
  display: inline-grid; place-items: center;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px;
  background: rgba(0,0,0,0.10);
  font-size: 10px; font-weight: 700;
}
body.dark-mode .adj-chip .adj-count { background: rgba(255,255,255,0.14); }
.adj-btn:hover .adj-chip { filter: brightness(0.97); outline: 1px solid currentColor; }

.adj-row {
  display: grid;
  grid-template-columns: 92px 1fr 28px;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.adj-row .adj-amt { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.adj-row .adj-amt.pos { color: var(--success); }
.adj-row .adj-amt.neg { color: var(--danger); }
.adj-row .adj-comment { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 8px; }
.adj-row .adj-conv { font-size: 11px; color: var(--ink-4); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.adj-hint {
  font-size: 11.5px; color: var(--ink-2);
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 11px;
  margin-bottom: 10px;
  font-variant-numeric: tabular-nums;
}

.payroll-fx-prefix { display: inline-flex; align-items: center; max-width: 120px; }
.payroll-fx-prefix .pfx { position: static; transform: none; margin-right: 6px; flex-shrink: 0; }
.payroll-fx-prefix .finput--fx { width: 72px; min-width: 72px; padding-left: 10px; }
.payroll-period-hint { line-height: 1.4; }

.salary-history-cards { display: flex; flex-direction: column; gap: 10px; }
.salary-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--bg-surface);
}
.salary-card-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.salary-card-period { font-weight: 600; font-size: 13px; }
.salary-card-date { font-size: 12px; color: var(--ink-3); }
.salary-card-stats { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; margin-bottom: 6px; }
.salary-card-stats .salary-uah { color: var(--accent-2, #ea8b51); }
.salary-card-meta { font-size: 12px; color: var(--ink-3); margin-bottom: 10px; }
.worker-salary-block h2 { font-size: 14px; font-weight: 600; margin: 0; }

.payroll-report-actions { display: inline-flex; align-items: center; gap: 2px; }
.payroll-report-actions .act {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border: none; background: transparent;
  color: var(--ink-3); border-radius: 6px; cursor: pointer; text-decoration: none;
}
.payroll-report-actions .act:hover { background: var(--bg-surface-2); color: var(--ink-1); }
.salary-card-foot { font-size: 12px; color: var(--ink-3); margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.salary-card--rich { padding: 16px 18px; }
.salary-card-kicker { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-3); margin-bottom: 4px; }
.salary-card-lead { font-size: 13px; color: var(--ink-2); line-height: 1.45; margin: 0 0 14px; }
.salary-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px 16px;
  margin: 0 0 14px;
}
.salary-card-grid > div { min-width: 0; }
.salary-card-grid dt { font-size: 11px; color: var(--ink-3); margin-bottom: 2px; }
.salary-card-grid dd { font-size: 14px; font-weight: 600; margin: 0; font-variant-numeric: tabular-nums; }
.salary-card-total dd { color: var(--accent-2, #ea8b51); font-size: 16px; }
.salary-card-report {
  margin-top: 4px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--bg-surface-2, rgba(0,0,0,0.03));
  border: 1px solid var(--border);
}
.salary-card-report-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.salary-card-report-hint { font-size: 12px; color: var(--ink-3); line-height: 1.4; margin: 0 0 10px; }
.salary-card-report-actions .payroll-report-actions--labeled { flex-wrap: wrap; }

.payroll-run-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.payroll-run-status--active { background: rgba(34, 197, 94, 0.12); color: #15803d; }
.payroll-run-status--reversed { background: rgba(148, 163, 184, 0.2); color: var(--ink-3); }

.payroll-history-hint { font-size: 12px; color: var(--ink-3); margin: 0 0 10px; line-height: 1.4; }
.payroll-runs-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.payroll-run-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 13px;
  margin-bottom: 10px;
  color: var(--ink-2);
}
.payroll-run-detail-hint { font-size: 12px; color: var(--ink-3); margin: 0 0 12px; line-height: 1.4; }
.payroll-run-detail-modal { min-width: 0; width: 100%; }
body.timero-page-time #modal-content:has(.payroll-run-detail-modal) {
  width: min(960px, calc(100vw - 32px)) !important;
  max-width: min(960px, calc(100vw - 32px)) !important;
  overflow-x: auto !important;
  box-sizing: border-box !important;
}
.payroll-run-detail-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  box-shadow: none;
}
.payroll-run-detail-table th:last-child,
.payroll-run-detail-table td.payroll-run-detail-report {
  min-width: 72px;
  width: 72px;
}
.payroll-period-cell { min-width: 0; }
.payroll-period-name { font-weight: 600; font-size: 13px; line-height: 1.35; }
.payroll-period-dates { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.salary-card-period--named { font-size: 16px; }
.salary-card-period-dates { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.salary-card-report-actions .payroll-report-actions { gap: 2px; }
.salary-card-report-col dd { font-weight: 400; }
.salary-card-report-col .payroll-report-actions { margin-top: 2px; }
.salary-card--my .salary-card-report-col--my {
  grid-column: 1 / -1;
  margin-top: 6px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--accent-soft-2);
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--bg-surface) 72%);
}
.salary-card--my .salary-card-report-label {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-2);
  margin-bottom: 10px;
  letter-spacing: 0.01em;
}
.salary-card--my .salary-card-report-col--my dd {
  margin: 0;
  font-weight: 400;
}
.payroll-report-actions--salary-prominent {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.payroll-report-actions--salary-prominent .salary-pdf-open-btn,
.payroll-report-actions--salary-prominent .salary-pdf-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 16px;
  min-height: 42px;
}
.payroll-report-actions--salary-prominent .salary-pdf-open-btn {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  border-color: var(--accent-2);
  color: #fff;
  box-shadow: var(--shadow-1);
}
.payroll-report-actions--salary-prominent .salary-pdf-open-btn:hover {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: #fff;
  box-shadow: var(--shadow-2);
}
.payroll-report-actions--salary-prominent .salary-pdf-download-btn {
  background: var(--bg-surface);
  border-color: var(--border-strong);
  color: var(--ink-1);
}
.payroll-report-actions--salary-prominent .salary-pdf-download-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
  color: var(--ink-1);
}
.payroll-report-actions--salary-prominent .timero-icon-svg {
  flex-shrink: 0;
}

.payroll-run-detail-table { min-width: 720px; }
.payroll-run-detail-table .col-recalc {
  width: 40px;
  min-width: 40px;
  text-align: center;
  vertical-align: middle;
}
.payroll-run-detail-table .col-recalc input { margin: 0; cursor: pointer; }
.payroll-run-recalc-actions {
  margin-bottom: 14px;
}
.payroll-run-detail-report .payroll-report-actions--labeled { flex-wrap: wrap; gap: 6px; }
.payroll-run-detail-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
}

.payroll-run-supplement {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.payroll-run-supplement-title {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
}
.payroll-run-supplement-hint {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.4;
}
.payroll-run-supplement-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}
.payroll-run-supplement-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-surface-2);
  cursor: pointer;
}
.payroll-run-supplement-item input { margin-top: 2px; flex-shrink: 0; }
.payroll-run-supplement-name { font-weight: 600; font-size: 13px; min-width: 120px; }
.payroll-run-supplement-meta { font-size: 12px; color: var(--ink-3); }

.payroll-report-actions--labeled { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.team-person-wrap { display: inline-flex; align-items: center; gap: 4px; }
.team-person-pin {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-surface); color: var(--ink-3); cursor: pointer; padding: 0;
}
.team-person-pin:hover { border-color: var(--accent); color: var(--ink-1); }
.team-person-pin--on { background: rgba(234, 139, 81, 0.12); border-color: var(--accent-2, #ea8b51); color: var(--accent-2, #ea8b51); }

.payroll-report-preview-modal .timero-pdf-preview-frame {
  width: 100%; height: 70vh; border: 0; background: #fff;
}
.payroll-report-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.payroll-report-preview-head .funnel-modal-title {
  margin: 0;
  flex: 1;
  min-width: 0;
}
.payroll-report-preview-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}