/* Админка бота «Команда» — визуальный язык админок карусели и фильтров. */

:root {
  color-scheme: dark light;
  --bg: #0b0d14;
  --bg-desktop: #080a10;
  --ink: #e2e8f0;
  --ink-strong: #f1f5f9;
  --ink-2: #94a3b8;
  --ink-3: #64748b;
  --tab-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ios-ease: cubic-bezier(0.32, 0.72, 0, 1);
  --plate: linear-gradient(135deg, rgba(255, 255, 255, 0.085) 0%, rgba(255, 255, 255, 0.04) 100%);
  --plate-hover: linear-gradient(135deg, rgba(255, 255, 255, 0.13) 0%, rgba(255, 255, 255, 0.06) 100%);
  --plate-border: rgba(255, 255, 255, 0.11);
  --plate-border-hover: rgba(255, 255, 255, 0.18);
  --head-glass: rgba(17, 20, 30, 0.78);
  --head-edge: rgba(255, 255, 255, 0.09);
  --field-bg: rgba(255, 255, 255, 0.06);
  --field-border: rgba(255, 255, 255, 0.14);
  --push-on: #6366f1;
  --push-off: rgba(148, 163, 184, 0.32);
  --dock-h: 66px;
  --dock-inset: 13px;
  --dock-bottom: 10px;
  --dock-radius: 30px;
  --tab-accent: #d6ddff;
  --tab-idle: #7f879b;
  --dock-bg: rgba(19, 22, 32, 0.62);
  --dock-edge: rgba(255, 255, 255, 0.09);
  --dock-hi: rgba(255, 255, 255, 0.10);
  --dock-shadow: 0 14px 28px -16px rgba(0, 0, 0, 0.9);
  --tab-press-bg: rgba(255, 255, 255, 0.09);
  --ios-ink: #eef1fb;
  --ios-ink-2: #7f8798;
  --ios-accent: #0a84ff;
  --ios-card: #1a1e27;
  --ios-card-edge: rgba(255, 255, 255, 0.07);
  --ios-sep: rgba(255, 255, 255, 0.075);
  --ios-row-hover: rgba(255, 255, 255, 0.06);
  --ios-tint-users: #818cf8;
  --ios-tint-answers: #38bdf8;
  --ios-tint-plan: #34d399;
  --ios-tint-warn: #fbbf24;
  --ios-tint-neutral: #98a2b3;
  --ios-tint-danger: #f87171;
  --primary: #6366f1;
  --primary-grad: linear-gradient(180deg, #6b6ef6, #5558ec);
  --danger: #ef4444;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --dock-total: calc(var(--dock-h) + var(--dock-bottom) + var(--safe-b));
  --modal-backdrop: rgba(2, 4, 10, 0.62);
  --modal-bg: linear-gradient(180deg, #262a35, #1b1e26);
  --sep: rgba(255, 255, 255, 0.05);
  --hover: rgba(255, 255, 255, 0.06);
}

html.ios.pwa {
  --dock-bottom: -10px;
}

html[data-theme="light"] {
  --bg: #f5f7fa;
  --bg-desktop: #eef1f7;
  --ink: #334155;
  --ink-strong: #0f172a;
  --ink-2: #64748b;
  --ink-3: #94a3b8;
  --plate: linear-gradient(135deg, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.55) 100%);
  --plate-hover: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.75) 100%);
  --plate-border: rgba(15, 23, 42, 0.08);
  --plate-border-hover: rgba(15, 23, 42, 0.16);
  --head-glass: rgba(245, 247, 250, 0.82);
  --head-edge: rgba(15, 23, 42, 0.08);
  --field-bg: #ffffff;
  --field-border: rgba(15, 23, 42, 0.14);
  --push-on: #4f46e5;
  --tab-accent: #1d4ed8;
  --tab-idle: #98a1b3;
  --dock-bg: rgba(255, 255, 255, 0.72);
  --dock-edge: rgba(15, 23, 42, 0.07);
  --dock-hi: #ffffff;
  --dock-shadow: 0 12px 24px -14px rgba(15, 23, 42, 0.32);
  --tab-press-bg: rgba(15, 23, 42, 0.07);
  --ios-ink: #10192e;
  --ios-ink-2: #64748b;
  --ios-accent: #007aff;
  --ios-card: #ffffff;
  --ios-card-edge: rgba(15, 23, 42, 0.055);
  --ios-sep: rgba(15, 23, 42, 0.08);
  --ios-row-hover: rgba(15, 23, 42, 0.045);
  --ios-tint-danger: #d70015;
  --modal-backdrop: rgba(15, 23, 42, 0.35);
  --modal-bg: #ffffff;
  --sep: rgba(15, 23, 42, 0.07);
  --hover: rgba(15, 23, 42, 0.045);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
  min-height: 100dvh;
}

button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; touch-action: manipulation; }
a { color: var(--ios-accent); text-decoration: none; }
input, textarea, select { font: inherit; color: var(--ink); }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* ---------- Логин ---------- */

.login-body { display: flex; align-items: center; justify-content: center; min-height: 100dvh; position: relative; }

.login-aurora {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(60% 50% at 18% 12%, rgba(99, 102, 241, 0.24), transparent 70%),
    radial-gradient(55% 45% at 82% 20%, rgba(139, 92, 246, 0.18), transparent 70%),
    radial-gradient(50% 45% at 55% 90%, rgba(56, 189, 248, 0.10), transparent 70%);
}
html[data-theme="light"] .login-aurora {
  background:
    radial-gradient(60% 50% at 18% 12%, rgba(79, 70, 229, 0.14), transparent 70%),
    radial-gradient(55% 45% at 82% 20%, rgba(124, 58, 237, 0.10), transparent 70%);
}

.login-card { position: relative; z-index: 1; width: min(420px, 100% - 32px); }
.login-inner {
  border-radius: 28px; border: 1px solid var(--plate-border); background: var(--plate);
  backdrop-filter: blur(20px) saturate(160%); padding: 34px 30px;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.7);
}
html[data-theme="light"] .login-inner { box-shadow: 0 30px 60px -34px rgba(15, 23, 42, 0.35); }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 24px; }
.login-logo {
  width: 54px; height: 54px; border-radius: 17px; display: grid; place-items: center;
  background: var(--primary-grad); color: #fff;
  box-shadow: 0 12px 28px -10px rgba(99, 102, 241, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.login-title { font-size: 27px; font-weight: 800; letter-spacing: -0.03em; color: var(--ink-strong); }
.login-sub { font-size: 13.5px; color: var(--ink-2); }
.login-label { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-2); margin: 16px 0 7px; }
.login-input {
  width: 100%; height: 50px; border-radius: 15px; padding: 0 15px;
  background: rgba(255, 255, 255, 0.055); border: 1px solid var(--field-border); outline: none;
  transition: border-color 0.15s var(--tab-ease), box-shadow 0.15s var(--tab-ease);
}
html[data-theme="light"] .login-input { background: #fff; }
.login-input:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.16); }
.login-btn {
  width: 100%; height: 52px; border-radius: 15px; margin-top: 20px; font-weight: 700; color: #fff;
  background: var(--primary-grad);
  box-shadow: 0 14px 30px -12px rgba(99, 102, 241, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 0.12s var(--tab-ease), filter 0.15s;
}
.login-btn:active { transform: scale(0.98); }
.login-error {
  margin-top: 14px; padding: 10px 14px; border-radius: 14px; font-size: 13.5px;
  background: rgba(239, 68, 68, 0.10); border: 1px solid rgba(239, 68, 68, 0.28); color: #fca5a5;
}
html[data-theme="light"] .login-error { color: #b91c1c; background: rgba(239, 68, 68, 0.08); border-color: rgba(239, 68, 68, 0.25); }

@media (max-width: 1023px) {
  .login-inner { border: 0; background: none; backdrop-filter: none; box-shadow: none; padding: max(32px, var(--safe-t)) 6px 32px; border-radius: 0; }
}

/* ---------- Оболочка ---------- */

.shell { min-height: 100dvh; }
.content {
  padding: calc(12px + var(--safe-t)) calc(12px + var(--safe-r)) calc(24px + var(--dock-total)) calc(12px + var(--safe-l));
  max-width: 100%;
}
.content > :first-child { margin-top: 0; }
.m-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink-strong); margin: 0 0 14px; display: flex; align-items: center; gap: 10px; }
.kicker { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.sub { font-size: 13px; color: var(--ink-2); }
.content.spa-in { animation: spa-in 0.22s ease-out; }
@keyframes spa-in { from { opacity: 0.25; } to { opacity: 1; } }

/* ---------- Док ---------- */

.tabbar {
  position: fixed; left: calc(var(--dock-inset) + var(--safe-l)); right: calc(var(--dock-inset) + var(--safe-r));
  bottom: calc(var(--dock-bottom) + var(--safe-b)); height: var(--dock-h); border-radius: var(--dock-radius);
  background: var(--dock-bg); border: 1px solid var(--dock-edge);
  backdrop-filter: saturate(180%) blur(26px); -webkit-backdrop-filter: saturate(180%) blur(26px);
  box-shadow: var(--dock-shadow), inset 0 1px 0 var(--dock-hi);
  display: flex; z-index: 40; animation: dock-in 0.5s var(--tab-ease) both;
}
@keyframes dock-in { from { opacity: 0; transform: translateY(10px) scale(0.985); } }
.tabbar-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 8px 2px 10px; color: var(--tab-idle); position: relative; border-radius: 20px;
}
.tabbar-item svg { width: 24px; height: 24px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; transform: scale(0.94); transition: transform 0.2s var(--tab-ease); }
.tabbar-item span { font-size: 10.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; padding: 0 2px; }
.tabbar-item.active { color: var(--tab-accent); }
.tabbar-item.active span { font-weight: 600; }
.tabbar-item.active svg { fill: currentColor; fill-opacity: 0.16; stroke-width: 2.1; transform: none; animation: tab-rise 0.34s var(--tab-ease); }
@keyframes tab-rise { 0% { transform: translateY(0) scale(1); } 45% { transform: translateY(-4px) scale(1.05); } 100% { transform: translateY(-1px) scale(1); } }
.tabbar-item::after { content: ""; position: absolute; inset: 9px 9px 12px; border-radius: 999px; background: var(--tab-press-bg); opacity: 0; transition: opacity 0.16s; }
.tabbar-item:active { transform: scale(0.93); }
.tabbar-item:active::after { opacity: 1; }

/* ---------- Сайдбар (desktop) ---------- */

.sidebar { display: none; }
@media (min-width: 1024px) {
  body { font-size: 16px; background: var(--bg-desktop); }
  body::before {
    content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
    background:
      radial-gradient(40% 35% at 12% 8%, rgba(99, 102, 241, 0.16), transparent 70%),
      radial-gradient(35% 30% at 60% 0%, rgba(34, 211, 238, 0.09), transparent 70%),
      radial-gradient(45% 40% at 90% 85%, rgba(139, 92, 246, 0.08), transparent 70%);
  }
  .shell { display: flex; position: relative; z-index: 1; }
  .sidebar {
    display: flex; flex-direction: column; gap: 6px; width: 264px; flex: 0 0 264px; min-height: 100dvh;
    padding: 30px 22px; border-right: 1px solid var(--head-edge);
    background: rgba(12, 14, 22, 0.66); backdrop-filter: saturate(160%) blur(20px); position: sticky; top: 0; height: 100dvh;
  }
  html[data-theme="light"] .sidebar { background: rgba(255, 255, 255, 0.72); }
  .side-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; }
  .side-brand .login-logo { width: 38px; height: 38px; border-radius: 11px; }
  .side-brand b { font-size: 16px; letter-spacing: -0.02em; color: var(--ink-strong); }
  .side-link {
    display: flex; align-items: center; gap: 12px; height: 48px; padding: 0 14px; border-radius: 12px;
    color: #9aa4b8; font-size: 15.5px; position: relative; transition: background 0.15s var(--tab-ease);
  }
  .side-link svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; flex: none; }
  .side-link:hover { background: rgba(255, 255, 255, 0.04); }
  .side-link.active { background: rgba(255, 255, 255, 0.07); color: var(--ink-strong); }
  html[data-theme="light"] .side-link.active { background: rgba(15, 23, 42, 0.05); }
  .side-link.active::before { content: ""; position: absolute; left: -12px; top: 11px; width: 3px; height: 20px; border-radius: 2px; background: linear-gradient(180deg, #818cf8, #22d3ee); }
  html[data-theme="light"] .side-link.active::before { background: linear-gradient(180deg, #4f46e5, #0891b2); }
  .side-link.active svg { color: #818cf8; }
  html[data-theme="light"] .side-link.active svg { color: #4f46e5; }
  .side-link.danger { color: #f87171; margin-top: auto; }
  html[data-theme="light"] .side-link.danger { color: #90171f; }
  .side-link.danger:hover { background: rgba(239, 68, 68, 0.12); }
  .tabbar { display: none; }
  .content { padding: 36px 44px 64px; max-width: var(--page-max, 1440px); margin: 0 auto; width: 100%; }
  .card, .db-stat, .ios-group { border-radius: 22px; }
  .row { min-height: 64px; padding: 15px 20px; }
  .row-title { font-size: 16px; }
  .row-sub { font-size: 14px; }
  .ios-row { min-height: 56px; padding: 13px 20px; }
  .btn { min-height: 46px; font-size: 15px; }
  .btn-sm { min-height: 38px; font-size: 14px; }
  .m-title { font-size: 28px; margin-bottom: 20px; }
  .ios-title { font-size: 34px; }
}

/* ---------- Карточки ---------- */

.card {
  border-radius: 24px; border: 1px solid var(--plate-border); background: var(--plate);
  backdrop-filter: blur(12px); overflow: hidden; margin-bottom: 14px;
}
.card-title { padding: 14px 18px 0; font-size: 12px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-2); }
.card-body { padding: 0; }
.card-pad { padding: 16px 18px; }

.row {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; position: relative; min-height: 56px;
  border-bottom: 1px solid var(--sep); transition: background 0.15s;
}
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--hover); }
.row-main { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.row-title { font-size: 15px; font-weight: 650; color: var(--ink-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-foot { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.row-chevron { color: rgba(255, 255, 255, 0.28); flex: none; display: flex; }
.row-chevron svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
html[data-theme="light"] .row-chevron { color: rgba(15, 23, 42, 0.25); }
button.row { width: 100%; text-align: left; cursor: pointer; }
.row:active { background: var(--hover); }

.avatar {
  width: 40px; height: 40px; border-radius: 13px; flex: none; display: grid; place-items: center;
  font-size: 15px; font-weight: 700; color: #fff; letter-spacing: -0.02em;
  background: linear-gradient(150deg, #818cf8, #4f46e5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.avatar[data-tint="sky"] { background: linear-gradient(150deg, #38bdf8, #0284c7); }
.avatar[data-tint="green"] { background: linear-gradient(150deg, #34d399, #059669); }
.avatar[data-tint="amber"] { background: linear-gradient(150deg, #fbbf24, #d97706); }
.avatar[data-tint="gray"] { background: linear-gradient(150deg, #98a2b3, #64748b); }
.avatar[data-tint="rose"] { background: linear-gradient(150deg, #fb7185, #e11d48); }

/* ---------- Бейджи ---------- */

.badge {
  display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 9px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap; border: 1px solid transparent;
}
.badge-green { background: rgba(16, 185, 129, 0.10); border-color: rgba(16, 185, 129, 0.22); color: #6ee7b7; }
.badge-red { background: rgba(239, 68, 68, 0.10); border-color: rgba(239, 68, 68, 0.22); color: #fca5a5; }
.badge-amber { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.30); color: #fcd34d; }
.badge-sky { background: rgba(56, 189, 248, 0.10); border-color: rgba(56, 189, 248, 0.22); color: #7dd3fc; }
.badge-indigo { background: rgba(99, 102, 241, 0.12); border-color: rgba(99, 102, 241, 0.28); color: #c7d2fe; }
.badge-gray { background: rgba(148, 163, 184, 0.10); border-color: rgba(255, 255, 255, 0.06); color: #cbd5e1; }
html[data-theme="light"] .badge-green { color: #047857; background: rgba(16, 185, 129, 0.08); }
html[data-theme="light"] .badge-red { color: #b91c1c; background: rgba(239, 68, 68, 0.08); }
html[data-theme="light"] .badge-amber { color: #b45309; background: rgba(245, 158, 11, 0.10); }
html[data-theme="light"] .badge-sky { color: #0369a1; background: rgba(56, 189, 248, 0.10); }
html[data-theme="light"] .badge-indigo { color: #4338ca; background: rgba(99, 102, 241, 0.09); }
html[data-theme="light"] .badge-gray { color: #475569; background: rgba(15, 23, 42, 0.05); }

.chip {
  border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 600; flex: none;
  background: var(--field-bg); border: 1px solid var(--field-border); color: var(--ink-2);
  transition: all 0.15s var(--tab-ease);
}
.chip.active { background: rgba(99, 102, 241, 0.14); border-color: rgba(99, 102, 241, 0.35); color: var(--ink-strong); }
html[data-theme="light"] .chip.active { background: rgba(79, 70, 229, 0.10); border-color: rgba(79, 70, 229, 0.30); color: #3730a3; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }

/* ---------- Дашборд ---------- */

.db-hero { margin: 6px 2px 18px; }
.db-hero-title { font-size: 40px; font-weight: 800; letter-spacing: -0.03em; color: var(--ink-strong); line-height: 1.05; }
.db-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.db-stat {
  border-radius: 24px; border: 1px solid var(--plate-border); background: var(--plate); backdrop-filter: blur(10px);
  padding: 16px 18px; display: flex; flex-direction: column-reverse; text-align: right; gap: 8px; align-items: flex-end;
  transition: border-color 0.15s var(--tab-ease);
}
.db-stat:hover { border-color: var(--plate-border-hover); }
.db-stat-value { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink-strong); font-variant-numeric: tabular-nums; }
.db-stat-label { font-size: 12.5px; color: var(--ink-2); }
.db-stat-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(99, 102, 241, 0.10); border: 1px solid rgba(99, 102, 241, 0.18); color: #6366f1; align-self: flex-start; }
.db-stat[data-tint="sky"] .db-stat-icon { background: rgba(56, 189, 248, 0.10); border-color: rgba(56, 189, 248, 0.2); color: #38bdf8; }
.db-stat[data-tint="green"] .db-stat-icon { background: rgba(52, 211, 153, 0.10); border-color: rgba(52, 211, 153, 0.2); color: #34d399; }
.db-stat[data-tint="amber"] .db-stat-icon { background: rgba(251, 191, 36, 0.10); border-color: rgba(251, 191, 36, 0.2); color: #fbbf24; }
.db-stat-icon svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.8; fill: none; }
.db-actions { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 16px; }
.db-charts { margin-bottom: 16px; }
.db-charts .st-donut { min-width: 0; display: flex; justify-content: center; text-align: center; }
@media (min-width: 560px) { .db-actions { grid-template-columns: 1fr 1fr; } }
.db-action {
  border-radius: 20px; border: 1px solid var(--plate-border); background: var(--plate); padding: 14px;
  display: flex; align-items: center; gap: 12px; text-align: left; transition: border-color 0.15s; min-width: 0;
}
.db-action:hover { border-color: var(--plate-border-hover); background: var(--plate-hover); }
.db-action-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(99, 102, 241, 0.10); border: 1px solid rgba(99, 102, 241, 0.18); color: #6366f1; flex: none; }
.db-action-icon svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 1.8; fill: none; }
.db-action > span:last-child { min-width: 0; }
.db-action b { display: block; font-size: 14px; font-weight: 650; color: var(--ink-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-action span span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-action span { font-size: 12px; color: var(--ink-2); }
@media (min-width: 1024px) {
  .db-hero-title { font-size: 26px; }
  .db-stats { grid-template-columns: repeat(4, 1fr); }
  .db-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
  .db-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.empty { padding: 34px 20px; text-align: center; }
.empty svg { width: 44px; height: 44px; stroke: var(--ink-2); opacity: 0.35; margin: 0 auto 10px; fill: none; }
.empty b { display: block; font-size: 15px; color: #cbd5e1; font-weight: 600; }
html[data-theme="light"] .empty b { color: #334155; }
.empty span { font-size: 13px; color: var(--ink-3); }

/* ---------- Поля и кнопки ---------- */

.field { margin-bottom: 14px; min-width: 0; }
.field-date .input { display: block; min-width: 0; max-width: 100%; }
.field-date .input::-webkit-date-and-time-value { min-width: 0; text-align: left; }
.field-label { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 6px; }
.input, .textarea, .select {
  width: 100%; border-radius: 14px; border: 1px solid var(--field-border); background: var(--field-bg);
  padding: 12px 14px; outline: none; color: var(--ink);
  transition: border-color 0.15s var(--tab-ease), box-shadow 0.15s var(--tab-ease);
}
.textarea { min-height: 110px; resize: vertical; }
.input:focus, .textarea:focus, .select:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.16); }
.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='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 14px; font-weight: 650; font-size: 14.5px; line-height: 1.2;
  background: var(--field-bg); border: 1px solid var(--field-border); color: var(--ink-strong);
  transition: transform 0.12s var(--tab-ease), border-color 0.15s, filter 0.15s;
}
.btn > svg { width: 18px; height: 18px; flex: none; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: linear-gradient(180deg, #6366f1, #4f46e5); border: 0; color: #fff; box-shadow: 0 14px 30px -14px rgba(99, 102, 241, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.18); }
.btn-danger { background: rgba(239, 68, 68, 0.10); border-color: rgba(239, 68, 68, 0.3); color: #fca5a5; }
html[data-theme="light"] .btn-danger { color: #b91c1c; }
.btn-block { width: 100%; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn[disabled] { opacity: 0.55; pointer-events: none; }
.actions-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- iOS-настройки ---------- */

.ios-group { background: var(--ios-card); border: 1px solid var(--ios-card-edge); border-radius: 26px; margin-bottom: 20px; overflow: hidden; }
.ios-group-title { font-size: 11.5px; font-weight: 700; letter-spacing: 0.055em; text-transform: uppercase; color: var(--ios-ink-2); padding: 0 17px 8px; }
.ios-row { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 10px 16px; position: relative; width: 100%; text-align: left; font-size: 16px; font-weight: 450; color: var(--ios-ink); }
.ios-row + .ios-row::before { content: ""; position: absolute; top: 0; left: 56px; right: 16px; height: 1px; background: var(--ios-sep); }
.ios-row:active { background: var(--ios-row-hover); }
.ios-row-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: #fff; flex: none; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22); }
.ios-row-icon svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; fill: none; }
.ios-row-icon[data-tint="indigo"] { background: linear-gradient(150deg, #818cf8, #4f46e5); }
.ios-row-icon[data-tint="sky"] { background: linear-gradient(150deg, #38bdf8, #0284c7); }
.ios-row-icon[data-tint="green"] { background: linear-gradient(150deg, #34d399, #059669); }
.ios-row-icon[data-tint="amber"] { background: linear-gradient(150deg, #fbbf24, #d97706); }
.ios-row-icon[data-tint="gray"] { background: linear-gradient(150deg, #98a2b3, #64748b); }
.ios-row-icon[data-tint="rose"] { background: linear-gradient(150deg, #fb7185, #e11d48); }
.ios-row-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ios-row-value { color: var(--ios-ink-2); font-size: 15px; max-width: 46%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; font-variant-numeric: tabular-nums; }
.worker-update .ios-row-title { color: var(--ios-accent); }
.worker-update[disabled] { opacity: .55; pointer-events: none; }
.ios-detail-root { max-width: 620px; }
.ios-title { font-size: 30px; font-weight: 700; letter-spacing: -0.022em; color: var(--ink-strong); margin: 4px 0 16px; }
.ios-back { display: inline-flex; align-items: center; gap: 2px; color: var(--ios-accent); font-size: 16px; padding: 6px 10px 6px 2px; margin-bottom: 6px; border-radius: 999px; }
.ios-back svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2.4; fill: none; }
.ios-detail { animation: ios-push 0.3s var(--ios-ease) both; }
@keyframes ios-push { from { opacity: 0.2; transform: translateX(16px); } }
.ios-stack-pop { animation: ios-pop 0.3s var(--ios-ease) both; }
@keyframes ios-pop { from { opacity: 0.2; transform: translateX(-14px); } }
.ios-field { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.ios-field + .ios-field { border-top: 1px solid var(--ios-sep); }
.ios-field-label { font-size: 16px; color: var(--ios-ink); }
.ios-field .input, .ios-field .select { width: 160px; text-align: right; min-height: 34px; padding: 6px 10px; border-radius: 10px; font-size: 15px; }
.ios-field--stack { flex-direction: column; align-items: stretch; }

.push-switch { position: relative; width: 44px; height: 26px; border-radius: 13px; background: var(--push-off); flex: none; transition: background 0.22s var(--tab-ease); }
.push-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(2, 6, 23, 0.35); transition: transform 0.22s var(--tab-ease); }
.push-switch.on { background: var(--push-on); }
.push-switch.on::after { transform: translateX(18px); }

.theme-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 16px; background: var(--field-bg); border: 1px solid var(--field-border); }
.theme-check { margin-left: auto; color: var(--ios-accent); display: flex; }
.theme-check svg { width: 19px; height: 19px; stroke: currentColor; stroke-width: 2.4; fill: none; }
.theme-seg-item { border-radius: 12px; padding: 9px 4px; font-size: 13px; font-weight: 600; color: #94a3b8; display: flex; align-items: center; justify-content: center; gap: 6px; }
.theme-seg-item svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 1.9; fill: none; }
.theme-seg-item.active { background: rgba(99, 102, 241, 0.16); color: #c7d2fe; box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.32); }
html[data-theme="light"] .theme-seg-item.active { background: rgba(79, 70, 229, 0.10); color: #4338ca; box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.25); }

/* ---------- Ответы / запросы ---------- */

.q-block { border-left: 3px solid rgba(99, 102, 241, 0.45); padding: 8px 12px; margin: 10px 16px 4px; border-radius: 0 12px 12px 0; background: rgba(99, 102, 241, 0.07); }
.q-block .kicker { margin-bottom: 2px; }
.q-text, .a-text { font-size: 14px; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.a-text { margin: 10px 16px; }
.answer-meta { display: flex; align-items: center; gap: 8px; padding: 0 16px 12px; flex-wrap: wrap; }
.answer-card { padding-top: 4px; }

.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 14px; }
.photo-grid .ph { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--field-bg); border: 1px solid var(--field-border); }
.photo-grid .ph img { width: 100%; height: 100%; object-fit: cover; }
.photo-grid .ph-del { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; background: rgba(2, 4, 10, 0.55); color: #fff; display: grid; place-items: center; backdrop-filter: blur(6px); }
.photo-grid .ph-del svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; }
@media (min-width: 1024px) { .photo-grid { grid-template-columns: repeat(6, 1fr); } }

/* ---------- Календарь ---------- */

.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-head b { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink-strong); text-transform: capitalize; }
.cal-nav { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--field-bg); border: 1px solid var(--field-border); color: var(--ink-2); }
.cal-nav svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: 2; fill: none; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-wday { font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-3); text-align: center; padding-bottom: 3px; }
.cal-day { position: relative; border-radius: 11px; min-height: 44px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 13.5px; color: var(--ink); border: 1px solid transparent; font-variant-numeric: tabular-nums; }
.cal-day:hover { background: var(--hover); }
.cal-day.empty { visibility: hidden; }
.cal-day.today { border-color: rgba(99, 102, 241, 0.5); color: var(--ink-strong); font-weight: 700; }
.cal-day.sel { background: rgba(99, 102, 241, 0.16); border-color: rgba(99, 102, 241, 0.45); color: var(--ink-strong); font-weight: 700; }
.cal-dot { display: flex; gap: 3px; height: 5px; margin-top: 2px; }
.cal-dot i { width: 5px; height: 5px; border-radius: 50%; background: var(--ios-tint-users); }
.cal-dot i.pub { background: var(--ios-tint-plan); }

/* ---------- Модалки ---------- */

.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; background: var(--modal-backdrop); backdrop-filter: blur(7px); animation: fade 0.18s ease-out; }
@keyframes fade { from { opacity: 0; } }
.modal-box {
  width: calc(100% - 24px); max-width: 440px; max-height: 88dvh; overflow: auto;
  background: var(--modal-bg); border: 1px solid var(--plate-border); border-radius: 24px 24px 0 0;
  padding: 20px 20px calc(20px + var(--safe-b)); animation: sheet 0.3s var(--ios-ease);
  box-shadow: 0 30px 60px -22px rgba(0, 0, 0, 0.8);
}
html[data-theme="light"] .modal-box { box-shadow: 0 30px 60px -26px rgba(15, 23, 42, 0.4); }
@keyframes sheet { from { transform: translateY(40px); opacity: 0.4; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-title { font-size: 18px; font-weight: 750; letter-spacing: -0.02em; color: var(--ink-strong); }
.modal-x { width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; background: var(--field-bg); border: 1px solid var(--field-border); color: var(--ink-2); }
.modal-x svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 2.2; fill: none; }
.modal-actions { display: flex; flex-direction: column-reverse; gap: 10px; margin-top: 16px; }
.modal-actions .btn { width: 100%; }
@media (min-width: 1024px) {
  .modal { align-items: center; }
  .modal-box { border-radius: 20px; padding: 24px; }
  .modal-actions { flex-direction: row; justify-content: flex-end; }
  .modal-actions .btn { width: auto; }
}

.seg-list { display: flex; flex-direction: column; gap: 10px; }
.seg-option { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 16px; border: 1px solid var(--field-border); background: var(--field-bg); text-align: left; width: 100%; }
.seg-option.active { border-color: rgba(99, 102, 241, 0.55); background: rgba(99, 102, 241, 0.10); }
.seg-option b { font-size: 14.5px; font-weight: 650; color: var(--ink-strong); display: block; }
.seg-option span { font-size: 12.5px; color: var(--ink-2); }
.seg-radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--field-border); flex: none; margin-top: 2px; display: grid; place-items: center; }
.seg-option.active .seg-radio { border-color: var(--primary); }
.seg-option.active .seg-radio::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); }

/* ---------- Тосты ---------- */

.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--dock-total) + 10px); z-index: 80; display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100% - 32px)); pointer-events: none; }
@media (min-width: 1024px) { .toasts { bottom: 24px; } }
.toast {
  border-radius: 16px; padding: 11px 16px; font-size: 13.5px; font-weight: 550; text-align: center;
  background: rgba(28, 32, 41, 0.95); color: #e2e8f0; border: 1px solid rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(14px); box-shadow: 0 14px 28px -14px rgba(0, 0, 0, 0.8);
  animation: toast-in 0.25s var(--tab-ease);
}
html[data-theme="light"] .toast { background: rgba(255, 255, 255, 0.95); color: #10192e; border-color: rgba(15, 23, 42, 0.08); }
.toast.err { color: #fca5a5; }
html[data-theme="light"] .toast.err { color: #b91c1c; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.load-more { display: flex; justify-content: center; padding: 6px 0 2px; }
.audit-pager { align-items: center; flex-wrap: wrap; gap: 10px; padding-top: 12px; }
.audit-page { color: var(--ink-2); font-size: 13px; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--field-border); border-top-color: var(--primary); animation: spin 0.8s linear infinite; margin: 24px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

.search-wrap { position: relative; margin-bottom: 14px; }
.search-wrap svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; stroke: var(--ink-3); fill: none; stroke-width: 2; }
.search-wrap .input { padding-left: 38px; border-radius: 16px; background: #1e212be8; backdrop-filter: blur(18px); box-shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.55); }
html[data-theme="light"] .search-wrap .input { background: #fff; box-shadow: 0 8px 24px -16px rgba(15, 23, 42, 0.35); }

/* ---------- Вход по ключу ---------- */
.login-separator { display: flex; align-items: center; gap: 12px; margin: 20px 0 14px; color: var(--ink-3); font-size: 12px; }
.login-separator::before, .login-separator::after { content: ""; height: 1px; flex: 1; background: var(--sep); }
.login-passkey {
  width: 100%; min-height: 50px; border-radius: 15px; display: flex; align-items: center; justify-content: center; gap: 10px;
  background: rgba(99, 102, 241, 0.10); border: 1px solid rgba(99, 102, 241, 0.28); color: var(--ink-strong); font-weight: 650;
}
.login-passkey svg { width: 22px; height: 22px; }
.login-passkey:active { background: rgba(99, 102, 241, 0.18); }
.login-passkey[disabled] { opacity: .55; }
[hidden] { display: none !important; }

/* ---------- Статистика ---------- */
.settings-column { max-width: 820px; }
.st-period { display: flex; gap: 6px; padding: 5px; width: fit-content; max-width: 100%; border-radius: 16px; border: 1px solid var(--plate-border); background: var(--plate); margin-bottom: 18px; }
.st-chip { min-height: 40px; padding: 0 16px; border-radius: 12px; font-size: 14px; font-weight: 650; color: var(--ios-ink-2); }
.st-chip.active { background: var(--ios-accent); color: #fff; }
.st-range { font-size: 12.5px; color: var(--ios-ink-2); margin: 0 2px 14px; }
.st-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.st-kpi { min-width: 0; border: 1px solid var(--plate-border); border-radius: 22px; background: var(--plate); padding: 17px; }
.st-kpi-value { font-size: 25px; line-height: 1.1; font-weight: 800; letter-spacing: -.025em; color: var(--ink-strong); font-variant-numeric: tabular-nums; }
.st-kpi-label { margin-top: 7px; font-size: 12.5px; color: var(--ios-ink-2); }
.st-delta { display: flex; align-items: center; gap: 4px; margin-top: 8px; min-height: 16px; font-size: 10.5px; line-height: 1.35; color: var(--ios-ink-2); }
.st-delta.up { color: var(--ios-tint-plan); }
.st-delta.down { color: var(--ios-tint-danger); }
.st-delta-arrow { font-size: 13px; }
.st-spark { height: 30px; margin-top: 8px; }
.st-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.st-card { min-width: 0; border: 1px solid var(--plate-border); border-radius: 22px; background: var(--plate); padding: 20px; }
.st-card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.st-card-title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; font-weight: 700; color: var(--ink-strong); }
.st-card-title svg { width: 18px; height: 18px; stroke: var(--ios-accent); stroke-width: 2; fill: none; }
.st-badge { padding: 4px 9px; border-radius: 999px; background: rgba(99, 102, 241, .11); border: 1px solid rgba(99, 102, 241, .20); color: var(--ios-accent); font-size: 10.5px; font-weight: 650; }
.st-legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 11px; color: var(--ios-ink-2); }
.st-legend span { display: inline-flex; align-items: center; gap: 5px; }
.st-legend i { width: 8px; height: 8px; border-radius: 3px; }
.st-chart { min-width: 0; min-height: 60px; }
.st-split { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: center; }
.st-donut { min-width: 150px; }
.st-split-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.st-split-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; align-items: baseline; }
.st-split-name { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12px; color: var(--ios-ink-2); }
.st-split-name i { width: 8px; height: 8px; border-radius: 3px; flex: none; }
.st-split-val { font-size: 13px; font-weight: 750; color: var(--ink-strong); }
.st-split-sub { grid-column: 1 / -1; font-size: 10.5px; color: var(--ios-ink-2); }
.st-ops { margin-top: 16px; }
.st-ops > b { display: block; font-size: 14px; color: var(--ink-strong); margin-bottom: 12px; }
.st-ops > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--sep); font-size: 13px; color: var(--ios-ink-2); }
.st-ops strong { color: var(--ink-strong); font-variant-numeric: tabular-nums; }

.chart-svg { display: block; overflow: visible; }
.chart-grid { stroke: var(--ios-sep); stroke-width: 1; }
.chart-axis-x, .chart-axis-y, .chart-donut-label, .chart-empty-text { font-size: 11px; fill: var(--ios-ink-2); font-weight: 500; }
.chart-donut-value { font-size: 19px; font-weight: 800; fill: var(--ink-strong); letter-spacing: -.02em; }
.chart-bar { opacity: .92; }
.chart-dot { fill: var(--ios-card); stroke-width: 2; }
.chart-crosshair { stroke: var(--ios-accent); stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
.chart-empty { margin: 0; padding: 20px 0; text-align: center; font-size: 12.5px; color: var(--ios-ink-2); }
.chart-empty-text { font-size: 12px; }
.chart-seg { transition: stroke-width .15s ease; }
.chart-seg:hover { stroke-width: 19; }
.chart-tip { position: fixed; z-index: 90; pointer-events: none; opacity: 0; padding: 9px 11px; border-radius: 13px; border: 1px solid var(--plate-border); background: var(--ios-card); box-shadow: 0 16px 34px -16px rgba(0, 0, 0, .55); font-size: 12px; line-height: 1.45; color: var(--ink-strong); white-space: nowrap; }
.chart-tip-day { display: block; font-weight: 750; margin-bottom: 4px; }
.chart-tip-row { display: flex; align-items: center; gap: 6px; color: var(--ios-ink-2); }
.chart-tip-row i { width: 8px; height: 8px; border-radius: 3px; flex: none; }
.chart-tip-row b { color: var(--ink-strong); }
.hbars { display: flex; flex-direction: column; gap: 13px; padding-top: 5px; }
.hbar { display: grid; grid-template-columns: minmax(72px, 34%) minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.hbar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 600; color: var(--ios-ink-2); }
.hbar-track { height: 8px; border-radius: 999px; background: var(--ios-sep); overflow: hidden; }
.hbar-track i { display: block; height: 100%; border-radius: 999px; }
.hbar-value { font-size: 13px; font-weight: 750; color: var(--ink-strong); }
.pk-item .row-main { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }

@media (min-width: 1024px) {
  .st-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .st-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-full { grid-column: 1 / -1; }
  .input, .textarea, .select { min-height: 44px; }
  .ios-row .input { min-height: 44px; }
  .settings-column { margin: 0 auto; }
}
@media (min-width: 1200px) {
  .st-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .st-kpi { padding: 18px 16px; }
}
@media (max-width: 420px) {
  .st-card { padding: 16px; }
  .st-split { grid-template-columns: 1fr; justify-items: center; }
  .st-split-list { width: 100%; }
  .st-kpi { padding: 15px; }
  .st-kpi-value { font-size: 23px; }
}

@media (max-width: 1023px) {
  input, textarea, select { font-size: 16px !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
