/* Work sheets – Railtek. Same look as the existing Work sheets (blue sidebar, grey title bar,
   blue table headers, white cards). Poppins for headings/nav/numbers/buttons, Inter for body.
   Signal colours for status: green = approved, yellow = awaiting, red = rejected. */
:root {
  --blue: #3b82f6;
  --blue-dark: #2563eb;
  --blue-darker: #1d4ed8;
  --blue-soft: #eff6ff;
  --blue-line: #93c5fd;
  --blue-ring: rgba(59, 130, 246, .28);
  --navy: #0f1d3d;          /* nav text on blue: AA-compliant */
  --navy-accent: #1e3a8a;
  --bg: #f6f8fb;
  --head-bg: #e2e8f0;
  --paper: #ffffff;
  --ink: #0f172a;
  --ink-2: #334155;
  --steel: #64748b;
  --placeholder: #94a3b8;
  --border: #e5e7eb;
  --border-strong: #cbd5e1;
  --rail: #e5e7eb;
  --rail-2: #eef1f5;
  --zebra: #f8fafc;
  --track: var(--blue);
  --track-soft: var(--blue-soft);
  --go: #16a34a;
  --go-ink: #166534;
  --go-soft: #dcfce7;
  --wait: #92400e;
  --wait-bg: #f59e0b;
  --wait-soft: #fef3c7;
  --stop: #dc2626;
  --stop-ink: #b91c1c;
  --stop-soft: #fee2e2;
  --font: "Inter", "Inter var", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-head: "Poppins", "Inter", "Segoe UI", system-ui, sans-serif;
  --font-cond: var(--font-head);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 12px rgba(15, 23, 42, .05);
  --shadow-lg: 0 24px 64px rgba(15, 23, 42, .28);
  --ease: 140ms ease;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue-dark); text-underline-offset: 2px; }
a:hover { color: var(--blue-darker); }
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; line-height: 1.25; margin: 0; letter-spacing: -.005em; color: var(--ink); }
h1 { font-size: 23px; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--steel); }
.small { font-size: 13px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
::placeholder { color: var(--placeholder); opacity: 1; }
::selection { background: #bfdbfe; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---------- Frame: blue sidebar as in the old Work sheets ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side {
  background: var(--blue); color: var(--navy);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; padding: 16px 12px 12px;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .35) transparent;
}
.brand { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 0 20px; }
.brand img { width: 124px; height: auto; }
.brand b { color: #fff; font-family: var(--font-head); font-size: 14px; font-weight: 600; letter-spacing: .02em; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-link {
  position: relative;
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 8px 12px; border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--navy); font-family: var(--font-head); font-weight: 500; font-size: 14px; line-height: 1.3;
  text-align: left; cursor: pointer; text-decoration: none;
}
.nav-link:hover { background: rgba(255, 255, 255, .2); color: var(--navy); transition: background-color var(--ease); }
.nav-link svg { width: 18px; height: 18px; flex: none; }
.nav-link .chev { width: 14px; height: 14px; margin-left: -4px; margin-right: -4px; opacity: .8; }
.nav-link[aria-current="page"] {
  background: #fff; color: var(--navy-accent); font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .12), 0 2px 8px rgba(15, 23, 42, .08);
}
.nav-link[aria-current="page"]::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--navy-accent);
}
.nav-head { font-weight: 600; }
.nav-head[aria-expanded="true"] { color: var(--navy); }
.nav-sub { margin-left: 22px; width: calc(100% - 22px); padding-left: 12px; font-weight: 500; font-size: 13.5px; min-height: 36px; }
.nav-sub::after { content: ""; position: absolute; left: -10px; top: -1px; bottom: -1px; width: 1px; background: rgba(15, 29, 61, .2); }
.nav-sub[aria-current="page"]::after { background: rgba(15, 29, 61, .2); }
.nav-group .nav-sub:last-child { margin-bottom: 4px; }
.nav-link .badge { margin-left: auto; }
.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .3); }
.side-foot .who { padding: 0 12px 8px; font-size: 12px; color: #e0ecff; line-height: 1.4; }
.side-foot .who b { display: block; color: #fff; font-family: var(--font-head); font-weight: 600; font-size: 13.5px; }
.mobile-top { display: none; }
.drawer-scrim { display: none; }
.demo-banner { position: sticky; top: 0; z-index: 75; height: 32px; }
.demo-banner + .app .side { top: 32px; height: calc(100vh - 32px); }
.nav-link span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { min-width: 0; padding: 16px 24px 64px; }
/* Grey title bar as in the old Work sheets */
.page-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap;
  background: var(--head-bg); border-radius: var(--radius); padding: 14px 24px; margin-bottom: 24px; min-height: 64px;
}
.page-head h1 { font-size: 23px; }
.page-head p { margin: 2px 0 0; color: var(--steel); font-size: 13.5px; }
.toolbar { display: flex; gap: 8px 12px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }

.badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 10px;
  background: #fff; color: var(--blue-darker); font-family: var(--font); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.main .badge { background: var(--wait-bg); color: #422006; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 264px; max-width: 85vw; z-index: 70; transform: translateX(-100%); transition: transform .2s ease; box-shadow: none; }
  .drawer-open .side { transform: none; box-shadow: 0 0 40px rgba(15, 23, 42, .3); }
  .drawer-open .drawer-scrim { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .4); z-index: 65; }
  .demo-banner { position: static; height: auto; }
  .demo-banner + .app .side { top: 0; height: 100vh; }
  .mobile-top { display: flex; align-items: center; gap: 12px; margin: -8px -12px 12px; padding: 8px 12px; min-height: 54px; background: var(--blue); color: #fff; position: sticky; top: 0; z-index: 40; }
  .mobile-top b { font-family: var(--font-head); font-weight: 600; font-size: 16px; }
  .hamburger { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; border: 0; border-radius: var(--radius-sm); background: rgba(255, 255, 255, .16); color: #fff; cursor: pointer; }
  .hamburger:hover { background: rgba(255, 255, 255, .26); }
  .hamburger svg { width: 22px; height: 22px; }
  .main { padding: 8px 12px 64px; }
  .page-head { padding: 12px 16px; margin-bottom: 16px; min-height: 56px; }
  .page-head h1 { font-size: 19px; }
}

/* ---------- Building blocks ---------- */
.panel, .card { background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.panel-pad { padding: 20px 24px; }
.panel > h2:first-child, .panel > h3:first-child, .panel-pad > h2:first-child, .panel-pad > h3:first-child { margin-bottom: 12px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: #fff; color: var(--ink-2); font-family: var(--font-head); font-weight: 500; font-size: 14px; line-height: 1;
  cursor: pointer; white-space: nowrap; text-decoration: none; user-select: none;
}
.btn:hover { background: #f8fafc; border-color: #94a3b8; color: var(--ink); transition: background-color var(--ease), border-color var(--ease), color var(--ease); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--blue-ring); border-color: var(--blue); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn:disabled:hover { background: #fff; border-color: var(--border-strong); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 1px 2px rgba(37, 99, 235, .25); }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }
.btn-primary:active { background: var(--blue-darker); border-color: var(--blue-darker); }
.btn-primary:disabled:hover { background: var(--blue); border-color: var(--blue); }
.btn-outline { background: #fff; border-color: var(--blue-line); color: var(--blue-dark); }
.btn-outline:hover { background: var(--blue-soft); border-color: var(--blue); color: var(--blue-darker); }
.btn-go { background: var(--go); border-color: var(--go); color: #fff; }
.btn-go:hover { background: #15803d; border-color: #15803d; color: #fff; }
.btn-stop { color: var(--stop-ink); border-color: #fca5a5; background: #fff; }
.btn-stop:hover { background: var(--stop-soft); border-color: var(--stop); color: #991b1b; }
.btn-ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn-ghost:hover { background: rgba(100, 116, 139, .1); border-color: transparent; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13.5px; gap: 6px; }
.btn-sm svg { width: 15px; height: 15px; }
.btn-icon { width: 38px; padding: 0; }
.btn-sm.btn-icon { width: 32px; }
.btn-block { width: 100%; }
.btn-ms { background: #fff; border-color: var(--border-strong); width: 100%; height: 42px; }
.btn-ms img, .btn-ms svg { width: 18px; height: 18px; }
.bulkbar .btn:not(.btn-primary):not(.btn-go):not(.btn-stop) { background: rgba(255, 255, 255, .12); color: #fff; }
.bulkbar .btn:not(.btn-primary):not(.btn-go):not(.btn-stop):hover { background: rgba(255, 255, 255, .22); }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 13.5px; font-weight: 500; color: var(--ink-2); line-height: 1.3; }
.field .hint { font-size: 12px; color: var(--steel); font-weight: 400; font-style: normal; }
.input, select.input, textarea.input {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff;
  font-size: 14.5px; font-variant-numeric: tabular-nums; color: var(--ink);
}
select.input {
  appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
}
textarea.input { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:hover:not(:disabled):not(:focus) { border-color: #94a3b8; }
.input:focus { border-color: var(--blue); outline: 0; box-shadow: 0 0 0 3px var(--blue-ring); }
.input:disabled { background-color: #f1f5f9; color: var(--steel); cursor: not-allowed; }
.input[aria-invalid="true"], .input:user-invalid { border-color: var(--stop); }
.input[aria-invalid="true"]:focus, .input:user-invalid:focus { box-shadow: 0 0 0 3px rgba(220, 38, 38, .2); }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14.5px; }
.check input { width: 18px; height: 18px; accent-color: var(--blue); flex: none; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.span-2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.row-end { justify-content: flex-end; }
.spacer { flex: 1; }
@media (max-width: 600px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } .span-2 { grid-column: auto; } }

/* Status as the old pill tags (AA contrast) */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; line-height: 1.4; white-space: nowrap; padding: 2px 10px; border-radius: 999px; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-Approved { color: var(--go-ink); background: var(--go-soft); }
.status-Awaiting { color: var(--wait); background: var(--wait-soft); }
.status-Rejected { color: var(--stop-ink); background: var(--stop-soft); }

.note { padding: 12px 16px; border-radius: var(--radius-sm); background: var(--blue-soft); color: #1e40af; font-size: 14px; border: 1px solid #dbeafe; }
.note-stop { background: var(--stop-soft); color: #991b1b; border-color: #fecaca; }
.note-wait { background: var(--wait-soft); color: #92400e; border-color: #fde68a; }
.empty { padding: 40px 24px; text-align: center; color: var(--steel); }
.empty b { display: block; color: var(--ink); font-family: var(--font-head); font-weight: 600; font-size: 16px; margin-bottom: 4px; }

/* Tables with the blue header from the old Work sheets */
table.list { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; font-variant-numeric: tabular-nums; }
table.list th {
  position: sticky; top: 0; z-index: 1;
  text-align: left; font-weight: 600; font-size: 13px; letter-spacing: .01em; color: #fff; padding: 12px 16px; background: var(--blue); white-space: nowrap;
}
table.list thead th:first-child { border-top-left-radius: var(--radius-sm); }
table.list thead th:last-child { border-top-right-radius: var(--radius-sm); }
.panel table.list thead th:first-child, .card table.list thead th:first-child { border-top-left-radius: calc(var(--radius) - 1px); }
.panel table.list thead th:last-child, .card table.list thead th:last-child { border-top-right-radius: calc(var(--radius) - 1px); }
table.list td { padding: 11px 16px; height: 44px; border-bottom: 1px solid var(--rail-2); vertical-align: middle; color: var(--ink-2); }
table.list td:first-child { font-weight: 500; color: var(--ink); }
table.list tbody tr:nth-child(even) td { background: var(--zebra); }
table.list tbody tr:hover td { background: #f1f5f9; }
table.list tr:last-child td { border-bottom: 0; }
table.list td.num, table.list th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.list tr.clickable { cursor: pointer; }
table.list tr.clickable:hover td { background: var(--blue-soft); }
table.list tr.subtotal td { font-weight: 700; background: #f1f5f9; border-top: 1px solid var(--rail); color: var(--ink); }
table.list tr.total td { font-weight: 700; border-top: 2px solid var(--ink); color: var(--ink); }
.table-wrap { overflow-x: auto; max-width: 100%; }

/* Tabs like the old Daily/Weekly and Active/Archived */
.segmented { display: inline-flex; gap: 4px; border-bottom: 1px solid var(--rail); max-width: 100%; overflow-x: auto; }
.segmented button { border: 0; background: none; padding: 10px 14px; cursor: pointer; font-family: var(--font-head); font-weight: 500; font-size: 14px; color: var(--steel); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.segmented button:hover { color: var(--ink); }
.segmented button[aria-pressed="true"] { color: var(--blue-dark); border-bottom-color: var(--blue); }

/* ---------- Dialog ---------- */
.scrim { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 80; display: flex; align-items: center; justify-content: center; padding: 16px; }
.dialog { background: var(--paper); border-radius: 14px; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-shadow: var(--shadow-lg); }
.dialog-wide { width: min(780px, 100%); }
.dialog header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 16px 14px 24px; border-bottom: 1px solid var(--rail-2); position: sticky; top: 0; background: var(--paper); z-index: 2; }
.dialog header h2 { font-size: 18px; }
.dialog .body { padding: 20px 24px 8px; }
.dialog footer { display: flex; justify-content: flex-end; align-items: center; gap: 8px 12px; padding: 16px 24px 20px; flex-wrap: wrap; }
.dialog footer .left { margin-right: auto; }
@media (max-width: 600px) {
  .scrim { align-items: flex-end; padding: 0; }
  .dialog { border-radius: 16px 16px 0 0; max-height: 92vh; width: 100%; }
  .dialog header { padding: 14px 12px 12px 20px; }
  .dialog .body { padding: 16px 20px 8px; }
  .dialog footer { padding: 14px 20px 20px; }
}

.toast-wrap { position: fixed; right: 24px; bottom: 24px; z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: var(--radius-sm); box-shadow: 0 8px 24px rgba(15, 23, 42, .25); max-width: 380px; font-size: 14px; }
.toast-error { background: var(--stop-ink); }
@media (max-width: 900px) { .toast-wrap { left: 16px; right: 16px; bottom: 16px; } }

/* ---------- Login: same card as the old Work sheets ---------- */
.login, .login-form {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px;
  background: radial-gradient(1200px 600px at 50% -10%, #dbeafe 0%, rgba(219, 234, 254, 0) 60%), var(--bg);
}
.login-card, .login-form .box { width: min(420px, 100%); background: #fff; border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 2px 4px rgba(15, 23, 42, .04), 0 12px 32px rgba(15, 23, 42, .08); padding: 40px 36px 32px; }
.login-card { display: flex; flex-direction: column; gap: 14px; }
.login-card > .login-forgot { margin-top: -6px; }
.login-card .btn-primary { height: 42px; font-size: 15px; }
.login-card > p.small { margin: 4px 0 0; line-height: 1.5; }
.login-logo { display: block; width: 200px; max-width: 70%; margin: 0 auto 6px; }
.login-card h1, .login-form h1 { font-size: 26px; text-align: center; }
.login-sub { text-align: center; color: var(--steel); margin: -10px 0 8px; }
.login-forgot { display: flex; justify-content: flex-end; font-size: 13.5px; }
.login-forgot a, .login-forgot button { color: var(--blue-dark); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: none; font-weight: 500; }
.login-forgot a:hover, .login-forgot button:hover { text-decoration: underline; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--steel); font-size: 13px; margin: 4px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--rail); }
@media (max-width: 480px) { .login-card, .login-form .box { padding: 32px 22px 24px; } }

/* ---------- Summary ---------- */
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat-card { border: 1px solid var(--border); border-left: 4px solid var(--blue); padding: 16px 20px; box-shadow: var(--shadow); }
.stat-top { display: flex; align-items: center; gap: 8px; font-size: 14.5px; color: var(--ink-2); }
.stat-top svg { width: 18px; height: 18px; color: var(--blue); flex: none; }
.stat-top b { font-family: var(--font-head); font-size: 22px; font-weight: 600; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-card span { display: block; color: var(--steel); font-size: 13.5px; margin-top: 4px; }
.action-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-left-width: 4px; box-shadow: var(--shadow); }
.action-card h3, .action-card b { font-family: var(--font-head); font-weight: 600; font-size: 16px; }
.action-card p { margin: 2px 0 0; color: var(--steel); font-size: 14px; }
.action-card.warn { border-left-color: var(--wait-bg); }
.action-card.ok { border-left-color: var(--go); }
.grid-chart { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 16px; }
.chart-card { padding: 20px 24px; box-shadow: var(--shadow); }
.chart-card h3 { margin-bottom: 16px; }
.bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; height: 220px; align-items: end; border-bottom: 1px solid var(--rail); padding-top: 18px; }
.bar-col { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.bar-col i { display: block; width: 70%; max-width: 38px; background: var(--blue); border-radius: 4px 4px 0 0; min-height: 0; }
.bar-col:hover i { background: var(--blue-dark); }
.bar-val { font-size: 11.5px; font-weight: 500; color: var(--steel); margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.bar-label { position: absolute; bottom: -22px; font-size: 11.5px; color: var(--steel); }
.chart-card .bars { margin-bottom: 24px; }
.hbars { display: flex; flex-direction: column; gap: 12px; }
.hbar { display: grid; grid-template-columns: minmax(140px, 260px) 1fr 80px; gap: 16px; align-items: center; font-size: 14px; }
.hbar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.hbar-track { height: 10px; background: var(--rail-2); border-radius: 5px; overflow: hidden; }
.hbar-track i { display: block; height: 100%; background: var(--blue); border-radius: 5px; }
.hbar .num { text-align: right; font-weight: 600; color: var(--ink); }
@media (max-width: 1000px) { .cards { grid-template-columns: 1fr 1fr; } .grid-chart, .cards-2 { grid-template-columns: 1fr; } }
@media (max-width: 520px) {
  .cards { gap: 12px; }
  .stat-card { padding: 12px 14px; }
  .action-card { flex-direction: column; align-items: flex-start; }
  .hbar { grid-template-columns: 1fr 70px; } .hbar-track { display: none; }
  .bars { gap: 3px; }
  .bar-val { font-size: 10px; }
  .bar-label { font-size: 10px; }
}

/* ---------- Week sheet ---------- */
.week-head { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 16px; }
.week-no { font-family: var(--font-head); font-weight: 600; font-size: 30px; line-height: 1; letter-spacing: -.01em; }
.week-dates { color: var(--steel); font-size: 14px; }
.week-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
@media (max-width: 1180px) { .week-layout { grid-template-columns: 1fr; } }

.meter { padding: 16px 24px; display: grid; grid-template-columns: auto 1fr; gap: 8px 24px; align-items: center; box-shadow: var(--shadow); }
.meter .big { font-family: var(--font-head); font-size: 34px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.meter .big small { font-size: 17px; color: var(--steel); font-weight: 500; }
.meter-bar { position: relative; height: 10px; background: var(--rail-2); border-radius: 5px; overflow: hidden; display: flex; }
.meter-bar i { display: block; height: 100%; }
.meter-bar .seg-go { background: var(--go); }
.meter-bar .seg-wait { background: var(--wait-bg); }
.meter-legend { display: flex; gap: 8px 16px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--steel); }

.days { margin-top: 16px; overflow: hidden; box-shadow: var(--shadow); }
.day { display: grid; grid-template-columns: 118px 1fr 64px; align-items: stretch; border-bottom: 1px solid var(--rail-2); min-height: 62px; }
.day:last-child { border-bottom: 0; }
.day.weekend { background: #f9fafb; }
.day.today { background: linear-gradient(90deg, var(--blue-soft), rgba(239, 246, 255, 0) 30%); box-shadow: inset 3px 0 0 var(--blue); }
.day.today .day-label b { color: var(--blue-dark); }
.day-label { padding: 10px 16px; display: flex; flex-direction: column; justify-content: center; }
.day-label b { font-family: var(--font-head); font-weight: 600; font-size: 16px; line-height: 1.25; }
.day-label span { font-size: 12px; color: var(--steel); }
.day-label .holiday { color: var(--blue-dark); font-weight: 600; }
.day-sum { padding: 10px 16px 10px 0; display: flex; align-items: center; justify-content: flex-end; font-family: var(--font-head); font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.day-sum.zero { color: #b6c1ca; font-weight: 500; }

/* Timeline 06–20, registrations as blocks on the line */
.track { position: relative; margin: 10px 0; cursor: copy; border-radius: 6px; background:
  repeating-linear-gradient(to right, transparent 0, transparent calc(100% / 14 - 1px), var(--rail-2) calc(100% / 14 - 1px), var(--rail-2) calc(100% / 14)); }
.track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; background: var(--rail); }
.track.closed { cursor: default; }
.track-hours { display: grid; grid-template-columns: 118px 1fr 64px; font-size: 11.5px; color: var(--steel); padding-top: 10px; }
.track-hours div { position: relative; height: 16px; }
.track-hours span { position: absolute; transform: translateX(-50%); font-variant-numeric: tabular-nums; }
.train {
  position: absolute; top: 4px; bottom: 4px; border-radius: 6px; padding: 3px 8px; overflow: hidden;
  font-size: 12px; line-height: 1.3; cursor: pointer; border: 1px solid; text-align: left;
  display: flex; flex-direction: column; justify-content: center;
}
.train:hover { filter: brightness(.97); box-shadow: 0 2px 6px rgba(15, 23, 42, .12); transition: box-shadow var(--ease), filter var(--ease); }
.train b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.train span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .9; font-variant-numeric: tabular-nums; }
.train-Approved { background: var(--go-soft); border-color: #86efac; color: #14532d; }
.train-Awaiting { background: var(--wait-soft); border-color: #fcd34d; color: #713f12; }
.train-Rejected { background: var(--stop-soft); border-color: #fca5a5; color: #7f1d1d; }
.train.selected { box-shadow: 0 0 0 2px var(--blue), 0 2px 8px rgba(37, 99, 235, .25); }
.absence-bar { position: absolute; top: 4px; bottom: 4px; border-radius: 6px; background: repeating-linear-gradient(135deg, #e3e9ee 0 6px, #eef2f5 6px 12px); color: var(--steel); font-size: 12px; padding: 3px 8px; display: flex; align-items: center; pointer-events: none; }

/* Mobile: list instead of timeline */
.day-list { display: none; }
@media (max-width: 700px) {
  .week-no { font-size: 26px; }
  .meter { padding: 14px 16px; gap: 8px 16px; }
  .meter .big { font-size: 28px; }
  .day { grid-template-columns: 1fr auto; min-height: 56px; }
  .day .track, .track-hours { display: none; }
  .day-list { display: block; grid-column: 1 / -1; padding: 0 16px 8px; }
  .day-list:empty { display: none; }
  .day-list button.entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; width: 100%; gap: 4px 10px; align-items: center; text-align: left; background: #fff; border: 1px solid var(--border); border-left-width: 4px; border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 8px; cursor: pointer; font-size: 14px; min-width: 0; }
  .day-list button.entry > :nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .day-list button.entry:hover { border-color: #94a3b8; }
  .day-list .entry.e-Approved { border-left-color: var(--go); }
  .day-list .entry.e-Awaiting { border-left-color: var(--wait-bg); }
  .day-list .entry.e-Rejected { border-left-color: var(--stop); }
  .day-list button.entry.entry { border-left-width: 4px; }
  .day-list .add { font-size: 14px; }
}

.editor { position: sticky; top: 24px; box-shadow: var(--shadow); }
.demo-banner + .app .editor { top: 56px; }
.editor h2 { margin-bottom: 4px; }
.time-pair { display: grid; grid-template-columns: 1fr 1fr 68px; gap: 12px; align-items: end; }
.time-pair .input { padding: 0 8px; min-width: 0; }
.editor.panel-pad, .editor .panel-pad { padding: 20px; }
.hours-out { height: 40px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); background: var(--blue-soft); color: var(--blue-darker); font-family: var(--font-head); font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 1180px) { .editor { position: static; } }
@media (max-width: 420px) { .time-pair { grid-template-columns: 1fr 1fr; } .time-pair > :last-child { grid-column: 1 / -1; } }

/* ---------- Approvals ---------- */
.ap-group { margin-bottom: 16px; overflow: hidden; box-shadow: var(--shadow); }
.ap-head { display: flex; align-items: center; gap: 8px 16px; padding: 16px 20px; flex-wrap: wrap; }
.ap-head .who { font-family: var(--font-head); font-size: 17px; font-weight: 600; }
.ap-head .facts { display: flex; gap: 4px 16px; color: var(--steel); font-size: 14px; flex-wrap: wrap; }
.ap-head .facts b { color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 600; }
.ap-rows { border-top: 1px solid var(--rail-2); }
.ap-row { display: grid; grid-template-columns: 34px 96px 120px 1fr 110px 80px; gap: 12px; padding: 10px 20px; min-height: 44px; align-items: center; border-bottom: 1px solid var(--rail-2); font-size: 14px; color: var(--ink-2); }
.ap-row:nth-child(even) { background: var(--zebra); }
.ap-row:hover { background: #f1f5f9; }
.ap-row:last-child { border-bottom: 0; }
.ap-row .c-date { font-variant-numeric: tabular-nums; }
.ap-row .kind { font-size: 12px; font-weight: 600; color: var(--steel); }
.ap-row .amt { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
.ap-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--blue); }
.kind-chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--rail-2); color: var(--ink-2); }
@media (max-width: 760px) {
  .ap-head { padding: 14px 16px; }
  .ap-row { grid-template-columns: 30px minmax(0, 1fr) auto; padding: 10px 16px; align-items: start; }
  .ap-row .c-date, .ap-row .c-proj { grid-column: 2; }
  .ap-row .c-desc { grid-column: 2 / -1; }
  .ap-row .amt { grid-row: 1; grid-column: 3; }
  .ap-row .c-act { grid-column: 2 / -1; }
}
.bulkbar { position: sticky; bottom: 16px; z-index: 30; display: flex; align-items: center; gap: 12px; background: var(--navy); color: #fff; padding: 10px 16px; border-radius: var(--radius); box-shadow: 0 8px 24px rgba(15, 23, 42, .25); margin-top: 16px; flex-wrap: wrap; }
.bulkbar .btn { border-color: transparent; }


/* ---------- Misc ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { padding: 16px 20px; box-shadow: var(--shadow); }
.stat b { display: block; font-family: var(--font-head); font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.15; color: var(--ink); }
.stat span { font-size: 13px; color: var(--steel); }
@media (max-width: 760px) { .stats { grid-template-columns: 1fr 1fr; gap: 12px; } .stat b { font-size: 22px; } }
.filters { display: flex; gap: 12px 16px; flex-wrap: wrap; align-items: flex-end; padding: 16px 20px; }
.filters .field { width: 200px; }
@media (max-width: 600px) { .filters .field { width: 100%; } }
.receipt-thumb { width: 100%; max-height: 360px; object-fit: contain; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #f8fafc; }
.file-drop { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius-sm); background: #f8fafc; cursor: pointer; }
.file-drop:hover { border-color: var(--blue); background: var(--blue-soft); transition: border-color var(--ease), background-color var(--ease); }
.emp-rows { display: flex; flex-direction: column; gap: 8px; }
.emp-row { display: grid; grid-template-columns: 1fr 150px 110px 38px; gap: 8px; align-items: center; }
@media (max-width: 600px) { .emp-row { grid-template-columns: 1fr 1fr; } }
.demo-banner { background: var(--wait-soft); color: #92400e; text-align: center; font-size: 13px; padding: 6px 12px; font-weight: 600; border-bottom: 1px solid #fde68a; }
.demo-banner select { font-size: 12.5px; border: 1px solid #fcd34d; border-radius: 6px; background: #fff; padding: 1px 4px; max-width: 100%; }
.loading { padding: 40px; text-align: center; color: var(--steel); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 24px; font-size: 14px; }
.kv dt { color: var(--steel); }
.kv dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Week calendar (days as columns, hours downwards) ---------- */
.cal { margin-top: 16px; overflow: hidden; }
.cal-scroll { overflow-x: auto; }
.cal-grid { display: grid; min-width: 680px; }
.cal-corner { border-bottom: 1px solid var(--rail); }
.cal-head { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 4px; border-bottom: 1px solid var(--rail); border-left: 1px solid var(--rail-2); }
.cal-head.weekend { background: #f8fafc; }
.cal-dow { font-size: 12px; color: var(--steel); text-transform: uppercase; letter-spacing: .04em; }
.cal-date { font-family: var(--font-head); font-size: 20px; line-height: 1.1; }
.cal-head.today .cal-date { color: #fff; background: var(--blue); border-radius: 999px; min-width: 32px; text-align: center; padding: 0 6px; }
.cal-sum { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cal-sum.zero { color: #b6c1ca; }
.cal-tag { font-size: 11px; color: var(--steel); text-align: center; line-height: 1.2; }
.cal-tag.holiday { color: var(--blue-dark); font-weight: 600; }
.cal-gutter { position: relative; }
.cal-gutter span { position: absolute; right: 8px; transform: translateY(-50%); font-size: 11px; color: var(--steel); font-variant-numeric: tabular-nums; }
.cal-gutter span:first-child { transform: none; }
.cal-col { position: relative; border-left: 1px solid var(--rail-2); cursor: copy; background-image: linear-gradient(to bottom, var(--rail-2) 1px, transparent 1px); }
.cal-col.weekend { background-color: #fafbfc; }
.cal-col.holiday { background-color: #f1f5ff; }
.cal-col.closed { cursor: default; }
.cal-col:hover:not(.closed) { background-color: #f8fbff; }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--stop); z-index: 2; pointer-events: none; }
.cal-now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--stop); }
.cal-entry { position: absolute; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 3px 6px; border: 1px solid; border-left-width: 4px; border-radius: 6px; font-size: 12px; line-height: 1.25; text-align: left; overflow: hidden; cursor: pointer; }
.cal-entry b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cal-entry .cal-time { font-variant-numeric: tabular-nums; opacity: .85; font-size: 11px; }
.cal-entry .cal-desc { opacity: .8; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cal-entry.selected { box-shadow: 0 0 0 2px var(--blue); }
.cal-entry.train-Approved { border-left-color: var(--go); }
.cal-entry.train-Awaiting { border-left-color: var(--wait-bg); }
.cal-entry.train-Rejected { border-left-color: var(--stop); }
.cal-dragging, .cal-dragging * { user-select: none; }
.cal-dragging .cal-col { cursor: grabbing; }
.cal-col { touch-action: pan-x; }
.cal-sel { position: absolute; left: 3px; right: 3px; z-index: 3; background: rgba(59, 130, 246, .18); border: 2px solid var(--blue); border-radius: 6px; pointer-events: none; }
.cal-sel span, .cal-ghost span { display: block; padding: 2px 6px; font-size: 11px; font-weight: 600; color: var(--blue-dark); font-variant-numeric: tabular-nums; line-height: 1.25; }
.cal-ghost { position: absolute; left: 3px; right: 3px; z-index: 3; background: #fff; border: 2px dashed var(--blue); border-radius: 6px; pointer-events: none; overflow: hidden; box-shadow: 0 6px 18px rgba(15, 23, 42, .18); }
.cal-ghost b { display: block; padding: 0 6px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-entry.movable { cursor: grab; }
.cal-entry.dragging { opacity: .35; }

/* Searchable select */
.ss { position: relative; }
.ss-input { padding-right: 30px; cursor: pointer; text-overflow: ellipsis; }
.ss-input:focus { cursor: text; }
.ss-caret { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--steel); font-size: 12px; }
.ss-list { position: fixed; z-index: 1000; max-height: 300px; overflow-y: auto; margin: 0; padding: 4px; list-style: none; background: #fff; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: 0 12px 32px rgba(15, 23, 42, .18); }
.ss-opt { padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 14px; line-height: 1.3; }
.ss-active { background: var(--blue-soft); }
.ss-sel { font-weight: 600; color: var(--blue-darker); }
.ss-head { padding: 8px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--steel); }
.ss-none { padding: 10px; color: var(--steel); font-size: 14px; }
.toolbar .ss-filter { min-width: 220px; flex: 1 1 220px; max-width: 320px; }

/* ---------- Summary / overview (pages/Home.tsx) ---------- */
.ov-section { margin-bottom: 32px; }
.ov-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin: 0 0 12px; }
.ov-section-head h2 { font-family: var(--font-head); font-size: 18px; font-weight: 600; color: var(--ink); margin: 0; }
.ov-section-head p { margin: 2px 0 0; color: var(--steel); font-size: 13.5px; }
.ov-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ov-section-head .input.ov-select { width: 230px; max-width: 100%; }
.ov-section-head .input.ov-select.ov-year { width: 100px; }

/* Stat cards */
.ov-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.ov-stat { display: flex; flex-direction: column; padding: 16px 20px; border-left: 4px solid var(--blue); box-shadow: var(--shadow); min-width: 0; }
.ov-stat.ov-tone-ok { border-left-color: var(--go); }
.ov-stat.ov-tone-warn { border-left-color: var(--wait-bg); }
.ov-stat.ov-tone-bad { border-left-color: var(--stop); }
.ov-stat-label { display: flex; align-items: center; gap: 8px; color: var(--steel); font-size: 13px; font-weight: 500; }
.ov-stat-label svg { width: 16px; height: 16px; color: var(--blue); flex: none; }
.ov-stat-value { font-family: var(--font-head); font-size: 26px; font-weight: 600; line-height: 1.15; color: var(--ink); margin-top: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-stat-value small { font-size: 14px; font-weight: 500; color: var(--steel); }
.ov-stat-value .ov-money { font-size: 22px; }
.ov-stat-value small.ov-nothing { font-size: 20px; color: var(--ink); font-weight: 600; }
.ov-stat-sub { color: var(--steel); font-size: 13px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.ov-stat-action { margin-top: auto; padding-top: 8px; }
.ov-link { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: var(--blue-dark, #2563eb); font: 600 13px var(--font-head); cursor: pointer; }
.ov-link:hover { text-decoration: underline; }
.ov-link svg { width: 14px; height: 14px; }
.ov-pos { color: var(--go-ink, #166534); }
.ov-neg { color: var(--stop-ink, #b91c1c); }

/* Cards with a head */
.ov-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; padding: 16px 20px 12px; }
.ov-card-head h3 { font-family: var(--font-head); font-size: 15.5px; font-weight: 600; color: var(--ink); margin: 0; }
.ov-card-head p { margin: 2px 0 0; color: var(--steel); font-size: 13px; }
.ov-table-card { box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden; min-width: 0; }
.ov-table-card .table-wrap { border-top: 1px solid var(--rail-2, #eef1f5); }
.ov-table-card > table.list { border-top: 1px solid var(--rail-2, #eef1f5); }
.ov-empty { padding: 4px 20px 20px; margin: 0; }
.ov-more { display: flex; justify-content: center; padding: 12px; border-top: 1px solid var(--rail-2, #eef1f5); }
.btn.btn-sm svg { width: 15px; height: 15px; }

table.list.ov-list td { padding-top: 9px; padding-bottom: 9px; }
table.list.ov-list th:first-child, table.list.ov-list td:first-child { padding-left: 20px; }
table.list.ov-list th:last-child, table.list.ov-list td:last-child { padding-right: 20px; }
.ov-pname { font-weight: 500; color: var(--ink); max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-psub { font-size: 12.5px; color: var(--steel); font-weight: 400; margin-top: 1px; }
td.ov-miss { color: var(--stop-ink, #b91c1c); font-weight: 600; }
td.ov-miss small, td.ov-old small { font-weight: 600; }
td.ov-old { color: var(--stop-ink, #b91c1c); font-weight: 600; }

/* Grids */
.ov-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 0; align-items: start; }
.ov-grid-wide { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }

/* Charts */
.ov-chart { box-shadow: var(--shadow); margin-bottom: 16px; min-width: 0; }
.ov-chart-body { padding: 0 20px 16px; min-width: 0; }
.ov-chart-body .ov-empty { padding: 4px 0 8px; }

/* Budget bar */
.ov-bar { position: relative; display: flex; height: 12px; border-radius: 6px; background: #eef2f7; overflow: hidden; }
.ov-bar-thin { height: 8px; border-radius: 4px; }
.ov-bar i { display: block; height: 100%; background: #3b82f6; }
.ov-bar i.ov-awaiting { opacity: .42; }
.ov-bar.ov-warn i { background: #f59e0b; }
.ov-bar.ov-over i { background: #dc2626; }
.ov-bar.ov-none { background: repeating-linear-gradient(135deg, #eef2f7 0 6px, #f8fafc 6px 12px); }
.ov-t-warn { color: #b45309; font-weight: 600; }
.ov-t-over { color: var(--stop-ink, #b91c1c); font-weight: 600; }
.ov-t-none { color: var(--steel); }

/* Project cards (project leader) */
.ov-projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 16px; }
.ov-project { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; box-shadow: var(--shadow); border-top: 4px solid #3b82f6; min-width: 0; }
.ov-project.ov-warn { border-top-color: #f59e0b; }
.ov-project.ov-over { border-top-color: #dc2626; }
.ov-project.ov-none { border-top-color: var(--border-strong, #cbd5e1); }
.ov-project-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.ov-project-name { min-width: 0; }
.ov-project-name h3 { font-family: var(--font-head); font-size: 16px; font-weight: 600; color: var(--ink); margin: 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ov-project-name p { margin: 2px 0 0; color: var(--steel); font-size: 13px; }
.ov-left { text-align: right; flex: none; }
.ov-left b { display: block; font-family: var(--font-head); font-size: 34px; font-weight: 600; line-height: 1; color: var(--ink); letter-spacing: -.01em; }
.ov-left span { display: block; font-size: 12.5px; font-weight: 500; color: var(--steel); margin-top: 4px; text-transform: uppercase; letter-spacing: .04em; }
.ov-project.ov-warn .ov-left b { color: #b45309; }
.ov-project.ov-over .ov-left b { color: var(--stop-ink, #b91c1c); }
.ov-project-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; font-size: 13.5px; color: var(--ink-2, #334155); }
.ov-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.ov-badge svg { width: 14px; height: 14px; }
.ov-badge-warn { background: var(--wait-soft, #fef3c7); color: var(--wait, #92400e); }
.ov-badge-over { background: var(--stop-soft, #fee2e2); color: var(--stop-ink, #b91c1c); }
.ov-badge-none { background: #f1f5f9; color: var(--steel); }

/* Budget table */
.ov-budget-table .ov-col-bar { width: 32%; min-width: 180px; }
.ov-barcell { display: flex; align-items: center; gap: 10px; }
.ov-barcell .ov-bar { flex: 1; min-width: 80px; }
.ov-pct { min-width: 64px; text-align: right; font-size: 13px; }

/* Missing days */
.ov-missing { box-shadow: var(--shadow); margin-bottom: 16px; border-left: 4px solid var(--wait-bg); }
.ov-days { list-style: none; margin: 0; padding: 0 0 6px; border-top: 1px solid var(--rail-2, #eef1f5); }
.ov-days li { display: grid; grid-template-columns: minmax(150px, 1fr) auto minmax(120px, auto); gap: 12px; align-items: center; padding: 9px 20px; border-bottom: 1px solid var(--rail-2, #eef1f5); font-size: 14px; }
.ov-days li:last-child { border-bottom: 0; }
.ov-day-date b { font-weight: 600; color: var(--ink); display: inline-block; min-width: 34px; }
.ov-day-miss { color: var(--stop-ink, #b91c1c); font-weight: 600; text-align: right; }
.ov-day-reg { text-align: right; font-size: 13px; }

/* Callouts */
.ov-callout { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-radius: var(--radius-sm, 8px); margin-bottom: 16px; font-size: 14px; border: 1px solid; }
.ov-callout > svg { width: 20px; height: 20px; flex: none; }
.ov-callout-text { flex: 1; min-width: 200px; }
.ov-callout-stop { background: var(--stop-soft, #fee2e2); border-color: #fecaca; color: var(--stop-ink, #b91c1c); }
.ov-callout-stop .ov-callout-text { color: #7f1d1d; }
.ov-callout-wait { background: var(--wait-soft, #fef3c7); border-color: #fde68a; color: var(--wait, #92400e); }

/* Sortable headers */
th.ov-sort { padding: 0 !important; }
th.ov-sort button { display: inline-flex; align-items: center; gap: 4px; width: 100%; padding: 11px 16px; border: 0; background: none; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; }
th.ov-sort:first-child button { padding-left: 20px; }
th.ov-sort:last-child button { padding-right: 20px; }
th.ov-sort.num button { justify-content: flex-end; }
th.ov-sort button:hover { color: var(--ink); }
th.ov-sort svg { width: 14px; height: 14px; flex: none; }
.ov-sort-gap { display: inline-block; width: 14px; }

@media (max-width: 1100px) {
  .ov-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ov-grid-2, .ov-grid-wide { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .ov-stats { gap: 10px; }
  .ov-stat { padding: 12px 14px; }
  .ov-stat-value { font-size: 21px; }
  .ov-stat-value .ov-money { font-size: 17px; }
  .ov-projects { grid-template-columns: minmax(0, 1fr); }
  .ov-left b { font-size: 28px; }
  .ov-card-head { padding: 14px 16px 10px; }
  .ov-chart-body { padding: 0 12px 12px; }
  .ov-days li { grid-template-columns: 1fr auto; padding: 9px 16px; }
  .ov-day-reg { display: none; }
  .ov-section-head .ov-tools { width: 100%; }
  .ov-section-head .input.ov-select { width: auto; min-width: 0; flex: 1; }
  table.list.ov-list td:first-child { white-space: nowrap; }
  table.list.ov-list th:first-child, table.list.ov-list td:first-child { padding-left: 16px; }
  .ov-pname { max-width: 200px; }
}
@media (max-width: 420px) {
  .ov-stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ov-stat-sub { font-size: 12px; }
}

/* ---------- Admin pages: filters, budgets, flex (Admin.tsx, Approvals.tsx, Reports.tsx) ---------- */

/* Filter toolbar: one row that wraps */
.ad-toolbar { align-items: center; }
.ad-toolbar > .input { width: auto; flex: 0 1 180px; min-width: 140px; }
.ad-toolbar > .ad-search { flex: 1 1 220px; max-width: 280px; }
.ad-count { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; color: var(--steel); font-size: 13.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ad-period { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ad-period .input { width: 150px; }
.ad-note { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-bottom: 16px; }
.ad-note .btn { color: inherit; text-decoration: underline; padding-left: 4px; padding-right: 4px; }
@media (max-width: 600px) {
  .ad-toolbar > .input, .ad-toolbar > .ad-search { flex: 1 1 100%; max-width: none; min-width: 0; }
  .ad-period { flex: 1 1 100%; }
  .ad-period .input { flex: 1 1 0; width: auto; min-width: 0; }
  .ad-count { margin-left: 0; }
}

/* Budget: hours left with a slim bar */
.bud { --bud: var(--blue); display: grid; grid-template-columns: auto auto; justify-content: start; align-items: baseline; column-gap: 8px; row-gap: 4px; min-width: 128px; }
.bud-left { font-family: var(--font-head); font-size: 17px; font-weight: 600; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bud-pct { font-size: 12px; color: var(--steel); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bud-bar { grid-column: 1 / -1; display: block; height: 5px; border-radius: 3px; background: var(--rail); overflow: hidden; width: 100%; min-width: 110px; }
.bud-bar > i { display: block; height: 100%; border-radius: 3px; background: var(--bud); }
.bud-ok { --bud: var(--blue); }
.bud-warn { --bud: var(--wait-bg); }
.bud-warn .bud-pct { color: var(--wait); font-weight: 600; }
.bud-over { --bud: var(--stop); }
.bud-over .bud-left, .bud-over .bud-pct { color: var(--stop-ink); }
.bud-over .bud-pct { font-weight: 600; }
.bud-none { --bud: var(--steel); }
.ad-left-cell { min-width: 150px; }

/* Contract & addendums in the project dialog */
.ad-budget { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--zebra); }
.ad-budget h3 { margin: 0; }
.ad-budget-top { display: grid; grid-template-columns: minmax(160px, 220px) 1fr; gap: 16px; align-items: start; }
.ad-sum { display: flex; flex-direction: column; gap: 6px; padding: 10px 14px; background: var(--paper); border: 1px solid var(--border); border-left: 4px solid var(--bud); border-radius: var(--radius-sm); }
.ad-sum-big { display: flex; align-items: baseline; gap: 8px; }
.ad-sum-big b { font-family: var(--font-head); font-size: 24px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--ink); }
.ad-sum-big span { color: var(--steel); font-size: 13.5px; }
.ad-sum.bud-over .ad-sum-big b { color: var(--stop-ink); }
.ad-sum p { margin: 0; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ad-sum .bud-bar { min-width: 0; }
.ad-add { display: grid; grid-template-columns: 150px 120px 1fr auto; gap: 10px; align-items: end; }
.ad-add .ad-add-ref { grid-column: 3 / 5; }
.ad-add .ad-add-comment { grid-column: 1 / 4; }
.ad-add-flex .ad-add-comment { grid-column: auto; }
.ad-add-flex { grid-template-columns: 150px 140px 1fr auto; padding-top: 12px; border-top: 1px solid var(--rail); }
table.list.ad-mini th { padding: 8px 12px; }
table.list.ad-mini td { padding: 7px 12px; height: 36px; }
@media (max-width: 760px) {
  .ad-budget-top { grid-template-columns: 1fr; }
  .ad-add, .ad-add-flex { grid-template-columns: 1fr 1fr; }
  .ad-add .ad-add-comment, .ad-add .ad-add-ref, .ad-add > .btn { grid-column: 1 / -1; }
}

/* Flex */
.flex-btn { border: 0; background: none; padding: 2px 6px; margin: -2px -6px; border-radius: 6px; cursor: pointer; font: inherit; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); text-decoration: underline dotted; text-underline-offset: 3px; }
.flex-btn:hover { background: var(--blue-soft); }
.flex-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.flex-pos { color: var(--go-ink) !important; }
.flex-neg { color: var(--stop-ink) !important; }
.flex-sum { display: grid; grid-template-columns: auto 1fr; gap: 16px 28px; align-items: center; }
.flex-big { display: flex; flex-direction: column; padding: 14px 20px; border-radius: var(--radius); background: var(--zebra); border: 1px solid var(--border); min-width: 160px; }
.flex-big b { font-family: var(--font-head); font-size: 30px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; color: inherit; }
.flex-big span { color: var(--steel); font-size: 13px; }
.flex-kv dd { margin: 0; }
@media (max-width: 600px) { .flex-sum { grid-template-columns: 1fr; } }

/* Reports: list of sheets in the Excel file */
.ad-sheets { margin-top: 4px; line-height: 1.6; }
.ad-sheets span { font-weight: 600; }

/* =====================================================================================
   Work sheets – design v3 (Oct 2026). Loaded last; refines the base styles.
   Railtek navy sidebar (the logo's colour), calm neutral surfaces, one blue accent for actions,
   signal colours only for status. Headings in Poppins, body and numbers in Inter.
   ===================================================================================== */
:root {
  --rt-navy: #17224d;
  --rt-navy-2: #1e2c63;
  --rt-navy-3: #24357a;
  --bg: #f3f5f9;
  --paper: #ffffff;
  --border: #e3e8ef;
  --border-strong: #cfd6e0;
  --rail: #e3e8ef;
  --rail-2: #edf0f5;
  --zebra: #fafbfd;
  --head-bg: transparent;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-darker: #1e40af;
  --blue-soft: #eef4ff;
  --blue-line: #a9c4fb;
  --blue-ring: rgba(37, 99, 235, .22);
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 2px 8px rgba(16, 24, 40, .04);
  --shadow-lg: 0 24px 60px rgba(16, 24, 40, .24);
}
body { background: var(--bg); font-size: 14.5px; }
h1 { letter-spacing: -.015em; }

/* ---------- Sidebar ---------- */
.app { grid-template-columns: 256px 1fr; }
.side {
  background: linear-gradient(180deg, var(--rt-navy) 0%, var(--rt-navy-2) 100%);
  color: #c9d3ee; padding: 20px 14px 14px;
  scrollbar-color: rgba(255, 255, 255, .25) transparent;
}
.brand { align-items: flex-start; padding: 2px 10px 22px; gap: 8px; }
.brand img { width: 128px; filter: brightness(0) invert(1); opacity: .96; }
.brand b { color: #8fa3d6; font-family: var(--font); font-size: 11.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.nav-link { color: #c9d3ee; font-weight: 500; font-size: 14px; min-height: 38px; border-radius: 9px; }
.nav-link svg { color: #8fa3d6; transition: color var(--ease); }
.nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-link:hover svg { color: #fff; }
.nav-link[aria-current="page"] { background: rgba(255, 255, 255, .12); color: #fff; font-weight: 600; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.nav-link[aria-current="page"] svg { color: #fff; }
.nav-link[aria-current="page"]::before { left: -14px; top: 9px; bottom: 9px; width: 3px; background: #7aa7ff; }
.nav-head, .nav-head[aria-expanded="true"] { color: #e4e9f7; }
.nav-sub { font-size: 13.5px; }
.nav-sub::after, .nav-sub[aria-current="page"]::after { background: rgba(255, 255, 255, .14); }
.side .badge { background: #f59e0b; color: #3b2304; }
.side-foot { border-top-color: rgba(255, 255, 255, .1); }
.side-foot .who { color: #8fa3d6; }
.side-foot .who b { color: #fff; }
@media (max-width: 900px) {
  .mobile-top { background: var(--rt-navy); }
}

/* ---------- Page ---------- */
.main { padding: 22px 32px 72px; max-width: 1480px; }
.page-head { background: none; border-radius: 0; padding: 6px 0 18px; margin-bottom: 22px; border-bottom: 1px solid var(--rail); min-height: 0; align-items: flex-end; }
.page-head h1 { font-size: 26px; font-weight: 600; }
.page-head p { font-size: 14px; max-width: 760px; margin-top: 4px; }
@media (max-width: 900px) {
  .main { padding: 8px 14px 64px; }
  .page-head { padding: 4px 0 14px; margin-bottom: 16px; }
  .page-head h1 { font-size: 21px; }
}

/* ---------- Surfaces ---------- */
.panel, .card { border-color: var(--border); box-shadow: var(--shadow); }
.btn { border-radius: 9px; font-weight: 500; }
.btn-primary { background: var(--blue); border-color: var(--blue); box-shadow: 0 1px 2px rgba(37, 99, 235, .3), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.input, select.input, textarea.input { border-radius: 9px; border-color: var(--border-strong); }

/* Tables: neutral headers, airy rows */
table.list th { background: #f7f9fc; color: #5b6b82; font-family: var(--font); font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 11px 16px; border-bottom: 1px solid var(--rail); }
table.list td { border-bottom-color: var(--rail-2); }
table.list tbody tr:nth-child(even) td { background: transparent; }
table.list tbody tr:hover td { background: #f7f9fc; }
table.list tr.clickable:hover td { background: var(--blue-soft); }
table.list tfoot tr.total td { border-top: 1px solid var(--border-strong); background: #f7f9fc; }

/* Tabs */
.segmented button[aria-pressed="true"] { color: var(--blue-dark); border-bottom-color: var(--blue); font-weight: 600; }
.segmented button svg { width: 15px; height: 15px; vertical-align: -2px; margin-right: 4px; }

/* Stats */
.stats { gap: 14px; }
.stat { position: relative; padding: 16px 20px 15px; border-radius: var(--radius); overflow: hidden; }
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--blue); }
.stat b { font-size: 25px; letter-spacing: -.01em; }
.stat-ok::before { background: var(--go); }
.stat-wait::before { background: var(--wait-bg); }
.stat-bad::before { background: var(--stop); }

/* Dialog */
.scrim { background: rgba(15, 23, 42, .5); backdrop-filter: blur(2px); }
.dialog { border-radius: 16px; }
.dialog-wide { width: min(940px, 100%); }
.dialog header h2 { font-size: 18.5px; }

/* Status pills a touch calmer */
.status { font-size: 12px; padding: 2px 9px; }

/* Text helpers */
.text-stop { color: var(--stop-ink); }
.text-go { color: var(--go-ink); }
.text-wait { color: var(--wait); }
.text-wait-strong { color: var(--wait); font-weight: 600; }
.nowrap { white-space: nowrap; }

/* ---------- Filters and search ---------- */
.filter-panel { padding: 14px 16px; margin-bottom: 16px; display: flex; flex-direction: column; gap: 12px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.search-box { position: relative; flex: 2 1 280px; min-width: 220px; }
.search-box svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--steel); pointer-events: none; }
.search-box .input { padding-left: 36px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { height: 32px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--border-strong); background: #fff; color: var(--ink-2); font-size: 13.5px; font-weight: 500; cursor: pointer; }
.chip:hover { border-color: #94a3b8; color: var(--ink); }
.chip-on, .chip-on:hover { background: var(--rt-navy); border-color: var(--rt-navy); color: #fff; }
.input-sm { height: 32px; font-size: 13.5px; padding: 0 10px; width: auto; }

/* ---------- My entries ---------- */
.entries-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .entries-layout { grid-template-columns: minmax(0, 1fr); } .side-card { position: static; } }
.entries-table tr.group-row td { background: #f7f9fc !important; color: var(--steel); font-size: 12px; font-weight: 600; letter-spacing: .03em; height: 34px; padding-top: 6px; padding-bottom: 6px; }
.entries-table .row-action { width: 36px; color: #b4bfcf; text-align: right; }
.entries-table tr.clickable:hover .row-action { color: var(--blue); }
.side-card { padding: 18px 20px; position: sticky; top: 16px; }
.side-card h3 { margin-bottom: 2px; }
.bar-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.bar-list-head { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; margin-bottom: 5px; }
.bar-list-head span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 6px; background: var(--rail-2); border-radius: 99px; overflow: hidden; }
.bar-track i { display: block; height: 100%; background: var(--blue); border-radius: 99px; }

/* ---------- Project economy ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
@media (max-width: 1000px) { .kpis { grid-template-columns: 1fr 1fr; } }
.kpi { padding: 16px 20px; display: flex; flex-direction: column; gap: 4px; border-top: 3px solid var(--blue); }
.kpi-ok { border-top-color: var(--go); }
.kpi-warn { border-top-color: var(--wait-bg); }
.kpi-bad { border-top-color: var(--stop); }
.kpi-label { font-size: 12.5px; font-weight: 600; color: var(--steel); letter-spacing: .02em; }
.kpi-value { font-family: var(--font-head); font-size: 24px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-hint { font-size: 12.5px; color: var(--steel); }
.proj-cell { display: flex; gap: 12px; align-items: center; min-width: 220px; }
.proj-no { flex: none; min-width: 46px; height: 26px; padding: 0 7px; display: inline-flex; align-items: center; justify-content: center; border-radius: 7px; background: var(--blue-soft); color: var(--blue-darker); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mini-budget { display: flex; flex-direction: column; gap: 4px; }
.mini-budget-track { height: 7px; border-radius: 99px; background: var(--rail-2); overflow: hidden; }
.mini-budget-track i { display: block; height: 100%; border-radius: 99px; }
.mb-ok { background: var(--go); }
.mb-warn { background: var(--wait-bg); }
.mb-over { background: var(--stop); }
.econ-flow { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 700px) { .econ-flow { grid-template-columns: 1fr; } }
.ef-col { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px 10px; background: #fbfcfe; }
.ef-col h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--steel); font-weight: 600; }
.ef-line { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 14px; border-bottom: 1px dashed var(--rail); font-variant-numeric: tabular-nums; }
.ef-line:last-child { border-bottom: 0; }
.ef-line b { font-weight: 500; white-space: nowrap; }
.ef-strong { border-top: 1px solid var(--border-strong); border-bottom: 0; margin-top: 4px; padding-top: 9px; font-weight: 600; }
.ef-strong b { font-weight: 700; font-size: 15.5px; }
.ef-ok b { color: var(--go-ink); }
.ef-bad b { color: var(--stop-ink); }
.ef-warn b { color: var(--wait); }
.inv-head { display: flex; align-items: center; gap: 6px; font-size: 14px; margin: 0 0 8px; font-weight: 600; }
.inv-head svg { width: 16px; height: 16px; color: var(--blue); }
.paid-pill { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid transparent; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.paid-pill svg { width: 14px; height: 14px; }
.paid-yes { background: var(--go-soft); color: var(--go-ink); }
.paid-no { background: #f1f5f9; color: var(--ink-2); border-color: var(--border); }
.paid-late { background: var(--stop-soft); color: var(--stop-ink); }
.paid-pill:hover { filter: brightness(.97); border-color: var(--border-strong); }
.file-input { padding: 7px 10px; height: auto; }
@media (max-width: 600px) {
  .search-box { min-width: 0; flex-basis: 100%; }
  .filter-row > .ss, .filter-row > select.input { flex: 1 1 100%; max-width: none !important; }
  .chips { gap: 5px; }
  .chip { height: 30px; padding: 0 11px; font-size: 13px; }
}

/* ---------- Guides ---------- */
.guide-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 18px; align-items: start; }
.guide-toc { position: sticky; top: 16px; padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.guide-toc b { padding: 0 10px 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--steel); }
.guide-toc a { padding: 6px 10px; border-radius: 7px; color: var(--ink-2); text-decoration: none; }
.guide-toc a:hover { background: var(--blue-soft); color: var(--blue-darker); }
.guide { padding: 8px 36px 28px; max-width: 900px; font-size: 15px; line-height: 1.65; }
.guide h2 { font-size: 20px; margin: 30px 0 10px; padding-top: 6px; scroll-margin-top: 16px; }
.guide h2:first-child { margin-top: 18px; }
.guide p { margin: 8px 0; }
.guide ul, .guide ol { padding-left: 22px; margin: 8px 0; }
.guide li { margin: 4px 0; }
.guide li:has(> .guide-box) { list-style: none; margin-left: -20px; display: flex; gap: 10px; align-items: baseline; }
.guide-box { flex: none; width: 15px; height: 15px; border: 1.5px solid var(--border-strong); border-radius: 4px; transform: translateY(2px); }
.guide table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 14px; }
.guide th { text-align: left; background: #f7f9fc; color: #5b6b82; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; padding: 9px 12px; border-bottom: 1px solid var(--rail); }
.guide td { padding: 9px 12px; border-bottom: 1px solid var(--rail-2); vertical-align: top; }
.guide code { background: #f1f5f9; padding: 1px 6px; border-radius: 5px; font-size: 13px; }
@media (max-width: 900px) { .guide-layout { grid-template-columns: minmax(0, 1fr); } .guide-toc { position: static; } .guide { padding: 4px 18px 20px; } }
@media print {
  .side, .mobile-top, .page-head .btn, .segmented, .guide-toc, .demo-banner { display: none !important; }
  .app { display: block; } .main { padding: 0; } .guide { border: 0; box-shadow: none; max-width: none; padding: 0; }
}
.folder-row { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; padding: 10px 14px; border: 1px dashed var(--border-strong); border-radius: 10px; background: #fbfcfe; }
.spin { animation: spin 1s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.mig-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.folder-icon { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin-left: 4px; border-radius: 6px; color: var(--blue); vertical-align: -5px; }
.folder-icon:hover { background: var(--blue-soft); color: var(--blue-darker); }
.folder-icon svg { width: 16px; height: 16px; }

/* ---------- Sign-in (Oct 2026): Microsoft only, track drawing on the left ---------- */
.login-split { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(380px, 1fr); background: var(--paper); }
.login-hero { position: relative; overflow: hidden; background: radial-gradient(120% 90% at 70% 20%, #1c2a5e 0%, var(--rt-navy) 45%, #0f173a 100%); color: #fff; display: flex; align-items: flex-start; }
.login-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.la-label { font-family: var(--font); font-size: 12px; font-weight: 500; fill: #8fa3d6; letter-spacing: .02em; }
.la-label-util { fill: #6fb7cf; fill-opacity: .8; }
.la-signal { fill: #f5b84a; filter: drop-shadow(0 0 6px rgba(245, 184, 74, .9)); }
.la-draw path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: la-draw 1.8s cubic-bezier(.4, .1, .2, 1) .15s forwards; }
.la-sleepers, .la-mast, .la-utility { animation: la-fade .9s ease-out .2s both; }
.la-signal { animation: la-light .5s ease-out 1.8s both; }
@keyframes la-draw { to { stroke-dashoffset: 0; } }
@keyframes la-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes la-light { from { fill: #3b4c86; filter: none; } to { fill: #f5b84a; } }
@media (prefers-reduced-motion: reduce) {
  .la-draw path { animation: none; stroke-dashoffset: 0; }
  .la-sleepers, .la-mast, .la-utility, .la-signal { animation: none; }
}
.login-hero-text { position: relative; padding: clamp(48px, 9vh, 96px) 56px 0; max-width: 540px; }
.login-hero-logo { display: none; }
.login-hero-line { font-family: var(--font-head); font-size: clamp(26px, 2.6vw, 38px); line-height: 1.18; font-weight: 600; letter-spacing: -.02em; margin: 0 0 14px; color: #fff; }
.login-hero-sub { margin: 0; color: #c9d3ee; font-size: 15.5px; line-height: 1.55; max-width: 44ch; }

.login-panel { display: flex; align-items: center; justify-content: center; padding: 48px 40px; }
.login-box { width: min(380px, 100%); display: flex; flex-direction: column; gap: 16px; }
.login-panel-logo { width: 168px; height: auto; margin-bottom: 18px; }
.login-box h1 { font-size: 28px; line-height: 1.2; }
.login-lead { margin: -6px 0 10px; color: var(--steel); line-height: 1.55; }
.btn-ms-big { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; height: 52px; border-radius: 10px; border: 1px solid var(--rt-navy); background: var(--rt-navy); color: #fff; font: 600 15.5px/1 var(--font-head); cursor: pointer; transition: background-color var(--ease), transform .08s ease; }
.btn-ms-big svg { width: 20px; height: 20px; background: #fff; padding: 3px; border-radius: 3px; box-sizing: content-box; }
.btn-ms-big:hover:not(:disabled) { background: var(--rt-navy-3); }
.btn-ms-big:active:not(:disabled) { transform: translateY(1px); }
.btn-ms-big:focus-visible { outline: 3px solid var(--blue-ring); outline-offset: 2px; }
.btn-ms-big:disabled { opacity: .75; cursor: progress; }
.login-help { margin: 4px 0 0; font-size: 13.5px; color: var(--steel); line-height: 1.55; }
.login-alt { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 4px; }
.login-link { background: none; border: 0; padding: 0; color: var(--blue-dark); font: 500 13.5px var(--font); cursor: pointer; }
.login-link:hover { text-decoration: underline; }

@media (max-width: 860px) {
  .login-split { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .login-hero { min-height: 230px; align-items: flex-end; }
  .login-hero-text { padding: 0 20px 22px; }
  .login-hero-text::before { content: ""; position: absolute; inset: -60px 0 0 0; background: linear-gradient(180deg, rgba(15, 23, 58, 0) 0%, rgba(15, 23, 58, .9) 50%); z-index: -1; }
  .login-hero-logo { display: block; width: 104px; margin-bottom: 12px; filter: brightness(0) invert(1); }
  .login-hero-line { font-size: 22px; margin-bottom: 0; }
  .login-hero-sub { display: none; }
  .login-panel { align-items: flex-start; padding: 28px 16px 40px; }
  .login-panel-logo { display: none; }
}

/* Project number RT-<code>-<running no> (Oct 2026) */
.projno { display: flex; align-items: center; gap: 6px; font-family: var(--font); font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.projno .projno-code { width: 72px; text-align: center; text-transform: uppercase; font-weight: 600; letter-spacing: .04em; }
