/* Complete v5 — design tokens and components, transcribed from the design canvas (2026-09-06). */
:root {
  --ink: #1b1a3a; --ink-2: #3f3e5e; --muted: #6b6a86; --faint: #9b9ab0;
  --line: #e1e2ec; --line-2: #eef0f5; --bg: #f4f5f9; --bg-2: #f8f9fc; --surface: #ffffff;
  --brand: #322483; --brand-dark: #271c6b; --accent: #2482c3; --accent-dark: #1a6aa0; --silver: #b8b4b4;
  --ok: #1f9d55; --warn: #e0a10c; --danger: #c62f4e;
  --chip-active-bg: #e4f2fb; --chip-active-fg: #1a6aa0; --chip-late-bg: #fff4d6; --chip-late-fg: #a06a00;
  --chip-done-bg: #e3f6ea; --chip-done-fg: #1f7a45; --chip-off-bg: #f0f0f4; --chip-off-fg: #6b6a86;
  --shadow-card: 0 12px 32px -20px rgba(27,26,58,.35); --shadow-menu: 0 16px 32px -16px rgba(27,26,58,.35); --shadow-modal: 0 30px 60px -24px rgba(27,26,58,.6);
  --r-card: 12px; --r-ctl: 8px; --r-pill: 999px;
  --font: 'Barlow', 'Segoe UI', Arial, sans-serif; --font-cond: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  color-scheme: light;
}
[data-theme="dark"] {
  --ink: #eceaf7; --ink-2: #cfcde0; --muted: #a09ebd; --faint: #7f7d9b;
  --line: #2b2a46; --line-2: #24233c; --bg: #14132a; --bg-2: #1b1a33; --surface: #1f1e38;
  --brand: #4a3ab0; --brand-dark: #3b2d92; --accent: #3a9ae0; --accent-dark: #2482c3; --silver: #8f8ca0;
  --chip-active-bg: #1c3550; --chip-active-fg: #8fcbf6; --chip-late-bg: #3f3110; --chip-late-fg: #f3c86a;
  --chip-done-bg: #14331f; --chip-done-fg: #6fd39a; --chip-off-bg: #2a2942; --chip-off-fg: #a09ebd;
  --shadow-card: 0 12px 32px -20px rgba(0,0,0,.7); --shadow-menu: 0 16px 32px -16px rgba(0,0,0,.7); --shadow-modal: 0 30px 60px -24px rgba(0,0,0,.8);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 14px; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; } a:hover { color: var(--accent-dark); }
button { font: inherit; }
.cond { font-family: var(--font-cond); }
input::placeholder, textarea::placeholder { color: var(--faint); }
[hidden] { display: none !important; }

/* Top bar */
.topbar { height: 60px; background: #322483; color: #fff; display: flex; align-items: center; padding: 0 28px; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; }
.brand .ctl-logo { height: 30px; width: auto; display: block; }
.brand__name { font-weight: 700; font-size: 20px; letter-spacing: .04em; text-transform: uppercase; }
.topnav { display: flex; align-items: center; gap: 4px; flex-grow: 1; }
.topnav__link { height: 36px; display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; border-radius: var(--r-ctl); color: rgba(255,255,255,.8); font-size: 14px; font-weight: 600; cursor: pointer; list-style: none; border: 0; background: transparent; }
.topnav__link:hover { color: #fff; }
.topnav__link.is-active { background: rgba(255,255,255,.14); color: #fff; }
.topnav summary::-webkit-details-marker { display: none; }
.topbar__right { display: flex; align-items: center; gap: 6px; }
.topbar__sep { width: 1px; height: 24px; background: rgba(255,255,255,.2); margin: 0 6px; }
.icon-btn { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface); color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; position: relative; }
.icon-btn:hover { background: var(--bg-2); color: var(--brand); }
.icon-btn--bar { width: 36px; height: 36px; border: 0; background: transparent; color: rgba(255,255,255,.85); }
.icon-btn--bar:hover { background: rgba(255,255,255,.12); color: #fff; }
.badge { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; border-radius: var(--r-pill); background: var(--warn); color: #1b1a3a; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.user { display: flex; align-items: center; gap: 10px; padding: 0 6px; font-size: 14px; font-weight: 600; }
.user__logout { color: rgba(255,255,255,.7); font-weight: 500; font-size: 13px; } .user__logout:hover { color: #fff; }
.avatar { width: 30px; height: 30px; border-radius: var(--r-pill); background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.avatar--accent { background: var(--accent); } .avatar--silver { background: var(--silver); } .avatar--sys { background: var(--chip-active-bg); color: var(--chip-active-fg); }
.avatar--lg { width: 32px; height: 32px; }

/* Menus */
.menu { position: relative; }
.menu__panel { position: absolute; top: 44px; left: 0; min-width: 220px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-menu); padding: 6px; display: flex; flex-direction: column; z-index: 30; }
.menu--right .menu__panel { left: auto; right: 0; }
.menu__item { padding: 9px 12px; border-radius: 6px; color: var(--ink); font-size: 14px; text-align: left; border: 0; background: transparent; cursor: pointer; display: block; }
.menu__item:hover { background: var(--bg); color: var(--ink); }
.menu__item--danger { color: var(--danger); }
.menu__sep { height: 1px; background: var(--line); margin: 6px 4px; }

/* Page */
.page { padding: 24px 28px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.page-title { font-weight: 700; font-size: 30px; line-height: 1.1; }
.page-sub { font-size: 14px; color: var(--muted); margin-top: 2px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); }
.card--pad { padding: 18px 20px; }
.card__title { font-family: var(--font-cond); font-weight: 700; font-size: 18px; }
.card__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.grid { display: grid; gap: 16px; }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.lbl { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.val { font-size: 15px; color: var(--ink); }
.val--strong { font-weight: 600; }
.val--reg { font-family: var(--font-cond); font-weight: 600; font-size: 18px; letter-spacing: .03em; }
.val--big { font-family: var(--font-cond); font-weight: 700; font-size: 22px; }
.val--muted { color: var(--faint); }
.kv { display: flex; flex-direction: column; gap: 3px; }
.kv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }

/* Buttons */
.btn { height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface); color: var(--ink-2); font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--bg-2); }
.btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; } .btn--primary:hover { background: var(--brand-dark); }
.btn--accent { background: var(--accent); border-color: var(--accent); color: #fff; } .btn--accent:hover { background: var(--accent-dark); color: #fff; }
.btn--ghost { color: var(--brand); }
.btn--danger { color: var(--danger); }
.btn--sm { height: 36px; padding: 0 14px; }
.btn--xs { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 6px; }
.btn--lg { height: 48px; font-size: 16px; }
.btn--block { width: 100%; }
.btn--dashed { border-style: dashed; color: var(--brand); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* Fields */
.fieldset { display: flex; flex-direction: column; gap: 6px; }
.fieldset__label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field { display: flex; align-items: center; gap: 10px; min-height: 42px; border: 1px solid #d5d6e3; border-radius: var(--r-ctl); padding: 0 12px; background: var(--surface); color: var(--muted); }
[data-theme="dark"] .field { border-color: #3a3958; }
.field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(36,130,195,.18); }
.field input, .field select, .field textarea { flex-grow: 1; min-width: 0; border: 0; outline: 0; font: inherit; font-size: 14px; color: var(--ink); background: transparent; padding: 0; }
.field select { padding-right: 4px; }
.field textarea { padding: 10px 0; resize: vertical; min-height: 72px; }
.field--textarea { align-items: flex-start; }
.field--lg { min-height: 46px; } .field--lg input { font-size: 15px; }
.field--reg input { font-family: var(--font-cond); letter-spacing: .04em; font-size: 16px; }
.field__toggle { border: 0; background: transparent; color: var(--accent); font-size: 13px; font-weight: 600; cursor: pointer; padding: 4px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--muted); }
.check input[type="checkbox"] { appearance: none; -webkit-appearance: none; width: 38px; height: 22px; margin: 0; border-radius: 999px; background: #c9cbdb; position: relative; cursor: pointer; transition: background .2s ease; flex-shrink: 0; }
.check input[type="checkbox"]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 999px; background: #fff; box-shadow: 0 1px 3px rgba(27,26,58,.3); transition: transform .2s cubic-bezier(.2,.8,.2,1); }
.check input[type="checkbox"]:checked { background: var(--brand); }
.check input[type="checkbox"]:checked::after { transform: translateX(16px); }
.check input[type="checkbox"]:focus-visible { outline: 3px solid rgba(36,130,195,.35); outline-offset: 2px; }
[data-theme="dark"] .check input[type="checkbox"] { background: #3a3958; }
.check { color: var(--ink-2); font-size: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.form-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid--21 { grid-template-columns: 2fr 1fr; }
.form-error { background: #fdf0f3; border: 1px solid #f3c4ce; color: #a4213d; border-radius: var(--r-ctl); padding: 10px 12px; font-size: 14px; margin-bottom: 14px; }
.alert { display: flex; align-items: center; gap: 10px; border-radius: var(--r-ctl); padding: 10px 12px; font-size: 14px; }
.alert--danger { background: #fdf0f3; border: 1px solid #f3c4ce; color: #a4213d; }
.alert--ok { background: var(--chip-done-bg); border: 1px solid #bfe7cf; color: var(--chip-done-fg); }
.alert--warn { background: var(--chip-late-bg); border: 1px solid #f3dea0; color: var(--chip-late-fg); }

/* Pills, chips, tags */
.pills { display: inline-flex; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 4px; }
.pill { height: 34px; padding: 0 16px; border: 0; border-radius: var(--r-pill); font-size: 14px; font-weight: 600; cursor: pointer; background: transparent; color: var(--ink-2); display: inline-flex; align-items: center; }
.pill.is-active { background: var(--brand); color: #fff; }
.chip { display: inline-flex; align-items: center; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; border-radius: var(--r-pill); padding: 2px 8px; }
.chip--active { background: var(--chip-active-bg); color: var(--chip-active-fg); }
.chip--late { background: var(--chip-late-bg); color: var(--chip-late-fg); }
.chip--complete { background: var(--chip-done-bg); color: var(--chip-done-fg); }
.chip--cancelled, .chip--off { background: var(--chip-off-bg); color: var(--chip-off-fg); }
.chip--lg { font-size: 11px; padding: 4px 10px; }
.tag { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; border-radius: var(--r-pill); padding: 4px 10px; background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.tag.is-on { background: var(--brand); color: #fff; border-color: var(--brand); }
.tag--md { font-size: 13px; padding: 6px 12px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.reg { font-family: var(--font-cond); font-weight: 600; font-size: 16px; letter-spacing: .03em; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; display: inline-block; }
.reg--lg { font-size: 18px; padding: 3px 10px; }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; padding: 12px 18px; background: var(--bg-2); border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.table td { padding: 12px 18px; border-bottom: 1px solid var(--line-2); vertical-align: middle; font-size: 14px; }
.table tr:last-child td { border-bottom: 0; }
.table--rows tbody tr { cursor: pointer; }
.table--rows tbody tr:hover td { background: var(--bg-2); }
.table--rows tbody tr.is-selected td { background: #eef3fb; }
.table--rows tbody tr.is-selected td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.table .num { font-family: var(--font-cond); font-weight: 700; font-size: 17px; color: var(--brand); }
.table .dim { color: var(--ink-2); }
.table .ell { max-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table--tight th, .table--tight td { padding: 10px 20px; }

/* Tabs */
.tabs { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab { height: 42px; padding: 0 16px; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; background: transparent; font-size: 15px; font-weight: 600; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.tab.is-active { border-bottom-color: var(--accent); color: var(--brand); }
.tab__count { font-size: 12px; font-weight: 700; background: var(--bg); border-radius: var(--r-pill); padding: 1px 7px; color: var(--muted); }

/* Modal */
.modal { border: 0; padding: 0; background: transparent; max-width: none; max-height: none; width: 100vw; height: 100vh; }
.modal::backdrop { background: rgba(27,26,58,.45); }
.modal[open] { display: flex; align-items: center; justify-content: center; animation: modal-backdrop .22s ease-out both; }
.modal[open] .modal__box { animation: modal-in .26s cubic-bezier(.2,.8,.2,1) both; }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes modal-backdrop { from { opacity: 0; } to { opacity: 1; } }
.modal::backdrop { animation: modal-backdrop .22s ease-out both; }
@media (prefers-reduced-motion: reduce) { .modal[open], .modal[open] .modal__box, .modal::backdrop { animation: none; } }
.modal__box { width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-modal); color: var(--ink); }
.modal__box:empty { display: none; }
.modal__box--sm { width: min(460px, calc(100vw - 32px)); } .modal__box--md { width: min(560px, calc(100vw - 32px)); } .modal__box--lg { width: min(820px, calc(100vw - 32px)); }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--line); gap: 16px; }
.modal__title { font-family: var(--font-cond); font-weight: 700; font-size: 24px; }
.modal__sub { font-size: 13px; color: var(--muted); }
.modal__close { width: 36px; height: 36px; border: 0; border-radius: var(--r-ctl); background: var(--bg); color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.modal__body { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.modal__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--line); background: var(--bg-2); border-radius: 0 0 14px 14px; }
.modal__foot-note { font-size: 13px; color: var(--muted); }
.modal__actions { display: flex; gap: 10px; margin-left: auto; }

/* Misc */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r-ctl); font-size: 14px; box-shadow: var(--shadow-menu); z-index: 60; margin: 0; border: 0; inset: auto auto 24px 50%; max-width: min(560px, 90vw); }
.toast:popover-open { display: block; }
[data-theme="dark"] .toast { background: var(--brand); }
.dot { width: 8px; height: 8px; border-radius: var(--r-pill); display: inline-block; flex-shrink: 0; }
.dot--ok { background: var(--ok); } .dot--warn { background: var(--warn); } .dot--off { background: var(--silver); }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mt { margin-top: 12px; }
.divider { height: 1px; background: var(--line); }
.placeholder-box { border-radius: var(--r-ctl); background: #e9ecf4; border: 1px dashed #c9cbdb; display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--muted); }

/* Login */
.login-page { background: var(--bg); }
.login { min-height: 100vh; display: flex; }
.login__panel { width: 44%; min-width: 420px; background: #322483; color: #fff; position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 56px; }
.login__diamond { position: absolute; right: -300px; bottom: -220px; opacity: .16; }
.login__brand { position: relative; width: 340px; } .login__brand .login__hero { width: 100%; height: auto; display: block; }
.login__brandname { font-weight: 700; font-size: 22px; letter-spacing: .04em; text-transform: uppercase; }
.login__copy { position: relative; display: flex; flex-direction: column; gap: 18px; max-width: 460px; }
.login__headline { font-weight: 700; font-size: 64px; line-height: 1.02; letter-spacing: -.01em; text-wrap: pretty; }
.login__sub { font-size: 18px; line-height: 1.5; color: rgba(255,255,255,.82); text-wrap: pretty; }
.login__foot { position: relative; font-size: 13px; color: rgba(255,255,255,.6); }
.login__main { flex-grow: 1; display: flex; align-items: center; justify-content: center; padding: 32px; }
.login__col { width: 420px; display: flex; flex-direction: column; gap: 28px; }
.login__logo { width: 320px; margin: 0 auto; } .login__logo svg { width: 100%; height: auto; display: block; }
.login__card { padding: 32px; display: flex; flex-direction: column; gap: 20px; box-shadow: var(--shadow-card); }
.login__title { font-weight: 700; font-size: 28px; line-height: 1.1; }
.login__hint { font-size: 14px; color: var(--muted); margin-top: 4px; }
.login__card .field { min-height: 46px; padding: 0 14px; } .login__card .field input { font-size: 15px; }
.login__row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); }
.login__version { text-align: center; font-size: 12px; color: var(--faint); }
@media (max-width: 900px) { .login__panel { display: none; } .login__col { width: 100%; max-width: 420px; } }

/* Error pages */
.error-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.error-box { text-align: center; }
.error-code { font-weight: 700; font-size: 48px; color: var(--brand); }

/* Responsive shell */
@media (max-width: 1100px) { .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .span-2 { grid-column: span 2; } .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .topbar { padding: 0 14px; gap: 12px; } .page { padding: 16px 14px; } .grid--3, .grid--2, .form-grid { grid-template-columns: 1fr; } .span-2 { grid-column: auto; } .user__name { display: none; } }

/* Jobs overview */
.jobs { display: flex; gap: 24px; align-items: flex-start; }
.jobs__main { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.jobs__rail { width: 280px; flex-shrink: 0; display: flex; flex-direction: column; gap: 16px; }
.rail-card .card__title { margin: 0; }
.search { display: flex; gap: 10px; }
.search__field { flex-grow: 1; padding-left: 0; overflow: hidden; }
.search__type { height: 100%; padding: 0 12px; border-right: 1px solid var(--line); background: var(--bg-2); color: var(--ink-2); font-weight: 600; flex-grow: 0; min-width: 120px; }
.search__clear { font-size: 13px; font-weight: 600; padding-right: 4px; }
.field--select { min-height: 36px; padding: 0 8px; }
.field--select select { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.jobs__table { overflow: hidden; }
.table-wrap { overflow-x: auto; }
.jobs-table th:nth-child(1) { width: 92px; } .jobs-table th:nth-child(2) { width: 104px; } .jobs-table th:nth-child(3) { width: 92px; }
.jobs-table th:nth-child(6), .jobs-table th:nth-child(7), .jobs-table th:nth-child(8) { width: 84px; }
.jobs-table th:nth-child(4) { width: 17%; } .jobs-table th:nth-child(5) { width: 11%; }
.jobs-table td { white-space: nowrap; }
.jobs-table td:last-child { white-space: normal; max-width: none; overflow: visible; line-height: 1.3; }
.jobs-table th, .jobs-table td { padding-left: 12px; padding-right: 12px; } .jobs-table th:first-child, .jobs-table td:first-child { padding-left: 18px; }
.jobs-table tr.tone-late td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.jobs-table tr.tone-warn td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.jobs-table tr.tone-done td:first-child { box-shadow: inset 3px 0 0 var(--ok); }
.pager { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-top: 1px solid var(--line); gap: 12px; flex-wrap: wrap; }
.empty { padding: 48px 24px; text-align: center; }
.empty__title { font-weight: 700; font-size: 22px; margin-bottom: 4px; }
@media (max-width: 1100px) { .jobs { flex-direction: column; } .jobs__rail { width: 100%; flex-direction: row; flex-wrap: wrap; } .jobs__rail .rail-card { flex: 1 1 260px; } }

/* Job page */
.job-head { padding: 16px 20px; display: flex; align-items: center; gap: 18px; margin-bottom: 14px; }
.job-head__main { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.job-head__num { font-weight: 700; font-size: 30px; line-height: 1; color: var(--brand); }
.tabpanel .card__title { margin: 0; }
.calls { display: flex; flex-direction: column; }
.call { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); align-items: flex-start; }
.call:last-child { border-bottom: 0; }
.call__body { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.call__meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.call__note { font-size: 14px; line-height: 1.45; white-space: pre-line; word-break: break-word; }
.call__del { width: 28px; height: 28px; border: 0; color: var(--faint); opacity: 0; }
.call:hover .call__del { opacity: 1; }
.inv-grid { display: grid; grid-template-columns: 1fr 64px 96px 78px 90px 104px 36px; gap: 8px; align-items: center; }
.inv-parties { display: flex; justify-content: space-between; gap: 16px; padding: 12px 14px; background: var(--bg); border-radius: var(--r-ctl); }
.inv-row .field select { padding: 0; font-size: 13px; }
.inv-grid--head { margin-bottom: -6px; }
.inv-row .field { min-height: 40px; }
.inv-row__del { width: 32px; height: 32px; border: 0; background: transparent; color: var(--faint); }
.inv-totals { width: 280px; margin-left: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.upload { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border: 1px dashed #c9cbdb; border-radius: var(--r-ctl); background: var(--bg); cursor: pointer; }
.upload.is-over { border-color: var(--accent); background: var(--chip-active-bg); }
.upload__text { font-size: 14px; color: var(--ink-2); }
.photo-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.photo { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); }
@media (max-width: 900px) { .job-head { flex-wrap: wrap; } .tabpanel .grid[style] { grid-template-columns: 1fr !important; } .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .inv-grid { grid-template-columns: 1fr 52px 76px 64px 74px 84px 32px; } }

/* Complete logo animation (design/logo): cyan edge draws in, band fades, wordmark rises, one sheen pass */
.ctl-logo .edge { stroke-dasharray: 966; stroke-dashoffset: 966; animation: ctl-draw .8s ease-out forwards; }
.ctl-logo .wordmark { opacity: 0; transform: translateY(8px); animation: ctl-rise .55s ease-out .45s forwards; }
.ctl-logo .band, .ctl-logo .inner { opacity: 0; animation: ctl-fade .5s ease-out .15s forwards; }
.ctl-logo .sheen { transform: translateX(-140px); opacity: 0; animation: ctl-sheen .55s ease-in-out .8s forwards; }
.ctl-logo--static .edge, .ctl-logo--static .wordmark, .ctl-logo--static .band, .ctl-logo--static .inner, .ctl-logo--static .sheen { animation: none; opacity: 1; transform: none; stroke-dashoffset: 0; }
@keyframes ctl-draw { to { stroke-dashoffset: 0; } }
@keyframes ctl-rise { to { opacity: 1; transform: translateY(0); } }
@keyframes ctl-fade { to { opacity: 1; } }
@keyframes ctl-sheen { 0% { opacity: 0; transform: translateX(-140px); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateX(720px); } }
@media (prefers-reduced-motion: reduce) { .ctl-logo .edge, .ctl-logo .wordmark, .ctl-logo .band, .ctl-logo .inner, .ctl-logo .sheen { animation: none; opacity: 1; transform: none; stroke-dashoffset: 0; } }

/* Staff chat drawer */
.chat-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(380px, 100vw); background: var(--surface); border-left: 1px solid var(--line); box-shadow: -12px 0 32px -20px rgba(27,26,58,.5); z-index: 45; display: flex; flex-direction: column; transform: translateX(100%); transition: transform .28s cubic-bezier(.2,.8,.2,1); }
.chat-drawer.is-open { transform: none; }
.chat-drawer[hidden] { display: flex !important; transform: translateX(100%); pointer-events: none; }
.chat-drawer__head { height: 60px; background: #322483; color: #fff; display: flex; align-items: center; gap: 8px; padding: 0 12px 0 14px; flex-shrink: 0; }
.chat-drawer__title { flex-grow: 1; min-width: 0; }
.chat-drawer__people { overflow: auto; flex-grow: 1; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.chat-person { display: flex; align-items: center; gap: 10px; padding: 10px; border: 0; background: transparent; border-radius: 10px; text-align: left; cursor: pointer; color: var(--ink); width: 100%; }
.chat-person:hover { background: var(--bg); }
.chat-person__body { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.chat-person__name { font-weight: 600; font-size: 14px; }
.chat-drawer__thread { display: flex; flex-direction: column; flex-grow: 1; min-height: 0; }
.chat-messages { flex-grow: 1; overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 6px; background: var(--bg); }
.chat-day { align-self: center; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin: 6px 0 2px; }
.chat-bubble { max-width: 82%; align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; padding: 8px 12px; font-size: 14px; line-height: 1.4; }
.chat-bubble--mine { align-self: flex-end; background: var(--brand); border-color: var(--brand); color: #fff; border-radius: 14px 14px 4px 14px; }
.chat-bubble--unseen { opacity: .85; }
.chat-bubble__time { font-size: 11px; opacity: .65; margin-top: 3px; text-align: right; }
.chat-bubble .emoji { height: 22px; vertical-align: middle; }
.chat-compose { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: var(--surface); align-items: flex-end; }
.chat-compose textarea { flex-grow: 1; resize: none; border: 1px solid #d5d6e3; border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 14px; background: var(--surface); color: var(--ink); outline: 0; }
.chat-compose textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(36,130,195,.18); }
@media (prefers-reduced-motion: reduce) { .chat-drawer { transition: none; } }

/* Custom dropdowns (select.js) */
.dd { position: relative; display: flex; flex-grow: 1; min-width: 0; }
.dd__native { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.dd__btn { flex-grow: 1; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 14px; padding: 0; height: 100%; min-height: 40px; cursor: pointer; text-align: left; }
.dd__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd__label--placeholder { color: var(--faint); }
.dd__btn svg { color: var(--muted); flex-shrink: 0; transition: transform .18s ease; }
.dd.is-open .dd__btn svg { transform: rotate(180deg); }
.dd__menu { position: absolute; top: calc(100% + 6px); left: -12px; right: -12px; min-width: 180px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-menu); padding: 6px; overflow: auto; z-index: 60; animation: dd-in .16s cubic-bezier(.2,.8,.2,1) both; }
.dd--up .dd__menu { top: auto; bottom: calc(100% + 6px); }
.dd__item { padding: 9px 12px; border-radius: 6px; font-size: 14px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd__item:hover { background: var(--bg); }
.dd__item.is-selected { background: var(--brand); color: #fff; }
.dd__item.is-disabled { color: var(--faint); cursor: default; }
.field--select .dd__btn { min-height: 34px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.dd--flush .dd__btn { padding: 0 12px; background: var(--bg-2); border-right: 1px solid var(--line); color: var(--ink-2); font-weight: 600; min-width: 130px; }
.dd--flush { flex-grow: 0; height: 100%; }
.dd--flush .dd__menu { left: 0; right: auto; }
.search__field .dd--flush + svg { margin-left: 12px; }
@keyframes dd-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
[data-theme="dark"] .dd__menu { border-color: #3a3958; }
/* dark-mode native controls that remain (date/time pickers, file) */
[data-theme="dark"] input[type="date"], [data-theme="dark"] input[type="time"], [data-theme="dark"] input[type="number"] { color-scheme: dark; }
@media (prefers-reduced-motion: reduce) { .dd__menu { animation: none; } }

/* Create-job wizard */
.wizard { display: grid; grid-template-columns: 200px minmax(0, 1fr); min-height: 420px; }
.wizard__steps { list-style: none; margin: 0; padding: 18px 12px; border-right: 1px solid var(--line); background: var(--bg-2); display: flex; flex-direction: column; gap: 4px; }
.wizard__step { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--muted); cursor: default; }
.wizard__step.is-reachable { cursor: pointer; }
.wizard__step.is-reachable:hover { background: var(--bg); }
.wizard__step.is-active { background: var(--surface); color: var(--brand); box-shadow: 0 1px 2px rgba(27,26,58,.08); }
.wizard__num { width: 24px; height: 24px; border-radius: 999px; background: var(--line); color: var(--ink-2); font-family: var(--font-cond); font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.wizard__step.is-active .wizard__num { background: var(--brand); color: #fff; }
.wizard__step.is-done .wizard__num { background: var(--ok); color: #fff; font-size: 0; }
.wizard__step.is-done .wizard__num::before { content: "✓"; font-size: 12px; }
.wizard__body { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.wizard__title { font-family: var(--font-cond); font-weight: 700; font-size: 22px; }
.summary { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.summary__row { display: grid; grid-template-columns: 140px minmax(0, 1fr) 40px; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line-2); align-items: start; cursor: pointer; }
.summary__row:last-child { border-bottom: 0; }
.summary__row:hover { background: var(--bg-2); }
.summary__val { font-size: 14px; line-height: 1.4; }
@media (max-width: 760px) { .wizard { grid-template-columns: 1fr; } .wizard__steps { flex-direction: row; overflow: auto; border-right: 0; border-bottom: 1px solid var(--line); } .wizard__label { display: none; } }

.modal--confirm .modal__box { padding: 0; }
.modal--confirm form { margin: 0; }

/* Rail card tabs */
.rail-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -4px 0 12px; }
.rail-tab { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; background: transparent; font-family: var(--font-cond); font-weight: 700; font-size: 16px; color: var(--muted); cursor: pointer; }
.rail-tab.is-active { color: var(--brand); border-bottom-color: var(--accent); }
.rail-tab .chip { font-size: 11px; padding: 1px 7px; }
