/* ==========================================================================
   Phoenix Workspace — hand-written design system (no CSS framework)
   ========================================================================== */

:root {
  color-scheme: light;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --gray-25: #fcfcfd; --gray-50: #f9fafb; --gray-100: #f3f4f6; --gray-150: #eceef1; --gray-200: #e5e7eb; --gray-300: #d1d5db;
  --gray-400: #9ca3af; --gray-500: #6b7280; --gray-600: #4b5563; --gray-700: #374151; --gray-800: #1f2937; --gray-900: #111827;

  --brand-50: #f1f3ff; --brand-100: #e4e7ff; --brand-200: #cdd2ff; --brand-300: #a9b0fd; --brand-400: #8184f9;
  --brand-500: #6461f2; --brand-600: #5345e6; --brand-700: #4637cb; --brand-800: #3a2fa4;

  --green-50: #ecfdf5; --green-200: #a7f3d0; --green-500: #10b981; --green-600: #059669; --green-700: #047857;
  --amber-50: #fffbeb; --amber-200: #fde68a; --amber-500: #f59e0b; --amber-600: #d97706; --amber-700: #b45309; --amber-800: #92400e;
  --red-50: #fff1f2; --red-200: #fecdd3; --red-500: #f43f5e; --red-600: #e11d48; --red-700: #be123c;
  --blue-50: #f0f9ff; --blue-200: #bae6fd; --blue-500: #0ea5e9; --blue-700: #0369a1;
  --violet-50: #f5f3ff; --violet-200: #ddd6fe; --violet-500: #8b5cf6; --violet-700: #6d28d9;
  --teal-50: #f0fdfa; --teal-100: #ccfbf1; --teal-200: #99f6e4; --teal-500: #14b8a6; --teal-700: #0f766e; --teal-800: #115e59;
  --orange-50: #fff7ed; --orange-200: #fed7aa; --orange-500: #f97316; --orange-700: #c2410c;

  --carry: #eda100; --additional: #6250d6;

  --bg: #f7f8fa;
  --surface: #ffffff;
  --border: #e6e8ec;
  --text: var(--gray-900);
  --muted: var(--gray-500);

  --radius-sm: 6px; --radius: 8px; --radius-lg: 12px; --radius-xl: 16px;
  --shadow-card: 0 1px 2px rgb(16 24 40 / .04), 0 1px 3px rgb(16 24 40 / .04);
  --shadow-pop: 0 12px 32px -8px rgb(16 24 40 / .18), 0 4px 8px -4px rgb(16 24 40 / .06);
  --sidebar-w: 248px; --sidebar-w-collapsed: 64px; --topbar-h: 56px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.45; color: var(--text); background: var(--bg); font-feature-settings: "cv11", "ss01"; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
img, svg { display: block; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
table { border-collapse: collapse; width: 100%; }
::selection { background: var(--brand-100); color: var(--brand-800); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid color-mix(in srgb, var(--brand-500) 55%, transparent); outline-offset: 2px; }
* { scrollbar-width: thin; scrollbar-color: var(--gray-300) transparent; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- Utilities (small, hand-picked set) ---------- */
.flex { display: flex; } .inline-flex { display: inline-flex; } .grid { display: grid; } .block { display: block; }
.items-center { align-items: center; } .items-start { align-items: flex-start; } .items-end { align-items: flex-end; } .items-baseline { align-items: baseline; }
.justify-between { justify-content: space-between; } .justify-end { justify-content: flex-end; } .justify-center { justify-content: center; }
.flex-1 { flex: 1 1 0%; min-width: 0; } .shrink-0 { flex-shrink: 0; } .wrap { flex-wrap: wrap; } .col { flex-direction: column; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-5 { gap: 20px; } .gap-6 { gap: 24px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; } .ml-auto { margin-left: auto; } .ml-1 { margin-left: 4px; }
.p-4 { padding: 16px; } .p-5 { padding: 20px; } .px-5 { padding-left: 20px; padding-right: 20px; } .pb-5 { padding-bottom: 20px; }
.w-full { width: 100%; } .min-w-0 { min-width: 0; }
.stack > * + * { margin-top: 24px; } .stack-4 > * + * { margin-top: 16px; } .stack-3 > * + * { margin-top: 12px; } .stack-2 > * + * { margin-top: 8px; }
.text-xs { font-size: 12px; } .text-2xs { font-size: 11px; } .text-sm { font-size: 13px; } .text-base { font-size: 14px; } .text-lg { font-size: 16px; } .text-xl { font-size: 20px; } .text-2xl { font-size: 24px; } .text-3xl { font-size: 30px; }
.font-medium { font-weight: 500; } .font-semibold { font-weight: 600; } .font-bold { font-weight: 700; }
.muted { color: var(--muted); } .subtle { color: var(--gray-400); } .strong { color: var(--gray-900); } .text-700 { color: var(--gray-700); } .text-600 { color: var(--gray-600); }
.text-red { color: var(--red-600); } .text-amber { color: var(--amber-700); } .text-green { color: var(--green-600); } .text-brand { color: var(--brand-700); } .text-teal { color: var(--teal-700); }
.text-right { text-align: right; } .text-center { text-align: center; } .uppercase { text-transform: uppercase; letter-spacing: .05em; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .nowrap { white-space: nowrap; } .tabular { font-variant-numeric: tabular-nums; } .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.strike { text-decoration: line-through; color: var(--gray-400); }
.link { color: var(--brand-600); font-weight: 500; font-size: 12px; } .link:hover { text-decoration: underline; }
.dot { width: 8px; height: 8px; border-radius: 99px; display: inline-block; flex-shrink: 0; }
.sq { width: 10px; height: 10px; border-radius: 2px; display: inline-block; flex-shrink: 0; }
.divider { height: 1px; background: var(--gray-100); margin: 8px 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hide-sm { } .show-sm { display: none; }
@media (max-width: 767px) { .hide-sm { display: none !important; } .show-sm { display: initial; } }

.grid-2 { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { display: grid; gap: 16px; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-6 { display: grid; gap: 16px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.grid-main { display: grid; gap: 24px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid-aside { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr) 300px; }
.span-2 { grid-column: span 2; } .span-full { grid-column: 1 / -1; }
@media (max-width: 1279px) { .grid-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid-main { grid-template-columns: minmax(0, 1fr); } .grid-3.collapse-lg { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1023px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-aside { grid-template-columns: minmax(0, 1fr); } .span-2 { grid-column: auto; } }
@media (max-width: 639px) { .grid-2, .grid-3, .grid-4, .grid-5, .grid-6 { grid-template-columns: minmax(0, 1fr); } .grid-6.keep-2, .grid-4.keep-2, .grid-5.keep-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- App shell ---------- */
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: var(--sidebar-w); background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; transition: width .2s ease; }
.sidebar-head { height: var(--topbar-h); display: flex; align-items: center; padding: 0 16px; border-bottom: 1px solid var(--gray-100); flex-shrink: 0; }
.logo { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo-mark { width: 32px; height: 32px; border-radius: 99px; display: block; flex-shrink: 0; object-fit: contain; }
.logo-name { font-size: 14px; font-weight: 600; } .logo-sub { font-size: 11px; color: var(--muted); }
.nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 12px 10px; }
.nav-group + .nav-group { margin-top: 16px; }
.nav-label { padding: 0 10px; margin-bottom: 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--gray-400); }
.nav-link { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 10px; border-radius: var(--radius); font-size: 13px; font-weight: 500; color: var(--gray-600); position: relative; }
.nav-link:hover { background: var(--gray-50); color: var(--gray-900); }
.nav-link.active { background: var(--gray-100); color: var(--gray-900); }
.nav-link svg { width: 17px; height: 17px; color: var(--gray-400); flex-shrink: 0; }
.nav-link.active svg { color: var(--brand-600); }
.nav-link .label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count { background: var(--brand-600); color: #fff; border-radius: 99px; padding: 1px 6px; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sidebar-foot { border-top: 1px solid var(--gray-100); padding: 10px; flex-shrink: 0; position: relative; }
.user-chip { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px; border-radius: var(--radius); text-align: left; }
.user-chip:hover { background: var(--gray-100); }
.collapse-btn { position: absolute; right: -12px; top: 18px; width: 24px; height: 24px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--gray-400); display: grid; place-items: center; box-shadow: var(--shadow-card); }
.collapse-btn:hover { color: var(--gray-700); }
.collapse-btn svg { width: 14px; height: 14px; }

body.sidebar-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
body.sidebar-collapsed .sidebar .logo-text, body.sidebar-collapsed .nav-label, body.sidebar-collapsed .nav-link .label, body.sidebar-collapsed .user-chip .user-text { display: none; }
body.sidebar-collapsed .nav-link { justify-content: center; padding: 0; }
body.sidebar-collapsed .nav-count { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; padding: 0; font-size: 0; box-shadow: 0 0 0 2px #fff; }
body.sidebar-collapsed .nav-group + .nav-group { border-top: 1px solid var(--gray-100); padding-top: 12px; margin-top: 12px; }
body.sidebar-collapsed .sidebar-head { justify-content: center; padding: 0; }
body.sidebar-collapsed .user-chip { justify-content: center; }
body.sidebar-collapsed .collapse-btn svg { transform: rotate(180deg); }

.shell { padding-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; transition: padding .2s ease; }
body.sidebar-collapsed .shell { padding-left: var(--sidebar-w-collapsed); }
.topbar { position: sticky; top: 0; z-index: 20; height: var(--topbar-h); display: flex; align-items: center; gap: 12px; padding: 0 24px; background: rgb(255 255 255 / .85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; min-width: 0; }
.crumbs a { color: var(--muted); } .crumbs a:hover { color: var(--gray-900); }
.crumbs .sep { color: var(--gray-300); }
.crumbs .current { font-weight: 500; color: var(--gray-900); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.search-trigger { display: flex; align-items: center; gap: 8px; height: 32px; width: 288px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--gray-400); font-size: 13px; }
.search-trigger:hover { border-color: var(--gray-300); color: var(--gray-600); }
.search-trigger svg { width: 16px; height: 16px; }
.icon-btn { position: relative; width: 32px; height: 32px; border-radius: var(--radius); display: grid; place-items: center; color: var(--gray-500); }
.icon-btn:hover { background: var(--gray-100); color: var(--gray-900); }
.icon-btn svg { width: 18px; height: 18px; }
.bell-count { position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--red-500); color: #fff; font-size: 10px; font-weight: 600; line-height: 16px; text-align: center; box-shadow: 0 0 0 2px #fff; }
.live-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 500; color: var(--green-700); padding: 2px 8px; border-radius: 99px; }
.live-badge .dot { width: 6px; height: 6px; background: var(--green-500); }
.live-badge.offline { background: var(--amber-50); color: var(--amber-700); } .live-badge.offline .dot { background: var(--amber-500); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.main { width: 100%; max-width: 1400px; margin: 0 auto; padding: 32px; flex: 1; }
.mobile-only { display: none; }
.scrim { position: fixed; inset: 0; background: rgb(17 24 39 / .4); z-index: 40; animation: fade .15s ease-out; }

@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s cubic-bezier(.2,.8,.2,1); width: 280px !important; z-index: 50; box-shadow: var(--shadow-pop); }
  body.nav-open .sidebar { transform: none; }
  body.sidebar-collapsed .sidebar .logo-text, body.sidebar-collapsed .nav-label, body.sidebar-collapsed .nav-link .label, body.sidebar-collapsed .user-chip .user-text { display: revert; }
  body.sidebar-collapsed .nav-link { justify-content: flex-start; padding: 0 10px; }
  .collapse-btn { display: none; }
  .shell, body.sidebar-collapsed .shell { padding-left: 0; }
  .mobile-only { display: grid; }
  .main { padding: 24px 16px; }
  .topbar { padding: 0 16px; }
  .search-trigger { width: auto; } .search-trigger .search-text, .search-trigger kbd { display: none; }
}
@media (max-width: 767px) { .crumbs .crumb-full { display: none; } .live-badge { display: none; } }

/* Header attendance control */
.attendance-clock { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.att-status { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: var(--radius); background: var(--green-50); color: var(--green-700); font-size: 12px; font-weight: 500; white-space: nowrap; }
a.att-status:hover { background: color-mix(in srgb, var(--green-50) 60%, var(--green-100, #dcfce7)); }
.att-dot { width: 8px; height: 8px; border-radius: 99px; background: var(--green-500); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green-500) 20%, transparent); animation: pulse 2s infinite; }
.att-dot-idle { background: var(--amber-500, #f59e0b); box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber-500, #f59e0b) 20%, transparent); animation: none; }
.att-elapsed { color: var(--green-800, var(--green-700)); font-weight: 600; }
.att-btn { white-space: nowrap; }
.break-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: var(--radius); background: var(--amber-50, #fffbeb); color: var(--amber-700, #b45309); font-size: 12px; font-weight: 500; white-space: nowrap; }
.att-btn.att-in svg { color: var(--brand-600); }
.att-btn.att-out { position: relative; }
@media (max-width: 1279px) { .att-status .att-label { display: none; } }
@media (max-width: 767px) {
  .att-status { display: none; }
  .att-btn { padding: 0 10px; }
  .att-btn.att-out::after { content: ""; position: absolute; top: -2px; right: -2px; width: 9px; height: 9px; border-radius: 99px; background: var(--green-500); box-shadow: 0 0 0 2px #fff; }
}
@media (max-width: 400px) { .att-btn .att-text { font-size: 12px; } .topbar-actions { gap: 6px; } }
.topbar-actions { flex-shrink: 0; }
.topbar .crumbs { flex: 1 1 auto; overflow: hidden; }
.topbar .crumbs .current { min-width: 0; }

/* ---------- Typography / page header ---------- */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-title { font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.page-desc { margin-top: 4px; color: var(--muted); font-size: 14px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 8px; font-size: 13px; color: var(--muted); }
.back-link:hover { color: var(--gray-900); }
.back-link svg { width: 16px; height: 16px; }
@media (max-width: 639px) { .page-header { align-items: flex-start; flex-direction: column; } .page-title { font-size: 20px; } }
kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 4px; border: 1px solid var(--border); border-radius: 4px; background: var(--gray-50); font: 500 11px var(--font); color: var(--muted); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: var(--radius); font-size: 14px; font-weight: 500; white-space: nowrap; border: 1px solid transparent; transition: background .15s, border-color .15s, color .15s; flex-shrink: 0; }
.btn svg { width: 16px; height: 16px; }
.btn:disabled, .btn[aria-disabled="true"] { cursor: not-allowed; opacity: .55; }
.btn-primary { background: var(--brand-600); color: #fff; box-shadow: var(--shadow-card); }
.btn-primary:hover:not(:disabled) { background: var(--brand-700); }
.btn-secondary { background: var(--surface); color: var(--gray-800); border-color: var(--border); box-shadow: var(--shadow-card); }
.btn-secondary:hover:not(:disabled) { background: var(--gray-50); border-color: var(--gray-300); }
.btn-ghost { color: var(--gray-600); } .btn-ghost:hover:not(:disabled) { background: var(--gray-100); color: var(--gray-900); }
.btn-subtle { background: var(--brand-50); color: var(--brand-700); } .btn-subtle:hover { background: var(--brand-100); }
.btn-warn { background: var(--amber-50, #fffbeb); color: var(--amber-700, #b45309); border: 1px solid var(--amber-200, #fde68a); } .btn-warn:hover { background: var(--amber-100, #fef3c7); }
.pm-dot { width: 7px; height: 7px; border-radius: 99px; background: var(--amber-500, #f59e0b); box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber-500, #f59e0b) 25%, transparent); }
.pm-section { display: grid; gap: 10px; padding: 14px 16px; border: 1px solid var(--amber-200, #fde68a); border-radius: var(--radius); background: var(--amber-50, #fffbeb); }
.pm-row + .pm-row { padding-top: 10px; border-top: 1px solid var(--amber-200, #fde68a); }
.btn-danger { background: var(--red-600); color: #fff; } .btn-danger:hover:not(:disabled) { background: var(--red-700); }
.btn-danger-text { color: var(--red-600); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; gap: 6px; }
.btn-xs { height: 28px; padding: 0 8px; font-size: 12px; gap: 4px; border-radius: var(--radius-sm); }
.btn-xs svg { width: 14px; height: 14px; }
.btn-icon { width: 36px; padding: 0; } .btn-sm.btn-icon { width: 32px; } .btn-xs.btn-icon { width: 28px; }
.btn-block { width: 100%; }
.btn.loading { pointer-events: none; opacity: .7; }
.btn.loading::before { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 99px; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); min-width: 0; }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px 20px 12px; }
.card-title { font-size: 14px; font-weight: 600; }
.menu-note { display: block; padding: 8px 12px; font-size: 12px; color: var(--muted); max-width: 220px; }
.card-desc { margin-top: 2px; font-size: 12px; color: var(--muted); }
.card-body { padding: 0 20px 20px; }
.card-foot { border-top: 1px solid var(--gray-100); padding: 10px 20px; font-size: 12px; color: var(--muted); }
.card.hoverable:hover { border-color: var(--gray-300); box-shadow: 0 4px 12px -4px rgb(16 24 40 / .12); }
.card-link { display: block; border-radius: var(--radius-lg); }
.card-link.stack-3, .grid-3 > .card.stack-3 { display: flex; flex-direction: column; } .card-link:hover { border-color: var(--gray-300); box-shadow: var(--shadow-md, var(--shadow)); }
.sq-lg { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; flex: none; } .sq-lg svg { width: 18px; height: 18px; }
.list { border-top: 1px solid var(--gray-100); }
.list > li + li { border-top: 1px solid var(--gray-100); }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; width: 100%; text-align: left; }
a.list-row:hover, button.list-row:hover { background: var(--gray-50); }

.stat { display: block; height: 100%; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
a.stat:hover { border-color: var(--gray-300); box-shadow: 0 4px 12px -4px rgb(16 24 40 / .12); }
.stat-icon { width: 32px; height: 32px; border-radius: var(--radius); display: grid; place-items: center; }
.stat-icon svg { width: 16px; height: 16px; }
.stat-value { margin-top: 12px; font-size: 24px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.stat-label { margin-top: 2px; font-size: 13px; color: var(--muted); }
.stat-hint { margin-top: 8px; font-size: 12px; color: var(--gray-400); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tone-gray { background: var(--gray-100); color: var(--gray-600); } .tone-brand { background: var(--brand-50); color: var(--brand-600); }
.tone-green { background: var(--green-50); color: var(--green-600); } .tone-amber { background: var(--amber-50); color: var(--amber-600); }
.tone-red { background: var(--red-50); color: var(--red-600); } .tone-violet { background: var(--violet-50); color: var(--violet-700); }
.tone-blue { background: var(--blue-50); color: var(--blue-700); } .tone-teal { background: var(--teal-50); color: var(--teal-700); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metrics > div { padding: 16px 20px; } .metrics > div + div { border-left: 1px solid var(--gray-100); }
@media (max-width: 767px) { .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } .metrics > div:nth-child(3) { border-left: 0; } }

/* ---------- Badges, avatars ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; border-radius: var(--radius-sm); padding: 2px 8px; font-size: 12px; font-weight: 500; box-shadow: inset 0 0 0 1px var(--ring, transparent); }
.badge svg { width: 12px; height: 12px; }
.badge .dot { width: 6px; height: 6px; }
.badge-gray { background: var(--gray-100); color: var(--gray-700); --ring: var(--gray-200); } .badge-gray .dot { background: var(--gray-400); }
.badge-brand { background: var(--brand-50); color: var(--brand-700); --ring: var(--brand-200); } .badge-brand .dot { background: var(--brand-500); }
.badge-green { background: var(--green-50); color: var(--green-700); --ring: var(--green-200); } .badge-green .dot { background: var(--green-500); }
.badge-amber { background: var(--amber-50); color: var(--amber-800); --ring: var(--amber-200); } .badge-amber .dot { background: var(--amber-500); }
.badge-red { background: var(--red-50); color: var(--red-700); --ring: var(--red-200); } .badge-red .dot { background: var(--red-500); }
.badge-blue { background: var(--blue-50); color: var(--blue-700); --ring: var(--blue-200); } .badge-blue .dot { background: var(--blue-500); }
.badge-violet { background: var(--violet-50); color: var(--violet-700); --ring: var(--violet-200); } .badge-violet .dot { background: var(--violet-500); }
.badge-teal { background: var(--teal-50); color: var(--teal-700); --ring: var(--teal-200); } .badge-teal .dot { background: var(--teal-500); }
.badge-orange { background: var(--orange-50); color: var(--orange-700); --ring: var(--orange-200); } .badge-orange .dot { background: var(--orange-500); }
.pill { border-radius: 99px; padding: 0 6px; font-size: 11px; font-weight: 600; background: var(--gray-100); color: var(--gray-500); font-variant-numeric: tabular-nums; }
.pill.active { background: var(--brand-100); color: var(--brand-700); }
.tag { border-radius: 4px; background: var(--gray-100); color: var(--gray-600); padding: 1px 6px; font-size: 11px; }
.code-chip { border-radius: 4px; background: var(--gray-100); padding: 0 6px; font-size: 11px; font-weight: 600; color: var(--gray-500); }

.avatar { display: inline-grid; place-items: center; flex-shrink: 0; border-radius: 99px; font-weight: 600; user-select: none; width: 32px; height: 32px; font-size: 12px; }
.avatar-xs { width: 20px; height: 20px; font-size: 9px; } .avatar-sm { width: 24px; height: 24px; font-size: 10px; } .avatar-lg { width: 40px; height: 40px; font-size: 14px; }
.avatar-xl { width: 64px; height: 64px; font-size: 20px; } .avatar-2xl { width: 80px; height: 80px; font-size: 24px; }
.avatar.ring { box-shadow: 0 0 0 2px #fff; }
.av-0 { background: #ffe4e6; color: #be123c; } .av-1 { background: #fef3c7; color: #b45309; } .av-2 { background: #d1fae5; color: #047857; } .av-3 { background: #e0f2fe; color: #0369a1; }
.av-4 { background: #ede9fe; color: #6d28d9; } .av-5 { background: #ccfbf1; color: #0f766e; } .av-6 { background: #ffedd5; color: #c2410c; } .av-7 { background: #e0e7ff; color: #4338ca; }
.av-8 { background: #fae8ff; color: #a21caf; } .av-9 { background: #ecfccb; color: #3f6212; }
.avatar-stack { display: flex; } .avatar-stack > * + * { margin-left: -6px; }
.avatar-more { background: var(--gray-100); color: var(--gray-600); font-weight: 500; }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person-name { font-size: 14px; font-weight: 500; color: var(--gray-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.type-tag { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 13px; color: var(--gray-800); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 500; color: var(--gray-700); }
.req { color: var(--red-500); margin-left: 2px; }
.field-hint { font-size: 12px; color: var(--muted); }
.field-error { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--red-600); }
.field-error:empty { display: none; }
.field.has-error .field-hint { display: none; }
.input, .select, .textarea { width: 100%; height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); font-size: 14px; color: var(--gray-900); transition: border-color .15s, box-shadow .15s; }
.input::placeholder, .textarea::placeholder { color: var(--gray-400); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--gray-300); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-500) 22%, transparent); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--gray-50); color: var(--gray-500); }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea, .field.has-error .ms { border-color: var(--red-500); }
.textarea { height: auto; padding: 8px 12px; resize: vertical; line-height: 1.5; min-height: 72px; }
.select { appearance: none; padding-right: 34px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
.input-sm, .select-sm { height: 32px; font-size: 13px; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap > svg { position: absolute; left: 10px; width: 16px; height: 16px; color: var(--gray-400); pointer-events: none; }
.input-wrap .input { padding-left: 34px; }
.input-wrap .suffix { position: absolute; right: 12px; font-size: 12px; color: var(--gray-400); }
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 639px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
.form-section-title { margin-bottom: 12px; font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.form-error-box { display: flex; gap: 8px; border: 1px solid var(--red-200); background: var(--red-50); color: var(--red-700); border-radius: var(--radius); padding: 10px; font-size: 12px; }
.form-error-box:empty { display: none; }

.check { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 14px; }
.check input { appearance: none; margin: 2px 0 0; width: 16px; height: 16px; border: 1px solid var(--gray-300); border-radius: 4px; background: #fff; display: grid; place-items: center; flex-shrink: 0; cursor: pointer; }
.check input:checked { background: var(--brand-600); border-color: var(--brand-600); }
.check input:checked::after { content: ""; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.check input:disabled { opacity: .6; cursor: not-allowed; }
.check .check-desc { display: block; font-size: 12px; color: var(--muted); }

.switch { position: relative; display: inline-flex; flex-shrink: 0; width: 36px; height: 20px; }
.switch input { appearance: none; margin: 0; width: 100%; height: 100%; border-radius: 99px; background: var(--gray-200); cursor: pointer; transition: background .15s; }
.switch input:checked { background: var(--brand-600); }
.switch input:disabled { opacity: .5; cursor: not-allowed; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 99px; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .2); transition: transform .15s; pointer-events: none; }
.switch:has(input:checked)::after { transform: translateX(16px); }
.switch-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 4px 0; }
.switch-row .title { font-size: 14px; font-weight: 500; color: var(--gray-800); }
.switch-row .desc { margin-top: 2px; font-size: 12px; color: var(--muted); }

.seg { display: inline-flex; background: var(--gray-100); padding: 2px; border-radius: var(--radius); }
.seg > button, .seg > a, .seg > label { display: inline-flex; flex: 1; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; cursor: pointer; }
.seg > button svg, .seg > a svg, .seg > label svg { width: 14px; height: 14px; }
.seg > .on, .seg > label:has(input:checked) { background: #fff; color: var(--gray-900); box-shadow: 0 1px 2px rgb(16 24 40 / .08); }
.seg > :disabled, .seg > label:has(input:disabled) { opacity: .4; cursor: not-allowed; }
.seg input { display: none; }
.seg-sm > button, .seg-sm > a, .seg-sm > label { height: 28px; padding: 0 10px; font-size: 12px; }
.seg.full { display: flex; width: 100%; }

.choice-grid { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; transition: border-color .15s, background .15s; }
.choice:hover { border-color: var(--gray-300); background: var(--gray-50); }
.choice:has(input:checked) { border-color: var(--brand-500); background: color-mix(in srgb, var(--brand-50) 60%, #fff); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-500) 18%, transparent); }
.choice input { display: none; }
.color-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.color-swatches label { width: 28px; height: 28px; border-radius: 8px; cursor: pointer; outline-offset: 2px; }
.color-swatches input { display: none; }
.color-swatches label:has(input:checked) { outline: 2px solid var(--gray-900); }

.filter-select { height: 32px; max-width: 200px; padding: 0 28px 0 10px; border: 1px solid var(--border); border-radius: var(--radius); background-color: #fff; font-size: 13px; color: var(--gray-600); appearance: none; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-size: 14px; text-overflow: ellipsis; }
.filter-select:hover { border-color: var(--gray-300); }
.filter-select.active { background-color: var(--brand-50); border-color: var(--brand-200); color: var(--brand-700); font-weight: 500; }
.search-input { position: relative; width: 256px; max-width: 100%; }
.search-input svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--gray-400); pointer-events: none; }
.search-input input { width: 100%; height: 32px; padding: 0 10px 0 32px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; background: #fff; }
.search-input input:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-500) 22%, transparent); }
@media (max-width: 639px) { .search-input { width: 100%; } }
.clear-filters { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 8px; border-radius: var(--radius); font-size: 13px; color: var(--muted); }
.clear-filters:hover { background: var(--gray-100); color: var(--gray-900); }

/* Multi-select (people picker) */
.ms { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-height: 36px; padding: 4px 32px 4px 8px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; cursor: pointer; }
.ms:hover { border-color: var(--gray-300); }
.ms::after { content: ""; position: absolute; right: 10px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center/16px no-repeat; }
.ms-placeholder { padding: 0 4px; color: var(--gray-400); font-size: 14px; }
.ms-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px; border-radius: 6px; background: var(--gray-100); font-size: 12px; font-weight: 500; color: var(--gray-700); }
.ms-chip button { color: var(--gray-400); display: grid; place-items: center; } .ms-chip button:hover { color: var(--gray-700); }
.ms-chip svg { width: 12px; height: 12px; }
.ms-panel { position: fixed; z-index: 70; display: flex; flex-direction: column; width: 360px; max-width: calc(100vw - 16px); overflow: hidden; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); padding: 4px; animation: pop .16s ease-out; }
.ms-panel input { width: 100%; height: 32px; margin-bottom: 4px; padding: 0 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
.ms-panel input:focus { outline: none; border-color: var(--brand-500); }
.ms-options { flex: 1 1 auto; min-height: 0; max-height: 256px; overflow-y: auto; overscroll-behavior: contain; }
.ms-panel input { flex-shrink: 0; }
.ms-option { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border-radius: 6px; text-align: left; font-size: 13px; }
.ms-option:hover { background: var(--gray-100); }
.ms-option[aria-selected="true"] .ms-check { visibility: visible; }
.ms-option:disabled { opacity: .4; cursor: not-allowed; }
.ms-check { visibility: hidden; margin-left: auto; color: var(--brand-600); width: 16px; height: 16px; }

/* ---------- Tables ---------- */
.table-card { overflow: hidden; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--gray-100); }
.toolbar .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.table-wrap { overflow-x: auto; }
.table { font-size: 14px; }
.table th { padding: 10px 16px; text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); background: color-mix(in srgb, var(--gray-50) 70%, #fff); border-bottom: 1px solid var(--gray-100); white-space: nowrap; }
.table th a { display: inline-flex; align-items: center; gap: 4px; } .table th a:hover, .table th a.sorted { color: var(--gray-900); }
.table th a svg { width: 12px; height: 12px; opacity: .5; } .table th a.sorted svg { opacity: 1; }
.table td { padding: 12px 16px; vertical-align: middle; color: var(--gray-700); border-bottom: 1px solid var(--gray-100); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--gray-50) 80%, #fff); }
.table tr[data-href] { cursor: pointer; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { text-align: right; width: 1%; white-space: nowrap; }
.table th.chk, .table td.chk { width: 40px; padding-right: 0; }
.table tr.selected td { background: color-mix(in srgb, var(--brand-50) 50%, #fff); }
.table-compact th, .table-compact td { padding: 8px 12px; font-size: 13px; }
.col-hidden { display: none; }
.bulk-bar { display: none; align-items: center; gap: 12px; padding: 8px 16px; background: color-mix(in srgb, var(--brand-50) 70%, #fff); border-bottom: 1px solid var(--brand-100); font-size: 13px; }
.bulk-bar.show { display: flex; }
.bulk-bar strong { color: var(--brand-800); }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--gray-100); font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.pagination .pages { display: flex; align-items: center; gap: 4px; }
.pagination .page { min-width: 28px; height: 28px; padding: 0 8px; border: 1px solid transparent; border-radius: 6px; display: inline-grid; place-items: center; font-size: 12px; font-weight: 500; color: var(--gray-600); transition: background-color .15s, border-color .15s, color .15s; }
.pagination a.page:hover { background: var(--brand-50); border-color: var(--brand-200); color: var(--brand-700); }
.pagination a.page:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 1px; }
.pagination .page.current, .pagination .page.current:hover { background: var(--brand-600); border-color: var(--brand-600); color: #fff; cursor: default; }
.pagination .page.disabled { opacity: .35; cursor: not-allowed; }
.pagination .page.gap { opacity: 1; cursor: default; color: var(--gray-400); }
.pagination svg { width: 16px; height: 16px; }

/* Mobile: complex tables turn into cards (no horizontal scroll) */
@media (max-width: 767px) {
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-cards tr { padding: 12px 16px; border-bottom: 1px solid var(--gray-100); }
  .table-cards tr:last-child { border-bottom: 0; }
  .table-cards td { padding: 3px 0; border: 0; text-align: left !important; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
  .table-cards td[data-label]::before { content: attr(data-label); font-size: 12px; color: var(--muted); flex-shrink: 0; }
  .table-cards td.primary { padding-bottom: 6px; } .table-cards td.primary::before { display: none; }
  .table-cards td.chk, .table-cards td.mob-hide { display: none; }
  .table-cards tbody tr:hover td { background: transparent; }
}

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--border); overflow-x: auto; margin-bottom: 20px; }
.tab { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 4px 0 10px; margin-bottom: -1px; border-bottom: 2px solid transparent; font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.tab:hover { color: var(--gray-800); }
.tab.on { color: var(--gray-900); border-color: var(--gray-900); }
.tab svg { width: 16px; height: 16px; }

/* ---------- Progress, meters ---------- */
.progress { display: flex; align-items: center; gap: 8px; }
.progress-track { flex: 1; height: 8px; border-radius: 99px; background: var(--gray-100); overflow: hidden; }
.progress-sm .progress-track { height: 6px; }
.progress-fill { height: 100%; border-radius: 99px; background: var(--brand-500); transition: width .4s; }
.progress-fill.green { background: var(--green-500); } .progress-fill.amber { background: var(--amber-500); } .progress-fill.red { background: var(--red-500); } .progress-fill.gray { background: var(--gray-400); }
.progress-label { width: 36px; text-align: right; font-size: 12px; font-weight: 500; color: var(--gray-600); font-variant-numeric: tabular-nums; }
.meter { display: flex; gap: 2px; height: 8px; border-radius: 99px; overflow: hidden; background: var(--gray-100); }
.meter > span { height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: var(--gray-600); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.hatch { background-image: repeating-linear-gradient(135deg, rgb(255 255 255 / .6) 0 3px, transparent 3px 6px); }
.source-bar { display: flex; gap: 1px; width: 100%; height: 10px; border-radius: 99px; overflow: hidden; background: var(--gray-100); }
.source-bar.thin { height: 6px; }
.source-bar > span { height: 100%; }
.source-bar > span.pending { border: 1px dashed var(--gray-400); background: transparent; border-radius: 0 99px 99px 0; }

/* ---------- Overlays: modal, drawer, menu, tooltip ---------- */
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(4px); } }
@keyframes slide-in { from { transform: translateX(100%); } }
.overlay { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 24px; overflow: hidden; }
.overlay.dialog-layer { z-index: 66; }
.overlay-bg { position: absolute; inset: 0; background: rgb(17 24 39 / .4); backdrop-filter: blur(2px); animation: fade .15s ease-out; }
.modal { position: relative; display: flex; flex-direction: column; width: 100%; max-width: 512px; min-height: 0; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); overflow: hidden; background: #fff; border-radius: var(--radius-xl); box-shadow: var(--shadow-pop); animation: pop .16s ease-out; }
/* Modal partials wrap head/body/foot in a <form> or <div>: make that wrapper the flex column so only .modal-body scrolls. */
.modal > form, .modal > div:only-child { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; max-height: 100%; }
.modal-head, .modal-foot, .drawer-head, .drawer-foot { flex-shrink: 0; }
.modal.nudge { animation: nudge .3s ease-in-out; }
@keyframes nudge { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.modal-sm { max-width: 420px; } .modal-lg { max-width: 672px; } .modal-xl { max-width: 900px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px 24px; border-bottom: 1px solid var(--gray-100); }
.modal-title { font-size: 16px; font-weight: 600; }
.modal-desc { margin-top: 2px; font-size: 13px; color: var(--muted); }
.modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: 20px 24px; }
.modal-head > :first-child, .drawer-head > :first-child { min-width: 0; overflow-wrap: anywhere; }
.modal-head [data-close], .drawer-head [data-close] { flex-shrink: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 24px; border-top: 1px solid var(--gray-100); background: color-mix(in srgb, var(--gray-50) 60%, #fff); border-radius: 0 0 var(--radius-xl) var(--radius-xl); }
.modal-loading { padding: 48px; display: grid; place-items: center; }
@media (max-width: 639px) {
  .overlay { align-items: flex-end; padding: 12px 0 0; }
  .modal { max-width: none !important; max-height: calc(100vh - 12px); max-height: calc(100dvh - 12px); border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
  .modal-head, .modal-body { padding-left: 16px; padding-right: 16px; }
  .modal-foot { flex-direction: column-reverse; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-radius: 0; }
  .modal-foot .btn { width: 100%; }
  .modal .form-grid { grid-template-columns: minmax(0, 1fr); }
}
.drawer-root { position: fixed; inset: 0; z-index: 55; display: flex; justify-content: flex-end; }
.drawer { position: relative; display: flex; flex-direction: column; width: 100%; max-width: 640px; height: 100%; min-height: 0; overflow: hidden; background: #fff; box-shadow: var(--shadow-pop); animation: slide-in .22s cubic-bezier(.2,.8,.2,1); }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px 24px; border-bottom: 1px solid var(--gray-100); }
.drawer-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: 20px 24px; }
@media (max-width: 639px) { .drawer-head, .drawer-body, .drawer-foot { padding-left: 16px; padding-right: 16px; } .drawer-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); } }
.drawer-foot { padding: 14px 24px; border-top: 1px solid var(--gray-100); }

.menu-wrap { position: relative; display: inline-flex; }
.menu { position: fixed; z-index: 70; min-width: 224px; max-width: calc(100vw - 16px); overflow-y: auto; overscroll-behavior: contain; padding: 4px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); animation: pop .14s ease-out; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 10px; border-radius: var(--radius); font-size: 13px; color: var(--gray-700); text-align: left; }
.menu-item:hover { background: var(--gray-100); }
.menu-item.is-disabled { cursor: not-allowed; color: var(--gray-400); } .menu-item.is-disabled:hover { background: none; }
.menu-item .menu-hint { display: block; margin-top: 1px; font-size: 11px; color: var(--muted); white-space: normal; max-width: 220px; }
.menu-item svg { width: 16px; height: 16px; color: var(--gray-400); }
.menu-item.danger { color: var(--red-600); } .menu-item.danger svg { color: var(--red-500); } .menu-item.danger:hover { background: var(--red-50); }
.menu-item:disabled { opacity: .4; cursor: not-allowed; }
.menu-head { padding: 6px 10px 8px; border-bottom: 1px solid var(--gray-100); margin-bottom: 4px; }
.menu-label { padding: 6px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--gray-400); }
.menu-divider { height: 1px; background: var(--gray-100); margin: 4px 0; }
.tooltip { position: fixed; z-index: 90; max-width: min(260px, calc(100vw - 16px)); overflow-wrap: anywhere; padding: 6px 8px; border-radius: 6px; background: var(--gray-900); color: #fff; font-size: 12px; line-height: 1.35; pointer-events: none; box-shadow: var(--shadow-pop); }
.tooltip strong { display: block; margin-bottom: 2px; }
.help { cursor: help; border-bottom: 1px dashed var(--gray-300); }

.menu:has(> .notif-panel) { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.menu:has(> .notif-panel)[hidden] { display: none; }
.notif-panel { display: flex; flex-direction: column; width: 380px; max-width: calc(100vw - 18px); min-height: 0; max-height: 100%; padding: 0; }
.notif-panel > * { flex-shrink: 0; }
.notif-panel .notif-list { flex: 1 1 auto; min-height: 0; max-height: 420px; overflow-y: auto; overscroll-behavior: contain; }
.notif-item .min-w-0 { overflow-wrap: anywhere; }
.notif-item { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 12px 16px; border-bottom: 1px solid var(--gray-50); text-align: left; }
.notif-item:hover { background: var(--gray-50); }
.notif-item.unread { background: color-mix(in srgb, var(--brand-50) 40%, #fff); }
.notif-icon { width: 32px; height: 32px; border-radius: 99px; display: grid; place-items: center; flex-shrink: 0; }
.notif-icon svg { width: 16px; height: 16px; }
.unread-dot { width: 6px; height: 6px; border-radius: 99px; background: var(--brand-500); display: inline-block; }

/* Toasts */
.toasts { position: fixed; right: 24px; bottom: 24px; z-index: 95; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); overflow: hidden; pointer-events: none; }
.toast { pointer-events: auto; flex-shrink: 0; display: flex; align-items: flex-start; gap: 12px; width: 360px; max-width: calc(100vw - 32px); min-width: 0; padding: 14px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); animation: pop .16s ease-out; }
.toast svg.icon { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.toast .t-title { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.toast .t-desc { margin-top: 2px; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; max-height: 7.5em; overflow-y: auto; }
.toast .t-close { margin-left: auto; flex-shrink: 0; display: grid; place-items: center; width: 24px; height: 24px; margin: -3px -3px 0 auto; border-radius: 6px; color: var(--gray-400); }
.toast.leaving { opacity: 0; transition: opacity .15s; } .toast .t-close:hover { color: var(--gray-700); }
.toast .t-close svg { width: 16px; height: 16px; }
.toast-success svg.icon { color: var(--green-500); } .toast-error svg.icon { color: var(--red-500); } .toast-info svg.icon { color: var(--blue-500); } .toast-warning svg.icon { color: var(--amber-500); }
@media (max-width: 639px) {
  /* Just below the topbar: never covers the header controls (Check In/Out, bell) or bottom-sheet buttons. */
  .toasts { left: 12px; right: 12px; top: calc(var(--topbar-h) + 8px + env(safe-area-inset-top)); bottom: auto; align-items: stretch; flex-direction: column-reverse; max-height: calc(100dvh - var(--topbar-h) - 24px); }
  .toast { width: auto; max-width: none; }
}

/* Command palette */
.palette { position: fixed; inset: 0; z-index: 80; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 0; padding: 12dvh 16px 0; }
.palette-box { position: relative; display: flex; flex-direction: column; max-height: 76vh; max-height: 76dvh; width: 100%; max-width: 576px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-pop); overflow: hidden; animation: pop .16s ease-out; }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--gray-100); }
.palette-input svg { width: 18px; height: 18px; color: var(--gray-400); }
.palette-input input { flex: 1; height: 48px; border: 0; font-size: 15px; outline: none; }
.palette-results { flex: 1 1 auto; min-height: 0; max-height: 60vh; overflow-y: auto; overscroll-behavior: contain; padding: 8px; }
.palette-group { padding: 8px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--gray-400); }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--radius); }
.palette-item.on { background: var(--gray-100); }
.palette-item .ic { width: 28px; height: 28px; border: 1px solid var(--border); border-radius: 6px; display: grid; place-items: center; color: var(--gray-500); flex-shrink: 0; }
.palette-item .ic svg { width: 14px; height: 14px; }
.palette-foot { display: flex; gap: 16px; padding: 8px 16px; border-top: 1px solid var(--gray-100); background: var(--gray-50); font-size: 12px; color: var(--muted); }

/* ---------- Empty / skeleton ---------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 56px 24px; }
.empty.compact { padding: 32px 16px; }
.empty-icon { width: 44px; height: 44px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--gray-50); display: grid; place-items: center; color: var(--gray-400); margin-bottom: 12px; box-shadow: var(--shadow-card); }
.empty-icon svg { width: 20px; height: 20px; }
.empty-title { font-size: 14px; font-weight: 600; }
.empty-desc { margin-top: 4px; max-width: 380px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.empty .btn { margin-top: 16px; }
.skeleton { position: relative; overflow: hidden; border-radius: 6px; background: var(--gray-100); }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgb(255 255 255 / .6), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

/* ---------- Kanban ---------- */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 16px; scroll-snap-type: x proximity; }
.column { width: 296px; flex-shrink: 0; display: flex; flex-direction: column; border-radius: var(--radius-lg); background: color-mix(in srgb, var(--gray-100) 75%, #fff); scroll-snap-align: start; }
.column-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 8px; font-size: 13px; font-weight: 600; }
.column-head .count { font-size: 12px; font-weight: 400; color: var(--gray-400); }
.column-head .hours { margin-left: auto; font-size: 11px; font-weight: 400; color: var(--gray-400); }
.column-body { flex: 1; display: flex; flex-direction: column; gap: 8px; min-height: 120px; padding: 0 8px 8px; border-radius: 0 0 var(--radius-lg) var(--radius-lg); transition: background .15s; }
.column-body.over { background: color-mix(in srgb, var(--brand-50) 80%, #fff); box-shadow: inset 0 0 0 2px var(--brand-200); }
.column-empty { flex: 1; display: grid; place-items: center; border: 1px dashed var(--gray-300); border-radius: var(--radius); padding: 24px 0; font-size: 12px; color: var(--gray-400); }
.kcard { display: block; width: 100%; text-align: left; padding: 12px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 1px 2px rgb(16 24 40 / .05); cursor: pointer; transition: box-shadow .15s, border-color .15s; }
.kcard:hover { border-color: var(--gray-300); box-shadow: 0 2px 6px rgb(16 24 40 / .08); }
.kcard[draggable="true"] { cursor: grab; }
.kcard.dragging { opacity: .35; }
.kcard.drop-before { box-shadow: 0 -3px 0 0 var(--brand-500); }
.kcard-meta { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 11px; color: var(--gray-400); }
.kcard-title { font-size: 13px; font-weight: 500; line-height: 1.35; color: var(--gray-900); }
.kcard-foot { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 12px; }
.kcard-foot .stat-mini { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; color: var(--gray-400); }
.kcard-foot .stat-mini svg { width: 12px; height: 12px; }
.prio svg { width: 14px; height: 14px; }
.prio-low { color: var(--gray-400); } .prio-medium { color: var(--blue-500); } .prio-high { color: var(--orange-500); } .prio-urgent { color: var(--red-600); }
.due { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font-size: 13px; color: var(--gray-600); }
.due svg { width: 14px; height: 14px; }
.due.late { color: var(--red-600); font-weight: 500; } .due.today { color: var(--amber-700); font-weight: 500; }

/* ---------- Calendar ---------- */
.cal-head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--gray-100); text-align: center; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--gray-400); }
.cal-head > div { padding: 8px 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-cell { min-height: 112px; padding: 6px; border-right: 1px solid var(--gray-100); border-bottom: 1px solid var(--gray-100); min-width: 0; }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell.outside { background: var(--gray-50); }
.cal-cell.off { background: color-mix(in srgb, var(--gray-50) 60%, #fff); }
.cal-cell.can-add { cursor: pointer; } .cal-cell.can-add:hover { background: color-mix(in srgb, var(--brand-50) 40%, #fff); }
.cal-day { width: 24px; height: 24px; border-radius: 99px; display: grid; place-items: center; font-size: 12px; color: var(--gray-700); margin-bottom: 4px; }
.cal-cell.outside .cal-day { color: var(--gray-300); }
.cal-day.today { background: var(--brand-600); color: #fff; font-weight: 600; }
.cal-chip { display: flex; align-items: center; gap: 4px; width: 100%; margin-top: 2px; padding: 2px 6px; border-radius: 4px; font-size: 11px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.cal-chip.approved { color: #fff; }
.cal-chip.pending { border: 1px dashed currentColor; }
.cal-chip.holiday { background: var(--teal-100); color: var(--teal-800); }
.cal-chip.optional { background: var(--teal-50); color: var(--teal-700); box-shadow: inset 0 0 0 1px var(--teal-200); }
.cal-chip.offsat { color: var(--gray-400); box-shadow: inset 0 0 0 1px var(--gray-200); }
.cal-more { width: 100%; padding: 0 6px; font-size: 11px; font-weight: 500; color: var(--muted); text-align: left; }
.cal-more:hover { color: var(--gray-900); }
@media (max-width: 767px) { .cal-cell { min-height: 84px; padding: 3px; } .cal-chip { font-size: 10px; padding: 1px 3px; } }

/* ---------- Charts ---------- */
.chart { width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--font); font-size: 11px; fill: var(--gray-500); }
.chart .grid-line { stroke: #f1f2f4; }
.chart [data-tip] { cursor: default; }
.chart rect[data-tip]:hover, .chart path[data-tip]:hover { opacity: .85; }
.donut-wrap { display: flex; align-items: center; gap: 20px; }
.donut-wrap.stacked { flex-direction: column; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.donut-legend { flex: 1; width: 100%; min-width: 0; }
.donut-legend li { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 3px 0; }

/* ---------- Timeline ---------- */
.timeline { position: relative; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 8px; bottom: 8px; width: 1px; background: var(--gray-200); }
.tl-item { position: relative; display: flex; gap: 12px; }
.tl-item + .tl-item { margin-top: 16px; }
.tl-icon { position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 99px; display: grid; place-items: center; flex-shrink: 0; box-shadow: 0 0 0 4px #fff; }
.tl-icon svg { width: 16px; height: 16px; }
.tl-day { margin: 20px 0 12px; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--gray-400); }
.tl-day:first-child { margin-top: 0; }
.change { border-radius: 4px; background: var(--gray-100); padding: 1px 6px; font-size: 11px; color: var(--gray-600); }

/* ---------- Gantt ---------- */
.gantt { min-width: 760px; }
.gantt-row { display: flex; align-items: center; height: 36px; border-bottom: 1px solid var(--gray-50); }
.gantt-label { width: 220px; flex-shrink: 0; padding-right: 12px; font-size: 13px; color: var(--gray-700); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.gantt-track { position: relative; flex: 1; height: 100%; }
.gantt-bar { position: absolute; top: 8px; height: 20px; border-radius: 6px; }
.gantt-bar.late { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--red-500); }
.gantt-today { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--red-500); z-index: 2; }

/* ---------- Login ---------- */
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 40px 16px; background: var(--gray-50); }
.auth-card { width: 100%; max-width: 420px; padding: 32px; background: #fff; border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 1px 2px rgb(16 24 40 / .04), 0 12px 32px -12px rgb(16 24 40 / .12); }
.auth-brand { margin-bottom: 28px; }
.auth-brand img { display: block; height: 40px; width: auto; }
.auth-foot { font-size: 12px; color: var(--gray-500); text-align: center; }
@media (max-width: 479px) { .auth-card { padding: 24px 20px; } }
.demo-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-lg); text-align: left; transition: border-color .15s, background .15s; }
.demo-btn:hover { border-color: var(--brand-300); background: color-mix(in srgb, var(--brand-50) 40%, #fff); }
.or-line { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--gray-400); }
.or-line::before, .or-line::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ---------- Misc components ---------- */
/* Holidays list: cards in a 3 / 2 / 1 column grid */
.holiday-grid { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 16px; }
.holiday-card { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.holiday-card.is-past > :not(.menu-wrap) { opacity: .6; }
.dot-sep { display: inline-block; margin: 0 10px; }
.holiday-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.pill-days { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; background: var(--brand-50); color: var(--brand-700); font-size: 11px; font-weight: 600; line-height: 18px; }
@media (max-width: 1199px) { .holiday-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 639px) { .holiday-grid { grid-template-columns: minmax(0, 1fr); padding: 12px; } }
.date-tile { width: 44px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; padding: 2px 0; }
.date-tile .m { font-size: 10px; font-weight: 600; text-transform: uppercase; color: var(--red-500); }
.date-tile .d { font-size: 16px; font-weight: 600; line-height: 1.2; }
.desc-list { display: grid; gap: 16px 24px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.desc-list.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.desc-list dt { font-size: 12px; font-weight: 500; color: var(--muted); }
.desc-list dd { margin-top: 4px; font-size: 14px; color: var(--gray-900); word-break: break-word; }
@media (max-width: 639px) { .desc-list, .desc-list.cols-3 { grid-template-columns: minmax(0, 1fr); } }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 13px; }
.kv > :first-child { color: var(--muted); } .kv > :last-child { font-weight: 500; color: var(--gray-900); text-align: right; font-variant-numeric: tabular-nums; }
.kv.strong > * { font-weight: 600; color: var(--gray-900); }
.summary-box { border: 1px solid var(--border); border-radius: var(--radius-lg); background: color-mix(in srgb, var(--gray-50) 60%, #fff); padding: 16px; }
.info-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: #fff; font-size: 13px; color: var(--gray-600); box-shadow: var(--shadow-card); }
.info-bar svg { width: 16px; height: 16px; color: var(--gray-400); flex-shrink: 0; }
.notice { border-radius: var(--radius); padding: 10px 12px; font-size: 13px; }
.notice-amber { background: var(--amber-50); color: var(--amber-800); border: 1px solid var(--amber-200); }
.notice-gray { background: var(--gray-50); color: var(--gray-600); }
.save-bar { position: sticky; bottom: 16px; z-index: 10; display: none; align-items: center; justify-content: space-between; gap: 12px; margin-top: 24px; padding: 12px 16px; background: rgb(255 255 255 / .96); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); animation: pop .16s ease-out; }
.save-bar.show { display: flex; }
.settings-section { display: grid; gap: 16px 40px; grid-template-columns: 280px minmax(0, 1fr); padding: 24px 0; border-bottom: 1px solid var(--gray-100); }
.settings-section:first-child { padding-top: 0; } .settings-section:last-child { border-bottom: 0; padding-bottom: 0; }
.settings-section h3 { font-size: 14px; font-weight: 600; } .settings-section > div:first-child p { margin-top: 4px; font-size: 13px; color: var(--muted); }
.settings-section > div:last-child > * + * { margin-top: 16px; }
@media (max-width: 1023px) { .settings-section { grid-template-columns: minmax(0, 1fr); } }
.day-toggles { display: flex; flex-wrap: wrap; gap: 8px; }
.day-toggles label { height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius); display: inline-flex; align-items: center; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; }
.day-toggles label:has(input:checked) { border-color: var(--brand-500); background: var(--brand-50); color: var(--brand-700); }
.day-toggles input { display: none; }
.week-grid { display: grid; gap: 8px; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.week-grid label { padding: 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--gray-50); text-align: center; cursor: pointer; }
.week-grid label:has(input:checked) { border-color: var(--brand-500); background: var(--brand-50); }
.week-grid input { display: none; }
.week-grid .state::after { content: "Holiday"; font-size: 12px; color: var(--muted); }
.week-grid label:has(input:checked) .state::after { content: "Working"; color: var(--brand-700); }
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px; border-radius: var(--radius); background: var(--gray-50); font-size: 12px; color: var(--gray-600); }
.chip-link { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border: 1px solid var(--border); border-radius: 99px; font-size: 13px; color: var(--gray-800); }
.chip-link:hover { border-color: var(--gray-300); }
.profile-cover { height: 80px; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.profile-head { display: flex; align-items: flex-end; gap: 16px; margin-top: -40px; flex-wrap: wrap; }
.profile-head .avatar { box-shadow: 0 0 0 4px #fff; }
.code-badge { width: 36px; height: 36px; border-radius: var(--radius); display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.code-badge.sm { width: 28px; height: 28px; font-size: 10px; border-radius: 6px; }
.icon-tile { width: 40px; height: 40px; border-radius: var(--radius-lg); display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.icon-tile svg { width: 20px; height: 20px; }
.ico { width: 16px; height: 16px; flex-shrink: 0; }
.ico-sm { width: 14px; height: 14px; flex-shrink: 0; }
.ico-xs { width: 12px; height: 12px; flex-shrink: 0; }
.dropzone { display: flex; flex-direction: column; align-items: center; padding: 24px; border: 2px dashed var(--gray-200); border-radius: var(--radius-lg); font-size: 13px; color: var(--muted); text-align: center; }
.dropzone.over { border-color: var(--brand-400); background: color-mix(in srgb, var(--brand-50) 50%, #fff); }
.file-pick { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border: 1px dashed var(--gray-300); border-radius: var(--radius); font-size: 13px; color: var(--muted); cursor: pointer; }
.file-pick:hover { border-color: var(--gray-400); background: var(--gray-50); }
.file-pick input { display: none; }
.perm-table td, .perm-table th { text-align: center; }
.perm-table td:first-child, .perm-table th:first-child { text-align: left; }
.perm-group td { background: var(--gray-50) !important; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 8px 20px; }
.callout-dashed { border: 1px dashed var(--gray-300); border-radius: var(--radius); padding: 16px; text-align: center; font-size: 13px; color: var(--muted); }

.print-only { display: none; }
@media print {
  .sidebar, .topbar, .no-print, .toasts { display: none !important; }
  .print-only { display: block !important; }
  .shell { padding-left: 0 !important; }
  .main { padding: 0; max-width: none; }
  .card { box-shadow: none; break-inside: avoid; }
  body { background: #fff; }
}

/* Workload */
.workload-list details > summary { list-style: none; cursor: pointer; }
.workload-list details > summary::-webkit-details-marker { display: none; }
.workload-row { display: grid; grid-template-columns: 220px minmax(0, 1fr) repeat(3, 56px) 110px; align-items: center; gap: 8px 24px; padding: 14px 20px; }
.workload-row:hover { background: var(--gray-50); }
.workload-row > .badge { justify-self: end; }
.workload-bar .track { position: relative; height: 10px; border-radius: 999px; background: var(--gray-100); overflow: hidden; }
.workload-bar .fill { height: 100%; border-radius: 999px; background: var(--gray-400); transition: width .3s; }
.workload-bar .fill.green, .level-green { background: var(--green-500); } .workload-bar .fill.amber, .level-amber { background: var(--amber-500); }
.workload-bar .fill.red, .level-red { background: var(--red-500); } .workload-bar .fill.gray, .level-gray { background: var(--gray-400); }
.workload-bar .mark { position: absolute; top: 0; bottom: 0; border-left: 1px dashed var(--gray-400); }
.wl-stat { text-align: center; } .wl-stat strong { display: block; font-size: 14px; font-variant-numeric: tabular-nums; } .wl-stat span { font-size: 11px; color: var(--muted); }
.workload-tasks { background: var(--gray-25, var(--gray-50)); padding: 12px 20px; border-top: 1px solid var(--gray-100); }
.task-chip { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface, #fff); font-size: 13px; text-align: left; }
.task-chip:hover { border-color: var(--gray-300); }
@media (max-width: 767px) {
  .workload-row { grid-template-columns: minmax(0, 1fr) auto; }
  .workload-row .workload-bar { grid-column: 1 / -1; order: 3; }
  .workload-row .wl-stat { display: none; }
}
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* Settings */
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group .addon { display: inline-flex; align-items: center; padding: 0 10px; border: 1px solid var(--border); border-left: 0; border-radius: 0 var(--radius) var(--radius) 0; background: var(--gray-50); font-size: 13px; color: var(--muted); white-space: nowrap; }
.sat-editor { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; }
.sat-editor > * + * { margin-top: 16px; }
.sat-weeks { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.sat-weeks[hidden] { display: none; }
.sat-week { display: block; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--gray-50); text-align: center; cursor: pointer; }
.sat-week input { display: none; }
.sat-week .t { display: block; font-size: 13px; font-weight: 500; color: var(--gray-900); }
.sat-week .s { display: block; font-size: 12px; color: var(--muted); }
.sat-week .s::after { content: "Off"; }
.sat-week:has(input:checked) { border-color: var(--brand-500); background: var(--brand-50); }
.sat-week:has(input:checked) .s { color: var(--brand-700); }
.sat-week:has(input:checked) .s::after { content: "Working"; }
.group-row td { background: var(--gray-50); font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding-top: 8px; padding-bottom: 8px; }
.diff-old { padding: 2px 6px; border-radius: 4px; background: var(--red-50); color: var(--red-700, var(--red-600)); text-decoration: line-through; }
.diff-new { padding: 2px 6px; border-radius: 4px; background: var(--green-50); color: var(--green-700, var(--green-600)); }
a.stat:hover { border-color: var(--gray-300); }
.stat-on { border-color: var(--brand-400, var(--brand-500)); box-shadow: 0 0 0 3px var(--brand-50); }
@media (max-width: 639px) { .sat-weeks { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Attendance summary */
.att-summary { display: grid; gap: 16px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1279px) { .att-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 639px) { .att-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
.card .att-summary .stat { box-shadow: none; background: var(--gray-25); }

/* Segmented controls never widen the page on small screens: they scroll sideways inside themselves. */
.seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg > button, .seg > a, .seg > label { flex-shrink: 0; }

/* Task timer */
.timer-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--gray-25); }
.timer-main { min-width: 0; }
.timer-display { font-size: 26px; font-weight: 600; letter-spacing: .02em; color: var(--gray-900); line-height: 1.2; }
.timer-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.timer-live { display: inline-flex; align-items: center; gap: 6px; padding: 1px 8px; border-radius: 99px; background: var(--green-50); color: var(--green-700); font-size: 11px; font-weight: 500; }
.timer-live .att-dot { width: 6px; height: 6px; }
.timer-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.timer-note { flex-basis: 100%; display: flex; align-items: center; gap: 6px; color: var(--amber-700); }
@media (max-width: 479px) { .timer-actions { width: 100%; } .timer-actions .btn { flex: 1; justify-content: center; } }
.sessions summary { cursor: pointer; padding: 10px 16px; color: var(--brand-700); border-top: 1px solid var(--gray-100); }
.sessions ul { border-top: 1px solid var(--gray-100); max-height: 260px; overflow-y: auto; }
.session-row { display: grid; grid-template-columns: minmax(60px, auto) minmax(0, 1fr) auto auto; align-items: center; gap: 8px 12px; padding: 8px 16px; font-size: 12px; border-top: 1px solid var(--gray-50); }
.session-row:first-child { border-top: 0; }
@media (max-width: 479px) { .session-row { grid-template-columns: minmax(0, 1fr) auto; } }

/* Comment attachments */
.comment-body { white-space: pre-line; overflow-wrap: anywhere; }
.comment-files, .attach-list { display: grid; gap: 6px; margin-top: 8px; }
.comment-file, .attach-item { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.cf-icon { position: relative; flex-shrink: 0; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 6px; background: var(--gray-100); color: var(--gray-500); }
.cf-icon svg { width: 18px; height: 18px; }
.cf-icon span { position: absolute; bottom: -4px; right: -6px; padding: 0 3px; border-radius: 3px; background: var(--gray-700); color: #fff; font-size: 8px; font-weight: 600; line-height: 12px; max-width: 34px; overflow: hidden; }
.cf-thumb { flex-shrink: 0; display: block; width: 56px; height: 56px; border-radius: 6px; overflow: hidden; background: var(--gray-100); }
.cf-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cf-meta { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.cf-name { font-size: 13px; font-weight: 500; color: var(--gray-800); overflow-wrap: anywhere; word-break: break-word; line-height: 1.35; }
.cf-size { font-size: 11px; color: var(--muted); }
.cf-actions { display: flex; flex-shrink: 0; gap: 2px; }
.attach-item.invalid { border-color: var(--red-200, #fecaca); background: var(--red-50); }
.attach-item .cf-size.err { color: var(--red-600); }
.cf-ext { font-size: 9px; font-weight: 700; color: var(--gray-600); letter-spacing: .02em; }
.stat-mini.tracking { color: var(--green-700); } .stat-mini.tracking svg { color: var(--green-500); }
.session-row .badge { justify-self: start; }

/* Header: running task timer */
.task-timer-chip-wrap { display: flex; flex-shrink: 0; }
.task-timer-chip-wrap:empty { display: none; }
.task-timer-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 1px solid var(--green-200, #bbf7d0); border-radius: var(--radius); background: var(--green-50); color: var(--green-800, var(--green-700)); font-size: 12px; font-weight: 600; white-space: nowrap; }
.task-timer-chip:hover { border-color: var(--green-500); }
.task-timer-chip .ttc-key { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 500; }
.task-timer-chip .ttc-cam.on { color: var(--green-600); } .task-timer-chip .ttc-cam.off { color: var(--amber-600, var(--amber-700)); }
@media (max-width: 1023px) { .task-timer-chip .ttc-key { display: none; } }
@media (max-width: 479px) { .task-timer-chip [data-timer-display] { display: none; } .task-timer-chip { padding: 0 8px; } }

/* Capture window */
.capture-page { background: var(--gray-50); }
.capture-shell { max-width: 520px; margin: 0 auto; padding: 20px 16px; }
.capture-shell > * + * { margin-top: 16px; }
.capture-card { padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-card); }
.capture-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 13px; border-bottom: 1px solid var(--gray-100); }
.capture-row strong { text-align: right; overflow-wrap: anywhere; font-weight: 500; }
.capture-msg { margin-top: 10px; min-height: 1.2em; color: var(--gray-700); }
.capture-msg[data-tone="warn"] { color: var(--amber-700); } .capture-msg[data-tone="ok"] { color: var(--green-700); }
.capture-note { color: var(--muted); line-height: 1.55; }
.capture-note > * + * { margin-top: 6px; }

/* Task drawer: screenshot status */
.capture-line { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding-top: 10px; border-top: 1px solid var(--gray-100); font-size: 12px; color: var(--muted); }
.capture-line .ico-sm { width: 14px; height: 14px; }
.capture-line.on { color: var(--green-700); } .capture-line.warn { color: var(--amber-700); }

/* Admin screenshot grid */
.shot-head { padding: 10px 16px 0; }
.shot-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); padding: 16px; }
.shot-card { position: relative; min-width: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.shot-card:has(input:checked) { border-color: var(--brand-500); box-shadow: 0 0 0 3px var(--brand-50); }
.shot-check { position: absolute; top: 8px; left: 8px; z-index: 1; padding: 4px; border-radius: 6px; background: rgb(255 255 255 / .9); }
.shot-thumb { display: block; width: 100%; aspect-ratio: 16 / 9; background: var(--gray-100); overflow: hidden; }
.shot-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.shot-thumb:hover img { transform: scale(1.02); }
.shot-meta { padding: 10px 12px; min-width: 0; }
.shot-activity { display: grid; gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.shot-activity-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.shot-flags { display: grid; gap: 6px; }
.shot-flag { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; border-radius: 8px; font-size: 13px; line-height: 1.4; }
.shot-flag .ico-sm { flex-shrink: 0; margin-top: 2px; }
.shot-flag.critical { background: var(--red-50); color: var(--red-700); }
.shot-flag.warning { background: var(--amber-50); color: var(--amber-800); }
.shot-meters { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.shot-meter-track { height: 6px; margin-top: 6px; border-radius: 99px; background: var(--gray-100); overflow: hidden; }
.shot-meter-track span { display: block; height: 100%; border-radius: 99px; background: var(--brand-500); }
.shot-meta .sq { display: inline-block; vertical-align: middle; }
.shot-preview { display: block; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--gray-900); }
.shot-preview img { display: block; width: 100%; height: auto; max-height: 60vh; max-height: 60dvh; object-fit: contain; }
.shot-details { display: grid; gap: 10px 24px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: 16px; font-size: 13px; }
.shot-details dt { font-size: 12px; color: var(--muted); }
.shot-details dd { font-weight: 500; color: var(--gray-800); overflow-wrap: anywhere; }
.shot-activity .shot-counts { margin-top: 0; }
@media (max-width: 479px) { .shot-grid { grid-template-columns: minmax(0, 1fr); padding: 12px; } }
.formula { position: relative; max-width: 100%; }
.formula summary { cursor: pointer; list-style: none; } .formula summary::-webkit-details-marker { display: none; }
.formula-body { margin-top: 8px; max-width: 560px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--gray-700); line-height: 1.55; }
.formula-body > * + * { margin-top: 6px; }

/* Salary slip (HTML view, mirrors the PDF) */
.slip { max-width: 820px; margin: 0 auto; padding: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); color: var(--gray-900); }
.slip-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 40px; padding-bottom: 14px; border-bottom: 2px solid var(--brand-600); }
.slip-logo { max-height: 46px; max-width: 130px; object-fit: contain; }
.slip-company { font-size: 18px; font-weight: 700; }
.slip-company-block { min-width: 0; max-width: 100%; margin-left: auto; text-align: right; }
.slip-digital { margin-top: 14px; text-align: center; font-size: 12px; color: var(--muted); }
.slip-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 8px 24px; margin-top: 16px; padding: 14px 16px; background: var(--gray-50); border-radius: var(--radius); font-size: 13px; }
.slip-info > div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px; }
.slip-info dt { color: var(--muted); } .slip-info dd { font-weight: 600; overflow-wrap: anywhere; }
.slip-net { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; margin-top: 18px; padding: 14px 16px; border: 1px solid var(--brand-200, #c7d2fe); border-radius: var(--radius); background: var(--brand-50); }
.slip-net-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--brand-700); text-transform: uppercase; }
.slip-net-amount { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 639px) {
  .slip { padding: 16px; }
  .slip-info { grid-template-columns: minmax(0, 1fr); }
  .slip-info > div { grid-template-columns: 110px minmax(0, 1fr); }
  .slip-net-amount { font-size: 20px; }
}
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius); font-size: 13px; line-height: 1.5; }
.notice svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
.notice.warn { background: var(--amber-50); color: var(--amber-800, var(--amber-700)); border: 1px solid var(--amber-200, #fde68a); }
.notice.ok { background: var(--green-50); color: var(--green-700); border: 1px solid var(--green-200, #bbf7d0); }
.notice.err { background: var(--red-50); color: var(--red-700, var(--red-600)); border: 1px solid var(--red-200, #fecaca); }
.generate-preview { min-width: 0; }
.generate-layout { display: grid; gap: 20px; grid-template-columns: minmax(340px, 460px) minmax(0, 1fr); align-items: start; }
@media (max-width: 1023px) { .generate-layout { grid-template-columns: minmax(0, 1fr); } }
.list-row.on { background: var(--brand-50); }
.logo-box { width: 160px; height: 72px; display: grid; place-items: center; border: 1px dashed var(--border); border-radius: var(--radius); background: #fff; overflow: hidden; }
.logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.salary-figure { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Simple salary slip */
.basic-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: var(--radius); background: var(--gray-50); border: 1px solid var(--border); }
.carry-box { display: grid; gap: 10px; padding: 12px 14px; border-radius: var(--radius); background: var(--gray-50); border: 1px solid var(--border); }
.carry-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.carry-box .check.is-disabled { opacity: .65; }
.basic-value { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.month-table { border: 1px solid var(--border); border-radius: var(--radius); max-height: 380px; overflow-y: auto; }
.month-table tr.is-active td { background: var(--brand-50); }
.month-table td { vertical-align: middle; }
.month-pick { font-weight: 500; text-align: left; }
.slip-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 18px; }
.slip-title span { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-600); }
.slip-title strong { font-size: 18px; }
.slip-lines { width: 100%; margin-top: 18px; border-collapse: collapse; font-size: 14px; }
.slip-lines th { padding: 6px 0; font-size: 12px; font-weight: 600; color: var(--muted); text-align: left; border-bottom: 1px solid var(--border); }
.slip-lines td { padding: 12px 0; border-bottom: 1px solid var(--gray-100); vertical-align: top; }
.slip-lines td span { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.slip-lines .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.slip.is-preview { border-style: dashed; }
.preview-label { margin-bottom: 8px; }
.result-list { margin-top: 6px; display: grid; gap: 2px; }


.month-table th, .month-table td { padding-left: 6px; padding-right: 6px; }
.month-table .mt-num { width: 60px; } .month-table .mt-bonus { width: 86px; }
.month-table input { padding: 0 8px; min-width: 0; }
.month-pick { white-space: nowrap; }
.month-form .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Leave policy: written document (read view) and its editor. */
.policy-doc .card-body { padding: 28px 32px 32px; }
.prose { font-size: 14px; line-height: 1.7; color: var(--gray-700); overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose h2 { margin: 28px 0 10px; font-size: 20px; font-weight: 600; line-height: 1.3; color: var(--gray-900); }
.prose h3 { margin: 22px 0 8px; font-size: 16px; font-weight: 600; line-height: 1.4; color: var(--gray-900); }
.prose h4 { margin: 18px 0 6px; font-size: 14px; font-weight: 600; color: var(--gray-900); }
.prose p { margin: 0 0 12px; }
.prose ul, .prose ol { margin: 0 0 12px; padding-left: 24px; }
.prose ul { list-style: disc; } .prose ol { list-style: decimal; }
.prose li { margin: 4px 0; } .prose li > p { margin: 0; }
.prose blockquote { margin: 0 0 12px; padding: 10px 14px; border-left: 3px solid var(--brand-500, #5345e6); background: var(--gray-50); border-radius: 0 var(--radius) var(--radius) 0; color: var(--gray-700); }
.prose hr { margin: 20px 0; border: 0; border-top: 1px solid var(--border); }
.prose a { color: var(--brand-600, #4338ca); text-decoration: underline; text-underline-offset: 2px; }
.prose strong, .prose b { font-weight: 600; color: var(--gray-900); }
.rte { overflow: hidden; }
.rte-bar { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 8px 10px; background: var(--gray-50); border-bottom: 1px solid var(--border); }
.rte-block { height: 30px; padding: 0 28px 0 8px; margin-right: 2px; font-size: 13px; border: 1px solid var(--border); border-radius: var(--radius); background-color: #fff; }
.rte-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: var(--radius); color: var(--gray-600); }
.rte-btn:hover { background: var(--gray-100); color: var(--gray-900); }
.rte-btn.on { background: var(--brand-50, #eef2ff); color: var(--brand-600, #4338ca); }
.rte-btn .ico { width: 16px; height: 16px; }
.rte-sep { width: 1px; height: 20px; margin: 0 6px; background: var(--border); }
.rte-area { position: relative; min-height: 420px; max-height: 70vh; overflow-y: auto; padding: 24px 28px; outline: none; }
.rte-area:focus { box-shadow: inset 0 0 0 2px var(--brand-100, #e0e7ff); }
.rte-area:has(> p:only-child > br:only-child)::before { content: attr(data-placeholder); position: absolute; color: var(--gray-400); pointer-events: none; }
@media (max-width: 640px) { .policy-doc .card-body { padding: 20px 16px; } .rte-area { padding: 16px; } }

/* Date picker (replaces the browser's own date / month picker everywhere). */
.dp-trigger { display: inline-flex; align-items: center; gap: 8px; min-width: 150px; text-align: left; cursor: pointer; white-space: nowrap; }
.dp-trigger.input { display: flex; }
label > .dp-trigger.input, .toolbar .dp-trigger.input, span > .dp-trigger.input { display: inline-flex; width: auto; }
.dp-trigger .dp-ico { flex: none; width: 16px; height: 16px; color: var(--gray-400); }
.dp-trigger .dp-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--gray-900); }
.dp-trigger .dp-placeholder { color: var(--gray-400); }
.dp-trigger.open { border-color: var(--brand-500); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-500) 22%, transparent); }
.dp-trigger.open .dp-ico, .dp-trigger:hover .dp-ico { color: var(--brand-600); }
.dp-trigger:disabled { cursor: not-allowed; background: var(--gray-50); }
.dp-clear { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 18px; height: 18px; margin-right: -4px; border-radius: 999px; color: var(--gray-400); }
.dp-clear:hover { background: var(--gray-100); color: var(--gray-700); }
.dp-clear svg { width: 12px; height: 12px; }
.dp-panel { position: fixed; z-index: 70; width: 288px; max-width: calc(100vw - 16px); padding: 12px; overflow: auto; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); animation: pop .14s ease-out; user-select: none; }
.dp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.dp-title { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 8px; margin-left: -4px; border-radius: var(--radius); font-size: 14px; font-weight: 600; color: var(--gray-900); }
.dp-title:hover { background: var(--gray-100); }
.dp-caret { width: 14px; height: 14px; color: var(--gray-500); }
.dp-nav { display: flex; gap: 2px; }
.dp-icon { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: var(--radius); color: var(--gray-600); }
.dp-icon:hover { background: var(--gray-100); color: var(--gray-900); }
.dp-icon svg { width: 16px; height: 16px; }
.dp-week, .dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-week span { padding: 4px 0 6px; text-align: center; font-size: 11px; font-weight: 500; color: var(--gray-500); }
.dp-day { position: relative; height: 34px; border-radius: var(--radius); font-size: 13px; font-variant-numeric: tabular-nums; color: var(--gray-800); }
.dp-day:hover:not(:disabled):not(.sel) { background: var(--brand-50); color: var(--brand-700); }
.dp-day.out { color: var(--gray-400); }
.dp-day.sun:not(.sel):not(.out) { color: var(--gray-500); }
.dp-day.today:not(.sel) { font-weight: 600; color: var(--brand-600); }
.dp-day.today:not(.sel)::after { content: ''; position: absolute; left: 50%; bottom: 5px; width: 4px; height: 4px; margin-left: -2px; border-radius: 999px; background: var(--brand-500); }
.dp-day.sel { background: var(--brand-600); color: #fff; font-weight: 600; }
.dp-day:disabled { color: var(--gray-300); cursor: not-allowed; text-decoration: line-through; text-decoration-color: var(--gray-200); }
.dp-day:focus-visible, .dp-month:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 1px; }
.dp-months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 4px 0; }
.dp-month { height: 40px; border-radius: var(--radius); font-size: 13px; color: var(--gray-800); }
.dp-month:hover:not(:disabled):not(.sel) { background: var(--brand-50); color: var(--brand-700); }
.dp-month.today:not(.sel) { font-weight: 600; color: var(--brand-600); box-shadow: inset 0 0 0 1px var(--brand-200); }
.dp-month.sel { background: var(--brand-600); color: #fff; font-weight: 600; }
.dp-month:disabled { color: var(--gray-300); cursor: not-allowed; }
.dp-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--gray-100); }
.dp-link { height: 28px; padding: 0 10px; border-radius: var(--radius); font-size: 13px; font-weight: 500; color: var(--brand-600); }
.dp-link:hover:not(:disabled) { background: var(--brand-50); }
.dp-link:disabled { color: var(--gray-300); cursor: not-allowed; }
@media (max-width: 640px) { .dp-day { height: 38px; } }

/* Salary slip generation: months that couldn't be generated, grouped by reason. */
.form-error-box:has(> .slip-error) { display: block; padding: 0; border: 0; background: none; }
.slip-error { border: 1px solid var(--red-200); background: var(--red-50); border-radius: var(--radius); padding: 12px 14px; color: var(--red-700); font-size: 13px; }
.slip-error-head { display: flex; align-items: center; gap: 8px; }
.slip-error-head svg { flex: none; width: 16px; height: 16px; }
.slip-error-head strong { font-weight: 600; }
.slip-problems { display: grid; gap: 6px; margin: 10px 0 0; padding: 10px 0 0; border-top: 1px solid var(--red-200); list-style: none; }
.slip-problems li { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; align-items: baseline; line-height: 1.5; }
.slip-problem-month { padding: 1px 8px; border-radius: 999px; background: #fff; border: 1px solid var(--red-200); font-size: 12px; font-weight: 600; white-space: nowrap; }
@media (max-width: 520px) { .slip-problems li { grid-template-columns: 1fr; } .slip-problem-month { justify-self: start; } }
.slip-net-value { margin-left: auto; text-align: right; }
.slip-net-words { margin-top: 2px; font-size: 12px; color: var(--muted); }

/* Salary slip history: many money columns, so tighter cells keep it on screen without sideways scrolling. */
.slip-table th, .slip-table td { padding-left: 10px; padding-right: 10px; }
.slip-table th:first-child, .slip-table td:first-child { padding-left: 16px; }
.slip-table th:last-child, .slip-table td:last-child { padding-right: 16px; }
.slip-table th { white-space: normal; line-height: 1.3; }
.slip-table td.num { white-space: nowrap; }
.slip-table .th-sub { display: block; font-size: 11px; font-weight: 400; color: var(--gray-400); }
/* Medium screens: the generated date (also shown on the slip itself) makes room for the money columns. */
@media (max-width: 1400px) { .slip-table .col-generated { display: none; } }
/* Narrow screens: one card per slip instead of a wide table. */
@media (max-width: 1240px) {
  .slip-table thead { display: none; }
  .slip-table, .slip-table tbody, .slip-table tr, .slip-table td { display: block; width: 100%; }
  .slip-table tr { padding: 12px 16px; border-bottom: 1px solid var(--gray-100); }
  .slip-table tr:last-child { border-bottom: 0; }
  .slip-table td, .slip-table td:first-child, .slip-table td:last-child { padding: 3px 0; border: 0; text-align: left !important; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
  .slip-table td[data-label]::before { content: attr(data-label); font-size: 12px; color: var(--muted); flex-shrink: 0; }
  .slip-table td.primary { padding-bottom: 6px; } .slip-table td.primary::before { display: none; }
  .slip-table .col-generated { display: flex; }
  .slip-table td.actions { padding-top: 8px; } .slip-table td.actions > div { justify-content: flex-start; }
  .slip-table tbody tr:hover td { background: transparent; }
}
.hike-now { padding: 12px 14px; border-radius: var(--radius); background: var(--gray-50); border: 1px solid var(--gray-100); }
.basic-value.is-multi { font-size: 15px; line-height: 1.4; }

/* Time picker (replaces the browser's own, like the date picker). */
.tp-trigger { min-width: 130px; }
.tp-panel { position: fixed; z-index: 70; width: 248px; max-width: calc(100vw - 16px); padding: 12px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); animation: pop .14s ease-out; user-select: none; }
.tp-head { display: flex; align-items: baseline; justify-content: center; gap: 6px; padding: 2px 0 10px; border-bottom: 1px solid var(--gray-100); }
.tp-big { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--gray-900); }
.tp-ampm { font-size: 13px; font-weight: 600; color: var(--brand-600); }
.tp-labels { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; padding: 8px 2px 2px; font-size: 11px; font-weight: 500; color: var(--gray-500); text-align: center; }
.tp-cols { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.tp-col { display: flex; flex-direction: column; gap: 2px; max-height: 196px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: 2px; }
.tp-col + .tp-col { border-left: 1px solid var(--gray-100); padding-left: 6px; }
.tp-opt { flex: none; height: 32px; border-radius: var(--radius); font-size: 13px; font-variant-numeric: tabular-nums; color: var(--gray-700); }
.tp-opt:hover:not(.sel) { background: var(--brand-50); color: var(--brand-700); }
.tp-opt.sel { background: var(--brand-600); color: #fff; font-weight: 600; }
.tp-opt:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 1px; }

/* Productivity → Apps & websites: share of app time per category. */
.app-split { display: flex; height: 10px; overflow: hidden; border-radius: 999px; background: var(--gray-100); gap: 2px; }
.app-split span { display: block; height: 100%; }
.seg-productive { background: #1baf7a; } .seg-neutral { background: #9ca3af; } .seg-unproductive { background: #e5484d; }
.app-split-legend .sq { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* Header: idle time already taken off the worked time. */
.att-idle { font-size: 12px; color: var(--amber-600, #d97706); white-space: nowrap; }
@media (max-width: 640px) { .att-idle { display: none; } }
