/* Plannex OS panel. Brand from plannex.org (mini app): ink navy, indigo, mint, Bowler display face.
   One loud element — the day band on the Day screen; everything else is a quiet working surface. */
@font-face {
  font-family: "Bowler"; src: url("bowler.ttf") format("truetype"); font-display: swap;
  /* Bowler has no narrow no-break space (U+202F, our thousands separator): let the system face draw it. */
  unicode-range: U+0000-202E, U+2030-FFFF;
}

:root {
  --ink: #16223d;          /* brand navy: top bar, day band, headings */
  --ink-deep: #0c1024;
  --indigo: #5b53d4;       /* actions */
  --indigo-soft: #ecebfb;
  /* Text colours are checked against WCAG AA (≥4.5:1) on white, paper and their own soft fills. */
  --mint: #0b7d50;         /* growth as text (brand #3ddc97 is too pale on paper) */
  --mint-soft: #e2f4ea;
  --mint-bright: #3ddc97;
  --amber: #8a5306;        /* unexplained change, missing report */
  --amber-soft: #fbf0dc;
  --red: #a92636;
  --red-soft: #fbe7e9;
  --paper: #f3f5fb;
  --surface: #ffffff;
  --text: #1b2236;
  --muted: #5c6582;
  --line: #e1e5f0;
  --focus: #5b53d4;
  --on-indigo: #ffffff;
  --chart-1: #5b53d4;      /* validated: dataviz validate_palette, light surface #fff */
  --chart-2: #b9740f;
  --chart-grid: #e8ebf3;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #0c1024;
    --ink-deep: #070a17;
    --indigo: #8f88ff;
    --indigo-soft: #26244f;
    --mint: #3ddc97;
    --mint-soft: color-mix(in srgb, #3ddc97 14%, #1a2440);
    --amber: #f0b14f;
    --amber-soft: #3a2c12;
    --red: #ff7d8a;
    --red-soft: #3c1c22;
    --paper: #121a30;
    --surface: #1a2440;
    --text: #e9ecf6;
    --muted: #9099b8;
    --line: #2a3557;
    --focus: #8f88ff;
    --on-indigo: #0e1230;    /* white on #8f88ff is 2.9:1; dark ink is 6.2:1 */
    --chart-1: #857dff;    /* validated against dark surface #1a2440 */
    --chart-2: #b97c25;
    --chart-grid: #26304f;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 15px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
/* Bowler (the brand face, caps only) is kept for the logo; headings and figures use the system face, so long
   numbers and Russian text never break out of their cards. */
.display { font-family: Bowler, system-ui, sans-serif; font-weight: 400; letter-spacing: .01em; }
h1 { font-size: 26px; line-height: 1.2; font-weight: 700; letter-spacing: -.015em; margin: 0; color: var(--ink); }
@media (prefers-color-scheme: dark) { h1 { color: var(--text); } }
.band h1 { color: #fff; }
h2 { font-size: 16px; font-weight: 650; letter-spacing: -.005em; margin: 0 0 12px; color: var(--ink); }
@media (prefers-color-scheme: dark) { h2 { color: var(--text); } }
p { margin: 0 0 10px; max-width: 72ch; }
.muted { color: var(--muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos { color: var(--mint); }
.neg { color: var(--red); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- side menu (top bar on phones) ---------- */
.top { background: var(--ink); color: #fff; z-index: 3; }
.top-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font: 18px Bowler, system-ui, sans-serif; color: #fff; text-decoration: none; }
.brand img { height: 26px; width: auto; }
nav { display: flex; flex-direction: column; gap: 14px; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-title { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: rgb(255 255 255 / .42); padding: 0 12px 4px; }
nav a {
  display: block; color: rgb(255 255 255 / .72); text-decoration: none; padding: 6px 12px; border-radius: 9px;
  font-size: 14px; font-weight: 500; transition: background .15s, color .15s;
}
nav a:hover { color: #fff; background: rgb(255 255 255 / .07); }
nav a.active { color: #fff; background: rgb(143 136 255 / .24); box-shadow: inset 3px 0 0 #8f88ff; }
.who { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: rgb(255 255 255 / .7); font-size: 13px; }
.who button.link { color: #fff; font-size: 13px; }
.menu-toggle { display: none; }

body.app { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh;
  background: linear-gradient(to right, var(--ink) 220px, var(--paper) 220px); }
body.app .top {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 16px;
  padding: 16px 12px 14px; scrollbar-width: none;
}
body.app .top::-webkit-scrollbar { display: none; }
body.app .top-bar { padding: 2px 10px 0; }
body.app nav { flex: 1; }
body.app .who { border-top: 1px solid rgb(255 255 255 / .1); padding: 12px 12px 0; flex-wrap: wrap; }
main { max-width: 1440px; width: 100%; margin: 0 auto; padding: 28px 28px 72px; }

@media (max-width: 980px) {
  body.app { display: block; background: var(--paper); }
  body.app .top { position: sticky; height: auto; overflow: visible; padding: 10px 16px; gap: 0; }
  body.app .top-bar { padding: 0; }
  .menu-toggle {
    display: inline-flex; align-items: center; gap: 8px; background: rgb(255 255 255 / .1); color: #fff;
    border: 1px solid rgb(255 255 255 / .16); max-width: 55vw; overflow: hidden; text-overflow: ellipsis;
  }
  .menu-toggle::after { content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); margin-left: 2px; }
  .menu-toggle:hover { background: rgb(255 255 255 / .16); border-color: rgb(255 255 255 / .24); }
  body.menu-open .menu-toggle::after { transform: rotate(-135deg) translateY(-1px); }
  body.app nav, body.app .who { display: none; }
  body.menu-open nav { display: flex; padding: 14px 0 4px; max-height: calc(100vh - 140px); overflow-y: auto; }
  body.menu-open .who { display: flex; border-top: 1px solid rgb(255 255 255 / .1); padding: 12px 4px 4px; margin-top: 8px; }
  main { padding: 20px 16px 56px; }
}

/* ---------- page heads ---------- */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.head p { margin: 6px 0 0; }

/* Employee portal: one personal view, the team schedule and a draft-only assistant. */
.employee-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.employee-metrics .sheet { margin-bottom: 20px; }
.employee-metrics .value { overflow-wrap: anywhere; }
.employee-metrics p { margin: 8px 0 0; font-size: 13px; }
.assistant-title { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.assistant-conversation { display: flex; flex-direction: column; gap: 10px; max-height: 450px; overflow: auto; padding: 15px; margin: 12px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.assistant-conversation > p { margin: 0; }
.assistant-question, .assistant-answer { max-width: min(85%, 640px); padding: 11px 14px; border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.assistant-question { align-self: flex-end; color: var(--on-indigo); background: var(--indigo); }
.assistant-answer { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); }
.assistant-answer p { margin: 7px 0; }
.assistant-status { font-weight: 650; color: var(--mint); }
.assistant-card .stack textarea { width: 100%; }
@media (max-width: 720px) { .employee-metrics { grid-template-columns: 1fr; gap: 0; } }

/* ---------- day band: the one loud element ---------- */
.band {
  background: linear-gradient(100deg, var(--ink) 0%, #252f6e 62%, var(--indigo) 140%);
  color: #fff; border-radius: 18px; padding: 22px 26px; margin-bottom: 20px;
  display: grid; grid-template-columns: 1fr auto; gap: 18px 28px; align-items: end;
}
.band .date-nav { display: flex; align-items: center; gap: 10px; grid-column: 1 / -1; flex-wrap: wrap; }
.band .date-nav h1 { font-size: 30px; margin-right: 6px; color: #fff; }
.band .date-nav button, .band .date-nav input {
  background: rgb(255 255 255 / .08); color: #fff; border-color: rgb(255 255 255 / .18);
}
.band .date-nav input { color-scheme: dark; }
.band .state { font-size: 13px; padding: 3px 10px; border-radius: 999px; background: rgb(255 255 255 / .12); }
.band .state.closed { background: rgb(61 220 151 / .2); color: var(--mint-bright); }
.band .state.reopened { background: rgb(240 177 79 / .2); color: #ffd28a; }
.figure .value { font-size: 44px; line-height: 1.05; font-weight: 700; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.figure .value small { font-size: 20px; opacity: .7; margin-left: 6px; }
.figure .caption { color: rgb(255 255 255 / .66); font-size: 13px; margin-top: 6px; }
.tally { min-width: 240px; }
.tally .caption { color: rgb(255 255 255 / .66); font-size: 13px; margin-bottom: 8px; }
.segments { display: flex; gap: 4px; }
.segments span { flex: 1; height: 10px; border-radius: 3px; background: rgb(255 255 255 / .16); min-width: 14px; }
.segments .done { background: var(--mint-bright); }
.segments .off { background: rgb(255 255 255 / .45); }
.segments .rejected { background: #ff7d8a; }
@media (max-width: 680px) {
  .band { grid-template-columns: 1fr; padding: 18px; border-radius: 14px; }
  .band .date-nav h1 { font-size: 26px; width: 100%; }
  .figure .value { font-size: 36px; }
}

/* ---------- working surface ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
/* Below 1360px (with the side menu) the side column goes above the tables: tables keep their full width, and the
   actions in it — rate, «Закрыть день», the forecast — stay in sight instead of under a long table. */
@media (max-width: 1360px) {
  .layout { grid-template-columns: minmax(0, 1fr); }   /* minmax: a wide table scrolls inside, the page does not */
  .layout > .slip { order: -1; position: static; margin-bottom: 0; }
  .layout.keep-order > .slip { order: 0; }   /* «Маркетолог»: the ideas first, the settings below */
}
.sheet { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; margin-bottom: 20px;
  box-shadow: 0 1px 2px rgb(22 34 61 / .04), 0 4px 16px rgb(22 34 61 / .04); min-width: 0; }
.slip { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; position: sticky; top: 20px;
  box-shadow: 0 1px 2px rgb(22 34 61 / .04), 0 4px 16px rgb(22 34 61 / .04); min-width: 0; }
.slip table { font-size: 14px; }
.slip th, .slip td { padding: 8px 4px; font-size: 13px; }
.slip tbody td:first-child { white-space: normal; }
.slip .tag { font-size: 11px; padding: 1px 6px; }
.slip section + section { border-top: 1px dashed var(--line); margin-top: 16px; padding-top: 16px; }
@media (max-width: 980px) { .slip { position: static; } }

.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
td { font-size: 14px; font-variant-numeric: tabular-nums; }
th { font-weight: 500; color: var(--muted); font-size: 12px; line-height: 1.3; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
tbody tr:last-child td { border-bottom: none; }
tfoot td { font-weight: 600; border-top: 1px solid var(--text); border-bottom: none; }
td .sub { display: block; color: var(--muted); font-size: 13px; }
tbody td:first-child { white-space: nowrap; }

.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 13px; white-space: nowrap; background: var(--paper); color: var(--muted); }
.tag.ok { background: var(--mint-soft); color: var(--mint); }
.tag.warn { background: var(--amber-soft); color: var(--amber); }
.tag.bad { background: var(--red-soft); color: var(--red); }

/* ---------- controls ---------- */
form.inline, .row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
label.check { flex-direction: row; align-items: center; gap: 10px; color: var(--text); font-size: 14px; }
.stack label.check input { width: 17px; }
input, select {
  font: inherit; color: var(--text); background: var(--surface); min-height: 38px;
  border: 1px solid var(--line); border-radius: 10px; padding: 7px 11px; min-width: 0;
  transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover { border-color: color-mix(in srgb, var(--muted) 45%, var(--line)); }
input:focus, select:focus { outline: none; border-color: var(--indigo); box-shadow: 0 0 0 3px color-mix(in srgb, var(--indigo) 22%, transparent); }
input[type=checkbox], input[type=radio] { min-height: 0; width: 17px; height: 17px; padding: 0; flex: none; }
input[type=file] { padding: 6px; }
input[type=file]::file-selector-button {
  font: inherit; font-size: 14px; margin-right: 10px; padding: 5px 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); background: var(--paper); color: var(--text);
}
input.amount { width: 140px; text-align: right; font-variant-numeric: tabular-nums; }
button {
  font: inherit; font-size: 14px; font-weight: 550; cursor: pointer; border-radius: 10px; padding: 7px 14px; min-height: 38px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); white-space: nowrap;
  box-shadow: 0 1px 2px rgb(22 34 61 / .05); transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
}
button:hover { background: var(--paper); border-color: color-mix(in srgb, var(--muted) 40%, var(--line)); }
button:active { transform: translateY(1px); }
button.primary { background: var(--indigo); color: var(--on-indigo); border-color: var(--indigo); box-shadow: 0 1px 2px rgb(91 83 212 / .3), 0 4px 12px rgb(91 83 212 / .18); }
button.primary:hover { background: var(--indigo); filter: brightness(1.08); }
button.big { width: 100%; padding: 11px 16px; font-size: 15px; min-height: 46px; }
button.danger { color: var(--red); }
button.danger:hover { background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 35%, var(--line)); }
button.link { border: none; background: none; color: var(--indigo); padding: 0; min-height: 0; box-shadow: none; font-weight: 500; }
button.link:hover { background: none; text-decoration: underline; text-underline-offset: 3px; }
button:disabled { opacity: .45; cursor: default; filter: none; }
.actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
td.actions { display: table-cell; text-align: right; white-space: nowrap; }   /* a table cell keeps its row lines */
td.actions > * + * { margin-left: 6px; }

/* ---------- figures in sheets ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 18px 24px; }
.stat { min-width: 0; }
.stat .label { font-size: 13px; color: var(--muted); }
.stat .value { font-size: 26px; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums;
  margin-top: 4px; color: var(--ink); overflow-wrap: anywhere; }
.slip .stats { grid-template-columns: 1fr; gap: 14px; }
.slip .stat .value { font-size: 22px; }
.stat .value.range { font-size: 17px; font-weight: 650; }
@media (prefers-color-scheme: dark) { .stat .value { color: var(--text); } }

/* ---------- login ---------- */
.login {
  max-width: 400px; margin: 12vh auto; padding: 26px; border-radius: 18px;
  background: linear-gradient(160deg, var(--ink) 0%, #252f6e 100%); color: #fff;
}
.login .brand { font-size: 24px; margin-bottom: 14px; }
.login .brand img { height: 34px; }
.login p { color: rgb(255 255 255 / .72); }
.login label { color: rgb(255 255 255 / .72); }
.login input { width: 100%; background: rgb(255 255 255 / .08); color: #fff; border-color: rgb(255 255 255 / .2); }
.login .neg { color: #ff9aa5; }
.login button { width: 100%; margin-top: 14px; }

/* ---------- toasts ---------- */
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 5; max-width: min(440px, calc(100vw - 32px)); }
.toast { padding: 11px 15px; border-radius: 10px; background: var(--ink); color: #fff; box-shadow: 0 8px 24px rgb(12 16 36 / .25); }
.toast.bad { background: #a92636; }  /* fixed: white on the dark theme's light red would be 2.6:1 */
@media (prefers-reduced-motion: no-preference) {
  .toast { animation: rise .18s ease-out; }
  @keyframes rise { from { transform: translateY(6px); opacity: 0; } }
}

/* ---------- identity ---------- */
.who-link { color: #fff; text-decoration: none; border-bottom: 1px solid rgb(255 255 255 / .3); }
.who-link:hover { border-bottom-color: #fff; }
.login button.link.on-dark { color: rgb(255 255 255 / .75); width: auto; margin: 0; font-size: 14px; }
.login button.link.on-dark:hover { color: #fff; }

/* ---------- charts ---------- */
.chart { position: relative; margin: 4px 0 8px; }
.chart svg { display: block; overflow: visible; }
.chart .axis text, .chart .axis-label { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .grid { stroke: var(--chart-grid); stroke-width: 1; }
.chart .zero { stroke: var(--muted); stroke-width: 1; }
.chart .bar { fill: var(--chart-1); }
.chart .bar.neg { fill: var(--chart-1); opacity: .55; }
.chart .hover-band { fill: var(--muted); opacity: .08; }
.chart .line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart .line.actual { stroke: var(--chart-1); }
.chart .line.forecast { stroke: var(--chart-2); stroke-dasharray: 5 4; }
.chart .band { fill: var(--chart-2); opacity: .16; }
.chart .dot.actual { fill: var(--chart-1); stroke: var(--surface); stroke-width: 2; }
.chart .direct { fill: var(--text); font-size: 12px; }
.chart .crosshair { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 3; }
.chart-tip {
  position: absolute; pointer-events: none; background: var(--ink); color: #fff; font-size: 13px;
  padding: 7px 10px; border-radius: 8px; white-space: nowrap; box-shadow: 0 6px 18px rgb(12 16 36 / .25); z-index: 2;
}
.legend { display: flex; gap: 16px; align-items: center; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.legend .key { display: inline-block; width: 18px; height: 0; border-top: 2px solid var(--chart-1); margin-right: 6px; vertical-align: middle; }
.legend .key.forecast { border-top: 2px dashed var(--chart-2); margin-left: 10px; }
details summary { cursor: pointer; margin-top: 8px; }

/* ---------- browser surfaces, touch, busy ---------- */
::selection { background: var(--indigo-soft); color: var(--text); }
:root { accent-color: var(--indigo); caret-color: var(--indigo); scrollbar-color: var(--line) transparent; }
@media (pointer: coarse) {
  button, input, select { min-height: 44px; }
  nav a { padding: 11px 12px; }
}
/* A form or button stays disabled while its request runs: no double expenses, no double close. */
button[aria-busy="true"] { cursor: progress; opacity: .6; }
.icon { width: 16px; height: 16px; display: block; }

/* ---------- outreach ---------- */
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.chip { border-radius: 999px; padding: 5px 12px; font-size: 14px; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip.on .muted { color: rgb(255 255 255 / .7); }
.chip.attention:not(.on) { border-color: var(--amber); color: var(--amber); }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack input, .stack select, .stack textarea { width: 100%; }
textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; resize: vertical; }
textarea:focus { outline: 2px solid var(--focus); outline-offset: -1px; border-color: transparent; }
.found { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); }
.found .sub, .timeline .sub { display: block; color: var(--muted); font-size: 13px; }
.timeline { list-style: none; padding: 0; margin: 12px 0 0; }
.timeline li { padding: 8px 0; border-top: 1px solid var(--line); }
.timeline li .muted { display: block; font-size: 12px; }
details summary { cursor: pointer; }

/* «Мой доход» → ежемесячные платежи: cards instead of a table, so the buttons stay in place in the narrow column */
.pay-total { padding: 12px 14px; margin: 0 0 12px; border-radius: 12px; background: var(--paper, rgba(127,127,127,.08)); }
.pay-total .value { font-size: 24px; font-weight: 700; margin: 2px 0; }
.pay-list { display: flex; flex-direction: column; gap: 8px; }
.pay-item { padding: 10px 12px; border: 1px solid var(--line, rgba(127,127,127,.25)); border-radius: 10px; }
.pay-item.paid { opacity: .65; }
.pay-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.pay-head strong { overflow-wrap: anywhere; }
.pay-head .num { white-space: nowrap; font-weight: 600; }
.pay-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.ok-text { color: var(--mint); }

/* «Письма Harvey» */
.harvey-draft { margin-bottom: 14px; }
.harvey-to { display: flex; flex-direction: column; gap: 2px; }
.harvey-draft textarea { font: inherit; line-height: 1.5; }

/* «График смен»: the owner's sheet colours — yellow morning, blue evening */
.shift { display: inline-block; padding: 1px 7px; border-radius: 6px; font-size: 12px; font-weight: 650; background: var(--paper); color: var(--muted); white-space: nowrap; }
.shift.morning { background: #ffec91; color: #624700; }
.shift.evening { background: #dce8ff; color: #244a91; }
.plan-state { display: inline-block; min-width: 16px; padding: 0 4px; border-radius: 5px; font-size: 11px; font-weight: 700; text-align: center; }
.plan-state.met { background: var(--mint-soft); color: var(--mint); }
.plan-state.below { background: var(--red-soft); color: var(--red); }
.roster-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.roster-person { padding: 2px 0; }
.week-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.week-nav { align-items: center; gap: 6px; }
/* The week as a real grid: every cell outlined, the shift is the cell colour (as in the owner's sheet). */
.wk-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table.wk { border-collapse: separate; border-spacing: 0; width: 100%; table-layout: fixed; min-width: 640px; }
table.wk th, table.wk td { padding: 8px 6px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; vertical-align: middle; }
table.wk tr > :last-child { border-right: 0; }
table.wk tbody tr:last-child > * { border-bottom: 0; }
table.wk thead th { background: var(--paper); color: var(--muted); font-size: 12px; font-weight: 500; line-height: 1.3; }
table.wk th.wk-day.today { background: var(--indigo); color: var(--on-indigo); font-weight: 650; }
.wk-dow { display: block; font-size: 11px; }
table.wk .wk-name { position: sticky; left: 0; z-index: 1; width: 112px; text-align: left; padding-left: 12px; background: var(--surface);
  color: var(--text); font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.wk thead .wk-name { background: var(--paper); color: var(--muted); font-size: 12px; font-weight: 500; }
table.wk tr.me .wk-name { color: var(--indigo); box-shadow: inset 3px 0 0 var(--indigo); }
.wk-cell { height: 52px; font-variant-numeric: tabular-nums; }
.wk-cell.morning { background: #fff3c4; }
.wk-cell.evening { background: #dfeaff; }
.wk-cell.shift { background: var(--paper); }
.wk-cell.today { box-shadow: inset 2px 0 0 var(--indigo), inset -2px 0 0 var(--indigo); }
.wk-plan { display: block; font-size: 14px; font-weight: 650; color: var(--text); }
.wk-fact { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; }
.wk-count { display: block; font-size: 11px; color: var(--muted); }
.wk-none { font-size: 11px; color: var(--muted); }
table.wk tfoot > tr > * { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 0; }
table.wk tfoot .wk-name { background: var(--paper); }
.wk-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--line); background: var(--surface); vertical-align: -2px; }
.wk-swatch.morning { background: #fff3c4; }
.wk-swatch.evening { background: #dfeaff; }
@media (prefers-color-scheme: dark) {
  .wk-cell.morning, .wk-swatch.morning { background: #4a3c17; }
  .wk-cell.evening, .wk-swatch.evening { background: #213a63; }
}
.roster-person.me { font-weight: 650; }
@media (prefers-color-scheme: dark) {
  .shift.morning { background: #51401b; color: #ffe5a0; }
  .shift.evening { background: #233e6d; color: #cadcff; }
}

/* «Обзор»: the day switcher in the dashboard header */
.ov-nav { align-items: center; gap: 6px; flex-wrap: nowrap; }
.ov-nav button { padding: 7px 10px; }

/* «Наличные» */
.cash-form { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; }
.cash-form fieldset { border: 0; padding: 0; margin: 0; display: flex; gap: 6px; align-items: flex-end; flex-wrap: wrap; }
.cash-form legend { font-size: 13px; color: var(--muted); padding: 0; margin-bottom: 4px; }
.cash-form .amount { width: 130px; }
.cash-form .cash-client { flex: 1; min-width: 200px; }
.cash-form .cash-client input { width: 100%; }
.cash-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.cash-totals .value { white-space: nowrap; }
.cash-totals .sheet { margin-bottom: 20px; }

/* «Маркетолог» */
.mk-section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.mk-section-head h2 { margin: 0; }
.mk-list { display: grid; gap: 12px; }
.mk-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--surface); }
.mk-card.mk-closed { opacity: .7; }
.mk-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.mk-head h3 { margin: 0; font-size: 15px; font-weight: 650; line-height: 1.35; }
.mk-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.mk-card p { margin: 8px 0 0; }
.mk-steps { margin: 8px 0 0; padding-left: 20px; }
.mk-steps li { margin: 2px 0; }
.mk-small { font-size: 13px; }
.mk-idea { background: var(--paper); border-radius: 8px; padding: 8px 10px; }
.mk-sources { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 13px; }
.mk-sources a { color: var(--indigo); overflow-wrap: anywhere; }
.mk-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* «Балансы профилей» */
.balance-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 14px; }
.balance-cards .sheet { margin: 0; }
tr.row-bad td { background: var(--red-soft); }
