/* ============================================================
   Ерошевич CRM — design tokens & base
   One restrained accent (refined indigo) on a neutral ground.
   Light + dark. Modern grotesque (Onest). Balanced density.
   ============================================================ */

:root {
  /* --- neutral ramp (very slightly cool) --- */
  --c-bg:        #f8f9fc;
  --c-surface:   #ffffff;
  --c-surface-2: #f3f5f9;
  --c-surface-3: #eef1f6;
  --c-line:      #e3e7ef;
  --c-line-2:    #d5dbe7;
  --c-text:      #202633;
  --c-text-2:    #5a6373;
  --c-muted:     #7a8292;
  --c-faint:     #9ca3b3;

  /* --- single accent --- */
  --c-accent:      #4169e1;
  --c-accent-hov:  #3157c8;
  --c-accent-press:#2849ad;
  --c-accent-soft: #edf2ff;
  --c-accent-line: #c7d5ff;
  --c-on-accent:   #ffffff;

  /* --- muted status colors (desaturated for a premium feel) --- */
  --c-green:   #238a63;
  --c-green-s: #e9f7ef;
  --c-amber:   #b7791f;
  --c-amber-s: #fff4dc;
  --c-red:     #c74343;
  --c-red-s:   #fdecec;
  --c-sky:     #2f7ebd;
  --c-sky-s:   #eaf5ff;

  /* --- elevation --- */
  --sh-xs: 0 1px 2px rgba(20, 24, 38, 0.05);
  --sh-sm: 0 1px 2px rgba(20, 24, 38, 0.06), 0 1px 3px rgba(20, 24, 38, 0.05);
  --sh-md: 0 4px 12px rgba(20, 24, 38, 0.07), 0 1px 3px rgba(20, 24, 38, 0.05);
  --sh-lg: 0 12px 32px rgba(20, 24, 38, 0.10), 0 4px 12px rgba(20, 24, 38, 0.06);
  --sh-xl: 0 24px 64px rgba(20, 24, 38, 0.16), 0 8px 24px rgba(20, 24, 38, 0.08);
  --ring: 0 0 0 3px rgba(65, 105, 225, 0.18);

  /* --- geometry --- */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-full: 999px;

  /* --- spacing scale (4px base) --- */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 20px; --s-6: 24px; --s-7: 32px; --s-8: 40px;
  --s-9: 48px; --s-10: 64px;

  /* --- layout --- */
  --sidebar-w: 252px;
  --sidebar-w-collapsed: 72px;
  --topbar-h: 64px;

  --font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  color-scheme: light;
}

[data-theme='dark'] {
  --c-bg:        #151821;
  --c-surface:   #1c202b;
  --c-surface-2: #242936;
  --c-surface-3: #2c3240;
  --c-line:      #343b4a;
  --c-line-2:    #434b5c;
  --c-text:      #f2f4f8;
  --c-text-2:    #c9cfda;
  --c-muted:     #9ba3b3;
  --c-faint:     #737c8f;

  --c-accent:      #7d9cff;
  --c-accent-hov:  #91adff;
  --c-accent-press:#a7bdff;
  --c-accent-soft: #29375c;
  --c-accent-line: #40548a;
  --c-on-accent:   #101522;

  --c-green:   #69c191;
  --c-green-s: #1e3a2d;
  --c-amber:   #d6a550;
  --c-amber-s: #3a2f1e;
  --c-red:     #e07a75;
  --c-red-s:   #3d2425;
  --c-sky:     #74b3e6;
  --c-sky-s:   #1f3449;

  --sh-xs: 0 1px 2px rgba(0, 0, 0, 0.30);
  --sh-sm: 0 1px 2px rgba(0, 0, 0, 0.34), 0 1px 3px rgba(0, 0, 0, 0.30);
  --sh-md: 0 4px 12px rgba(0, 0, 0, 0.40), 0 1px 3px rgba(0, 0, 0, 0.30);
  --sh-lg: 0 12px 32px rgba(0, 0, 0, 0.48), 0 4px 12px rgba(0, 0, 0, 0.34);
  --sh-xl: 0 24px 64px rgba(0, 0, 0, 0.56), 0 8px 24px rgba(0, 0, 0, 0.40);
  --ring: 0 0 0 3px rgba(125, 156, 255, 0.26);

  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'cv01', 'cv02', 'ss01';
  letter-spacing: 0;
  transition: background 0.3s ease, color 0.3s ease;
}

#root { height: 100%; }

button, input, select, textarea { font: inherit; color: inherit; margin: 0; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: 0; line-height: 1.12; }
p { margin: 0; }

::selection { background: rgba(65, 105, 225, 0.22); }

/* tabular numbers utility */
.tnum { font-feature-settings: 'tnum'; font-variant-numeric: tabular-nums; }

/* scrollbar */
* { scrollbar-width: thin; scrollbar-color: var(--c-line-2) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb {
  background: var(--c-line-2);
  border: 3px solid transparent;
  background-clip: padding-box;
  border-radius: 999px;
}
*::-webkit-scrollbar-thumb:hover { background: var(--c-muted); background-clip: padding-box; }

/* focus */
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-sm); }

/* shared motion */
@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: scale(0.97) translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes scrim-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-right { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }

/* ============================================================
   UI primitives — buttons, badges, fields, avatars, chips, tabs
   ============================================================ */

/* ---------- Buttons ---------- */
.btn {
  --bg: var(--c-surface);
  --fg: var(--c-text);
  --bd: var(--c-line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 14px;
  border: 1px solid var(--bd);
  border-radius: var(--r-sm);
  background: var(--bg); color: var(--fg);
  font-size: 13.5px; font-weight: 600; letter-spacing: 0;
  white-space: nowrap; user-select: none;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .08s ease;
}
.btn:hover { background: var(--c-surface-2); }
.btn:active { transform: translateY(0.5px); }
.btn svg { width: 17px; height: 17px; flex: 0 0 auto; }

.btn.primary { --bg: var(--c-accent); --fg: var(--c-on-accent); --bd: transparent; box-shadow: var(--sh-xs); }
.btn.primary:hover { background: var(--c-accent-hov); }
.btn.primary:active { background: var(--c-accent-press); }

.btn.ghost { --bd: transparent; --bg: transparent; }
.btn.ghost:hover { background: var(--c-surface-2); }

.btn.soft { --bg: var(--c-accent-soft); --fg: var(--c-accent); --bd: transparent; }
.btn.soft:hover { background: #e5ecff; background: color-mix(in oklch, var(--c-accent-soft) 80%, var(--c-accent) 10%); }

.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: var(--r-xs); }
.btn.sm svg { width: 15px; height: 15px; }
.btn.lg { height: 44px; padding: 0 18px; font-size: 14.5px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; pointer-events: none; }

/* icon button */
.iconbtn {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; flex: 0 0 auto;
  border: 1px solid transparent; border-radius: var(--r-sm);
  color: var(--c-text-2); background: transparent;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.iconbtn:hover { background: var(--c-surface-2); color: var(--c-text); }
.iconbtn svg { width: 18px; height: 18px; }
.iconbtn.sm { width: 30px; height: 30px; }
.iconbtn.sm svg { width: 16px; height: 16px; }
.iconbtn.bordered { border-color: var(--c-line-2); background: var(--c-surface); }

/* split button */
.splitbtn { display: inline-flex; }
.splitbtn > .btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.splitbtn > .btn:last-child { border-top-left-radius: 0; border-bottom-left-radius: 0; padding: 0 8px;
  border-left: 1px solid rgba(255,255,255,0.28); border-left: 1px solid color-mix(in oklch, var(--c-on-accent) 28%, transparent); }

/* ---------- Badges / status ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 23px; padding: 0 9px;
  border-radius: var(--r-full);
  font-size: 12px; font-weight: 600; letter-spacing: 0; white-space: nowrap;
  background: var(--c-surface-3); color: var(--c-text-2);
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.green { background: var(--c-green-s); color: var(--c-green); }
.badge.amber { background: var(--c-amber-s); color: var(--c-amber); }
.badge.red   { background: var(--c-red-s);   color: var(--c-red); }
.badge.sky   { background: var(--c-sky-s);   color: var(--c-sky); }
.badge.accent{ background: var(--c-accent-soft); color: var(--c-accent); }
.badge.plain { background: var(--c-surface-3); color: var(--c-muted); }
.badge.outline { background: transparent; border: 1px solid var(--c-line-2); color: var(--c-text-2); }

/* count pill (nav) */
.pill {
  min-width: 20px; height: 20px; padding: 0 6px;
  display: inline-grid; place-items: center;
  border-radius: var(--r-full);
  font-size: 11.5px; font-weight: 700;
  background: var(--c-surface-3); color: var(--c-muted);
}
.pill.accent { background: var(--c-accent-soft); color: var(--c-accent); }

/* ---------- Avatars ---------- */
.avatar {
  --sz: 34px;
  width: var(--sz); height: var(--sz); flex: 0 0 auto;
  display: inline-grid; place-items: center; overflow: hidden;
  border-radius: 50%;
  font-size: calc(var(--sz) * 0.38); font-weight: 700; line-height: 1;
  color: #fff; background: var(--av, var(--c-accent));
  letter-spacing: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.xs { --sz: 22px; } .avatar.sm { --sz: 28px; }
.avatar.lg { --sz: 44px; } .avatar.xl { --sz: 60px; }
.avatar.ring { box-shadow: 0 0 0 2px var(--c-surface), 0 0 0 3px var(--c-line-2); }

/* logo-ish company glyph */
.glyph {
  --sz: 36px;
  width: var(--sz); height: var(--sz); flex: 0 0 auto;
  display: inline-grid; place-items: center; overflow: hidden;
  border-radius: var(--r-sm);
  font-size: calc(var(--sz) * 0.36); font-weight: 700;
  color: var(--c-text); background: var(--c-surface-3);
  border: 1px solid var(--c-line);
}
.glyph[style*="--cc"] {
  background: var(--c-surface-3);
  background: color-mix(in oklch, var(--cc) 16%, var(--c-surface));
  border-color: var(--c-line);
  border-color: color-mix(in oklch, var(--cc) 32%, transparent);
}
.glyph img { width: 100%; height: 100%; object-fit: cover; }
.glyph.lg { --sz: 52px; border-radius: var(--r-md); }

.avatar-stack { display: inline-flex; align-items: center; }
.avatar-stack > * { margin-left: -8px; box-shadow: 0 0 0 2px var(--c-surface); border-radius: 50%; }
.avatar-stack > *:first-child { margin-left: 0; }

/* ---------- Fields ---------- */
.field { display: grid; gap: 6px; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--c-text-2); }
.input, .select, .textarea {
  width: 100%; height: 40px;
  padding: 0 12px;
  border: 1px solid var(--c-line-2); border-radius: var(--r-sm);
  background: var(--c-surface); color: var(--c-text);
  font-size: 14px; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.textarea { height: auto; min-height: 92px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--c-faint); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--c-accent); box-shadow: var(--ring);
}
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23889' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 34px;
}
.field .hint { font-size: 12px; color: var(--c-muted); }

/* search box */
.search {
  position: relative; display: flex; align-items: center;
}
.search svg { position: absolute; left: 12px; width: 17px; height: 17px; color: var(--c-faint); pointer-events: none; }
.search input {
  width: 100%; height: 40px; padding: 0 12px 0 38px;
  border: 1px solid var(--c-line-2); border-radius: var(--r-sm);
  background: var(--c-surface-2); color: var(--c-text); font-size: 14px; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.search input::placeholder { color: var(--c-faint); }
.search input:focus { border-color: var(--c-accent); background: var(--c-surface); box-shadow: var(--ring); }
.search .kbd { position: absolute; right: 10px; }

.kbd {
  display: inline-flex; align-items: center; gap: 2px;
  height: 21px; padding: 0 6px;
  border: 1px solid var(--c-line-2); border-radius: var(--r-xs);
  background: var(--c-surface); color: var(--c-muted);
  font-size: 11.5px; font-weight: 600;
}

/* toggle switch */
.switch { position: relative; width: 38px; height: 22px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.switch .track {
  position: absolute; inset: 0; border-radius: 999px;
  background: var(--c-line-2); transition: background .18s ease;
}
.switch .track::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: var(--sh-sm); transition: transform .18s ease;
}
.switch input:checked + .track { background: var(--c-accent); }
.switch input:checked + .track::after { transform: translateX(16px); }

/* segmented control */
.segmented {
  display: inline-flex; gap: 2px; padding: 3px;
  background: var(--c-surface-2); border: 1px solid var(--c-line);
  border-radius: var(--r-sm);
}
.segmented button {
  height: 30px; padding: 0 12px; border-radius: 6px;
  font-size: 13px; font-weight: 600; color: var(--c-text-2);
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.segmented button.active { background: var(--c-surface); color: var(--c-text); box-shadow: var(--sh-xs); }
[data-theme='dark'] .segmented button.active { background: var(--c-surface-3); }
.segmented button:hover:not(.active) { color: var(--c-text); }
.segmented button .pill { margin-left: 6px; }

/* tabs (underline) */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--c-line); }
.tabs button {
  position: relative; height: 42px; padding: 0 14px;
  font-size: 13.5px; font-weight: 600; color: var(--c-muted);
  transition: color .15s ease;
}
.tabs button:hover { color: var(--c-text); }
.tabs button.active { color: var(--c-text); }
.tabs button.active::after {
  content: ''; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px;
  background: var(--c-accent); border-radius: 2px;
}
.tabs button .pill { margin-left: 7px; }

/* chip / filter */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  border: 1px solid var(--c-line-2); border-radius: var(--r-full);
  font-size: 13px; font-weight: 600; color: var(--c-text-2);
  background: var(--c-surface); transition: all .15s ease;
  white-space: nowrap; flex-shrink: 0;   /* «На паузе» больше не ломается на две строки */
}
.chip:hover { background: var(--c-surface-2); color: var(--c-text); }
.chip.active { background: var(--c-accent-soft); border-color: var(--c-accent-line); color: var(--c-accent); }

/* card */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xs);
}

/* divider */
.hr { height: 1px; background: var(--c-line); border: 0; margin: 0; }
.vr { width: 1px; align-self: stretch; background: var(--c-line); }

/* tiny meta label */
.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--c-faint); }

/* progress */
.progress { height: 6px; border-radius: 999px; background: var(--c-surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 999px; background: var(--c-accent); }

/* tooltip-ish meta row */
.meta { display: inline-flex; align-items: center; gap: 6px; color: var(--c-muted); font-size: 13px; }
.meta svg { width: 15px; height: 15px; }

/* ---------- Task form controls ---------- */
.form-section { display: grid; gap: 14px; }
.section-label { display: flex; align-items: center; gap: 8px; }
.section-label .eyebrow { margin: 0; }
.section-label .ln { flex: 1; height: 1px; background: var(--c-line); }

/* priority picker */
.prio-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.prio-opt {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 10px;
  border: 1px solid var(--c-line-2); border-radius: var(--r-sm);
  background: var(--c-surface); color: var(--c-text-2);
  font-size: 13px; font-weight: 600; transition: all .14s ease;
}
.prio-opt:hover { background: var(--c-surface-2); }
.prio-opt .pdot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.prio-opt.active { color: var(--c-text); }

/* schedule card (inset, light) */
.sched {
  display: grid; gap: 14px;
  padding: 16px; border: 1px solid var(--c-line); border-radius: var(--r-lg);
  background: var(--c-surface-2);
}
.sched-head { display: flex; align-items: flex-start; gap: 12px; }
.sched-head .si { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--c-accent-soft); color: var(--c-accent); }
.sched-head .si svg { width: 18px; height: 18px; }
.sched-head .st { font-size: 14px; font-weight: 700; }
.sched-head .ss { margin-top: 2px; font-size: 12.5px; color: var(--c-muted); line-height: 1.4; }

/* date / time native inputs */
.input[type='date'], .input[type='time'] { padding-right: 10px; }
.input[type='date']::-webkit-calendar-picker-indicator,
.input[type='time']::-webkit-calendar-picker-indicator { opacity: .5; cursor: pointer; }
[data-theme='dark'] .input[type='date']::-webkit-calendar-picker-indicator,
[data-theme='dark'] .input[type='time']::-webkit-calendar-picker-indicator { filter: invert(1); opacity: .6; }

/* repeat chips */
.repeat-chips { display: flex; flex-wrap: wrap; gap: 7px; }

/* reveal */
.reveal { display: grid; gap: 14px; animation: reveal-in .2s ease; }
@keyframes reveal-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* interval */
.interval { display: flex; align-items: center; gap: 10px; }
.interval .intv-label { font-size: 13.5px; color: var(--c-text-2); font-weight: 500; }
.interval .intv-num { width: 74px; text-align: center; }
.interval .intv-unit { font-size: 13.5px; color: var(--c-muted); }

/* weekday toggles */
.weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.wd {
  height: 40px; border: 1px solid var(--c-line-2); border-radius: var(--r-sm);
  background: var(--c-surface); color: var(--c-text-2);
  font-size: 13px; font-weight: 600; transition: all .14s ease;
}
.wd:hover { background: var(--c-surface-3); color: var(--c-text); }
.wd.active { background: var(--c-accent); border-color: transparent; color: var(--c-on-accent); }

/* repeat backlog note */
.repeat-note { display: flex; align-items: flex-start; gap: 9px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--c-accent-soft); color: var(--c-accent); font-size: 12.5px; line-height: 1.45; }
.repeat-note svg { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 1px; }

/* client picker tile (read-only header inside form) */
.client-tile { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border: 1px solid var(--c-line); border-radius: var(--r-md); background: var(--c-surface-2); }
.client-tile .lmain { min-width: 0; }
.client-tile .lmain strong { display: block; font-size: 13.5px; font-weight: 600; }
.client-tile .lmain span { display: block; font-size: 12px; color: var(--c-muted); }

/* empty state */
.empty { display: grid; place-items: center; gap: 10px; padding: 48px 24px; text-align: center; color: var(--c-muted); }
.empty .ico { width: 46px; height: 46px; display: grid; place-items: center; border-radius: var(--r-md); background: var(--c-surface-2); color: var(--c-faint); }
.empty .ico svg { width: 22px; height: 22px; }

/* ---------- Отчёты по рекламе ---------- */
.ar-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.ar-card { text-align: left; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: 16px 18px; display: grid; gap: 9px; transition: border-color .12s ease, box-shadow .12s ease; }
.ar-card:hover { border-color: var(--c-accent); box-shadow: var(--sh-sm); }
.ar-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ar-card-date { font-size: 12px; color: var(--c-muted); }
.ar-card-title { font-size: 15.5px; font-weight: 700; }
.ar-card-stats { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12.5px; color: var(--c-text-2); }
.ar-card-foot { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--c-muted); padding-top: 4px; border-top: 1px solid var(--c-line); }

.ar-editor { display: flex; flex-direction: column; gap: 16px; }
.ar-meta { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: 18px; display: grid; gap: 14px; }
.ar-meta-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 12px; }
.ar-split { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; align-items: start; }
.ar-pane { display: grid; gap: 12px; min-width: 0; }
.ar-proj { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: 14px 16px; display: grid; gap: 12px; }
.ar-proj-head { display: flex; align-items: center; gap: 10px; }
.ar-proj-name { font-weight: 700; }
.ar-nobudget { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--c-muted); white-space: nowrap; }
.ar-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.ar-calc { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--c-muted); border-top: 1px solid var(--c-line); padding-top: 10px; }
.ar-add { justify-self: start; }
.ar-preview { position: sticky; top: 12px; }
.ar-prev-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 600; color: var(--c-text-2); padding: 10px 14px; background: var(--c-surface-2); border: 1px solid var(--c-line); border-bottom: 0; border-radius: var(--r-lg) var(--r-lg) 0 0; }
.ar-prev-text { margin: 0; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 0 0 var(--r-lg) var(--r-lg); padding: 16px 18px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; max-height: 70vh; overflow-y: auto; color: var(--c-text); }
.ar-foot { display: flex; align-items: center; gap: 10px; padding-top: 4px; }
@media (max-width: 1100px) {
  .ar-split { grid-template-columns: 1fr; }
  .ar-preview { position: static; }
  .ar-meta-row { grid-template-columns: 1fr; }
}

/* разбивка по кампаниям в подробном отчёте */
.ar-camps { border-top: 1px solid var(--c-line); padding-top: 12px; display: grid; gap: 10px; }
.ar-camps-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--c-text-2); text-transform: uppercase; letter-spacing: .03em; }
.ar-camp { background: var(--c-surface-2); border: 1px solid var(--c-line); border-radius: var(--r-md); padding: 11px 13px; display: grid; gap: 9px; }
.ar-camp-head { display: flex; align-items: center; gap: 8px; }
.ar-camp-grid { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 9px; align-items: end; }
.ar-camp-cpl { font-size: 12.5px; color: var(--c-muted); white-space: nowrap; padding-bottom: 9px; }
@media (max-width: 900px) { .ar-camp-grid { grid-template-columns: repeat(2, 1fr); } }
.ar-direct-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ar-direct-err { font-size: 12px; color: var(--c-red); }
.ar-direct-note { font-size: 12px; color: var(--c-amber, #b26a00); line-height: 1.35; }
.ar-addbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ar-addbar .select { max-width: 320px; }
.ar-seo-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; padding-top: 12px; border-top: 1px solid var(--c-line); font-size: 13px; color: var(--c-text-2); }

/* Баннер: изменения не ушли на сервер (сервер был занят) */
.save-error-bar {
  position: fixed; left: 50%; transform: translateX(-50%); top: 12px; z-index: 900;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  max-width: min(720px, calc(100vw - 24px));
  padding: 10px 14px; border-radius: 12px;
  background: var(--c-red-s, #fdecec); color: var(--c-red, #c0392b);
  border: 1px solid var(--c-red, #c0392b); box-shadow: 0 8px 24px rgba(0,0,0,.14);
  font-size: 13px; line-height: 1.35;
}

/* Публикация страницы отчёта для клиента */
.ar-share { margin-top: 14px; padding: 14px 16px; border: 1px solid var(--c-line); border-radius: 12px; background: var(--c-surface-2); }
.ar-share-head { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.ar-share-note { color: var(--c-muted); font-size: 12.5px; line-height: 1.45; margin: 8px 0 10px; }
.ar-share-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ar-share-row .input { flex: 1; min-width: 220px; font-size: 13px; }
.ar-share-row a.btn { text-decoration: none; }

/* Экран восстановления данных: сессия жива, база не догрузилась */
.db-recover { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--c-bg); }
.db-recover section { width: min(480px, 100%); background: var(--c-surface); border: 1px solid var(--c-line);
  border-radius: 18px; padding: 26px; text-align: center; box-shadow: 0 18px 50px rgba(25,35,60,.08); }
.db-recover h1 { margin: 0 0 8px; font-size: 22px; }
.db-recover p { margin: 0 0 18px; color: var(--c-muted); font-size: 14.5px; line-height: 1.5; }
.db-recover .btn { margin: 0 4px; }

/* Сборка месячного отчёта ИИ: редактируемые блоки */
.ar-compose { margin-top: 14px; padding: 14px 16px; border: 1px solid var(--c-line); border-radius: 12px; }
.ar-compose .ar-proj { margin-top: 12px; }
.ar-compose .ar-add { margin-top: 10px; }

/* Выбор целей Метрики и галочки в карточке клиента */
.check-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check-inline input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--c-accent, #4169e1); cursor: pointer; }
.goal-picker { display: flex; flex-direction: column; gap: 8px; }
.goal-note { margin: 0; color: var(--c-muted); font-size: 12.5px; line-height: 1.4; }
.goal-note.err { color: var(--c-red); }
.goal-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 14px;
  max-height: 260px; overflow-y: auto; padding: 10px; border: 1px solid var(--c-line); border-radius: 10px; }
.goal-list .check-inline { font-size: 13px; }
.goal-id { color: var(--c-muted); font-size: 11px; margin-left: auto; }

/* Выбор проектов для недельного отчёта */
.ar-picker { margin: 12px 0; padding: 14px 16px; border: 1px solid var(--c-line); border-radius: 12px; background: var(--c-surface-2); }
.ar-picker-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  font-weight: 600; font-size: 14px; margin-bottom: 12px; }
.ar-picker-actions { display: flex; gap: 7px; }
.ar-picker-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 16px; margin-bottom: 10px; }

/* Раздел SEO-инструментов: сервис открывается внутри CRM */

/* Примечания клиента: правка и удаление */
.note { position: relative; }
.note-head { display: flex; align-items: center; gap: 8px; }
.note-head time { margin-right: auto; }
.note-edited { font-size: 11.5px; color: var(--c-muted); font-style: italic; }
.note-acts { display: flex; gap: 2px; opacity: 0; transition: opacity .15s ease; }
.note:hover .note-acts, .note:focus-within .note-acts { opacity: 1; }
.note-edit { margin-top: 8px; }
.note-edit .textarea { width: 100%; }
.note-edit-acts { display: flex; gap: 8px; margin-top: 8px; }
.note-confirm { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 10px; padding: 10px 12px; border-radius: 10px;
  background: var(--c-red-s); color: var(--c-red); font-size: 13px; }
.note-confirm span { flex: 1; }
@media (max-width: 720px) { .note-acts { opacity: 1; } }

/* SEO-инструменты: плитки, формы и результаты */
/* SEO-инструменты */
.seo-group { margin-bottom: 22px; }
.seo-h3 { font-size: 15px; margin: 6px 0 10px; color: var(--c-text); }
.seo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.seo-card { display: flex; align-items: flex-start; gap: 12px; padding: 16px; background: var(--c-surface);
  border: 1px solid var(--c-line); border-radius: 14px; cursor: pointer; transition: border-color .15s, transform .15s; }
.seo-card:hover { border-color: var(--c-accent-line); transform: translateY(-1px); }
.seo-card-icon { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  background: var(--c-accent-soft); color: var(--c-accent); }
.seo-card.level-blocked .seo-card-icon { background: var(--c-red-s); color: var(--c-red); }
.seo-card.level-partial .seo-card-icon { background: var(--c-amber-s); color: var(--c-amber); }
.seo-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.seo-card-body strong { font-size: 14.5px; }
.seo-card-body span { font-size: 12.5px; color: var(--c-muted); line-height: 1.35; }
.seo-card-warn { font-size: 11.5px; font-style: normal; color: var(--c-red); margin-top: 2px; }
.seo-card.level-partial .seo-card-warn { color: var(--c-amber); }
.seo-tool .card, .seo-report .card, .seo-chain > .card { margin-bottom: 14px; }
.seo-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.seo-section-head h3 { margin: 0; font-size: 15px; }
.seo-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 12px; }
.seo-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.seo-err { color: var(--c-red); font-size: 13px; margin: 10px 0; }
.seo-muted { color: var(--c-muted); }
.seo-small { font-size: 12px; }
.seo-link { font-size: 13px; color: var(--c-accent); display: inline-block; margin-top: 8px; }
.seo-note { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: 11px; font-size: 13px;
  line-height: 1.45; margin: 10px 0; border: 1px solid var(--c-line); }
.seo-note.info { background: var(--c-sky-s); }
.seo-note.warn { background: var(--c-amber-s); }
.seo-note > svg { flex: 0 0 auto; margin-top: 2px; }
.seo-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 6px 0; }
.seo-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.seo-table th { text-align: left; color: var(--c-muted); font-size: 12px; font-weight: 600; padding: 7px 8px;
  border-bottom: 1px solid var(--c-line); white-space: nowrap; }
.seo-table td { padding: 7px 8px; border-bottom: 1px solid var(--c-line); vertical-align: top; }
.seo-table tr:last-child td { border-bottom: none; }
.seo-table .r { text-align: right; white-space: nowrap; }
.seo-table a { color: var(--c-accent); word-break: break-all; }
.pos-top3 { color: var(--c-green); } .pos-top10 { color: var(--c-accent); }
.pos-up { color: var(--c-green); } .pos-down { color: var(--c-red); }
.rank-gold td:nth-child(4) b { color: #c99400; } .rank-purple td:nth-child(4) b { color: #8a4fd8; }
.rank-lost td:nth-child(4) b { color: var(--c-muted); }
/* выполнение задач */
.seo-runner { border-left: 3px solid var(--c-accent); }
.seo-runner.state-done { border-left-color: var(--c-green); }
.seo-runner.state-waiting { border-left-color: var(--c-amber); }
.seo-runner.state-error { border-left-color: var(--c-red); }
.seo-runner-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.seo-runner-title { margin-left: auto; color: var(--c-muted); font-size: 12.5px; }
.seo-state-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c-accent); flex: 0 0 auto; }
.state-running .seo-state-dot, .seo-state-dot.state-running { animation: seoPulse 1.2s ease-in-out infinite; }
.state-done .seo-state-dot, .seo-state-dot.state-done { background: var(--c-green); }
.state-waiting .seo-state-dot, .seo-state-dot.state-waiting { background: var(--c-amber); }
.state-error .seo-state-dot, .seo-state-dot.state-error { background: var(--c-red); }
@keyframes seoPulse { 50% { opacity: .35; } }
.seo-progress { height: 6px; border-radius: 3px; background: var(--c-line); overflow: hidden; margin: 10px 0 6px; }
.seo-progress-bar { height: 100%; background: var(--c-accent); transition: width .4s; }
.seo-runner-result { margin-top: 10px; }
.seo-log-wrap { margin-top: 10px; }
.seo-log { max-height: 260px; overflow: auto; background: var(--c-bg); border: 1px solid var(--c-line); border-radius: 9px;
  padding: 10px; font-size: 11.5px; line-height: 1.45; white-space: pre-wrap; margin: 6px 0 0; }
.seo-step { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--c-line); }
.seo-step h4 { margin: 0 0 8px; font-size: 14px; }
/* проекты позиций */
.seo-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.seo-proj-card { display: flex; flex-direction: column; gap: 4px; padding: 13px; border: 1px solid var(--c-line); border-radius: 12px;
  cursor: pointer; font-size: 13px; }
.seo-proj-card:hover { border-color: var(--c-accent-line); }
.seo-proj-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; font-size: 12.5px; }
.seo-proj-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.seo-proj-title { flex: 1; min-width: 180px; display: flex; flex-direction: column; font-size: 13px; }
.seo-proj-title strong { font-size: 16px; }
.seo-inline-form { padding: 12px; border: 1px dashed var(--c-line); border-radius: 12px; margin: 8px 0 12px; }
.seo-tops { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 14px; }
.seo-top-tile { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; background: var(--c-surface);
  border: 1px solid var(--c-line); border-radius: 11px; font-size: 12px; }
.seo-top-tile b { font-size: 18px; }
.seo-rank-layout { display: grid; grid-template-columns: 230px 1fr; gap: 14px; align-items: start; }
.seo-rank-side { padding: 8px !important; }
.seo-side-item { display: flex; align-items: center; gap: 6px; padding: 7px 9px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.seo-side-item > span:last-child, .seo-side-item > .iconbtn { margin-left: auto; }
.seo-side-item.group { padding-left: 26px; }
.seo-side-item:hover { background: var(--c-bg); }
.seo-side-item.active { background: var(--c-accent-soft); color: var(--c-accent); }
.seo-rank-main { min-width: 0; }
.select.sm { height: 30px; font-size: 12.5px; padding: 0 8px; width: auto; }
/* отчёты */
.seo-report { display: flex; flex-direction: column; gap: 0; }
.seo-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.seo-kv > div { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.seo-kv > div > span:first-child { color: var(--c-muted); font-size: 12px; }
.seo-badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11.5px; font-weight: 600;
  background: var(--c-bg); color: var(--c-muted); white-space: nowrap; }
.seo-badge.ok { background: var(--c-green-s); color: var(--c-green); }
.seo-badge.warn { background: var(--c-amber-s); color: var(--c-amber); }
.seo-badge.err { background: var(--c-red-s); color: var(--c-red); }
.seo-badge.info { background: var(--c-sky-s); color: var(--c-sky); }
.seo-coll { padding: 0 !important; }
.seo-coll-head { display: flex; align-items: center; gap: 9px; width: 100%; padding: 14px 16px; background: none; border: 0;
  cursor: pointer; font: inherit; color: inherit; text-align: left; }
.seo-coll-head strong { flex: 1; font-size: 14px; }
.seo-coll-body { padding: 0 16px 16px; }
.seo-coll-body h4 { margin: 14px 0 6px; font-size: 13.5px; }
.seo-diag-row { display: flex; align-items: center; gap: 9px; padding: 6px 0; font-size: 13.5px; border-bottom: 1px solid var(--c-line); }
.seo-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 6px 0 12px; }
.seo-stat { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; background: var(--c-bg); border-radius: 10px; font-size: 12px; color: var(--c-muted); }
.seo-stat b { font-size: 18px; color: var(--c-text); }
.seo-dup { padding: 8px 0; border-bottom: 1px solid var(--c-line); font-size: 13px; }
.seo-dup a { color: var(--c-accent); }
.seo-prose { font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; margin: 8px 0; }
.seo-findings h4 { margin: 12px 0 4px; font-size: 13.5px; }
.seo-find { font-size: 13px; padding: 2px 0; } .seo-find.ok { color: var(--c-green); } .seo-find.miss { color: var(--c-muted); }
.seo-radio, .seo-check { display: flex; align-items: center; gap: 7px; font-size: 13.5px; margin: 6px 12px 6px 0; cursor: pointer; }
.seo-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.seo-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 20px; border: 1px solid var(--c-line);
  font-size: 12.5px; cursor: pointer; background: var(--c-surface); }
.seo-chip input { display: none; }
.seo-chip.on { background: var(--c-accent-soft); border-color: var(--c-accent-line); color: var(--c-accent); }
.seo-chip-block { margin: 12px 0; }
.seo-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; margin-bottom: 14px; }
.seo-mode { display: flex; flex-direction: column; gap: 3px; padding: 11px 12px; border: 1px solid var(--c-line); border-radius: 11px;
  background: var(--c-surface); text-align: left; cursor: pointer; font: inherit; color: inherit; }
.seo-mode span { font-size: 12px; color: var(--c-muted); line-height: 1.35; }
.seo-mode.on { border-color: var(--c-accent); background: var(--c-accent-soft); }
.seo-tabs-mini { display: flex; gap: 4px; margin-bottom: 8px; }
.seo-tabs-mini button { padding: 5px 12px; border-radius: 8px; border: 1px solid var(--c-line); background: var(--c-surface); cursor: pointer; font: inherit; font-size: 13px; color: inherit; }
.seo-tabs-mini button.on { background: var(--c-accent); color: var(--c-on-accent); border-color: var(--c-accent); }
.seo-md-box { max-height: 520px; overflow: auto; border: 1px solid var(--c-line); border-radius: 10px; padding: 4px 16px; background: var(--c-surface); }
.seo-md { font-size: 13.5px; line-height: 1.55; }
.seo-md h3, .seo-md h4, .seo-md h5 { margin: 16px 0 6px; }
.seo-md ul, .seo-md ol { padding-left: 20px; margin: 6px 0; }
.seo-md code { background: var(--c-bg); padding: 1px 4px; border-radius: 4px; font-size: 12px; }
.seo-text-frame { width: 100%; height: 520px; border: 1px solid var(--c-line); border-radius: 10px; background: #fff; }
.seo-details summary { cursor: pointer; font-size: 13.5px; margin: 10px 0; color: var(--c-accent); }
.seo-rec { padding: 10px 0; border-bottom: 1px solid var(--c-line); font-size: 13.5px; }
.seo-rec h4 { margin: 0 0 4px; font-size: 14px; }
.seo-rec p { margin: 4px 0; line-height: 1.5; }
.seo-steps-list { margin: 0 0 10px; padding-left: 20px; font-size: 13.5px; line-height: 1.6; }
/* ссылки и кнопки */
.lc-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.lc-item { padding: 10px 12px; border: 1px solid var(--c-line); border-left: 3px solid var(--c-line); border-radius: 10px; font-size: 13.5px; }
.lc-item.sev-error { border-left-color: var(--c-red); }
.lc-item.sev-warn { border-left-color: var(--c-amber); }
.lc-item.sev-info { border-left-color: var(--c-sky); }
.lc-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; line-height: 1.45; }
.lc-href, .lc-pages { margin-top: 4px; word-break: break-all; }
.lc-href a, .lc-pages a { color: var(--c-accent); }
.lc-href code { background: var(--c-bg); padding: 1px 5px; border-radius: 4px; }
/* история */
.seo-hist { padding: 4px !important; }
.seo-hist-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px; cursor: pointer; font-size: 13.5px; }
.seo-hist-row:hover { background: var(--c-bg); }
.seo-hist-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.seo-hist-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* ключи */
.seo-service.miss { border-left: 3px solid var(--c-red); }
.seo-service.part { border-left: 3px solid var(--c-amber); }
.seo-service.ok { border-left: 3px solid var(--c-green); }
.seo-service-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.seo-service-title { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 2px; }
.seo-service > .seo-small { margin: 4px 0; }
.seo-keys { margin-top: 8px; }
.seo-key { display: flex; align-items: center; gap: 14px; padding: 9px 0; border-top: 1px solid var(--c-line); flex-wrap: wrap; }
.seo-key-info { flex: 1 1 240px; display: flex; flex-direction: column; gap: 1px; font-size: 13.5px; }
.seo-key .input { flex: 1 1 300px; font-size: 13px; }
.seo-key-state { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--c-red); }
.seo-key-state.ok { color: var(--c-green); }
.seo-sticky-save { position: sticky; bottom: 12px; display: none; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px;
  background: var(--c-surface); border: 1px solid var(--c-accent-line); border-radius: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.12); }
.seo-sticky-save.show { display: flex; }
@media (max-width: 760px) {
  .seo-rank-layout { grid-template-columns: 1fr; }
  .seo-tops { grid-template-columns: repeat(3, 1fr); }
  .seo-runner-title { margin-left: 0; width: 100%; }
}

/* Мини-приложение в Telegram: своя шапка у клиента, поэтому убираем верхний отступ
   и оставляем место под системную панель снизу */
.in-telegram body { padding-top: 0; }
.in-telegram .shell { min-height: 100vh; }
.in-telegram .topbar { padding-top: 6px; }
.in-telegram .view-pad { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }

/* Доступы клиента */
.cred-hint { color: var(--c-muted); font-size: 12.5px; margin: 0 0 12px; line-height: 1.45; }
.cred-error { color: var(--c-red); font-size: 13px; margin-bottom: 10px; }
.cred-search { margin-bottom: 12px; }
.cred-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.cred-card { border: 1px solid var(--c-line); border-radius: 12px; padding: 14px; background: var(--c-card); display: flex; flex-direction: column; gap: 8px; }
.cred-head { display: flex; align-items: center; gap: 10px; }
.cred-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--c-accent-soft); color: var(--c-accent); flex: 0 0 auto; }
.cred-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cred-title strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cred-title span { font-size: 12px; color: var(--c-muted); }
.cred-acts { display: flex; gap: 2px; }
.cred-row { display: flex; align-items: center; gap: 6px; font-size: 13px; min-width: 0; }
.cred-label { width: 58px; flex: 0 0 auto; color: var(--c-muted); font-size: 12px; }
.cred-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cred-value.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.cred-value.link { color: var(--c-accent); text-decoration: none; }
.cred-note { margin: 2px 0 0; font-size: 12.5px; color: var(--c-text-2); white-space: pre-wrap; }
.cred-foot { font-size: 11.5px; color: var(--c-muted); margin-top: 2px; }
.cred-state { color: var(--c-green); }
.cred-form { border: 1px solid var(--c-accent-line); border-radius: 12px; padding: 14px; margin-bottom: 14px; background: var(--c-surface); }
.cred-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.cred-pass-input { display: flex; gap: 6px; align-items: center; }
.cred-pass-input .input { flex: 1; }
.cred-form-acts { display: flex; gap: 8px; margin-top: 12px; }

/* ============================================================
   Layout — shell, sidebar, topbar, screens, kanban, modal, login
   ============================================================ */

/* ---------- App shell ---------- */
.shell {
  height: 100%;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  background: var(--c-bg);
  transition: grid-template-columns .22s ease;
}
.shell.collapsed { grid-template-columns: var(--sidebar-w-collapsed) minmax(0, 1fr); }

/* ---------- Sidebar ---------- */
.sidebar {
  display: flex; flex-direction: column;
  border-right: 1px solid var(--c-line);
  background: var(--c-surface);
  min-height: 0;
}
.sidebar-top {
  display: flex; align-items: center; gap: 10px;
  height: var(--topbar-h); padding: 0 14px;
  border-bottom: 1px solid var(--c-line);
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark {
  width: 34px; height: 34px; flex: 0 0 auto;
  display: grid; place-items: center; border-radius: 9px;
  background: var(--c-accent); color: var(--c-on-accent);
  box-shadow: var(--sh-sm);
}
.brand-mark svg { width: 19px; height: 19px; }
.brand-copy { min-width: 0; line-height: 1.15; }
.brand-copy strong { display: block; font-size: 14.5px; font-weight: 700; letter-spacing: 0; white-space: nowrap; }
.brand-copy span { display: block; font-size: 11.5px; color: var(--c-muted); white-space: nowrap; }

.sidebar-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 12px 4px; }
.nav-group + .nav-group { margin-top: 18px; }
.nav-group-label { padding: 0 10px 8px; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--c-faint); }

.nav-item {
  position: relative;
  display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 11px;
  width: 100%; height: 40px; padding: 0 11px; margin-bottom: 2px;
  border-radius: var(--r-sm);
  color: var(--c-text-2); font-size: 13.5px; font-weight: 600; text-align: left;
  transition: background .14s ease, color .14s ease;
}
.nav-item svg { width: 19px; height: 19px; }
.nav-item:hover { background: var(--c-surface-2); color: var(--c-text); }
.nav-item.active { background: var(--c-accent-soft); color: var(--c-accent); }
.nav-item.active::before {
  content: ''; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px;
  background: var(--c-accent); border-radius: 0 3px 3px 0;
}
.nav-item .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sidebar-foot { padding: 10px 12px; border-top: 1px solid var(--c-line); }
.user-card {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  width: 100%; padding: 7px 8px; border-radius: var(--r-sm);
  transition: background .14s ease;
}
.user-card:hover { background: var(--c-surface-2); }
.user-card .who { min-width: 0; text-align: left; line-height: 1.2; }
.user-card .who strong { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card .who span { display: block; font-size: 11.5px; color: var(--c-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card .chev { color: var(--c-faint); }

/* collapsed sidebar */
.shell.collapsed .brand-copy,
.shell.collapsed .nav-item .label,
.shell.collapsed .nav-item .pill,
.shell.collapsed .nav-group-label,
.shell.collapsed .user-card .who,
.shell.collapsed .user-card .chev { display: none; }
.shell.collapsed .nav-item { grid-template-columns: 1fr; justify-items: center; padding: 0; }
.shell.collapsed .user-card { grid-template-columns: 1fr; justify-items: center; }
.shell.collapsed .sidebar-top { justify-content: center; padding: 0; }
.shell.collapsed .brand { justify-content: center; }

/* ---------- Workspace ---------- */
.workspace { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.topbar {
  display: flex; align-items: center; gap: 12px;
  height: var(--topbar-h); flex: 0 0 auto;
  padding: 0 18px;
  border-bottom: 1px solid var(--c-line);
  background: rgba(255,255,255,0.8);
  background: color-mix(in oklch, var(--c-surface) 80%, transparent);
  backdrop-filter: blur(10px);
}
.topbar .search { width: min(420px, 38vw); }
.topbar-spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.topbar .vr { height: 26px; margin: 0 4px; }
.mobile-only { display: none; }

.view { flex: 1; min-height: 0; overflow-y: auto; }
.view-pad { padding: var(--s-6); }
.view-pad.wide { padding: var(--s-6) var(--s-7); }

/* page head */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: var(--s-5); flex-wrap: wrap; }
.page-head .titles h1 { font-size: 24px; }
.page-head .titles p { margin-top: 5px; color: var(--c-muted); font-size: 14px; }
.page-head .acts { display: flex; align-items: center; gap: 8px; }

/* ---------- Stat cards ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.stat {
  padding: 16px 18px; border-radius: var(--r-lg);
  border: 1px solid var(--c-line); background: var(--c-surface);
}
.stat .top { display: flex; align-items: center; justify-content: space-between; }
.stat .lbl { font-size: 12.5px; color: var(--c-muted); font-weight: 600; }
.stat .ic { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: var(--c-surface-2); color: var(--c-text-2); }
.stat .ic svg { width: 16px; height: 16px; }
.stat .val { margin-top: 12px; font-size: 28px; font-weight: 700; letter-spacing: 0; line-height: 1; }
.stat .delta { margin-top: 9px; font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.stat .delta.up { color: var(--c-green); }
.stat .delta.down { color: var(--c-red); }
.stat .delta svg { width: 14px; height: 14px; }

/* ---------- Clients master/detail ---------- */
.clients-split {
  display: grid; grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
  height: 100%; min-height: 0;
}
.master {
  display: flex; flex-direction: column; min-height: 0;
  border-right: 1px solid var(--c-line); background: var(--c-surface);
}
.master-head { padding: 16px 16px 12px; border-bottom: 1px solid var(--c-line); display: grid; gap: 12px; }
.master-head .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.master-head h2 { font-size: 17px; }
.master-filters { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.master-filters::-webkit-scrollbar { display: none; }
.master-list { flex: 1; min-height: 0; overflow-y: auto; padding: 8px; }

.client-row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px;
  width: 100%; padding: 10px 11px; border-radius: var(--r-md); text-align: left;
  transition: background .12s ease;
}
.client-row:hover { background: var(--c-surface-2); }
.client-row.active { background: var(--c-accent-soft); }
.client-row.active .c-name { color: var(--c-accent); }
.client-row .c-main { min-width: 0; }
.client-row .c-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-row .c-sub { font-size: 12px; color: var(--c-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.client-row .c-side { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }

.master-foot { padding: 10px 14px; border-top: 1px solid var(--c-line); display: flex; align-items: center; justify-content: space-between; color: var(--c-muted); font-size: 12.5px; }
.pager { display: flex; align-items: center; gap: 2px; }
.pager button { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--c-text-2); }
.pager button:hover { background: var(--c-surface-2); }
.pager button.active { background: var(--c-accent); color: var(--c-on-accent); }

/* detail */
.detail { min-width: 0; min-height: 0; overflow-y: auto; }
.detail-hero { padding: 22px 26px 0; }
.detail-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.detail-id { display: flex; align-items: center; gap: 14px; min-width: 0; }
.detail-id .who h1 { font-size: 23px; display: flex; align-items: center; gap: 12px; }
.detail-id .who .sub { margin-top: 4px; color: var(--c-muted); font-size: 13.5px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-acts { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

.detail-meta { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 0; margin-top: 22px; border: 1px solid var(--c-line); border-radius: var(--r-lg); background: var(--c-surface); overflow: hidden; }
.detail-meta .cell { padding: 14px 18px; border-right: 1px solid var(--c-line); }
.detail-meta .cell:last-child { border-right: 0; }
.detail-meta .cell .k { font-size: 11.5px; color: var(--c-faint); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.detail-meta .cell .v { margin-top: 7px; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 9px; }
.detail-meta .cell .v a { color: var(--c-accent); }

.detail-tabs { position: sticky; top: 0; z-index: 5; padding: 18px 26px 0; background: var(--c-bg); }
.detail-body { padding: 20px 26px 32px; }

/* two-column inside overview */
.ov-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(300px, 340px); gap: 18px; align-items: start; }

/* panels */
.panel { border: 1px solid var(--c-line); border-radius: var(--r-lg); background: var(--c-surface); overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--c-line); }
.panel-head h3 { font-size: 14.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.panel-head .n { color: var(--c-faint); font-weight: 600; }
.panel-body { padding: 6px; }
.panel-body.pad { padding: 16px; }

/* link rows */
.link-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; padding: 10px 11px; border-radius: var(--r-md); transition: background .12s ease; }
.link-row:hover { background: var(--c-surface-2); }
.link-row .lico { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; background: var(--c-surface-2); color: var(--c-text-2); }
.link-row .lico svg { width: 17px; height: 17px; }
.link-row .lmain { min-width: 0; }
.link-row .lmain strong { display: block; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-row .lmain span { display: block; font-size: 12px; color: var(--c-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* notes */
.note { padding: 13px 14px; border-radius: var(--r-md); background: var(--c-surface-2); border: 1px solid var(--c-line); }
.note + .note { margin-top: 10px; }
.note p { font-size: 13.5px; line-height: 1.55; color: var(--c-text); }
.note .note-head { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.note .note-head strong { font-size: 13px; font-weight: 600; }
.note .note-head time { font-size: 12px; color: var(--c-faint); margin-left: auto; }

/* timeline */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ''; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 1.5px; background: var(--c-line); }
.tl-item { position: relative; padding: 0 0 18px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item .tl-dot { position: absolute; left: -22px; top: 3px; width: 11px; height: 11px; border-radius: 50%; background: var(--c-surface); border: 2px solid var(--c-line-2); }
.tl-item.accent .tl-dot { border-color: var(--c-accent); background: var(--c-accent); }
.tl-item .tl-txt { font-size: 13.5px; }
.tl-item .tl-txt b { font-weight: 600; }
.tl-item time { display: block; margin-top: 3px; font-size: 12px; color: var(--c-faint); }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(264px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.kcol { background: var(--c-surface-2); border: 1px solid var(--c-line); border-radius: var(--r-lg); display: flex; flex-direction: column; max-height: 100%; }
.kcol-head { display: flex; align-items: center; gap: 8px; padding: 13px 14px 11px; }
.kcol-head .kdot { width: 8px; height: 8px; border-radius: 50%; }
.kcol-head h4 { font-size: 13px; font-weight: 700; }
.kcol-head .pill { margin-left: 2px; }
.kcol-head .add { margin-left: auto; color: var(--c-faint); }
.kcol-body { display: flex; flex-direction: column; gap: 9px; padding: 0 10px 12px; overflow-y: auto; }

.tcard {
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-md);
  padding: 12px 13px; cursor: pointer; box-shadow: var(--sh-xs);
  transition: border-color .14s ease, box-shadow .14s ease, transform .08s ease;
}
.tcard:hover { border-color: var(--c-line-2); box-shadow: var(--sh-sm); }
.tcard:active { transform: scale(0.99); }
.tcard .tt { font-size: 13.5px; font-weight: 600; line-height: 1.4; }
.tcard .tmeta { display: flex; align-items: center; gap: 8px; margin-top: 11px; }
.tcard .tmeta .when { font-size: 12px; color: var(--c-muted); display: inline-flex; align-items: center; gap: 5px; margin-right: auto; }
.tcard .tmeta .when svg { width: 13px; height: 13px; }
.tcard .tmeta .when.over { color: var(--c-red); }
.tcard .tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 9px; }
/* иерархия: проект — главный акцент, метки — вторичные (приглушённые) */
.tcard .tags-project { margin-top: 10px; }
.tcard .tags-project .client-tag { font-weight: 700; }
.tcard .tags-labels { margin-top: 6px; }
.tcard .tags-labels .label-chip { background: var(--c-surface-2); border-color: var(--c-line); color: var(--c-muted); font-weight: 500; }
.tcard .tags-labels .label-chip .ldot { opacity: .55; width: 5px; height: 5px; }
.tcard .tags-labels .label-chip .lt { color: var(--c-muted); }
.tcard .ttag { font-size: 11px; font-weight: 600; color: var(--c-muted); background: var(--c-surface-2); border: 1px solid var(--c-line); border-radius: 5px; padding: 1px 6px; }
.kadd { display: flex; align-items: center; gap: 7px; padding: 9px 11px; border-radius: var(--r-md); border: 1px dashed var(--c-line-2); color: var(--c-muted); font-size: 13px; font-weight: 600; }
.kadd:hover { background: var(--c-surface); color: var(--c-text); }
.kadd svg { width: 15px; height: 15px; }
.prio-bar { width: 3px; align-self: stretch; border-radius: 3px; }

/* ---------- Data table (tasks list / team) ---------- */
.dtable-wrap { border: 1px solid var(--c-line); border-radius: var(--r-lg); overflow: hidden; background: var(--c-surface); }
.dtable { width: 100%; border-collapse: collapse; }
.dtable th { padding: 11px 16px; text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--c-muted); background: var(--c-surface-2); border-bottom: 1px solid var(--c-line); white-space: nowrap; }
.dtable td { padding: 13px 16px; border-bottom: 1px solid var(--c-line); font-size: 13.5px; vertical-align: middle; }
.dtable tbody tr:last-child td { border-bottom: 0; }
.dtable tbody tr { transition: background .12s ease; }
.dtable tbody tr:hover { background: var(--c-surface-2); }
.dtable .t-title { font-weight: 600; }
.cellflex { display: flex; align-items: center; gap: 10px; min-width: 0; }

/* ---------- Reports ---------- */
.report-grid { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(0,1fr); gap: 16px; align-items: start; }
.chart-card { padding: 18px 20px; }
.bars { display: flex; align-items: flex-end; gap: 12px; height: 200px; padding-top: 10px; }
.bars .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.bars .bar-col .stack { flex: 1; width: 100%; max-width: 38px; display: flex; flex-direction: column; justify-content: flex-end; gap: 3px; }
.bars .bar { width: 100%; border-radius: 5px 5px 3px 3px; background: var(--c-accent); transition: height .4s cubic-bezier(.2,.7,.3,1); }
.bars .bar.alt { background: var(--c-accent-soft); }
.bars .bar-col .x { font-size: 11.5px; color: var(--c-muted); }

.legend { display: flex; gap: 16px; flex-wrap: wrap; }
.legend .li { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--c-text-2); }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; }

.ring-row { display: flex; align-items: center; gap: 18px; }
.donut { --p: 70; --col: var(--c-accent); width: 120px; height: 120px; border-radius: 50%; flex: 0 0 auto;
  background: conic-gradient(var(--col) calc(var(--p) * 1%), var(--c-surface-3) 0);
  display: grid; place-items: center; }
.donut::after { content: ''; width: 80px; height: 80px; border-radius: 50%; background: var(--c-surface); }
.donut .lab { position: absolute; text-align: center; }

.workload-row { display: grid; grid-template-columns: 150px 1fr auto; align-items: center; gap: 14px; padding: 11px 0; }
.workload-row + .workload-row { border-top: 1px solid var(--c-line); }
.workload-row .nm { display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 600; }

/* ---------- Modal / drawer ---------- */
.scrim { position: fixed; inset: 0; z-index: 80; background: rgba(32,38,51,0.36); background: color-mix(in oklch, var(--c-text) 36%, transparent); backdrop-filter: blur(3px); animation: scrim-in .18s ease; display: grid; }
.modal { place-self: center; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 64px); overflow: hidden; display: flex; flex-direction: column;
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-xl); box-shadow: var(--sh-xl); animation: pop-in .22s cubic-bezier(.2,.7,.3,1); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 22px 24px 0; }
.modal-head h2 { font-size: 19px; }
.modal-head p { margin-top: 5px; color: var(--c-muted); font-size: 13.5px; }
.modal-body { padding: 20px 24px; overflow-y: auto; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--c-line); background: var(--c-surface-2); }

.drawer-scrim { position: fixed; inset: 0; z-index: 80; background: rgba(32,38,51,0.3); background: color-mix(in oklch, var(--c-text) 30%, transparent); backdrop-filter: blur(2px); animation: scrim-in .18s ease; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 81; width: min(460px, 100vw); display: flex; flex-direction: column;
  background: var(--c-surface); border-left: 1px solid var(--c-line); box-shadow: var(--sh-xl); animation: slide-right .24s cubic-bezier(.2,.7,.3,1); }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 20px 22px; border-bottom: 1px solid var(--c-line); }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 22px; }
.drawer-foot { display: flex; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--c-line); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-stack { display: grid; gap: 16px; }

/* popover */
.popover { position: absolute; z-index: 60; min-width: 280px; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg); box-shadow: var(--sh-lg); animation: pop-in .16s ease; overflow: hidden; }
.popover-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 15px; border-bottom: 1px solid var(--c-line); }
.popover-head strong { font-size: 13.5px; }
.popover-body { max-height: 360px; overflow-y: auto; }
.menu { padding: 6px; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px; border-radius: 7px; font-size: 13.5px; font-weight: 500; color: var(--c-text); text-align: left; }
.menu button:hover { background: var(--c-surface-2); }
.menu button svg { width: 16px; height: 16px; color: var(--c-text-2); }
.menu button.danger { color: var(--c-red); }
.menu button.danger svg { color: var(--c-red); }
.menu .sep { height: 1px; background: var(--c-line); margin: 6px 0; }

.notif { display: grid; grid-template-columns: auto 1fr; gap: 11px; padding: 12px 15px; border-bottom: 1px solid var(--c-line); }
.notif:last-child { border-bottom: 0; }
.notif.unread { background: var(--c-accent-soft); }
.notif .nico { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; background: var(--c-surface-2); color: var(--c-text-2); }
.notif .nico svg { width: 16px; height: 16px; }
.notif p { font-size: 13px; line-height: 1.45; }
.notif p b { font-weight: 600; }
.notif time { font-size: 11.5px; color: var(--c-faint); }

/* ---------- Login ---------- */
.login { height: 100%; display: grid; grid-template-columns: 1.05fr 0.95fr; background: var(--c-bg); }
.login-aside { position: relative; overflow: hidden; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; color: var(--c-on-accent);
  background: linear-gradient(155deg, var(--c-accent-press), var(--c-accent));
  background:
    radial-gradient(120% 100% at 0% 0%, color-mix(in oklch, var(--c-accent) 86%, white 14%), transparent 60%),
    linear-gradient(155deg, var(--c-accent-press), var(--c-accent)); }
.login-aside .grain { position: absolute; inset: 0; opacity: 0.5;
  background-image: radial-gradient(rgba(255,255,255,0.14) 1px, transparent 1.4px);
  background-image: radial-gradient(color-mix(in oklch, white 14%, transparent) 1px, transparent 1.4px);
  background-size: 22px 22px; mask-image: radial-gradient(120% 120% at 30% 10%, black, transparent 75%); }
.login-aside .lb-top, .login-aside .lb-mid, .login-aside .lb-bot { position: relative; z-index: 1; }
.login-aside .brand-mark { background: rgba(255,255,255,0.16); box-shadow: none; backdrop-filter: blur(4px); }
.login-aside h1 { margin: 0; font-size: 40px; letter-spacing: 0; max-width: 16ch; }
.login-aside .lead { margin-top: 16px; font-size: 16px; line-height: 1.55; max-width: 40ch; opacity: 0.85; }
.login-aside .lb-bot { display: grid; gap: 12px; }
.login-feat { display: flex; align-items: center; gap: 11px; font-size: 14px; opacity: 0.92; }
.login-feat .fi { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: rgba(255,255,255,0.14); }
.login-feat .fi svg { width: 16px; height: 16px; }

.login-main { display: grid; place-items: center; padding: 32px; }
.login-card { width: min(400px, 100%); }
.login-card .lc-head { margin-bottom: 24px; }
.login-card h2 { font-size: 25px; }
.login-card .lc-head p { margin-top: 7px; color: var(--c-muted); font-size: 14.5px; }
.login-err { display: flex; align-items: center; gap: 9px; padding: 11px 13px; border-radius: var(--r-sm); background: var(--c-red-s); color: var(--c-red); font-size: 13px; font-weight: 500; }
.login-err svg { width: 17px; height: 17px; flex: 0 0 auto; }
.input-wrap { position: relative; }
.input-wrap .pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .ov-grid { grid-template-columns: 1fr; }
  .report-grid { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-meta { grid-template-columns: 1fr; }
  .detail-meta .cell { border-right: 0; border-bottom: 1px solid var(--c-line); }
  .detail-meta .cell:last-child { border-bottom: 0; }
}

/* mobile */
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 90; top: 0; bottom: 0; left: 0; width: 276px; transform: translateX(-100%); transition: transform .24s ease; box-shadow: var(--sh-xl); }
  .shell.nav-open .sidebar { transform: none; }
  .mobile-scrim { position: fixed; inset: 0; z-index: 89; background: rgba(10,12,20,.42); animation: scrim-in .2s ease; }
  .mobile-only { display: inline-grid; }
  .clients-split { grid-template-columns: 1fr; }
  .clients-split .detail { display: none; }
  .clients-split.show-detail .master { display: none; }
  .clients-split.show-detail .detail { display: block; }
  .login { grid-template-columns: 1fr; }
  .login-aside { display: none; }
  /* верхняя панель на телефоне: меню, поиск, «+», уведомления */
  .desktop-only { display: none !important; }
  .topbar { gap: 6px; padding-left: 10px; padding-right: 10px; }
  .topbar .search { display: flex; width: auto; flex: 1 1 auto; min-width: 0; }
  .topbar-spacer { display: none; }
  .topbar .profile-button, .topbar .theme-toggle { display: none; }
  .topbar .btn.primary { padding-left: 10px; padding-right: 10px; }
  .view-pad, .view-pad.wide { padding: var(--s-4); }
  .detail-hero { padding: 16px 16px 0; }
  .detail-tabs { padding: 14px 16px 0; }
  .detail-body { padding: 16px; }
  .page-head .titles h1 { font-size: 21px; }

  /* задачи: канбан колонками во весь экран со снэпом */
  .kanban { grid-auto-columns: min(86vw, 320px); scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
  .kanban .kcol { scroll-snap-align: start; }
  .kcol-body { max-height: calc(100dvh - 320px); }
  .page-head { flex-wrap: wrap; gap: 10px; }
  .page-head .acts { width: 100%; display: flex; gap: 8px; }
  .page-head .acts .segmented { flex: 1; display: flex; }
  .page-head .acts .segmented button { flex: 1; }
  .page-head .acts .btn.primary { flex: 1; justify-content: center; }
  .dtable-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .dtable { min-width: 640px; }
  .tcard .tt { font-size: 14px; }
  .kadd, .kcol-head .add, .tcard, .chip { touch-action: manipulation; }
  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { white-space: nowrap; }
  .modal { width: min(96vw, 600px) !important; max-height: 92dvh; }
  .drawer { width: min(100vw, 480px); }
}

/* ============================================================
   Плотность интерфейса (data-density on <html>)
   ============================================================ */
/* Просторно */
html[data-density="spacious"] {
  --s-3: 14px; --s-4: 20px; --s-5: 26px; --s-6: 32px; --s-7: 44px;
}
html[data-density="spacious"] .panel-head { padding: 18px 20px; }
html[data-density="spacious"] .panel-body.pad { padding: 22px; }
html[data-density="spacious"] .stat { padding: 22px 22px; }
html[data-density="spacious"] .stat-grid { gap: 18px; }
html[data-density="spacious"] .ov-grid { gap: 24px; }
html[data-density="spacious"] .dtable th { padding: 14px 18px; }
html[data-density="spacious"] .dtable td { padding: 17px 18px; }
html[data-density="spacious"] .link-row { padding: 13px 13px; }
html[data-density="spacious"] .kb-item { padding: 14px 13px; }

/* Компактно */
html[data-density="compact"] {
  --s-3: 8px; --s-4: 11px; --s-5: 14px; --s-6: 16px; --s-7: 22px;
}
html[data-density="compact"] .panel-head { padding: 9px 13px; }
html[data-density="compact"] .panel-body.pad { padding: 11px; }
html[data-density="compact"] .stat { padding: 11px 13px; }
html[data-density="compact"] .stat-grid { gap: 10px; }
html[data-density="compact"] .ov-grid { gap: 12px; }
html[data-density="compact"] .dtable th { padding: 8px 14px; }
html[data-density="compact"] .dtable td { padding: 8px 14px; }
html[data-density="compact"] .link-row { padding: 7px 10px; }
html[data-density="compact"] .stat .val { font-size: 26px; }
html[data-density="compact"] .kb-item { padding: 8px 10px; }
html[data-density="compact"] .kb-article { padding: 18px 22px 28px; }

/* кнопка быстрого завершения на карточке задачи */
.tcard-snooze { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 7px; border-radius: 6px; font-size: 11.5px;
  color: var(--c-amber); border: 1px solid var(--c-line); background: var(--c-surface); transition: all .12s ease; white-space: nowrap; }
.tcard-snooze:hover { color: #fff; background: var(--c-amber); border-color: var(--c-amber); }
.tcard-snooze svg { width: 12px; height: 12px; }
.tcard-done { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; color: var(--c-faint); border: 1px solid var(--c-line); background: var(--c-surface); transition: all .12s ease; }
.tcard-done:hover { color: #fff; background: var(--c-green); border-color: var(--c-green); }
.btn.done-btn { color: var(--c-green); border-color: color-mix(in oklch, var(--c-green) 40%, var(--c-line)); }
.btn.done-btn:hover { background: var(--c-green); color: #fff; border-color: var(--c-green); }

/* ============================================================
   Calendar — month grid, week view, mobile agenda
   Built on the shared tokens (theme.css). One accent, status tones.
   ============================================================ */

/* ---------- shell ---------- */
.cal { display: flex; flex-direction: column; }

/* navigation strip under the page head */
.cal-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.cal-monthnav { display: flex; align-items: center; gap: 4px; }
.cal-monthnav .arr {
  width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto;
  border: 1px solid var(--c-line-2); border-radius: var(--r-sm); background: var(--c-surface); color: var(--c-text-2);
  transition: background .14s ease, color .14s ease, border-color .14s ease;
}
.cal-monthnav .arr:hover { background: var(--c-surface-2); color: var(--c-text); }
.cal-monthnav .arr svg { width: 18px; height: 18px; }
.cal-title { font-size: 17px; font-weight: 700; letter-spacing: 0; min-width: 168px; text-align: center; }
.cal-title .yr { color: var(--c-muted); font-weight: 600; }

.cal-filters { display: flex; gap: 7px; flex-wrap: wrap; margin-left: 2px; }
.cal-bar .spacer { flex: 1; }

/* legend */
.cal-legend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cal-legend .li { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--c-text-2); font-weight: 500; }
.cal-legend .sw { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }

/* ---------- Month grid ---------- */
.cal-card {
  border: 1px solid var(--c-line); border-radius: var(--r-lg); background: var(--c-surface);
  overflow: hidden; box-shadow: var(--sh-xs);
  display: flex; flex-direction: column;
}
.cal-dow {
  display: grid; grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--c-line); background: var(--c-surface-2);
}
.cal-dow .d {
  padding: 10px 12px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--c-muted); text-align: left;
}
.cal-dow .d.we { color: var(--c-faint); }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: minmax(118px, auto); }
.cal-cell {
  position: relative; border-right: 1px solid var(--c-line); border-bottom: 1px solid var(--c-line);
  padding: 7px 8px 8px; display: flex; flex-direction: column; gap: 4px; min-width: 0;
  background: var(--c-surface); transition: background .12s ease; text-align: left;
}
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-grid > .cal-cell:nth-last-child(-n+7) { border-bottom: 0; }
.cal-cell:hover { background: var(--c-surface-2); }
.cal-cell.out { background: var(--c-bg); }
.cal-cell.out .daynum { color: var(--c-faint); }
.cal-cell.we:not(.out) { background: #f9fafc; background: color-mix(in oklch, var(--c-surface-2) 50%, var(--c-surface)); }

.cal-cell .cell-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.cal-cell .daynum {
  font-size: 13px; font-weight: 600; color: var(--c-text-2); line-height: 1;
  width: 24px; height: 24px; display: grid; place-items: center; border-radius: var(--r-full);
}
.cal-cell.today .daynum { background: var(--c-accent); color: var(--c-on-accent); font-weight: 700; }
.cal-cell .addday {
  width: 20px; height: 20px; display: grid; place-items: center; border-radius: var(--r-xs);
  color: var(--c-faint); opacity: 0; transition: opacity .12s ease, background .12s ease, color .12s ease;
}
.cal-cell:hover .addday { opacity: 1; }
.cal-cell .addday:hover { background: var(--c-accent-soft); color: var(--c-accent); }
.cal-cell .addday svg { width: 14px; height: 14px; }

.cal-chips { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-chip {
  display: flex; align-items: center; gap: 6px; min-width: 0; text-align: left;
  height: 22px; padding: 0 7px; border-radius: var(--r-xs);
  font-size: 12px; font-weight: 600; line-height: 1; color: var(--cf, var(--c-text-2));
  background: var(--cbg, var(--c-surface-3));
  transition: filter .12s ease, transform .06s ease;
}
.cal-chip:hover { filter: brightness(0.97); }
[data-theme='dark'] .cal-chip:hover { filter: brightness(1.12); }
.cal-chip:active { transform: scale(0.985); }
.cal-chip .cdot { width: 6px; height: 6px; border-radius: 50%; flex: 0 0 auto; background: var(--cd, var(--c-faint)); }
.cal-chip .ctitle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cal-chip.is-done .ctitle { text-decoration: line-through; opacity: .7; }
.cal-more {
  align-self: flex-start; padding: 1px 5px; border-radius: var(--r-xs);
  font-size: 11.5px; font-weight: 600; color: var(--c-muted);
}
.cal-more:hover { background: var(--c-surface-3); color: var(--c-text); }

/* ---------- Week view ---------- */
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-wcol { border-right: 1px solid var(--c-line); display: flex; flex-direction: column; min-width: 0; }
.cal-wcol:last-child { border-right: 0; }
.cal-whead {
  display: flex; align-items: baseline; gap: 8px; padding: 11px 12px;
  border-bottom: 1px solid var(--c-line); background: var(--c-surface-2);
}
.cal-whead .wd { font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--c-muted); }
.cal-whead .dn { font-size: 16px; font-weight: 700; letter-spacing: 0; }
.cal-whead.today .dn { color: var(--c-accent); }
.cal-whead .n { margin-left: auto; }
.cal-wbody { flex: 1; padding: 8px; display: flex; flex-direction: column; gap: 7px; min-height: 120px; }
.cal-wcol.is-we .cal-wbody { background: rgba(243,245,249,0.45); background: color-mix(in oklch, var(--c-surface-2) 45%, transparent); }
.cal-wadd {
  margin-top: auto; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px; border-radius: var(--r-sm); border: 1px dashed var(--c-line-2);
  color: var(--c-faint); font-size: 12px; font-weight: 600; opacity: 0; transition: opacity .12s ease;
}
.cal-wcol:hover .cal-wadd { opacity: 1; }
.cal-wadd:hover { background: var(--c-surface); color: var(--c-text); }
.cal-wadd svg { width: 14px; height: 14px; }

/* event card (week + agenda) */
.cal-event {
  position: relative; display: flex; gap: 9px; align-items: flex-start;
  padding: 9px 10px 9px 11px; border-radius: var(--r-md);
  border: 1px solid var(--c-line); background: var(--c-surface); box-shadow: var(--sh-xs);
  text-align: left; transition: border-color .14s ease, box-shadow .14s ease, transform .06s ease;
}
.cal-event::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--cd, var(--c-faint)); }
.cal-event:hover { border-color: var(--c-line-2); box-shadow: var(--sh-sm); }
.cal-event:active { transform: scale(0.995); }
.cal-event .ev-main { flex: 1; min-width: 0; }
.cal-event .ev-title { font-size: 13px; font-weight: 600; line-height: 1.35; }
.cal-event.is-done .ev-title { text-decoration: line-through; color: var(--c-muted); }
.cal-event .ev-meta { display: flex; align-items: center; gap: 8px; margin-top: 7px; flex-wrap: wrap; }
.cal-event .ev-cli { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--c-muted); font-weight: 500; min-width: 0; }
.cal-event .ev-cli .glyph { --sz: 18px; border-radius: 5px; font-size: 10px; }
.cal-event .ev-time { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--c-text-2); }
.cal-event .ev-time svg { width: 12px; height: 12px; }
.cal-event .ev-time.over { color: var(--c-red); }
.cal-event .ev-right { display: flex; align-items: center; gap: 7px; flex: 0 0 auto; }

/* ---------- Unscheduled strip ---------- */
.cal-unsched { margin-top: 14px; }
.cal-unsched .panel-head .add { color: var(--c-faint); }
.cal-unsched-body { display: flex; gap: 8px; padding: 12px; overflow-x: auto; }
.cal-unsched-body .cal-event { min-width: 240px; flex: 0 0 auto; }
.cal-unsched-empty { padding: 14px 16px; color: var(--c-muted); font-size: 13px; }

/* ---------- Mobile agenda ---------- */
.cal-mobile { display: none; }

@media (max-width: 760px) {
  /* hide desktop calendar, show mobile agenda */
  .cal-desktop { display: none; }
  .cal-mobile { display: flex; flex-direction: column; }

  .cal-m-head {
    display: flex; align-items: center; gap: 10px; padding: 4px 0 12px;
  }
  .cal-m-head .cal-title { min-width: 0; flex: 1; text-align: left; font-size: 19px; }
  .cal-m-head .today-btn { flex: 0 0 auto; }

  /* week strip */
  .cal-strip {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
    padding: 8px; border: 1px solid var(--c-line); border-radius: var(--r-lg);
    background: var(--c-surface); box-shadow: var(--sh-xs);
  }
  .cal-sday {
    display: flex; flex-direction: column; align-items: center; gap: 5px;
    padding: 7px 0 8px; border-radius: var(--r-md); min-width: 0;
    transition: background .14s ease;
  }
  .cal-sday:hover { background: var(--c-surface-2); }
  .cal-sday .sd-wd { font-size: 10.5px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; color: var(--c-faint); }
  .cal-sday .sd-num {
    width: 30px; height: 30px; display: grid; place-items: center; border-radius: var(--r-full);
    font-size: 14px; font-weight: 700; color: var(--c-text);
  }
  .cal-sday.today .sd-num { box-shadow: inset 0 0 0 1.5px var(--c-accent); color: var(--c-accent); }
  .cal-sday.sel .sd-num { background: var(--c-accent); color: var(--c-on-accent); }
  .cal-sday.sel.today .sd-num { box-shadow: none; }
  .cal-sday .sd-dots { display: flex; gap: 3px; height: 5px; align-items: center; }
  .cal-sday .sd-dots i { width: 5px; height: 5px; border-radius: 50%; }
  .cal-sday.sel .sd-wd { color: var(--c-accent); }

  /* selected-day header */
  .cal-m-dayhead { display: flex; align-items: baseline; gap: 9px; padding: 18px 2px 12px; }
  .cal-m-dayhead h3 { font-size: 16px; font-weight: 700; letter-spacing: 0; }
  .cal-m-dayhead h3 .dow { color: var(--c-muted); font-weight: 600; text-transform: capitalize; }
  .cal-m-dayhead .n { margin-left: auto; }

  /* agenda list */
  .cal-agenda { display: flex; flex-direction: column; gap: 9px; padding-bottom: 24px; }
  .cal-agenda .cal-event { padding: 12px 13px; }
  .cal-agenda .cal-event .ev-title { font-size: 14px; }

  .cal-m-empty {
    display: grid; place-items: center; gap: 10px; padding: 40px 20px; text-align: center;
    color: var(--c-muted); border: 1px dashed var(--c-line-2); border-radius: var(--r-lg); margin-top: 4px;
  }
  .cal-m-empty .ico { width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--r-md); background: var(--c-surface-2); color: var(--c-faint); }
  .cal-m-empty .ico svg { width: 22px; height: 22px; }
  .cal-m-empty .t { font-weight: 600; color: var(--c-text); font-size: 13.5px; }
}

/* tablet: smaller month cells */
@media (max-width: 1100px) and (min-width: 761px) {
  .cal-grid { grid-auto-rows: minmax(104px, auto); }
}

/* ============================================================
   Метки (labels) — chips, picker, palette
   ============================================================ */
:root {
  --lab-indigo: var(--c-accent);
  --lab-green:  var(--c-green);
  --lab-amber:  var(--c-amber);
  --lab-red:    var(--c-red);
  --lab-sky:    var(--c-sky);
  --lab-purple: #8b5cf6;
  --lab-teal:   #0f9b8e;
  --lab-pink:   #db4d7a;
  --lab-slate:  #687386;
}
[data-theme='dark'] {
  --lab-purple: #b394ff;
  --lab-teal:   #74d3c7;
  --lab-pink:   #f097b3;
  --lab-slate:  #aab3c2;
}

/* chip */
.label-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  height: 25px; padding: 0 9px; border-radius: var(--r-full);
  font-size: 12px; font-weight: 600; line-height: 1; white-space: nowrap;
  color: var(--lc, var(--c-text-2));
  background: color-mix(in oklch, var(--lc, var(--c-faint)) 11%, var(--c-surface));
  border: 1px solid color-mix(in oklch, var(--lc, var(--c-line-2)) 26%, transparent);
}
.label-chip .ldot { width: 7px; height: 7px; border-radius: 50%; background: var(--lc, var(--c-faint)); flex: 0 0 auto; }
.label-chip .lt { overflow: hidden; text-overflow: ellipsis; }
.label-chip .lx {
  display: grid; place-items: center; width: 16px; height: 16px; margin-right: -3px; border-radius: 50%;
  color: var(--lc); opacity: 0.65; transition: opacity .12s ease, background .12s ease;
}
.label-chip .lx:hover { opacity: 1; background: color-mix(in oklch, var(--lc) 18%, transparent); }

.label-chip.mini { height: 20px; padding: 0 7px; font-size: 11px; font-weight: 600; gap: 5px; }
.label-chip.mini .ldot { width: 6px; height: 6px; }

/* generic chip row */
.label-row { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }

/* picker */
.label-picker { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.lp-anchor { position: relative; display: inline-flex; }
.label-add {
  display: inline-flex; align-items: center; gap: 5px; height: 25px; padding: 0 11px 0 8px;
  border-radius: var(--r-full); border: 1px dashed var(--c-line-2); background: transparent;
  color: var(--c-muted); font-size: 12px; font-weight: 600;
  transition: border-color .14s ease, color .14s ease, background .14s ease;
}
.label-add:hover { border-color: var(--c-accent-line); color: var(--c-accent); background: var(--c-accent-soft); border-style: solid; }
.label-add svg { stroke-width: 2.2; }

/* popover */
.popover.label-pop { padding: 0; overflow: hidden; min-width: 0; }
.lp-search { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--c-line); }
.lp-search svg { color: var(--c-faint); flex: 0 0 auto; }
.lp-search input { flex: 1; border: 0; background: transparent; outline: none; font-size: 13.5px; color: var(--c-text); }
.lp-search input::placeholder { color: var(--c-faint); }
.lp-list { max-height: 240px; overflow-y: auto; padding: 6px; }
.lp-item {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 9px;
  border-radius: 7px; font-size: 13.5px; font-weight: 500; color: var(--c-text); text-align: left;
}
.lp-item:hover { background: var(--c-surface-2); }
.lp-item .ldot { width: 9px; height: 9px; border-radius: 50%; background: var(--lc, var(--c-faint)); flex: 0 0 auto; }
.lp-item .lp-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-item.create { color: var(--c-accent); font-weight: 600; }
.lp-item .lp-plus { display: grid; place-items: center; width: 9px; height: 9px; color: var(--c-accent); }
.lp-item.create svg { stroke-width: 2.4; }
.lp-empty { padding: 14px 10px; text-align: center; font-size: 12.5px; color: var(--c-faint); }

/* labelled field block (reused in modals) */
.field-labels { display: flex; flex-direction: column; gap: 9px; }

/* ---------- menu extras (status section + dots) ---------- */
.menu-label { padding: 6px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--c-faint); }
.menu .st-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; background: var(--c-faint); }
.menu .st-dot.green { background: var(--c-green); }
.menu .st-dot.amber { background: var(--c-amber); }
.menu .st-dot.sky   { background: var(--c-sky); }
.menu .st-dot.plain { background: var(--c-faint); }

/* ---------- danger button ---------- */
.btn.danger { background: var(--c-red); color: #fff; border-color: transparent; }
.btn.danger:hover { filter: brightness(0.95); background: var(--c-red); color: #fff; }
.btn.danger svg { color: #fff; }

/* ---------- client detail: метки row ---------- */
.detail-labels { display: flex; align-items: center; gap: 14px; margin-top: 16px; flex-wrap: wrap; }
.detail-labels .dl-label {
  display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto;
  font-size: 12px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; color: var(--c-faint);
}
.detail-labels .dl-label svg { color: var(--c-faint); }

/* ---------- confirm modal body ---------- */
.confirm-body { display: flex; gap: 14px; align-items: flex-start; }
.confirm-body .confirm-ico {
  flex: 0 0 auto; width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--r-md);
  background: var(--c-red-s); color: var(--c-red);
}
.confirm-body p { margin: 4px 0 0; font-size: 14px; line-height: 1.55; color: var(--c-text-2); }

/* ============================================================
   Client tag (выделенная метка проекта на карточках задач)
   ============================================================ */
.client-tag {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  height: 24px; padding: 0 9px 0 5px; border-radius: var(--r-full);
  font-size: 12px; font-weight: 700; line-height: 1; white-space: nowrap;
  color: var(--cc); background: color-mix(in oklch, var(--cc) 14%, var(--c-surface));
  border: 1px solid color-mix(in oklch, var(--cc) 36%, transparent);
}
button.client-tag { cursor: pointer; transition: filter .12s ease; }
button.client-tag:hover { filter: brightness(0.96); }
[data-theme='dark'] button.client-tag:hover { filter: brightness(1.12); }
.client-tag .ct-glyph {
  width: 16px; height: 16px; flex: 0 0 auto; display: grid; place-items: center;
  border-radius: 50%; background: var(--cc); color: #fff; font-size: 9px; font-weight: 700;
}
.client-tag .ct-name { overflow: hidden; text-overflow: ellipsis; letter-spacing: 0; }
.client-tag.mini { height: 21px; font-size: 11.5px; padding: 0 8px 0 4px; gap: 5px; }
.client-tag.mini .ct-glyph { width: 14px; height: 14px; font-size: 8.5px; }

/* ============================================================
   People picker (исполнители / команда)
   ============================================================ */
.people-picker { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.person-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 9px 0 3px;
  border-radius: var(--r-full); background: var(--c-surface-2); border: 1px solid var(--c-line);
  font-size: 12.5px; font-weight: 600; color: var(--c-text);
}
.person-chip .pc-name { white-space: nowrap; }
.person-chip .pc-x {
  display: grid; place-items: center; width: 16px; height: 16px; margin-left: 1px; border-radius: 50%;
  color: var(--c-faint); transition: background .12s ease, color .12s ease;
}
.person-chip .pc-x:hover { background: var(--c-red-s); color: var(--c-red); }

.lp-item.person { height: 44px; gap: 11px; }
.lp-item.person .lp-pmain { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.lp-item.person .lp-role { font-size: 11.5px; color: var(--c-muted); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-item.person.on { background: var(--c-accent-soft); }

/* ============================================================
   Трекер — домашнее оформление поверх базовых токенов.
   У каждого человека своя тема (data-skin на <html>), светлая и тёмная.
   Питомец-помощник, конфетти, мягкие формы, округлый шрифт.
   ============================================================ */

@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url(/assets/fonts/nunito-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url(/assets/fonts/nunito-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --font: 'Nunito', ui-rounded, 'SF Pro Rounded', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r-xs: 8px;
  --r-sm: 11px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --c-accent-2: #ffb347;
  --blob-1: rgba(255, 179, 71, 0.20);
  --blob-2: rgba(242, 104, 60, 0.14);
  --blob-3: rgba(255, 214, 165, 0.30);
  --grad: linear-gradient(135deg, var(--c-accent) 0%, var(--c-accent-2) 100%);
  --sh-accent: 0 8px 22px color-mix(in oklch, var(--c-accent) 26%, transparent);
}

/* ---------- темы: светлые ---------- */
html[data-skin='mandarin'] {
  --c-bg: #fff8f2; --c-surface: #ffffff; --c-surface-2: #fff2e8; --c-surface-3: #ffe9da;
  --c-line: #f5e3d6; --c-line-2: #ebd1bf; --c-text: #2c201b; --c-text-2: #6b5449; --c-muted: #8f776b; --c-faint: #b59e92;
  --c-accent: #f2683c; --c-accent-hov: #e2592e; --c-accent-press: #c94a22; --c-accent-soft: #ffeee5; --c-accent-line: #ffcdb7; --c-on-accent: #ffffff;
  --c-accent-2: #ffb347;
  --blob-1: rgba(255, 179, 71, 0.22); --blob-2: rgba(242, 104, 60, 0.13); --blob-3: rgba(255, 220, 180, 0.35);
  --ring: 0 0 0 3px rgba(242, 104, 60, 0.20);
}
html[data-skin='zefir'] {
  --c-bg: #fff6fb; --c-surface: #ffffff; --c-surface-2: #fdeff7; --c-surface-3: #fae4f0;
  --c-line: #f4e0eb; --c-line-2: #eacbdd; --c-text: #2e1d2a; --c-text-2: #6f5169; --c-muted: #957693; --c-faint: #b99fb6;
  --c-accent: #e0559c; --c-accent-hov: #cf4689; --c-accent-press: #b43a77; --c-accent-soft: #ffeaf5; --c-accent-line: #f8c5e0; --c-on-accent: #ffffff;
  --c-accent-2: #a98bfb;
  --blob-1: rgba(255, 166, 210, 0.30); --blob-2: rgba(169, 139, 251, 0.20); --blob-3: rgba(255, 214, 236, 0.45);
  --ring: 0 0 0 3px rgba(224, 85, 156, 0.20);
}
html[data-skin='lavender'] {
  --c-bg: #f8f5ff; --c-surface: #ffffff; --c-surface-2: #f2edff; --c-surface-3: #ebe3ff;
  --c-line: #e7e0f7; --c-line-2: #d8ccf2; --c-text: #241d36; --c-text-2: #5d5275; --c-muted: #807599; --c-faint: #a59cbb;
  --c-accent: #8b5cf6; --c-accent-hov: #7c4ded; --c-accent-press: #6a3dd6; --c-accent-soft: #f1ebff; --c-accent-line: #d7c8ff; --c-on-accent: #ffffff;
  --c-accent-2: #f472b6;
  --blob-1: rgba(139, 92, 246, 0.18); --blob-2: rgba(244, 114, 182, 0.16); --blob-3: rgba(196, 181, 253, 0.32);
  --ring: 0 0 0 3px rgba(139, 92, 246, 0.20);
}
html[data-skin='mint'] {
  --c-bg: #f2fbf7; --c-surface: #ffffff; --c-surface-2: #e9f8f1; --c-surface-3: #ddf3e9;
  --c-line: #d9eee4; --c-line-2: #c3e3d4; --c-text: #18291f; --c-text-2: #4b6357; --c-muted: #6f877b; --c-faint: #97ab9f;
  --c-accent: #12a17d; --c-accent-hov: #0e8e6e; --c-accent-press: #0b7a5e; --c-accent-soft: #e3f7ef; --c-accent-line: #b6e6d3; --c-on-accent: #ffffff;
  --c-accent-2: #3dd3c4;
  --blob-1: rgba(61, 211, 196, 0.20); --blob-2: rgba(18, 161, 125, 0.12); --blob-3: rgba(190, 240, 214, 0.40);
  --ring: 0 0 0 3px rgba(18, 161, 125, 0.20);
}
html[data-skin='ocean'] {
  --c-bg: #f3f8ff; --c-surface: #ffffff; --c-surface-2: #eaf3ff; --c-surface-3: #ddebff;
  --c-line: #dce7f6; --c-line-2: #c6d7ef; --c-text: #182337; --c-text-2: #4a5a75; --c-muted: #6d7d97; --c-faint: #97a5bb;
  --c-accent: #2f80ed; --c-accent-hov: #2470d8; --c-accent-press: #1d5fbd; --c-accent-soft: #e7f1ff; --c-accent-line: #bcd6fb; --c-on-accent: #ffffff;
  --c-accent-2: #22c1c3;
  --blob-1: rgba(34, 193, 195, 0.18); --blob-2: rgba(47, 128, 237, 0.14); --blob-3: rgba(190, 220, 255, 0.40);
  --ring: 0 0 0 3px rgba(47, 128, 237, 0.20);
}
html[data-skin='classic'] {
  --c-accent-2: #7d9cff;
  --blob-1: rgba(65, 105, 225, 0.10); --blob-2: rgba(125, 156, 255, 0.10); --blob-3: rgba(200, 214, 255, 0.25);
}

/* ---------- темы: тёмные ---------- */
html[data-theme='dark'] { --blob-1: rgba(255,255,255,0.03); --blob-2: rgba(255,255,255,0.02); --blob-3: rgba(255,255,255,0.02); }
html[data-skin='mandarin'][data-theme='dark'] {
  --c-bg: #1c1512; --c-surface: #251c18; --c-surface-2: #2e231e; --c-surface-3: #382b25;
  --c-line: #3d3029; --c-line-2: #4e3d35; --c-text: #fbf0ea; --c-text-2: #ddc8bd; --c-muted: #b19c90; --c-faint: #86736a;
  --c-accent: #ff8a5c; --c-accent-hov: #ff9d75; --c-accent-press: #ffb090; --c-accent-soft: #432a1f; --c-accent-line: #6b3f2c; --c-on-accent: #1c1512;
  --c-accent-2: #ffc06b;
  --blob-1: rgba(255, 138, 92, 0.10); --blob-2: rgba(255, 192, 107, 0.06); --blob-3: rgba(255, 138, 92, 0.05);
}
html[data-skin='zefir'][data-theme='dark'] {
  --c-bg: #1b1420; --c-surface: #241b2a; --c-surface-2: #2d2234; --c-surface-3: #372a3f;
  --c-line: #3e2f46; --c-line-2: #4f3c58; --c-text: #fbeffa; --c-text-2: #dec7dd; --c-muted: #b499b4; --c-faint: #88718b;
  --c-accent: #ff7ab8; --c-accent-hov: #ff91c5; --c-accent-press: #ffa8d2; --c-accent-soft: #4a2442; --c-accent-line: #74395f; --c-on-accent: #1b1420;
  --c-accent-2: #b9a1ff;
  --blob-1: rgba(255, 122, 184, 0.11); --blob-2: rgba(185, 161, 255, 0.09); --blob-3: rgba(255, 122, 184, 0.05);
}
html[data-skin='lavender'][data-theme='dark'] {
  --c-bg: #17142a; --c-surface: #1f1b36; --c-surface-2: #282342; --c-surface-3: #312b4f;
  --c-line: #352f55; --c-line-2: #453d6b; --c-text: #f3f0ff; --c-text-2: #cfc8ea; --c-muted: #a69ec6; --c-faint: #7d7699;
  --c-accent: #a78bfa; --c-accent-hov: #b9a2fc; --c-accent-press: #cbb9fd; --c-accent-soft: #33295e; --c-accent-line: #503f8f; --c-on-accent: #17142a;
  --c-accent-2: #f9a8d4;
  --blob-1: rgba(167, 139, 250, 0.12); --blob-2: rgba(249, 168, 212, 0.07); --blob-3: rgba(167, 139, 250, 0.05);
}
html[data-skin='mint'][data-theme='dark'] {
  --c-bg: #111c18; --c-surface: #172420; --c-surface-2: #1e2e29; --c-surface-3: #263832;
  --c-line: #2b3d37; --c-line-2: #384e46; --c-text: #ecfaf4; --c-text-2: #c4ddd2; --c-muted: #93ada2; --c-faint: #6c8379;
  --c-accent: #4fd1ad; --c-accent-hov: #6bdbbb; --c-accent-press: #8ae4ca; --c-accent-soft: #1d3f35; --c-accent-line: #2d6553; --c-on-accent: #111c18;
  --c-accent-2: #67e8f9;
  --blob-1: rgba(79, 209, 173, 0.10); --blob-2: rgba(103, 232, 249, 0.07); --blob-3: rgba(79, 209, 173, 0.04);
}
html[data-skin='ocean'][data-theme='dark'] {
  --c-bg: #111827; --c-surface: #172033; --c-surface-2: #1e2a40; --c-surface-3: #26344e;
  --c-line: #2a3852; --c-line-2: #384966; --c-text: #eef4ff; --c-text-2: #c6d3ea; --c-muted: #93a3bf; --c-faint: #6d7c97;
  --c-accent: #6aa9ff; --c-accent-hov: #84b8ff; --c-accent-press: #9fc8ff; --c-accent-soft: #1f3557; --c-accent-line: #2f5285; --c-on-accent: #111827;
  --c-accent-2: #5eead4;
  --blob-1: rgba(106, 169, 255, 0.10); --blob-2: rgba(94, 234, 212, 0.07); --blob-3: rgba(106, 169, 255, 0.04);
}

/* ---------- общий фон с мягкими пятнами ---------- */
body { letter-spacing: 0.005em; }
.shell { background: transparent; position: relative; isolation: isolate; }
.shell::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(42vw 36vw at 8% -6%, var(--blob-1), transparent 70%),
    radial-gradient(38vw 34vw at 102% 8%, var(--blob-2), transparent 70%),
    radial-gradient(50vw 40vw at 60% 110%, var(--blob-3), transparent 70%),
    var(--c-bg);
}
h1, h2, h3, h4 { font-weight: 800; letter-spacing: -0.01em; }
.page-head .titles h1 { font-size: 27px; }

/* ---------- боковое меню ---------- */
.sidebar { background: color-mix(in oklch, var(--c-surface) 82%, transparent); backdrop-filter: blur(14px); }
.brand-mark { background: var(--grad); box-shadow: var(--sh-accent); border-radius: 14px; overflow: hidden; }
/* логотип в меню: питомец крупно, имена под стать */
.sidebar-top { height: auto; min-height: var(--topbar-h); padding: 14px 14px 12px; border-bottom: 0; }
.brand { width: 100%; gap: 12px; padding: 6px; margin: -6px; border-radius: 20px; text-align: left; transition: background .15s ease; }
.brand:hover { background: var(--c-accent-soft); }
.brand-mark.pet-mark {
  width: 60px; height: 60px; border-radius: 20px; padding: 0; overflow: visible;
  background: radial-gradient(circle at 50% 65%, color-mix(in oklch, var(--c-accent) 22%, var(--c-surface)) 0 55%, transparent 56%);
  box-shadow: none; display: grid; place-items: center;
}
.brand-mark.pet-mark .pet { margin-top: -4px; }
/* старое правило .brand-mark svg { 19px } сжимало питомца — отменяем */
.brand-mark.pet-mark svg { width: 100%; height: 100%; }
.brand-copy strong { font-size: 17.5px; font-weight: 900; line-height: 1.15; letter-spacing: -0.01em; }
.brand-copy span { font-size: 12.5px; font-weight: 700; margin-top: 2px; color: var(--c-accent); }
.shell.collapsed .sidebar-top { padding: 14px 0 12px; }
.shell.collapsed .brand { width: auto; margin: 0; }
.shell.collapsed .brand-mark.pet-mark { width: 50px; height: 50px; }
.shell.collapsed .brand-mark.pet-mark .pet { transform: scale(.82); }
.nav-item { border-radius: 14px; font-weight: 600; }
.nav-item.active { background: var(--c-accent-soft); color: var(--c-accent); font-weight: 800; }
.nav-item.active::before { display: none; }
.nav-group-label { letter-spacing: 0.08em; }
.topbar { background: color-mix(in oklch, var(--c-bg) 72%, transparent); border-bottom-color: transparent; }

/* ---------- кнопки, карточки ---------- */
.btn { font-weight: 700; }
.btn.primary { background: var(--grad); border: 0; box-shadow: var(--sh-accent); }
.btn.primary:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn.primary:active { transform: translateY(0); filter: brightness(0.97); }
.panel, .card, .stat, .kcol { border-color: color-mix(in oklch, var(--c-line) 80%, transparent); box-shadow: 0 2px 10px color-mix(in oklch, var(--c-accent) 6%, transparent); }
.tcard { border-radius: 16px; transition: transform .15s ease, box-shadow .15s ease; }
.tcard:hover { transform: translateY(-2px) rotate(-0.3deg); }
.chip.active, .segmented button.active { font-weight: 800; }
.pill.accent { background: var(--grad); color: var(--c-on-accent); }
.avatar { box-shadow: 0 0 0 2px var(--c-surface); }
.tcard-done { border-radius: 50%; }
.tcard-done:hover { background: var(--c-green); color: #fff; transform: scale(1.12); }

/* ---------- питомец ---------- */
.pet { display: inline-block; position: relative; line-height: 0; }
.pet svg { overflow: visible; }
.pet .pet-body { animation: pet-bob 3.4s ease-in-out infinite; transform-origin: 60px 110px; transform-box: view-box; }
.pet .pet-eyes { animation: pet-blink 5.5s infinite; transform-origin: 60px 58px; transform-box: view-box; }
.pet.bounce .pet-body { animation: pet-jump .6s cubic-bezier(.3,1.6,.5,1) 1, pet-bob 3.4s ease-in-out .6s infinite; }
.pet .pet-zzz { animation: pet-zzz 2.6s ease-in-out infinite; }
.pet .pet-sweat { animation: pet-sweat 1.8s ease-in infinite; }
.pet.clickable { cursor: pointer; }
.pet .pet-heart { position: absolute; font-size: 18px; line-height: 1; pointer-events: none; animation: pet-heart 1.2s ease-out forwards; }
@keyframes pet-bob { 0%, 100% { transform: translateY(0) scale(1, 1); } 50% { transform: translateY(-3px) scale(1.012, .99); } }
@keyframes pet-jump { 0% { transform: translateY(0) scale(1); } 30% { transform: translateY(2px) scale(1.08, .9); } 60% { transform: translateY(-16px) scale(.95, 1.06); } 100% { transform: translateY(0) scale(1); } }
@keyframes pet-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.08); } }
@keyframes pet-zzz { 0% { opacity: 0; transform: translate(0, 4px); } 40% { opacity: 1; } 100% { opacity: 0; transform: translate(8px, -10px); } }
@keyframes pet-sweat { 0% { opacity: 0; transform: translateY(-3px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(6px); } }
@keyframes pet-heart { 0% { opacity: 0; transform: translate(0, 0) scale(.6); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx, 0px), -60px) scale(1.2); } }

/* реплика питомца */
.pet-bubble {
  position: relative; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 18px;
  padding: 12px 15px; font-size: 14.5px; line-height: 1.45; font-weight: 600; color: var(--c-text);
  box-shadow: var(--sh-sm); animation: pop-in .25s ease;
}
.pet-bubble::before {
  content: ''; position: absolute; left: -7px; top: 22px; width: 14px; height: 14px; background: var(--c-surface);
  border-left: 1px solid var(--c-line); border-bottom: 1px solid var(--c-line); transform: rotate(45deg); border-radius: 0 0 0 4px;
}

/* ---------- «Дом» ---------- */
.home-hero {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 22px; align-items: center;
  padding: 22px 24px; border-radius: var(--r-xl); margin-bottom: 18px;
  background:
    radial-gradient(120% 160% at 0% 0%, color-mix(in oklch, var(--c-accent) 14%, transparent), transparent 55%),
    radial-gradient(120% 160% at 100% 100%, color-mix(in oklch, var(--c-accent-2) 18%, transparent), transparent 60%),
    var(--c-surface);
  border: 1px solid color-mix(in oklch, var(--c-accent) 18%, var(--c-line));
  box-shadow: 0 10px 30px color-mix(in oklch, var(--c-accent) 10%, transparent);
}
.home-hero .hello { font-size: 28px; font-weight: 900; letter-spacing: -0.02em; line-height: 1.1; }
.home-hero .hello-sub { margin-top: 6px; color: var(--c-text-2); font-size: 14.5px; font-weight: 600; }
.home-hero .bubble-wrap { margin-top: 14px; max-width: 560px; }
.home-hero .pet-side { display: grid; justify-items: center; gap: 8px; }
.home-hero .pet-name { font-weight: 900; font-size: 15px; }
.home-badges { display: grid; gap: 8px; min-width: 190px; }
.home-badge { display: flex; align-items: center; gap: 10px; padding: 10px 13px; border-radius: 16px; background: color-mix(in oklch, var(--c-surface) 75%, transparent); border: 1px solid var(--c-line); font-weight: 700; font-size: 13.5px; }
.home-badge .big { font-size: 20px; font-weight: 900; line-height: 1; }
.home-badge .em { font-size: 20px; line-height: 1; }
.xp-bar { height: 8px; border-radius: 99px; background: var(--c-surface-3); overflow: hidden; margin-top: 6px; }
.xp-bar i { display: block; height: 100%; border-radius: 99px; background: var(--grad); transition: width .6s cubic-bezier(.2,.8,.2,1); }

.quick-add { display: flex; gap: 10px; align-items: center; padding: 8px 8px 8px 16px; border-radius: 18px; background: var(--c-surface); border: 1px solid var(--c-line); box-shadow: var(--sh-xs); margin-bottom: 18px; }
.quick-add input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 15px; font-weight: 600; padding: 8px 0; }
.quick-add .qa-who { display: flex; gap: 4px; }
.quick-add .qa-who button { font-size: 12.5px; font-weight: 700; padding: 6px 10px; border-radius: 99px; color: var(--c-muted); }
.quick-add .qa-who button.on { background: var(--c-accent-soft); color: var(--c-accent); }

.home-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; }
.todo-row { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-top: 1px solid var(--c-line); cursor: pointer; transition: background .12s ease; }
.todo-row:first-child { border-top: 0; }
.todo-row:hover { background: var(--c-surface-2); }
.todo-check { width: 24px; height: 24px; flex: 0 0 auto; border-radius: 50%; border: 2px solid var(--c-line-2); display: grid; place-items: center; transition: all .15s ease; color: transparent; }
.todo-check:hover { border-color: var(--c-green); color: var(--c-green); transform: scale(1.1); }
.todo-check.done { background: var(--c-green); border-color: var(--c-green); color: #fff; }
.todo-row .tt { flex: 1; min-width: 0; font-weight: 700; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-row .meta { color: var(--c-muted); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.todo-row .meta.over { color: var(--c-red); }

.together { padding: 18px; display: grid; gap: 14px; }
.together .pair { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; text-align: center; }
.together .heart { font-size: 22px; animation: pet-bob 2s ease-in-out infinite; }
.together .who { display: grid; justify-items: center; gap: 2px; }
.together .who b { font-size: 14px; font-weight: 900; }
.together .who span { font-size: 12.5px; color: var(--c-muted); font-weight: 600; }
.together .note { text-align: center; font-weight: 700; color: var(--c-text-2); font-size: 13.5px; padding: 10px 12px; border-radius: 14px; background: var(--c-surface-2); }

.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 0 18px 18px; }
.mini-stat { padding: 12px; border-radius: 16px; background: var(--c-surface-2); text-align: center; }
.mini-stat b { display: block; font-size: 22px; font-weight: 900; line-height: 1.1; }
.mini-stat span { font-size: 12px; color: var(--c-muted); font-weight: 700; }

/* ---------- выбор темы и питомца ---------- */
.skin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.skin-opt { border: 2px solid var(--c-line); border-radius: 18px; padding: 12px; text-align: left; background: var(--c-surface); transition: transform .12s ease, border-color .12s ease; }
.skin-opt:hover { transform: translateY(-2px); }
.skin-opt.on { border-color: var(--c-accent); box-shadow: var(--ring); }
.skin-opt .sw { height: 46px; border-radius: 12px; margin-bottom: 9px; }
.skin-opt b { display: block; font-size: 14px; font-weight: 800; }
.skin-opt span { font-size: 12px; color: var(--c-muted); font-weight: 600; }
.pet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.pet-opt { border: 2px solid var(--c-line); border-radius: 18px; padding: 8px 6px 10px; display: grid; justify-items: center; gap: 4px; background: var(--c-surface); font-weight: 800; font-size: 13px; transition: transform .12s ease; }
.pet-opt:hover { transform: translateY(-2px); }
.pet-opt.on { border-color: var(--c-accent); box-shadow: var(--ring); }
.color-dots { display: flex; gap: 8px; flex-wrap: wrap; }
.color-dot { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--c-surface); box-shadow: 0 0 0 1px var(--c-line-2); transition: transform .12s ease; }
.color-dot.on { box-shadow: 0 0 0 2px var(--c-accent); transform: scale(1.1); }

/* ---------- всплывающая реплика питомца ---------- */
.pet-toast {
  position: fixed; right: 18px; bottom: 18px; z-index: 300; display: flex; align-items: flex-end; gap: 6px;
  animation: toast-in .35s cubic-bezier(.2,1.4,.4,1); pointer-events: auto; max-width: min(360px, calc(100vw - 36px));
}
.pet-toast .pet-bubble { font-size: 14px; }
.pet-toast .pet-bubble::before { left: auto; right: -7px; top: auto; bottom: 20px; transform: rotate(-135deg); }
.pet-toast.out { animation: toast-out .3s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(20px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(12px) scale(.95); } }

/* ---------- конфетти ---------- */
.confetti-piece { position: fixed; z-index: 400; width: 9px; height: 14px; border-radius: 3px; pointer-events: none; will-change: transform, opacity; }

/* ---------- вход ---------- */
.login-aside { background: var(--grad); }
.login-pets { display: flex; align-items: flex-end; gap: 6px; margin-top: 18px; }

/* ---------- телефон ---------- */
@media (max-width: 960px) {
  .home-grid { grid-template-columns: 1fr; }
  .home-hero { grid-template-columns: auto minmax(0, 1fr); }
  .home-hero .home-badges { grid-column: 1 / -1; grid-template-columns: repeat(3, 1fr); min-width: 0; }
}
@media (max-width: 760px) {
  .home-hero { padding: 16px; gap: 12px; }
  .home-hero .hello { font-size: 22px; }
  .home-hero .home-badges { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .home-badge { flex-direction: column; gap: 4px; padding: 9px 6px; text-align: center; font-size: 11.5px; }
  .pet-toast { right: 10px; bottom: 10px; }
  .quick-add { flex-wrap: wrap; padding: 10px 12px; }
  .quick-add input { flex: 1 1 calc(100% - 32px); }
  .quick-add .qa-who { flex: 1; }
  .home-hero .pet-side .pet { transform: scale(.85); transform-origin: top center; }
}

@media (prefers-reduced-motion: reduce) {
  .pet .pet-body, .pet .pet-eyes, .together .heart { animation: none !important; }
}
