/* Фокус — стили. Ноутбук: боковое меню. Телефон (< 900px): нижняя панель. */
:root {
  --bg: #F3F4F8;
  --surface: #FFFFFF;
  --ink: #0E1726;
  --muted: #5B6577;
  --faint: #8A93A5;
  --line: #E3E6EE;
  --line-soft: #EEF0F5;
  --side: #0E1726;
  --side-2: #1A2740;
  --side-text: #B8C0D0;

  --clients: #1F4FE0;
  --clients-bg: #E6EDFF;
  --clients-dark: #163BAA;
  --startup: #B4470E;
  --startup-bg: #FDEBDD;
  --startup-ink: #9A3A0A;
  --health: #0B7A6E;
  --health-bg: #DDF3EF;
  --health-ink: #08665C;
  --other: #5B6577;
  --other-bg: #ECEEF3;
  --danger: #B42318;
  --sales: #6D28D9;
  --sales-bg: #EFE7FF;
  --sales-ink: #5B21B6;

  --r-lg: 24px;
  --r-md: 18px;
  --r-sm: 14px;
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Unbounded', 'Manrope', system-ui, sans-serif;
  --shadow: 0 1px 2px rgba(14, 23, 38, .04), 0 8px 24px rgba(14, 23, 38, .06);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--clients); text-decoration: none; }
a:hover { color: var(--clients-dark); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #7EA2FF; outline-offset: 2px; }
.muted { color: var(--muted); }
.error { color: var(--danger); background: #FDECEA; padding: 12px 14px; border-radius: 12px; font-weight: 600; font-size: 14px; }
.hint { font-size: 13px; color: var(--muted); }
.h-display { font-family: var(--display); font-weight: 600; letter-spacing: -0.01em; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 12px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Кнопки и поля ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: var(--r-sm);
  border: 0; background: var(--ink); color: #fff; font-weight: 700; font-size: 15px;
  transition: transform .08s ease, background .15s ease, opacity .15s;
  white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--clients); }
.btn-primary:hover { background: var(--clients-dark); color: #fff; }
.btn-light { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn-light:hover { background: #F7F8FB; color: var(--ink); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: rgba(14, 23, 38, .05); color: var(--ink); }
.btn-danger { background: transparent; color: var(--danger); }
.btn-health { background: var(--health); }
.btn-startup { background: var(--startup); }
.btn-block { width: 100%; }
.btn-lg { min-height: 54px; font-size: 17px; }
.btn-sm { min-height: 38px; padding: 0 12px; font-size: 14px; border-radius: 11px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent;
  display: inline-flex; align-items: center; justify-content: center; color: var(--muted); flex-shrink: 0;
}
.icon-btn:hover { background: rgba(14, 23, 38, .06); color: var(--ink); }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 700; }
.field > span:first-child { color: var(--ink); }
.input, select.input, textarea.input {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: var(--r-sm);
  border: 1.5px solid #C9CFDB; background: var(--surface); color: var(--ink); font-size: 16px; font-weight: 500;
  outline: none; transition: border-color .15s;
}
textarea.input { min-height: 90px; resize: vertical; line-height: 1.45; }
.input:focus { border-color: var(--clients); }
.input-icon { display: flex; align-items: center; gap: 8px; border: 1.5px solid #C9CFDB; border-radius: var(--r-sm); background: var(--surface); padding: 0 4px 0 14px; color: var(--muted); }
.input-icon:focus-within { border-color: var(--clients); }
.input-icon .input { border: 0; padding-left: 0; min-height: 52px; color: var(--ink); }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; color: #3A4456; min-height: 44px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--clients); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }

/* ---------- Бренд ---------- */
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; background: var(--clients); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 700; font-size: 16px;
}
.brand-name { font-family: var(--display); font-weight: 600; font-size: 20px; }

/* ---------- Вход ---------- */
body.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 620px) 1fr; }
.login-hero { background: var(--side); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.login-title { font-family: var(--display); font-weight: 600; font-size: clamp(32px, 4vw, 52px); line-height: 1.12; letter-spacing: -0.02em; }
.login-sub { color: var(--side-text); font-size: 18px; max-width: 440px; margin-top: 20px; }
.login-pills { display: flex; gap: 10px; flex-wrap: wrap; }
.pill-dark { padding: 10px 16px; border-radius: 999px; background: var(--side-2); font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-clients { background: #7EA2FF; } .dot-startup { background: #F5A06A; } .dot-health { background: #5FD3BF; }
.login-form-wrap { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login-form { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 20px; }
.login-form .h-display { font-size: 30px; margin-bottom: 6px; }
@media (max-width: 860px) {
  body.login { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .login-hero { padding: 40px 24px 32px; border-radius: 0 0 28px 28px; gap: 24px; }
  .login-sub, .login-pills { display: none; }
  .login-form-wrap { align-items: flex-start; padding: 32px 24px 40px; }
}
body.auth-page { min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; }
.auth-card { width: 100%; max-width: 460px; background: var(--surface); border-radius: var(--r-lg); padding: 32px; display: flex; flex-direction: column; gap: 18px; box-shadow: var(--shadow); }
.auth-card h1 { font-family: var(--display); font-weight: 600; font-size: 26px; }
.auth-card hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

/* ---------- Каркас приложения ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 248px; background: var(--side); color: #fff;
  padding: 28px 18px 20px; display: flex; flex-direction: column; gap: 28px; overflow-y: auto; z-index: 20;
}
.sidebar .brand { padding: 0 8px; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav a {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px;
  color: var(--side-text); font-size: 15px; font-weight: 600; transition: background .15s, color .15s;
}
.side-nav a:hover { background: var(--side-2); color: #fff; }
.side-nav a.active { background: var(--clients); color: #fff; font-weight: 700; }
.side-nav .badge { margin-left: auto; font-size: 12px; font-weight: 700; background: var(--side-2); color: #fff; padding: 2px 8px; border-radius: 999px; }
.side-nav a.active .badge { background: #3D68F0; }
.side-spacer { flex: 1; }
.side-card { background: var(--side-2); border-radius: 16px; padding: 14px 16px; font-size: 13px; line-height: 1.5; color: var(--side-text); }
.side-card b { color: #fff; }
.side-card .t { display: flex; align-items: center; gap: 8px; font-weight: 700; color: #7EA2FF; margin-bottom: 6px; }
.side-card .t.off { color: #F5A06A; }
.side-logout { display: flex; align-items: center; gap: 10px; background: transparent; border: 0; color: var(--side-text); padding: 10px 14px; border-radius: 12px; font-weight: 600; font-size: 14px; }
.side-logout:hover { background: var(--side-2); color: #fff; }

.main { margin-left: 248px; padding: 32px 40px 48px; max-width: 1400px; outline: none; min-height: 100vh; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head .kicker { font-size: 15px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.page-head h1 { font-family: var(--display); font-weight: 600; font-size: 30px; letter-spacing: -0.01em; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.tabbar { display: none; }

@media (max-width: 899px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding: 24px 16px calc(110px + env(safe-area-inset-bottom)); }
  .page-head { margin-bottom: 16px; align-items: center; flex-wrap: nowrap; }
  .summary { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 14px; padding: 0 16px; scrollbar-width: none; }
  .summary .pill { flex-shrink: 0; padding: 10px 14px; }
  .page-head h1 { font-size: 22px; }
  .page-head .kicker { font-size: 14px; margin-bottom: 2px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px);
    border-top: 1px solid var(--line); padding: 6px 4px calc(8px + env(safe-area-inset-bottom));
  }
  .tabbar a, .tabbar button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 54px; font-size: 11px; font-weight: 700; color: var(--muted); background: none; border: 0; border-radius: 12px;
  }
  .tabbar .active { color: var(--clients); font-weight: 800; }
  .tabbar .active[data-cat="startup"] { color: var(--startup); }
  .tabbar .active[data-cat="sales"] { color: var(--sales); }
  .tabbar a, .tabbar button { font-size: 10.5px; }
  .tabbar .active[data-cat="health"] { color: var(--health); }
  .hide-mobile { display: none !important; }
}
@media (min-width: 900px) { .hide-desktop { display: none !important; } }

/* ---------- Карточки ---------- */
.card { background: var(--surface); border-radius: var(--r-lg); padding: 24px 26px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.card-head h2, .card-head h3 { font-size: 18px; font-weight: 800; }
.card-head .meta { font-size: 14px; font-weight: 700; color: var(--muted); }
@media (max-width: 899px) { .card { padding: 16px 18px; border-radius: 22px; } .card-head h2, .card-head h3 { font-size: 16px; } }

.today-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
@media (max-width: 1180px) { .today-grid { grid-template-columns: 1fr; } }
@media (max-width: 899px) { .col, .today-grid { gap: 14px; } }

/* «Сейчас» */
.now { background: var(--clients); color: #fff; border-radius: var(--r-lg); padding: 28px 32px; display: flex; flex-direction: column; gap: 16px; }
.now.cat-startup { background: var(--startup); }
.now.cat-health { background: var(--health); }
.now.cat-rest, .now.cat-review, .now.cat-other { background: var(--side); }
.now-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.now-kicker { font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.now-left { font-size: 13px; font-weight: 700; background: rgba(255, 255, 255, .16); padding: 6px 12px; border-radius: 999px; }
.now h2 { font-family: var(--display); font-weight: 600; font-size: 28px; line-height: 1.25; }
.now p { color: rgba(255, 255, 255, .85); font-size: 16px; }
.now-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.now .btn-start { background: #fff; color: var(--clients); font-weight: 800; min-height: 52px; padding: 0 24px; font-size: 16px; }
.now.cat-startup .btn-start { color: var(--startup); }
.now.cat-health .btn-start { color: var(--health); }
.now.cat-rest .btn-start, .now.cat-review .btn-start, .now.cat-other .btn-start { color: var(--ink); }
.now .btn-outline { background: transparent; color: #fff; border: 1.5px solid rgba(255, 255, 255, .55); min-height: 52px; }
.now .btn-outline:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.now .btn-text { background: transparent; color: rgba(255, 255, 255, .85); min-height: 52px; }
.now .btn-text:hover { color: #fff; background: rgba(255, 255, 255, .08); }
@media (max-width: 899px) {
  .now { padding: 20px; border-radius: 22px; gap: 12px; }
  .now h2 { font-size: 20px; }
  .now p { font-size: 14px; }
  .now .btn-start { flex: 1; }
  .now .btn-outline, .now .btn-text { min-height: 48px; }
}

/* Задачи */
.tasks { display: flex; flex-direction: column; }
.task { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); min-height: 56px; }
.task:last-child { border-bottom: 0; }
.task-check {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--clients); background: transparent;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; padding: 0; color: #fff;
  position: relative;
}
.task-check::before { content: ''; position: absolute; inset: -9px; }
.task-check.c-startup { border-color: var(--startup); }
.task-check.c-health { border-color: var(--health); }
.task-check.c-other { border-color: var(--other); }
.task.done .task-check { background: var(--clients); }
.task.done .task-check.c-startup { background: var(--startup); }
.task.done .task-check.c-health { background: var(--health); }
.task.done .task-check.c-other { background: var(--other); }
.task-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.task-title { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.task.done .task-title { color: var(--muted); text-decoration: line-through; font-weight: 600; }
.task-sub { font-size: 13px; color: var(--muted); }
.task-meta { font-size: 14px; color: var(--muted); white-space: nowrap; }
.task .star { color: #E0A100; }
.task-menu { opacity: .6; }
.task:hover .task-menu { opacity: 1; }
.empty { padding: 18px 0 6px; color: var(--muted); font-size: 15px; }
.add-inline { display: flex; gap: 8px; margin-top: 10px; }
.add-inline .input { min-height: 46px; }

.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; padding: 5px 10px; border-radius: 999px; white-space: nowrap; }
.tag-clients { background: var(--clients-bg); color: var(--clients); }
.tag-startup { background: var(--startup-bg); color: var(--startup-ink); }
.tag-health { background: var(--health-bg); color: var(--health-ink); }
.tag-other, .tag-rest, .tag-review { background: var(--other-bg); color: var(--muted); }
.tag-warn { background: var(--startup-bg); color: var(--startup-ink); }

/* Плитки статистики */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (min-width: 1680px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { background: var(--surface); border-radius: 20px; padding: 20px 22px; display: flex; flex-direction: column; gap: 8px; color: var(--ink); }
a.stat:hover { color: var(--ink); box-shadow: var(--shadow); }
.stat-label { font-size: 13px; font-weight: 700; color: var(--muted); }
.stat-value { font-family: var(--display); font-size: 28px; font-weight: 600; line-height: 1.1; }
.stat-value small { font-size: 15px; }
.stat-sub { font-size: 13px; color: var(--muted); }
.bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--clients); }
.bar.health > i { background: var(--health); }
.bar.startup > i { background: var(--startup); }
.dots7 { display: flex; gap: 6px; }
.dots7 i { flex: 1; height: 8px; border-radius: 999px; background: var(--line); }
.dots7 i.on { background: var(--startup); }
@media (max-width: 899px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat { padding: 16px; }
  .stat-value { font-size: 22px; }
}

/* План дня */
.timeline { display: flex; flex-direction: column; gap: 2px; }
.tl { display: flex; align-items: center; gap: 14px; padding: 11px 12px; border-radius: 14px; }
.tl-time { width: 50px; font-size: 14px; font-weight: 700; color: var(--muted); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; background: #9AA3B5; }
.tl-dot.c-clients { background: var(--clients); } .tl-dot.c-startup { background: var(--startup); } .tl-dot.c-health { background: var(--health); }
.tl-title { flex: 1; font-size: 15px; font-weight: 600; }
.tl.past .tl-title { color: var(--faint); }
.tl.is-now { background: var(--clients-bg); }
.tl.is-now .tl-time { color: var(--clients); font-weight: 800; }
.tl.is-now .tl-title { font-weight: 800; }

/* Предупреждения */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; background: var(--startup-bg); color: var(--startup-ink); font-size: 14px; font-weight: 600; }
.alert.info { background: var(--clients-bg); color: var(--clients-dark); }
.alert .grow b { color: inherit; }

/* ---------- Клиенты ---------- */
.summary { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.summary .pill { background: var(--surface); border-radius: 16px; padding: 12px 18px; display: flex; gap: 10px; align-items: baseline; font-size: 14px; color: var(--muted); font-weight: 600; }
.summary .pill b { font-family: var(--display); font-size: 20px; font-weight: 600; color: var(--ink); }
.summary .pill.warn b { color: var(--startup); }
.kanban { display: grid; grid-template-columns: repeat(5, minmax(176px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.kcol { background: #E8EBF2; border-radius: 20px; padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 160px; transition: background .15s; }
.kcol.drop { background: var(--clients-bg); outline: 2px dashed var(--clients); }
.kcol-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px; }
.kcol-head h2 { font-size: 15px; font-weight: 800; }
.kcol-head span { font-size: 13px; font-weight: 800; color: var(--muted); }
.ocard {
  background: var(--surface); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px;
  border: 0; text-align: left; width: 100%; box-shadow: 0 1px 2px rgba(14, 23, 38, .05);
}
.ocard[draggable="true"] { cursor: grab; }
.ocard:hover { box-shadow: var(--shadow); }
.ocard.dragging { opacity: .5; }
.ocard-client { font-size: 15px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.ocard-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.ocard-when { color: var(--muted); font-weight: 600; }
.ocard-when.soon { color: var(--startup); font-weight: 800; }
.ocard-sum { font-weight: 700; white-space: nowrap; }
.ocard .bar { height: 6px; }
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 14px; padding: 2px 16px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid #DDE1EA; background: var(--surface); font-size: 14px; font-weight: 700; color: var(--ink); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.olist { display: flex; flex-direction: column; gap: 12px; }
.olist .ocard { border-radius: 20px; padding: 16px; }

/* ---------- Здоровье ---------- */
.health-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 1100px) { .health-grid { grid-template-columns: 1fr; gap: 14px; } }
.weight-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.weight-big { font-family: var(--display); font-size: 44px; font-weight: 600; line-height: 1.05; }
.weight-big small { font-size: 18px; }
.weight-goal { font-family: var(--display); font-size: 22px; font-weight: 600; color: var(--health); }
.chart { width: 100%; height: auto; display: block; margin: 8px 0; }
.chart text { font-family: var(--font); font-size: 11px; fill: var(--muted); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); font-weight: 600; }
.legend i { display: inline-block; width: 18px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; background: var(--ink); }
.legend i.plan { background: repeating-linear-gradient(90deg, var(--health) 0 5px, transparent 5px 9px); }
.weight-form { display: flex; gap: 10px; margin-top: 12px; }
.weight-form .input { max-width: 160px; font-size: 18px; font-weight: 700; }
.hrow { display: flex; align-items: center; gap: 12px; min-height: 58px; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; padding: 6px 0; }
.hrow:last-child { border-bottom: 0; }
.hrow-title { flex: 1; font-size: 15px; font-weight: 700; min-width: 120px; }
.glasses { display: flex; gap: 5px; flex-wrap: wrap; }
.glass { width: 26px; height: 34px; border-radius: 7px; border: 1.5px solid var(--health); background: var(--surface); padding: 0; position: relative; }
.glass::before { content: ''; position: absolute; inset: -5px -2px; }
.glass.on { background: var(--health); }
.toggle { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--health); background: var(--surface); color: var(--health-ink); font-weight: 800; font-size: 14px; }
.toggle.on { background: var(--health); color: #fff; }
.steps-input { width: 120px; min-height: 42px; }
.hist { width: 100%; border-collapse: collapse; font-size: 14px; }
.hist td, .hist th { padding: 10px 6px; border-bottom: 1px solid var(--line-soft); text-align: left; }
.hist th { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.hist td.num { font-variant-numeric: tabular-nums; font-weight: 700; }
.down { color: var(--health); } .up { color: var(--startup); }

/* ---------- Стартап ---------- */
.startup-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 1100px) { .startup-grid { grid-template-columns: 1fr; gap: 14px; } }
.step-card { background: var(--startup); color: #fff; border-radius: var(--r-lg); padding: 22px 24px; display: flex; flex-direction: column; gap: 10px; }
.step-card .now-kicker { color: #FFE3D1; }
.step-card h2 { font-size: 20px; font-weight: 800; line-height: 1.35; }
.step-card .btn { background: #fff; color: var(--startup); }
.week7 { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.week7 div { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.week7 span { width: 100%; max-width: 44px; aspect-ratio: 1; border-radius: 12px; border: 2px dashed #D5D9E2; }
.week7 .done span { background: var(--startup); border: 0; }
.week7 .today span { border-color: var(--startup); border-style: solid; }
.week7 .missed span { background: #F1F2F6; border-style: solid; border-color: #F1F2F6; }
.ms { display: flex; align-items: center; gap: 12px; min-height: 52px; border-top: 1px solid var(--line-soft); }
.ms-num {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--startup); display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: var(--startup-ink); background: transparent; flex-shrink: 0; padding: 0;
}
.ms.done .ms-num { background: var(--startup); color: #fff; }
.ms.done .ms-title { color: var(--muted); text-decoration: line-through; }
.ms-title { flex: 1; font-size: 15px; font-weight: 700; }
.ms-when { font-size: 13px; color: var(--muted); font-weight: 600; }
.goal-label { font-size: 12px; font-weight: 800; letter-spacing: .08em; color: var(--startup-ink); text-transform: uppercase; }
.goal-text { font-size: 18px; font-weight: 800; line-height: 1.35; margin: 4px 0 8px; }

/* ---------- Отчёт и неделя ---------- */
.moods { display: flex; gap: 8px; flex-wrap: wrap; }
.mood { min-width: 52px; min-height: 52px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); font-size: 15px; font-weight: 800; padding: 0 12px; }
.mood.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.top3 { display: flex; flex-direction: column; gap: 10px; }
.top3-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) 150px; gap: 10px; align-items: center; }
.top3-row b { font-family: var(--display); color: var(--muted); }
@media (max-width: 600px) { .top3-row { grid-template-columns: 22px minmax(0, 1fr); } .top3-row select { grid-column: 2; } }
.report-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 700px) { .report-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.report-sum div { background: var(--bg); border-radius: 16px; padding: 14px; }
.report-sum b { display: block; font-family: var(--display); font-size: 22px; font-weight: 600; }
.report-sum span { font-size: 13px; color: var(--muted); font-weight: 600; }
.week-chart { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; align-items: end; height: 200px; padding-top: 10px; }
.wbar { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.wbar-stack { width: 100%; max-width: 46px; display: flex; flex-direction: column-reverse; gap: 2px; border-radius: 10px; overflow: hidden; min-height: 4px; background: var(--line-soft); }
.wbar-stack i { display: block; width: 100%; }
.wbar-stack .c-clients { background: var(--clients); } .wbar-stack .c-startup { background: var(--startup); }
.wbar-stack .c-health { background: var(--health); } .wbar-stack .c-other { background: #9AA3B5; }
.wbar-n { font-size: 13px; font-weight: 800; }
.wbar-l { font-size: 12px; font-weight: 700; color: var(--muted); }
.wbar.today .wbar-l { color: var(--ink); }
.week-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
@media (max-width: 899px) { .week-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; } .report-sum b { font-size: 18px; } }

/* ---------- Настройки ---------- */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
@media (max-width: 1100px) { .settings-grid { grid-template-columns: 1fr; gap: 14px; } }
.sched { display: flex; flex-direction: column; gap: 10px; }
.sched-row { display: grid; grid-template-columns: 92px 92px minmax(0, 1fr) 130px auto; gap: 8px; align-items: center; padding: 10px; border-radius: 16px; background: var(--bg); }
.sched-row .input { min-height: 42px; padding: 8px 10px; font-size: 15px; }
.sched-days { grid-column: 1 / -2; display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.dayb { min-width: 38px; min-height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: 12px; font-weight: 800; color: var(--muted); }
.dayb.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.sched-row .check { min-height: 34px; font-size: 13px; margin-left: auto; }
@media (max-width: 700px) {
  .sched-row { grid-template-columns: 1fr 1fr auto; }
  .sched-row .s-title { grid-column: 1 / -1; order: -1; }
  .sched-row .s-cat { grid-column: 1 / 3; }
  .sched-days { grid-column: 1 / -1; }
}
.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; background: var(--bg); padding: 10px 12px; border-radius: 10px; overflow-wrap: anywhere; user-select: all; }
.steps-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: #3A4456; }

/* ---------- Модальное окно ---------- */
.modal { border: 0; padding: 0; border-radius: 24px; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 40px); background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px rgba(14, 23, 38, .25); }
.modal::backdrop { background: rgba(14, 23, 38, .45); }
.modal-inner { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.modal-head h2 { font-family: var(--display); font-weight: 600; font-size: 20px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 4px; }
.modal-foot .spacer { flex: 1; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 700; font-size: 14px; }
.seg button.on { border-color: transparent; color: #fff; background: var(--ink); }
.seg button.on[data-v="clients"] { background: var(--clients); }
.seg button.on[data-v="startup"] { background: var(--startup); }
.seg button.on[data-v="health"] { background: var(--health); }
@media (max-width: 600px) {
  .modal { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: 24px 24px 0 0; max-height: 92vh; }
  .modal-inner { padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); }
  .form-grid { grid-template-columns: 1fr; }
  .modal-foot .btn { flex: 1; }
}

/* ---------- Таймер ---------- */
.timer-bar {
  position: fixed; right: 24px; bottom: 24px; z-index: 40;
  background: var(--ink); color: #fff; border-radius: 20px; padding: 12px 12px 12px 20px;
  display: flex; align-items: center; gap: 14px; box-shadow: 0 20px 50px rgba(14, 23, 38, .3); max-width: calc(100vw - 32px);
}
.timer-time { font-family: var(--display); font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.timer-task { font-size: 13px; color: var(--side-text); max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timer-bar .icon-btn { color: #fff; background: var(--side-2); }
@media (max-width: 899px) { .timer-bar { left: 12px; right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); } .timer-task { max-width: none; flex: 1; } }

/* ---------- Уведомление ---------- */
.toast {
  position: fixed; left: 50%; top: 20px; transform: translate(-50%, calc(-100% - 40px)); z-index: 60;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 700; font-size: 14px;
  transition: transform .25s ease, opacity .25s; opacity: 0; pointer-events: none; max-width: calc(100vw - 32px); box-shadow: 0 10px 30px rgba(14, 23, 38, .25);
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.err { background: var(--danger); }

.loading { padding: 60px 0; text-align: center; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.input::placeholder { color: #8A93A5; }

/* ---------- Продажи ---------- */
.now.cat-sales { background: var(--sales); }
.now.cat-sales .btn-start { color: var(--sales); }
.tl-dot.c-sales { background: var(--sales); }
.bar.sales > i { background: var(--sales); }
.btn-sales { background: var(--sales); }
.btn-sales:hover { background: var(--sales-ink); color: #fff; }
.sales-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 1100px) {
  .sales-grid { grid-template-columns: 1fr; gap: 14px; }
  .sales-grid > .col { display: contents; }
  .sales-grid .o1 { order: 1; } .sales-grid .o2 { order: 2; } .sales-grid .o3 { order: 3; }
  .sales-grid .o4 { order: 4; } .sales-grid .o5 { order: 5; } .sales-grid .o6 { order: 6; }
}
.sales-big { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sales-big b { font-family: var(--display); font-size: 44px; font-weight: 600; line-height: 1.05; }
.sales-big span { font-size: 15px; font-weight: 700; color: var(--muted); }
@media (max-width: 899px) { .sales-big b { font-size: 34px; } }
.counters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.counter { background: var(--bg); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.counter-l { font-size: 13px; font-weight: 700; color: var(--muted); }
.counter b { font-family: var(--display); font-size: 24px; font-weight: 600; }
.counter .icon-btn { width: 38px; height: 38px; background: var(--surface); font-size: 18px; font-weight: 800; color: var(--ink); }
.tpls { display: flex; flex-direction: column; gap: 12px; }
.tpl { background: var(--bg); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.tpl .row { flex-wrap: wrap; }
.tpl-text { font-size: 14px; line-height: 1.5; color: #3A4456; white-space: pre-wrap; }
.funnel { display: flex; flex-direction: column; gap: 10px; }
.fun-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) 44px 44px; gap: 10px; align-items: center; font-size: 14px; }
.fun-l { font-weight: 700; }
.fun-bar { height: 12px; background: var(--line-soft); border-radius: 999px; overflow: hidden; }
.fun-bar i { display: block; height: 100%; background: var(--sales); border-radius: 999px; }
.fun-row b { text-align: right; font-variant-numeric: tabular-nums; }
.fun-p { color: var(--muted); font-weight: 700; font-size: 13px; text-align: right; }
@media (max-width: 500px) { .fun-row { grid-template-columns: 100px minmax(0, 1fr) 36px 40px; gap: 6px; font-size: 13px; } }
.tchart { position: relative; display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 4px; height: 170px; align-items: end; padding-top: 18px; }
.tchart::before { content: ''; position: absolute; left: 0; right: 0; bottom: calc(18px + var(--goal)); border-top: 2px dashed #C4B5FD; pointer-events: none; }
.tc { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.tc i { display: block; width: 100%; max-width: 26px; min-height: 3px; border-radius: 6px 6px 3px 3px; background: #C4B5FD; }
.tc i.hit { background: var(--sales); }
.tc-n { font-size: 11px; font-weight: 800; min-height: 14px; }
.tc-l { font-size: 11px; font-weight: 700; color: var(--muted); height: 14px; }
.tc.we .tc-l { color: #B5BCCB; }
.tc.today .tc-l { color: var(--ink); }

.inc-rows { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.inc-rows div { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--muted); }
.inc-rows b { color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }

.ocard { cursor: pointer; }
.pay-line { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 700; color: var(--health-ink); flex-wrap: wrap; }
.pay-box { background: var(--bg); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.pay-list { display: flex; flex-direction: column; }
.pay-row { display: flex; align-items: center; gap: 10px; font-size: 14px; border-bottom: 1px solid var(--line); min-height: 44px; }
.pay-row:last-child { border-bottom: 0; }
.pay-row b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pay-row .icon-btn { width: 36px; height: 36px; }
.pay-add { display: grid; grid-template-columns: minmax(0, 1fr) 150px minmax(0, 1.5fr) auto; gap: 8px; }
.pay-add .input { min-height: 44px; font-size: 15px; padding: 8px 10px; }
@media (max-width: 600px) { .pay-add { grid-template-columns: 1fr 1fr; } .pay-add .btn { grid-column: 1 / -1; } }

.ocard-when.late { color: var(--danger); font-weight: 800; }
.cd-live { display: inline-flex; align-self: flex-start; gap: 6px; font-size: 13px; font-weight: 800; color: var(--startup-ink); background: var(--startup-bg); padding: 4px 10px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.cd-live.late { color: #fff; background: var(--danger); }
.cd-box { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--clients-bg); color: var(--clients-dark); border-radius: 16px; padding: 12px 14px; font-weight: 600; }
.cd-box > div { display: flex; flex-direction: column; gap: 2px; }
.cd-box .hint { color: inherit; opacity: .8; }
.cd-box b { font-size: 16px; }
.cd-big { font-family: var(--display); font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cd-box.late { background: #FDECEA; color: var(--danger); }
.cd-box.wait { background: var(--bg); color: var(--muted); }

/* ---------- Документы ---------- */
.next-nums { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.next-num { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); text-align: left; }
.next-num:hover { border-color: var(--clients); }
.next-num span { font-size: 12px; font-weight: 700; color: var(--muted); }
.next-num b { font-family: var(--display); font-size: 20px; font-weight: 600; }
.doc-list { display: flex; flex-direction: column; }
.doc-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.doc-row:last-child { border-bottom: 0; }
.doc-row.off .doc-tag, .doc-row.off .doc-client, .doc-row.off .doc-sum { text-decoration: line-through; opacity: .55; }
.doc-tag { display: inline-flex; align-items: baseline; gap: 2px; font-size: 13px; font-weight: 800; padding: 6px 10px; border-radius: 10px; background: var(--clients-bg); color: var(--clients-dark); white-space: nowrap; min-width: 150px; }
.doc-tag small { font-weight: 600; opacity: .7; }
.doc-tag.t-invoice { background: var(--startup-bg); color: var(--startup-ink); }
.doc-tag.t-act { background: var(--health-bg); color: var(--health-ink); }
.doc-tag.t-sf { background: var(--sales-bg); color: var(--sales-ink); }
.doc-tag.t-kp, .doc-tag.t-addendum, .doc-tag.t-other { background: var(--other-bg); color: var(--ink); }
.doc-tag.off { text-decoration: line-through; opacity: .55; }
.doc-date { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; width: 90px; }
.doc-client { font-size: 15px; font-weight: 700; display: flex; flex-direction: column; }
.doc-client small { font-size: 12px; font-weight: 500; color: var(--muted); }
.doc-sum { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 899px) {
  .doc-row { gap: 6px 10px; }
  .doc-tag { min-width: 0; }
  .doc-client { flex-basis: 100%; order: 3; }
  .doc-sum { order: 4; }
  .doc-st { order: 5; }
  .doc-file { order: 6; margin-left: auto; }
  .doc-row .icon-btn { order: 2; margin-left: auto; }
}
.doc-badges { display: flex; gap: 4px; flex-wrap: wrap; }
.doc-badge { font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 6px; background: var(--other-bg); color: var(--ink); }
.doc-badge i { font-style: normal; color: var(--startup); margin-left: 2px; }
.doc-badge.off { text-decoration: line-through; opacity: .5; }
input[type="file"].input { padding: 10px; font-size: 14px; }

/* ---------- Архив ---------- */
.mode-tabs { display: inline-flex; gap: 4px; padding: 4px; background: #E8EBF2; border-radius: 14px; margin-bottom: 16px; }
.mode-tabs button { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px; border: 0; border-radius: 11px; background: transparent; font-weight: 700; font-size: 14px; color: var(--muted); }
.mode-tabs button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(14, 23, 38, .1); }
.ocard-arch { align-self: flex-start; min-height: 32px; padding: 0 8px; font-size: 12px; color: var(--muted); margin: -4px 0 -6px -8px; }
.ocard-arch:hover { color: var(--ink); }
.linklike { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--ink); text-align: left; cursor: pointer; }
.linklike:hover { color: var(--clients); }
.doc-sum small { display: block; font-size: 12px; font-weight: 700; }
.arch-rest { color: var(--startup-ink); }
.arch-ok { color: var(--health-ink); }

.sched-row .check.sd { margin-left: 8px; gap: 6px; }
.sched-row .check.sd .input { min-height: 34px; padding: 4px 8px; font-size: 13px; width: 140px; }
