:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --faint: #94a3b8;
  --border: #e2e8f0;
  --primary: #0d9488;
  --primary-strong: #0f766e;
  --primary-soft: #ccfbf1;
  --accent: #6366f1;
  --danger: #e11d48;
  --danger-soft: #ffe4e6;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --ok: #047857;
  --ok-soft: #d1fae5;
  --info: #0369a1;
  --info-soft: #e0f2fe;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 12px 32px -16px rgba(15, 23, 42, 0.18);
  --radius: 16px;
  --radius-sm: 11px;
  --sidebar-w: 248px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1120;
    --surface: #111a2b;
    --surface-2: #162033;
    --text: #e6edf6;
    --muted: #93a3b8;
    --faint: #6b7c93;
    --border: #223047;
    --primary: #2dd4bf;
    --primary-strong: #5eead4;
    --primary-soft: #113c39;
    --accent: #818cf8;
    --danger: #fb7185;
    --danger-soft: #3b1220;
    --warn: #fbbf24;
    --warn-soft: #3a2a08;
    --ok: #34d399;
    --ok-soft: #0d3327;
    --info: #60a5fa;
    --info-soft: #0d2740;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 40px -20px rgba(0, 0, 0, 0.6);
  }
}

/* Ручной выбор темы перекрывает системную */
html[data-theme="dark"] {
  --bg: #0a1120;
  --surface: #111a2b;
  --surface-2: #162033;
  --text: #e6edf6;
  --muted: #93a3b8;
  --faint: #6b7c93;
  --border: #223047;
  --primary: #2dd4bf;
  --primary-strong: #5eead4;
  --primary-soft: #113c39;
  --accent: #818cf8;
  --danger: #fb7185;
  --danger-soft: #3b1220;
  --warn: #fbbf24;
  --warn-soft: #3a2a08;
  --ok: #34d399;
  --ok-soft: #0d3327;
  --info: #60a5fa;
  --info-soft: #0d2740;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 40px -20px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body { min-height: 100dvh; }

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 24px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { margin: 0; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

.boot {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Каркас ---------- */
.app-shell { min-height: 100dvh; }

.sidebar {
  display: none;
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  flex-direction: column;
  gap: 6px;
  z-index: 30;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 18px;
}
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 18px;
  box-shadow: var(--shadow-sm);
  flex: none;
}
.brand-name { font-weight: 700; font-size: 15px; line-height: 1.15; }
.brand-sub { font-size: 11.5px; color: var(--muted); }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-group { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); padding: 16px 12px 6px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-weight: 500;
  font-size: 14.5px;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
}
.nav-item svg { width: 19px; height: 19px; flex: none; }
.nav-item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--primary-soft); color: var(--primary-strong); font-weight: 600; }
.nav-item .nav-count {
  margin-left: auto;
  font-size: 11px;
  background: var(--danger);
  color: #fff;
  border-radius: 20px;
  padding: 1px 7px;
}

.sidebar-foot {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-foot .who { flex: 1; min-width: 0; }
.sidebar-foot .who-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-foot .who-role { font-size: 11.5px; color: var(--muted); }

.main {
  padding: 14px 14px calc(84px + env(safe-area-inset-bottom));
  max-width: 1180px;
  margin: 0 auto;
  min-width: 0;
}

@media (min-width: 920px) {
  .app-shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .sidebar { display: flex; }
  /* сайдбар fixed и выпадает из сетки — контент ставим во вторую колонку вручную */
  .main { grid-column: 2; padding: 26px 30px 60px; width: 100%; }
  .tabbar { display: none !important; }
}

/* ---------- Нижняя навигация ---------- */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  z-index: 25;
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 5px 2px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 500;
  border-radius: 10px;
}
.tab svg { width: 21px; height: 21px; }
.tab.active { color: var(--primary-strong); }
.tab.active svg { stroke-width: 2.2; }

/* ---------- Страница ---------- */
.page { display: flex; flex-direction: column; gap: 14px; animation: fade 0.18s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.page-head .grow { flex: 1; min-width: 160px; }
.page-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 9px 14px;
  font-size: 14px;
  font-weight: 600;
  background: var(--surface);
  color: var(--text);
  transition: transform 0.06s ease, filter 0.15s ease, background 0.15s;
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-soft { background: var(--primary-soft); color: var(--primary-strong); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger-solid { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 10px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn-icon-only { padding: 9px; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 19px; height: 19px; }

/* ---------- Карточки ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 16px; }
.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.card-head h3 { font-size: 15px; }
.card-head .spacer { flex: 1; }
.card-body { padding: 14px 16px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 640px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { gap: 8px; }
}

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
  overflow: hidden;
}
.kpi-icon {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary-strong);
}
.kpi-icon svg { width: 16px; height: 16px; }
.kpi-label { font-size: 12px; color: var(--muted); padding-right: 34px; }
.kpi-value { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin-top: 3px; }
.kpi-hint { font-size: 11.5px; color: var(--faint); }
.kpi-hint.up { color: var(--ok); }
.kpi-hint.down { color: var(--danger); }

/* ---------- Списки ---------- */
.list { display: flex; flex-direction: column; }
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: none;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  text-align: left;
  width: 100%;
  color: inherit;
}
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--surface-2); text-decoration: none; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 600; font-size: 14.5px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.row-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; display: flex; gap: 10px; flex-wrap: wrap; }
.row-side { text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.row-chevron { color: var(--faint); flex: none; }
.row-chevron svg { width: 18px; height: 18px; }

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  flex: none;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  letter-spacing: 0.02em;
}
.avatar-sm { width: 32px; height: 32px; border-radius: 10px; font-size: 12px; }
.avatar-lg { width: 62px; height: 62px; border-radius: 18px; font-size: 21px; }

/* ---------- Бейджи ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-muted { background: var(--surface-2); color: var(--muted); }

/* ---------- Формы ---------- */
.form-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 560px) { .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .form-grid .col-2 { grid-column: 1 / -1; } }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.field .hint { font-size: 11.5px; color: var(--faint); }

.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 11px;
  padding: 10px 12px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  color: var(--text);
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}
.input::placeholder { color: var(--faint); }
.textarea { resize: vertical; min-height: 72px; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 32px; }

.search { position: relative; flex: 1; min-width: 180px; }
.search input { padding-left: 38px; }
.search .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search .search-icon svg { width: 18px; height: 18px; }

.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- Таблицы ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.table th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--faint);
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.table tr:last-child td { border-bottom: 0; }
table.table tr:hover td { background: var(--surface-2); }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Вкладки ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
@media (max-width: 560px) {
  /* На телефоне вкладки переносим, иначе последняя обрезается */
  .tabs { flex-wrap: wrap; overflow-x: visible; row-gap: 0; }
  .tab-btn { padding: 10px 9px; font-size: 13.5px; }
}
.tab-btn {
  border: 0;
  background: none;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tab-btn.active { color: var(--primary-strong); border-bottom-color: var(--primary); }

/* ---------- Пустое состояние ---------- */
.empty { padding: 34px 20px; text-align: center; color: var(--muted); }
.empty .empty-icon {
  width: 52px; height: 52px; margin: 0 auto 10px; border-radius: 16px;
  background: var(--surface-2); display: grid; place-items: center; color: var(--faint);
}
.empty .empty-icon svg { width: 26px; height: 26px; }
.empty-title { font-weight: 600; color: var(--text); margin-bottom: 3px; }
.empty-sub { font-size: 13px; }

/* ---------- Модальные окна ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 15, 30, 0.5);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 60;
  animation: fade 0.15s ease-out;
}
@media (min-width: 700px) { .modal-overlay { align-items: center; padding: 20px; } }

.modal {
  background: var(--surface);
  width: 100%;
  max-width: 520px;
  max-height: 92dvh;
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -10px 60px rgba(0, 0, 0, 0.3);
  animation: slideup 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes slideup { from { transform: translateY(24px); opacity: 0.6; } to { transform: none; opacity: 1; } }
@media (min-width: 700px) {
  .modal { border-radius: 18px; max-width: 560px; animation: fade 0.15s ease-out; }
  .modal-wide { max-width: 760px; }
}
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 10px; }
.modal-head h3 { flex: 1; font-size: 17px; }
.modal-body { padding: 4px 18px 16px; overflow-y: auto; }
.modal-foot { padding: 12px 18px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.modal-foot .btn { flex: 1; }
@media (min-width: 560px) { .modal-foot .btn { flex: 0 0 auto; } }

/* ---------- Тосты ---------- */
.toast-root { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(78px + env(safe-area-inset-bottom)); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(92vw, 420px); }
@media (min-width: 920px) { .toast-root { bottom: 24px; } }
.toast {
  background: #0f172a;
  color: #f8fafc;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  animation: toastin 0.18s ease-out;
  max-width: 100%;
}
.toast-error { background: #9f1239; }
.toast-ok { background: #065f46; }
@keyframes toastin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- График ---------- */
.chart { width: 100%; overflow: visible; }
.chart text { fill: var(--faint); font-size: 10px; }

/* ---------- Расписание ---------- */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.day {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 12px;
  padding: 7px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  color: var(--muted);
}
.day-name { font-size: 10.5px; text-transform: capitalize; }
.day-num { font-size: 16px; font-weight: 700; color: var(--text); }
.day.active { background: var(--primary); border-color: var(--primary); }
.day.active .day-name, .day.active .day-num { color: #fff; }
.day.today .day-num { color: var(--primary-strong); }
.day.active.today .day-num { color: #fff; }

.class-card { display: flex; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.class-card:last-child { border-bottom: 0; }
.class-time { font-weight: 700; font-size: 14px; width: 46px; flex: none; font-variant-numeric: tabular-nums; }
.class-time small { display: block; font-weight: 500; font-size: 11px; color: var(--faint); }
.class-info { flex: 1; min-width: 0; }
.class-title { font-weight: 600; }
.class-meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.bookings { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.booking {
  font-size: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px 8px;
  color: var(--muted);
}
.booking.attended { background: var(--ok-soft); color: var(--ok); border-color: transparent; }

/* ---------- Прочее ---------- */
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.mono { font-variant-numeric: tabular-nums; }
.divider { height: 1px; background: var(--border); margin: 4px 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row-flex { display: flex; align-items: center; gap: 8px; }
.spacer { flex: 1; }
.nowrap { white-space: nowrap; }

.hero {
  border-radius: var(--radius);
  padding: 18px;
  color: #fff;
  background: linear-gradient(135deg, #0f766e 0%, #0d9488 45%, #4f46e5 130%);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -70px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}
.hero h2 { font-size: 19px; }
.hero p { opacity: 0.85; font-size: 13px; margin-top: 3px; }

.fab {
  position: fixed;
  right: 16px;
  bottom: calc(84px + env(safe-area-inset-bottom));
  width: 54px;
  height: 54px;
  border-radius: 18px;
  border: 0;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 24px -6px rgba(13, 148, 136, 0.55);
  z-index: 20;
}
.fab svg { width: 24px; height: 24px; }
@media (min-width: 920px) { .fab { right: 28px; bottom: 28px; } }

.progress { height: 6px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--primary); border-radius: 6px; }

.note { font-size: 13px; background: var(--surface-2); border-left: 3px solid var(--border); padding: 8px 10px; border-radius: 6px; color: var(--muted); white-space: pre-wrap; }

.banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 12px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 13.5px;
  font-weight: 500;
}
.banner .btn { margin-left: auto; }

.login-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 20px; background:
  radial-gradient(900px 500px at 15% -10%, color-mix(in srgb, var(--primary) 18%, transparent), transparent),
  radial-gradient(700px 400px at 100% 100%, color-mix(in srgb, var(--accent) 16%, transparent), transparent); }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 26px; box-shadow: var(--shadow); }
.login-logo { width: 56px; height: 56px; border-radius: 18px; background: linear-gradient(135deg, var(--primary), var(--accent)); display: grid; place-items: center; color: #fff; margin-bottom: 14px; box-shadow: var(--shadow); }
.login-logo svg { width: 30px; height: 30px; }
.login-card h1 { font-size: 21px; }
.login-card .sub { color: var(--muted); font-size: 13px; margin: 3px 0 18px; }
.login-err { color: var(--danger); font-size: 13px; min-height: 18px; margin-top: 4px; }
.login-hint { margin-top: 16px; font-size: 12px; color: var(--faint); text-align: center; }

.dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: 14px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }

@media (max-width: 520px) {
  .hide-sm { display: none !important; }
}

.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.photo-cell {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-2);
  border: 0;
  padding: 0;
}
.photo-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-cell .pick {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  accent-color: var(--primary);
}
.photo-date {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px 8px 5px;
  font-size: 10.5px;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
}
.photo-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.photo-compare figure { margin: 0; }
.photo-compare img { width: 100%; border-radius: 12px; display: block; }
.photo-compare figcaption { text-align: center; font-size: 12px; color: var(--muted); margin-top: 6px; }

/* Кабинет клиента: всегда мобильная компоновка, без сайдбара */
.app-shell.is-client { display: block; }
.app-shell.is-client .main {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 14px calc(88px + env(safe-area-inset-bottom));
}
@media (min-width: 920px) {
  .app-shell.is-client .main { padding: 26px 24px 60px; }
  .app-shell.is-client .tabbar { display: grid !important; }
}

/* ---------- График (столбики) ---------- */
.bars { display: flex; align-items: flex-end; gap: 4px; width: 100%; }
.bar-col { flex: 1; height: 100%; display: flex; align-items: flex-end; min-width: 0; }
.bar {
  width: 100%;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, var(--primary), color-mix(in srgb, var(--primary) 55%, var(--accent)));
  min-height: 2px;
  transition: filter 0.15s;
}
.bar-empty { background: var(--border); }
.bar-col:hover .bar { filter: brightness(1.12); }
.bars-x { display: flex; justify-content: space-between; font-size: 11px; color: var(--faint); margin-top: 8px; }

.brand-mark svg { width: 21px; height: 21px; }
.avatar svg { width: 17px; height: 17px; }
.empty-icon svg { width: 26px; height: 26px; }
.row > svg { width: 18px; height: 18px; color: var(--faint); flex: none; }

