/* =============================================================
   Proscreen UI — ps.css  ("Modernist" reskin, 2026-09-04)
   Source: Claude Design mockup Customers-D-Modern. Archivo, blue accent,
   white panels on warm grey. Class names unchanged from the first build.
   ============================================================= */

/* ---------- font ---------- */
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 100 900; font-stretch: 100%; font-display: swap; src: url("../fonts/archivo-vietnamese.woff2") format("woff2"); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 100 900; font-stretch: 100%; font-display: swap; src: url("../fonts/archivo-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 100 900; font-stretch: 100%; font-display: swap; src: url("../fonts/archivo-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- tokens ---------- */
:root {
  --ps-bg: #f4f3f2;
  --ps-surface: #ffffff;
  --ps-surface-2: #fbfbfa;
  --ps-surface-3: #f4f3f2;
  --ps-line: #e6e4e3;
  --ps-line-strong: #cfcccb;
  --ps-ink: #201e1d;
  --ps-ink-2: #605d5d;
  --ps-ink-3: #7d7979;
  --ps-ink-4: #9b9797;
  --ps-accent: #2563D9;
  --ps-accent-2: #1c4fb4;
  --ps-accent-soft: #eef3fd;
  --ps-accent-soft-2: #d3e0fa;
  --ps-accent-mid: #163c8b;
  --ps-accent-deep: #112c66;
  --ps-ok: #163c8b;        --ps-ok-soft: #eef3fd;
  --ps-warn: #8a5a12;      --ps-warn-soft: #fdf3e3;   --ps-warn-dot: #e8a13a;
  --ps-bad: #b3260f;       --ps-bad-soft: #fdecea;    --ps-bad-strong: #ec3013;
  --ps-purple: #6f6bd8;
  --ps-focus: #2563D9;

  --ps-s1: 4px; --ps-s2: 8px; --ps-s3: 12px; --ps-s4: 16px;
  --ps-s5: 20px; --ps-s6: 24px; --ps-s8: 32px; --ps-s10: 40px;

  --ps-r-lg: 14px; --ps-r-md: 10px; --ps-r-sm: 8px; --ps-r-pill: 999px;
  --ps-shadow-card: 0 1px 2px rgba(32,30,29,.04);
  --ps-shadow: 0 12px 32px rgba(32,30,29,.16);

  --ps-font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ps-fs-xs: 12px; --ps-fs-sm: 13px; --ps-fs-md: 14px; --ps-fs-lg: 17px;
  --ps-fs-xl: 20px; --ps-fs-2xl: 23px; --ps-fs-3xl: 32px;

  --ps-sidebar-w: 252px; --ps-rail-w: 64px; --ps-topbar-h: 62px;
  --ps-control-h: 38px; --ps-control-h-sm: 32px; --ps-row-h: 54px;
  --ps-gutter: var(--ps-s6);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ps-bg); color: var(--ps-ink); font: 400 var(--ps-fs-md)/1.5 var(--ps-font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, canvas, iframe { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: var(--ps-accent-mid); text-decoration: none; }
a:hover { color: var(--ps-accent-deep); }
:focus-visible { outline: 2px solid var(--ps-focus); outline-offset: 2px; }
[hidden] { display: none !important; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #dedbd9; border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }

/* ---------- type ---------- */
.ps-h1 { font-size: var(--ps-fs-xl); font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.ps-h2 { font-size: var(--ps-fs-lg); font-weight: 700; letter-spacing: -.01em; line-height: 1.3; }
.ps-h3 { font-size: 15px; font-weight: 700; line-height: 1.3; }
.ps-muted { color: var(--ps-ink-3); font-size: var(--ps-fs-sm); }
.ps-sub { color: var(--ps-ink-2); font-size: var(--ps-fs-sm); }
.ps-num { font-variant-numeric: tabular-nums; text-align: right; }
.ps-text-bad { color: var(--ps-bad); }
.ps-text-ok { color: var(--ps-ok); }
.ps-kicker { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ps-ink-4); }
.ps-visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ps-skip { position: absolute; left: -999px; top: 8px; background: var(--ps-surface); padding: 8px 12px; border-radius: var(--ps-r-sm); z-index: 100; }
.ps-skip:focus { left: 8px; }

/* ---------- icon ---------- */
.ps-icon { width: 17px; height: 17px; flex: 0 0 auto; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ps-icon--sm { width: 15px; height: 15px; }
.ps-icon--lg { width: 22px; height: 22px; }

/* ---------- shell ---------- */
.ps-app { display: grid; grid-template-columns: var(--ps-sidebar-w) 1fr; min-height: 100vh; transition: grid-template-columns 180ms ease; }
.ps-app.is-rail { grid-template-columns: var(--ps-rail-w) 1fr; }
.ps-app--driver { grid-template-columns: 1fr; }
.ps-main { min-width: 0; display: flex; flex-direction: column; }
.ps-page { width: 100%; max-width: 1480px; margin: 0 auto; padding: var(--ps-s5) var(--ps-gutter) calc(var(--ps-s10) * 2); display: flex; flex-direction: column; gap: var(--ps-s4); }
.ps-page__body { display: flex; flex-direction: column; gap: var(--ps-s4); }
.ps-page__actions { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: var(--ps-s2); padding: var(--ps-s3) 0; margin-top: var(--ps-s2); background: linear-gradient(to top, var(--ps-bg) 70%, transparent); }

/* ---------- sidebar ---------- */
.ps-side { position: sticky; top: 0; height: 100vh; background: var(--ps-surface); border-right: 1px solid var(--ps-line); display: flex; flex-direction: column; min-width: 0; overflow: visible; }
.ps-side__brand { flex-shrink: 0; transition: padding 180ms ease; height: var(--ps-topbar-h); display: flex; align-items: center; padding: 0 18px; border-bottom: 1px solid var(--ps-line); }
.ps-side__brand a { display: flex; align-items: center; max-width: 100%; }
.ps-side__brand .ps-side__logo { display: block; width: auto; height: 52px; max-width: 100%; object-fit: contain; transition: max-width 180ms ease; }
.ps-side__nav { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; padding: var(--ps-s2) 14px 64px; display: flex; flex-direction: column; gap: 14px; }
.ps-side__group { display: flex; flex-direction: column; gap: 2px; }
.ps-side__label { font-size: 10px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--ps-ink-4); padding: 4px 10px 6px; }
.ps-side__link { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--ps-r-md); color: #444141; font-weight: 400; font-size: var(--ps-fs-md); white-space: nowrap; }
.ps-side__link .ps-icon { flex-shrink: 0; opacity: .75; width: 18px; height: 18px; stroke-width: 1.7; }
.ps-side__link:hover { background: var(--ps-surface-3); color: var(--ps-ink); }
.ps-side__link.is-active { background: var(--ps-accent-soft); color: var(--ps-accent-deep); font-weight: 600; }
.ps-side__link.is-active .ps-icon { opacity: 1; }
.ps-side__toggle { position: absolute; bottom: 18px; left: 18px; z-index: 31; display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 1px solid rgb(255 255 255 / 80%); border-radius: 8px; background: rgb(255 255 255 / 12%); backdrop-filter: blur(3px) saturate(140%); -webkit-backdrop-filter: blur(3px) saturate(140%); box-shadow: 0 3px 10px rgb(22 33 28 / 8%), inset 0 1px 0 rgb(255 255 255 / 65%), 0 0 0 1px rgb(22 33 28 / 8%); color: var(--ps-ink-3); transition: background-color 180ms ease, color 180ms ease; }
.ps-side__toggle:hover { background: rgb(255 255 255 / 22%); color: var(--ps-ink); }
.ps-side__toggle .ps-icon { width: 16px; height: 16px; transition: transform 180ms ease; }
.ps-side__link { transition: padding 180ms ease, background-color 180ms ease, color 180ms ease; }
.is-rail .ps-side__brand { justify-content: center; padding: 0; }
.is-rail .ps-side__brand .ps-side__logo { max-width: 52px; }
.is-rail .ps-side__label, .is-rail .ps-side__text { display: none; }
.is-rail .ps-side__link { justify-content: center; padding: 0; height: 40px; }
.is-rail .ps-side__toggle .ps-icon { transform: rotate(180deg); }
.ps-side__scrim { display: none; }

/* ---------- topbar ---------- */
.ps-top { position: sticky; top: 0; z-index: 30; height: var(--ps-topbar-h); background: var(--ps-surface); border-bottom: 1px solid var(--ps-line); display: flex; align-items: center; gap: 14px; padding: 0 var(--ps-gutter); }
.ps-top__menu { display: none; }
.ps-top .ps-top__menu { display: none; }
.ps-top__crumbs { flex: 0 1 auto; min-width: 0; display: flex; align-items: center; }
.ps-top__title { font-size: var(--ps-fs-xl); font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-top__user { position: relative; margin-left: auto; display: flex; align-items: center; gap: 12px; }
.ps-top__who { display: none; }
.ps-top__avatar { display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 8px 0 4px; border: 1px solid var(--ps-line); border-radius: var(--ps-r-pill); background: var(--ps-surface); color: var(--ps-ink); }
.ps-top__avatar:hover { background: var(--ps-surface-2); }
.ps-top__avatar .ps-top__initials { width: 26px; height: 26px; border-radius: 50%; background: var(--ps-accent-soft-2); color: var(--ps-accent-deep); display: grid; place-items: center; font-size: 10px; font-weight: 700; }
.ps-top__avatar .ps-icon { opacity: .5; width: 13px; height: 13px; }
.ps-menu { position: absolute; top: calc(100% + 8px); right: 0; min-width: 200px; background: var(--ps-surface); border: 1px solid var(--ps-line); border-radius: var(--ps-r-lg); box-shadow: var(--ps-shadow); padding: 6px; z-index: 50; display: none; }
.ps-menu.is-open { display: block; }
.ps-menu__item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: var(--ps-r-sm); color: var(--ps-ink); font-size: var(--ps-fs-sm); font-weight: 500; text-align: left; }
.ps-menu__item:hover { background: var(--ps-surface-3); color: var(--ps-ink); }
.ps-menu__item--bad { color: var(--ps-bad-strong); }
.ps-menu__item--bad:hover { background: var(--ps-bad-soft); color: var(--ps-bad-strong); }
.ps-menu__sep { height: 1px; background: var(--ps-line); margin: 4px 0; }

/* ---------- tab bar (phone) ---------- */
.ps-tabbar { display: none; }
.ps-more { display: none; }

/* ---------- buttons ---------- */
.ps-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: var(--ps-control-h); padding: 0 15px; border-radius: var(--ps-r-md); font-size: var(--ps-fs-sm); font-weight: 600; border: 1px solid transparent; white-space: nowrap; transition: background .12s, border-color .12s, color .12s; }
.ps-btn .ps-icon { width: 15px; height: 15px; }
.ps-btn:disabled { opacity: .5; cursor: not-allowed; }
.ps-btn--primary { background: var(--ps-accent); color: #fff; font-weight: 700; }
.ps-btn--primary:hover:not(:disabled) { background: var(--ps-accent-2); color: #fff; }
.ps-btn--secondary { background: var(--ps-surface); color: var(--ps-ink); border-color: var(--ps-line); padding: 0 13px; }
.ps-btn--secondary:hover:not(:disabled) { background: var(--ps-surface-2); color: var(--ps-ink); }
.ps-btn--ghost { background: transparent; color: var(--ps-ink-2); }
.ps-btn--ghost:hover:not(:disabled) { background: var(--ps-surface-3); color: var(--ps-ink); }
.ps-btn--danger { background: var(--ps-bad-soft); color: var(--ps-bad-strong); }
.ps-btn--danger:hover:not(:disabled) { background: var(--ps-bad-strong); color: #fff; }
.ps-btn--dark { background: var(--ps-ink); color: #fff; }
.ps-btn--dark:hover:not(:disabled) { background: #3a3736; color: #fff; }
.ps-btn--sm { height: var(--ps-control-h-sm); padding: 0 12px; font-size: var(--ps-fs-xs); }
.ps-btn--lg { height: 46px; font-size: var(--ps-fs-md); }
.ps-btn--icon { width: var(--ps-control-h); padding: 0; }
.ps-btn--icon.ps-btn--sm { width: var(--ps-control-h-sm); }
.ps-btn--block { width: 100%; }

/* ---------- forms ---------- */
.ps-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--ps-s4); }
.ps-grid + .ps-grid { margin-top: var(--ps-s4); }
.ps-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.ps-field--2 { grid-column: span 2; }
.ps-field--full { grid-column: 1 / -1; }
.ps-field__label { font-size: var(--ps-fs-xs); font-weight: 600; color: var(--ps-ink-2); }
.ps-field__req { color: var(--ps-bad-strong); margin-left: 2px; }
.ps-field__help { font-size: var(--ps-fs-xs); color: var(--ps-ink-3); }
.ps-field__error { font-size: var(--ps-fs-xs); color: var(--ps-bad); font-weight: 600; }
.ps-input, .ps-select, .ps-textarea { width: 100%; background: var(--ps-surface); border: 1px solid var(--ps-line); border-radius: var(--ps-r-md); padding: 0 var(--ps-s3); height: var(--ps-control-h); font-size: var(--ps-fs-sm); color: var(--ps-ink); caret-color: var(--ps-accent); transition: border-color .12s, box-shadow .12s; }
.ps-input::placeholder, .ps-textarea::placeholder { color: var(--ps-ink-4); }
.ps-input:hover, .ps-select:hover, .ps-textarea:hover { border-color: var(--ps-line-strong); }
.ps-input:focus, .ps-select:focus, .ps-textarea:focus { outline: none; border-color: var(--ps-accent); box-shadow: 0 0 0 3px var(--ps-accent-soft); }
.ps-input[readonly] { background: var(--ps-surface-2); color: var(--ps-ink-2); }
.ps-input[aria-invalid="true"], .ps-select[aria-invalid="true"], .ps-textarea[aria-invalid="true"] { border-color: var(--ps-bad-strong); }
.ps-input--num { text-align: right; font-variant-numeric: tabular-nums; }
.ps-select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23605d5d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 14px; }
.ps-textarea { height: auto; min-height: 96px; padding: 10px var(--ps-s3); resize: vertical; line-height: 1.5; }
.ps-detail__value { min-height: var(--ps-control-h); display: flex; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--ps-line); font-size: var(--ps-fs-md); word-break: break-word; }
.ps-detail__value--num { justify-content: flex-end; font-variant-numeric: tabular-nums; }
.ps-switch { display: inline-flex; align-items: center; gap: 10px; height: var(--ps-control-h); cursor: pointer; }
.ps-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.ps-switch__track { width: 38px; height: 22px; border-radius: var(--ps-r-pill); background: var(--ps-line-strong); position: relative; transition: background .15s; }
.ps-switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.ps-switch input:checked + .ps-switch__track { background: var(--ps-accent); }
.ps-switch input:checked + .ps-switch__track::after { transform: translateX(16px); }
.ps-switch input:focus-visible + .ps-switch__track { outline: 2px solid var(--ps-focus); outline-offset: 2px; }
.ps-switch__text { font-size: var(--ps-fs-sm); color: var(--ps-ink-2); }
.ps-check { display: inline-flex; align-items: center; gap: var(--ps-s2); font-size: var(--ps-fs-sm); cursor: pointer; }
.ps-check input { width: 17px; height: 17px; accent-color: var(--ps-accent); margin: 0; }
.ps-inline { display: flex; align-items: center; gap: var(--ps-s3); min-height: var(--ps-control-h); }
.ps-inline--end { align-self: end; }
.ps-section-title { font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ps-ink-4); margin: var(--ps-s6) 0 var(--ps-s3); padding-bottom: var(--ps-s2); border-bottom: 1px solid var(--ps-line); }
.ps-section-title:first-child { margin-top: 0; }
.ps-subcard { border: 1px solid var(--ps-line); border-radius: 12px; padding: var(--ps-s4); margin-bottom: var(--ps-s3); background: var(--ps-surface-2); }

/* ---------- searchable select ---------- */
.ps-ss { position: relative; }
.ps-ss__trigger { display: flex; align-items: center; justify-content: space-between; gap: var(--ps-s2); width: 100%; text-align: left; cursor: pointer; }
.ps-ss__trigger .is-placeholder { color: var(--ps-ink-4); }
.ps-ss__trigger > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-ss__trigger .ps-icon { opacity: .5; width: 14px; height: 14px; }
.ps-ss__panel { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 60; background: var(--ps-surface); border: 1px solid var(--ps-line); border-radius: var(--ps-r-lg); box-shadow: var(--ps-shadow); padding: var(--ps-s2); display: flex; flex-direction: column; gap: var(--ps-s2); }
.ps-ss__list { overflow-y: auto; max-height: 240px; display: flex; flex-direction: column; }
.ps-ss__opt { text-align: left; padding: 8px 10px; border-radius: var(--ps-r-sm); color: var(--ps-ink); font-size: var(--ps-fs-sm); }
.ps-ss__opt:hover, .ps-ss__opt:focus { background: var(--ps-surface-3); outline: none; }
.ps-ss__opt.is-selected { color: var(--ps-accent-deep); font-weight: 600; background: var(--ps-accent-soft); }
.ps-ss__opt.is-clear { color: var(--ps-ink-3); font-style: italic; }
.ps-ss__empty { padding: 8px 10px; font-size: var(--ps-fs-sm); color: var(--ps-ink-3); }

/* ---------- panel (list container) ---------- */
.ps-panel { background: var(--ps-surface); background-clip: padding-box; border: 1px solid var(--ps-line); border-radius: var(--ps-r-lg); box-shadow: var(--ps-shadow-card); }
.ps-panel__head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 14px; flex-wrap: wrap; }
.ps-panel__title { font-size: var(--ps-fs-lg); font-weight: 700; letter-spacing: -.01em; }
.ps-panel__sub { font-size: var(--ps-fs-sm); color: var(--ps-ink-3); margin-top: 3px; }
.ps-panel__actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.ps-panel > .ps-toolbar { padding: 0 20px 14px; }
.ps-panel > .ps-table { border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.ps-panel > .ps-table > .ps-table__foot { background: transparent; background-clip: padding-box; }
.ps-panel > .ps-table > :first-child, .ps-panel > .ps-table > :last-child { border-radius: 0; }
.ps-panel > .ps-empty { border-top: 1px solid var(--ps-line); }

/* ---------- tabs ---------- */
.ps-tabs { display: flex; gap: 4px; padding: 0 20px; border-bottom: 1px solid var(--ps-line); overflow-x: auto; }
.ps-tabs__item { display: flex; align-items: center; gap: 7px; padding: 11px 12px 12px; margin-bottom: -1px; border-bottom: 2px solid transparent; font-size: 13.5px; font-weight: 500; color: var(--ps-ink-3); white-space: nowrap; }
.ps-tabs__item:hover { color: var(--ps-ink); }
.ps-tabs__item.is-active { color: var(--ps-ink); font-weight: 600; border-bottom-color: var(--ps-accent); }
.ps-tabs__count { font-size: 11px; font-variant-numeric: tabular-nums; background: var(--ps-surface-3); color: var(--ps-ink-3); padding: 1px 7px; border-radius: var(--ps-r-pill); }
.ps-tabs__item.is-active .ps-tabs__count { background: var(--ps-accent-soft-2); color: var(--ps-accent-deep); }

/* ---------- toolbar (filters) ---------- */
.ps-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ps-toolbar .ps-select, .ps-toolbar .ps-input { width: auto; min-width: 150px; height: 34px; font-size: var(--ps-fs-sm); }
.ps-search { position: relative; flex: 0 1 290px; }
.ps-search .ps-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--ps-ink); opacity: .45; pointer-events: none; }
.ps-search__input { width: 100%; height: 34px; padding: 0 12px 0 32px; border: 1px solid var(--ps-line); border-radius: var(--ps-r-md); background: var(--ps-surface); font-size: var(--ps-fs-sm); color: var(--ps-ink); }
.ps-search__input::placeholder { color: var(--ps-ink-4); }
.ps-search__input:focus { outline: none; border-color: var(--ps-accent); }

/* ---------- tables ---------- */
.ps-table { background: var(--ps-surface); background-clip: padding-box; border: 1px solid var(--ps-line); border-radius: var(--ps-r-lg); overflow: visible; box-shadow: var(--ps-shadow-card); }
.ps-table > :first-child { border-top-left-radius: var(--ps-r-lg); border-top-right-radius: var(--ps-r-lg); }
.ps-table > :last-child { border-bottom-left-radius: var(--ps-r-lg); border-bottom-right-radius: var(--ps-r-lg); }
.ps-card--flush .ps-table > :first-child, .ps-card--flush .ps-table > :last-child, .ps-table--sub > :first-child, .ps-table--sub > :last-child { border-radius: 0; }
.ps-card--flush > .ps-table:last-child > :last-child { border-bottom-left-radius: var(--ps-r-lg); border-bottom-right-radius: var(--ps-r-lg); }
.ps-table__head, .ps-table__row { display: flex; align-items: center; min-height: var(--ps-row-h); padding: 0 20px; gap: 12px; }
.ps-table__head { background: var(--ps-surface-2); background-clip: padding-box; border-bottom: 1px solid var(--ps-line); font-size: var(--ps-fs-xs); font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ps-ink-2); min-height: 40px; }
.ps-table__row { border-bottom: 1px solid var(--ps-line); font-size: 13.5px; }
.ps-table__row > .ps-table__cell:first-child { font-weight: 600; }
.ps-table__record:has(+ .ps-table__foot) .ps-table__row, .ps-table > .ps-table__row:last-child { border-bottom: 0; }
.ps-table__record[data-href] .ps-table__row { cursor: pointer; }
.ps-table__record[data-href] .ps-table__row:hover { background: var(--ps-surface-2); }
.ps-table__cell { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-table__cell--wrap { white-space: normal; }
.ps-table__cell--grow { flex: 2 1 0; }
.ps-table__cell--num { text-align: right; font-variant-numeric: tabular-nums; }
.ps-table__cell--actions { flex: 0 0 104px; display: flex; justify-content: flex-end; overflow: visible; }
.ps-table__head .ps-table__cell--actions { visibility: visible; text-align: right; justify-content: flex-end; }
.ps-table__cell--id { flex: 0 0 110px; font-variant-numeric: tabular-nums; color: var(--ps-ink-2); font-weight: 500 !important; }
.ps-table__cell--tight { flex: 0 0 130px; }
.ps-table__who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ps-table__who > span:last-child { min-width: 0; }
.ps-table__who strong { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-table__who small { display: block; font-size: var(--ps-fs-xs); color: var(--ps-ink-3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-avatar { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--ps-accent-soft-2); color: var(--ps-accent-deep); }
.ps-avatar--1 { background: #e8e6f7; color: #413a7a; }
.ps-avatar--2 { background: #fce9dd; color: #8a4416; }
.ps-avatar--3 { background: #e2eef7; color: #1f4c6b; }
.ps-avatar--4 { background: #f4f3f2; color: #444141; }
.ps-table--sub { border-radius: var(--ps-r-sm); box-shadow: none; }
.ps-table--sub .ps-table__head, .ps-table--sub .ps-table__row { padding: 0 var(--ps-s4); }
.ps-table__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; font-size: var(--ps-fs-sm); color: var(--ps-ink-3); background: var(--ps-surface); background-clip: padding-box; border-top: 1px solid var(--ps-line); flex-wrap: wrap; }
.ps-table__foot strong { color: var(--ps-ink); font-weight: 700; }
.ps-rcard { display: none; }

/* ---------- badges ---------- */
.ps-badge { display: inline-flex; align-items: center; height: 22px; padding: 0 10px; border-radius: var(--ps-r-pill); font-size: var(--ps-fs-xs); font-weight: 600; white-space: nowrap; }
.ps-badge--ok { background: var(--ps-accent-soft); color: var(--ps-accent-mid); }
.ps-badge--accent { background: var(--ps-accent-soft); color: var(--ps-accent-mid); }
.ps-badge--warn { background: var(--ps-warn-soft); color: var(--ps-warn); }
.ps-badge--bad { background: var(--ps-bad-soft); color: var(--ps-bad); }
.ps-badge--neutral { background: var(--ps-surface-3); color: #444141; }
.ps-badge--muted { background: var(--ps-surface-3); color: var(--ps-ink-3); }
.ps-chip { display: inline-flex; align-items: center; font-size: var(--ps-fs-xs); padding: 3px 9px; border-radius: var(--ps-r-pill); background: var(--ps-surface-3); color: #444141; white-space: nowrap; }

/* ---------- action menu (inline icons + more) ---------- */
.ps-actions { position: relative; display: inline-flex; gap: 4px; justify-content: flex-end; color: var(--ps-ink-3); }
.ps-actions form { margin: 0; display: contents; }
.ps-actions__btn { width: 28px; height: 28px; border-radius: var(--ps-r-sm); display: grid; place-items: center; color: inherit; }
.ps-actions__btn .ps-icon { width: 15px; height: 15px; }
.ps-actions__btn:hover { background: #f0efee; color: var(--ps-ink); }
.ps-actions__btn--bad:hover { background: var(--ps-bad-soft); color: var(--ps-bad-strong); }
.ps-actions .ps-menu { top: calc(100% + 4px); }
.ps-actions .ps-menu form { display: block; }

/* ---------- breadcrumb ---------- */
.ps-crumbs { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; font-size: var(--ps-fs-sm); color: var(--ps-ink-4); white-space: nowrap; }
.ps-crumbs a { color: var(--ps-ink-3); }
.ps-crumbs a:hover { color: var(--ps-accent); }
.ps-crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--ps-line-strong); }
.ps-crumbs [aria-current] { color: var(--ps-ink); font-weight: 600; }

/* ---------- page header ---------- */
.ps-phead { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.ps-phead__left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ps-phead__back { width: 34px; height: 34px; border-radius: var(--ps-r-md); display: grid; place-items: center; color: var(--ps-ink-2); border: 1px solid var(--ps-line); background: var(--ps-surface); }
.ps-phead__back:hover { background: var(--ps-surface-2); color: var(--ps-ink); }
.ps-phead__title { font-size: var(--ps-fs-xl); font-weight: 700; letter-spacing: -.01em; line-height: 1.2; overflow-wrap: anywhere; }
.ps-phead__sub { font-size: var(--ps-fs-sm); color: var(--ps-ink-3); margin-top: 2px; }
.ps-phead__right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- cards ---------- */
.ps-card { background: var(--ps-surface); background-clip: padding-box; border: 1px solid var(--ps-line); border-radius: var(--ps-r-lg); box-shadow: var(--ps-shadow-card); padding: 20px; }
.ps-card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.ps-card__title { font-size: var(--ps-fs-lg); font-weight: 700; letter-spacing: -.01em; }
.ps-card--flush { padding: 0; }
.ps-card--flush .ps-card__head { padding: 18px 20px 0; }
.ps-card--flush .ps-table { border: 0; border-radius: 0; box-shadow: none; }
.ps-card--warn { border-color: var(--ps-warn-dot); background: var(--ps-warn-soft); }
.ps-card--bad { border-color: var(--ps-bad-strong); background: var(--ps-bad-soft); }
.ps-note { padding: 10px 14px; border-radius: var(--ps-r-md); font-size: var(--ps-fs-sm); font-weight: 500; }
.ps-note--bad { background: var(--ps-bad-soft); color: var(--ps-bad); }
.ps-note--ok { background: var(--ps-accent-soft); color: var(--ps-accent-mid); }
.ps-note--warn { background: var(--ps-warn-soft); color: var(--ps-warn); }
.ps-note--info { background: var(--ps-accent-soft); color: var(--ps-accent-mid); }
.ps-promo { border: 1px solid var(--ps-line); border-radius: var(--ps-r-lg); padding: 14px; background: var(--ps-surface-2); }
.ps-promo__title { font-size: var(--ps-fs-sm); font-weight: 600; }
.ps-promo__text { font-size: var(--ps-fs-xs); color: var(--ps-ink-3); margin-top: 4px; line-height: 1.45; }

/* ---------- stats ---------- */
.ps-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.ps-stat { display: block; border: 1px solid var(--ps-line); border-radius: 12px; padding: 13px 15px; min-width: 0; background: var(--ps-surface); color: inherit; transition: border-color .12s; }
.ps-stat:hover { border-color: var(--ps-accent-soft-2); color: inherit; }
.ps-stat__top { display: flex; align-items: center; gap: 7px; }
.ps-stat__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ps-accent); flex: none; }
.ps-stat__dot--warn { background: var(--ps-warn-dot); }
.ps-stat__dot--bad { background: var(--ps-bad-strong); }
.ps-stat__dot--purple { background: var(--ps-purple); }
.ps-stat__label { font-size: var(--ps-fs-xs); color: var(--ps-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-stat__value { font-size: var(--ps-fs-2xl); font-weight: 700; letter-spacing: -.02em; margin-top: 7px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ps-stat__note { font-size: var(--ps-fs-xs); color: var(--ps-ink-4); margin-top: 2px; }
.ps-stat__icon { display: none; }

/* ---------- toast ---------- */
.ps-toasts { position: fixed; top: var(--ps-s4); right: var(--ps-s4); z-index: 90; display: flex; flex-direction: column; gap: var(--ps-s2); width: min(360px, calc(100vw - 32px)); }
.ps-toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--ps-r-lg); background: var(--ps-ink); color: #fff; font-size: var(--ps-fs-sm); font-weight: 500; box-shadow: var(--ps-shadow); animation: ps-in .18s ease; }
.ps-toast--ok { border-left: 4px solid var(--ps-accent); }
.ps-toast--bad { border-left: 4px solid var(--ps-bad-strong); }
.ps-toast.is-dismissing { opacity: 0; transform: translateY(-6px); transition: all .25s; }
.ps-toast__x { margin-left: auto; color: rgba(255,255,255,.7); font-size: 18px; line-height: 1; }
.ps-toast__x:hover { color: #fff; }
@keyframes ps-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- pagination ---------- */
.ps-pager { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.ps-pager__btn { min-width: 34px; height: 34px; padding: 0 8px; border: 1px solid var(--ps-line); border-radius: var(--ps-r-md); background: var(--ps-surface); display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: var(--ps-fs-sm); font-weight: 500; color: var(--ps-ink); font-variant-numeric: tabular-nums; }
.ps-pager__btn--text { padding: 0 12px; font-weight: 600; }
.ps-pager__btn .ps-icon { width: 14px; height: 14px; }
.ps-pager__btn:hover:not(:disabled):not(.is-active) { border-color: #a9c4f4; color: var(--ps-ink); background: var(--ps-surface-2); }
.ps-pager__btn.is-active { background: var(--ps-accent); border-color: var(--ps-accent-2); color: #fff; font-weight: 700; }
.ps-pager__btn:disabled { color: var(--ps-ink-4); cursor: not-allowed; }
.ps-pager__gap { min-width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--ps-line); border-radius: var(--ps-r-md); color: var(--ps-ink-3); background: var(--ps-surface); }

/* ---------- empty ---------- */
.ps-empty { display: flex; flex-direction: column; align-items: center; gap: var(--ps-s2); padding: var(--ps-s10) var(--ps-s4); text-align: center; color: var(--ps-ink-3); font-size: var(--ps-fs-sm); }
.ps-empty .ps-icon { width: 28px; height: 28px; color: var(--ps-line-strong); }
.ps-empty--compact { padding: var(--ps-s5) var(--ps-s4); }

/* ---------- login (frosted glass over photo) ---------- */
.ps-login { position: relative; isolation: isolate; min-height: 100vh; display: grid; place-items: center; padding: var(--ps-s4); background-color: #0b1512; background-image: linear-gradient(135deg, rgba(2, 6, 23, .62) 0%, rgba(15, 23, 42, .48) 46%, rgba(2, 6, 23, .60) 100%), url("../images/login-background.jpg"); background-size: cover; background-position: center; background-repeat: no-repeat; overflow: hidden; }
.ps-login__card { position: relative; width: 100%; max-width: 430px; padding: var(--ps-s8); border-radius: 28px; border: 1px solid rgba(255,255,255,.22); background: rgba(15,23,42,.28); backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%); box-shadow: 0 28px 80px rgba(2,6,23,.42), inset 0 1px 0 rgba(255,255,255,.22), inset 0 -1px 0 rgba(255,255,255,.08); color: #fff; display: flex; flex-direction: column; gap: var(--ps-s5); animation: ps-login-in .52s ease-out both; }
.ps-login__card::before { content: ""; position: absolute; inset: 1px; border-radius: 27px; background: linear-gradient(180deg, rgba(255,255,255,.16), transparent 38%); pointer-events: none; }
.ps-login__card > * { position: relative; }
.ps-login__head { text-align: center; display: flex; flex-direction: column; align-items: center; gap: var(--ps-s2); }
.ps-login__tile { width: 72px; height: 72px; border-radius: 18px; background: rgba(255,255,255,.92); display: grid; place-items: center; padding: 10px; box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 8px 24px rgba(2,6,23,.25); margin-bottom: var(--ps-s2); }
.ps-login__tile img { width: 100%; height: 100%; object-fit: contain; }
.ps-login__title { font-size: var(--ps-fs-2xl); font-weight: 800; line-height: 1.2; color: #fff; text-shadow: 0 2px 18px rgba(2,6,23,.24); }
.ps-login__sub { font-size: var(--ps-fs-sm); font-weight: 500; color: rgba(226,232,240,.80); }
.ps-login__form { display: flex; flex-direction: column; gap: var(--ps-s5); }
.ps-login__field { display: flex; flex-direction: column; gap: var(--ps-s2); }
.ps-login__label { font-size: var(--ps-fs-sm); font-weight: 600; color: rgba(248,250,252,.90); }
.ps-login__label span { color: #fda4af; margin-left: 2px; }
.ps-login__input { width: 100%; min-height: 48px; padding: 12px var(--ps-s4); border-radius: 16px; border: 1px solid rgba(255,255,255,.20); background: rgba(255,255,255,.12); color: #fff; font-size: var(--ps-fs-sm); box-shadow: inset 0 1px 0 rgba(255,255,255,.14); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); transition: all .2s; outline: none; }
.ps-login__input::placeholder { color: rgba(226,232,240,.65); }
.ps-login__input:hover { border-color: rgba(255,255,255,.30); background: rgba(255,255,255,.16); }
.ps-login__input:focus { transform: translateY(-1px); border-color: rgba(255,255,255,.60); background: rgba(255,255,255,.18); box-shadow: 0 0 0 4px rgba(255,255,255,.14), 0 12px 28px rgba(2,6,23,.18); }
.ps-login__input:-webkit-autofill { -webkit-text-fill-color: #fff; -webkit-box-shadow: 0 0 0 1000px rgba(30,41,59,.9) inset; }
.ps-login__remember { display: inline-flex; width: max-content; align-items: center; gap: var(--ps-s2); font-size: var(--ps-fs-sm); font-weight: 500; color: rgba(255,255,255,.90); cursor: pointer; }
.ps-login__remember input { width: 16px; height: 16px; margin: 0; cursor: pointer; accent-color: #dbeafe; border-radius: 4px; }
.ps-login__remember input:focus-visible { outline: 2px solid rgba(255,255,255,.6); outline-offset: 2px; }
.ps-login__btn { display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 50px; padding: 12px var(--ps-s5); border-radius: 16px; border: 1px solid rgba(255,255,255,.30); background: rgba(255,255,255,.18); color: #fff; font-size: var(--ps-fs-sm); font-weight: 700; box-shadow: 0 16px 36px rgba(2,6,23,.25), inset 0 1px 0 rgba(255,255,255,.20); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); transition: all .2s; cursor: pointer; }
.ps-login__btn:hover { transform: translateY(-2px) scale(1.01); border-color: rgba(255,255,255,.45); background: rgba(255,255,255,.26); box-shadow: 0 20px 42px rgba(2,6,23,.30), inset 0 1px 0 rgba(255,255,255,.28); }
.ps-login__btn:active { transform: none scale(.99); }
.ps-login__btn:focus-visible { outline: 2px solid rgba(255,255,255,.8); outline-offset: 2px; }
.ps-login__error { padding: 12px var(--ps-s4); border-radius: 18px; border: 1px solid rgba(254,205,211,.35); background: rgba(244,63,94,.15); color: #fff1f2; font-size: var(--ps-fs-sm); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
@keyframes ps-login-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ps-login__card { animation: none; } }


/* ---------- driver ---------- */
.ps-dhead { position: sticky; top: 0; z-index: 30; background: var(--ps-surface); border-bottom: 1px solid var(--ps-line); display: flex; align-items: center; justify-content: space-between; gap: var(--ps-s3); height: 56px; padding: 0 var(--ps-s4); }
.ps-dhead img { height: 32px; width: auto; }
.ps-lang { display: inline-flex; border: 1px solid var(--ps-line); border-radius: var(--ps-r-pill); overflow: hidden; }
.ps-lang form { display: contents; }
.ps-lang button { height: 30px; padding: 0 12px; font-size: var(--ps-fs-xs); font-weight: 700; color: var(--ps-ink-2); }
.ps-lang button.is-active { background: var(--ps-accent); color: #fff; }
.ps-dsum { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--ps-s2); }
.ps-dsum div { background: var(--ps-surface); border: 1px solid var(--ps-line); border-radius: var(--ps-r-lg); padding: var(--ps-s3); display: flex; flex-direction: column; gap: 2px; }
.ps-dsum span { font-size: var(--ps-fs-xs); color: var(--ps-ink-3); font-weight: 600; }
.ps-dsum strong { font-size: var(--ps-fs-lg); font-weight: 800; font-variant-numeric: tabular-nums; }
.ps-dgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--ps-s4); }
.ps-dcard { background: var(--ps-surface); border: 1px solid var(--ps-line); border-radius: var(--ps-r-lg); box-shadow: var(--ps-shadow-card); padding: var(--ps-s5); display: flex; flex-direction: column; gap: var(--ps-s3); }
.ps-dcard__head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--ps-s3); }
.ps-dcard__num { font-size: var(--ps-fs-xs); font-weight: 700; color: var(--ps-ink-3); letter-spacing: .04em; }
.ps-dcard__title { font-size: var(--ps-fs-lg); font-weight: 800; line-height: 1.25; }
.ps-dcard__addr { color: var(--ps-ink-2); font-size: var(--ps-fs-sm); }
.ps-dcard__actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--ps-s2); margin-top: var(--ps-s1); }
.ps-dcard__actions .ps-btn { height: 44px; }
.ps-dmap { border-radius: var(--ps-r-lg); overflow: hidden; border: 1px solid var(--ps-line); background: var(--ps-surface); }
.ps-dmap iframe { width: 100%; height: 200px; border: 0; }
.ps-dmap__sheet { padding: var(--ps-s4); display: flex; flex-direction: column; gap: var(--ps-s3); }
.ps-dmap__sheet > div { display: flex; flex-direction: column; gap: 2px; }
.ps-dmap__sheet strong { font-size: var(--ps-fs-md); font-weight: 700; }
.ps-dmap__sheet a.ps-muted { display: inline-flex; align-items: center; gap: 4px; margin-top: 2px; }
.ps-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--ps-s2); }
.ps-steps li { display: flex; flex-direction: column; gap: var(--ps-s2); font-size: var(--ps-fs-xs); font-weight: 700; color: var(--ps-ink-3); text-align: center; }
.ps-steps li span { height: 6px; border-radius: 3px; background: var(--ps-line); }
.ps-steps li.is-complete { color: var(--ps-ok); }
.ps-steps li.is-complete span { background: var(--ps-ok); }
.ps-steps li.is-active { color: var(--ps-accent); }
.ps-steps li.is-active span { background: var(--ps-accent); }
.ps-dsection { background: var(--ps-surface); border: 1px solid var(--ps-line); border-radius: var(--ps-r-lg); padding: var(--ps-s5); display: flex; flex-direction: column; gap: var(--ps-s4); }
.ps-dsection__head { display: flex; align-items: center; justify-content: space-between; gap: var(--ps-s3); }
.ps-dsection__title { font-size: var(--ps-fs-lg); font-weight: 800; }
.ps-dlines { display: flex; flex-direction: column; gap: var(--ps-s2); }
.ps-dline { display: flex; gap: var(--ps-s3); padding: var(--ps-s3); border: 1px solid var(--ps-line); border-radius: var(--ps-r-lg); background: var(--ps-bg); flex-wrap: wrap; }
.ps-dline__idx { font-weight: 800; color: var(--ps-ink-3); font-variant-numeric: tabular-nums; }
.ps-dline__body { flex: 1 1 200px; display: flex; flex-direction: column; gap: var(--ps-s1); min-width: 0; }
.ps-dline__body strong { font-size: var(--ps-fs-md); }
.ps-dline__qty { display: grid; grid-template-columns: 1fr 1fr; gap: var(--ps-s3); margin-top: var(--ps-s2); }
.ps-dline__qty label { display: flex; flex-direction: column; gap: 4px; font-size: var(--ps-fs-xs); font-weight: 700; color: var(--ps-ink-2); }
.ps-dline__qty .ps-input { height: 46px; font-size: var(--ps-fs-lg); font-weight: 700; }
.ps-dline__damage { margin-top: var(--ps-s2); padding: var(--ps-s3); border: 1px dashed var(--ps-bad); border-radius: var(--ps-r-lg); background: var(--ps-bad-soft); display: flex; flex-direction: column; gap: var(--ps-s2); }
.ps-dline__damage label { font-size: var(--ps-fs-xs); font-weight: 700; color: var(--ps-ink-2); display: flex; flex-direction: column; gap: 4px; }
.ps-done { position: sticky; bottom: calc(var(--ps-s4) + 64px); display: flex; flex-direction: column; gap: var(--ps-s2); padding: var(--ps-s3); background: var(--ps-surface); border: 1px solid var(--ps-line); border-radius: var(--ps-r-lg); box-shadow: var(--ps-shadow); }
.ps-done .ps-btn { height: 52px; font-size: var(--ps-fs-md); }
.ps-busy { display: flex; align-items: center; gap: var(--ps-s2); font-size: var(--ps-fs-sm); color: var(--ps-ink-2); }
.ps-busy__spin { width: 16px; height: 16px; border: 2px solid var(--ps-line-strong); border-top-color: var(--ps-accent); border-radius: 50%; animation: ps-spin .8s linear infinite; }
@keyframes ps-spin { to { transform: rotate(360deg); } }
.ps-pc { display: flex; flex-direction: column; gap: var(--ps-s3); }
.ps-pc__head { display: flex; justify-content: space-between; gap: var(--ps-s3); align-items: flex-start; }
.ps-pc__head h3 { font-size: var(--ps-fs-md); font-weight: 800; }
.ps-pc__head p { font-size: var(--ps-fs-sm); color: var(--ps-ink-3); }
.ps-pc__limit { font-size: var(--ps-fs-xs); color: var(--ps-ink-3); white-space: nowrap; }
.ps-pc__src { display: grid; grid-template-columns: 1fr 1fr; gap: var(--ps-s2); }
.ps-pc__src .ps-btn { height: 48px; }
.ps-pc__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--ps-s2); }
.ps-pc__tile { position: relative; aspect-ratio: 1; border-radius: var(--ps-r-lg); overflow: hidden; background: var(--ps-surface-2); border: 1px solid var(--ps-line); }
.ps-pc__media { width: 100%; height: 100%; object-fit: cover; }
.ps-pc__media.ps-pc__media--fallback { display: grid; place-items: center; color: var(--ps-ink-3); }
.ps-pc__media img, .ps-pc__media video { width: 100%; height: 100%; object-fit: cover; }
.ps-pc__name { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 6px; font-size: 10px; color: #fff; background: rgba(22,33,28,.65); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-pc__rm { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; background: rgba(22,33,28,.75); color: #fff; display: grid; place-items: center; font-size: 14px; line-height: 1; }
.ps-pc__add { aspect-ratio: 1; border: 2px dashed var(--ps-line-strong); border-radius: var(--ps-r-lg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--ps-ink-3); font-size: var(--ps-fs-xs); font-weight: 700; }
.ps-pc__add span { font-size: 28px; line-height: 1; }
.ps-pc__add:hover { border-color: var(--ps-accent); color: var(--ps-accent); }
.ps-pc__help { font-size: var(--ps-fs-xs); color: var(--ps-ink-3); }
.ps-pc__msg { font-size: var(--ps-fs-sm); color: var(--ps-bad); font-weight: 600; }
.ps-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: var(--ps-s2); }
.ps-gallery__item { aspect-ratio: 16/10; border-radius: var(--ps-r-lg); overflow: hidden; border: 1px solid var(--ps-line); background: var(--ps-surface-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--ps-ink-2); font-size: var(--ps-fs-xs); text-align: center; padding: var(--ps-s2); }
.ps-gallery__item img { width: 100%; height: 100%; object-fit: cover; }
.ps-gallery__item--img { padding: 0; }
.ps-sig { border: 1px solid var(--ps-line); border-radius: var(--ps-r-lg); background: var(--ps-surface); position: relative; overflow: hidden; }
.ps-sig canvas { width: 100%; height: 180px; touch-action: none; }
.ps-sig__hint { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ps-ink-3); font-size: var(--ps-fs-sm); pointer-events: none; }
.ps-sig.is-signed .ps-sig__hint { display: none; }
.ps-sig__bar { display: flex; justify-content: flex-end; padding: var(--ps-s2); border-top: 1px solid var(--ps-line); }
.ps-sig-thumb { border: 1px solid var(--ps-line); border-radius: var(--ps-r-lg); background: #fff; max-width: 320px; }

/* ---------- utilities ---------- */
.ps-row { display: flex; align-items: center; gap: var(--ps-s3); flex-wrap: wrap; }
.ps-row--end { justify-content: flex-end; }
.ps-row--between { justify-content: space-between; }
.ps-stack { display: flex; flex-direction: column; gap: var(--ps-s3); }
.ps-mt { margin-top: var(--ps-s4); }
.ps-mb { margin-bottom: var(--ps-s4); }
.ps-w-auto { width: auto; }
.ps-audit { margin: 6px 0 0; padding-left: 16px; font-size: var(--ps-fs-xs); list-style: disc; }
.ps-audit__old { color: var(--ps-bad); text-decoration: line-through; }
.ps-audit__new { color: var(--ps-ok); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .ps-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  :root { --ps-gutter: var(--ps-s4); }
  .ps-app, .ps-app.is-rail { grid-template-columns: 1fr; }
  .ps-side { position: fixed; inset: 0 auto 0 0; width: var(--ps-sidebar-w); z-index: 60; transform: translateX(-100%); transition: transform .2s ease; }
  .ps-app.is-drawer .ps-side { transform: none; }
  .ps-side__scrim { display: block; position: fixed; inset: 0; background: rgba(22,33,28,.4); z-index: 55; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .ps-app.is-drawer .ps-side__scrim { opacity: 1; pointer-events: auto; }
  .ps-side__toggle { display: none; }
  .is-rail .ps-side__label, .is-rail .ps-side__text { display: initial; }
  .is-rail .ps-side__link { justify-content: flex-start; padding: 0 var(--ps-s3); }
  .is-rail .ps-side__brand { justify-content: flex-start; padding: 0 18px; }
  .is-rail .ps-side__brand .ps-side__logo { max-width: 100%; }
  .ps-top .ps-top__menu { display: inline-flex; }

  .ps-page { padding-bottom: 96px; }
  .ps-tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; height: 64px; background: var(--ps-surface); border-top: 1px solid var(--ps-line); z-index: 40; padding-bottom: env(safe-area-inset-bottom); }
  .ps-tabbar__item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--ps-ink-3); }
  .ps-tabbar__item.is-active { color: var(--ps-accent); }
  .ps-more { display: flex; flex-direction: column; position: fixed; left: var(--ps-s3); right: var(--ps-s3); bottom: 76px; background: var(--ps-surface); border: 1px solid var(--ps-line); border-radius: var(--ps-r-lg); box-shadow: var(--ps-shadow); padding: var(--ps-s2); z-index: 45; }
  .ps-more[hidden] { display: none !important; }
  .ps-more a { padding: 10px var(--ps-s3); border-radius: var(--ps-r-sm); color: var(--ps-ink); font-size: var(--ps-fs-sm); font-weight: 500; }
  .ps-more a:hover { background: var(--ps-surface-2); }
  .ps-page__actions { bottom: calc(64px + env(safe-area-inset-bottom)); }
  .ps-done { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .ps-dsum { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .ps-grid { grid-template-columns: 1fr; }
  .ps-field--2, .ps-field--full { grid-column: 1 / -1; }
  .ps-phead__title { font-size: var(--ps-fs-xl); }
  .ps-card { padding: var(--ps-s4); }
  .ps-table__head, .ps-table__row { display: none; }
  .ps-table { background: transparent; border: 0; border-radius: 0; overflow: visible; box-shadow: none; }
  .ps-table__foot { border: 1px solid var(--ps-line); border-radius: var(--ps-r-lg); background: var(--ps-surface); margin-top: var(--ps-s3); }
  .ps-table--sub .ps-table__row { display: flex; flex-direction: column; align-items: stretch; padding: var(--ps-s3) var(--ps-s4); gap: 4px; min-height: 0; }
  .ps-table--sub .ps-table__head { display: none; }
  .ps-table--sub .ps-table__cell { white-space: normal; }
  .ps-table--sub .ps-table__cell[data-label]::before { content: attr(data-label) ": "; color: var(--ps-ink-3); font-size: var(--ps-fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
  .ps-rcard { display: block; background: var(--ps-surface); border: 1px solid var(--ps-line); border-radius: var(--ps-r-lg); padding: var(--ps-s4); margin-bottom: var(--ps-s2); }
  .ps-rcard__head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--ps-s3); margin-bottom: var(--ps-s2); }
  .ps-rcard__head strong { font-size: var(--ps-fs-md); font-weight: 700; }
  .ps-rcard__head span { font-size: var(--ps-fs-xs); color: var(--ps-ink-3); }
  .ps-rcard__meta { display: grid; grid-template-columns: 1fr 1fr; gap: var(--ps-s2) var(--ps-s3); }
  .ps-rcard__meta dt { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ps-ink-3); }
  .ps-rcard__meta dd { font-size: var(--ps-fs-sm); }
  .ps-rcard__actions { display: flex; gap: var(--ps-s2); margin-top: var(--ps-s3); }
  .ps-rcard__actions .ps-btn { flex: 1; }
  .ps-toolbar .ps-select, .ps-toolbar .ps-input { width: 100%; }
  .ps-panel__head { padding: 16px 16px 12px; }
  .ps-panel > .ps-toolbar { padding: 0 16px 12px; }
  .ps-tabs { padding: 0 16px; }
  .ps-panel > .ps-table { background: transparent; }
  .ps-panel .ps-rcard { margin: 0 16px 8px; }
  .ps-panel .ps-rcard:first-of-type { margin-top: 12px; }
  .ps-panel > .ps-table > .ps-table__foot { border-radius: 0 0 var(--ps-r-lg) var(--ps-r-lg); margin-top: 0; border: 0; border-top: 1px solid var(--ps-line); }
  .ps-search { max-width: none; }
  .ps-pc__src, .ps-dcard__actions { grid-template-columns: 1fr; }
  .ps-login__card { padding: var(--ps-s6) var(--ps-s5); border-radius: 22px; }
}

/* ---- Job Sheet line editor ---- */
.ps-door-panel { display: grid; grid-template-columns: 1fr auto; gap: var(--ps-s4); margin-top: var(--ps-s3); padding: var(--ps-s3); border: 1px dashed var(--ps-line); border-radius: 10px; }
.ps-door-panel__controls { display: grid; gap: var(--ps-s2); }
.ps-radio-row { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; min-height: var(--ps-control-h); }
.ps-radio, .ps-check { display: inline-flex; gap: 6px; align-items: center; font-size: var(--ps-fs-sm); min-height: var(--ps-control-h); }
.ps-input--xs { width: 64px; }
.ps-door-panel__preview { text-align: center; min-width: 120px; }
.ps-door-panel__in { font-size: var(--ps-fs-sm); color: var(--ps-ink-3); }
.ps-door-panel__glass { font-size: var(--ps-fs-sm); color: var(--ps-bad); font-weight: 600; }
.ps-attach { justify-content: space-between; padding: 4px 0; border-bottom: 1px solid var(--ps-line); }
.ps-attach:last-of-type { border-bottom: 0; }
.ps-attach__link { display: inline-flex; align-items: center; gap: 8px; }
.ps-attach__thumb { height: 40px; border-radius: 4px; }
.ps-attach__upload { margin-top: var(--ps-s3); }
@media (max-width: 700px) { .ps-door-panel { grid-template-columns: 1fr; } }

/* ---- Driver vehicle picker ---- */
.ps-vpick { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--ps-line); border-radius: 10px; margin-bottom: 12px; }
.ps-vpick--warn { border-color: var(--ps-warn); background: color-mix(in srgb, var(--ps-warn) 10%, #fff); }
.ps-vpick .ps-select { max-width: 260px; }

/* ---- Job Sheet progress steps ---- */
.ps-steps { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.ps-steps__item { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--ps-line); background: var(--ps-surface-2); }
.ps-steps__item.is-done { border-color: var(--ps-ok); }
.ps-steps__item.is-current { border-color: var(--ps-accent); box-shadow: inset 0 0 0 1px var(--ps-accent); }
.ps-steps__item.is-skipped { opacity: .55; }
.ps-steps__label { font-weight: 600; font-size: var(--ps-fs-sm); }
.ps-steps__meta { font-size: var(--ps-fs-sm); color: var(--ps-ink-3); min-height: 1.2em; }
.ps-pipeline-actions { flex-wrap: wrap; gap: 10px; }
.ps-select--sm { min-height: 32px; padding-top: 2px; padding-bottom: 2px; }
@media (max-width: 900px) { .ps-steps { grid-template-columns: 1fr; } }

/* ---- Floor: my jobs ---- */
.ps-complete { text-align: center; }
.ps-btn--xl { font-size: 1.15rem; padding: 16px 28px; width: 100%; max-width: 420px; }
.ps-jobline { display: flex; gap: 12px; align-items: flex-start; }
.ps-jobline__draw { flex: 0 0 auto; }
.ps-jobline__body { flex: 1 1 auto; display: grid; gap: 2px; }
.ps-steps { grid-template-columns: repeat(6, 1fr); }

/* ---- Dashboard ---- */
.ps-stats--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.ps-dash-row { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--ps-s4); align-items: start; }
.ps-dash-row > * { min-width: 0; }
.ps-dash .ps-card--flush .ps-card__head { padding: 16px 20px 12px; margin-bottom: 0; border-bottom: 1px solid var(--ps-line); }
.ps-card__link { font-size: var(--ps-fs-sm); font-weight: 600; color: var(--ps-accent); white-space: nowrap; }
.ps-card__link:hover { color: var(--ps-accent-2); }

.ps-pipe { display: flex; min-height: 76px; }
.ps-pipe__seg { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 12px 16px; border-right: 1px solid var(--ps-line); color: inherit; position: relative; transition: background .12s; }
.ps-pipe__seg:last-child { border-right: 0; }
.ps-pipe__seg::before { content: ""; position: absolute; left: 16px; right: 16px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--ps-line-strong); }
.ps-pipe__seg--0::before { background: var(--ps-ink-4); }
.ps-pipe__seg--1::before { background: var(--ps-warn-dot); }
.ps-pipe__seg--2::before, .ps-pipe__seg--3::before, .ps-pipe__seg--4::before { background: var(--ps-accent); }
.ps-pipe__seg--5::before { background: var(--ps-purple); }
.ps-pipe__seg--6::before { background: var(--ps-accent-mid); }
.ps-pipe__seg:hover { background: var(--ps-surface-2); color: inherit; }
.ps-pipe__seg.is-zero .ps-pipe__n { color: var(--ps-ink-4); }
.ps-pipe__seg.is-zero::before { opacity: .35; }
.ps-pipe__n { font-size: var(--ps-fs-2xl); font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.ps-pipe__l { font-size: var(--ps-fs-xs); color: var(--ps-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ps-attn__item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--ps-line); color: inherit; font-size: var(--ps-fs-sm); font-weight: 500; }
.ps-attn li:last-child .ps-attn__item { border-bottom: 0; }
.ps-attn__item:hover { background: var(--ps-surface-2); color: inherit; }
.ps-attn__dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--ps-warn-dot); }
.ps-attn__item--bad .ps-attn__dot { background: var(--ps-bad-strong); }
.ps-attn__item--neutral .ps-attn__dot { background: var(--ps-ink-4); }
.ps-attn__text { flex: 1 1 auto; }
.ps-attn__item .ps-icon { color: var(--ps-ink-4); }

.ps-feed__item, .ps-road__item { display: flex; align-items: center; gap: 12px; padding: 11px 20px; border-bottom: 1px solid var(--ps-line); font-size: var(--ps-fs-sm); }
.ps-feed li:last-child .ps-feed__item, .ps-road li:last-child .ps-road__item { border-bottom: 0; }
.ps-feed__body, .ps-road__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.ps-feed__body strong, .ps-road__body strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-feed__what { color: var(--ps-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-feed__when { color: var(--ps-ink-4); font-size: var(--ps-fs-xs); white-space: nowrap; }
.ps-road__stops { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ps-ink-2); white-space: nowrap; }
.ps-road__stops.is-done { color: var(--ps-accent-mid); }

@media (max-width: 1100px) { .ps-stats--5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .ps-dash-row { grid-template-columns: 1fr; }
  .ps-pipe { flex-wrap: wrap; }
  .ps-pipe__seg { flex-basis: 33.33%; border-bottom: 1px solid var(--ps-line); }
}
@media (max-width: 640px) { .ps-stats--5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ps-pipe__seg { flex-basis: 50%; } }

@media (prefers-reduced-motion: reduce) {
  .ps-app, .ps-side, .ps-side__brand, .ps-side__logo, .ps-side__link, .ps-side__toggle, .ps-side__toggle .ps-icon { transition: none !important; }
}
