/* DriverPay — «Машинные сны»: day and night themes, switched by the ☀/☾ button (html[data-theme]).
   Every colour lives in the tokens below; the rules under them only refer to tokens. Printed sheets stay black on white. */

/* fonts ship inside the program (SIL OFL 1.1, see fonts/OFL-*.txt) */
@font-face {
  font-family: 'Onest'; font-style: normal; font-display: swap; font-weight: 100 900; src: url(fonts/onest-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;
}
@font-face {
  font-family: 'Onest'; font-style: normal; font-display: swap; font-weight: 100 900; src: url(fonts/onest-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Unbounded'; font-style: normal; font-display: swap; font-weight: 200 900; src: url(fonts/unbounded-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;
}
@font-face {
  font-family: 'Unbounded'; font-style: normal; font-display: swap; font-weight: 200 900; src: url(fonts/unbounded-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* ---------- day: morning mist over the canopy ---------- */
:root {
  color-scheme: light;
  --font: 'Onest', 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  --display: 'Unbounded', 'Segoe UI', system-ui, sans-serif;
  --mono: Consolas, 'Cascadia Mono', Menlo, monospace;
  --radius: 18px;

  --page: radial-gradient(1200px 520px at 8% -10%, rgba(64, 214, 160, .22), transparent 70%),
          radial-gradient(1000px 480px at 92% -14%, rgba(139, 108, 255, .18), transparent 70%), #edf2ee;
  --glass: rgba(255, 255, 255, .72);
  --glass-strong: rgba(255, 255, 255, .9);
  --modal-bg: #ffffff;
  --btn-bg: rgba(255, 255, 255, .78);
  --btn-hover: #ffffff;
  --input-bg: #ffffff;
  --input-bg-focus: #ffffff;
  --note-bg: rgba(255, 255, 255, .85);
  --surface-2: rgba(14, 31, 25, .05);
  --hover: rgba(14, 31, 25, .05);
  --row-hover: rgba(91, 61, 245, .04);
  --sel: rgba(91, 61, 245, .08);
  --table-bg: rgba(255, 255, 255, .5);
  --th-bg: #f3f7f5;
  --top-bg: rgba(255, 255, 255, .58);
  --top-line: rgba(14, 31, 25, .08);
  --side-bg: rgba(255, 255, 255, .35);
  --nav-bg: rgba(255, 255, 255, .62);
  --nav-active-bg: #ffffff;
  --nav-active-glow: 0 1px 2px rgba(14, 31, 25, .06);
  --tabs-bg: rgba(14, 31, 25, .06);
  --tab-active-bg: #ffffff;
  --tab-active-shadow: 0 1px 3px rgba(14, 31, 25, .14);
  --line: rgba(14, 31, 25, .09);
  --line-soft: rgba(14, 31, 25, .06);
  --line-strong: rgba(14, 31, 25, .17);

  --text: #0e1f19;
  --text-2: #33463f;
  --muted: #4d6058;
  --faint: #8a9a94;

  --accent: #5b3df5;
  --accent-hover: #4c2fe6;
  --accent-ink: #ffffff;
  --accent-text: #4a2be0;
  --accent-soft: rgba(91, 61, 245, .10);
  --accent-line: rgba(91, 61, 245, .45);
  --accent-glow: 0 4px 14px rgba(91, 61, 245, .28);
  --focus: #5b3df5;
  --focus-ring: rgba(91, 61, 245, .18);

  --pos: #00704f;
  --pos-strong: #00805a;
  --pos-bg: #d7f4e8;
  --pos-line: #9fe3c6;
  --pos-line-strong: #2fa97a;
  --pos-mark: #00805a;
  --pos-mark-ink: #ffffff;
  --neg: #a23a15;
  --neg-strong: #b5401a;
  --neg-bg: #ffe6dc;
  --neg-line: #f7c3ae;
  --warn: #8a5a00;
  --warn-ink: #5c3d00;
  --warn-bg: #fff4d9;
  --warn-line: #f5d58a;
  --info-ink: #3b2a9e;
  --info-bg: rgba(91, 61, 245, .07);
  --info-line: rgba(91, 61, 245, .25);
  --bad-ink: #8e1f14;
  --bad-bg: #fef0ee;
  --bad-line: #f5c6be;
  --edited-ink: #4a2be0;
  --edited-bg: rgba(91, 61, 245, .10);
  --edited-line: rgba(91, 61, 245, .4);
  --flash: rgba(255, 200, 87, .55);

  --res-pos-bg: linear-gradient(160deg, rgba(215, 244, 232, .96), rgba(255, 255, 255, .82) 62%);
  --res-neg-bg: linear-gradient(160deg, rgba(255, 230, 220, .96), rgba(255, 255, 255, .82) 62%);
  --glow-pos: none;
  --glow-neg: none;

  --logo-grad: linear-gradient(140deg, #0e8f6e, #4b3fe0);
  --logo-shadow: 0 4px 12px rgba(43, 90, 140, .25);
  --tile-grad: linear-gradient(150deg, #0b7a5e 0%, #1d6fa8 55%, #5b3dd8 100%);
  --tile-strip: rgba(255, 255, 255, .16);
  --tile-shadow: 0 6px 18px rgba(43, 90, 140, .28);
  --today-bg: #5b3df5;

  --alert-bg: #d92d20; --alert-ink: #ffffff; --alert-ring: #ffffff;
  --cal-ok-bg: #d7f4e8; --cal-ok-ink: #075e44; --cal-ok-line: #9fe3c6;
  --cal-wa-bg: #fff1cf; --cal-wa-ink: #6e4a00; --cal-wa-line: #f5d58a;
  --cal-none-bg: rgba(14, 31, 25, .05); --cal-none-ink: #33463f; --cal-none-line: rgba(14, 31, 25, .1);
  --cal-off: #9aa9a3;
  --cal-inc: #4d6058;

  --sc-work-bg: rgba(91, 61, 245, .09); --sc-work-ink: #3b2a9e; --sc-work-line: rgba(91, 61, 245, .26);
  --sc-off-bg: #ffebe3; --sc-off-ink: #9a3412; --sc-off-line: #f6c4ae;
  --sc-empty-bg: rgba(14, 31, 25, .03); --sc-empty-line: rgba(14, 31, 25, .12);
  --rec-bg: rgba(91, 61, 245, .08); --rec-ink: #4a2be0; --rec-line: rgba(91, 61, 245, .55);
  --fm-ok: #00805a; --fm-ok-ink: #ffffff; --fm-diff: #a35f00; --fm-diff-ink: #ffffff; --fm-absent: #c0392b; --fm-absent-ink: #ffffff;
  --fm-extra: #5b3df5; --fm-extra-ink: #ffffff; --fm-unknown: #5f716a; --fm-unknown-ink: #ffffff;
  --cov-1: #f1edff; --cov-2: #ddd4ff; --cov-3: #c3b4ff; --cov-4: #9d86ff; --cov-5: #6a4bf0;
  --cov-ink: #241a66; --cov-ink-5: #ffffff;

  --chart-pay: #eb6834;
  --chart-rest: #2a78d6;
  --chart-grid: rgba(14, 31, 25, .10);
  --chart-axis: rgba(14, 31, 25, .28);
  --chart-tick: #4d6058;
  --chart-peak: #33463f;
  --chart-hover: rgba(14, 31, 25, .05);

  --shadow: 0 1px 2px rgba(14, 31, 25, .04), 0 8px 24px rgba(14, 31, 25, .06);
  --shadow-pop: 0 20px 50px rgba(14, 31, 25, .18), 0 2px 6px rgba(14, 31, 25, .06);
  --scrim: rgba(8, 20, 16, .45);
  --scrim-strong: rgba(8, 20, 16, .55);
  --drop-scrim: rgba(0, 128, 90, .16);
  --toast-bg: #0e1f19;
  --toast-ink: #e8f5ef;
  --toast-line: transparent;
  --toast-err-bg: #a3261a;
}

/* ---------- night: the rainforest after dark, moonflower light ---------- */
:root[data-theme="night"] {
  color-scheme: dark;
  --page: radial-gradient(1000px 560px at 8% -6%, rgba(0, 255, 170, .10), transparent 70%),
          radial-gradient(900px 560px at 94% 0%, rgba(140, 92, 255, .14), transparent 70%),
          radial-gradient(1000px 640px at 60% 112%, rgba(0, 180, 255, .07), transparent 70%), #050b09;
  --glass: rgba(255, 255, 255, .045);
  --glass-strong: rgba(14, 24, 20, .92);
  --modal-bg: #0f1a16;
  --btn-bg: rgba(255, 255, 255, .06);
  --btn-hover: rgba(255, 255, 255, .11);
  --input-bg: rgba(0, 0, 0, .32);
  --input-bg-focus: rgba(0, 0, 0, .45);
  --note-bg: rgba(0, 0, 0, .3);
  --surface-2: rgba(255, 255, 255, .07);
  --hover: rgba(255, 255, 255, .06);
  --row-hover: rgba(255, 255, 255, .04);
  --sel: rgba(124, 92, 255, .16);
  --table-bg: rgba(0, 0, 0, .14);
  --th-bg: #0e1714;
  --top-bg: rgba(5, 11, 9, .6);
  --top-line: rgba(232, 245, 239, .08);
  --side-bg: rgba(255, 255, 255, .02);
  --nav-bg: rgba(255, 255, 255, .04);
  --nav-active-bg: rgba(124, 92, 255, .14);
  --nav-active-glow: 0 0 22px rgba(124, 92, 255, .22);
  --tabs-bg: rgba(255, 255, 255, .05);
  --tab-active-bg: rgba(255, 255, 255, .12);
  --tab-active-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
  --line: rgba(232, 245, 239, .09);
  --line-soft: rgba(232, 245, 239, .05);
  --line-strong: rgba(232, 245, 239, .18);

  --text: #e8f5ef;
  --text-2: #b9ccc4;
  --muted: #8da59c;
  --faint: #5f716a;

  --accent: #7454fb;
  --accent-hover: #6b4af2;
  --accent-ink: #ffffff;
  --accent-text: #b39dff;
  --accent-soft: rgba(124, 92, 255, .16);
  --accent-line: rgba(167, 139, 250, .55);
  --accent-glow: 0 0 22px rgba(124, 92, 255, .35);
  --focus: #a78bfa;
  --focus-ring: rgba(167, 139, 250, .28);

  --pos: #7df7c7;
  --pos-strong: #3df5b0;
  --pos-bg: rgba(61, 245, 176, .12);
  --pos-line: rgba(61, 245, 176, .35);
  --pos-line-strong: rgba(61, 245, 176, .6);
  --pos-mark: #3df5b0;
  --pos-mark-ink: #04130e;
  --neg: #ffb49c;
  --neg-strong: #ff9a7a;
  --neg-bg: rgba(255, 138, 101, .14);
  --neg-line: rgba(255, 138, 101, .4);
  --warn: #ffd98a;
  --warn-ink: #ffe3a3;
  --warn-bg: rgba(255, 200, 87, .10);
  --warn-line: rgba(255, 200, 87, .35);
  --info-ink: #cfc2ff;
  --info-bg: rgba(124, 92, 255, .12);
  --info-line: rgba(167, 139, 250, .35);
  --bad-ink: #ffb3a8;
  --bad-bg: rgba(255, 90, 70, .12);
  --bad-line: rgba(255, 120, 100, .35);
  --edited-ink: #c9beff;
  --edited-bg: rgba(124, 92, 255, .18);
  --edited-line: rgba(167, 139, 250, .5);
  --flash: rgba(255, 200, 87, .28);

  --res-pos-bg: radial-gradient(420px 220px at 20% 0%, rgba(61, 245, 176, .16), transparent 70%), rgba(255, 255, 255, .05);
  --res-neg-bg: radial-gradient(420px 220px at 20% 0%, rgba(255, 138, 101, .16), transparent 70%), rgba(255, 255, 255, .05);
  --glow-pos: 0 0 28px rgba(61, 245, 176, .35);
  --glow-neg: 0 0 28px rgba(255, 138, 101, .3);

  --logo-grad: linear-gradient(140deg, #0c8f6b, #6a47f0);
  --logo-shadow: 0 0 18px rgba(61, 245, 176, .18);
  --tile-grad: linear-gradient(150deg, #0c8f6b 0%, #1c5fb0 55%, #6a47f0 100%);
  --tile-strip: rgba(0, 0, 0, .22);
  --tile-shadow: 0 0 0 1px rgba(255, 255, 255, .12), 0 8px 26px rgba(61, 245, 176, .22);
  --today-bg: #7454fb;

  --alert-bg: #ff6b5e; --alert-ink: #2a0705; --alert-ring: #0f1a16;
  --cal-ok-bg: rgba(61, 245, 176, .14); --cal-ok-ink: #7df7c7; --cal-ok-line: rgba(61, 245, 176, .35);
  --cal-wa-bg: rgba(255, 200, 87, .12); --cal-wa-ink: #ffd98a; --cal-wa-line: rgba(255, 200, 87, .35);
  --cal-none-bg: rgba(255, 255, 255, .05); --cal-none-ink: #b9ccc4; --cal-none-line: rgba(255, 255, 255, .1);
  --cal-off: #55665f;
  --cal-inc: #8da59c;

  --sc-work-bg: rgba(124, 92, 255, .16); --sc-work-ink: #d8ceff; --sc-work-line: rgba(167, 139, 250, .38);
  --sc-off-bg: rgba(255, 120, 90, .12); --sc-off-ink: #ffb49c; --sc-off-line: rgba(255, 138, 101, .32);
  --sc-empty-bg: rgba(255, 255, 255, .025); --sc-empty-line: rgba(255, 255, 255, .1);
  --rec-bg: rgba(124, 92, 255, .14); --rec-ink: #c9beff; --rec-line: rgba(167, 139, 250, .65);
  --fm-ok: #3df5b0; --fm-ok-ink: #04130e; --fm-diff: #ffc857; --fm-diff-ink: #1f1500; --fm-absent: #ff8a70; --fm-absent-ink: #1f0904;
  --fm-extra: #a78bfa; --fm-extra-ink: #120a2e; --fm-unknown: #5f716a; --fm-unknown-ink: #e8f5ef;
  --cov-1: rgba(116, 84, 251, .16); --cov-2: rgba(116, 84, 251, .3); --cov-3: rgba(116, 84, 251, .48); --cov-4: rgba(116, 84, 251, .68); --cov-5: rgba(116, 84, 251, .9);
  --cov-ink: #e8f5ef; --cov-ink-5: #ffffff;

  --chart-pay: #d95926;
  --chart-rest: #3987e5;
  --chart-grid: rgba(232, 245, 239, .09);
  --chart-axis: rgba(232, 245, 239, .22);
  --chart-tick: #8da59c;
  --chart-peak: #b9ccc4;
  --chart-hover: rgba(255, 255, 255, .05);

  --shadow: 0 10px 40px rgba(0, 0, 0, .35);
  --shadow-pop: 0 24px 64px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .06);
  --scrim: rgba(0, 0, 0, .6);
  --scrim-strong: rgba(0, 0, 0, .7);
  --drop-scrim: rgba(61, 245, 176, .10);
  --toast-bg: #1b2b25;
  --toast-ink: #e8f5ef;
  --toast-line: rgba(255, 255, 255, .12);
  --toast-err-bg: #8e2318;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--page); background-attachment: fixed; color: var(--text);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased; accent-color: var(--accent);
}
button, input, select, textarea { font: inherit; color: inherit; }
.btn svg, .dropzone svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12.5px; }
[hidden] { display: none !important; }

/* ---------- top bar ---------- */
#app { display: flex; flex-direction: column; height: 100vh; }
.topbar {
  display: flex; align-items: center; gap: 20px; padding: 10px 20px; flex: none; position: relative; z-index: 30;
  background: var(--top-bg); border-bottom: 1px solid var(--top-line);
  backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 250px; flex: none; }
.logo {
  width: 38px; height: 38px; border-radius: 12px; flex: none; display: inline-flex; align-items: center; justify-content: center;
  background: var(--logo-grad); color: #fff; box-shadow: var(--logo-shadow);
}
.logo svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.brand-title { font-family: var(--display); font-weight: 600; font-size: 14.5px; letter-spacing: -0.01em; }
.brand-sub { font-size: 12px; color: var(--muted); }
.day-picker { display: flex; align-items: center; gap: 10px; position: relative; min-width: 0; flex: 0 1 auto; }
.day-picker > .btn, .day-picker > .tile-wrap { flex: none; }
.tile-wrap { position: relative; display: inline-flex; }
/* small red "!" — a day where a driver is not settled or an order has no driver */
.alert-dot {
  position: absolute; top: -5px; right: -5px; width: 16px; height: 16px; border-radius: 50%; background: var(--alert-bg); color: var(--alert-ink);
  font-size: 11px; font-weight: 800; line-height: 16px; text-align: center; box-shadow: 0 0 0 2px var(--alert-ring); pointer-events: none; font-family: var(--body, inherit);
}
.alert-dot[hidden] { display: none; }
.cal-day { position: relative; }
.cal-day .alert-dot { top: -4px; right: -4px; width: 15px; height: 15px; line-height: 15px; font-size: 10.5px; }
.cal-pending { display: block; margin: -4px auto 8px; border: 0; background: none; color: var(--bad-ink); font-size: 12.5px; font-weight: 700; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.cal-pending:hover, .cal-pending:focus-visible { background: var(--bad-bg); }
.cal-pending .alert-dot, .cal-legend .alert-dot { position: static; display: inline-block; box-shadow: none; margin-right: 5px; vertical-align: 1px; }

/* the open day as a square calendar sheet; a click opens the month calendar */
.day-tile {
  width: 48px; height: 48px; padding: 0; border: 0; border-radius: 14px; background: var(--tile-grad); color: #fff; cursor: pointer;
  display: flex; flex-direction: column; overflow: hidden; line-height: 1; flex: none; text-align: center; box-shadow: var(--tile-shadow);
}
.day-tile .dt-mon { display: block; background: var(--tile-strip); color: #fff; font-size: 10px; font-weight: 700; line-height: 14px; letter-spacing: .08em; text-transform: uppercase; }
.day-tile .dt-num { display: block; font-family: var(--display); font-size: 17px; font-weight: 600; line-height: 18px; margin-top: 2px; }
.day-tile .dt-dow { display: block; font-size: 10px; line-height: 11px; margin-top: 1px; color: rgba(255, 255, 255, .88); text-transform: uppercase; letter-spacing: .04em; }
.day-tile:hover:not(:disabled) { filter: brightness(1.07); }
.day-tile[aria-expanded="true"] { box-shadow: var(--tile-shadow), 0 0 0 3px var(--focus-ring); }
.day-tile:disabled { cursor: default; opacity: .5; filter: grayscale(.7); }
.day-tile:focus-visible, .day-info:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.day-info {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 3px 8px; border: 0; border-radius: 10px;
  background: none; cursor: pointer; text-align: left; min-width: 0; max-width: 540px; color: var(--text);
}
.day-info:hover:not(:disabled) { background: var(--hover); }
.day-info:disabled { cursor: default; }
.di-date { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.di-date::first-letter { text-transform: uppercase; }
.di-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cal-pop {
  position: absolute; top: calc(100% + 10px); left: 0; z-index: 55; width: max-content; color: var(--text);
  /* opaque: the popup lives inside the blurred top bar, where its own backdrop blur cannot reach the page below */
  background: var(--modal-bg); border: 1px solid var(--line-strong); border-radius: 20px; padding: 14px 16px 12px; box-shadow: var(--shadow-pop);
}
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cal-title { font-family: var(--display); font-weight: 600; font-size: 15px; }
.cal-sum { text-align: center; font-size: 12.5px; color: var(--muted); margin: 2px 0 8px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 54px); gap: 4px; }
.cal-dow { text-align: center; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; padding-bottom: 2px; }
.cal-dow.we { color: var(--cal-off); }
.cal-day {
  width: 54px; height: 54px; border-radius: 12px; border: 1px solid transparent; padding: 0; background: none; color: inherit;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; line-height: 1.05;
}
.cal-day .cd-num { font-family: var(--display); font-size: 14px; font-weight: 600; }
.cal-day .cd-n, .cal-day .cd-rev { font-size: 11px; font-variant-numeric: tabular-nums; }
.cal-day.off { color: var(--cal-off); }
.cal-day.off .cd-num { font-weight: 400; }
button.cal-day { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.cal-day.st-ok { background: var(--cal-ok-bg); color: var(--cal-ok-ink); border-color: var(--cal-ok-line); }
.cal-day.st-wa { background: var(--cal-wa-bg); color: var(--cal-wa-ink); border-color: var(--cal-wa-line); }
.cal-day.st-none { background: var(--cal-none-bg); color: var(--cal-none-ink); border-color: var(--cal-none-line); }
.cal-day.inc { border-style: dashed; border-color: var(--cal-inc); }
button.cal-day:hover { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--focus-ring); }
.cal-day.sel { outline: 2px solid var(--focus); outline-offset: 2px; }
.cal-day.today .cd-num { background: var(--today-bg); color: #fff; border-radius: 999px; min-width: 22px; padding: 0 5px; line-height: 19px; }
.cal-day:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; font-size: 12px; color: var(--text-2); max-width: 402px; }
.cal-legend .lg { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: -1px; margin-right: 5px; border: 1px solid transparent; }
.cal-legend .lg.st-ok { background: var(--cal-ok-bg); border-color: var(--cal-ok-line); }
.cal-legend .lg.st-wa { background: var(--cal-wa-bg); border-color: var(--cal-wa-line); }
.cal-legend .lg.inc { border: 1px dashed var(--cal-inc); }
.cal-legend .lg.today { background: var(--today-bg); border-radius: 999px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; flex: none; }
.save-state { font-size: 12.5px; color: var(--muted); min-width: 86px; text-align: right; white-space: nowrap; }
.save-state.err { color: var(--neg); font-weight: 600; }

/* day / night switch: the moon by day, the sun by night */
.theme-btn .i-sun { display: none; }
:root[data-theme="night"] .theme-btn .i-sun { display: block; }
:root[data-theme="night"] .theme-btn .i-moon { display: none; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 12px; color: var(--text);
  border: 1px solid var(--line-strong); background: var(--btn-bg); cursor: pointer; font-weight: 600; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { background: var(--btn-hover); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .nav-item:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); box-shadow: var(--accent-glow); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.icon { padding: 8px; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.ok { background: var(--pos-bg); border-color: var(--pos-line); color: var(--pos); }
.btn:disabled { opacity: .5; cursor: default; }

/* ---------- layout ---------- */
.layout { flex: 1; display: flex; min-height: 0; }
.sidebar { width: 300px; flex: none; overflow: auto; padding: 14px 12px; border-right: 1px solid var(--line); background: var(--side-bg); }
.main { flex: 1; overflow: auto; padding: 20px 24px 40px; min-width: 0; }
.side-title { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 14px 8px 6px; font-weight: 700; }
.nav-item {
  width: 100%; text-align: left; display: block; padding: 10px 12px; margin: 0 0 6px; border-radius: 14px; color: var(--text);
  border: 1px solid var(--line); background: var(--nav-bg); cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.nav-item:hover { border-color: var(--line-strong); }
.nav-item.active { border-color: var(--accent-line); background: var(--nav-active-bg); box-shadow: 0 0 0 3px var(--accent-soft), var(--nav-active-glow); }
.nav-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.nav-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.check { color: var(--pos); font-weight: 700; margin-right: 4px; }
.badge { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; background: var(--surface-2); color: var(--text-2); }
.badge.pos { background: var(--pos-bg); color: var(--pos); }
.badge.neg { background: var(--neg-bg); color: var(--neg); }
.badge.warn { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line); }
.nav-item.warn { border-color: var(--warn-line); background: var(--warn-bg); }

/* ---------- cards ---------- */
.card { background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 16px; }
.card h3 { margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
h1 { font-family: var(--display); font-size: 24px; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: minmax(380px, 1.1fr) minmax(300px, 1fr); gap: 16px; }
.grid-2 > .card { margin-bottom: 16px; }

/* shift */
.shift-inputs { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.time-input {
  width: 124px; padding: 7px 12px; font-family: var(--display); font-size: 17px; font-weight: 600;
  border: 1px solid var(--line-strong); border-radius: 12px; color: var(--text); background: var(--input-bg);
}
.time-input.empty { background: var(--warn-bg); border-color: var(--warn-line); }
.arrow { font-size: 20px; color: var(--muted); padding-bottom: 8px; }
.hours-pill { margin-left: 6px; padding: 6px 14px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-size: 14px; }
.hours-pill b { font-size: 18px; font-family: var(--display); font-weight: 600; }
/* the shift's facts in one line: orders, rate, pay */
.shift-facts { display: flex; flex-wrap: wrap; gap: 2px 18px; margin-top: 10px; font-size: 13.5px; color: var(--text-2); }
.shift-facts b { color: var(--text); font-variant-numeric: tabular-nums; }
/* the driver's page: two short cards (shift, result), then the orders with the payment types above them */
.drv-top > .card { padding: 14px 18px; margin-bottom: 12px; }
.formula-note { font-size: 12.5px; color: var(--info-ink); margin-top: 2px; }
.card.orders-card { padding: 12px 16px 14px; }
.orders-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.orders-head .btn { flex: none; }
#kpiCard { min-width: 0; }
#kpiCard .chips { margin-top: 0; gap: 6px; }
#kpiCard .paychip { padding: 4px 10px 4px 5px; }
.pay-cap { font-weight: 700; font-size: 13.5px; }
.pay-custom { font-size: 13px; color: var(--text-2); }
.orders-hint { margin-top: 8px; }
.hint { color: var(--muted); font-size: 13px; margin-top: 10px; }
.invalid { border-color: var(--neg) !important; background: var(--neg-bg) !important; }

.notice { margin-top: 10px; padding: 9px 12px; border-radius: 12px; font-size: 13px; border: 1px solid var(--warn-line); background: var(--warn-bg); color: var(--warn-ink); }
.notice.info { border-color: var(--info-line); background: var(--info-bg); color: var(--info-ink); }
.notice.bad { border-color: var(--bad-line); background: var(--bad-bg); color: var(--bad-ink); }
.notice.ok { border-color: var(--pos-line); background: var(--pos-bg); color: var(--pos); }
.notice ul { margin: 6px 0 0 18px; padding: 0; }
/* «Что осталось сделать»: the day's open points in one list instead of separate boxes */
.card.todo { padding: 12px 16px 6px; margin-bottom: 12px; }
.card.todo h3 { margin-bottom: 4px; display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.card.todo h3 .alert-dot { position: static; box-shadow: none; flex: none; }
.todo .notice { margin: 0; padding: 8px 0 8px 12px; border: 0; border-radius: 0; background: none; color: var(--text); border-left: 3px solid var(--warn-line); border-top: 1px solid var(--line-soft); }
.todo .notice:first-of-type { border-top: 0; }
.todo .notice.bad { border-left-color: var(--alert-bg); }
.todo .notice.info { border-left-color: var(--info-line); }
.todo .notice .btn { margin-left: 4px; }
.alert-dot.inline { position: static; display: inline-block; box-shadow: none; margin-right: 5px; vertical-align: 1px; width: 15px; height: 15px; line-height: 15px; font-size: 10.5px; }
/* «Справка»: short answers, one opened at a time by the reader */
.help-topic { border-top: 1px solid var(--line-soft); }
.help-topic:first-child { border-top: 0; }
.help-topic > summary { cursor: pointer; padding: 10px 2px; font-weight: 700; font-size: 14.5px; }
.help-topic[open] > summary { color: var(--accent-text); }
.help-body { padding: 0 2px 10px; color: var(--text-2); font-size: 14px; line-height: 1.5; }
.help-body p { margin: 0 0 8px; }
.help-body ol, .help-body ul { margin: 0 0 8px 20px; padding: 0; }
.help-body li { margin-bottom: 4px; }
details.report-more { margin-top: 10px; }
details.report-more > summary { cursor: pointer; color: var(--accent-text); font-weight: 600; font-size: 13.5px; }
details.report-more[open] > summary { margin-bottom: 8px; }

/* result */
.result-card { display: flex; flex-direction: column; justify-content: center; }
.result-card.pos { background: var(--res-pos-bg); border-color: var(--pos-line); }
.result-card.neg { background: var(--res-neg-bg); border-color: var(--neg-line); }
.result-label { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.result-card.pos .result-label { color: var(--pos); }
.result-card.pos .result-amount { color: var(--pos-strong); text-shadow: var(--glow-pos); }
.result-card.neg .result-label { color: var(--neg); }
.result-card.neg .result-amount { color: var(--neg-strong); text-shadow: var(--glow-neg); }
.result-amount { font-family: var(--display); font-size: 36px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; margin: 4px 0 6px; font-variant-numeric: tabular-nums; }
.formula { font-size: 13.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.result-card.none .result-amount { color: var(--text-2); }
.settled-note { margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--pos); }

/* kpis */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(110px, 1fr)); gap: 10px; }
.kpi { padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--glass); }
.kpi .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi .v { font-family: var(--display); font-size: 18px; font-weight: 600; margin-top: 3px; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi.hl { border-color: var(--pos-line); background: var(--pos-bg); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.chip { padding: 4px 10px; border-radius: 999px; background: var(--surface-2); font-size: 13px; }
.chip.cash { background: var(--warn-bg); border: 1px solid var(--warn-line); font-weight: 600; }
.paychip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 8px; border-radius: 999px; cursor: pointer;
  border: 1.5px dashed var(--line-strong); background: var(--btn-bg); color: var(--text-2); font-size: 13.5px; font-variant-numeric: tabular-nums;
}
.paychip:hover { border-color: var(--pos-line-strong); color: var(--text); }
.paychip .pc-mark { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; background: var(--surface-2); color: var(--muted); }
.paychip.on { border: 1.5px solid var(--pos-line-strong); background: var(--pos-bg); color: var(--pos); font-weight: 600; }
.paychip.on .pc-mark { background: var(--pos-mark); color: var(--pos-mark-ink); }
.paychip .pc-n { font-weight: 500; color: var(--muted); margin-left: 2px; }
.paychip.on .pc-n { color: var(--pos); }
#payTotal { margin-left: 4px; }
.paychip:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.linkbtn { border: 0; background: none; color: var(--accent-text); cursor: pointer; padding: 0; font-weight: 600; text-decoration: underline; }
.linkbtn.danger { color: var(--bad-ink); font-weight: 600; font-size: 12px; }
.linkbtn.quiet { color: var(--muted); font-weight: 500; font-size: 12px; text-decoration-style: dotted; }
.linkbtn.quiet:hover, .linkbtn.quiet:focus-visible { color: var(--accent-text); }
.badge.moved { background: var(--info-bg); color: var(--info-ink); border: 1px solid var(--info-line, var(--line)); font-size: 11px; padding: 1px 6px; }
.form-row.mv-row { grid-template-columns: 1fr auto; }
.mv-days { display: flex; gap: 6px; align-items: center; }
.mv-days .dp-date { flex: 0 0 auto; }
.moved-hint { margin: 10px 0 0; }
.bad-text { color: var(--bad-ink); }
.badge.manual { background: var(--accent-soft); color: var(--accent-text); border: 1px solid var(--accent-line); font-size: 11px; padding: 1px 6px; }
.form-row select { padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--input-bg); }
@keyframes flash { from { background: var(--flash); } to { background: transparent; } }
table.grid tr.flash td { animation: flash 2.5s ease-out; }

/* tables */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--table-bg); }
table.grid { width: 100%; border-collapse: collapse; }
table.grid th {
  position: sticky; top: 0; z-index: 1; background: var(--th-bg); text-align: left; font-size: 11.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.grid th.num { text-align: right; }
table.grid td { padding: 6px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.grid tr:last-child td { border-bottom: 0; }
table.grid tbody tr:hover td { background: var(--row-hover); }
table.grid td .sub { font-size: 12px; color: var(--muted); }
table.grid tr.is-cancelled td { color: var(--faint); }
table.grid tr.is-cancelled td.cust, table.grid tr.is-cancelled td.amount { text-decoration: line-through; }
table.grid tr.clickable { cursor: pointer; }
table.grid tfoot td, table.grid tfoot th {
  background: var(--th-bg); font-weight: 700; padding: 9px 10px; border-top: 1px solid var(--line); position: static; color: var(--text);
  font-size: 14px; text-transform: none; letter-spacing: 0;
}
.cell-select, .cell-input { padding: 5px 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--input-bg); color: var(--text); }
.cell-select { max-width: 150px; }
.tip-input { width: 86px; text-align: right; }
.amount-input { width: 92px; text-align: right; font-variant-numeric: tabular-nums; border-color: transparent; background: transparent; }
.amount-input:hover, .amount-input:focus { border-color: var(--line-strong); background: var(--input-bg); }
.amount-input.is-edited { border-color: var(--edited-line); background: var(--edited-bg); font-weight: 600; }
table.grid tr.is-cancelled .amount-input { text-decoration: line-through; color: var(--faint); }
.drv-input { width: 130px; }
.cell-input:disabled { background: var(--surface-2); color: var(--faint); }
.chk { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; }
.chk input { width: 16px; height: 16px; }
.status-text { font-size: 12.5px; color: var(--muted); }
.edited { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 700; color: var(--edited-ink); background: var(--edited-bg); border-radius: 5px; padding: 0 5px; }
/* the orders of a driver: dense rows; the rare actions (move, split the payment) show when the row is pointed at */
table.orders td { padding: 4px 8px; }
table.orders th { padding-left: 8px; padding-right: 8px; }
table.orders .cell-input, table.orders .cell-select { padding: 3px 7px; }
table.orders td .sub { font-size: 11.5px; line-height: 14px; }
table.orders td .sub .linkbtn { font-size: 11.5px; line-height: 14px; vertical-align: top; }
table.orders .chk { line-height: 20px; }
table.orders .name-input { min-width: 130px; }
table.orders .drv-input { width: 104px; }
table.orders .tip-input { width: 74px; }
table.orders .amount-input { width: 84px; }
table.orders .cell-select { max-width: 132px; }
table.orders td.mono { font-size: 12px; }
.on-hover { opacity: 0; transition: opacity .12s; }
tr:hover > td > .on-hover, tr:focus-within > td > .on-hover, .on-hover:focus-within { opacity: 1; }
@media (hover: none) { .on-hover { opacity: 1; } }
td.cancel .chk-text { font-size: 12.5px; color: var(--text-2); }
td.cancel .status-text { margin-left: 22px; }
tr.is-cancelled td.cancel .chk-text { color: var(--bad-ink); font-weight: 600; }
/* one order paid several ways: a line per payment type, the amounts and the types side by side */
table.grid tr.is-split td { vertical-align: top; }
.part-line { display: flex; align-items: center; height: 28px; }
.part-line + .part-line { margin-top: 4px; }
td.amount .part-line { justify-content: flex-end; }
td.pay .part-line .cell-select { height: 28px; }
.part-input { height: 28px; box-sizing: border-box; border-color: var(--line-strong); background: var(--input-bg); }
.part-input::placeholder { color: var(--muted); font-style: italic; opacity: 1; }
.split-sum { margin-top: 4px; white-space: nowrap; }
.amount-input.total-mini { width: 76px; padding: 1px 6px; font-size: 12px; color: var(--text-2); }
.split-sum .edited { margin-left: 4px; }
.part-del { border: 0; background: none; color: var(--muted); cursor: pointer; width: 26px; height: 26px; margin-left: 4px; border-radius: 6px; font-size: 13px; line-height: 1; flex: none; }
.part-del:hover, .part-del:focus-visible { color: var(--bad-ink); background: var(--bad-bg); }
.out-shift td.time { color: var(--warn); font-weight: 700; }
td.res-pos { color: var(--pos); font-weight: 700; }
td.res-neg { color: var(--neg); font-weight: 700; }

/* empty / welcome */
.welcome { max-width: 760px; margin: 30px auto; }
.dropzone { border: 2px dashed var(--line-strong); border-radius: 18px; padding: 36px; text-align: center; background: var(--glass); cursor: pointer; }
.dropzone:hover { border-color: var(--accent-line); background: var(--glass-strong); }
.dropzone .big { font-family: var(--display); font-size: 17px; font-weight: 600; margin: 8px 0 4px; }
.steps { margin: 10px 0 0 20px; padding: 0; }
.steps li { margin: 6px 0; }
kbd { border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; font-size: 12px; background: var(--input-bg); }

/* overlays */
.drop-overlay { position: fixed; inset: 0; background: var(--drop-scrim); display: flex; align-items: center; justify-content: center; z-index: 50; }
.drop-box { background: var(--glass-strong); color: var(--text); border: 3px dashed var(--accent); padding: 40px 60px; border-radius: 20px; font-size: 20px; font-weight: 700; box-shadow: var(--shadow-pop); }
.modal-back { position: fixed; inset: 0; background: var(--scrim); display: flex; align-items: flex-start; justify-content: center; padding: 60px 20px; z-index: 60; overflow: auto; }
.modal { background: var(--modal-bg); color: var(--text); border: 1px solid var(--line); border-radius: 20px; width: min(640px, 100%); box-shadow: var(--shadow-pop); }
.modal header { padding: 16px 20px; border-bottom: 1px solid var(--line); font-family: var(--display); font-weight: 600; font-size: 16px; }
.modal .content { padding: 16px 20px; max-height: 65vh; overflow: auto; }
.modal footer { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.form-row { display: grid; grid-template-columns: 1fr 160px; gap: 12px; align-items: center; margin: 8px 0; }
.form-row input { padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--input-bg); color: var(--text); }
.form-section { font-weight: 700; margin: 14px 0 4px; }
#mirrorBox .form-row { grid-template-columns: auto minmax(0, 1fr); }
#mirrorBox #mirrorOther { grid-template-columns: minmax(0, 1fr) auto; }
#mirrorBox select { min-width: 0; width: 100%; color: var(--text); }
.form-row[hidden] { display: none; }
.form-help { font-size: 12.5px; color: var(--muted); margin: 2px 0 8px; }
.report-list { margin: 6px 0 0 18px; padding: 0; }
.report-list li { margin: 4px 0; }
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 70; }
.toast {
  background: var(--toast-bg); color: var(--toast-ink); border: 1px solid var(--toast-line); padding: 10px 14px; border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .22); display: flex; gap: 12px; align-items: center; max-width: 460px;
}
.toast.error { background: var(--toast-err-bg); color: #fff; }
.toast button { background: transparent; border: 1px solid currentColor; color: inherit; border-radius: 8px; padding: 3px 9px; cursor: pointer; font-weight: 600; opacity: .9; }
.lost { position: fixed; inset: 0; background: var(--scrim-strong); display: flex; align-items: center; justify-content: center; z-index: 80; }
.lost-box { background: var(--modal-bg); color: var(--text); padding: 24px 28px; border-radius: 20px; max-width: 460px; box-shadow: var(--shadow-pop); }

/* tabs + day navigation */
.tabs { display: inline-flex; background: var(--tabs-bg); border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; flex: none; }
.tab { border: 0; background: transparent; padding: 7px 15px; border-radius: 999px; cursor: pointer; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--tab-active-bg); color: var(--text); box-shadow: var(--tab-active-shadow); }
.day-picker .btn.small { padding: 5px 10px; font-size: 16px; line-height: 1; border-radius: 999px; min-width: 34px; min-height: 34px; justify-content: center; }

/* names */
.name-input { width: 100%; min-width: 150px; border-color: transparent; background: transparent; font-weight: 500; }
.name-input:hover, .name-input:focus { border-color: var(--line-strong); background: var(--input-bg); }
.name-input.is-edited { border-color: var(--edited-line); background: var(--edited-bg); }
table.grid tr.is-cancelled .name-input { text-decoration: line-through; color: var(--faint); }
.rename-input { width: 100%; padding: 9px 12px; font-size: 16px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--input-bg); color: var(--text); }
.names-table { width: 100%; border-collapse: collapse; margin: 4px 0; }
.names-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 4px 6px; }
.names-table td { padding: 5px 6px; border-top: 1px solid var(--line-soft); }

/* inline shifts in the day summary */
.shift-cell { white-space: nowrap; }
.time-mini { width: 96px; text-align: center; font-variant-numeric: tabular-nums; }
.time-mini.empty { background: var(--warn-bg); border-color: var(--warn-line); }
.shift-cell .dash { color: var(--muted); padding: 0 4px; }

/* statistics */
.filters { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.seg-btn { border: 1px solid var(--line-strong); background: var(--btn-bg); border-radius: 999px; padding: 6px 13px; cursor: pointer; font-weight: 600; color: var(--text-2); }
.seg-btn:hover { border-color: var(--accent-line); color: var(--text); }
.seg-btn.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: var(--accent-glow); }
.date-field { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
/* a date typed as ДД.ММ.ГГГГ, with the system's calendar behind the little button */
.dp-date { position: relative; display: inline-flex; align-items: center; }
.dp-date .dp-date-text { width: 122px; padding: 6px 30px 6px 9px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--input-bg); color: var(--text); font-variant-numeric: tabular-nums; }
.dp-date .dp-date-btn { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); width: 26px; height: 26px; border-radius: 7px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.dp-date .dp-date-btn:hover { color: var(--accent-text); background: var(--accent-soft); }
.dp-date .dp-date-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dp-date .dp-date-native { position: absolute; right: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; margin: 0; }
.dp-date .dp-date-native.invalid + .dp-date-text { border-color: var(--neg); background: var(--neg-bg); }
.stats-kpis { margin-bottom: 16px; }
.stats-kpis .kpi { background: var(--glass); }
.stats-kpis .v { font-variant-numeric: normal; }
.main.is-loading .card, .main.is-loading .kpis { opacity: .55; transition: opacity .15s; }
.loading-card { color: var(--muted); }
.warn-text { color: var(--warn); font-weight: 700; }
.chart-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--text-2); }
.legend .key { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.sw-pay { background: var(--chart-pay); }
.sw-rest { background: var(--chart-rest); }
.chart { position: relative; width: 100%; }
.chart svg { display: block; }
.chart .grid { stroke: var(--chart-grid); stroke-width: 1; }
.chart .axis { stroke: var(--chart-axis); stroke-width: 1; }
.chart .tick { fill: var(--chart-tick); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .peak { fill: var(--chart-peak); font-size: 11px; font-weight: 600; }
.chart .seg-pay { fill: var(--chart-pay); }
.chart .seg-rest { fill: var(--chart-rest); }
.chart .hit { fill: transparent; cursor: default; outline: none; }
.chart .hit.on { fill: var(--chart-hover); }
.chart-tip {
  position: absolute; pointer-events: none; background: var(--modal-bg); color: var(--text); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-pop); padding: 8px 10px; font-size: 12.5px; min-width: 180px; z-index: 5;
}
.chart-tip .tt-title { color: var(--muted); margin-bottom: 4px; }
.chart-tip .tt-row { display: flex; align-items: center; gap: 6px; }
.chart-tip .tt-row b { font-variant-numeric: tabular-nums; color: var(--text); }
.chart-tip .tt-row span:last-child { color: var(--text-2); }
.chart-tip .tt-key { width: 12px; height: 0; border-top: 2px solid transparent; display: inline-block; }
.chart-tip .tt-key.pay { border-top-color: var(--chart-pay); }
.chart-tip .tt-key.rest { border-top-color: var(--chart-rest); }
.chart-tip .tt-sub { color: var(--muted); margin-top: 3px; }
.share-cell { padding-right: 16px !important; }
.share-bar { display: block; height: 8px; border-radius: 4px; background: var(--chart-rest); }
.report-list.scroll { max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px 6px 26px; }
details summary { cursor: pointer; color: var(--accent-text); font-weight: 600; margin: 6px 0; }
.sheet h4 { margin: 14px 0 4px; font-size: 13px; }

/* search */
.search-box { position: relative; max-width: 780px; margin-bottom: 8px; }
.search-box svg { position: absolute; left: 14px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.search-box input { width: 100%; padding: 12px 14px 12px 44px; font-size: 17px; border: 1.5px solid var(--line-strong); border-radius: 14px; background: var(--input-bg); color: var(--text); }
.search-box input:focus { border-color: var(--focus); outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }
.search-help { font-size: 12.5px; color: var(--muted); margin: 0 0 14px; max-width: 980px; line-height: 1.8; }
code { font-family: var(--mono); font-size: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 0 4px; color: var(--text); }
#searchFilters .filters { margin-bottom: 10px; }
.filters select { padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--input-bg); color: var(--text); }
.filter-chk { padding: 5px 11px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--btn-bg); font-size: 13px; font-weight: 600; color: var(--text-2); }
.filter-chk:hover { border-color: var(--accent-line); color: var(--text); }
.filter-chk.on { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-text); }
.filter-chk input { width: 14px; height: 14px; margin: 0; }
.search-summary { margin: 4px 0 10px; font-size: 14.5px; }
.search-intro ul { margin: 0 0 0 18px; padding: 0; }
.search-intro li { margin: 6px 0; }
table.search-table tr[data-act="open-order"]:focus { outline: 2px solid var(--focus); outline-offset: -2px; }
table.search-table tr[data-act="open-order"]:focus td { background: var(--sel); }
table.search-table tr.is-cancelled td.amount { text-decoration: line-through; }
.nowrap { white-space: nowrap; }
.note-results { margin: 0 0 0 18px; padding: 0; }
.note-results li { margin: 5px 0; white-space: pre-wrap; }
.notice.similar ul { margin-top: 4px; }
.notice.similar li { margin: 2px 0; }

/* manager's note on the driver page and in the day summary */
.note-box { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line-strong); }
.note-input {
  width: 100%; min-height: 38px; resize: vertical; padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: 12px;
  background: var(--note-bg); font: inherit; font-size: 14px; line-height: 1.4; color: var(--text);
}
.note-input:focus { background: var(--input-bg-focus); border-color: var(--focus); outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }
.note-mark { color: var(--muted); font-weight: 400; }
table.grid tr.has-note td { border-bottom: 0; }
table.grid tr.note-row td { padding-top: 0; padding-bottom: 8px; }
table.grid tr.has-note:hover + tr.note-row td { background: var(--row-hover); }
.note-line { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; overflow-wrap: anywhere; font-size: 12.5px; color: var(--text-2); }

/* ---------- «Смены»: the week's schedule ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.week-nav { display: inline-flex; align-items: center; gap: 4px; }
.sched-card { padding-bottom: 12px; }
table.sched { table-layout: fixed; min-width: 980px; }
table.sched th.sc-name, table.sched td.sc-name { width: 150px; }
table.sched th.sc-tot, table.sched td.sc-tot { width: 184px; }
table.sched td.sc-tot { white-space: normal; }
table.sched th.sc-x, table.sched td.sc-x { width: 34px; padding-left: 0; padding-right: 6px; }
table.sched th.sc-day { text-align: center; }
table.sched th.sc-day.we .sd-dow { color: var(--accent-text); }
table.sched th.sc-day.today { color: var(--text); }
table.sched th.sc-day.today .sd-num { background: var(--today-bg); color: #fff; border-radius: 999px; padding: 1px 7px; }
.sd-num { font-variant-numeric: tabular-nums; }
.sd-data { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--pos-mark); margin-left: 5px; vertical-align: 2px; }
table.sched td { padding: 5px 4px; }
table.sched td.sc-name { padding-left: 10px; }
table.sched tbody tr:hover td { background: transparent; }
.sched-name { width: 100%; padding: 7px 9px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--text); font-weight: 700; }
.sched-name:hover { border-color: var(--line-strong); }
.sched-name:focus { border-color: var(--focus); background: var(--input-bg); outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }
.sched-name::placeholder { font-weight: 400; color: var(--faint); }
.scell { position: relative; border-radius: 12px; border: 1px solid var(--sc-empty-line); background: var(--sc-empty-bg); transition: border-color .15s, box-shadow .15s; }
.scell.st-work { background: var(--sc-work-bg); border-color: var(--sc-work-line); }
.scell.st-work.no-end { border-style: dashed; }
.scell.st-off { background: var(--sc-off-bg); border-color: var(--sc-off-line); }
.scell.pf-absent { box-shadow: inset 0 0 0 1.5px var(--fm-absent); }
.scell.pf-extra { box-shadow: inset 0 0 0 1.5px var(--fm-extra); }
.scell:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px var(--focus-ring); }
.sched-in {
  display: block; width: 100%; height: 40px; padding: 0 6px; border: 0; background: transparent; text-align: center; border-radius: 12px;
  font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--muted); outline: none;
}
.scell.st-work .sched-in { color: var(--sc-work-ink); }
.scell.st-off .sched-in { color: var(--sc-off-ink); }
.sched-in:focus { color: var(--text); }
.scell.invalid { border-color: var(--neg); background: var(--neg-bg); }
td.sc-cell.today .scell { outline: 1px dashed var(--accent-line); outline-offset: 2px; }
.fm {
  position: absolute; top: -7px; right: -6px; width: 18px; height: 18px; border-radius: 50%; border: 0; padding: 0; z-index: 1;
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; line-height: 1; font-style: normal; cursor: default;
}
button.fm { cursor: pointer; }
button.fm:hover { transform: scale(1.15); }
.fm-ok { background: var(--fm-ok); color: var(--fm-ok-ink); }
.fm-diff { background: var(--fm-diff); color: var(--fm-diff-ink); }
.fm-absent { background: var(--fm-absent); color: var(--fm-absent-ink); }
.fm-extra { background: var(--fm-extra); color: var(--fm-extra-ink); }
.fm-unknown { background: var(--fm-unknown); color: var(--fm-unknown-ink); }
.pf-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 12.5px; color: var(--text-2); align-items: center; }
.pf-legend .fm { position: static; margin-right: 6px; vertical-align: -4px; }
td.sc-tot { font-size: 13px; line-height: 1.35; }
td.sc-tot .sub { font-size: 12px; color: var(--muted); }
td.sc-tot .sub.fact { color: var(--text-2); }
td.sc-foot { text-align: center; }
td.sc-foot .sub { font-size: 12px; color: var(--muted); font-weight: 400; }
.icon-x { width: 26px; height: 26px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; }
.icon-x:hover { border-color: var(--neg-line); background: var(--neg-bg); color: var(--neg); }
.sched-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.sched-tools .hint { margin: 0; flex: 1; min-width: 260px; }
.sched-empty p { margin: 0 0 14px; max-width: 760px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-btn { border: 1px solid var(--fm-extra); background: var(--accent-soft); color: var(--accent-text); border-radius: 999px; padding: 2px 9px; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.chip-btn:hover { background: var(--edited-bg); }
table.sched-extra td, table.sched-extra th { text-align: center; }
table.sched-extra td:first-child, table.sched-extra th:first-child { text-align: left; }
/* hours on the road */
.cov-legend { gap: 6px; align-items: center; }
.cov-legend .cv { display: inline-flex; width: 26px; height: 20px; border-radius: 6px; align-items: center; justify-content: center; font-style: normal; font-size: 11.5px; font-weight: 700; margin-right: 4px; }
table.cov { border-collapse: separate; border-spacing: 3px; width: 100%; }
table.cov th { font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 2px; text-align: center; white-space: nowrap; }
table.cov tbody th { text-align: left; padding-right: 8px; color: var(--text-2); }
td.cv, i.cv { min-width: 26px; height: 26px; text-align: center; border-radius: 6px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--cov-ink); }
.cv-1 { background: var(--cov-1); } .cv-2 { background: var(--cov-2); } .cv-3 { background: var(--cov-3); } .cv-4 { background: var(--cov-4); }
.cv-5 { background: var(--cov-5); color: var(--cov-ink-5) !important; }
.cv-hole { background: var(--bad-bg); color: var(--bad-ink) !important; box-shadow: inset 0 0 0 1px var(--bad-line); }
.cv-est { font-style: italic; }
.cov-ends { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line-strong); font-size: 13px; color: var(--text-2); }
.cov-ends ul { margin: 6px 0 0 18px; padding: 0; }
.cov-ends li { margin: 3px 0; }
.ce-miss { margin-top: 6px; color: var(--warn); }
/* plan times in the day's settlement: recommended until checked */
.cell-input.rec, .time-input.rec { border-style: dashed; border-color: var(--rec-line); background: var(--rec-bg); color: var(--rec-ink); font-style: italic; }
.mini-ok { margin-left: 6px; width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--pos-line); background: var(--pos-bg); color: var(--pos); cursor: pointer; font-weight: 800; vertical-align: middle; }
.mini-ok:hover { border-color: var(--pos-line-strong); }
.badge.rec { outline: 1.5px dashed var(--rec-line); outline-offset: 1px; }
.notice .btn.small { margin-left: 6px; }
/* the picture for the chat */
.modal.wide { width: min(860px, 100%); }
.pic-opts { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; font-size: 13.5px; }
.pic-box { display: flex; justify-content: center; background: #07100d; border-radius: 14px; padding: 10px; }
.pic-box img { max-width: 100%; max-height: 46vh; height: auto; border-radius: 8px; }

/* ---------- quick search (Ctrl+F / ⌘F) over any screen ---------- */
.qs-back { position: fixed; inset: 0; z-index: 62; background: var(--scrim); display: flex; justify-content: center; align-items: flex-start; padding: 10vh 16px 16px; }
.qs-panel {
  width: min(720px, 100%); max-height: 78vh; display: flex; flex-direction: column; overflow: hidden;
  background: var(--modal-bg); color: var(--text); border: 1px solid var(--line-strong); border-radius: 20px; box-shadow: var(--shadow-pop);
}
.qs-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.qs-head svg { width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; flex: none; }
#qsInput { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--text); font-size: 17px; padding: 6px 0; }
#qsInput::placeholder { color: var(--faint); }
.qs-body { overflow: auto; padding: 4px 8px 10px; }
.qs-grp { display: flex; align-items: baseline; gap: 10px; padding: 12px 10px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.qs-grp-note { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 12px; }
.qs-opt { display: grid; grid-template-columns: 124px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 12px; cursor: pointer; font-size: 14px; }
.qs-opt.sel { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
.qs-when { color: var(--muted); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.qs-when b { color: var(--text-2); font-weight: 600; }
.qs-what { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qs-what .sub { color: var(--muted); }
.qs-what .badge, .qs-what .edited { margin-left: 4px; }
.qs-amt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.qs-go { font-size: 12.5px; color: var(--accent-text); font-weight: 600; white-space: nowrap; }
.qs-opt.cancelled .qs-amt { text-decoration: line-through; color: var(--faint); }
.qs-opt.all { grid-template-columns: 1fr; color: var(--accent-text); font-weight: 600; font-size: 13.5px; }
.qs-note, .qs-empty { padding: 10px 12px; color: var(--muted); font-size: 13.5px; }
.qs-intro ul { margin: 2px 0 4px 28px; padding: 0; color: var(--text-2); font-size: 13.5px; }
.qs-intro li { margin: 5px 0; }
.qs-intro code, .qs-note code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); border-radius: 5px; padding: 0 4px; }
.qs-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 9px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.qs-count { margin-left: auto; }
@media (max-width: 760px) { .qs-opt { grid-template-columns: 100px minmax(0, 1fr) auto; } }

/* ---------- print: always black on white, whatever the theme ---------- */
#printRoot { display: none; }
@media print {
  @page { size: letter; margin: 12mm; }
  :root, :root[data-theme="night"] { color-scheme: light; }
  body { background: #fff !important; color: #000; }
  body > *:not(#printRoot) { display: none !important; }
  #printRoot { display: block; }
}
.sheet { font: 11.5px/1.35 Arial, Helvetica, sans-serif; color: #000; page-break-after: always; }
.sheet:last-child { page-break-after: auto; }
.sh-title { display: flex; justify-content: space-between; font-size: 15px; font-weight: 700; border-bottom: 2px solid #000; padding-bottom: 4px; margin-bottom: 10px; }
.sh-top { display: flex; gap: 24px; align-items: flex-start; }
.sh-kv { border-collapse: collapse; flex: 1; }
.sh-kv th { text-align: left; font-weight: 700; padding: 3px 8px 3px 0; white-space: nowrap; }
.sh-kv th.sub { padding-top: 8px; }
.sh-kv td { padding: 3px 0; border-bottom: 1px solid #ccc; }
.sh-kv td.pt { padding-left: 14px; border-bottom: 1px dotted #ccc; }
.sh-kv.right td { text-align: right; min-width: 90px; }
.sh-kv tr.big th, .sh-kv tr.big td { font-size: 14px; font-weight: 700; border-top: 2px solid #000; border-bottom: 2px solid #000; }
.sh-kv td.neg { color: #b42318; }
.sh-kv td.note { border: 0; text-align: right; font-size: 10px; color: #555; }
.sh-kv.right td.notes-box { text-align: left; border: 1px solid #000; height: 46px; vertical-align: top; white-space: pre-wrap; padding: 4px 6px; font-size: 11px; }
.sheet .sum-note { color: #333; }
.sh-result { margin: 10px 0; padding: 6px 10px; border: 1.5px solid #000; font-size: 13px; }
.sh-orders { width: 100%; border-collapse: collapse; margin-top: 6px; }
.sh-orders th, .sh-orders td { border: 1px solid #999; padding: 3px 6px; }
.sh-orders th { background: #e6e6e6; text-align: left; }
.sh-orders td.c, .sh-orders th.c { text-align: center; }
.sh-orders .num { text-align: right; }
.sh-orders tr.x td { color: #777; text-decoration: line-through; }
.sh-orders tfoot th { background: #f2f2f2; }
.sh-orders td.neg { color: #b42318; }
.sh-sign { display: flex; justify-content: space-between; margin-top: 26px; }
.sh-foot { margin-top: 14px; font-size: 9.5px; color: #666; }
.sheet .note { font-size: 10.5px; color: #333; }
.sheet .warn { font-weight: 700; }

@media (max-width: 1300px) {
  table.sched { min-width: 900px; }
  table.sched th.sc-name, table.sched td.sc-name { width: 120px; }
  table.sched th.sc-tot, table.sched td.sc-tot { width: 160px; }
}

/* narrower windows: the top bar keeps one row — the brand loses its subtitle, the day line gets shorter */
@media (max-width: 1500px) {
  .brand { min-width: 0; }
  .brand-sub { display: none; }
  .topbar { gap: 16px; }
}
@media (max-width: 1440px) {
  .brand > div { display: none; }               /* the logo stays: the open day's date needs the room */
  #btnImport .bl-more { display: none; }
  .topbar { gap: 12px; }
  .top-actions { gap: 6px; }
}
@media (max-width: 1300px) {
  #btnImport .btn-label { display: none; }
  .tab { padding: 7px 11px; }
}
@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(3, minmax(110px, 1fr)); }
  .sidebar { width: 248px; }
  .main { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 1000px) {
  .grid-2 { grid-template-columns: 1fr; }
}

/* ---------- сверка с Weedmaps ---------- */
.modal.wm-modal { width: min(1000px, 100%); }
.wm-cover { opacity: .85; }
.wm-list { list-style: none; margin: 8px 0 2px !important; padding: 0 !important; }
.wm-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 6px 8px; border-radius: 10px; background: var(--note-bg); border: 1px solid var(--bad-line); margin-top: 5px; color: var(--text); }
.wm-list .wm-what { flex: 1 1 360px; font-variant-numeric: tabular-nums; }
.wm-list .wm-what .sub { color: var(--muted); font-size: 12px; }
.wm-acts { display: inline-flex; gap: 6px; white-space: nowrap; }
.notice .wm-acts .btn.small { margin-left: 0; }
.wm-look { flex-basis: 100%; font-size: 12.5px; color: var(--text-2); }
.wm-look .btn.small { margin-left: 4px; padding-top: 2px; padding-bottom: 2px; }
.wm-group-note { margin-top: 6px; }
.wm-head { margin-top: 0; }
h4.wm-h { margin: 18px 0 4px; font-size: 14px; }
.wm-sub { color: var(--text-2); font-size: 13px; margin: 8px 0 6px; }
.wm-table td { padding-top: 5px; padding-bottom: 5px; }
.wm-table td.time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.wm-table td.wm-acts { display: table-cell; text-align: right; }
.wm-table td.wm-acts .btn + .btn { margin-left: 6px; }
a.btn, label.btn { text-decoration: none; display: inline-block; }
table.copies td { vertical-align: middle; }
table.copies td:last-child { text-align: right; }
.wm-table tr.wm-look-row td { padding-top: 0; border-top: 0; }
.wm-table tr[data-wm]:has(+ tr.wm-look-row) td { border-bottom: 0; }
.wm-days { margin: 10px 0 4px; }
.wm-days td.wm-acts { display: table-cell; text-align: right; }
.wm-st { font-weight: 600; }
.wm-st.ok { color: var(--pos); }
.wm-st.warn { color: var(--warn); }
.wm-st.bad { color: var(--bad-ink); }
section.wm-day { margin-top: 18px; padding-top: 12px; border-top: 1px dashed var(--line-strong); }
section.wm-day h3 { margin: 0 0 6px; font-family: var(--display); font-size: 15px; font-weight: 600; }
table.sched:not(.show-fact) .wk-fact { display: none; }
details.wm-day { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line-strong); }
details.wm-more { margin-top: 12px; }

/* ---------- the server version: the sign-in page ---------- */
body.login-page { display: flex; align-items: center; justify-content: center; min-height: 100%; padding: 24px 16px; }
.login-card {
  width: min(400px, 100%); background: var(--glass-strong); border: 1px solid var(--line); border-radius: 24px; padding: 28px 28px 20px;
  box-shadow: var(--shadow-pop); backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2);
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.login-brand h1 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 18px; letter-spacing: -0.01em; }
.login-form { display: flex; flex-direction: column; }
.login-form label { font-size: 13px; font-weight: 600; color: var(--text-2); margin: 12px 0 5px; }
.login-form > label:first-of-type { margin-top: 0; }
.login-form input:not([type=checkbox]) {
  width: 100%; padding: 11px 12px; font-size: 16px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--input-bg); color: var(--text);
}
.login-form input::placeholder { color: var(--faint); font-size: 14px; }
.login-form .login-chk { margin: 14px 0 0; font-weight: 500; color: var(--text); white-space: normal; }
.login-go { margin-top: 18px; padding: 12px 16px; font-size: 15px; justify-content: center; }
.login-alt { margin-top: 8px; justify-content: center; }
.login-lead { margin: 0 0 14px; color: var(--text); }
.login-help { margin: 12px 0 0; font-size: 12.5px; color: var(--muted); }
.login-error { margin: 14px 0 0; padding: 9px 12px; border-radius: 12px; font-size: 13px; border: 1px solid var(--bad-line); background: var(--bad-bg); color: var(--bad-ink); }
.login-wait { color: var(--muted); margin: 0; }
.login-show { margin-top: 16px; font-size: 13px; color: var(--text-2); }
.login-foot { margin: 18px 0 0; font-size: 12px; color: var(--muted); text-align: center; }

/* ---------- the server version: who is signed in, no connection, the password asked again ---------- */
.user-btn { padding: 3px 12px 3px 3px; gap: 8px; border-radius: 999px; max-width: 200px; min-height: 36px; }
.user-dot {
  width: 28px; height: 28px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--accent-ink); font-size: 11.5px; font-weight: 700; letter-spacing: .02em;
}
.user-dot.big { width: 46px; height: 46px; font-size: 16px; }
.user-name { overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
@media (max-width: 1640px) {
  .user-name { display: none; }
  .user-btn { padding: 3px; }
}
.offline-bar { flex: none; padding: 8px 20px; text-align: center; font-size: 13px; background: var(--bad-bg); color: var(--bad-ink); border-bottom: 1px solid var(--bad-line); }
.reauth-box { width: min(420px, calc(100% - 32px)); display: flex; flex-direction: column; }
.reauth-box > b { font-family: var(--display); font-size: 17px; font-weight: 600; }
.reauth-box p { margin: 8px 0 14px; color: var(--text-2); }
.reauth-box label { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.reauth-box input { padding: 11px 12px; font-size: 16px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--input-bg); color: var(--text); }
.reauth-box .login-error { margin: 12px 0 0; }
.reauth-acts { display: flex; justify-content: space-between; gap: 8px; margin-top: 18px; flex-wrap: wrap; }

/* what a role does not allow is not offered */
body.no-admin [data-act="delete-day"] { display: none !important; }
/* a person who only looks: the closed fields read as plain figures — no frames to type into, no "fill me in" colours or hints */
body.no-work #main input:disabled, body.no-work #main textarea:disabled, body.no-work #main select:disabled {
  color: var(--text); -webkit-text-fill-color: var(--text); opacity: 1; background: transparent; border-color: transparent; box-shadow: none; cursor: default;
  -webkit-appearance: none; appearance: none; background-image: none; resize: none;
}
body.no-work #main input:disabled::placeholder, body.no-work #main textarea:disabled::placeholder { color: transparent; -webkit-text-fill-color: transparent; }
body.no-work #main input[type="checkbox"]:disabled { -webkit-appearance: auto; appearance: auto; opacity: .75; }
body.no-work #main .btn:disabled, body.no-work #main button:disabled { opacity: 1; cursor: default; }
.role-badge { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; background: var(--info-bg); color: var(--info-ink); border: 1px solid var(--info-line); }
@media (max-width: 1100px) { .role-badge { display: none; } }

/* «Мой вход», people, the journal, the history of a day */
.acct { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.acct-name { font-family: var(--display); font-weight: 600; font-size: 16px; }
.modal.users-modal, .modal.journal-modal, .modal.history-modal { width: min(900px, 100%); }
.users-table td { vertical-align: top; padding-top: 9px; padding-bottom: 9px; }
.users-table select, .user-add select, .user-add input, .journal-head select {
  padding: 6px 9px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--input-bg); color: var(--text); min-width: 0;
}
.user-name-in { width: 100%; max-width: 230px; font-weight: 600; }
.users-table td .sub { margin-top: 4px; }
.user-stats { display: flex; margin-top: 7px; font-size: 12.5px; white-space: normal; }
.user-acts { text-align: right; white-space: nowrap; }
tr.user-off .user-name-in { color: var(--faint); text-decoration: line-through; }
.user-add { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto auto; gap: 8px; align-items: center; }
.pw-note { margin: 0 0 12px; }
.pw-note .sub { margin-top: 6px; font-size: 12.5px; }
.pw-temp { font-size: 15px; letter-spacing: .04em; user-select: all; padding: 2px 7px; border-radius: 6px; background: var(--input-bg); color: var(--text); border: 1px solid var(--line-strong); }
.btn.danger { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad-ink); }
.roles-help { margin-top: 12px; font-size: 13px; color: var(--text-2); }
.journal-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; font-size: 13px; }
.journal-table td.time { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--text-2); }
.hist-list { list-style: none; margin: 0; padding: 0; }
.hist-list > li { padding: 10px 0; border-top: 1px solid var(--line-soft); }
.hist-list > li:first-child { border-top: 0; padding-top: 0; }
.hist-list ul { margin: 4px 0 0 18px; padding: 0; }
.hist-list ul li { margin: 2px 0; }
@media (max-width: 760px) {
  .user-add { grid-template-columns: 1fr; }
  .user-acts { white-space: normal; text-align: left; }
}
body.no-work #main .note-box:has(textarea:disabled:placeholder-shown) { display: none; }      /* no note: no empty frame for one */
