/* ==========================================================================
   Techviv Portal — design system
   One set of tokens, one spacing scale, one component for each job.
   ========================================================================== */

:root {
  --bg: #f5f6fb;
  --surface: #ffffff;
  --surface-2: #f7f8fc;
  --surface-3: #eceef6;
  --border: #e6e8f1;
  --border-strong: #d6dae6;
  --text: #182033;
  --text-2: #475069;
  --muted: #6b7489;
  --primary: #5b4cf0;
  --primary-600: #4a3bd9;
  --primary-soft: rgba(91, 76, 240, 0.1);
  --primary-text: #4b3cdc;
  --accent: #10b4d4;
  --success: #0e9f6e;
  --success-soft: rgba(16, 185, 129, 0.12);
  --success-text: #077a54;
  --warning: #d97706;
  --warning-soft: rgba(245, 158, 11, 0.15);
  --warning-text: #965a03;
  --danger: #dc2626;
  --danger-soft: rgba(239, 68, 68, 0.11);
  --danger-text: #b42318;
  --info: #0284c7;
  --info-soft: rgba(14, 165, 233, 0.12);
  --info-text: #0369a1;
  --muted-soft: rgba(100, 116, 139, 0.12);
  --muted-text: #4b5568;
  --holiday-soft: rgba(168, 85, 247, 0.13);
  --holiday-text: #7e22ce;
  --input-bg: #ffffff;
  --nav-bg: rgba(255, 255, 255, 0.86);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 6px 20px rgba(16, 24, 40, 0.05);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, 0.14);
  --radius: 16px;
  --radius-sm: 10px;
  --gap: 20px;
  --content: 1240px;
  --font: 'DM Sans', 'Segoe UI', system-ui, sans-serif;
  --font-display: 'Manrope', 'Segoe UI', system-ui, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

  /* Bootstrap bridges so its components follow our theme */
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-body-font-family: var(--font);
  --bs-border-color: var(--border-strong);
  --bs-secondary-bg: var(--surface-2);
  --bs-tertiary-bg: var(--surface-2);
  --bs-emphasis-color: var(--text);
  --bs-secondary-color: var(--muted);
  --bs-link-color: var(--primary-text);
  --bs-link-hover-color: var(--primary-600);
  --bs-link-color-rgb: 75, 60, 220;
  --bs-focus-ring-color: rgba(91, 76, 240, 0.25);
}

:root[data-theme="dark"] {
  --bg: #0b1020;
  --surface: #121a2d;
  --surface-2: #172138;
  --surface-3: #1f2b46;
  --border: rgba(148, 163, 184, 0.15);
  --border-strong: rgba(148, 163, 184, 0.26);
  --text: #e7edfb;
  --text-2: #b8c2d8;
  --muted: #8b97b0;
  --primary: #7c6cff;
  --primary-600: #6a59f5;
  --primary-soft: rgba(124, 108, 255, 0.17);
  --primary-text: #b3a9ff;
  --accent: #38d2ee;
  --success: #22c58b;
  --success-soft: rgba(34, 197, 139, 0.15);
  --success-text: #6ee7b7;
  --warning: #f5a524;
  --warning-soft: rgba(245, 165, 36, 0.16);
  --warning-text: #fcd27b;
  --danger: #f05252;
  --danger-soft: rgba(240, 82, 82, 0.16);
  --danger-text: #fca5a5;
  --info: #38bdf8;
  --info-soft: rgba(56, 189, 248, 0.15);
  --info-text: #93d8fb;
  --muted-soft: rgba(148, 163, 184, 0.14);
  --muted-text: #c1cadb;
  --holiday-soft: rgba(192, 132, 252, 0.17);
  --holiday-text: #e2c3ff;
  --input-bg: #0f1627;
  --nav-bg: rgba(11, 16, 32, 0.85);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 8px 24px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  --bs-link-color-rgb: 179, 169, 255;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
p, dl, dd, ul, ol, figure, h1, h2, h3, h4, h5, h6 { margin: 0; }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); color: var(--text); }
img { max-width: 100%; display: block; }
a { color: var(--primary-text); text-decoration: none; }
a:hover { color: var(--primary-600); }
code { color: var(--primary-text); background: var(--primary-soft); padding: 1px 6px; border-radius: 6px; font-size: 0.86em; }
button, input, select, textarea { font: inherit; }
.icon { flex-shrink: 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.prewrap { white-space: pre-wrap; word-break: break-word; }
.nowrap { white-space: nowrap; }
.text-danger-soft { color: var(--danger-text) !important; }
.text-success-soft { color: var(--success-text) !important; }
.push-top { margin-top: 4px; }
.push-bottom { margin-top: auto; }

/* ---------- App shell ---------- */
.app-main {
  width: 100%;
  max-width: var(--content);
  margin: 0 auto;
  padding: 28px 24px 56px;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}
.narrow { width: 100%; max-width: 520px; margin: 24px auto 0; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: var(--content);
  height: 64px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); flex-shrink: 0; }
.brand:hover { color: var(--text); }
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 6px 16px rgba(91, 76, 240, 0.3);
}
.brand-logo { display: grid; place-items: center; width: 40px; height: 34px; padding: 3px 4px; border-radius: 10px; background: #fff; box-shadow: 0 0 0 1px var(--border), 0 4px 12px rgba(16, 24, 40, 0.08); }
.brand-logo img { width: 100%; height: 100%; object-fit: contain; }
.auth-logo { width: 112px; height: 112px; border-radius: 18px; background: #fff; box-shadow: 0 0 0 1px var(--border), var(--shadow); }
.brand-text { font-family: var(--font-display); font-weight: 800; font-size: 17px; letter-spacing: -0.01em; }
.brand-text span { margin-left: 5px; color: var(--muted); font-weight: 600; }

.topnav { display: flex; align-items: center; gap: 2px; margin: 0 auto; min-width: 0; }
.topnav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.topnav-link:hover { background: var(--surface-2); color: var(--text); }
.topnav-link.active { background: var(--primary-soft); color: var(--primary-text); }
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.icon-btn-sm { width: 30px; height: 30px; }
.icon-btn-solid { background: var(--primary); border-color: var(--primary); color: #fff; }
.icon-btn-solid:hover { background: var(--primary-600); color: #fff; }
.icon-btn-success { background: var(--success-soft); border-color: transparent; color: var(--success-text); }
.icon-btn-danger { background: var(--danger-soft); border-color: transparent; color: var(--danger-text); }
.icon-btn-success:hover, .icon-btn-danger:hover { filter: brightness(0.95); }
.icon-btn-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  border: 2px solid var(--surface);
  box-sizing: content-box;
}
:root[data-theme="dark"] .theme-icon-dark,
:root:not([data-theme="dark"]) .theme-icon-light { display: none; }
.theme-icon-dark, .theme-icon-light { display: inline-grid; }
.avatar-btn { padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; }
.avatar-btn:focus-visible { outline: 3px solid var(--primary-soft); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.chip-text { max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.chip-live { background: var(--info-soft); color: var(--info-text); }
.chip-warning { background: var(--warning-soft); color: var(--warning-text); }
.chip-live:hover { color: var(--info-text); }
.chip-warning:hover { color: var(--warning-text); }
.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* dropdown menus */
.menu-panel {
  --bs-dropdown-bg: var(--surface);
  --bs-dropdown-border-color: var(--border);
  --bs-dropdown-link-color: var(--text);
  --bs-dropdown-link-hover-bg: var(--surface-2);
  min-width: 250px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  margin-top: 8px !important;
}
.notif-menu { width: 350px; max-height: min(70vh, 560px); overflow-y: auto; }
.menu-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; }
.menu-header strong { font-size: 14px; }
.menu-header-stack { flex-direction: column; align-items: flex-start; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.menu-header-stack span { color: var(--muted); font-size: 12.5px; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.menu-item:hover { background: var(--surface-2); color: var(--text); }
.menu-item-danger, .menu-item-danger:hover { color: var(--danger-text); }
.menu-form { display: flex; flex-direction: column; gap: 6px; padding: 8px 12px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.menu-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.menu-empty { padding: 20px 12px; color: var(--muted); text-align: center; font-size: 13.5px; }
.menu-footer { display: block; margin-top: 4px; padding: 10px; border-top: 1px solid var(--border); text-align: center; font-size: 13px; font-weight: 600; }
.notif-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; color: var(--text); }
.notif-item:hover { background: var(--surface-2); color: var(--text); }
.notif-item.unread { background: var(--primary-soft); }
.notif-title { font-size: 13.5px; font-weight: 600; }
.notif-message { font-size: 12.5px; color: var(--text-2); }
.notif-time { font-size: 11.5px; color: var(--muted); }
.link-btn { padding: 0; border: 0; background: none; color: var(--primary-text); font-size: 12.5px; font-weight: 600; cursor: pointer; }

/* system bars (impersonation, announcements) aligned to the content column */
.system-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px max(24px, calc((100% - var(--content)) / 2 + 24px));
  background: var(--info-soft);
  color: var(--info-text);
  font-size: 13.5px;
  border-bottom: 1px solid var(--border);
}
.system-bar > span { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.system-bar-warning { background: var(--warning-soft); color: var(--warning-text); }
.system-bar .icon-btn { background: transparent; border-color: transparent; color: inherit; }

/* mobile tab bar + sheet */
.tabbar { display: none; }
.more-sheet { --bs-offcanvas-bg: var(--surface); --bs-offcanvas-height: auto; border-radius: 20px 20px 0 0; border: 0 !important; }
.more-sheet .offcanvas-header { padding: 18px 20px 6px; }
.more-sheet .offcanvas-title { font-size: 17px; font-weight: 800; }
.more-sheet .offcanvas-body { padding: 12px 20px calc(24px + env(safe-area-inset-bottom)); }
.sheet-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.sheet-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}
.sheet-link.active { background: var(--primary-soft); color: var(--primary-text); }

/* ---------- Page header ---------- */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-heading { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.page-kicker { color: var(--primary-text); font-size: 11.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.page-title { font-size: clamp(1.55rem, 2.4vw, 2rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.page-subtitle { color: var(--muted); font-size: 14.5px; max-width: 720px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- Grid ---------- */
.grid { display: grid; gap: var(--gap); align-items: stretch; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2-1 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }
.stack { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.stack-sm { gap: 8px; }
.grid-2-1 > .stack { gap: var(--gap); }

/* ---------- Panels ---------- */
.panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 68px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.panel-header > div:first-child { min-width: 0; }
.panel-kicker { margin-bottom: 2px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.panel-title { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.panel-body { display: flex; flex-direction: column; gap: 14px; flex: 1; padding: 20px; min-width: 0; }
.panel-body-flush { gap: 0; padding: 0; }
.panel-footer { margin-top: auto; padding: 12px 20px; border-top: 1px solid var(--border); }
.panel-subsection { display: flex; flex-direction: column; padding: 16px 0 4px; border-top: 1px solid var(--border); }
.panel-subsection > .panel-kicker { padding: 0 20px 4px; }
.panel-note { padding: 12px 20px; border-top: 1px solid var(--border); }
.link-action { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.count-pill {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-text);
  font-size: 12px;
  font-weight: 700;
}

/* ---------- Stat cards ---------- */
.stat-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  min-height: 148px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--text);
}
a.stat-card { transition: border-color 0.15s ease, transform 0.15s ease; }
a.stat-card:hover { color: var(--text); border-color: var(--primary); transform: translateY(-1px); }
.stat-icon { display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 8px; border-radius: 10px; }
.stat-label { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat-value { font-family: var(--font-display); font-size: clamp(1.35rem, 2vw, 1.75rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-hint { margin-top: auto; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tone-primary { background: var(--primary-soft); color: var(--primary-text); }
.tone-success { background: var(--success-soft); color: var(--success-text); }
.tone-warning { background: var(--warning-soft); color: var(--warning-text); }
.tone-danger { background: var(--danger-soft); color: var(--danger-text); }
.tone-info { background: var(--info-soft); color: var(--info-text); }
.tone-muted { background: var(--muted-soft); color: var(--muted-text); }

/* ---------- Badges ---------- */
.badge {
  --bs-badge-padding-x: 10px;
  --bs-badge-padding-y: 3px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0;
  white-space: nowrap;
  vertical-align: middle;
}
.badge-primary { background: var(--primary-soft); color: var(--primary-text); }
.badge-success { background: var(--success-soft); color: var(--success-text); }
.badge-warning { background: var(--warning-soft); color: var(--warning-text); }
.badge-danger { background: var(--danger-soft); color: var(--danger-text); }
.badge-info { background: var(--info-soft); color: var(--info-text); }
.badge-muted { background: var(--muted-soft); color: var(--muted-text); }

/* ---------- Buttons ---------- */
.btn {
  --bs-btn-padding-x: 16px;
  --bs-btn-padding-y: 0;
  --bs-btn-font-size: 14px;
  --bs-btn-font-weight: 600;
  --bs-btn-border-radius: var(--radius-sm);
  --bs-btn-focus-shadow-rgb: 91, 76, 240;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.btn:disabled, .btn.disabled { opacity: 0.5; }
.btn-sm { --bs-btn-padding-x: 12px; --bs-btn-font-size: 13px; --bs-btn-border-radius: 8px; height: 32px; gap: 6px; }
.btn-block { width: 100%; }
.btn-square { width: 40px; --bs-btn-padding-x: 0; }
.btn-primary {
  --bs-btn-color: #fff; --bs-btn-bg: var(--primary); --bs-btn-border-color: var(--primary);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--primary-600); --bs-btn-hover-border-color: var(--primary-600);
  --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--primary-600); --bs-btn-active-border-color: var(--primary-600);
  --bs-btn-disabled-color: #fff; --bs-btn-disabled-bg: var(--primary); --bs-btn-disabled-border-color: var(--primary);
  box-shadow: 0 6px 16px rgba(91, 76, 240, 0.22);
}
.btn-secondary {
  --bs-btn-color: var(--text); --bs-btn-bg: var(--surface); --bs-btn-border-color: var(--border-strong);
  --bs-btn-hover-color: var(--text); --bs-btn-hover-bg: var(--surface-2); --bs-btn-hover-border-color: var(--border-strong);
  --bs-btn-active-color: var(--text); --bs-btn-active-bg: var(--surface-3); --bs-btn-active-border-color: var(--border-strong);
  --bs-btn-disabled-color: var(--text); --bs-btn-disabled-bg: var(--surface); --bs-btn-disabled-border-color: var(--border-strong);
}
.btn-ghost {
  --bs-btn-color: var(--text-2); --bs-btn-bg: transparent; --bs-btn-border-color: transparent;
  --bs-btn-hover-color: var(--text); --bs-btn-hover-bg: var(--surface-2); --bs-btn-hover-border-color: transparent;
  --bs-btn-active-color: var(--text); --bs-btn-active-bg: var(--surface-3); --bs-btn-active-border-color: transparent;
}
.btn-success {
  --bs-btn-color: #fff; --bs-btn-bg: var(--success); --bs-btn-border-color: var(--success);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--success); --bs-btn-hover-border-color: var(--success);
  --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--success); --bs-btn-active-border-color: var(--success);
  --bs-btn-disabled-color: #fff; --bs-btn-disabled-bg: var(--success); --bs-btn-disabled-border-color: var(--success);
}
.btn-success:hover { filter: brightness(0.94); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row-equal > * { flex: 1 1 0; min-width: 0; }

/* ---------- Forms ---------- */
.form-control, .form-select {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background-color: var(--input-bg);
  color: var(--text);
  font-size: 14.5px;
}
.form-select { padding-right: 36px; }
textarea.form-control { min-height: 84px; resize: vertical; }
.form-control-sm, .form-select-sm { min-height: 32px; padding: 4px 10px; font-size: 13px; border-radius: 8px; }
.form-select-sm { padding-right: 30px; }
.form-control::placeholder { color: var(--muted); opacity: 0.85; }
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  background-color: var(--input-bg);
  color: var(--text);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.form-control[type="file"] { padding: 6px 8px; }
.form-control[readonly] { background-color: var(--surface-2); }
.input-narrow { width: 90px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; align-items: start; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field-label { margin: 0; color: var(--text-2); font-size: 13px; font-weight: 600; }
.field-full { grid-column: 1 / -1; }
.field-end { align-self: end; }
.field-grow { flex: 1 1 220px; }
.label-hint { color: var(--muted); font-weight: 400; }
.hint { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }
.hint-block { display: block; line-height: 1.7; }
.hint-center { justify-content: center; width: 100%; text-align: center; }
.check { display: inline-flex; align-items: center; gap: 9px; margin: 0; color: var(--text); font-size: 14px; font-weight: 500; cursor: pointer; }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; accent-color: var(--primary); }
.form-actions { display: flex; gap: 10px; }
.leave-form { display: flex; flex-direction: column; gap: 18px; }
.check-box { min-height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--input-bg); }
.form-actions-end { justify-content: flex-end; }
.inline-filter { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inline-filter .form-control, .inline-filter .form-select { width: auto; min-width: 140px; }
.inline-form { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.filter-bar .form-select { width: auto; min-width: 150px; }
.filter-search { position: relative; flex: 1 1 220px; }
.filter-search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.filter-search .form-control { padding-left: 36px; }
.export-bar { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.export-bar .field { width: 180px; }
.decision-form { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end; }
.decision-form .form-control { width: 170px; }
.check-list { display: flex; flex-direction: column; gap: 2px; max-height: 330px; overflow-y: auto; padding: 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.check-list-short { max-height: 210px; }
.check-item { display: flex; align-items: center; gap: 10px; margin: 0; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.check-item:hover { background: var(--surface); }
.weekday-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.weekday { margin: 0; cursor: pointer; }
.weekday input { position: absolute; opacity: 0; pointer-events: none; }
.weekday span {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 36px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
}
.weekday input:checked + span { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-text); }
.weekday input:focus-visible + span { box-shadow: 0 0 0 3px var(--primary-soft); }

/* ---------- Tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.data-table th {
  padding: 11px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  text-align: left;
}
.data-table td { padding: 13px 14px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
.data-table th:first-child, .data-table td:first-child { padding-left: 20px; }
.data-table th:last-child, .data-table td:last-child { padding-right: 20px; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: var(--surface-2); }
.data-table th.text-end, .data-table td.text-end { text-align: right; }
.data-table th.text-center, .data-table td.text-center { text-align: center; }
.data-table tr.is-muted td { opacity: 0.6; }
.data-table tr.row-form td { background: var(--surface-2); }
.data-table .empty-state { padding: 28px 12px; }
.cell-note { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.cell-wrap { min-width: 180px; max-width: 340px; }
.cell-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: nowrap; }
.cell-actions-start { justify-content: flex-start; }
.balance-number { font-family: var(--font-display); font-size: 18px; font-weight: 800; }

/* ---------- Lists ---------- */
.list-row { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: 0; }
.list-row-compact { min-height: 52px; padding: 9px 20px; }
.list-row-link { color: var(--text); transition: background 0.15s ease; }
.list-row-link:hover { background: var(--surface-2); color: var(--text); }
.list-row.is-unread { background: var(--primary-soft); }
.list-row-total { background: var(--surface-2); }
.list-main { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; color: var(--text); }
a.list-main:hover { color: var(--text); }
a.list-main:hover .list-title { color: var(--primary-text); }
.list-title { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-title.is-struck { color: var(--muted); text-decoration: line-through; }
.list-sub { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }
.list-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }
.list-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--radius-sm); flex-shrink: 0; }
.list-time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.check-toggle {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 2px solid var(--border-strong);
  border-radius: 7px;
  background: transparent;
  color: transparent;
  cursor: pointer;
  flex-shrink: 0;
}
.check-toggle:hover { border-color: var(--success); }
.check-toggle.is-done { background: var(--success); border-color: var(--success); color: #fff; }

/* ---------- People ---------- */
.avatar {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff;
  font-weight: 700;
  object-fit: cover;
  line-height: 1;
}
.avatar-xs { width: 22px; height: 22px; font-size: 9px; }
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-md { width: 40px; height: 40px; font-size: 14px; }
.avatar-xl { width: 76px; height: 76px; font-size: 26px; }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { border: 2px solid var(--surface); }
.avatar-stack .avatar + .avatar { margin-left: -7px; }
.person { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.person-text { display: flex; flex-direction: column; min-width: 0; }
.person-name { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-head { display: flex; align-items: center; gap: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }

/* ---------- Misc content ---------- */
.kv { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px 16px; font-size: 14px; }
.kv dt { color: var(--muted); font-weight: 500; }
.kv dd { color: var(--text); font-weight: 600; word-break: break-word; }
.note { display: flex; align-items: flex-start; gap: 9px; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13.5px; line-height: 1.45; }
.note .icon { margin-top: 1px; }
.note a { color: inherit; font-weight: 700; text-decoration: underline; }
.note-info { background: var(--info-soft); color: var(--info-text); }
.note-warning { background: var(--warning-soft); color: var(--warning-text); }
.note-success { background: var(--success-soft); color: var(--success-text); }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 36px 16px; color: var(--muted); text-align: center; font-size: 14px; }
.empty-state .icon { opacity: 0.6; }
.progress-track { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--accent)); }
.rate-inline { display: flex; align-items: center; gap: 12px; width: 230px; }
.rate-inline .progress-track { flex: 1; }
.rate-number { font-family: var(--font-display); font-size: 20px; font-weight: 800; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; color: var(--muted); font-size: 12.5px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.dot-primary { background: var(--primary); }
.dot-holiday { background: var(--holiday-text); }
.dot-off { background: var(--border-strong); }
.file-list { display: flex; flex-wrap: wrap; gap: 8px; }
.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  margin: 6px 6px 0 0;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-list .file-chip { margin: 0; background: var(--surface-2); }
.file-chip:hover { border-color: var(--primary); color: var(--primary-text); }
.selfie-thumb { display: block; width: 36px; height: 36px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); flex-shrink: 0; }
.selfie-thumb img { width: 100%; height: 100%; object-fit: cover; }
.evidence { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 18px; align-items: start; }
.evidence-img { width: 150px; aspect-ratio: 3 / 4; border-radius: 12px; border: 1px solid var(--border); object-fit: cover; }
.evidence-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: var(--surface-2); color: var(--muted); font-size: 12.5px; }

/* flash messages */
.flash-stack { display: flex; flex-direction: column; gap: 8px; }
.flash { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid transparent; border-radius: 12px; font-size: 14px; font-weight: 500; }
.flash-success { background: var(--success-soft); border-color: var(--success-soft); color: var(--success-text); }
.flash-error, .flash-danger { background: var(--danger-soft); border-color: var(--danger-soft); color: var(--danger-text); }
.flash-late-prompt, .flash-warning { background: var(--warning-soft); border-color: var(--warning-soft); color: var(--warning-text); }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: -1px;
  padding: 10px 14px;
  border-bottom: 2px solid transparent;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { border-bottom-color: var(--primary); color: var(--primary-text); }
.tab-count { min-width: 18px; padding: 0 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }

.pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--border); }
.pager > :last-child { justify-self: end; }
.pager-label { color: var(--muted); font-size: 13px; }

/* ---------- Dashboard specifics ---------- */
.kpi-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 12px; background: var(--surface-2); }
.kpi span { color: var(--muted); font-size: 12.5px; }
.kpi strong { font-family: var(--font-display); font-size: 20px; font-weight: 800; }
.selfie-box {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 320px;
  overflow: hidden;
  border: 1px dashed var(--border-strong);
  border-radius: 14px;
  background: var(--surface-2);
}
.selfie-box video, .selfie-box img { width: 100%; height: 100%; object-fit: cover; }
.selfie-box video { transform: scaleX(-1); }
.selfie-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 16px; color: var(--muted); font-size: 13.5px; text-align: center; }
.timer-pill { padding: 4px 10px; border-radius: 999px; background: var(--info-soft); color: var(--info-text); font-family: var(--mono); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.timer-display { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 18px; border-radius: 14px; background: var(--surface-2); }
.timer-display span { font-family: var(--font-display); font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.timer-display small { color: var(--muted); font-size: 12.5px; }

/* leave balances */
.balance-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--gap); }
.balance-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 168px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.balance-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 24px; }
.balance-name { font-size: 14px; font-weight: 700; }
.balance-value { font-family: var(--font-display); font-size: 30px; font-weight: 800; line-height: 1.1; }
.balance-sub { color: var(--muted); font-size: 13px; }
.balance-card .progress-track { margin-top: auto; }
.balance-foot { color: var(--muted); font-size: 12px; }

/* task board */
.board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; align-items: start; }
.board-column { display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: 220px; padding: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); }
.board-column-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px; font-size: 13.5px; font-weight: 700; }
.board-count { margin-left: auto; padding: 0 8px; border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 12px; line-height: 22px; }
.board-dot { width: 9px; height: 9px; border-radius: 50%; }
.dot-primary { background: var(--primary); }
.dot-info { background: var(--info); }
.dot-warning { background: var(--warning); }
.dot-success { background: var(--success); }
.dot-danger { background: var(--danger); }
.dot-muted { background: var(--muted); }
.board-column-body { display: flex; flex-direction: column; gap: 10px; }
.board-empty { padding: 18px 8px; color: var(--muted); font-size: 13px; text-align: center; }
.task-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  color: var(--text);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.task-card:hover { border-color: var(--primary); color: var(--text); transform: translateY(-1px); }
.task-card.is-overdue { box-shadow: inset 3px 0 0 var(--danger), var(--shadow-sm); }
.task-card-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.task-card-title { font-size: 14px; font-weight: 600; line-height: 1.35; word-break: break-word; }
.task-card-project { color: var(--muted); font-size: 12px; }
.task-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 22px; }
.task-card-meta { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.task-card-meta span, .task-card-meta { white-space: nowrap; }
.task-card-meta .icon { vertical-align: -2px; margin-right: 2px; }

/* comments timeline */
.timeline { display: flex; flex-direction: column; gap: 14px; }
.timeline-item { display: flex; align-items: flex-start; gap: 12px; }
.timeline-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); color: var(--muted); flex-shrink: 0; }
.timeline-body { flex: 1; min-width: 0; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); font-size: 14px; }
.timeline-item.is-system .timeline-body { padding: 6px 0; background: transparent; color: var(--muted); font-size: 13px; }
.timeline-meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; font-size: 13px; }
.timeline-meta span { color: var(--muted); font-size: 12px; }

/* calendar */
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.calendar-head { padding: 4px 0 6px; color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-align: center; text-transform: uppercase; }
.calendar-day { display: flex; flex-direction: column; gap: 4px; min-width: 0; min-height: 108px; padding: 8px; border: 1px solid transparent; border-radius: 10px; background: var(--surface-2); }
.calendar-day.is-outside { opacity: 0.4; }
.calendar-day.is-off { background: var(--surface-3); }
.calendar-day.is-holiday { background: var(--holiday-soft); }
.calendar-day.is-today { border-color: var(--primary); }
.calendar-date { font-size: 13px; font-weight: 700; }
.is-today .calendar-date { color: var(--primary-text); }
.calendar-event { padding: 2px 7px; border-radius: 6px; background: var(--primary-soft); color: var(--primary-text); font-size: 11.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-holiday { background: transparent; color: var(--holiday-text); padding-left: 0; }
.calendar-more { color: var(--muted); font-size: 11px; }

/* report bars */
.bar-row { display: grid; grid-template-columns: 140px minmax(0, 1fr) 72px; align-items: center; gap: 12px; }
.bar-label { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar-track span { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.bar-track-alt span { background: var(--accent); }
.bar-value { font-family: var(--mono); font-size: 12.5px; text-align: right; color: var(--text-2); }

/* ---------- Modals ---------- */
.app-modal {
  --bs-modal-bg: var(--surface);
  --bs-modal-border-color: var(--border);
  --bs-modal-border-radius: 18px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}
.app-modal .modal-header { padding: 20px 22px 4px; border: 0; }
.app-modal .modal-title { font-size: 20px; font-weight: 800; }
.app-modal .modal-body { padding: 14px 22px; }
.app-modal .modal-footer { gap: 8px; padding: 14px 22px; border-top: 1px solid var(--border); }
.app-modal .modal-footer > * { margin: 0; }
.popup-list { display: flex; flex-direction: column; gap: 10px; }
.popup-task { display: block; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); color: var(--text); }
.popup-task:hover { border-color: var(--primary); color: var(--text); }
.popup-task-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; font-size: 14.5px; }
.popup-task-meta { display: block; margin-top: 4px; color: var(--muted); font-size: 12.5px; }
.popup-task-people { display: block; margin-top: 2px; color: var(--text-2); font-size: 12.5px; }

/* ---------- Auth pages ---------- */
.auth-page {
  background:
    radial-gradient(circle at 12% 18%, rgba(124, 92, 255, 0.45), transparent 26%),
    radial-gradient(circle at 85% 12%, rgba(56, 210, 238, 0.25), transparent 28%),
    linear-gradient(135deg, #070b17 0%, #0c1529 55%, #10193a 100%);
  background-attachment: fixed;
}
.auth-page .app-main { min-height: 100vh; justify-content: center; padding-top: 32px; padding-bottom: 32px; }
.auth-page .flash-stack { width: 100%; max-width: 440px; margin-left: auto; }
.auth-shell { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 440px); align-items: center; gap: 48px; width: 100%; }
.auth-spotlight { display: flex; flex-direction: column; gap: 18px; color: #fff; }
.auth-spotlight h1 { color: #f6f8ff; font-size: clamp(2.2rem, 4vw, 3.6rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1.04; }
.auth-spotlight p { max-width: 520px; color: rgba(214, 227, 255, 0.78); font-size: 1.05rem; }
.spotlight-pill { align-self: flex-start; padding: 7px 14px; border: 1px solid rgba(125, 218, 248, 0.35); border-radius: 999px; background: rgba(14, 21, 35, 0.6); color: #99ebff; font-size: 11px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.spotlight-list { display: flex; flex-direction: column; gap: 10px; padding: 0; list-style: none; }
.spotlight-list li { display: flex; align-items: center; gap: 10px; color: rgba(230, 238, 255, 0.88); font-weight: 500; }
.spotlight-list .icon { padding: 7px; width: 32px; height: 32px; border-radius: 10px; background: rgba(255, 255, 255, 0.08); color: #a9ecff; }
.auth-card {
  position: relative;
  width: 100%;
  padding: 32px 30px 26px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 36px 90px rgba(2, 6, 23, 0.55);
}
.auth-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 5px; background: linear-gradient(90deg, var(--primary), var(--accent), #7ef0d1); }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.auth-title { margin: 4px 0 6px; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.auth-intro { margin-bottom: 20px; color: var(--muted); font-size: 14.5px; }
.auth-foot { margin-top: 16px; text-align: center; font-size: 14px; font-weight: 600; }
.auth-card .btn-block { height: 44px; margin-top: 4px; }


/* ---------- Task journey, moves, estimate ---------- */
.journey { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.journey-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.journey-step::before { content: ''; position: absolute; top: 15px; left: -50%; width: 100%; height: 2px; background: var(--border-strong); z-index: 0; }
.journey-step:first-child::before { display: none; }
.journey-step.is-done::before, .journey-step.is-current::before { background: var(--primary); }
.journey-dot { position: relative; z-index: 1; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 700; }
.journey-step.is-done .journey-dot { background: var(--primary); border-color: var(--primary); color: #fff; }
.journey-step.is-current .journey-dot { border-color: var(--primary); color: var(--primary-text); box-shadow: 0 0 0 4px var(--primary-soft); }
.journey-label { font-size: 13.5px; font-weight: 600; }
.journey-time { color: var(--muted); font-size: 12px; }
.move-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--border); }
.move-bar .form-control { flex: 1 1 240px; }
.move-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.move-buttons .board-dot { background: currentColor; opacity: 0.7; }
.move-buttons .btn-secondary .board-dot { opacity: 1; }
.estimate-box { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 12px; background: var(--surface-2); }
.estimate-row { display: flex; justify-content: space-between; font-size: 14px; }
.estimate-row span { color: var(--muted); }
.progress-track.is-over span { background: var(--danger); }

/* ---------- Board interactions ---------- */
.task-card { position: relative; }
.task-card.is-movable { cursor: grab; }
.task-card.is-dragging { opacity: 0.45; cursor: grabbing; }
.task-card-title { color: var(--text); }
.task-card-title:hover { color: var(--primary-text); }
.task-card-menu { position: relative; z-index: 2; margin-left: auto; }
.task-card-menu .icon-btn { background: transparent; }
.board-column.is-droppable { border-color: var(--primary); border-style: dashed; }
.board-column.is-over { background: var(--primary-soft); }
.board-column.is-blocked { opacity: 0.45; }
.menu-label-pad { display: block; padding: 6px 12px 2px; }

/* ---------- Clients ---------- */
.client-chip { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--client) 16%, transparent); color: var(--text); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.client-switch { display: flex; gap: 8px; flex-wrap: wrap; }
.client-pill { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); color: var(--text); font-size: 14px; font-weight: 600; }
.client-pill:hover { color: var(--text); border-color: var(--client); }
.client-pill.active { border-color: var(--client); background: color-mix(in srgb, var(--client) 14%, var(--surface)); }
.client-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--client); }
.client-card { border-top: 4px solid var(--client); }
.client-card.is-muted { opacity: 0.6; }
.client-avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--client); color: #fff; font-family: var(--font-display); font-weight: 800; }
.client-roles { display: flex; flex-direction: column; gap: 8px; }
.client-role { display: grid; grid-template-columns: 120px auto minmax(0, 1fr); align-items: center; gap: 8px; font-size: 13px; }
.client-role .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi-row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.team-picker input[type="radio"] { width: 18px; height: 18px; accent-color: var(--primary); }
.form-control-color { width: 100%; min-height: 40px; padding: 4px; }
.calendar-post { display: flex; align-items: center; gap: 5px; background: color-mix(in srgb, var(--client) 15%, transparent); color: var(--text); }
.calendar-post:hover { color: var(--text); filter: brightness(0.96); }
.post-dots { display: inline-flex; gap: 2px; }
.post-dots i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; }
.month-label { min-width: 120px; text-align: center; font-weight: 700; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.tab-end { margin-left: auto; border-top: 0; border-left: 0; border-right: 0; background: none; cursor: pointer; }

/* ---------- Toast ---------- */
.toast-host { position: fixed; left: 50%; bottom: 24px; z-index: 1090; transform: translateX(-50%); pointer-events: none; }
.app-toast { padding: 10px 16px; border-radius: 12px; background: var(--text); color: var(--surface); font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); }
.app-toast-success { background: var(--success); color: #fff; }
@media (max-width: 1180px) { .toast-host { bottom: calc(80px + env(safe-area-inset-bottom)); } }
@media (max-width: 640px) {
  .journey-label { font-size: 12px; }
  .journey-time { font-size: 10.5px; }
  .move-buttons { width: 100%; }
  .move-buttons .btn { flex: 1 1 0; }
  .client-role { grid-template-columns: 96px auto; }
  .client-role .small { display: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .topnav { display: none; }
  .tabbar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 1030;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    height: calc(64px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--nav-bg);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-top: 1px solid var(--border);
  }
  .tabbar-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
  }
  .tabbar-link.active { color: var(--primary-text); }
  .tabbar-link span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body.has-tabbar .app-main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .board { grid-template-columns: repeat(5, minmax(250px, 1fr)); overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
  .board-column { scroll-snap-align: start; }
}

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3, .grid-2, .grid-2-1 { grid-template-columns: minmax(0, 1fr); }
  .form-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  :root { --gap: 14px; }
  body { font-size: 14.5px; }
  .app-main { padding: 18px 16px 40px; }
  .topbar-inner { padding: 0 16px; gap: 10px; height: 58px; }
  .brand-text span { display: none; }
  .hide-mobile { display: none !important; }
  .page-header { align-items: stretch; }
  .page-actions { width: 100%; }
  .page-actions > .btn, .page-actions > form { flex: 1 1 0; }
  .page-actions > form .btn { width: 100%; }
  .inline-filter .form-control, .inline-filter .form-select { flex: 1 1 130px; min-width: 0; }
  .panel-header { min-height: 60px; padding: 12px 16px; }
  .panel-body { padding: 16px; }
  .panel-body-flush { padding: 0; }
  .panel-footer { padding: 12px 16px; }
  .list-row { padding: 12px 16px; }
  .data-table th:first-child, .data-table td:first-child { padding-left: 16px; }
  .data-table th:last-child, .data-table td:last-child { padding-right: 16px; }
  .stat-card { min-height: 128px; padding: 14px 16px; }
  .stat-icon { width: 32px; height: 32px; margin-bottom: 4px; }
  .form-grid, .form-grid-3, .form-grid-4 { grid-template-columns: minmax(0, 1fr); }
  .kpi-row { gap: 8px; }
  .kpi { padding: 10px; }
  .kpi strong { font-size: 16px; }
  .kv { grid-template-columns: 110px minmax(0, 1fr); }
  .evidence { grid-template-columns: minmax(0, 1fr); }
  .calendar { gap: 3px; }
  .calendar-day { min-height: 70px; padding: 5px; border-radius: 8px; }
  .calendar-event { padding: 1px 4px; font-size: 10px; }
  .calendar-head { font-size: 10px; letter-spacing: 0; }
  .bar-row { grid-template-columns: 96px minmax(0, 1fr) 62px; gap: 8px; }
  .decision-form { flex-wrap: wrap; justify-content: flex-start; }
  .data-table td { white-space: nowrap; }
  .data-table td.cell-wrap { white-space: normal; }
  .decision-form .form-control { width: 100%; }
  .notif-menu { width: calc(100vw - 24px); }
  .rate-inline { width: 150px; }
  .auth-shell { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .auth-spotlight { display: none; }
  .auth-card { padding: 26px 20px 22px; }
  .profile-head { flex-direction: column; align-items: flex-start; }
}

@media (min-width: 641px) and (max-width: 900px) {
  .auth-shell { grid-template-columns: minmax(0, 1fr); max-width: 460px; margin: 0 auto; }
  .auth-spotlight { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ==========================================================================
   Task workspace (folder tree + List / Board / Table / Timeline views)
   ========================================================================== */
:root {
  --st-todo: #7c8aa5;
  --st-progress: #2f80ed;
  --st-review: #8e5cf7;
  --st-revision: #f08c2e;
  --st-done: #23a15d;
}
:root[data-theme="dark"] {
  --st-todo: #9aa7c0;
  --st-progress: #5b9dff;
  --st-review: #a987ff;
  --st-revision: #ffa552;
  --st-done: #3cc77d;
}
.wk-st-todo { --st: var(--st-todo); }
.wk-st-progress { --st: var(--st-progress); }
.wk-st-review { --st: var(--st-review); }
.wk-st-revision { --st: var(--st-revision); }
.wk-st-done { --st: var(--st-done); }

.wk-shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 22px; align-items: start; }
.wk-shell > * { min-width: 0; }
.wk-side {
  position: sticky; top: 84px; display: flex; flex-direction: column; gap: 4px;
  max-height: calc(100vh - 104px); overflow-y: auto; padding: 12px 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.wk-side-title { margin: 12px 10px 4px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.wk-side-group { display: flex; flex-direction: column; gap: 1px; }
.wk-nav {
  display: flex; align-items: center; gap: 9px; min-height: 34px; padding: 6px 10px; border-radius: 8px;
  color: var(--text-2); font-size: 14px; font-weight: 500; text-decoration: none;
}
.wk-nav span:not(.wk-count):not(.wk-swatch) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-nav .icon { flex-shrink: 0; color: var(--muted); }
.wk-nav:hover { background: var(--surface-2); color: var(--text); }
.wk-nav.active { background: var(--primary-soft); color: var(--primary-text); font-weight: 700; }
.wk-nav.active .icon { color: var(--primary-text); }
.wk-count { margin-left: auto; padding: 0 7px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: 11.5px; font-weight: 700; line-height: 20px; }
.wk-swatch { width: 10px; height: 10px; flex-shrink: 0; margin: 0 3px; border-radius: 3px; background: var(--client); }

.wk-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.wk-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.wk-title { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.wk-head-actions { display: flex; align-items: center; gap: 8px; }
.wk-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.wk-views { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface-3); }
.wk-view { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px; color: var(--text-2); font-size: 13.5px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.wk-view:hover { color: var(--text); }
.wk-view.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.wk-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wk-filters .filter-search { flex: 0 1 190px; }
.wk-filters .form-select { width: auto; min-width: 120px; }

/* status pill + square status button */
.wk-status { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 7px; border-radius: 999px; background: color-mix(in srgb, var(--st) 14%, transparent); color: var(--text); font-size: 12px; font-weight: 600; white-space: nowrap; }
.wk-dot, .wk-dot-inline { width: 8px; height: 8px; flex-shrink: 0; border-radius: 50%; background: var(--st); }
.wk-dot-inline { display: inline-block; }
.wk-status-btn {
  display: grid; place-items: center; width: 18px; height: 18px; padding: 0; border: 2px solid var(--st); border-radius: 5px;
  background: color-mix(in srgb, var(--st) 12%, transparent); color: #fff; cursor: pointer;
}
.wk-status-btn.wk-st-done { background: var(--st); }
.wk-status-btn.wk-st-progress { background: linear-gradient(90deg, var(--st) 50%, transparent 50%); }
.wk-status-btn:disabled { cursor: default; opacity: 0.85; }
.wk-status-btn:not(:disabled):hover { box-shadow: 0 0 0 3px color-mix(in srgb, var(--st) 25%, transparent); }
.wk-status-chip { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; }

/* importance */
.wk-imp { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.wk-imp-urgent { color: var(--danger-text); }
.wk-imp-high { color: var(--warning-text); }
.wk-imp-normal { color: var(--muted); }
.wk-imp-low { color: var(--info-text); }

/* groups + rows (List / My Work) */
.wk-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.wk-group > summary { display: flex; align-items: center; gap: 9px; padding: 10px 14px; cursor: pointer; list-style: none; font-weight: 700; font-size: 14px; user-select: none; }
.wk-group > summary::-webkit-details-marker { display: none; }
.wk-group[open] > summary { border-bottom: 1px solid var(--border); }
.wk-caret { display: inline-grid; color: var(--muted); transition: transform 0.15s ease; transform: rotate(-90deg); }
.wk-group[open] .wk-caret { transform: none; }
.wk-group.is-alert .wk-group-name { color: var(--danger-text); }
.wk-group > summary .wk-count { margin-left: 0; }
.wk-empty { padding: 12px 16px 12px 46px; color: var(--muted); font-size: 13px; }
.wk-row {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto 112px 64px; align-items: center; gap: 12px;
  min-height: 48px; padding: 7px 14px; border-bottom: 1px solid var(--border); transition: background 0.12s ease;
}
.wk-row:last-child { border-bottom: 0; }
.wk-row:hover { background: var(--surface-2); }
.wk-row.is-overdue { box-shadow: inset 3px 0 0 var(--danger); }
.wk-row.is-done .wk-row-title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--border-strong); }
.wk-row-main { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; row-gap: 2px; }
.wk-row-title { display: inline-flex; align-items: center; gap: 5px; min-width: 0; color: var(--text); font-size: 14px; font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.wk-row-title:hover { color: var(--primary-text); }
.wk-row-tags { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wk-tag, .wk-meta { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.wk-tag { padding: 1px 7px; border-radius: 6px; background: var(--surface-3); }
.wk-live { color: var(--info-text); font-weight: 600; }
.wk-row-people { justify-self: end; }
.wk-row-date { color: var(--text-2); font-size: 12.5px; text-align: right; white-space: nowrap; }
.wk-row > .wk-imp { justify-self: end; }
.wk-status-menu .menu-item, .wk-table .menu-item { gap: 0; }

.wk-quick { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 14px; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.wk-quick:focus-within { border-style: solid; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.wk-quick-icon { display: inline-grid; color: var(--primary-text); }
.wk-quick-input { flex: 1; min-width: 0; height: 34px; border: 0; background: transparent; color: var(--text); font-size: 14px; outline: none; }
.wk-quick-date { width: 150px; height: 32px; padding: 0 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--input-bg); color: var(--text-2); font-size: 13px; }

/* board tweaks */
.board-column-head .wk-status { font-size: 13px; }
.board-column { border-top: 3px solid var(--st, var(--border)); }
.wk-col-todo { --st: var(--st-todo); }
.wk-col-progress { --st: var(--st-progress); }
.wk-col-review { --st: var(--st-review); }
.wk-col-revision { --st: var(--st-revision); }
.wk-col-done { --st: var(--st-done); }
.task-card-project .icon { vertical-align: -2px; }

/* table view */
.wk-table th { white-space: nowrap; }
.wk-sort { display: inline-flex; align-items: center; gap: 3px; color: inherit; text-decoration: none; }
.wk-sort.active, .wk-sort:hover { color: var(--text); }
.wk-id { width: 64px; color: var(--muted); font-size: 12.5px; }
.wk-table tr.is-overdue td:first-child { box-shadow: inset 3px 0 0 var(--danger); }

/* timeline (gantt) */
.wk-gantt-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wk-gantt-panel { overflow-x: auto; }
.wk-gantt { --label: 260px; min-width: 860px; }
.wk-gantt-row { display: grid; grid-template-columns: var(--label) minmax(0, 1fr); min-height: 40px; border-bottom: 1px solid var(--border); }
.wk-gantt-row:last-child { border-bottom: 0; }
.wk-gantt-head { position: sticky; top: 0; z-index: 2; background: var(--surface-2); }
.wk-gantt-label { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px 14px; border-right: 1px solid var(--border); color: var(--text); font-size: 13.5px; font-weight: 600; text-decoration: none; }
.wk-gantt-head .wk-gantt-label { color: var(--muted); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }
a.wk-gantt-label:hover { background: var(--surface-2); color: var(--primary-text); }
.wk-gantt-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-gantt-scale { display: flex; flex-direction: column; }
.wk-gantt-weeks, .wk-gantt-days { display: grid; }
.wk-gantt-weeks { grid-template-columns: repeat(calc(var(--days) / 7), minmax(0, 1fr)); border-bottom: 1px solid var(--border); }
.wk-gantt-weeks span { padding: 4px 8px; border-left: 1px solid var(--border); color: var(--text-2); font-size: 12px; font-weight: 700; }
.wk-gantt-days { grid-template-columns: repeat(var(--days), minmax(0, 1fr)); }
.wk-gantt-days span { padding: 2px 0; color: var(--muted); font-size: 10.5px; text-align: center; }
.wk-gantt-days span.is-weekend { background: var(--surface-3); }
.wk-gantt-days span.is-today { background: var(--primary); color: #fff; border-radius: 4px; font-weight: 700; }
.wk-gantt-track {
  position: relative;
  background-image: linear-gradient(to right, transparent calc(100% * 5 / 7), var(--surface-2) calc(100% * 5 / 7));
  background-size: calc(100% * 7 / var(--days)) 100%;
}
.wk-today { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--primary); opacity: 0.55; z-index: 1; }
.wk-gantt-bar {
  position: absolute; top: 8px; bottom: 8px; z-index: 1; display: flex; align-items: center; min-width: 8px; padding: 0 8px;
  overflow: hidden; border-radius: 6px; background: var(--st); color: #fff; font-size: 12px; font-weight: 600;
  white-space: nowrap; text-overflow: ellipsis; text-decoration: none; box-shadow: var(--shadow-sm);
}
.wk-gantt-bar:hover { color: #fff; filter: brightness(1.08); }
.wk-gantt-bar.cut-start { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.wk-gantt-bar.cut-end { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.wk-gantt-bar.is-overdue { box-shadow: 0 0 0 2px var(--danger); }
.wk-gantt-empty { padding: 12px; }

/* task page */
.wk-task { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--gap); align-items: start; }
.wk-task-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; padding: 22px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.wk-crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.wk-crumbs a { color: var(--muted); text-decoration: none; }
.wk-crumbs a:hover { color: var(--primary-text); }
.wk-task-title { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; overflow-wrap: anywhere; }
.wk-task-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wk-status-big {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 0; border-radius: 8px;
  background: var(--st); color: #fff; font-size: 13.5px; font-weight: 700; cursor: pointer;
}
.wk-status-big:disabled { cursor: default; }
.wk-props { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.wk-prop { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 10px 14px; border-right: 1px solid var(--border); }
.wk-prop:last-child { border-right: 0; }
.wk-prop-label { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.wk-prop-value { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; font-weight: 600; }
.wk-section { display: flex; flex-direction: column; gap: 10px; }
.wk-section-title { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 15px; font-weight: 700; }
.wk-section-title .muted { font-weight: 500; font-size: 13px; }
.wk-workflow { display: flex; gap: 0; margin: 0; padding: 0; list-style: none; }
.wk-step { position: relative; flex: 1; padding: 6px 8px 6px 18px; background: var(--surface-3); color: var(--muted); font-size: 12px; font-weight: 600; clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%); }
.wk-step:first-child { clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); padding-left: 10px; border-radius: 8px 0 0 8px; }
.wk-step small { display: block; font-weight: 500; font-size: 11px; }
.wk-step.is-done { background: color-mix(in srgb, var(--st-done) 22%, transparent); color: var(--text); }
.wk-step.is-current { background: var(--primary); color: #fff; }
.wk-subtask { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-bottom: 1px solid var(--border); }
.wk-subtask:last-of-type { border-bottom: 0; }
.wk-subtask-add { display: flex; gap: 8px; }
.wk-progress { height: 6px; flex: 1; max-width: 160px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.wk-progress span { display: block; height: 100%; background: var(--st-done); }
.wk-stream { border-top: 1px solid var(--border); padding-top: 18px; }
.wk-side-col { display: flex; flex-direction: column; gap: var(--gap); }

/* extra hours, location */
.extra-box { display: flex; flex-direction: column; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); }
.extra-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.timer-display-sm { padding: 10px; background: var(--surface); }
.timer-display-sm span { font-size: 26px; }
.list-row-flat { padding: 8px 0; min-height: 0; background: transparent; }
.geo-status { display: flex; align-items: flex-start; gap: 6px; }
.geo-status > .icon { flex-shrink: 0; margin-top: 2px; }
.geo-status.is-ok { color: var(--success-text); }
.geo-status.is-error { color: var(--danger-text); font-weight: 600; }
.kpi-note { color: var(--warning-text); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.cell-note-inline { display: inline-flex; align-items: center; gap: 4px; margin-right: 6px; }
.person-link { color: inherit; text-decoration: none; }
.person-link:hover .person-name { color: var(--primary-text); }

@media (max-width: 1024px) {
  .wk-shell { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .wk-side { position: static; flex-direction: row; align-items: center; max-height: none; padding: 6px; overflow-x: auto; scrollbar-width: none; }
  .wk-side::-webkit-scrollbar { display: none; }
  .wk-side-title { display: none; }
  .wk-side-group { flex-direction: row; gap: 2px; }
  .wk-side-group + .wk-side-title + .wk-side-group, .wk-side-group + .wk-side-group { padding-left: 6px; border-left: 1px solid var(--border); }
  .wk-nav { flex-shrink: 0; white-space: nowrap; }
  .wk-nav span:not(.wk-count):not(.wk-swatch) { overflow: visible; }
  .wk-task { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .wk-title, .wk-task-title { font-size: 22px; }
  .wk-row { grid-template-columns: 22px minmax(0, 1fr) auto; row-gap: 4px; padding: 9px 12px; }
  .wk-row-date { grid-column: 2; grid-row: 2; text-align: left; }
  .wk-row-people { grid-column: 3; grid-row: 1; }
  .wk-row > .wk-imp { grid-column: 3; grid-row: 2; }
  .wk-bar { align-items: stretch; }
  .wk-views { overflow-x: auto; scrollbar-width: none; }
  .wk-filters { width: 100%; }
  .wk-filters .filter-search { flex: 1 1 100%; }
  .wk-filters .form-select { flex: 1 1 120px; }
  .wk-quick-date { width: 42px; padding: 0 4px; }
  .wk-quick-input::placeholder { font-size: 13px; }
  .wk-head-actions .btn-primary { padding-inline: 12px; }
  .wk-task-main { padding: 16px; }
  .wk-props { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wk-prop:nth-child(2n) { border-right: 0; }
  .wk-prop { border-bottom: 1px solid var(--border); }
  .wk-step { font-size: 11px; padding-left: 14px; }
  .wk-step small { display: none; }
}
