/* ============================================================
   Kings Clinic CRM — дизайн-система
   Бренд: дентал-блю / навы / чистый белый · корона · premium
   (клинические цвета статусов зубов — по мед.стандарту, не бренд)
   ============================================================ */

:root {
  /* Чернила / текст (прохладный слейт) */
  --ink:        #142a35;
  --ink-2:      #43555f;
  --ink-3:      #7b8b94;
  --ink-inv:    #eaf4fa;

  /* Поверхности (чистые, медицинские) */
  --paper:      #eef4f8;   /* фон приложения (прохладный) */
  --surface:    #ffffff;   /* панели, таблицы */
  --surface-2:  #f3f8fb;   /* вложенные блоки */
  --black:      #0e3a4e;   /* сайдбар — дентал-навы */
  --black-2:    #12475d;

  /* Бренд-акцент (дентал-блю; имена --gold* сохранены для совместимости) */
  --gold:       #1786b5;   /* текст-безопасный дентал-блю */
  --gold-bright:#3bb4e2;   /* яркий голубой (декор/тёмный фон) */
  --gold-soft:  #dceff8;   /* голубая подложка */
  --gold-line:  #a9dcef;

  /* Линии */
  --line:       #dde8ee;
  --line-soft:  #eef4f7;
  --line-strong:#c2d3dd;

  /* Статусы (валидировано для ivory-фона) */
  --c-gold:  #9c7420;
  --c-blue:  #3f6fb5;
  --c-green: #4f9d5f;
  --c-red:   #c0442e;
  --c-purple:#6d4b9e;
  --c-teal:  #0b93ad;
  --ok:      #2f7d46;
  --warn:    #b8860b;
  --danger:  #c0442e;

  /* Прочее */
  --radius:   10px;
  --radius-s: 7px;
  --shadow:   0 1px 2px rgba(16,40,52,.05), 0 8px 24px -12px rgba(16,40,52,.16);
  --shadow-lg:0 24px 60px -20px rgba(16,40,52,.38);
  --serif: "Lora", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1,h2,h3,h4 { font-family: var(--serif); font-weight: 600; letter-spacing: -.005em; color: var(--ink); }
a { color: var(--gold); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--gold-soft); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #c6d5de; border-radius: 8px; border: 3px solid var(--paper); }
::-webkit-scrollbar-thumb:hover { background: #a9bfca; }

/* ============================================================ LAYOUT */
.app { display: grid; grid-template-columns: 248px 1fr; height: 100vh; overflow: hidden; }

.sidebar {
  background: var(--black);
  color: var(--ink-inv);
  display: flex; flex-direction: column;
  border-right: 1px solid #000;
  position: relative;
}
.sidebar::after { /* золотая нить у правого края */
  content:""; position:absolute; top:0; right:0; bottom:0; width:1px;
  background: linear-gradient(180deg, transparent, var(--gold-line) 20%, var(--gold-line) 80%, transparent);
  opacity:.35;
}
.brand { padding: 22px 22px 18px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid rgba(59,180,226,.14); }
.brand .crown { width: 40px; height: 40px; flex: 0 0 auto; }
.brand .wm { line-height: 1.05; }
.brand .wm b {
  font-family: var(--serif); font-size: 19px; font-weight: 700; letter-spacing: .04em;
  color: #f6efdd; display:block;
}
.brand .wm span { font-size: 9.5px; letter-spacing: .26em; text-transform: uppercase; color: var(--gold-bright); }

.nav { flex: 1; overflow-y: auto; padding: 12px 12px 20px; }
.nav-group { margin-top: 14px; }
.nav-group > .lbl { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: #6b6250; padding: 8px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 8px;
  color: #cabfa6; font-size: 13.5px; font-weight: 500; margin-bottom: 1px; position: relative;
  transition: background .12s, color .12s;
}
.nav a svg { width: 18px; height: 18px; flex: 0 0 auto; opacity: .85; }
.nav a:hover { background: rgba(59,180,226,.08); color: #f0e7d0; }
.nav a.active { background: linear-gradient(90deg, rgba(59,180,226,.18), rgba(59,180,226,.04)); color: #fbf3dd; }
.nav a.active::before { content:""; position:absolute; left:0; top:7px; bottom:7px; width:3px; background: var(--gold-bright); border-radius: 0 3px 3px 0; }
.nav a .count { margin-left: auto; font-size: 11px; background: rgba(59,180,226,.18); color: var(--gold-bright); padding: 1px 7px; border-radius: 10px; font-variant-numeric: tabular-nums; }

.sidebar .me { padding: 12px 16px; border-top: 1px solid rgba(59,180,226,.14); display: flex; align-items: center; gap: 10px; }
.sidebar .me .av { width: 34px; height: 34px; border-radius: 50%; background: var(--gold-soft); color: var(--black); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.sidebar .me .info b { display: block; font-size: 13px; color: #f0e7d0; font-weight: 600; }
.sidebar .me .info span { font-size: 11px; color: #837a66; }

.main { display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  height: 60px; flex: 0 0 auto; background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px; padding: 0 24px;
}
.topbar .search { flex: 1; max-width: 460px; position: relative; }
.topbar .search input {
  width: 100%; height: 38px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface-2);
  padding: 0 16px 0 40px; font-size: 13.5px; color: var(--ink); outline: none; transition: border-color .12s, box-shadow .12s;
}
.topbar .search input:focus { border-color: var(--gold-line); box-shadow: 0 0 0 3px rgba(59,180,226,.12); background: var(--surface); }
.topbar .search svg { position: absolute; left: 14px; top: 10px; width: 18px; height: 18px; color: var(--ink-3); }
.topbar .spacer { flex: 1; }
.topbar .icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; color: var(--ink-2); position: relative; }
.topbar .icon-btn:hover { border-color: var(--gold-line); color: var(--gold); }
.topbar .icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); border: 2px solid var(--surface); }

.content { flex: 1; overflow-y: auto; }
.page { padding: 26px 28px 60px; max-width: 1500px; }

/* ============================================================ PAGE HEADER (editorial) */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.page-head .eyebrow { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); font-weight: 600; margin-bottom: 5px; }
.page-head h1 { font-size: 30px; line-height: 1.05; }
.page-head p.sub { color: var(--ink-3); font-size: 13.5px; margin-top: 6px; max-width: 620px; }
.page-head .actions { display: flex; gap: 10px; align-items: center; }

/* ============================================================ BUTTONS */
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 9px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-size: 13.5px; font-weight: 600;
  transition: all .12s; white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { border-color: var(--ink-3); background: var(--surface-2); }
.btn.primary { background: linear-gradient(180deg, #2a9fca, #1786b5); color: #fff; border-color: #12719a; box-shadow: 0 2px 8px -2px rgba(23,134,181,.5); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.dark { background: var(--black); color: var(--ink-inv); border-color: #000; }
.btn.dark:hover { background: var(--black-2); }
.btn.danger { color: var(--danger); border-color: #e3b8b0; background: #fdf6f4; }
.btn.danger:hover { background: #fbeae6; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--line); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 12.5px; }
.btn.icon { width: 38px; padding: 0; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ============================================================ CARDS / PANELS (rules, not heavy shadow) */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel.pad { padding: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-head h3 { font-size: 16px; }
.panel-head .tools { display: flex; gap: 8px; align-items: center; }
.grid { display: grid; gap: 18px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
}
.card:hover { border-color: var(--line-strong); }

/* editorial section label */
.sec-label { font-family: var(--serif); font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); display: flex; align-items: center; gap: 12px; margin: 26px 0 14px; }
.sec-label::after { content:""; flex:1; height:1px; background: var(--line); }

/* ============================================================ STAT TILES (KPI) */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.kpi { padding: 18px 20px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); position: relative; }
.kpi:hover { background: var(--surface-2); }
.kpi .k-label { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 9px; font-weight: 600; }
.kpi .k-val { font-family: var(--serif); font-size: 27px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1; }
.kpi .k-val small { font-size: 15px; color: var(--ink-3); font-family: var(--sans); font-weight: 500; }
.kpi .k-delta { font-size: 12px; margin-top: 7px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.kpi .k-delta.up { color: var(--ok); }
.kpi .k-delta.down { color: var(--danger); }
.kpi .k-spark { position: absolute; right: 16px; top: 18px; opacity: .8; }

/* ============================================================ TABLES (editorial hairlines) */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl thead th { text-align: left; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; padding: 11px 16px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.tbl tbody td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); color: var(--ink); vertical-align: middle; }
.tbl tbody tr:hover { background: var(--surface-2); cursor: default; }
.tbl tbody tr.clickable:hover { cursor: pointer; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 12.5px; }
.tbl .muted { color: var(--ink-3); }

/* ============================================================ BADGES / CHIPS */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; }
.badge.soft { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.badge.gold { background: #f7ecd4; color: #9c6a12; }
.badge.blue { background: #e9f0fa; color: var(--c-blue); }
.badge.green { background: #e7f4ea; color: var(--ok); }
.badge.red { background: #fbeae6; color: var(--danger); }
.badge.purple { background: #f0eafa; color: var(--c-purple); }
.badge.teal { background: #e2f4f6; color: var(--c-teal); }
.badge.allergy { background: var(--danger); color: #fff; font-weight: 700; letter-spacing: .02em; box-shadow: 0 1px 4px rgba(192,68,46,.4); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 8px; font-size: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); }
.chip.active { border-color: var(--gold-line); background: var(--gold-soft); color: var(--gold); font-weight: 600; }

.channel-ic { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; flex: 0 0 auto; }
.channel-ic svg { width: 14px; height: 14px; }
.channel-ic.instagram { background: linear-gradient(45deg,#f9ce34,#ee2a7b,#6228d7); color:#fff; }
.channel-ic.whatsapp { background: #25d366; color:#fff; }
.channel-ic.phone { background: #e7ddc9; color: var(--ink-2); }
.channel-ic.site { background: #e9f0fa; color: var(--c-blue); }
.channel-ic.offline { background: #f0eafa; color: var(--c-purple); }

.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; flex: 0 0 auto; }

/* ============================================================ FORMS */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.input, .select, textarea.input {
  width: 100%; height: 40px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface);
  padding: 0 13px; font-size: 13.5px; color: var(--ink); outline: none; font-family: inherit; transition: border-color .12s, box-shadow .12s;
}
textarea.input { height: auto; padding: 10px 13px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, textarea.input:focus { border-color: var(--gold-line); box-shadow: 0 0 0 3px rgba(59,180,226,.12); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* ============================================================ TABS */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs .tab { padding: 10px 16px; font-size: 13.5px; font-weight: 600; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; background: none; border-top: none; border-left: none; border-right: none; }
.tabs .tab:hover { color: var(--ink); }
.tabs .tab.active { color: var(--gold); border-bottom-color: var(--gold); }

/* ============================================================ MODAL */
.overlay { position: fixed; inset: 0; background: rgba(23,20,15,.5); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 100; padding: 24px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--line); animation: pop .18s cubic-bezier(.2,.9,.3,1.2); }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.modal.wide { max-width: 820px; }
.modal-head { padding: 20px 24px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { font-size: 19px; }
.modal-head .x { width: 32px; height: 32px; border-radius: 8px; border: none; background: var(--surface-2); color: var(--ink-3); display: grid; place-items: center; font-size: 18px; }
.modal-head .x:hover { background: #f0e8d7; color: var(--ink); }
.modal-body { padding: 22px 24px; overflow-y: auto; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; background: var(--surface-2); }

/* ============================================================ EMPTY / LOADING */
.empty { text-align: center; padding: 60px 20px; color: var(--ink-3); }
.empty .crown { width: 46px; height: 46px; opacity: .3; margin: 0 auto 14px; }
.empty h3 { color: var(--ink-2); margin-bottom: 6px; }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, #f0e8d7 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 6px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.spinner { width: 30px; height: 30px; border: 3px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: spin .7s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================ TOAST */
.toasts { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast { background: var(--black); color: var(--ink-inv); padding: 13px 18px; border-radius: 10px; font-size: 13.5px; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px; animation: slideIn .2s; border-left: 3px solid var(--gold-bright); min-width: 240px; }
.toast.ok { border-left-color: var(--c-green); }
.toast.err { border-left-color: var(--danger); }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } }

/* ============================================================ utils */
.flex { display: flex; }
.aic { align-items: center; }
.jcb { justify-content: space-between; }
.gap8 { gap: 8px; } .gap12 { gap: 12px; } .gap16 { gap: 16px; }
.muted { color: var(--ink-3); }
.gold { color: var(--gold); }
.tnum { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }
.right { text-align: right; }
.mt0{margin-top:0}.mt8{margin-top:8px}.mt16{margin-top:16px}.mt24{margin-top:24px}
.mb0{margin-bottom:0}.mb8{margin-bottom:8px}.mb16{margin-bottom:16px}
.hidden { display: none !important; }
.hairline { height: 1px; background: var(--line); border: none; margin: 18px 0; }

/* ============================================================
   BRAND MAX — люкс-стилизация под Kings Clinic (дентал-блю)
   (готика — только на бренд-элементах; контент остаётся Inter/Lora)
   ============================================================ */
.wm-gothic { font-family: "Grenze Gotisch", var(--serif); }

/* — Сайдбар: глубокий дентал-навы с голубым свечением сверху — */
.sidebar {
  background:
    radial-gradient(130% 55% at 50% -12%, rgba(59,180,226,.22), transparent 62%),
    linear-gradient(180deg, #134f6a 0%, #0e4055 55%, #0a3345 100%);
}
.sidebar .brand { padding-top: 24px; padding-bottom: 20px; border-bottom: 1px solid rgba(59,180,226,.2); }
.sidebar .brand .crown { filter: drop-shadow(0 3px 12px rgba(59,180,226,.55)); }
.brand .wm b {
  font-family: "Grenze Gotisch", var(--serif);
  font-size: 27px; font-weight: 700; letter-spacing: .05em; line-height: .92;
  background: linear-gradient(180deg, #d3f0fb 0%, #63c4e9 55%, #2f9fca 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.brand .wm span { color: #7fbdd8; letter-spacing: .3em; font-size: 9px; }
.nav-group > .lbl { color: #5e8496; }
.nav a { color: #a7c6d3; }
.nav a:hover { color: #e7f4fa; }
.nav a.active { background: linear-gradient(90deg, rgba(59,180,226,.24), rgba(59,180,226,.04)); color: #f0fafe; }
.nav a.active::before { background: linear-gradient(180deg, #6fd0f2, #3bb4e2); box-shadow: 0 0 9px rgba(59,180,226,.6); }
.nav a .count { color: #7fd0ef; }
.sidebar .me { border-top: 1px solid rgba(59,180,226,.2); }
.sidebar .me .av { background: linear-gradient(180deg, #7fd0f2, #2f9fca); color: #05303f; box-shadow: 0 2px 9px -2px rgba(59,180,226,.6); }
.sidebar .me .info b { color: #e7f4fa; }
.sidebar .me .info span { color: #7a97a4; }

/* — Топбар: тонкая голубая нить снизу — */
.topbar { box-shadow: 0 1px 0 rgba(59,180,226,.16); }

/* — Голубые кнопки богаче (внутренний блик + свечение) — */
.btn.primary {
  background: linear-gradient(180deg, #45b3df 0%, #2597c4 46%, #1786b5 100%);
  border-color: #12719a; color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.32), 0 2px 12px -3px rgba(23,134,181,.5);
  text-shadow: 0 1px 0 rgba(0,0,0,.12);
}
.btn.primary:hover { filter: brightness(1.05); box-shadow: inset 0 1px 0 rgba(255,255,255,.38), 0 5px 18px -4px rgba(23,134,181,.55); }

/* — KPI-полоса: фирменная голубая кромка сверху — */
.kpis { border-top: 2px solid var(--gold-bright); }

/* — Заголовок страницы: голубая затухающая линия — */
.page-head { border-bottom: 1px solid; border-image: linear-gradient(90deg, var(--gold-line), var(--line) 55%, transparent 100%) 1; }
.page-head .eyebrow::before { content: "◆"; color: var(--gold-bright); font-size: 8px; margin-right: 7px; vertical-align: middle; }

/* — Секц.разделители: голубой ромб — */
.sec-label::before { content: "◆"; color: var(--gold-bright); font-size: 9px; margin-right: 2px; }

/* — Панели: прохладная подсветка шапки — */
.panel-head { background: linear-gradient(180deg, rgba(59,180,226,.06), transparent); }

/* ============================================================
   ЭКРАН ВХОДА — брендовый (дентал-навы + голубой + корона + готика)
   ============================================================ */
.login-scene {
  position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; overflow: hidden;
  background:
    radial-gradient(85% 65% at 50% 2%, rgba(59,180,226,.22), transparent 55%),
    radial-gradient(70% 55% at 50% 120%, rgba(59,180,226,.12), transparent 60%),
    linear-gradient(180deg, #0f4258 0%, #072634 100%);
  animation: fade .4s ease;
}
.login-scene .bg-crown { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -54%); opacity: .06; pointer-events: none; }
.login-scene .bg-crown svg circle { fill: transparent; stroke: none; }
.login-card {
  position: relative; width: 100%; max-width: 396px; text-align: center;
  background: linear-gradient(180deg, rgba(18,58,76,.92), rgba(9,38,52,.96));
  border: 1px solid rgba(59,180,226,.42); border-radius: 20px; padding: 42px 38px 32px;
  box-shadow: 0 40px 90px -35px rgba(0,0,0,.75), inset 0 1px 0 rgba(255,255,255,.06);
  animation: pop .35s cubic-bezier(.2,.9,.3,1.2);
}
.login-crown { margin-bottom: 12px; }
.login-crown svg { filter: drop-shadow(0 5px 18px rgba(59,180,226,.55)); }
.login-wm {
  font-family: "Grenze Gotisch", serif; font-size: 46px; line-height: .9; letter-spacing: .05em; font-weight: 700;
  background: linear-gradient(180deg, #dcf3fd 0%, #63c4e9 52%, #2f9fca 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.login-sub { font-family: "Lora", serif; font-size: 13px; letter-spacing: .52em; color: #56bfe6; margin: 4px 0 0 8px; }
.login-tag { color: #8fa9b3; font-size: 12.5px; letter-spacing: .03em; margin-top: 12px; }
.login-rule { height: 1px; background: linear-gradient(90deg, transparent, rgba(59,180,226,.6), transparent); margin: 22px 0 20px; }
.login-field { text-align: left; margin-bottom: 13px; }
.login-field label { display: block; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: #6f909d; margin-bottom: 6px; }
.login-field input {
  width: 100%; height: 44px; border-radius: 10px; border: 1px solid rgba(59,180,226,.3);
  background: rgba(0,0,0,.26); color: #e9f5fb; padding: 0 14px; font-size: 14px; outline: none; font-family: var(--sans);
  transition: border-color .12s, box-shadow .12s;
}
.login-field input:focus { border-color: #3bb4e2; box-shadow: 0 0 0 3px rgba(59,180,226,.2); }
.login-btn {
  width: 100%; height: 47px; margin-top: 8px; border: none; border-radius: 11px; cursor: pointer;
  background: linear-gradient(180deg, #45b3df, #2597c4 50%, #1786b5);
  color: #ffffff; font-weight: 700; font-size: 14.5px; letter-spacing: .01em; font-family: var(--sans);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 10px 26px -8px rgba(59,180,226,.6);
  transition: filter .12s;
}
.login-btn:hover { filter: brightness(1.06); }
.login-foot { margin-top: 18px; font-size: 12px; color: #6f8a95; letter-spacing: .02em; }
.login-foot b { color: #6fc3e6; font-weight: 600; }

/* ============================================================
   ДЕМО-ТУР + переходы + оживление (для презентации)
   ============================================================ */
/* плавное появление контента при смене экрана */
@keyframes pageIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.page.page-in { animation: pageIn .3s cubic-bezier(.2,.7,.3,1); }

/* мягкое свечение короны на входе */
@keyframes crownGlow {
  0%, 100% { filter: drop-shadow(0 5px 18px rgba(59,180,226,.45)); }
  50%      { filter: drop-shadow(0 6px 30px rgba(59,180,226,.85)); }
}
.login-crown svg { animation: crownGlow 3.2s ease-in-out infinite; }

/* панель демо-тура (снизу по центру) */
.tour-bar {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 300; display: flex; align-items: center; gap: 18px;
  max-width: min(880px, 92vw); padding: 14px 16px 14px 20px;
  background: linear-gradient(180deg, rgba(18,58,76,.97), rgba(10,40,54,.98));
  border: 1px solid rgba(59,180,226,.4); border-radius: 16px;
  box-shadow: 0 24px 60px -20px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.06);
  color: #eaf4fa; backdrop-filter: blur(6px);
  animation: tourIn .28s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes tourIn { from { transform: translate(-50%, 16px); opacity: 0; } }
.tour-bar .tour-step {
  flex: 0 0 auto; font-size: 12px; font-weight: 700; letter-spacing: .04em;
  color: #0a2c3a; background: linear-gradient(180deg, #6fd0f2, #3bb4e2);
  padding: 5px 11px; border-radius: 20px; font-variant-numeric: tabular-nums;
}
.tour-bar .tour-text { flex: 1; font-size: 13.5px; line-height: 1.45; color: #dcebf3; }
.tour-bar .tour-text b { color: #7fd6f5; font-weight: 600; }
.tour-bar .tour-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
.tour-btn {
  height: 34px; padding: 0 14px; border-radius: 9px; font-size: 13px; font-weight: 600; cursor: pointer;
  border: 1px solid rgba(59,180,226,.35); background: rgba(255,255,255,.04); color: #cfe6f1; font-family: var(--sans);
  transition: filter .12s, background .12s;
}
.tour-btn:hover { background: rgba(59,180,226,.14); }
.tour-btn:disabled { opacity: .35; cursor: default; }
.tour-btn.primary { border: none; background: linear-gradient(180deg, #45b3df, #1786b5); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.3); }
.tour-btn.primary:hover { filter: brightness(1.07); }
.tour-x { width: 34px; height: 34px; border-radius: 9px; border: none; background: rgba(255,255,255,.05); color: #9fc0cf; font-size: 15px; cursor: pointer; }
.tour-x:hover { background: rgba(255,255,255,.12); color: #fff; }

/* пульсирующая подсветка целевого элемента тура */
@keyframes spotPulse { 0%,100% { box-shadow: 0 0 0 3px rgba(59,180,226,.5), 0 0 0 9px rgba(59,180,226,.16); } 50% { box-shadow: 0 0 0 3px rgba(59,180,226,.8), 0 0 0 14px rgba(59,180,226,.08); } }
.tour-spot { border-radius: 12px; animation: spotPulse 1.6s ease-in-out infinite; scroll-margin: 90px; }

/* кнопка запуска тура в топбаре */
.tour-launch { color: var(--gold); border-color: var(--gold-line) !important; }
.tour-launch:hover { background: var(--gold-soft) !important; }

/* ============================================================
   PREMIUM POLISH — глубина, свет, микро-анимации
   ============================================================ */
/* лёгкое голубое «свечение» в фоне контента */
.content { background: radial-gradient(110% 80% at 88% -12%, rgba(59,180,226,.09), transparent 55%), var(--paper); }

/* многослойные мягкие тени + внутренний свет */
.panel, .kpis { border-radius: 14px; box-shadow: inset 0 1px 0 rgba(255,255,255,.65), 0 1px 2px rgba(16,40,52,.03), 0 14px 34px -24px rgba(16,40,52,.25); }
.card { border-radius: 14px; box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 1px 2px rgba(16,40,52,.03), 0 10px 26px -20px rgba(16,40,52,.22); }

/* hover-lift для интерактивных плиток */
.card, .kpi { transition: transform .18s ease, box-shadow .18s ease, border-color .18s, background .18s; }
.card:hover { transform: translateY(-2px); border-color: var(--gold-line); box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 3px 6px rgba(16,40,52,.05), 0 20px 44px -22px rgba(16,40,52,.32); }
.kpi:hover { background: linear-gradient(180deg, rgba(59,180,226,.06), transparent); }

/* кнопки: нажатие и живость */
.btn { transition: all .15s ease; }
.btn:active { transform: translateY(1px) scale(.995); }
.btn.primary:active { filter: brightness(.97); }

/* таблицы: строка с акцент-полосой */
.tbl tbody tr { transition: background .12s, box-shadow .12s; }
.tbl tbody tr:hover { box-shadow: inset 3px 0 0 var(--gold-bright); }

/* стекло: оверлеи, модалки, тосты */
.overlay { backdrop-filter: blur(9px) saturate(1.25); }
.modal { border-radius: 18px; }
.toast { background: rgba(13,53,71,.92); backdrop-filter: blur(8px); border: 1px solid rgba(59,180,226,.25); border-left-width: 3px; }

/* вкладки и навигация — микро-движение */
.tabs .tab { transition: color .15s, border-color .15s, background .15s; border-radius: 8px 8px 0 0; }
.tabs .tab:hover { background: var(--surface-2); }
.nav a svg { transition: transform .16s ease; }
.nav a:hover svg { transform: translateX(2px) scale(1.06); }

/* доступный фокус */
:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; border-radius: 6px; }

/* оркестрованный вход: контент появляется каскадом */
.page.page-in { animation: none; }
.page.page-in > * { animation: pageIn .4s cubic-bezier(.2,.7,.3,1) both; }
.page.page-in > *:nth-child(1) { animation-delay: .02s; }
.page.page-in > *:nth-child(2) { animation-delay: .08s; }
.page.page-in > *:nth-child(3) { animation-delay: .14s; }
.page.page-in > *:nth-child(4) { animation-delay: .20s; }
.page.page-in > *:nth-child(5) { animation-delay: .26s; }
.page.page-in > *:nth-child(n+6) { animation-delay: .30s; }

/* графики: мягкое всплытие контейнера */
.chart { animation: chartIn .55s ease both; }
@keyframes chartIn { from { opacity: 0; transform: translateY(10px); } }

/* логин: дыхание фоновой короны */
.login-scene .bg-crown { animation: bgBreathe 9s ease-in-out infinite; }
@keyframes bgBreathe {
  0%, 100% { opacity: .05; transform: translate(-50%, -54%) scale(1); }
  50%      { opacity: .09; transform: translate(-50%, -54%) scale(1.045); }
}

/* заголовок страницы — чуть увереннее */
.page-head h1 { font-size: 32px; }

/* уважение к reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .page.page-in > *, .chart, .login-scene .bg-crown, .login-crown svg { animation: none !important; }
  .card, .kpi, .btn, .nav a svg { transition: none !important; }
}
