/* Travora CRM — staff desk. Look follows the HV Technologies CRM reference (user request, Task 3):
   white panels on a light grey page, Inter, blue primary, icon sidebar with collapsible groups, soft status badges, dark mode.
   The website keeps its own editorial design (styles.css / CLAUDE.md design rules).
   Planner colours --p1..3 validated with the dataviz palette checker (light and dark). */
:root {
  --bg: #f5f6f8; --panel: #ffffff; --side: #fafafa; --raise: #ffffff;
  --line: #e5e7eb; --line-2: #f0f1f3; --hover: #f3f4f6;
  --ink: #111827; --ink-2: #374151; --muted: #6b7280; --faint: #9ca3af;
  --primary: #1c6ed4; --primary-h: #175db5; --primary-soft: #e8f1fc; --primary-ink: #ffffff;
  --ok: #15803d; --ok-soft: #e7f6ec; --warn: #b45309; --warn-soft: #fdf3e1; --bad: #dc2626; --bad-soft: #fdecec;
  --violet: #7c3aed; --violet-soft: #f1eafe; --grey-soft: #f1f2f4;
  --p1: #1f6a9a; --p2: #a8741a; --p3: #8a4a98; --p0: #6b7280;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05); --shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);
  --r: 12px; --r-sm: 8px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --side-w: 256px;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0d1117; --panel: #161b22; --side: #11151b; --raise: #1c222b;
  --line: #2a313c; --line-2: #21272f; --hover: #1f252e;
  --ink: #e6e8eb; --ink-2: #c9cdd3; --muted: #9aa3ae; --faint: #6e7681;
  --primary: #3b82f6; --primary-h: #60a5fa; --primary-soft: #16233d; --primary-ink: #ffffff;
  --ok: #4ade80; --ok-soft: #10271a; --warn: #fbbf24; --warn-soft: #2a2110; --bad: #f87171; --bad-soft: #2d1414;
  --violet: #a78bfa; --violet-soft: #221a3a; --grey-soft: #21272f;
  --p1: #3f8fd0; --p2: #b07f25; --p3: #a86fc0; --p0: #9aa3ae;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 12px 32px rgba(0, 0, 0, .5);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { background: var(--bg); }
body { margin: 0; color: var(--ink); font: 400 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i--sm { width: 15px; height: 15px; }
svg.i--lg { width: 22px; height: 22px; }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-weight: 500; font-size: 13.5px; cursor: pointer; white-space: nowrap;
  text-decoration: none; box-shadow: var(--shadow); transition: background .15s, border-color .15s; }
.btn:hover { background: var(--hover); }
.btn--primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn--primary:hover { background: var(--primary-h); border-color: var(--primary-h); }
.btn--dark { background: var(--ink); border-color: var(--ink); color: var(--panel); }
.btn--dark:hover { opacity: .9; background: var(--ink); }
.btn--danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn--danger:hover { opacity: .9; background: var(--bad); }
.btn--ghost { box-shadow: none; }
.btn--sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn--wide { width: 100%; height: 40px; }
.btn[disabled] { opacity: .55; cursor: progress; }
.linkbtn { border: 0; background: none; padding: 0; cursor: pointer; color: var(--primary); font-size: 13px; font-weight: 500; }
.linkbtn:hover { text-decoration: underline; }
.iconbtn { position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; background: none; border-radius: var(--r-sm);
  cursor: pointer; color: var(--muted); text-decoration: none; }
.iconbtn:hover { background: var(--hover); color: var(--ink); }
.iconbtn.is-on { color: var(--primary); background: var(--primary-soft); }
.iconbtn .badge { position: absolute; top: 3px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--bad); color: #fff;
  font-size: 10px; font-weight: 600; line-height: 16px; text-align: center; }

/* ── Forms ── */
.field { display: grid; gap: 6px; align-content: start; }
.field > span { font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.field > span i { color: var(--bad); font-style: normal; }
.field input, .field select, .field textarea, .ctl {
  width: 100%; height: 38px; padding: 0 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--ink); }
.field textarea { height: auto; min-height: 80px; padding: 8px 12px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .ctl:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.field input[readonly] { background: var(--hover); color: var(--muted); }
.field small { color: var(--muted); font-size: 12px; }
.ctl { width: auto; min-width: 150px; }
.form-error { min-height: 1.2em; margin: 0; color: var(--bad); font-size: 13px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; padding-top: 2px; }
.checks label, label.check { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; cursor: pointer; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); }
.chips-input { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px; border-radius: 13px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink-2); font-size: 12px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.chip:hover { background: var(--hover); }
.chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.chip--soft { background: var(--grey-soft); border-color: transparent; }
.chip--soft[aria-pressed="false"] { color: var(--faint); text-decoration: line-through; }

/* ── Login ── */
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: var(--panel); }
.login__side { background: #0f172a; color: #e2e8f0; padding: 32px 40px; display: flex; flex-direction: column; justify-content: space-between;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 40px 40px; }
.login__brand { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.login__pitch h2 { font-size: 30px; line-height: 1.2; color: #fff; max-width: 14ch; }
.login__pitch p { color: #94a3b8; max-width: 44ch; margin: 12px 0 20px; }
.login__boxes { display: flex; gap: 10px; flex-wrap: wrap; }
.login__boxes div { border: 1px solid rgba(255,255,255,.12); border-radius: 10px; padding: 10px 12px; font-size: 12px; color: #94a3b8; min-width: 120px; }
.login__boxes b { display: block; color: #fff; font-size: 12.5px; margin-bottom: 2px; }
.login__small { font-size: 12px; color: #64748b; }
.login__form { align-self: center; justify-self: center; width: min(380px, 100% - 32px); display: grid; gap: 14px; padding: 40px 0; }
.login__form h1 { font-size: 24px; }
.login__form p { margin: 0; }
.login__row { display: flex; justify-content: space-between; align-items: center; }
.pw { position: relative; }
.pw input { padding-right: 40px; }
.pw button { position: absolute; right: 4px; top: 1px; }
.login__demo { font-size: 12.5px; background: var(--warn-soft); color: var(--ink-2); padding: 10px 12px; border-radius: var(--r-sm); }

/* ── App shell ── */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .2s; }
.side { position: sticky; top: 0; height: 100vh; background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column; overflow: hidden; }
.ws { margin: 12px; padding: 8px 10px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); box-shadow: var(--shadow); text-decoration: none; }
.ws__logo { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: none; }
.ws__name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; line-height: 1.25; }
.ws__role { font-size: 12px; color: var(--muted); display: block; }
.ws > span { min-width: 0; }
.nav { flex: 1; overflow-y: auto; padding: 0 10px 12px; }
.nav__group { margin: 16px 12px 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-weight: 600; white-space: nowrap; }
.nav__item { display: flex; align-items: center; gap: 12px; width: 100%; height: 38px; padding: 0 12px; border: 0; background: none; border-radius: 10px;
  text-decoration: none; color: var(--ink-2); font-size: 14.5px; font-weight: 500; cursor: pointer; white-space: nowrap; text-align: left; }
.nav__item:hover { background: var(--hover); color: var(--ink); }
.nav__item.is-active { background: var(--panel); color: var(--ink); font-weight: 600; box-shadow: var(--shadow), 0 0 0 1px var(--line); }
.nav__item .grow { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.nav__item .chev { width: 15px; height: 15px; color: var(--faint); transition: transform .15s; }
.nav__item[aria-expanded="true"] .chev { transform: rotate(90deg); }
.nav__count { background: var(--bad); color: #fff; font-size: 10.5px; font-weight: 600; border-radius: 9px; padding: 0 6px; line-height: 17px; }
.nav__sub { margin: 2px 0 4px 21px; padding-left: 12px; border-left: 1px solid var(--line); }
.nav__sub .nav__item { height: 32px; font-size: 13.5px; gap: 8px; }
.side__foot { border-top: 1px solid var(--line); padding: 10px 16px; font-size: 12px; color: var(--muted); white-space: nowrap; display: flex; justify-content: space-between; gap: 8px; }
.side__foot b { color: var(--ink); }
.side__foot a { text-decoration: none; }
.side__foot a:hover { color: var(--primary); }

/* collapsed to icons */
.app.is-collapsed { grid-template-columns: 72px minmax(0, 1fr); }
.app.is-collapsed .ws { justify-content: center; padding: 8px 0; }
.app.is-collapsed .ws > span, .app.is-collapsed .nav__group, .app.is-collapsed .nav__item .grow, .app.is-collapsed .nav__item .chev,
.app.is-collapsed .nav__sub, .app.is-collapsed .nav__count, .app.is-collapsed .side__foot span { display: none; }
.app.is-collapsed .nav__item { justify-content: center; padding: 0; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; height: 60px; display: flex; align-items: center; gap: 6px; padding: 0 20px; background: var(--panel); border-bottom: 1px solid var(--line); }
.top__title { font-size: 19px; font-weight: 600; margin: 0 auto 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.top__user { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px 0 4px; margin-left: 6px; border: 1px solid var(--line); border-radius: 18px;
  background: var(--panel); cursor: pointer; font-weight: 500; }
.top__user:hover { background: var(--hover); }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--grey-soft); color: var(--muted); flex: none; font-size: 12px; font-weight: 600; }
.view { padding: 24px; min-width: 0; outline: none; }

/* ── Popovers (⋮ menus, bell, account) ── */
.pop { position: fixed; z-index: 80; min-width: 190px; max-width: 360px; background: var(--raise); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 6px; }
.pop__head { padding: 8px 10px; border-bottom: 1px solid var(--line); margin: -6px -6px 6px; }
.pop__head small { display: block; color: var(--muted); }
.pop button, .pop a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: 0; background: none; border-radius: 6px; cursor: pointer;
  text-align: left; font-size: 13.5px; color: var(--ink); text-decoration: none; }
.pop button:hover, .pop a:hover { background: var(--hover); }
.pop .is-danger { color: var(--bad); }
.pop hr { border: 0; border-top: 1px solid var(--line); margin: 6px -6px; }
.pop--bell { width: 360px; }
.pop--bell .nitem { align-items: flex-start; }
.pop--bell .nitem small { display: block; color: var(--muted); }
.pop--bell .nitem.is-unread { background: var(--primary-soft); }
.pop__foot { display: flex; justify-content: space-between; padding: 6px 6px 2px; border-top: 1px solid var(--line); margin: 6px -6px -6px; }
.pop__foot button { width: auto; color: var(--primary); font-weight: 500; }

/* ── Building blocks ── */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); min-width: 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.panel__title { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 600; margin: 0 0 2px; }
.panel__title svg { color: var(--ok); }
.panel__sub { color: var(--muted); font-size: 12.5px; margin: 0 0 16px; }
.grid { display: grid; gap: 20px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.gap-top { margin-top: 20px; }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.bar .grow { flex: 1; }
.bar h2 { font-size: 18px; }
.section-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 28px 0 14px; flex-wrap: wrap; }
.section-title h2 { font-size: 19px; }
.section-title p { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }

/* KPI tiles */
.kpi { position: relative; display: grid; gap: 6px; padding: 18px 20px; min-height: 118px; text-decoration: none; align-content: start; }
a.kpi:hover { border-color: var(--primary); }
.kpi__label { font-size: 13px; color: var(--ink-2); font-weight: 500; padding-right: 44px; }
.kpi__value { font-size: 26px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi__meta { font-size: 12.5px; color: var(--muted); }
.kpi__icon { position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; }
.tone-blue { background: var(--primary-soft); color: var(--primary); }
.tone-green { background: var(--ok-soft); color: var(--ok); }
.tone-amber { background: var(--warn-soft); color: var(--warn); }
.tone-red { background: var(--bad-soft); color: var(--bad); }
.tone-violet { background: var(--violet-soft); color: var(--violet); }
.kpi--sm { min-height: 92px; padding: 14px 16px; }
.kpi--sm .kpi__value { font-size: 22px; }
.kpi--sm .kpi__icon { width: 30px; height: 30px; top: 12px; right: 12px; border-radius: 8px; }

/* Badges (soft background + text; never colour alone) */
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 12px; font-weight: 500; white-space: nowrap;
  background: var(--grey-soft); color: var(--ink-2); }
.b-blue { background: var(--primary-soft); color: var(--primary); }
.b-green { background: var(--ok-soft); color: var(--ok); }
.b-amber { background: var(--warn-soft); color: var(--warn); }
.b-red { background: var(--bad-soft); color: var(--bad); }
.b-violet { background: var(--violet-soft); color: var(--violet); }
.who { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.who::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--pc, var(--p0)); flex: none; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag { font-size: 11.5px; padding: 1px 8px; border-radius: 10px; background: var(--grey-soft); color: var(--ink-2); white-space: nowrap; }

/* ── List screen (shared controls) ── */
.lst__filters { padding: 14px 16px; margin-bottom: 14px; display: grid; gap: 12px; }
.lst__filters .row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.lst__filters .sep { width: 1px; height: 26px; background: var(--line); }
.lst__label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.lst__tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.lst__search { position: relative; flex: 1; min-width: 220px; }
.lst__search svg { position: absolute; left: 12px; top: 10px; color: var(--faint); }
.lst__search input { width: 100%; height: 38px; padding: 0 12px 0 36px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); }
.lst__search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.seg { display: inline-flex; flex-wrap: wrap; max-width: 100%; padding: 3px; gap: 2px; border-radius: 10px; background: var(--grey-soft); }
.seg button { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 0; background: none; border-radius: 8px; cursor: pointer;
  font-size: 12.5px; font-weight: 500; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }
.bulk { display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin-bottom: 10px; border-radius: var(--r-sm); background: var(--primary-soft); font-size: 13px; }
.lst__body { overflow: hidden; }
.tablewrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.t th { text-align: left; font-weight: 600; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 12px 14px;
  border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--panel); }
.t th button { border: 0; background: none; padding: 0; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.t th button span { color: var(--faint); }
.t td { padding: 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.t tbody tr:last-child td { border-bottom: 0; }
.t tbody tr.is-link { cursor: pointer; }
.t tbody tr:hover td { background: var(--hover); }
.t tbody tr.is-selected td { background: var(--primary-soft); }
.t td.r, .t th.r { text-align: right; }
.t td.cb, .t th.cb { width: 40px; padding-right: 0; }
.t td.act { width: 48px; text-align: right; padding: 6px 10px; }
.t small { display: block; color: var(--muted); font-size: 12px; }
.t .strong { font-weight: 500; }
.t tfoot td { font-weight: 600; border-top: 1px solid var(--line); }
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.pager b { color: var(--ink); }
.pager .grow { flex: 1; }
.pager .pg { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; display: inline-grid; place-items: center; color: var(--ink); }
.pager .pg[aria-current="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager .pg[disabled] { opacity: .4; cursor: default; }
.pager select { height: 30px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); padding: 0 8px; }
.empty { padding: 56px 12px; text-align: center; color: var(--muted); display: grid; justify-items: center; gap: 6px; }
.empty .ico { width: 44px; height: 44px; border-radius: 50%; background: var(--grey-soft); display: grid; place-items: center; color: var(--muted); }
.empty b { color: var(--ink); font-weight: 600; }

.cards { display: grid; gap: 14px; padding: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.cards--list { grid-template-columns: 1fr; }
.rcard { position: relative; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; background: var(--panel); cursor: pointer; display: grid; gap: 6px; min-width: 0; }
.rcard:hover { border-color: var(--primary); }
.rcard__top { display: flex; align-items: flex-start; gap: 8px; }
.rcard__top b { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.rcard__meta { color: var(--muted); font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.rcard .act { margin: -6px -8px -6px 0; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; padding: 14px; }
.lane { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; min-height: 380px; display: flex; flex-direction: column; gap: 8px; }
.lane.is-over { outline: 2px dashed var(--primary); outline-offset: -3px; }
.lane__head { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; padding: 2px 4px 6px; }
.lane__head small { color: var(--muted); font-weight: 500; }
.lane__drop { border: 1px dashed var(--line); border-radius: var(--r-sm); padding: 12px; text-align: center; color: var(--faint); font-size: 12px; }
.lane .rcard { cursor: grab; }
.lane .rcard.is-dragging { opacity: .4; }

/* Charts — single series bars in primary blue, hover tooltips */
.hbars { display: grid; gap: 14px; }
.hbar { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 13.5px; }
.hbar__track { grid-column: 1 / -1; height: 6px; background: var(--line-2); border-radius: 3px; }
.hbar__fill { height: 100%; background: var(--primary); border-radius: 3px; }
.hbar__v { font-variant-numeric: tabular-nums; font-weight: 600; }
.cols { display: flex; align-items: flex-end; gap: 4px; height: 220px; border-bottom: 1px solid var(--line); }
.cols__c { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 0; }
.cols__c:hover .cols__b { background: var(--primary-h); }
.cols__b { width: min(44px, 70%); background: var(--primary); border-radius: 4px 4px 0 0; }
.cols__v { font-size: 11.5px; color: var(--muted); margin-bottom: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cols__x { display: flex; gap: 4px; margin-top: 6px; }
.cols__x span { flex: 1; text-align: center; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.chart-empty { min-height: 220px; display: grid; place-content: center; justify-items: center; text-align: center; color: var(--muted); font-size: 12.5px; gap: 6px; }
.chart-empty svg { width: 40px; height: 40px; color: var(--faint); }
.chart-empty b { color: var(--ink); font-weight: 600; font-size: 14px; }
.chart-empty--sm { min-height: 90px; }
.tip { position: fixed; z-index: 95; pointer-events: none; background: #111827; color: #fff; font-size: 12.5px; padding: 6px 9px; border-radius: 6px; max-width: 280px; }

/* Ruled rows (today, upcoming) */
.rows { display: grid; }
.rows > * { display: grid; grid-template-columns: 70px 1fr auto; gap: 12px; padding: 12px 6px; border: 0; border-bottom: 1px solid var(--line-2); align-items: start;
  background: none; text-align: left; width: 100%; text-decoration: none; border-radius: 0; }
.rows > *:last-child { border-bottom: 0; }
.rows > .empty { display: grid; grid-template-columns: none; }
.rows .time { font-variant-numeric: tabular-nums; font-weight: 600; }
.rows small { display: block; color: var(--muted); }
.rows > button { cursor: pointer; }
.rows > button:hover { background: var(--hover); }

/* Notifications page */
.nrow { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: start; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.nrow:last-child { border-bottom: 0; }
.nrow.is-unread { background: var(--primary-soft); }
.nrow__icon { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; }
.nrow__text { cursor: pointer; min-width: 0; }
.nrow__text small { display: block; color: var(--muted); }
.nrow__act { display: flex; gap: 4px; align-items: center; }

/* ── Calendar ── */
.cal { overflow: auto; max-height: calc(100vh - 250px); }
.cal__head, .cal__body { display: grid; grid-template-columns: 60px repeat(var(--days), minmax(120px, 1fr)); min-width: calc(60px + var(--days) * 120px); }
.cal__head { position: sticky; top: 0; z-index: 3; background: var(--panel); border-bottom: 1px solid var(--line); }
.cal__head > div { padding: 10px 12px; font-size: 12px; color: var(--muted); border-left: 1px solid var(--line-2); font-weight: 500; }
.cal__head > div:first-child { border-left: 0; }
.cal__head b { display: block; font-size: 20px; font-weight: 600; color: var(--ink); line-height: 1.2; }
.cal__head .is-today b { color: var(--primary); }
.cal__hours > div { height: 64px; font-size: 11.5px; color: var(--muted); text-align: right; padding: 2px 8px 0 0; font-variant-numeric: tabular-nums; }
.cal__col { position: relative; border-left: 1px solid var(--line-2); background-image: repeating-linear-gradient(to bottom, var(--line-2) 0 1px, transparent 1px 64px); }
.cal__col.is-closed { background-color: var(--hover); }
.cal__closed { position: absolute; top: 8px; left: 0; right: 0; text-align: center; font-size: 12px; color: var(--muted); pointer-events: none; }
.cal__slot { position: absolute; left: 0; right: 0; height: 32px; border: 0; background: none; cursor: pointer; padding: 0; }
.cal__slot:hover { background: var(--primary-soft); }
.cal__now { position: absolute; left: 0; right: 0; border-top: 2px solid var(--bad); z-index: 2; pointer-events: none; }
.ev { position: absolute; z-index: 1; overflow: hidden; text-align: left; border: 0; border-left: 3px solid var(--pc, var(--p0)); background: var(--primary-soft);
  box-shadow: 0 0 0 2px var(--panel); border-radius: 0 6px 6px 0; padding: 4px 7px; font-size: 12px; line-height: 1.3; cursor: pointer; color: var(--ink); }
.ev:hover { filter: brightness(.97); }
.ev b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev span { color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev.is-short span { display: none; }
.ev.is-short { padding-top: 6px; }
.ev.is-cancelled, .ev.is-no_show { opacity: .55; text-decoration: line-through; background: var(--grey-soft); }
.ev.is-completed { background: var(--ok-soft); }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.month__dow { padding: 10px 12px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); font-weight: 500; }
.month__d { min-height: 110px; padding: 8px; border-bottom: 1px solid var(--line-2); border-left: 1px solid var(--line-2); display: grid; align-content: start; gap: 3px; min-width: 0; }
.month__d:nth-child(7n+1) { border-left: 0; }
.month__d.is-out { background: var(--hover); color: var(--faint); }
.month__n { justify-self: start; border: 0; background: none; padding: 0; cursor: pointer; font-weight: 600; font-variant-numeric: tabular-nums; width: 26px; height: 26px; border-radius: 50%; color: inherit; }
.month__d.is-today .month__n { background: var(--primary); color: #fff; }
.month__e { border: 0; background: none; padding: 1px 0 1px 10px; text-align: left; font-size: 12px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; color: var(--ink); }
.month__e::before { content: ""; position: absolute; left: 0; top: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--pc, var(--p0)); }
.month__more { font-size: 12px; color: var(--primary); border: 0; background: none; padding: 0; text-align: left; cursor: pointer; }
.cal-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.cal-bar h3 { font-size: 16px; margin-right: auto; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.legend label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }

/* Event types */
.etype { border-top: 3px solid var(--pc, var(--primary)); }
.etype__link { font-size: 12px; color: var(--muted); word-break: break-all; }

/* Masters */
.masters { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; align-items: start; }
.masters__nav { padding: 8px; }
.masters__nav button { display: flex; justify-content: space-between; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; font-size: 13.5px; text-align: left; color: var(--ink-2); }
.masters__nav button:hover { background: var(--hover); }
.masters__nav button[aria-current="true"] { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.masters__nav small { color: var(--muted); }

/* Profile */
.profile { max-width: 640px; margin: 0 auto; display: grid; gap: 20px; }
.profile__head { text-align: center; display: grid; justify-items: center; gap: 4px; }
.profile__head .avatar { width: 72px; height: 72px; font-size: 26px; background: var(--ink); color: var(--panel); }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 12px; font-size: 13.5px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; text-align: right; }

/* ── Modal ── */
.modal { border: 0; border-radius: 16px; padding: 0; width: min(720px, calc(100% - 24px)); max-height: calc(100vh - 40px); background: var(--panel); color: var(--ink); box-shadow: var(--shadow-lg); }
.modal::backdrop { background: rgba(15, 23, 42, .45); }
.modal__inner { display: grid; grid-template-rows: auto 1fr auto; max-height: calc(100vh - 42px); margin: 0; }
.modal__head { padding: 18px 22px 14px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.modal__head h2 { font-size: 17px; }
.modal__head .x { margin-left: auto; }
.modal__body { padding: 18px 22px; overflow: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; align-content: start; }
.modal__body > .full { grid-column: 1 / -1; }
.modal__foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.modal__foot .grow { flex: 1; }
.facts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 22px; font-size: 13px; padding: 10px 12px; background: var(--hover); border-radius: var(--r-sm); }
.facts b { font-weight: 600; }
.note { grid-column: 1 / -1; font-size: 12.5px; margin: 0; color: var(--muted); }
.info { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; margin: 0; }
.info dt { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.info dd { margin: 2px 0 0; font-weight: 500; word-break: break-word; }
.items { grid-column: 1 / -1; display: grid; gap: 6px; }
.items__row { display: grid; grid-template-columns: 1fr 64px 110px 100px 32px; gap: 6px; align-items: center; }
.items__row input { height: 36px; padding: 0 10px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); width: 100%; min-width: 0; }
.items__head { font-size: 12px; color: var(--muted); }
.items__amt { text-align: right; font-variant-numeric: tabular-nums; }
.subhead { grid-column: 1 / -1; font-size: 14px; font-weight: 600; margin: 8px 0 -4px; }
.mini { grid-column: 1 / -1; }
.mini table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mini td { padding: 7px 4px; border-bottom: 1px solid var(--line-2); }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: #111827; color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 100;
  font-size: 13.5px; box-shadow: var(--shadow-lg); max-width: calc(100% - 32px); }
.toast.is-error { background: #b91c1c; }

/* Printable invoice */
.print-root { display: none; }
.invoice { color: #111; background: #fff; padding: 32px; max-width: 800px; margin: 0 auto; font: 14px/1.5 var(--font); }
.invoice h1 { font-size: 28px; }
.invoice table { width: 100%; border-collapse: collapse; margin: 24px 0; }
.invoice th, .invoice td { text-align: left; padding: 8px 6px; border-bottom: 1px solid #ddd; }
.invoice .r { text-align: right; }
.invoice__top { display: flex; justify-content: space-between; gap: 24px; }
@media print {
  body.printing > * { display: none !important; }
  body.printing > .print-root { display: block !important; }
}

/* ── Responsive ── */
@media (max-width: 1200px) { .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid--6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .app, .app.is-collapsed { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 60; left: 0; top: 0; width: 272px; transform: translateX(-100%); transition: transform .25s; box-shadow: var(--shadow-lg); }
  .app.is-menu .side { transform: none; }
  .grid--2, .grid--3, .masters { grid-template-columns: minmax(0, 1fr); }
  .top { padding: 0 10px; gap: 2px; }
  .top__user span { display: none; }
  .view { padding: 16px; }
  .login { grid-template-columns: 1fr; }
  .login__side { padding: 24px 16px; gap: 18px; }
  .login__pitch h2 { font-size: 22px; }
}
@media (max-width: 560px) {
  .grid--4, .grid--6 { grid-template-columns: 1fr 1fr; }
  .kpi { min-height: 100px; padding: 14px; }
  .kpi__value { font-size: 20px; }
  .modal__body, .info { grid-template-columns: 1fr; }
  .items__row { grid-template-columns: 1fr 52px 84px 32px; }
  .items__row .items__amt { display: none; }
  .top__title { font-size: 16px; }
  #refreshBtn, #filtersBtn { display: none; }
  .top__user { padding: 0 3px; margin-left: 2px; border: 0; }
  .iconbtn { width: 34px; }
  .panel { padding: 16px; }
  .tablewrap .t { min-width: 720px; }
  .lst__search { min-width: 100%; }
  .pop--bell { width: calc(100vw - 24px); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
