﻿/* â”€â”€ Design Tokens â”€â”€ */
:root {
  /* Brand green */
  --color-primary:          #8DC641;
  --color-primary-rgb:      141, 198, 65;
  --color-primary-dark:     #5a7020;
  --color-primary-grad:     #6aaa20;
  --color-primary-accent:   #b0e060;

  /* Warning / amber */
  --color-warning:          #f59e0b;
  --color-warning-rgb:      245, 158, 11;
  --color-warning-dark:     #c97d0a;

  /* Danger / red */
  --color-danger:           #dc2626;
  --color-danger-rgb:       239, 68, 68;

  /* Info / in-progress (onboarding, development, check-ins) */
  --color-info:             #2563eb;
  --color-info-rgb:         37, 99, 235;
  --color-info-dark:        #1e40af;

  /* Text scale */
  --color-text:             #1c1f18;
  --color-text-secondary:   #5a6050;
  --color-text-muted:       #9aa08a;
  --color-text-label:       #7a8068;
  --color-text-faint:       #b0b8a8;

  /* Surface scale */
  --color-bg:               #f5f6f2;
  --color-surface:          #ffffff;
  --color-surface-alt:      #f8f9f5;
  --color-surface-raised:   #f0f1ec;
  --color-surface-sunken:   #edf0e8;

  /* Borders */
  --color-border:           #e8eae2;
  --color-border-alt:       #e4e6df;
  --color-border-strong:    #d4d8cc;

  /* Structural */
  --color-sidebar:          #38404e;

  /* Border radius */
  --radius-sm:    6px;
  --radius-md:    8px;
  --radius-lg:    10px;
  --radius-xl:    12px;
  --radius-2xl:   14px;
  --radius-full:  9999px;

  /* Shadows — kept very subtle by design: whitespace and light borders carry
     hierarchy first, shadow is only a faint lift, never a "floating card" look */
  --shadow-sm:      0 1px 2px rgba(28,31,24,0.05);
  --shadow-topbar:  0 1px 0 var(--color-border), 0 2px 10px rgba(0,0,0,0.05);
  --shadow-sidebar: 2px 0 16px rgba(0,0,0,0.18);

  /* Spacing - 4px grid */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-7:  28px;
  --space-8:  32px;
  --space-9:  36px;
  --space-10: 40px;

  /* Typography scale */
  --text-xs:   11px;
  --text-sm:   12px;
  --text-base: 13px;
  --text-md:   14px;
  --text-lg:   16px;
  --text-xl:   20px;
  --text-2xl:  28px;

  /* Transitions */
  --transition: 0.15s;
}

/* â”€â”€ Reset & Base â”€â”€ */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* â”€â”€ Layout â”€â”€ */
.app { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }

/* â”€â”€ Sidebar â”€â”€ light, modern SaaS treatment (Connecteam/HiBob-inspired) â”€â”€ */
.sidebar {
  background: var(--color-surface);
  color: var(--color-text);
  padding: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--color-border);
  box-shadow: none;
}
.sidebar-header { padding: 0 24px 24px; border-bottom: 1px solid var(--color-border); }
.sidebar-header .eg-logo { font-size: 28px; font-weight: 900; font-style: italic; line-height: 1; letter-spacing: -0.5px; color: var(--color-text); }
.sidebar-header p { font-size: 11px; color: var(--color-text-muted); margin-top: 6px; text-transform: uppercase; letter-spacing: 0.8px; }

/* Employee card */
.employee-card { padding: 14px 20px; border-bottom: 1px solid var(--color-border); display: flex; align-items: center; gap: 11px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-grad));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.employee-info { overflow: hidden; }
.employee-name { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--color-text); }
.employee-role { font-size: 12px; color: var(--color-text-secondary); margin-top: 2px; }
.employee-start { font-size: 11px; color: var(--color-primary-dark); font-weight: 600; margin-top: 3px; }

/* Progress ring */
.progress-section { padding: 14px 20px; border-bottom: 1px solid var(--color-border); display: flex; align-items: center; gap: 14px; }
.ring-wrap { position: relative; flex-shrink: 0; }
.ring-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: var(--color-text); }
.progress-text strong { font-size: 13px; display: block; color: var(--color-text); }
.progress-text span { font-size: 11px; color: var(--color-text-muted); }
svg circle { transition: stroke-dashoffset 0.5s ease; }

/* Steps nav */
.steps-nav { flex: 1; overflow-y: auto; padding: 10px 0; }
.step-nav-item { display: flex; align-items: center; gap: 9px; margin: 1px 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; transition: background-color 0.15s; position: relative; }
.step-nav-item:hover { background: var(--color-surface-alt); }
.step-nav-item.active { background: rgba(var(--color-primary-rgb),0.10); }
.step-icon { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.step-icon.done    { background: var(--color-primary); color: #fff; }
.step-icon.active  { background: var(--color-primary); color: #fff; }
.step-icon.waiting { background: var(--color-warning); color: #fff; }
.step-icon.locked  { background: var(--color-surface-sunken); color: var(--color-text-faint); }
.step-nav-label        { font-size: 13.5px; color: var(--color-text-secondary); }
.step-nav-label.active { color: var(--color-primary-dark); font-weight: 700; }
.step-nav-label.done   { color: var(--color-text-muted); }
.step-badge { margin-left: auto; font-size: 10px; padding: 2px 7px; border-radius: 10px; font-weight: 600; }
.badge-done    { background: rgba(var(--color-primary-rgb),0.15); color: var(--color-primary-dark); }
.badge-active  { background: rgba(var(--color-primary-rgb),0.15); color: var(--color-primary-dark); }
.badge-waiting { background: rgba(var(--color-warning-rgb),0.15); color: var(--color-warning-dark); }
.badge-locked  { background: var(--color-surface-sunken); color: var(--color-text-faint); }

/* â”€â”€ Main â”€â”€ */
.main { overflow-y: auto; background: var(--color-bg); }
.topbar {
  background: var(--color-surface); border-bottom: none;
  box-shadow: 0 1px 0 var(--color-border), 0 2px 10px rgba(0,0,0,0.05);
  padding: 13px 32px; display: flex; align-items: center;
  justify-content: space-between; position: sticky; top: 0; z-index: 10;
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.topbar-left h2 { font-size: 20px; font-weight: 700; color: var(--color-text); }
.topbar-left .step-count { font-size: 13px; color: rgba(var(--color-primary-rgb),0.7); }
.content { padding: 28px 32px; }
/* Table/report-heavy pages get a readable cap on very wide monitors.
   Not applied globally -- profile/form/settings pages keep their own
   (already narrower) widths. */
.content-wide { max-width: 1600px; margin: 0 auto; }

/* â”€â”€ Buttons â”€â”€ */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px; border-radius: 8px; font-size: 13.5px; font-weight: 600; border: 1px solid transparent; cursor: pointer; transition: background-color 0.15s, border-color 0.15s, color 0.15s; }
/* Dark text on brand green: white on #8DC641 is 2.0:1, below the 4.5:1 readability minimum (WCAG AA);
   dark text is 8.2:1. Hover keeps white on the darker green (5.6:1). Matches .mto-btn-primary. */
.btn-primary   { background: var(--color-primary); color: var(--color-text); font-weight: 700; }
.btn-primary:hover { background: var(--color-primary-dark); color: #fff; }
.btn-secondary { background: var(--color-surface-raised); color: var(--color-text-secondary); border: 1px solid var(--color-border-strong); }
.btn-secondary:hover { background: var(--color-border); border-color: var(--color-primary); color: var(--color-primary-dark); }
.btn-warning   { background: rgba(var(--color-warning-rgb),0.1); color: var(--color-warning-dark); border: 1px solid rgba(var(--color-warning-rgb),0.3); }
.btn-danger    { background: rgba(var(--color-danger-rgb),0.08); color: var(--color-danger); border: 1px solid rgba(var(--color-danger-rgb),0.2); }
.btn:disabled  { opacity: 0.4; cursor: not-allowed; }

/* â”€â”€ Hero banner â”€â”€ */
.hero {
  position: relative;
  background: linear-gradient(to right, #eef6df 0%, #e4f0cc 55%, #DAEBC1 85%, #c8e4a4 100%);
  border-radius: 14px; overflow: hidden; margin-bottom: 24px;
  height: 200px; display: flex; align-items: center;
  padding: 0 40px; border: 1px solid #cde5a8;
}
.hero-glow { position: absolute; inset: 0; background: radial-gradient(ellipse at 30% 50%, rgba(var(--color-primary-rgb),0.25) 0%, transparent 60%); pointer-events: none; }
.hero-text { position: relative; z-index: 2; }
.hero-text h2 { font-size: 28px; font-weight: 800; color: var(--color-text); line-height: 1.1; }
.hero-text p  { font-size: 14px; color: var(--color-text-secondary); margin-top: 8px; }
.hero-figure  { position: absolute; right: 0; top: 0; bottom: 0; z-index: 1; display: flex; align-items: stretch; }

/* â”€â”€ Step detail card â”€â”€ */
.step-detail { background: var(--color-surface); border-radius: 12px; border: 1px solid var(--color-border-alt); overflow: hidden; margin-bottom: 20px; }
.step-detail-header { padding: 20px 24px; border-bottom: 1px solid var(--color-border-alt); display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.step-status-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 20px; }
.status-done    { background: rgba(var(--color-primary-rgb),0.15); color: var(--color-primary-dark); }
.status-active  { background: rgba(var(--color-primary-rgb),0.15); color: var(--color-primary-dark); }
.status-waiting { background: rgba(var(--color-warning-rgb),0.1); color: var(--color-warning-dark); }
.status-locked  { background: var(--color-surface-sunken); color: var(--color-text-muted); }
.step-detail-body { padding: 24px; }
.step-description { font-size: 14px; color: var(--color-text-secondary); line-height: 1.6; margin-bottom: 20px; }

/* â”€â”€ Document block â”€â”€ */
.doc-block { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 10px; padding: 18px 20px; margin-bottom: 10px; display: flex; align-items: center; gap: 16px; transition: box-shadow 0.15s; }
.doc-block:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.doc-info  { flex: 1; min-width: 0; }
.doc-name-row { display: flex; align-items: center; gap: 8px; }
.doc-name  { font-size: 14px; font-weight: 600; color: var(--color-text); }
.doc-meta  { font-size: 12px; color: var(--color-text-muted); margin-top: 2px; }
.doc-actions { display: flex; align-items: flex-end; flex-direction: column; gap: 6px; flex-shrink: 0; }
.doc-action-btns { display: flex; gap: 6px; align-items: center; }
.doc-checkbox { width: 18px; height: 18px; accent-color: var(--color-primary); cursor: pointer; flex-shrink: 0; }

/* Doc type label */
.doc-type-label { font-size: 10px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; padding: 2px 7px; border-radius: 4px; flex-shrink: 0; }
.doc-type-pandadoc   { background: rgba(99,102,241,0.1);  color: #4f46e5; }
.doc-type-email      { background: rgba(59,130,246,0.1);  color: #1e6bc4; }
.doc-type-return     { background: rgba(var(--color-warning-rgb),0.1);  color: #b86f00; }
.doc-type-task       { background: rgba(107,114,128,0.1); color: #4b5563; }
.doc-type-checklist  { background: rgba(var(--color-primary-rgb),0.12); color: #4a7020; }
.doc-type-reference  { background: rgba(107,114,128,0.08); color: var(--color-text-muted); }

/* Tooltip */
.doc-tooltip-wrap { position: relative; display: inline-flex; align-items: center; flex-shrink: 0; }
.doc-tooltip-icon { font-size: 13px; color: var(--color-text-faint); cursor: default; line-height: 1; }
.doc-tooltip-icon:hover { color: #7a9060; }
.doc-tooltip-wrap:hover .doc-tooltip-box { opacity: 1; pointer-events: auto; transform: translateY(0); }
.doc-tooltip-box {
  position: absolute; left: 50%; bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(4px);
  background: #2a2f22; color: var(--color-border);
  font-size: 12px; line-height: 1.5; font-weight: 400;
  padding: 8px 12px; border-radius: 7px;
  white-space: normal; width: 240px; z-index: 100;
  opacity: 0; pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.doc-tooltip-box::after {
  content: ''; position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: #2a2f22;
}
/* Button-based variant (help tooltips, e.g. Company Stats Primary/Secondary
   %) -- adds keyboard focus and a click/tap-open state on top of the
   existing hover-only trigger. Additive only: the original plain-<span>
   icon (phase-view.js) has no tabindex and never receives .open, so its
   hover-only behavior is completely unchanged. */
.doc-tooltip-icon-btn { background: none; border: none; padding: 0; font-family: inherit; cursor: pointer; }
.doc-tooltip-icon-btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; border-radius: 3px; }
.doc-tooltip-wrap:focus-within .doc-tooltip-box,
.doc-tooltip-wrap.open .doc-tooltip-box { opacity: 1; pointer-events: auto; transform: translateY(0); }
/* Narrower box for short help copy, capped so it can never exceed the
   viewport width regardless of how close to the edge its trigger sits. */
.doc-tooltip-box-sm { width: 220px; max-width: calc(100vw - 32px); }
/* Edge-overflow correction -- positionHelpTooltip() (shared/ui.js) measures
   the box against the viewport on hover/focus/click and adds one of these
   when a centered box would run off the left/right edge of the screen. Two
   classes on the same element outrank the single-class base rules above, so
   these win without !important. The arrow shifts to a fixed inset rather
   than tracking the icon's exact position -- close enough at this box size
   to still read as "pointing at" the icon, without needing per-pixel math. */
.doc-tooltip-box.doc-tooltip-align-right { left: auto; right: -6px; transform: none; }
.doc-tooltip-box.doc-tooltip-align-right::after { left: auto; right: 14px; transform: none; }
.doc-tooltip-box.doc-tooltip-align-left { left: -6px; transform: none; }
.doc-tooltip-box.doc-tooltip-align-left::after { left: 14px; transform: none; }
.sig-status { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 20px; } /* alias of step-status-badge */
.sig-pending { background: rgba(var(--color-warning-rgb),0.1); color: var(--color-warning-dark); }
.sig-signed  { background: rgba(var(--color-primary-rgb),0.15); color: var(--color-primary-dark); }
.sig-unsent  { background: var(--color-surface-sunken); color: var(--color-text-muted); }

/* â”€â”€ Doc status pills â”€â”€ */
.doc-status-pill     { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 20px; }
.doc-status-unsent   { background: var(--color-surface-sunken); color: var(--color-text-muted); }
.doc-status-sent     { background: rgba(59,130,246,0.1); color: #1e6bc4; }
.doc-status-received { background: rgba(var(--color-primary-rgb),0.15); color: var(--color-primary-dark); }
.doc-status-uploaded { background: rgba(var(--color-primary-rgb),0.2);  color: #4a6018; }
.doc-status-signed   { background: rgba(var(--color-primary-rgb),0.2);  color: #4a6018; }
.doc-status-given    { background: rgba(var(--color-primary-rgb),0.2);  color: #4a6018; }
.doc-status-waived   { background: rgba(var(--color-warning-rgb),0.1);  color: var(--color-warning-dark); }

/* â”€â”€ Completed doc collapse â”€â”€ */
.doc-block-done { opacity: 0.52; }
.doc-completed-section { margin-top: 0; }
.docs-completed-toggle { margin-top: 4px; margin-bottom: 4px; font-size: 12px; padding: 5px 14px; color: #7a9060; border-color: rgba(122,144,96,0.3); width: 100%; justify-content: center; }
.doc-type-badge  { font-size: 11px; color: var(--color-text-muted); font-style: italic; }
.doc-sent-by     { font-size: 11px; color: var(--color-text-muted); margin-top: 3px; }
.doc-assignee-row { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.doc-assignee-label { font-size: 11px; color: #6b8f4a; font-weight: 500; }
.doc-reassign-btn { font-size: 11px; color: #b0b8a0; background: none; border: none; cursor: pointer; padding: 0 2px; line-height: 1; opacity: 0.6; transition: opacity 0.15s, color 0.15s; }
.doc-reassign-btn:hover { opacity: 1; color: var(--color-primary); }

/* Primary doc action button — unified brand green, all advance actions */
.btn-doc-send { font-size: 12px; font-weight: 600; padding: 4px 14px; background: var(--color-primary); color: var(--color-text); border: none; border-radius: 6px; cursor: pointer; transition: background 0.15s; white-space: nowrap; display: inline-flex; align-items: center; }
.btn-doc-send:hover { background: var(--color-primary-dark); color: #fff; }
/* Waive button â€” subtle secondary */
.btn-doc-waive { font-size: 11px; padding: 4px 10px; color: var(--color-text-muted); background: transparent; border: 1px solid var(--color-border-strong); border-radius: 6px; cursor: pointer; transition: color 0.15s, border-color 0.15s; white-space: nowrap; }
.btn-doc-waive:hover { color: var(--color-text-secondary); border-color: var(--color-text-muted); }
/* Undo button â€” ghost, turns red on hover to signal reversal */
.btn-doc-undo { font-size: 11px; padding: 3px 7px; color: var(--color-text-muted); background: transparent; border: 1px solid #e5e7eb; border-radius: 6px; cursor: pointer; transition: color 0.15s, border-color 0.15s; white-space: nowrap; }
.btn-doc-undo:hover { color: var(--color-danger); border-color: var(--color-danger); }

/* Awaiting return pill */
.doc-status-awaiting { background: rgba(var(--color-warning-rgb),0.1); color: #b86f00; }

/* ── Step doc summary (D2) ── */
.step-doc-summary { display:flex; align-items:center; justify-content:space-between; padding:8px 12px; background:#f4f6f0; border-radius:6px; margin-bottom:10px; flex-wrap:wrap; gap:6px; }
.step-doc-owners { font-size:12px; color:#1c1f18; font-weight:600; }
.step-doc-status { font-size:11px; color:#5a7020; font-weight:500; }

/* ── Progressive doc rows (Phase C) ── */
.doc-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f0f2ec; }
.doc-row:last-child { border-bottom: none; }
.doc-row-done { opacity: 0.5; }
.doc-row-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.doc-dot-unsent   { background: #d1d5c9; }
.doc-dot-sent     { background: #f0a500; }
.doc-dot-received { background: #f0a500; }
.doc-dot-uploaded { background: #6bbf45; }
.doc-dot-signed        { background: #6bbf45; }
.doc-dot-saved_to_drive{ background: #6bbf45; }
.doc-dot-given         { background: #6bbf45; }
.doc-dot-done     { background: #6bbf45; }
.doc-dot-waived   { background: #b0b8a0; }
.doc-row-info { flex: 1; min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.doc-row-name { font-size: 13px; font-weight: 500; color: #1c1f18; }
.doc-row-owner { font-size: 11px; color: #9aa08a; }
.doc-row-sent  { font-size: 11px; color: #b0b8a0; }
.doc-row-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.doc-row-state { font-size: 12px; color: #7a8068; white-space: nowrap; }
.doc-state-terminal { color: #6bbf45; font-weight: 600; font-size: 12px; }
/* Overflow menu */
.doc-overflow-wrap { position: relative; }
.doc-overflow-btn { background: none; border: 1px solid #d0d4c8; cursor: pointer; font-size: 13px; color: #6b7468; padding: 2px 7px; border-radius: 4px; line-height: 1.5; letter-spacing: 2px; }
.doc-overflow-btn:hover { background: #f0f2ec; color: #1c1f18; border-color: #9aa08a; }
.doc-overflow-menu { display: none; position: absolute; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid #e0e4d8; border-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,0.10); z-index: 120; min-width: 150px; padding: 4px 0; }
.doc-overflow-menu.open { display: block; }
.doc-overflow-item { display: block; width: 100%; text-align: left; background: none; border: none; cursor: pointer; font-size: 12px; color: #1c1f18; padding: 8px 16px; white-space: nowrap; }
.doc-overflow-item:hover { background: #f8f9f5; }

/* â”€â”€ Timeline â”€â”€ */
.timeline { margin-top: 20px; }
.timeline-title { font-size: 11px; font-weight: 700; color: var(--color-text-faint); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 14px; }
.timeline-item  { display: flex; gap: 12px; margin-bottom: 14px; }
.timeline-dot   { width: 8px; height: 8px; border-radius: 50%; background: #d8dbd2; margin-top: 5px; flex-shrink: 0; }
.timeline-dot.done    { background: var(--color-primary); }
.timeline-dot.active  { background: var(--color-primary); }
.timeline-dot.waiting { background: var(--color-warning); }
.timeline-text { font-size: 13px; color: var(--color-text-secondary); line-height: 1.5; }
.timeline-time { font-size: 11px; color: var(--color-text-muted); margin-top: 1px; }

/* â”€â”€ Flow â”€â”€ */
.flow-block       { background: var(--color-surface-alt); border: 1px solid var(--color-border-alt); border-radius: 10px; padding: 16px 20px; }
.flow-block-title { font-size: 11px; font-weight: 700; color: var(--color-text-faint); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; }
.flow-condition   { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--color-text-secondary); padding: 8px 12px; background: var(--color-surface); border: 1px solid var(--color-border-alt); border-radius: 8px; margin-bottom: 6px; }
.condition-icon   { font-size: 14px; }
.arrow-down       { text-align: center; font-size: 16px; color: var(--color-border-strong); margin: 4px 0; }

/* â”€â”€ Tabs â”€â”€ */
.tabs { display: flex; border-bottom: 1px solid var(--color-border-alt); margin-bottom: 24px; }
.tab  { padding: 10px 20px; font-size: 13px; font-weight: 500; color: var(--color-text-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all 0.15s; }
.tab.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }
.tab:hover:not(.active) { color: var(--color-text-secondary); }

/* â”€â”€ Panels â”€â”€ */
.panel        { display: none; }
.panel.active { display: block; }

/* â”€â”€ Banners â”€â”€ */
.banner         { border-radius: 10px; padding: 14px 18px; display: flex; align-items: flex-start; gap: 10px; margin-bottom: 20px; font-size: 13px; line-height: 1.5; }
.banner-warning { background: rgba(var(--color-warning-rgb),0.08); border: 1px solid rgba(var(--color-warning-rgb),0.25); color: #b86f00; }
.banner-info    { background: rgba(59,130,246,0.07); border: 1px solid rgba(59,130,246,0.2); color: #2563eb; }
.banner-success { background: rgba(var(--color-primary-rgb),0.1); border: 1px solid rgba(var(--color-primary-rgb),0.3); color: var(--color-primary-dark); }

/* â”€â”€ Topbar controls â”€â”€ */
.topbar-controls { display: flex; align-items: center; gap: 12px; }
.topbar-nav-btn { background: none; border: 1px solid var(--color-border-strong); border-radius: 8px; color: var(--color-text-secondary); font-size: 13px; font-weight: 500; padding: 8px 14px; cursor: pointer; transition: all 0.15s; white-space: nowrap; }
.topbar-nav-btn:hover { border-color: var(--color-primary); color: var(--color-primary-dark); }

/* â”€â”€ View toggle â”€â”€ */
.view-toggle { display: flex; background: var(--color-surface-raised); border-radius: 10px; padding: 4px; gap: 3px; border: 1px solid var(--color-border-strong); }
.view-btn { display: flex; align-items: center; gap: 7px; padding: 8px 18px; border-radius: 7px; font-size: 13px; font-weight: 500; cursor: pointer; color: var(--color-text-secondary); transition: all 0.2s; white-space: nowrap; user-select: none; }
.view-btn-icon { font-size: 14px; }
.view-btn:hover:not(.active) { color: var(--color-text); background: rgba(0,0,0,0.04); }
.view-btn.active { background: var(--color-primary); color: var(--color-text); font-weight: 700; }

/* â”€â”€ Table â”€â”€ calmer, more spacious, less "raw admin grid" â”€â”€ */
.table-wrap { background: var(--color-surface); border-radius: 12px; border: 1px solid var(--color-border); overflow: hidden; box-shadow: var(--shadow-sm); }
/* Wrap a bare <table> in .table-scroll wherever the table has real chances of
   exceeding its container's width (fixed per-column min-widths, many columns)
   -- gives it its own horizontal scrollbar instead of silently clipping
   under a .workspace-surface's overflow:hidden. */
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { background: var(--color-surface-alt); text-align: left; padding: 10px 16px; font-size: 12.5px; font-weight: 700; color: var(--color-text); text-transform: none; letter-spacing: normal; border-bottom: 1px solid var(--color-border-strong); }
td { padding: 11px 16px; font-size: 13.5px; border-top: 1px solid var(--color-surface-sunken); color: var(--color-text-secondary); }
tr:hover td { background: var(--color-surface-alt); }
/* Sortable column headers (sortHeaderCell): the label is a plain-looking button. */
.th-sort-btn { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; text-align: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; white-space: nowrap; }
.th-sort-btn:hover { color: var(--color-primary-dark); }
.th-sort-icon { margin-left: 4px; font-size: 11px; color: var(--color-text-muted); opacity: 0.55; }
.th-sort-btn:hover .th-sort-icon { opacity: 1; }
.th-sort-icon.is-active { color: var(--color-primary-dark); opacity: 1; font-size: 12px; }
.th-sort-btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; border-radius: 3px; }
tr.row-clickable { cursor: pointer; transition: background-color 0.1s; }
.row-view-arrow { background: none; border: none; color: var(--color-text-faint); font-size: 17px; cursor: pointer; padding: 4px 6px; line-height: 1; transition: color 0.15s; }
tr:hover .row-view-arrow { color: var(--color-primary-dark); }
.progress-bar-wrap { display: flex; align-items: center; gap: 8px; }
.progress-bar  { flex: 1; height: 4px; background: var(--color-surface-sunken); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--color-primary); border-radius: 3px; transition: width 0.3s; }
.progress-fill.warn { background: var(--color-warning); }
.chip { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.annotation { display: inline-block; font-size: 11px; color: var(--color-text-faint); font-style: italic; margin-left: 6px; }

/* â”€â”€ Mobile defaults (hidden on desktop) â”€â”€ */
.mobile-topbar  { display: none; }
.mobile-progress { display: none; }
.mobile-tabs    { display: none; }
.drawer-overlay { display: none; }
.sidebar-close  { display: none; }

/* â”€â”€ Mobile â”€â”€ */
@media (max-width: 768px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 100; padding: 0; overflow-y: auto; }
  .sidebar.open { display: flex; flex-direction: column; }

  .drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 99; backdrop-filter: blur(2px); }
  .drawer-overlay.open { display: block; }

  .mobile-topbar {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--color-surface); border-bottom: none;
    box-shadow: 0 1px 0 var(--color-border), 0 2px 10px rgba(0,0,0,0.05);
    padding: 14px 18px; position: sticky; top: 0; z-index: 50;
  }
  .mobile-topbar .m-step-pill {
    font-size: 11px; font-weight: 600; color: var(--color-primary-dark);
    background: rgba(var(--color-primary-rgb),0.15); border: 1px solid rgba(var(--color-primary-rgb),0.3);
    padding: 4px 10px; border-radius: 20px;
  }
  .mobile-topbar .m-hamburger {
    width: 44px; height: 44px; padding: 0; margin: -4px 0; border-radius: 8px; background: var(--color-surface-raised);
    border: 1px solid var(--color-border-strong); display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 5px; cursor: pointer; font: inherit;
  }
  .mobile-topbar .m-hamburger:focus-visible,
  .sidebar-close .close-btn:focus-visible { outline: 2px solid var(--color-primary-dark); outline-offset: 2px; }
  .mobile-topbar .m-hamburger span { width: 16px; height: 2px; background: var(--color-primary); border-radius: 2px; display: block; }

  .topbar { display: none; }
  .mobile-progress { display: flex; }
  .mobile-tabs     { display: flex; }
  .mobile-bottom-nav { display: flex; }
  .sidebar-close   { display: flex; }

  .content { padding: 16px; }

  .hero { height: 140px; padding: 0 20px; margin-bottom: 16px; }
  .hero-text h2 { font-size: 20px; }
  .hero-text p  { font-size: 12px; }
  .hero-figure img { height: 140px; }

  .mobile-progress {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; background: var(--color-surface);
    border-bottom: 1px solid var(--color-border-alt); overflow-x: auto;
    scrollbar-width: none;
  }
  .mobile-progress::-webkit-scrollbar { display: none; }
  .mobile-progress-dot {
    width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 700; cursor: pointer; transition: transform 0.15s;
  }
  .mobile-progress-dot.done    { background: var(--color-primary); color: #fff; }
  .mobile-progress-dot.active  { background: var(--color-primary); color: #fff; box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb),0.25); }
  .mobile-progress-dot.locked  { background: var(--color-surface-sunken); color: #b8bfaa; }
  .mobile-progress-dot.waiting { background: var(--color-warning); color: #fff; }
  .mobile-progress-line { flex: 1; height: 2px; background: var(--color-surface-sunken); border-radius: 1px; flex-shrink: 0; min-width: 12px; }
  .mobile-progress-line.done { background: var(--color-primary); }

  .step-detail-header { flex-direction: column; gap: 10px; }
  .step-detail-body   { padding: 16px; }
  .doc-block { flex-wrap: wrap; gap: 10px; padding: 12px; }
  .doc-actions { width: 100%; justify-content: flex-end; }
  .tab { padding: 10px 14px; font-size: 12px; }
  .timeline-item { gap: 10px; }

  table thead { display: none; }
  table, tbody, tr, td { display: block; width: 100%; }
  tr { background: var(--color-surface); border: 1px solid var(--color-border-alt); border-radius: 10px; margin-bottom: 10px; padding: 12px; }
  td { padding: 4px 0; border: none; font-size: 13px; }
  td:first-child { padding-bottom: 8px; border-bottom: 1px solid var(--color-surface-sunken); margin-bottom: 8px; }

  .topbar-controls { display: none; }

  .mobile-tabs {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
    background: var(--color-surface); border-top: 1px solid var(--color-border-alt);
    display: flex; height: 60px;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .m-tab {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 3px; cursor: pointer;
    font-size: 10px; font-weight: 600; color: var(--color-text-faint);
    text-transform: uppercase; letter-spacing: 0.5px;
    transition: color 0.15s; border: none; background: none;
  }
  .m-tab .m-tab-icon { font-size: 18px; line-height: 1; }
  .m-tab.active { color: var(--color-primary); }

  .main { padding-bottom: 60px; }

  .sidebar-close {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 24px; background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
  }
  .sidebar-close .close-btn {
    width: 44px; height: 44px; padding: 0; margin: -6px 0; border-radius: 8px; background: var(--color-surface-raised);
    border: 1px solid var(--color-border-strong); display: flex; align-items: center;
    justify-content: center; cursor: pointer; font-family: inherit; font-size: 16px; color: var(--color-text-secondary);
  }
  .sidebar-close .close-btn:hover { background: var(--color-border); color: var(--color-text); }
}

/* â”€â”€ Dashboard-style stat grid (Attendance Company Stats) â”€â”€ equal-width
   zones spread across the full summary band, not left-packed flex items.
   auto-fit rather than a hardcoded column count -- reflows cleanly whether
   there are 6 cells or 7 (with 100% Club added) without a separate
   breakpoint to maintain. â”€â”€ */
.att-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 16px; }

/* â”€â”€ Attendance detailed-report row â”€â”€ quiet interaction cue on hover,
   no layout shift (box-shadow, not border, so nothing reflows) â”€â”€ */
.att-row:hover td:first-child { box-shadow: inset 3px 0 0 var(--color-border-strong); }

/* â”€â”€ Company Stats normal KPI cards â”€â”€ subtle structure only: same
   background as the surrounding Company Stats band (no fill), a border
   only slightly darker than that background. Same radius/padding as
   .att-club-cell below for consistent card height, but visibly quieter --
   about half its border opacity and no tint at all -- so the Club card
   stays the one that reads as special/interactive.
   flex column + centered main/cross axis is what actually centers the
   content within the card: grid's default align-items:stretch makes every
   cell in a row match the tallest cell's height (usually the 3-line Club
   card), so without this the shorter 2-line cells' content sat at the top
   of that extra height instead of centered in it. â”€â”€ */
.att-stat-cell {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  background: var(--color-surface-alt);
  border: 1px solid rgba(var(--color-primary-rgb),0.14);
  border-radius: 8px; padding: 10px 8px;
}

/* â”€â”€ 100% Attendance Club â”€â”€ restrained recognition treatment, reusing
   existing brand tokens only (no new colors). Same flex-centering and
   padding as .att-stat-cell above, for identical alignment/card height
   across the whole row -- only background/border/cursor differ. â”€â”€ */
.att-club-cell {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; text-align: center;
  background: rgba(var(--color-primary-rgb),0.07);
  border: 1px solid rgba(var(--color-primary-rgb),0.25);
  border-radius: 8px; padding: 10px 8px;
  transition: background 0.15s, border-color 0.15s;
}
.att-club-cell:hover { background: rgba(var(--color-primary-rgb),0.13); border-color: rgba(var(--color-primary-rgb),0.4); }

/* Right-side drawer -- slide-in panel, not the centered-overlay pattern
   used elsewhere (e.g. the Attendance drill-down modal). Backdrop is
   transparent by design (click-to-close only, no dimming) so the report
   stays fully visible behind it, per the approved mockup. */
.club-drawer-backdrop { position: fixed; inset: 0; background: transparent; z-index: 1000; }
.club-drawer-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 1001;
  width: 400px; max-width: 92vw;
  background: var(--color-surface);
  box-shadow: -8px 0 32px rgba(0,0,0,0.14);
  padding: 28px 24px; overflow-y: auto;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  animation: clubDrawerSlideIn 0.18s ease-out;
}
@keyframes clubDrawerSlideIn { from { transform: translateX(24px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@media (max-width: 480px) {
  .club-drawer-panel { width: 100%; max-width: 100%; padding: 24px 18px; }
}
.club-drawer-close {
  position: absolute; top: 14px; right: 14px;
  background: none; border: none; font-size: 20px; line-height: 1;
  color: var(--color-text-muted); cursor: pointer; padding: 4px 8px;
}
.club-drawer-close:hover { color: var(--color-text); }
.club-drawer-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(var(--color-primary-rgb),0.12); color: var(--color-primary-dark);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px; flex-shrink: 0;
}
.club-drawer-title { font-size: 17px; font-weight: 800; color: var(--color-text); }
.club-drawer-subtitle { font-size: 12.5px; color: var(--color-text-secondary); margin-top: 6px; line-height: 1.4; max-width: 300px; }
.club-drawer-count { font-size: 10.5px; font-weight: 700; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 14px; }
.club-drawer-actions { display: flex; gap: 8px; margin-top: 14px; }
.club-drawer-list { width: 100%; margin-top: 18px; text-align: left; display: flex; flex-direction: column; gap: 4px; }
.club-drawer-row { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 8px; cursor: pointer; transition: background 0.12s; }
.club-drawer-row:hover { background: var(--color-surface-alt); }

/* â”€â”€ Stats bar â”€â”€ neutral by default; accent color only when the number is
   actually actionable/semantic, not decoration on every card â”€â”€ */
.stats-bar { display: flex; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.stat-card {
  flex: 1; min-width: 170px; position: relative;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 12px; padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
/* Icon-left layout -- opt-in via markup (wrap icon + .stat-card-body in a
   .stat-card-row). .stat-card itself stays a plain block container so pages
   that don't use this wrapper (Dashboard, Profile's Attendance cards) keep
   their existing stacked value/label layout completely unchanged. */
.stat-card-row { display: flex; align-items: flex-start; gap: 14px; }
.stat-card-body { min-width: 0; }
.stat-card-icon {
  width: 40px; height: 40px; border-radius: 11px;
  background: var(--color-surface-sunken); color: var(--color-text-muted);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
/* Semantic accent modifiers -- apply only to cards whose number means
   something actionable (e.g. "In Onboarding" = info, "Overdue" = danger) */
.stat-card.accent-green  .stat-card-icon { background: rgba(var(--color-primary-rgb),0.12); color: var(--color-primary-dark); }
.stat-card.accent-info   .stat-card-icon { background: rgba(var(--color-info-rgb),0.10); color: var(--color-info-dark); }
.stat-card.accent-amber  .stat-card-icon { background: rgba(var(--color-warning-rgb),0.12); color: var(--color-warning-dark); }
.stat-card.accent-danger .stat-card-icon { background: rgba(var(--color-danger-rgb),0.10); color: var(--color-danger); }
.stat-card-value { font-size: 27px; font-weight: 800; color: var(--color-text); line-height: 1.1; }
.stat-card-label { font-size: 12.5px; font-weight: 600; color: var(--color-text-secondary); margin-top: 4px; }
.stat-card-context { font-size: 11px; color: var(--color-text-muted); margin-top: 4px; }
.stat-card-value.green { color: var(--color-primary-dark); }
.stat-card-value.amber { color: #e08c00; }

/* â”€â”€ Notes â”€â”€ */
.note-item { background: var(--color-surface-alt); border: 1px solid var(--color-border-alt); border-radius: 8px; padding: 12px 16px; margin-bottom: 8px; }
.note-item.note-pinned { border-color: rgba(var(--color-primary-rgb),0.4); background: rgba(var(--color-primary-rgb),0.06); }
.note-item.note-editing { border-color: rgba(var(--color-primary-rgb),0.3); }
.note-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; min-height: 22px; }
.note-badges { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.note-pin-flag { font-size: 13px; }
.note-badge { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 10px; text-transform: uppercase; letter-spacing: 0.4px; }
.note-cat-urgent { background: rgba(var(--color-danger-rgb),0.1); color: var(--color-danger); }
.note-cat-action  { background: rgba(var(--color-warning-rgb),0.1); color: var(--color-warning-dark); }
.note-cat-fyi     { background: rgba(59,130,246,0.1);  color: #2563eb; }
.note-vis-all { background: rgba(var(--color-primary-rgb),0.15); color: var(--color-primary-dark); }
.note-vis-internal { background: rgba(100,116,139,0.15); color: #475569; }
.note-vis-hr  { background: var(--color-danger); color: #fff; display: inline-block; padding: 2px 14px 2px 8px; border-radius: 2px 0 0 2px; clip-path: polygon(0% 0%, calc(100% - 8px) 0%, 100% 50%, calc(100% - 8px) 100%, 0% 100%); }
.note-actions { display: flex; align-items: center; gap: 2px; }
.note-action-btn { background: none; border: none; cursor: pointer; padding: 3px 5px; border-radius: 4px; font-size: 13px; opacity: 0.55; transition: opacity 0.15s, background 0.15s; }
.note-action-btn:hover { opacity: 1; background: rgba(0,0,0,0.05); }
.note-action-delete:hover { background: rgba(var(--color-danger-rgb),0.08); }
.note-text { font-size: 13px; color: #2a2f22; line-height: 1.5; margin-bottom: 6px; }
.note-meta { font-size: 11px; color: var(--color-text-muted); }
.note-edited { font-size: 11px; color: var(--color-text-faint); margin-top: 2px; font-style: italic; }
.note-ack-row { margin-top: 8px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.note-ack-status { font-size: 11px; color: #5a7a3a; }
.note-edit-label { font-size: 11px; font-weight: 700; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.note-edit-row { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; flex-wrap: wrap; row-gap: 6px; }
.char-count { font-size: 11px; color: var(--color-text-faint); }
/* max-width/box-sizing let a <select> actually shrink inside a flex-wrap
   row instead of imposing its longest-option width on the container --
   this is what caused the visibility dropdown to overflow the Notes card
   at narrower widths (the secondary column is a fixed 320px). */
.note-select { background: var(--color-surface-raised); border: 1px solid var(--color-border-strong); color: var(--color-text-secondary); font-size: 11px; padding: 4px 8px; border-radius: 6px; cursor: pointer; max-width: 100%; box-sizing: border-box; }
.note-select:focus { outline: none; border-color: rgba(var(--color-primary-rgb),0.5); }
.note-vis-help { word-wrap: break-word; }

/* â”€â”€ All Notes â€” filter chips â”€â”€ */
.filter-chip { background: var(--color-surface-raised); border: 1px solid var(--color-border-strong); color: var(--color-text-secondary); font-size: 12px; font-weight: 600; padding: 5px 13px; border-radius: 20px; cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s; }
.filter-chip:hover { background: #e8eae4; color: var(--color-text); border-color: #b8bfaa; }
.filter-chip.active { background: rgba(var(--color-primary-rgb),0.15); color: var(--color-primary-dark); border-color: rgba(var(--color-primary-rgb),0.4); }

/* â”€â”€ All Notes â€” employee groups â”€â”€ */
.notes-emp-group { margin-bottom: 16px; border: 1px solid #2e3428; border-radius: 10px; overflow: hidden; }
.notes-emp-header { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: #1e2419; cursor: pointer; user-select: none; transition: background 0.15s; }
.notes-emp-header:hover { background: #252b1f; }
.notes-emp-name { font-size: 13px; font-weight: 700; color: var(--color-primary); flex: 1; }
.notes-emp-count { font-size: 11px; color: #666; }
.notes-emp-chevron { font-size: 12px; color: #666; transition: transform 0.2s; }
.notes-emp-group.collapsed .notes-emp-chevron { transform: rotate(-90deg); }
.notes-emp-body { padding: 12px 12px 4px; }
.notes-emp-group.collapsed .notes-emp-body { display: none; }

/* â”€â”€ Inline forms â”€â”€ */
.inline-form { background: var(--color-surface-alt); border: 1px solid var(--color-border-alt); border-radius: 10px; padding: 20px 24px; margin-top: 12px; }
.form-field { margin-bottom: 14px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--color-text-label); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.form-input, .form-select, .form-textarea { width: 100%; background: var(--color-surface); border: 1px solid var(--color-border-strong); border-radius: 8px; color: var(--color-text); font-size: 14px; padding: 10px 14px; font-family: inherit; }
.form-input:focus, .form-select:focus, .form-textarea:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb),0.15); }
input[type="date"]::-webkit-calendar-picker-indicator { opacity: 0.5; cursor: pointer; }
input[type="date"]::-webkit-calendar-picker-indicator:hover { opacity: 0.9; }
.form-select option { background: var(--color-surface); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-error { font-size: 12px; color: var(--color-danger); margin-top: 6px; }
.form-row { display: flex; gap: 16px; }
.form-row .form-field { flex: 1; }

/* â”€â”€ Sidebar nav links (dashboard mode) â”€â”€ */
.sidebar-nav-link { display: flex; align-items: center; gap: 10px; margin: 1px 10px; padding: 8px 10px; border-radius: 8px; font-size: 13.5px; font-weight: 500; color: var(--color-text-secondary); cursor: pointer; transition: background-color 0.15s, color 0.15s; }
.sidebar-nav-link svg { opacity: 0.6; transition: opacity 0.15s; }
.sidebar-nav-link:hover { background: var(--color-surface-alt); color: var(--color-text); }
.sidebar-nav-link:hover svg { opacity: 0.85; }
.sidebar-nav-link.active {
  background: rgba(var(--color-primary-rgb),0.10); color: var(--color-primary-dark); font-weight: 700;
  border-left: 3px solid var(--color-primary); padding-left: 7px;
}
.sidebar-nav-link.active svg { opacity: 1; }
.sidebar-nav-primary { font-weight: 700; color: var(--color-text); margin-bottom: 8px; }
/* Sidebar items are links and buttons (6A browser QA): they look as the divs did. */
a.sidebar-nav-link { text-decoration: none; }
button.sidebar-nav-link, button.step-nav-item {
  width: calc(100% - 20px); box-sizing: border-box; border: 0; background: transparent;
  font-family: inherit; line-height: inherit; text-align: left;
}
button.step-nav-item { font-size: inherit; color: inherit; }
button.sidebar-section-header { width: 100%; box-sizing: border-box; border: 0; background: transparent; font: inherit; color: inherit; text-align: left; }
.sidebar-nav-link:focus-visible, .sidebar-section-header:focus-visible, .step-nav-item:focus-visible {
  outline: 2px solid var(--color-primary-dark); outline-offset: -2px;
}
#main-content:focus { outline: none; }
.sidebar-section-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--color-primary-grad); padding: 12px 22px 4px; }

/* â”€â”€ Filter bars â”€â”€ quiet background, no border/shadow, consistent across pages â”€â”€ */
.filter-bar { background: var(--color-surface-alt); border-radius: 10px; padding: 14px 16px; }

/* â”€â”€ Compact workspace toolbar â”€â”€ scoped to filter-heavy report/list toolbars
   (Attendance, Compensation, Team Members) via .toolbar-compact on the
   .workspace-toolbar wrapper. Deliberately does NOT touch the base
   .form-label/.form-input/.form-select/.btn classes, so normal forms and
   modals elsewhere (New Employee, Profile edit, Workflow Editor)
   keep their standard control sizing untouched. â”€â”€ */
.toolbar-compact .form-label { font-size: 10.5px; margin-bottom: 3px; }
.toolbar-compact .form-input,
.toolbar-compact .form-select { font-size: 12.5px; padding: 6px 10px; }
.toolbar-compact .btn { font-size: 12px; padding: 6px 12px; }
.toolbar-compact .toolbar-primary { gap: 7px; }
.toolbar-compact .toolbar-option { font-size: 11.5px; }
.toolbar-compact .toolbar-count { font-size: 11.5px; }

/* â”€â”€ Unified workspace surface â”€â”€ toolbar + table live in one contained
   panel (Connecteam-style "working surface"), not two separate floating
   cards. .workspace-toolbar is the top zone (own bottom border); whatever
   follows (table, empty state) is the body zone -- same white surface. â”€â”€ */
.workspace-surface { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px; box-shadow: var(--shadow-sm); overflow: hidden; margin-bottom: 20px; }
.workspace-toolbar { padding: 14px 18px 12px; border-bottom: 1px solid var(--color-border); }

/* Two-tier toolbar (primary filters/actions + quiet secondary options) */
.toolbar-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.toolbar-primary { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; flex: 1; min-width: 0; }
.toolbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.toolbar-secondary { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 11px; padding-top: 11px; border-top: 1px solid var(--color-border); }
.toolbar-options { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.toolbar-option { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--color-text-muted); cursor: pointer; white-space: nowrap; }
.toolbar-option input { accent-color: var(--color-primary); }
.toolbar-count { font-size: 12.5px; color: var(--color-text-muted); white-space: nowrap; }
.toolbar-clear-btn { background: none; border: none; padding: 0; font-size: 12.5px; font-weight: 600; color: var(--color-primary-dark); cursor: pointer; white-space: nowrap; }
.toolbar-clear-btn:hover { text-decoration: underline; }

/* â”€â”€ Wide desktop toolbar field widths â”€â”€ deliberate, content-independent
   widths for filter controls inside .toolbar-primary, instead of relying on
   each input/select's native/content-driven size. A bare <select> sizes
   itself to its widest visible option, which is exactly why Department/
   Division/Manager (Attendance) and similar filters behaved like
   unpredictable standalone form fields and pushed later controls
   (Manager, Export) onto a second row despite unused row width elsewhere.
   .toolbar-field forces min-width:0 so the flex item can actually shrink
   below its content's natural size; the tb-w-* modifiers set a fixed
   flex-basis (shrinkable, never grows); .tb-grow is the one field per
   toolbar (Search) allowed to both grow into leftover space and shrink. â”€â”€ */
.toolbar-field { min-width: 0; }
.toolbar-field .form-input,
.toolbar-field .form-select { width: 100%; }
.tb-w-xs  { flex: 0 1 108px; }
.tb-w-sm  { flex: 0 1 140px; }
.tb-w-md  { flex: 0 1 168px; }
.tb-grow  { flex: 1 1 190px; max-width: 340px; }

/* â”€â”€ People directory â”€â”€ */
.people-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; background: var(--color-surface-alt); border-radius: 10px; padding: 14px 16px; }
.people-name-link { font-weight: 700; color: var(--color-text); cursor: pointer; transition: color 0.15s; display: inline; }
.people-name-link:hover { color: var(--color-primary-dark); }

/* â”€â”€ Team member row (avatar + name/role) â”€â”€ */
.tm-row { display: flex; align-items: center; gap: 11px; }
.tm-avatar { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; color: #fff; flex-shrink: 0; }
.tm-name { font-size: 13.5px; }
.tm-role { font-size: 12.5px; color: var(--color-text-muted); margin-top: 2px; }

/* â”€â”€ Loading screen â”€â”€ */
.loading-state { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 60vh; gap: 16px; color: var(--color-text-muted); font-size: 14px; }
.loading-spinner { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--color-border-alt); border-top-color: var(--color-primary); animation: spin 0.8s linear infinite; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 64px 24px; text-align: center; }
.empty-state-icon { font-size: 36px; margin-bottom: 16px; opacity: 0.7; }
.empty-state-title { font-size: 16px; font-weight: 700; color: var(--color-text); margin-bottom: 6px; }
.empty-state-subtitle { font-size: 14px; color: var(--color-text-muted); line-height: 1.5; }
@keyframes spin { to { transform: rotate(360deg); } }

/* â”€â”€ Login page â”€â”€ */
.login-page { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--color-bg); z-index: 200; }
.login-card { width: 100%; max-width: 380px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 14px; padding: 40px 36px; box-shadow: 0 2px 8px rgba(0,0,0,0.06), 0 12px 40px rgba(0,0,0,0.1); }
.login-logo { font-size: 32px; font-weight: 900; font-style: italic; text-align: center; margin-bottom: 8px; }
.login-tagline { font-size: 12px; color: var(--color-text-muted); text-align: center; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 32px; }
.login-error { background: rgba(var(--color-danger-rgb),0.07); border: 1px solid rgba(var(--color-danger-rgb),0.2); color: var(--color-danger); border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px; }

/* â”€â”€ Countdown badge â”€â”€ */
.countdown-badge { display: flex; align-items: center; gap: 8px; background: rgba(var(--color-warning-rgb),0.07); border: 1px solid rgba(var(--color-warning-rgb),0.2); border-radius: 10px; padding: 10px 16px; font-size: 13px; color: #b86f00; margin-bottom: 16px; }
.countdown-badge.ready    { background: rgba(var(--color-primary-rgb),0.1); border-color: rgba(var(--color-primary-rgb),0.3); color: var(--color-primary-dark); }
.countdown-badge.past-due { background: rgba(var(--color-danger-rgb),0.07); border-color: rgba(var(--color-danger-rgb),0.25); color: var(--color-danger); }

/* â”€â”€ Credentials card â”€â”€ */
.creds-card { background: var(--color-surface-alt); border: 1px solid var(--color-border-alt); border-radius: 10px; padding: 16px 20px; margin-bottom: 8px; }
.creds-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--color-surface-sunken); }
.creds-row:last-child { border-bottom: none; }
.creds-label { font-size: 11px; color: var(--color-text-faint); text-transform: uppercase; letter-spacing: 0.5px; width: 80px; flex-shrink: 0; }
.creds-value { font-size: 13px; color: var(--color-text-secondary); font-family: monospace; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.creds-copy { font-size: 11px; color: var(--color-text-muted); cursor: pointer; padding: 3px 8px; border-radius: 4px; border: 1px solid var(--color-border-strong); background: none; flex-shrink: 0; }
.creds-copy:hover { color: var(--color-primary-dark); border-color: var(--color-primary); }
.creds-copy.copied { color: var(--color-primary-dark); border-color: var(--color-primary); }

/* â”€â”€ Profile page â”€â”€ */
.profile-page { padding: 24px; max-width: 1400px; }

.profile-header {
  display: flex; align-items: center; gap: 20px;
  margin-bottom: 28px;
  padding: 24px; background: var(--color-surface); border-radius: 14px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}
.profile-avatar-large {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-grad));
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; color: #fff; flex-shrink: 0;
}
.profile-name { font-size: 22px; font-weight: 800; color: var(--color-text); line-height: 1.2; }
.profile-meta { font-size: 13px; color: var(--color-text-label); margin-top: 4px; }
.profile-header-employee { background: linear-gradient(120deg, rgba(141,198,65,0.10) 0%, rgba(141,198,65,0.04) 100%); border-color: rgba(141,198,65,0.25); }
/* Employee employment collapsible */
.profile-details { border: none; }
.profile-details summary { list-style: none; cursor: pointer; padding: 8px 0 2px; font-size: 13px; font-weight: 600; color: var(--color-primary-dark); user-select: none; display: flex; align-items: center; gap: 4px; }
.profile-details summary::-webkit-details-marker { display: none; }
.profile-details summary::after { content: ' ▸'; font-size: 11px; }
details[open].profile-details summary::after { content: ' ▾'; }
.profile-details-toggle { }
.profile-details-content { border-top: 1px solid var(--color-border); margin-top: 2px; padding-top: 4px; display: flex; flex-direction: column; }

.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 1100px) { .profile-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 680px)  { .profile-grid { grid-template-columns: 1fr; } }
.profile-card {
  background: var(--color-surface); border-radius: 12px; border: 1px solid var(--color-border-strong);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.profile-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 16px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-alt);
}
.profile-card-title { font-size: 11.5px; font-weight: 700; color: var(--color-text); text-transform: uppercase; letter-spacing: 0.6px; }
.profile-card-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }

/* Profile tabs */
.profile-tabs { display: flex; border-bottom: 2px solid #e8eae4; margin-bottom: 24px; gap: 4px; flex-wrap: wrap; }
.profile-tab { padding: 10px 18px; font-size: 13px; font-weight: 600; color: var(--color-text-muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; transition: all 0.15s; border-radius: 6px 6px 0 0; }
.profile-tab.active { color: var(--color-primary-dark); border-bottom-color: var(--color-primary); background: rgba(var(--color-primary-rgb),0.06); }
.profile-tab:hover:not(.active) { color: var(--color-text-secondary); background: #f4f5f0; }
.profile-tab-panel { display: none; }
.profile-tab-panel.active { display: block; }

/* Phase Stepper */
.phase-stepper {
  display: flex; align-items: flex-start;
  background: var(--color-surface); border-radius: 12px; border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  padding: 20px 28px; margin-bottom: 20px; overflow-x: auto;
}
.phase-step {
  display: flex; flex-direction: column; align-items: center;
  flex: 1; min-width: 90px; position: relative;
}
.phase-step-icon {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; margin-bottom: 7px; flex-shrink: 0;
}
.phase-step.done .phase-step-icon   { background: var(--color-primary); color: #fff; }
.phase-step.active .phase-step-icon { background: var(--color-primary-dark); color: #fff; box-shadow: 0 0 0 5px rgba(var(--color-primary-rgb),0.2); }
.phase-step.pending .phase-step-icon { background: #f0f2ec; color: #bbb; border: 2px solid #e0e2da; }
.phase-step.cancelled .phase-step-icon { background: #b04a4a; color: #fff; }
.phase-step-label { font-size: 12px; font-weight: 700; color: #333; text-align: center; }
.phase-step.pending .phase-step-label { color: #aaa; }
.phase-step.cancelled .phase-step-label { color: #7a3030; }
.phase-step-sub { font-size: 11px; color: #888; text-align: center; margin-top: 3px; max-width: 100px; }
.phase-step.active .phase-step-sub { color: var(--color-primary-dark); font-weight: 600; }
.phase-step.pending .phase-step-sub { color: #bbb; }
.phase-step.cancelled .phase-step-sub { color: #b04a4a; }
.phase-step-clickable { cursor: pointer; }
.phase-step-clickable:hover .phase-step-icon { opacity: 0.85; }
.phase-step-clickable:hover .phase-step-label { text-decoration: underline; }
.phase-connector {
  flex: 1; height: 2px; background: #e0e2da; margin-top: 18px; min-width: 24px; flex-shrink: 1;
}
.phase-connector.done { background: var(--color-primary); }

.profile-field { display: flex; flex-direction: column; gap: 2px; }
.profile-label { font-size: 11px; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.4px; font-weight: 600; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.profile-value { font-size: 14px; color: var(--color-text); line-height: 1.4; }

/* Logout button â”€â”€ */
.logout-btn { display: flex; align-items: center; gap: 8px; padding: 12px 24px; font-size: 12px; color: var(--color-text-faint); cursor: pointer; margin-top: auto; border-top: 1px solid var(--color-border); transition: color 0.15s; }
.logout-btn:hover { color: var(--color-danger); }
/* sidebar-signout-mobile: sign-out at the bottom of the mobile drawer only */
.sidebar-signout-mobile { display: none; border: none; background: none; font-family: inherit; width: 100%; text-align: left; }
@media (max-width: 768px) { .sidebar-signout-mobile { display: flex; } }

/* â”€â”€ Step workspace (HR view) â”€â”€ */
.workspace-header-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}
.workspace-step-num { font-size: 12px; font-weight: 700; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 6px; }
.workspace-header-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.btn-complete { font-size: 14px; padding: 10px 22px; }
.complete-warning { font-size: 11px; color: var(--color-warning-dark); text-align: right; max-width: 200px; }
.workspace-done-badge { font-size: 13px; color: var(--color-primary-dark); font-weight: 600; background: rgba(var(--color-primary-rgb),0.12); padding: 8px 16px; border-radius: 8px; white-space: nowrap; border: 1px solid rgba(var(--color-primary-rgb),0.25); }

/* ── Two-column workspace layout (Phase B) ── */
.workspace-layout { display: flex; gap: 20px; align-items: flex-start; }
.workspace-primary { flex: 1; min-width: 0; }
.workspace-secondary { width: 320px; flex-shrink: 0; }
@media (max-width: 900px) {
  .workspace-layout { flex-direction: column; }
  .workspace-secondary { width: 100%; }
}
/* Status border accent on header card — replaces full-width status banner */
.workspace-header-card.status-active  { border-left: 4px solid #6bbf45; }
.workspace-header-card.status-locked  { border-left: 4px solid #f0a500; }
.workspace-header-card.status-waiting { border-left: 4px solid #f0a500; }
.workspace-header-card.status-done    { border-left: 4px solid #a8c48a; }

/* ── D3-1: Blocking chain card ── */
.blocking-chain-card { border-left: 3px solid #f0a500; background: #fdfcf8; }
.blocking-chain-inner { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; }
.blocking-chain-label { font-size:10px; font-weight:700; color:#92651a; text-transform:uppercase; letter-spacing:0.6px; margin-bottom:5px; }
.blocking-chain-name  { font-size:14px; font-weight:700; color:#1c1f18; margin-bottom:3px; }
.blocking-chain-hint  { font-size:12px; color:#9aa08a; }
.blocking-chain-btn   { flex-shrink:0; font-size:12px; white-space:nowrap; }

/* â”€â”€ Progress stepper â”€â”€ */
.stepper-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 20px 24px 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}
.stepper-track {
  display: flex;
  align-items: flex-start;
  gap: 0;
  min-width: 0;
}
.stepper-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  flex: 1;
  min-width: 52px;
  cursor: pointer;
}
.stepper-item:hover .stepper-dot { filter: brightness(0.9); }
.stepper-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  flex-shrink: 0;
  transition: filter 0.15s;
  position: relative; z-index: 1;
}
.stepper-done    { background: var(--color-primary); color: #fff; }
.stepper-active  { background: var(--color-text); color: #fff; }
.stepper-pending { background: var(--color-surface-sunken); color: var(--color-text-label); border: 2px solid var(--color-border-strong); }
.stepper-locked  { background: #f0f0f0; color: #c0c4b8; border: 2px dashed var(--color-border-strong); }
.stepper-label {
  font-size: 10px; font-weight: 600; color: var(--color-text-label);
  text-align: center; margin-top: 6px;
  max-width: 64px; line-height: 1.3;
  word-break: break-word;
}
.stepper-current .stepper-label { color: var(--color-text); font-weight: 700; }
.stepper-line {
  position: absolute;
  top: 16px; left: calc(50% + 16px);
  width: calc(100% - 32px);
  height: 2px;
  background: var(--color-border-alt);
  z-index: 0;
}
.stepper-line-done { background: var(--color-primary); }
.stepper-summary {
  font-size: 11px; color: var(--color-text-muted); font-weight: 500;
  text-align: right; margin-top: 12px;
}

.workspace-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.workspace-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.workspace-card-title {
  font-size: 11px;
  font-weight: 800;
  color: #4e5646;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.workspace-card-secondary { background: var(--color-surface-alt); box-shadow: none; border-color: var(--color-border-alt); }
.workspace-card-danger { display: flex; align-items: center; border-color: rgba(var(--color-danger-rgb),0.15); box-shadow: none; }

.docs-progress-pill { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 20px; background: var(--color-surface-sunken); color: var(--color-text-label); }
.docs-progress-pill.docs-all-done { background: rgba(var(--color-primary-rgb),0.15); color: var(--color-primary-dark); }

/* â”€â”€ Step Guide accordion â”€â”€ */
.step-guide-accordion {
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border-alt);
  border-radius: 12px;
  margin-bottom: 16px;
  overflow: hidden;
}
.step-guide-accordion summary {
  padding: 14px 20px;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-label);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}
.step-guide-accordion summary::-webkit-details-marker { display: none; }
.step-guide-accordion summary::before { content: 'â–¶'; font-size: 9px; color: var(--color-text-muted); transition: transform 0.2s; }
.step-guide-accordion[open] summary::before { transform: rotate(90deg); }
.step-guide-accordion summary:hover { background: rgba(var(--color-primary-rgb),0.05); }
.step-guide-body { padding: 4px 20px 20px; }

/* â”€â”€ Attention badge (My Work sidebar count) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.attention-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 9px;
  padding: 0 5px;
  margin-left: 6px;
  vertical-align: middle;
}

/* â”€â”€ My Work view â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.my-work-section { margin-bottom: 18px; }
.my-work-section-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 0 0 8px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #e8eae4;
  color: var(--color-text-muted);
}
.my-work-section-header.overdue    { color: #ef4444; }
.my-work-section-header.due-soon   { color: #f0a500; }
.my-work-section-header.stalled    { color: #8888ff; }
.my-work-section-header.active-steps { color: var(--color-primary); }
.mw-urgency-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; padding: 4px 0 2px; margin-top: 6px; }
.mw-urgency-label.overdue  { color: #ef4444; }
.mw-urgency-label.due-soon { color: #f0a500; }
.mw-urgency-label.stalled  { color: #8888ff; }

/* â”€â”€ Dashboard attention banner â”€â”€ */
.attention-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: rgba(240,165,0,0.07); border: 1px solid rgba(240,165,0,0.25); border-radius: 8px; padding: 10px 16px; margin-bottom: 16px; }
.attention-item { font-size: 13px; font-weight: 700; }
.attention-item.overdue  { color: #ef4444; }
.attention-item.expiring { color: #f0a500; }

/* â”€â”€ Toast notification â”€â”€ */
.app-toast { position: fixed; bottom: 28px; right: 28px; background: #2d3a1e; color: var(--color-primary); border: 1px solid rgba(var(--color-primary-rgb),0.3); border-radius: 8px; padding: 11px 20px; font-size: 13px; font-weight: 600; z-index: 9999; box-shadow: 0 4px 16px rgba(0,0,0,0.35); opacity: 1; transition: opacity 0.45s; pointer-events: none; }
.app-toast-fade { opacity: 0; }
.app-toast-warning { color: #f0a500; border-color: rgba(240,165,0,0.3); }

/* Start Offboarding checklist — flags a workflow row whose Cancel/Leave-Active
   choice was left on the unselected placeholder when submission was attempted */
.wf-decision-missing { border-color: #b04a4a !important; box-shadow: 0 0 0 2px rgba(176,74,74,0.2); }
.my-work-count {
  font-size: 11px;
  background: rgba(255,255,255,0.1);
  padding: 2px 7px;
  border-radius: 9px;
  font-weight: 600;
}
.my-work-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-alt);
  border-radius: 10px;
  padding: 9px 14px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.my-work-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); border-color: #c8d4bf; }
.my-work-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-grad));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.my-work-info { flex: 1; min-width: 0; }
.my-work-name { font-size: 13px; font-weight: 600; color: var(--color-text); }
.my-work-step { font-size: 12px; color: var(--color-text-label); margin-top: 2px; }

/* â”€â”€ Doc owner grouping â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.doc-owner-group { margin-bottom: 6px; }
.doc-owner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 6px;
  border-bottom: 1px solid #f0f2ec;
  margin-bottom: 2px;
}
.doc-owner-header.doc-owner-done .doc-owner-name { color: #7a9060; }
.doc-owner-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.doc-owner-count { font-size: 11px; color: var(--color-text-muted); }
.doc-owner-count.done { color: var(--color-primary); font-weight: 700; }

/* â”€â”€ Inline step guide card â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.workspace-card-guide {
  background: #f8faf6;
  border: 1px solid #d8e8cc;
}
.workspace-card-guide .workspace-card-title { color: #3a5a2a; }

/* ── Phase 1B: Component System ─────────────────────────────────────────────── */

/* Button extensions */
.btn-ghost { background: transparent; color: var(--color-text-secondary); border: 1px solid transparent; }
.btn-ghost:hover { background: rgba(0,0,0,0.04); color: var(--color-text); border-color: var(--color-border-strong); }
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: var(--radius-sm); }
.btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.btn-danger:hover { background: rgba(var(--color-danger-rgb),0.12); border-color: rgba(var(--color-danger-rgb),0.35); color: var(--color-danger); }

/* Standard Card */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--color-border-alt);
  background: var(--color-surface-alt);
}
.card-title {
  font-size: 11px; font-weight: 700;
  color: var(--color-primary-dark);
  text-transform: uppercase; letter-spacing: 0.6px;
}
.card-body { padding: 20px; }
.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--color-border-alt);
  background: var(--color-surface-alt);
  font-size: 12px;
  color: var(--color-text-muted);
}

/* Standard page header — consistent size/weight/color/spacing across all views */
.page-title { font-size: 21px; font-weight: 800; color: var(--color-text); margin: 0 0 4px; line-height: 1.25; }
.page-subtitle { font-size: 12.5px; color: var(--color-text-secondary); margin-bottom: 16px; }

/* Unified badge base */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600;
  padding: 3px 8px; border-radius: var(--radius-full);
  white-space: nowrap;
}
.badge-success { background: rgba(var(--color-primary-rgb),0.15); color: var(--color-primary-dark); }
.badge-warning { background: rgba(var(--color-warning-rgb),0.12); color: var(--color-warning-dark); }
.badge-danger  { background: rgba(var(--color-danger-rgb),0.1);  color: var(--color-danger); }
.badge-neutral { background: var(--color-surface-sunken); color: var(--color-text-muted); }
.badge-info    { background: rgba(59,130,246,0.1); color: #1e6bc4; }
.badge-purple  { background: rgba(99,102,241,0.1); color: #4f46e5; }
.badge-lg { font-size: 12px; padding: 4px 10px; }

/* Form field extensions */
.form-hint { font-size: 11px; color: var(--color-text-muted); margin-top: 4px; line-height: 1.4; }
.form-label-required::after { content: ' *'; color: var(--color-danger); font-weight: 700; }
.form-field-error .form-input,
.form-field-error .form-select,
.form-field-error .form-textarea { border-color: var(--color-danger); box-shadow: 0 0 0 2px rgba(var(--color-danger-rgb),0.1); }

/* Inline empty state (smaller than full-page emptyState) */
.empty-inline { padding: 12px 0; font-size: 13px; color: var(--color-text-muted); font-style: italic; text-align: center; }


/* ══ Phase 1E: Sidebar logo ══════════════════════════════════════════════════ */
/* Real energuy PNG asset has its own thin dark outline, so it reads fine
   directly on the light sidebar surface -- no dark band needed behind it. */
.sidebar-logo {
  padding: 18px 24px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* In the mobile drawer the header beside the close button already shows the logo. */
@media (max-width: 768px) { .sidebar-logo { display: none; } }
/* ══ Phase 1E: Topbar restructure ════════════════════════════════════════════ */
.topbar-breadcrumb {
  flex: 1; display: flex; align-items: center; gap: 6px;
  font-size: 13.5px; font-weight: 600; color: var(--color-text);
  min-width: 0; overflow: hidden;
}
.breadcrumb-item { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.breadcrumb-sep  { color: #ccc; font-size: 12px; flex-shrink: 0; font-weight: 400; }
.breadcrumb-context { color: var(--color-text-secondary); font-weight: 400; }

.topbar-right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.topbar-user-zone { padding-left: 14px; border-left: 1px solid var(--color-border); }

/* Roadmap indicator */
.topbar-roadmap {
  font-size: 11px; color: #b8c4a0; white-space: nowrap; letter-spacing: 0.01em;
}
.topbar-roadmap-label { font-weight: 600; color: #a0ad8a; }

/* User zone */
.topbar-user-zone { position: relative; }
.topbar-user-btn {
  display: flex; align-items: center; gap: 7px;
  cursor: pointer; padding: 5px 8px 5px 5px; border-radius: 8px;
  border: 1px solid transparent; background: none;
  font-size: 13px; color: var(--color-text); font-family: inherit;
  transition: all 0.15s;
}
.topbar-user-btn:hover { background: var(--color-surface-raised); border-color: var(--color-border); }
.topbar-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.topbar-username {
  max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar-chevron { font-size: 10px; color: #999; }
.topbar-user-menu {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,0.12);
  min-width: 210px; z-index: 300; display: none; overflow: hidden;
}
.topbar-user-menu.open { display: block; }
.topbar-user-menu-item {
  padding: 9px 14px; font-size: 13px; cursor: pointer;
  color: var(--color-text); transition: background 0.1s;
}
.topbar-user-menu-item:hover { background: var(--color-surface-raised); }
.topbar-user-menu-item.u-muted {
  color: var(--color-text-secondary); font-size: 11px;
  cursor: default; padding-bottom: 6px;
}
.topbar-user-menu-item.u-muted:hover { background: none; }
.topbar-user-menu-divider { height: 1px; background: var(--color-border); margin: 2px 0; }
.topbar-user-menu-item.u-danger { color: #ef4444; }
.topbar-user-menu-item.u-danger:hover { background: rgba(239,68,68,0.06); }

/* ══ Phase 1E: Mobile bottom nav ════════════════════════════════════════════ */
.mobile-bottom-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--color-sidebar); border-top: 1px solid rgba(255,255,255,0.09);
  z-index: 150; padding-bottom: env(safe-area-inset-bottom, 0);
}
.m-bottom-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 8px 4px 6px; gap: 3px;
  color: rgba(255,255,255,0.42); font-size: 10px; cursor: pointer;
  border: none; background: none; font-family: inherit; transition: color 0.15s;
}
.m-bottom-item.active { color: var(--color-primary); }
.m-bottom-item:hover  { color: rgba(255,255,255,0.75); }
.m-bottom-icon { font-size: 18px; line-height: 1; }


/* ══ Collapsible sidebar sections ══════════════════════════════════════════ */
.sidebar-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 22px 4px; cursor: pointer; user-select: none;
}
.sidebar-section-header:hover .sidebar-section-label-text { color: var(--color-primary); }
.sidebar-section-label-text {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--color-primary-grad);
}
.sidebar-section-chevron {
  font-size: 13px; color: var(--color-text-secondary);
  transition: transform 0.2s; display: inline-block; line-height: 1; flex-shrink: 0;
}
.sidebar-section-chevron.collapsed { transform: rotate(-90deg); }
.sidebar-section-body { overflow: hidden; }
.sidebar-section-body.collapsed { display: none; }

/* ══ Phase 1E-b: Topbar module chips ════════════════════════════════════════ */
.topbar-modules { display: flex; align-items: center; gap: 4px; }
.topbar-module {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 7px; font-size: 13px;
  white-space: nowrap; transition: background-color 0.15s, color 0.15s; line-height: 1.4;
}
/* Current module (home/HR Platform) — confident, unmistakably "you are here" */
.topbar-module.tm-active {
  background: rgba(var(--color-primary-rgb),0.12);
  color: var(--color-primary-dark); cursor: pointer; font-weight: 700;
}
.topbar-module.tm-active:hover { background: rgba(var(--color-primary-rgb),0.20); }
/* Other live modules — clickable, but not styled as the current location */
.topbar-module.tm-live {
  background: transparent;
  color: var(--color-text-secondary); cursor: pointer; font-weight: 600;
}
.topbar-module.tm-live:hover { background: var(--color-surface-alt); color: var(--color-text); }
/* Planned modules — recede, text-only, never looks broken/disabled */
.topbar-module.tm-planned {
  background: transparent;
  color: var(--color-text-faint); cursor: default; font-weight: 500;
}
.topbar-module-soon {
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--color-text-muted); background: var(--color-surface-raised);
  padding: 1px 6px; border-radius: 4px; line-height: 1.6;
}


/* ══ Workflow Editor: grouped template list ══════════════════════════════════ */
.wf-phase-header {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--color-text-secondary);
  padding: 20px 0 8px;
}
.wf-phase-group:first-child .wf-phase-header { padding-top: 4px; }
.wf-template-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-radius: 10px;
  border: 1px solid var(--color-border); margin-bottom: 6px;
  background: var(--color-surface); cursor: pointer; transition: all 0.15s;
}
.wf-template-row:hover { border-color: var(--color-primary); background: rgba(var(--color-primary-rgb), 0.04); }
.wf-template-name { font-size: 13px; font-weight: 600; color: var(--color-text); }
.wf-template-meta { font-size: 11px; color: var(--color-text-secondary); margin-top: 3px; }

/* ══ My Time Off (attendance self-service, step 5) ═══════════════════════════
   Mobile first. Green buttons carry dark text for contrast (owner decision,
   2026-10-31); secondary text uses --color-text-secondary, never muted. */
.mto { display: flex; flex-direction: column; gap: 16px; max-width: 1180px; margin: 0 auto; color: var(--color-text); }
.mto-narrow { max-width: 640px; }
.mto-hist { max-width: 740px; }
.mto .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mto-title { margin: 0; font-size: 22px; font-weight: 700; }
.mto-head { display: flex; flex-direction: column; gap: 14px; }
.mto-go-row { display: flex; flex-direction: column; gap: 12px; }
.mto-go { min-height: 76px; border-radius: 12px; border: 1px solid var(--color-border-strong); background: var(--color-surface); color: var(--color-text);
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 3px; padding: 0 16px; font-family: inherit; text-align: left; cursor: pointer; }
.mto-go-primary { background: var(--color-primary); border-color: var(--color-primary); }
.mto-go:hover { border-color: var(--color-primary-dark); }
.mto-go-title { font-size: 16px; font-weight: 700; }
.mto-go-sub { font-size: 13px; color: var(--color-text-secondary); }
.mto-go-primary .mto-go-sub { color: #2f3e10; }
.mto-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.mto-main, .mto-side, .mto-stack, .mto-section { display: flex; flex-direction: column; gap: 10px; }
.mto-h2 { margin: 4px 0 0; font-size: 15px; font-weight: 700; }
.mto-label { margin: 6px 0 4px; font-size: 12px; font-weight: 600; color: var(--color-text-secondary); }
.mto-muted { margin: 0; font-size: 13px; color: var(--color-text-secondary); line-height: 1.45; }
.mto-text { margin: 0; font-size: 14px; line-height: 1.5; white-space: pre-wrap; }
.mto-hint { margin: 6px 0 0; font-size: 12px; color: var(--color-text-secondary); line-height: 1.45; }
.mto-card { width: 100%; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 4px; text-align: left; font-family: inherit; color: inherit; cursor: pointer; }
.mto-card:hover { border-color: var(--color-primary); }
.mto-card-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mto-card-title { margin: 0; font-size: 15px; font-weight: 600; }
.mto-card-sub { font-size: 13px; color: var(--color-text-secondary); }
.mto-badge { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 9999px; white-space: nowrap; }
.mto-amber { background: #fef3c7; color: #7c4a03; }
.mto-green { background: #e8f4d4; color: #3f5216; }
.mto-blue  { background: #dbeafe; color: #1e40af; }
.mto-red   { background: #fee2e2; color: #991b1b; }
.mto-grey  { background: var(--color-surface-raised); color: var(--color-text-secondary); }
.mto-panel { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.mto-usage { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 4px; }
.mto-usage div { display: flex; flex-direction: column; gap: 2px; }
.mto-usage strong { font-size: 22px; font-weight: 700; }
.mto-usage span { font-size: 12px; color: var(--color-text-secondary); }
.mto-approver { margin: 0; font-size: 15px; font-weight: 600; }
.mto-line { margin: 0; display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.mto-line span { color: var(--color-text-secondary); }
.mto-empty { text-align: center; padding: 40px 20px; display: flex; flex-direction: column; gap: 8px; align-items: center; color: var(--color-text-label); }
.mto-empty-title { margin: 0; font-size: 15px; font-weight: 600; color: var(--color-text); }
.mto-empty-sub { margin: 0; font-size: 13px; color: var(--color-text-secondary); }
.mto-skeleton { background: var(--color-surface-sunken); border-radius: 12px; margin-bottom: 10px; animation: mto-pulse 1.4s ease-in-out infinite; }
@keyframes mto-pulse { 50% { opacity: 0.55; } }
@media (prefers-reduced-motion: reduce) { .mto-skeleton { animation: none; } }
.mto-alert { border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.mto-alert-warn { background: #fffbeb; border: 1px solid #fde68a; }
.mto-alert-error { background: #fef2f2; border: 1px solid #fecaca; }
.mto-alert-title { margin: 0; font-size: 14px; font-weight: 600; }
.mto-alert-warn .mto-alert-title { color: #7c4a03; }
.mto-alert-error .mto-alert-title { color: #991b1b; }
.mto-alert-body { margin: 0; font-size: 13px; line-height: 1.45; }
.mto-btn { min-height: 46px; padding: 0 16px; border-radius: 10px; font-family: inherit; font-size: 15px; font-weight: 700; cursor: pointer; border: 1px solid transparent; }
.mto-btn:disabled { opacity: 0.6; cursor: default; }
.mto-btn-primary { background: var(--color-primary); color: var(--color-text); }
.mto-btn-primary:hover:not(:disabled) { background: #7fb536; }
.mto-btn-secondary { background: var(--color-surface); color: var(--color-text); border-color: var(--color-border-strong); font-weight: 600; font-size: 14px; }
.mto-btn-block { width: 100%; min-height: 50px; font-size: 16px; }
/* Cancel and withdraw: tinted red to open, solid red to confirm. #b91c1c on white and white on #b91c1c both pass AA. */
.mto-btn-danger { background: #fef2f2; color: #b91c1c; border-color: #fca5a5; font-weight: 600; font-size: 14px; }
.mto-btn-danger:hover:not(:disabled) { background: #fee2e2; border-color: #f87171; }
.mto-btn-danger-solid { background: #b91c1c; color: #fff; }
.mto-btn-danger-solid:hover:not(:disabled) { background: #991b1b; }
/* One visible focus ring for every My Time Off control; headings and panels that take focus from a script show none. */
.mto button:focus-visible { outline: 2px solid var(--color-primary-dark); outline-offset: 2px; }
.mto [tabindex="-1"]:focus { outline: none; }
.mto-input[aria-invalid="true"] { border-color: #b91c1c; }
.mto-chips.mto-invalid .mto-chip:not(.mto-on) { border-color: #b91c1c; }
#mto-announcer { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mto-link { min-height: 44px; border: 0; background: none; font-family: inherit; font-size: 14px; font-weight: 600; color: var(--color-primary-dark); cursor: pointer; padding: 0 4px; align-self: flex-start; }
.mto-more { align-self: center; }
.mto-filters, .mto-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mto-chip { min-height: 44px; padding: 0 14px; border-radius: 9999px; border: 1px solid var(--color-border-strong); background: var(--color-surface);
  font-family: inherit; font-size: 14px; font-weight: 500; color: var(--color-text); cursor: pointer; }
.mto-filters .mto-chip { min-height: 40px; font-size: 13px; }
.mto-chip.mto-on, .mto-seg-btn.mto-on { background: #e8f4d4; border: 2px solid var(--color-primary-dark); font-weight: 600; color: #2f3e10; }
.mto-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; background: var(--color-surface-raised); padding: 4px; border-radius: 10px; }
.mto-seg-btn { min-height: 40px; border: 1px solid transparent; border-radius: 8px; background: none; font-family: inherit; font-size: 14px; font-weight: 500; color: var(--color-text); cursor: pointer; }
.mto-backbar { display: flex; align-items: center; gap: 4px; margin: -4px 0 0 -8px; }
.mto-back { width: 44px; height: 44px; border: 0; background: none; display: flex; align-items: center; justify-content: center; color: var(--color-text); cursor: pointer; border-radius: 8px; }
.mto-backbar-title { margin: 0; font-size: 18px; font-weight: 700; }
.mto-note-box { background: var(--color-surface-alt); border: 1px solid var(--color-border); border-radius: 10px; padding: 12px 14px; font-size: 13px; color: var(--color-text-secondary); line-height: 1.45; }
/* Time off details: summary, approval, notes (approved redesign, 2026-11-02). */
.mto-detail { max-width: 1080px; gap: 12px; }
.mto-detail-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mto-detail-actions { flex-direction: row !important; flex-wrap: wrap; gap: 10px; }
.mto-detail-actions .mto-btn { min-width: 140px; }
.mto-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
.mto-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.mto-box { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 14px; box-shadow: 0 1px 2px rgba(28,31,24,0.04);
  padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.mto-box-soft { background: var(--color-surface-alt); box-shadow: none; }
.mto-box-red { background: #fef2f2; border-color: #fecaca; gap: 8px; }
.mto-caps { margin: 0; font-size: 12px; font-weight: 600; color: var(--color-text-secondary); letter-spacing: 0.02em; text-transform: uppercase; }
.mto-amber-text { color: #7c4a03; }
.mto-red-text { color: #991b1b; }
.mto-sum-head { display: flex; align-items: center; gap: 12px; }
.mto-sum-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mto-sum-type { margin: 0; font-size: 15px; font-weight: 600; }
.mto-tile { width: 42px; height: 42px; border-radius: 12px; flex: none; display: flex; align-items: center; justify-content: center; }
.mto-tile-green { background: #e8f4d4; color: #3f5216; }
.mto-tile-blue { background: #dbeafe; color: #1e40af; }
.mto-tile-grey { background: var(--color-surface-raised); color: var(--color-text-secondary); }
.mto-detail-dates { margin: 0; font-size: 24px; font-weight: 700; line-height: 1.25; }
.mto-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mto-fact { background: var(--color-surface-alt); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.mto-fact-value { margin: 0; font-size: 15px; font-weight: 600; }
.mto-dates-list { display: flex; flex-direction: column; gap: 8px; }
.mto-day-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: var(--color-surface-alt); border-radius: 10px; padding: 11px 14px; font-size: 14px; font-weight: 600; }
.mto-day-row .mto-muted { font-weight: 400; }
.mto-change { border: 2px solid #f59e0b; background: #fffbeb; border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.mto-quote { margin: 0; font-size: 15px; line-height: 1.5; white-space: pre-wrap; }
.mto-lock { display: flex; gap: 12px; align-items: flex-start; color: var(--color-text-secondary); }
.mto-lock > svg { flex: none; margin-top: 1px; }
.mto-lock .mto-fact-value { color: var(--color-text); font-size: 14px; }
.mto-person { display: flex; align-items: center; gap: 12px; }
.mto-avatar { width: 40px; height: 40px; border-radius: 9999px; flex: none; background: var(--color-text); color: #fff; font-size: 14px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.mto-steps { list-style: none; margin: 0; padding: 0; }
.mto-step { display: grid; grid-template-columns: 24px 1fr; gap: 12px; }
.mto-step-rail { display: flex; flex-direction: column; align-items: center; }
.mto-step-mark { width: 22px; height: 22px; box-sizing: border-box; border-radius: 9999px; flex: none; display: flex; align-items: center; justify-content: center; color: #fff;
  background: var(--color-surface); border: 2px solid var(--color-border-strong); }
.mto-step-line { width: 2px; flex: 1; min-height: 16px; background: var(--color-border-strong); }
.mto-step-done .mto-step-mark { background: var(--color-primary-dark); border-color: var(--color-primary-dark); }
.mto-step-current .mto-step-mark { border: 3px solid #f59e0b; }
.mto-step-declined .mto-step-mark { background: #dc2626; border-color: #dc2626; }
.mto-step-ended .mto-step-mark { background: var(--color-text-label); border-color: var(--color-text-label); }
.mto-step-body { padding-bottom: 16px; min-width: 0; }
.mto-step:last-child .mto-step-body { padding-bottom: 0; }
.mto-step-text { margin: 0; font-size: 14px; font-weight: 600; }
.mto-step-upcoming .mto-step-text { font-weight: 500; color: var(--color-text-secondary); }
.mto-step-at { margin: 2px 0 0; font-size: 13px; color: var(--color-text-secondary); line-height: 1.45; }
.mto-step-note { margin: 6px 0 0; font-size: 14px; line-height: 1.5; }
.mto-step-changes { list-style: none; margin: 6px 0 0; padding: 8px 10px; display: flex; flex-direction: column; gap: 4px;
  background: var(--color-surface-raised); border-radius: 8px; font-size: 13px; line-height: 1.45; }
.mto-step-change-label { display: inline-block; min-width: 72px; margin-right: 6px; font-weight: 600; color: var(--color-text-secondary); }
.mto-step-from { color: var(--color-text-secondary); text-decoration: line-through; }
.mto-detail-foot { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 10px; background: var(--color-surface);
  border-top: 1px solid var(--color-border); margin: 4px -16px -16px; padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px)); }
.mto-detail-foot .mto-btn { flex: 1 1 140px; }
.mto-action-row { display: flex; flex-wrap: wrap; gap: 10px; }
.mto-action-row .mto-btn { flex: 1 1 140px; }
.mto-confirm { border: 1px solid var(--color-border-strong); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--color-surface); }
.mto-confirm-title { margin: 0; font-size: 15px; font-weight: 700; }
.mto-form { gap: 20px; }
.mto-field { display: flex; flex-direction: column; }
.mto-field-label { margin: 0 0 8px; font-size: 13px; font-weight: 600; display: block; }
.mto-small-label { font-size: 12px; color: var(--color-text-secondary); display: block; margin-bottom: 4px; }
.mto-optional { font-weight: 400; color: var(--color-text-secondary); }
.mto-input { width: 100%; box-sizing: border-box; min-height: 46px; border: 1px solid var(--color-border-strong); border-radius: 8px; padding: 0 12px;
  font-family: inherit; font-size: 16px; color: var(--color-text); background: var(--color-surface); }
.mto-input:focus { outline: 2px solid var(--color-primary-dark); outline-offset: 1px; }
.mto-textarea { padding: 10px 12px; resize: vertical; min-height: 64px; }
/* Privacy reminder: a quiet info box under each free-text field, easy to notice on a phone. */
.mto-privacy { margin: 8px 0 0; display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px;
  background: #eef6e2; border: 1px solid #d3e8b5; color: #2f3e10; font-size: 13px; line-height: 1.45; }
.mto-privacy > svg { flex: none; margin-top: 1px; color: #3f5216; }
.mto-date-echo { margin: 4px 0 0; font-size: 13px; color: var(--color-text-secondary); min-height: 1em; }
.mto-history-link { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 16px;
  border-radius: 12px; border: 1px solid var(--color-border-strong); background: var(--color-surface); color: var(--color-primary-dark);
  font-family: inherit; font-size: 15px; font-weight: 700; cursor: pointer; text-align: left; }
.mto-history-link:hover { border-color: var(--color-primary-dark); }
.mto-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.mto-gap { margin-top: 12px; }
.mto-sep-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.mto-icon-btn { width: 44px; height: 44px; flex: none; border: 1px solid var(--color-border-strong); border-radius: 8px; background: var(--color-surface); cursor: pointer; color: var(--color-text-secondary); }
.mto-summary { margin: 8px 0 0; font-size: 13px; color: var(--color-text-secondary); min-height: 1em; }
.mto-warn-text { color: #7c4a03; }
.mto-form-foot { position: sticky; bottom: 0; background: var(--color-bg); padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--color-border); z-index: 5; }
.mto-done { gap: 20px; padding-top: 16px; }
.mto-done-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.mto-done-icon { width: 60px; height: 60px; border-radius: 9999px; background: #e8f4d4; color: #3f5216; display: flex; align-items: center; justify-content: center; }
.mto-done > .mto-link { align-self: center; }
.mto-table { width: 100%; border-collapse: collapse; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px; overflow: hidden; font-size: 14px; }
.mto-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--color-text-secondary); padding: 10px 14px; border-bottom: 1px solid var(--color-border); }
.mto-table td { padding: 12px 14px; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
.mto-table .mto-td-dates, .mto-table .mto-td-status { white-space: nowrap; }
.mto-td-main { display: block; font-weight: 600; }
.mto-td-sub { display: block; margin-top: 2px; font-size: 13px; color: var(--color-text-secondary); }
.mto-td-chev { width: 24px; color: var(--color-text-secondary); font-size: 20px; text-align: right; }
.mto-row-link { border: 0; background: none; padding: 0; font-family: inherit; font-size: 14px; font-weight: 700; color: var(--color-text); cursor: pointer; text-align: left; }
.mto-row-link:focus-visible { outline: 2px solid var(--color-primary-dark); outline-offset: 2px; border-radius: 4px; }
.mto-table tbody tr { cursor: pointer; }
.mto-table tbody tr:hover { background: var(--color-surface-alt); }
.mto-table tbody tr:last-child td { border-bottom: 0; }
.mto-desk-only { display: none; }
/* Two columns only where the table has room beside the side cards. */
@media (min-width: 1100px) { .mto-grid { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; } }
/* Mobile vacation stat strip */
.mto-stat-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; background: var(--color-surface-alt); border: 1px solid var(--color-border); border-radius: 10px; padding: 10px 12px; }
.mto-stat-strip div { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; }
.mto-stat-strip strong { font-size: 20px; font-weight: 700; color: var(--color-text); line-height: 1.1; }
.mto-stat-strip span { font-size: 11px; color: var(--color-text-secondary); }
/* Mobile approver compact line */
.mto-approver-line { margin: 2px 0 0; font-size: 13px; color: var(--color-text-secondary); }
.mto-approver-line strong { color: var(--color-text); font-weight: 600; }
.mto-approver-cover { font-size: 12px; font-weight: 400; }
@media (min-width: 900px) {
  .mto-head { gap: 16px; }
  .mto-go-row { flex-direction: row; align-self: center; gap: 14px; }
  .mto-go { min-height: 68px; padding: 0 20px; width: 270px; flex: none; max-width: none; }
  .mto-phone-only { display: none; }
  .mto-desk-only { display: flex; flex-direction: column; gap: 10px; }
  .mto-form-foot { position: static; border-top: 0; padding: 0; }
  .mto-detail-grid { grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; }
  .mto-col { gap: 20px; }
  .mto-box { padding: 24px; }
  .mto-detail-dates { font-size: 26px; }
}

/* ── Period selector ─────────────────────────────────────────────────────── */
.mto-period-wrap { display: flex; flex-direction: column; gap: 10px; }
.mto-period-row { display: flex; flex-wrap: wrap; gap: 6px; }
.mto-period-btn { min-height: 36px; padding: 0 14px; border-radius: 9999px; border: 1px solid var(--color-border-strong); background: var(--color-surface); font-family: inherit; font-size: 13px; font-weight: 500; color: var(--color-text); cursor: pointer; }
.mto-period-btn:hover { border-color: var(--color-primary-dark); }
.mto-period-active { background: #e8f4d4; border: 2px solid var(--color-primary-dark); font-weight: 600; color: #2f3e10; }
.mto-period-custom { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.mto-period-label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 500; color: var(--color-text-secondary); }
.mto-period-date { height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--color-border-strong); background: var(--color-surface); font-family: inherit; font-size: 13px; color: var(--color-text); }
.mto-period-apply { min-height: 36px !important; padding: 0 14px !important; font-size: 13px !important; }
/* ── Summary cards ───────────────────────────────────────────────────────── */
.mto-sumcards { display: grid; grid-template-columns: 1fr; gap: 10px; }
.mto-sumcards-skel { display: flex; flex-direction: column; gap: 10px; }
.mto-sumcard { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.mto-sumcard-label { font-size: 12px; font-weight: 600; color: var(--color-text-secondary); letter-spacing: 0.02em; text-transform: uppercase; }
.mto-sumcard-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 14px; }
.mto-sumcard-row strong { font-size: 26px; font-weight: 700; line-height: 1; }
.mto-sumcard-fwd span { color: var(--color-text-secondary); font-size: 13px; }
.mto-sumcard-fwd strong { font-size: 16px; }
@media (min-width: 900px) { .mto-sumcards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* ── Home footer (history link + mobile approver) ────────────────────────── */
.mto-home-foot { display: flex; flex-direction: column; gap: 10px; }
/* ── History controls (year selector + filter chips) ─────────────────────── */
.mto-history-controls { display: flex; flex-direction: column; gap: 10px; }
.mto-year-sel { height: 40px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--color-border-strong); background: var(--color-surface); font-family: inherit; font-size: 14px; font-weight: 500; color: var(--color-text); cursor: pointer; align-self: flex-start; }
/* ── Time off to approve (My Work, attendance self-service step 6A) ───────── */
.toa-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.toa .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.toa-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.toa-sort { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--color-text-secondary); }
.toa-select { min-height: 40px; width: auto; padding: 0 10px; font-size: 13px; }
.toa-muted { margin: 0; font-size: 13px; color: var(--color-text-secondary); }
.toa-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.toa-row { border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-surface); }
.toa-row.toa-flag { border-color: #f0b44a; }
.toa-row.toa-open { border-color: var(--color-primary-dark); }
.toa-main { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px; }
.toa-check { width: 20px; height: 20px; accent-color: var(--color-primary-dark); }
.toa-check-space { width: 20px; }
.toa-text { min-width: 0; }
.toa-name { margin: 0; font-size: 15px; font-weight: 600; }
.toa-what { margin: 2px 0 0; font-size: 13px; color: var(--color-text-secondary); }
.toa-what strong { color: var(--color-text); font-weight: 600; }
.toa-was { text-decoration: line-through; color: var(--color-text-secondary); }
.toa-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.toa-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.toa-btn { min-height: 44px; font-size: 14px; }
.toa-pending { font-size: 13px; font-weight: 600; color: #3f5216; }
.toa-row-error { padding: 0 12px 12px; }
.toa-expand { border-top: 1px solid var(--color-border); padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.toa-exp-title { margin: 0; font-size: 15px; font-weight: 700; }
.toa-exp-title:focus { outline: none; }
.toa-exp-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; }
.toa-exp-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.toa-facts { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.toa-kv { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; font-size: 14px; }
.toa-kv dt { color: var(--color-text-secondary); }
.toa-kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.toa-sub { margin: 0 0 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-secondary); }
.toa-conflict { background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.toa-conflict ul, .toa-recent ul { margin: 0; padding-left: 18px; }
.toa-away { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.toa-away li { display: flex; justify-content: space-between; gap: 10px; }
.toa-history { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.toa-history li { display: flex; flex-direction: column; gap: 2px; }
.toa-quote { color: var(--color-text-secondary); }
.toa-decide { display: flex; flex-direction: column; gap: 8px; background: var(--color-surface-raised); border-radius: 12px; padding: 12px; }
.toa-decide p { margin: 0; font-size: 14px; }
.toa-confirm { display: flex; flex-direction: column; gap: 10px; }
.toa-confirm-title { margin: 0; font-size: 15px; font-weight: 700; }
.toa-confirm-title:focus { outline: none; }
.toa-bulk { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; background: #e8f4d4; border: 1px solid var(--color-primary); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.toa-bulk p { margin: 0; }
.toa-bulk ul { margin: 0; padding-left: 18px; width: 100%; }
.toa-bulk-acts { display: flex; gap: 8px; }
.toa-recent { border-top: 1px solid var(--color-border); padding-top: 10px; font-size: 13px; color: var(--color-text-secondary); }
/* My Work collapsible sections (step 6A): a heading holding one full-width button. */
.mw-sec { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 14px; margin-bottom: 16px; }
.mw-sec-title { margin: 0; font-size: 17px; font-weight: 700; }
.mw-sec-title:focus { outline: none; }
.mw-sec-toggle { width: 100%; min-height: 56px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; padding: 12px 16px;
  background: none; border: 0; border-radius: 14px; text-align: left; font: inherit; color: var(--color-text); cursor: pointer; }
.mw-sec-toggle:hover { background: var(--color-surface-alt); }
.mw-sec-toggle:focus-visible { outline: 2px solid var(--color-primary-dark); outline-offset: -2px; }
.mw-sec-chev { width: 12px; display: inline-flex; justify-content: center; flex-shrink: 0; }
.mw-sec-chev::before { content: ''; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform 0.15s ease; }
.mw-sec-toggle[aria-expanded="true"] .mw-sec-chev::before { transform: rotate(45deg); }
.mw-sec-summary { font-size: 13px; font-weight: 500; color: var(--color-text-secondary); }
.mw-sec-open .mw-sec-toggle { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.mw-sec-body { padding: 4px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.mw-sec-body[hidden] { display: none; }
.mw-sec-body .my-work-section { margin-bottom: 0; }
@media (max-width: 600px) {
  .mw-sec-summary { flex-basis: 100%; padding-left: 22px; }
  .mw-sec-body { padding: 4px 12px 12px; }
  .my-work-item .chip { display: none; }
  .mw-timer-txt { display: block; white-space: normal; }
  .mw-remind-btn { display: none; }
}
/* M-H2: dashboard two-column grid stacks on mobile */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 768px) { .dash-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .mw-sec-chev::before { transition: none; } }
.toa-chip-count { display: inline-block; min-width: 20px; margin-left: 4px; padding: 0 6px; border-radius: 9999px; background: var(--color-surface-raised); font-size: 12px; font-weight: 700; text-align: center; }
.toa-decided-list { list-style: none; margin: 0; font-size: 13px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.toa-decided-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 6px 0; border-bottom: 1px solid var(--color-border); }
.toa-decided-who { font-weight: 600; color: var(--color-text); min-width: 140px; }
.toa-consequence { margin: 8px 0 0; font-size: 13px; color: var(--color-text-secondary); }
.attention-badge .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.toa-recent-title { margin: 0 0 4px; font-weight: 600; color: var(--color-text); }
@media (max-width: 760px) { .toa-exp-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .toa-main { grid-template-columns: 24px minmax(0, 1fr); }
  .toa-acts { grid-column: 1 / -1; justify-content: stretch; }
  .toa-acts .toa-btn { flex: 1 1 120px; }
  .toa-kv { grid-template-columns: 1fr; gap: 0; }
  .toa-controls { flex-direction: column; align-items: stretch; }
}

/* ── Shared attendance form (Step 7A, src/shared/attendance-form.js) ──
   A centred dialog on desktop and a full-screen sheet on phones. The fields use
   the My Time Off controls (.mto-*), so every entry point looks the same. */
body.af-locked { overflow: hidden; }
.af-backdrop { position: fixed; inset: 0; z-index: 1100; background: rgba(17, 24, 39, 0.45); display: flex; align-items: center; justify-content: center; padding: 24px; }
.af-dialog { background: var(--color-surface); border-radius: 16px; box-shadow: 0 20px 48px rgba(0,0,0,0.2); width: 100%; max-width: 560px; max-height: calc(100vh - 48px); display: flex; flex-direction: column; gap: 0; margin: 0; }
.af-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; border-bottom: 1px solid var(--color-border); }
.af-title { margin: 0; font-size: 18px; font-weight: 700; }
.af-sub { margin: 2px 0 0; font-size: 13px; color: var(--color-text-secondary); }
.af-close { width: 40px; height: 40px; flex: none; border: 0; background: none; border-radius: 8px; font-size: 18px; color: var(--color-text-secondary); cursor: pointer; }
.af-close:hover:not(:disabled) { background: var(--color-surface-raised); color: var(--color-text); }
.af-body { padding: 16px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }
.af-foot { padding: 12px 20px 18px; border-top: 1px solid var(--color-border); display: flex; flex-direction: column; gap: 12px; }
.af-foot-actions { display: flex; justify-content: flex-end; gap: 10px; }
.af-check { display: flex; align-items: center; gap: 10px; font-size: 14px; min-height: 44px; cursor: pointer; }
.af-check input { width: 18px; height: 18px; }
.af-more-body { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; padding: 12px 14px; border: 1px solid var(--color-border); border-radius: 10px; background: var(--color-surface-alt); }
.af-more-body[hidden] { display: none; }
.af-slots { border: 1px solid #fde68a; background: #fffbeb; border-radius: 10px; padding: 10px 14px; }
.af-slots-title { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: #7c4a03; }
.af-slots-note { margin: 0; font-size: 13px; color: var(--color-text-secondary); }
.af-slot-list, .af-results { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.af-slot { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; flex-wrap: wrap; }
.af-slot-act { min-height: 36px; }
.af-result { font-size: 13px; }
.af-result-ok { color: #2f6b12; }
.af-result-warn { color: #7c4a03; }
.af-result-error { color: #991b1b; }
@media (max-width: 640px) {
  .af-backdrop { padding: 0; align-items: stretch; }
  .af-dialog { max-width: none; max-height: none; height: 100%; border-radius: 0; }
  .af-head { padding: 14px 16px 10px; }
  .af-body { padding: 14px 16px; }
  .af-foot { padding: 10px 16px calc(14px + env(safe-area-inset-bottom)); }
  .af-foot-actions .mto-btn { flex: 1; }
}
