/* ═══ ВИРТУАЛЬНЫЕ ОТКРЫТИЯ · ЗАКАЗЫ ═══
   Тёмная тема, mobile-first. Бренд: #7C9CFF / #FFB454. */
:root {
  --bg: #070A12;
  --bg2: #0B1020;
  --surface: #111726;
  --surface2: #161E31;
  --surface3: #1C2740;
  --line: #232D44;
  --line2: #2F3D5C;
  --text: #E8ECF7;
  --muted: #9AA6BF;
  --faint: #6E7B96;
  --accent: #7C9CFF;
  --accent2: #5B7BFF;
  --amber: #FFB454;
  --ok: #53D7A0;
  --err: #FF6B6B;
  --violet: #C79BFF;
  --cyan: #5BD0E6;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --tabh: 62px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
html.no-scroll, html.no-scroll body { overflow: hidden; }

body {
  min-height: 100vh;
  background:
    radial-gradient(1100px 620px at 88% -8%, rgba(124, 156, 255, 0.14), transparent 62%),
    radial-gradient(900px 560px at -12% 104%, rgba(255, 180, 84, 0.06), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: none;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
h1, h2, h3, p { margin: 0; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.center { text-align: center; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid rgba(124, 156, 255, 0.65); outline-offset: 2px; }
::selection { background: rgba(124, 156, 255, 0.35); }

.app {
  min-height: 100vh;
  padding-bottom: calc(var(--tabh) + env(safe-area-inset-bottom) + 92px);
}

/* ═══ загрузочный экран ═══ */
.boot {
  position: fixed; inset: 0; z-index: 300;
  background: #070A12;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.boot-mark img { border-radius: 18px; box-shadow: 0 14px 48px rgba(124, 156, 255, 0.3); }
.boot-name { font-weight: 800; font-size: 18px; margin-top: 16px; letter-spacing: -0.3px; }
.boot-sub { color: var(--faint); font-size: 11.5px; text-transform: uppercase; letter-spacing: 1.4px; margin-top: 2px; }
.boot-spinner {
  width: 26px; height: 26px; border-radius: 50%; margin-top: 22px;
  border: 2px solid rgba(124, 156, 255, 0.22); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══ шапка ═══ */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  padding: calc(9px + env(safe-area-inset-top)) max(14px, calc((100vw - 1080px) / 2)) 9px;
  background: rgba(7, 10, 18, 0.8);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(35, 45, 68, 0.65);
}
.topbar.sub { gap: 8px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.brand-logo { width: 38px; height: 38px; border-radius: 12px; box-shadow: 0 6px 18px rgba(124, 156, 255, 0.22); flex: none; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-size: 14px; font-weight: 750; letter-spacing: -0.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: 9.5px; color: var(--faint); text-transform: uppercase; letter-spacing: 1.1px; }
.topbar-actions { display: flex; align-items: center; gap: 2px; flex: none; }
.sub-title { flex: 1; min-width: 0; }
.sub-title-main { font-weight: 750; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub-title-sub { font-size: 11px; color: var(--faint); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; flex: none;
  border: 1px solid transparent; background: transparent; color: var(--muted);
  cursor: pointer; transition: background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.icon-btn .ic { width: 21px; height: 21px; }

/* ═══ страница ═══ */
.page { max-width: 1080px; margin: 0 auto; padding: 18px 16px 8px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin: 2px 0 6px; }
.page-title { font-size: 26px; font-weight: 800; letter-spacing: -0.7px; line-height: 1.15; }
.page-sub { color: var(--faint); font-size: 12px; margin-top: 5px; line-height: 1.4; }
.foot-note { font-size: 11px; color: var(--faint); line-height: 1.55; margin: 12px 2px 4px; }
.foot-note.center { text-align: center; }

.card {
  background: linear-gradient(180deg, rgba(23, 31, 50, 0.92), rgba(14, 20, 34, 0.92));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 12px 34px rgba(0, 0, 0, 0.16);
}

/* ═══ кнопки ═══ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 12px; padding: 11px 16px;
  font-size: 14px; font-weight: 650; line-height: 1.2;
  border: 1px solid var(--line); background: var(--surface2); color: var(--text);
  cursor: pointer; transition: border-color 0.15s, transform 0.1s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { border-color: var(--line2); }
.btn:active { transform: scale(0.985); }
.btn:disabled { opacity: 0.45; pointer-events: none; }
.btn .ic { width: 18px; height: 18px; }
.btn-primary {
  background: linear-gradient(135deg, #8CA8FF, #6785FF);
  border-color: transparent; color: #08122E;
  box-shadow: 0 8px 24px rgba(104, 133, 255, 0.28);
}
.btn-primary:hover { border-color: transparent; box-shadow: 0 10px 30px rgba(104, 133, 255, 0.36); }
.btn-ghost { background: rgba(255, 255, 255, 0.03); border-color: var(--line); }
.btn-danger { background: linear-gradient(135deg, #FF7B7B, #F45B5B); border-color: transparent; color: #2A0606; }
.btn-danger-ghost { background: rgba(255, 107, 107, 0.07); border-color: rgba(255, 107, 107, 0.28); color: #FF9B9B; }
.btn-wide { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 12.5px; border-radius: 10px; }
.btn-sm .ic { width: 15px; height: 15px; }
.btn-lg { padding: 15px 18px; font-size: 16px; border-radius: 14px; }

/* ═══ поля ═══ */
.input {
  width: 100%; background: #0B1020; border: 1px solid var(--line);
  border-radius: 12px; padding: 11px 13px;
  color: var(--text); font-size: 15px; font-family: inherit; line-height: 1.3;
  outline: none; -webkit-appearance: none; appearance: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus { border-color: rgba(124, 156, 255, 0.55); box-shadow: 0 0 0 3px rgba(124, 156, 255, 0.13); }
.input::placeholder { color: #56627C; }
.textarea { min-height: 84px; resize: vertical; line-height: 1.45; }
.select {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}
input[type="date"].input, input[type="month"].input, input[type="datetime-local"].input { min-height: 44px; }
.form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 11.5px; font-weight: 600; color: var(--muted); letter-spacing: 0.2px; }
.field-hint { font-size: 10.5px; color: var(--faint); line-height: 1.45; }
.field-row { display: grid; gap: 12px; }
.form-err {
  background: rgba(255, 107, 107, 0.1); border: 1px solid rgba(255, 107, 107, 0.32);
  color: #FFA8A8; padding: 10px 12px; border-radius: 10px; font-size: 12.5px;
}
.chip-radios { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-radio { position: relative; }
.chip-radio input { position: absolute; opacity: 0; pointer-events: none; }
.chip-radio span {
  display: inline-flex; padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.02);
  font-size: 12.5px; color: var(--muted); cursor: pointer; transition: 0.15s;
}
.chip-radio input:checked + span {
  background: rgba(124, 156, 255, 0.16); border-color: rgba(124, 156, 255, 0.5);
  color: #C9D6FF; font-weight: 650;
}

/* ═══ чипы, поиск ═══ */
.chips { display: flex; gap: 7px; margin: 12px 0; flex-wrap: wrap; }
.chips.scroll-x {
  flex-wrap: nowrap; overflow-x: auto; padding-bottom: 5px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.chips.scroll-x::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02); color: var(--muted);
  font-size: 12.5px; font-weight: 600; cursor: pointer; transition: 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.chip.active { background: rgba(124, 156, 255, 0.15); border-color: rgba(124, 156, 255, 0.45); color: #C9D6FF; }
.chip-n { font-size: 10px; background: rgba(255, 255, 255, 0.06); border-radius: 999px; padding: 1px 6px; color: var(--faint); }
.chip.active .chip-n { background: rgba(124, 156, 255, 0.2); color: #A9BEFF; }
.toolbar { display: flex; gap: 8px; margin: 12px 0 4px; }
.searchbox {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px;
  background: #0B1020; border: 1px solid var(--line); border-radius: 12px;
  padding: 0 12px; color: var(--faint); transition: border-color 0.15s;
}
.searchbox:focus-within { border-color: rgba(124, 156, 255, 0.5); }
.searchbox input {
  flex: 1; min-width: 0; background: transparent; border: 0; outline: 0;
  color: var(--text); font-size: 14px; font-family: inherit; padding: 11px 0;
}
.searchbox input::placeholder { color: #56627C; }
.searchbox .ic { width: 18px; height: 18px; }
.sort-select { width: auto; max-width: 136px; padding: 0 30px 0 10px; font-size: 12.5px; }

/* ═══ пилюли статусов ═══ */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.2px; white-space: nowrap;
}
.tone-blue { background: rgba(124, 156, 255, 0.14); color: #AEBFFF; }
.tone-green { background: rgba(83, 215, 160, 0.13); color: #7FE3BC; }
.tone-amber { background: rgba(255, 180, 84, 0.14); color: #FFC77D; }
.tone-cyan { background: rgba(91, 208, 230, 0.13); color: #8BE3F4; }
.tone-gray { background: rgba(154, 166, 191, 0.12); color: #B3BDD1; }
.tone-violet { background: rgba(199, 155, 255, 0.14); color: #D6B8FF; }
.tone-red { background: rgba(255, 107, 107, 0.13); color: #FFA3A3; }
.tone-outline { background: transparent; border: 1px dashed var(--line2); color: var(--faint); }

/* ═══ список клиентов ═══ */
.client-list { display: flex; flex-direction: column; gap: 9px; margin-top: 10px; }
.client-row {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 13px 14px; border-radius: 16px;
  background: linear-gradient(180deg, rgba(23, 31, 50, 0.72), rgba(14, 20, 34, 0.72));
  border: 1px solid var(--line);
  transition: border-color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.client-row:hover { border-color: var(--line2); background: linear-gradient(180deg, rgba(27, 36, 58, 0.85), rgba(16, 23, 39, 0.85)); }
.avatar {
  width: 44px; height: 44px; border-radius: 14px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(124, 156, 255, 0.24), rgba(255, 180, 84, 0.14));
  border: 1px solid rgba(124, 156, 255, 0.26);
  color: #C9D6FF; font-weight: 800; font-size: 15px; letter-spacing: 0.5px;
}
.avatar-lg { width: 56px; height: 56px; border-radius: 18px; font-size: 18px; }
.cr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cr-name {
  font-weight: 700; font-size: 14.5px; line-height: 1.3;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.cr-sub { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-meta { color: var(--faint); font-size: 11.5px; margin-top: 2px; }
.cr-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; max-width: 38%; }
.cr-last { font-size: 10px; color: var(--faint); white-space: nowrap; }
.arch-wrap { margin-top: 16px; }
.ghost-link {
  display: inline-flex; align-items: center; gap: 7px;
  background: transparent; border: 0; color: var(--faint);
  font-size: 12.5px; cursor: pointer; padding: 6px 2px; font-family: inherit;
}
.ghost-link:hover { color: var(--muted); }
.ghost-link .ic { width: 16px; height: 16px; }
.arch-list { display: flex; flex-direction: column; gap: 8px; }
.arch-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid rgba(35, 45, 68, 0.5); }
.arch-row:last-child { border-bottom: 0; }
.arch-main { flex: 1; min-width: 0; }
.arch-name { font-weight: 650; font-size: 13.5px; }
.arch-sub { font-size: 11.5px; color: var(--faint); }

/* ═══ карточка клиента ═══ */
.client-page { max-width: 840px; }
.client-hero {
  padding: 18px; margin-bottom: 14px;
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(124, 156, 255, 0.14), transparent 55%),
    linear-gradient(180deg, rgba(26, 35, 57, 0.94), rgba(14, 20, 34, 0.94));
}
.hero-top { display: flex; gap: 14px; align-items: flex-start; }
.hero-main { flex: 1; min-width: 0; }
.hero-name { font-size: 20px; line-height: 1.25; font-weight: 800; letter-spacing: -0.35px; }
.hero-sub { color: var(--muted); font-size: 12.5px; margin-top: 4px; line-height: 1.4; }
.hero-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.hero-actions .btn { flex: 1; min-width: 104px; }
.info-card { padding: 2px 16px; margin-bottom: 14px; }
.info-row { display: flex; gap: 12px; padding: 13px 0; border-bottom: 1px solid rgba(35, 45, 68, 0.55); }
.info-row:last-child { border-bottom: 0; }
.info-ic {
  width: 32px; height: 32px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  background: rgba(124, 156, 255, 0.08); color: #9FB4FF;
}
.info-ic .ic { width: 17px; height: 17px; }
.info-main { flex: 1; min-width: 0; }
.info-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.7px; color: var(--faint); margin-bottom: 2px; }
.info-value { font-size: 14.5px; color: var(--text); word-break: break-word; }
a.info-value:hover { color: var(--accent); }
.info-value.muted { color: var(--faint); font-size: 13.5px; }
.info-value.accent { color: #A9BEFF; }
.info-row.note .info-value { color: var(--muted); font-size: 13.5px; white-space: pre-wrap; }

/* ═══ статистика ═══ */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin: 14px 0; }
.stat {
  padding: 14px; border-radius: 16px;
  background: linear-gradient(180deg, rgba(22, 30, 49, 0.8), rgba(13, 19, 32, 0.8));
  border: 1px solid var(--line);
}
.stat-v { font-size: 22px; font-weight: 800; letter-spacing: -0.6px; line-height: 1.1; }
.stat-v.money { font-size: 17px; letter-spacing: -0.3px; padding-top: 3px; }
.stat-l { color: var(--faint); font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.7px; margin-top: 5px; }
.stats-grid.small .stat { padding: 11px 12px; }
.stats-grid.small .stat-v { font-size: 17px; }
.stats-grid.small .stat-v.money { font-size: 14px; }

/* ═══ ближайшее представление ═══ */
.next-show {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 13px 15px; margin: 2px 0 16px; border-radius: 16px;
  border: 1px solid rgba(255, 180, 84, 0.3);
  background: linear-gradient(135deg, rgba(255, 180, 84, 0.13), rgba(255, 180, 84, 0.03));
  color: var(--text); cursor: pointer; font-family: inherit;
  transition: border-color 0.15s;
}
.next-show:hover { border-color: rgba(255, 180, 84, 0.5); }
.next-ic {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  display: grid; place-items: center;
  background: rgba(255, 180, 84, 0.14); color: var(--amber);
}
.next-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.next-label { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--amber); }
.next-title { font-weight: 650; font-size: 13.5px; line-height: 1.35; }
.next-days {
  font-size: 10.5px; font-weight: 700; color: var(--amber); white-space: nowrap;
  background: rgba(255, 180, 84, 0.12); padding: 5px 9px; border-radius: 999px;
}

/* ═══ секции ═══ */
.section { margin: 18px 0 6px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.section-head h2 { font-size: 15px; font-weight: 750; letter-spacing: 0.1px; }
.section-head.sub { margin-top: 22px; }
.section-head.sub h2 { font-size: 11.5px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.8px; }

/* ═══ представления ═══ */
.show-list { display: flex; flex-direction: column; gap: 8px; }
.show-row {
  display: flex; gap: 12px; align-items: center;
  padding: 11px 13px; border-radius: 14px;
  background: rgba(17, 23, 38, 0.7); border: 1px solid var(--line);
  text-align: left; color: inherit; cursor: pointer; width: 100%; font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.show-row:hover { border-color: var(--line2); background: rgba(21, 29, 47, 0.8); }
.show-date {
  width: 46px; flex: none; display: flex; flex-direction: column; align-items: center;
  background: rgba(124, 156, 255, 0.09); border-radius: 10px; padding: 6px 0; color: #B9C9FF;
}
.show-date b { font-size: 17px; line-height: 1; }
.show-date span { font-size: 9px; text-transform: uppercase; letter-spacing: 0.3px; margin-top: 3px; color: var(--faint); }
.show-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.show-title { font-weight: 650; font-size: 13.5px; line-height: 1.3; }
.show-sub { font-size: 11.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.show-money { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.show-money b { font-size: 13px; white-space: nowrap; }
.show-money span { font-size: 10px; color: var(--faint); white-space: nowrap; }

/* ═══ звонки ═══ */
.call-list { display: flex; flex-direction: column; gap: 8px; }
.call-row {
  display: flex; gap: 12px; padding: 12px 14px; border-radius: 14px;
  background: rgba(17, 23, 38, 0.7); border: 1px solid var(--line);
  cursor: pointer; transition: border-color 0.15s;
}
.call-row:hover { border-color: var(--line2); }
.call-ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.call-ic .ic { width: 17px; height: 17px; }
.ch-call { background: rgba(124, 156, 255, 0.12); color: #A9BEFF; }
.ch-max { background: rgba(91, 208, 230, 0.12); color: #8BE3F4; }
.ch-note { background: rgba(255, 180, 84, 0.12); color: #FFC77D; }
.call-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.call-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.call-channel { font-weight: 650; font-size: 13px; }
.call-time { font-size: 10.5px; color: var(--faint); white-space: nowrap; }
.call-note { font-size: 12.5px; color: var(--muted); line-height: 1.45; white-space: pre-wrap; }
.call-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.call-hint { font-size: 10px; color: var(--amber); }
.quick-results { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 1px; }
.qr-btn {
  font-size: 10.5px; font-weight: 600; color: var(--muted);
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 9px; cursor: pointer; font-family: inherit;
  transition: 0.15s;
}
.qr-btn:hover { color: var(--text); border-color: var(--line2); }

/* ═══ календарь ═══ */
.cal-card { padding: 14px 12px 12px; margin: 8px auto 0; max-width: 680px; }
.cal-head { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.cal-title { flex: 1; text-align: center; font-weight: 750; font-size: 16px; letter-spacing: -0.2px; }
.cal-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr); text-align: center;
  color: var(--faint); font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-blank { aspect-ratio: 1; }
.cal-day {
  position: relative; aspect-ratio: 1; border: 0; background: transparent;
  border-radius: 50%; color: var(--text); font-family: inherit; font-size: 14px;
  display: grid; place-items: center; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.cal-day .cal-num {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1.5px solid transparent; transition: 0.15s;
}
.cal-day.has .cal-num { border-color: rgba(124, 156, 255, 0.85); color: #C4D1FF; background: rgba(124, 156, 255, 0.08); font-weight: 700; }
.cal-day.past { color: var(--faint); }
.cal-day.has.past .cal-num { border-color: rgba(124, 156, 255, 0.32); color: var(--muted); background: transparent; }
.cal-day.today .cal-num { background: linear-gradient(135deg, #8CA8FF, #6785FF); color: #08122E; border-color: transparent; font-weight: 800; }
.cal-day.today.has .cal-num { box-shadow: 0 0 0 3px rgba(124, 156, 255, 0.18); }
.cal-count {
  position: absolute; top: 0; right: 2px; min-width: 15px; height: 15px;
  border-radius: 999px; background: var(--amber); color: #2A1A00;
  font-size: 9px; font-weight: 800; display: grid; place-items: center; padding: 0 3px;
}
.cal-dot { position: absolute; bottom: 2px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.cal-legend { display: flex; align-items: center; gap: 7px; margin-top: 10px; color: var(--faint); font-size: 10.5px; padding-left: 4px; }
.cal-legend-ring { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid rgba(124, 156, 255, 0.85); }
#cal-section { max-width: 760px; margin-left: auto; margin-right: auto; }
.cal-list { display: flex; flex-direction: column; gap: 8px; }
.cal-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 13px; border-radius: 14px;
  background: rgba(17, 23, 38, 0.7); border: 1px solid var(--line);
  text-align: left; color: inherit; cursor: pointer; font-family: inherit;
  transition: border-color 0.15s;
}
.cal-row:hover { border-color: var(--line2); }
.cal-row.dim { opacity: 0.55; }
.cal-row .ic { color: var(--faint); width: 18px; height: 18px; }
.cal-row-date { width: 40px; flex: none; display: flex; flex-direction: column; align-items: center; color: #B9C9FF; }
.cal-row-date b { font-size: 17px; line-height: 1; }
.cal-row-date span { font-size: 9px; text-transform: uppercase; color: var(--faint); margin-top: 3px; }
.cal-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cal-row-title { font-weight: 650; font-size: 13.5px; }
.cal-row-sub { font-size: 11.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-row-money { font-weight: 700; font-size: 12.5px; white-space: nowrap; }

/* ═══ история ═══ */
.summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 8px; margin: 12px 0 4px; }
.summary-item { padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.025); }
.summary-item b { display: block; font-size: 17px; font-weight: 800; letter-spacing: -0.3px; }
.summary-item span { font-size: 9.5px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.5px; }
.hist-list { display: flex; flex-direction: column; gap: 22px; margin-top: 10px; }
.hist-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.hist-group-head h2 { font-size: 14px; font-weight: 750; }
.hist-group-head span { font-size: 10.5px; color: var(--faint); }
.hist-row {
  display: flex; gap: 12px; align-items: center; width: 100%;
  padding: 11px 13px; border-radius: 13px; margin-bottom: 6px;
  background: rgba(17, 23, 38, 0.6); border: 1px solid var(--line);
  text-align: left; color: inherit; cursor: pointer; font-family: inherit;
  transition: border-color 0.15s;
}
.hist-row:hover { border-color: var(--line2); }
.hist-date { width: 34px; flex: none; display: flex; flex-direction: column; align-items: center; color: #B9C9FF; }
.hist-date b { font-size: 16px; line-height: 1; }
.hist-date span { font-size: 9px; text-transform: uppercase; color: var(--faint); margin-top: 2px; }
.hist-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hist-title { font-weight: 650; font-size: 13.5px; }
.hist-sub { font-size: 11.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-money { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.hist-money b { font-size: 12.5px; white-space: nowrap; }
.hist-money span { font-size: 9.5px; color: var(--faint); white-space: nowrap; }
.range-extra { margin: 8px 0 2px; }
.range-fields { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline-field { display: flex; flex-direction: column; gap: 5px; font-size: 10.5px; color: var(--faint); }
.inline-field .input { padding: 8px 10px; font-size: 13px; }

/* ═══ финансы ═══ */
.money-hero {
  padding: 20px; margin: 8px 0 16px;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(124, 156, 255, 0.2), transparent 55%),
    linear-gradient(180deg, rgba(24, 33, 54, 0.95), rgba(14, 20, 34, 0.95));
}
.mh-top { display: flex; justify-content: space-between; align-items: center; }
.mh-eyebrow { font-size: 10px; text-transform: uppercase; letter-spacing: 0.9px; color: var(--muted); }
.mh-ic { color: var(--accent); }
.mh-value {
  font-size: 34px; font-weight: 850; letter-spacing: -1.2px; margin: 8px 0 16px; line-height: 1.1;
  background: linear-gradient(135deg, #F2F5FF, #A9BEFF);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.mh-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; border-top: 1px solid var(--line); padding-top: 13px; }
.mh-row div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mh-row b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mh-row span { font-size: 9px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.5px; }
.year-card { padding: 16px; margin-top: 12px; }
.year-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.year-card-head h3 { font-size: 14px; font-weight: 700; }
.year-card-head .muted { font-size: 11px; }
.year-card-sub { font-size: 10px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.6px; margin: 14px 0 6px; }
.bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; align-items: end; padding-top: 8px; }
.bar { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; }
.bar-track { width: 100%; height: 96px; display: flex; align-items: flex-end; background: rgba(255, 255, 255, 0.03); border-radius: 6px; overflow: hidden; }
.bar-track i { display: block; width: 100%; background: linear-gradient(180deg, #8CA8FF, #5B7BFF); border-radius: 6px 6px 0 0; min-height: 2px; }
.bar-label { font-size: 8.5px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.2px; }
.table-wrap { overflow-x: auto; padding: 0; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 520px; }
.data-table th {
  text-align: left; font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--faint); padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 600;
}
.data-table td { padding: 11px 14px; border-bottom: 1px solid rgba(35, 45, 68, 0.45); }
.data-table tr:last-child td { border-bottom: 0; }
.data-table .num { text-align: right; white-space: nowrap; }
.data-table tbody tr[data-year] { cursor: pointer; }
.data-table tbody tr:hover { background: rgba(124, 156, 255, 0.04); }
.data-table tr.sel { background: rgba(124, 156, 255, 0.07); }
.data-table tr.total td { font-weight: 700; border-top: 1px solid var(--line2); }

/* ═══ настройки ═══ */
.profile-card { display: flex; align-items: center; gap: 14px; padding: 16px; margin: 8px 0 14px; }
.profile-main { flex: 1; min-width: 0; }
.profile-name { font-weight: 750; font-size: 16px; }
.profile-sub { font-size: 11.5px; color: var(--faint); }
.settings-block { padding: 16px; margin-bottom: 14px; }
.settings-block h2 { font-size: 15px; font-weight: 750; margin-bottom: 4px; }
.settings-block > .muted { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.settings-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid rgba(35, 45, 68, 0.5); }
.settings-block h2 + .settings-row { border-top: 0; }
.settings-row-main { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.settings-row-main b { font-size: 13.5px; font-weight: 650; }
.settings-row-main span { font-size: 11.5px; color: var(--faint); line-height: 1.4; }
.about-lines { margin-top: 10px; border-top: 1px solid rgba(35, 45, 68, 0.5); padding-top: 10px; display: flex; flex-direction: column; gap: 7px; }
.about-lines div { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; color: var(--faint); }
.about-lines b { color: var(--muted); font-weight: 600; text-align: right; word-break: break-all; }
.howto { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; color: var(--muted); line-height: 1.5; }
.howto .ic { width: 15px; height: 15px; vertical-align: -2px; }

/* ═══ пустые состояния, скелетоны ═══ */
.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
  padding: 34px 18px; border: 1px dashed var(--line); border-radius: 18px;
  background: rgba(17, 23, 38, 0.4);
}
.empty-ic {
  width: 48px; height: 48px; border-radius: 16px; margin-bottom: 4px;
  background: rgba(124, 156, 255, 0.09); color: var(--accent);
  display: grid; place-items: center;
}
.empty-ic .ic { width: 23px; height: 23px; }
.empty-title { font-weight: 700; font-size: 15px; }
.empty-text { color: var(--faint); font-size: 12.5px; max-width: 340px; line-height: 1.5; }
.empty .btn { margin-top: 10px; }
.skel {
  height: 76px; border-radius: 14px; margin: 12px 0;
  background: linear-gradient(90deg, rgba(30, 40, 63, 0.55) 25%, rgba(46, 59, 89, 0.75) 50%, rgba(30, 40, 63, 0.55) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite;
}
.skel-hero { height: 130px; border-radius: 18px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ═══ шторки ═══ */
.sheets { position: relative; z-index: 100; }
.sheet-wrap {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; transition: opacity 0.2s;
}
.sheet-wrap.show { opacity: 1; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(3, 5, 10, 0.66); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.sheet {
  position: relative; width: 100%; max-width: 560px; max-height: 88vh;
  display: flex; flex-direction: column;
  background: #0F1524; border: 1px solid var(--line);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.5);
  transform: translateY(18px);
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sheet.wide { max-width: 720px; }
.sheet-wrap.show .sheet { transform: translateY(0); }
.sheet-grip { width: 36px; height: 4px; border-radius: 999px; background: var(--line2); margin: 8px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 12px 18px 8px; flex: none; }
.sheet-title { flex: 1; font-weight: 750; font-size: 16px; min-width: 0; }
.sheet-body { padding: 6px 18px 18px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet-foot {
  display: flex; gap: 10px; flex: none;
  padding: 12px 18px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}
.sheet-foot .btn { flex: 1; }
.confirm-text { color: var(--muted); font-size: 14px; line-height: 1.55; padding: 4px 0 8px; }

/* ═══ тосты ═══ */
.toasts {
  position: fixed; left: 12px; right: 12px;
  bottom: calc(var(--tabh) + env(safe-area-inset-bottom) + 18px);
  z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  max-width: 520px; width: 100%; display: flex; align-items: flex-start; gap: 9px;
  padding: 11px 14px; border-radius: 14px;
  background: #182135; border: 1px solid var(--line2); color: var(--text);
  font-size: 13px; line-height: 1.4; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  opacity: 0; transform: translateY(8px); transition: 0.22s;
}
.toast.show { opacity: 1; transform: none; }
.toast-ok { border-color: rgba(83, 215, 160, 0.35); }
.toast-ok .toast-ic { color: var(--ok); }
.toast-err { border-color: rgba(255, 107, 107, 0.4); }
.toast-err .toast-ic { color: var(--err); }
.toast-info { border-color: rgba(124, 156, 255, 0.4); }
.toast-info .toast-ic { color: var(--accent); }
.toast-ic { flex: none; margin-top: 1px; }
.toast-ic .ic { width: 17px; height: 17px; }

/* ═══ нижняя навигация и FAB ═══ */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; justify-content: space-around;
  padding: 5px 4px calc(5px + env(safe-area-inset-bottom));
  background: rgba(9, 13, 22, 0.94);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--faint); font-size: 10px; font-weight: 600; letter-spacing: 0.1px;
  padding: 5px 2px; border-radius: 12px; transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.tabbar a .ic { width: 22px; height: 22px; }
.tabbar a.active { color: var(--accent); }
.fab {
  position: fixed; right: 16px;
  bottom: calc(var(--tabh) + env(safe-area-inset-bottom) + 18px);
  z-index: 50; width: 56px; height: 56px; border-radius: 18px; border: 0;
  background: linear-gradient(135deg, #8CA8FF, #6785FF); color: #08122E;
  display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 14px 36px rgba(104, 133, 255, 0.45);
  transition: transform 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.fab:active { transform: scale(0.94); }
.fab .ic { width: 26px; height: 26px; stroke-width: 2.4; }

/* ═══ вход ═══ */
.login {
  min-height: 100vh; min-height: 100dvh; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(900px 600px at 50% -10%, rgba(124, 156, 255, 0.18), transparent 60%),
    var(--bg);
}
.login-orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.5; pointer-events: none; }
.login-orb-a { width: 420px; height: 420px; background: rgba(124, 156, 255, 0.25); top: -160px; right: -120px; }
.login-orb-b { width: 360px; height: 360px; background: rgba(255, 180, 84, 0.12); bottom: -160px; left: -120px; }
.login-wrap { width: 100%; max-width: 400px; position: relative; z-index: 1; display: flex; flex-direction: column; gap: 18px; align-items: center; }
.login-card {
  width: 100%; padding: 28px 24px; border-radius: 24px;
  background: linear-gradient(180deg, rgba(23, 31, 50, 0.94), rgba(12, 17, 30, 0.96));
  border: 1px solid var(--line); box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.login-logo { filter: drop-shadow(0 10px 28px rgba(124, 156, 255, 0.35)); border-radius: 20px; }
.login-kicker {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 14px;
  font-size: 9.5px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--accent);
  background: rgba(124, 156, 255, 0.09); padding: 4px 10px; border-radius: 999px;
  border: 1px solid rgba(124, 156, 255, 0.2);
}
.login-kicker .ic { width: 13px; height: 13px; }
.login-title { font-size: 23px; font-weight: 800; letter-spacing: -0.6px; margin-top: 12px; }
.login-sub { color: var(--muted); font-size: 12.5px; margin: 4px 0 20px; }
.login-form { width: 100%; display: flex; flex-direction: column; gap: 12px; text-align: left; }
.login-hint {
  display: flex; align-items: flex-start; gap: 6px; justify-content: center;
  color: var(--faint); font-size: 10.5px; margin-top: 16px; line-height: 1.45; text-align: center;
}
.login-hint .ic { width: 14px; height: 14px; margin-top: 1px; }
.login-foot { color: var(--faint); font-size: 10.5px; letter-spacing: 0.3px; }

/* ═══ адаптив ═══ */
@media (max-width: 379px) {
  .brand-sub { display: none; }
  .brand-name { font-size: 13px; }
  .cr-side { max-width: 34%; }
  .cr-last { display: none; }
  .hide-xs { display: none; }
}
@media (max-width: 420px) {
  .mh-value { font-size: 28px; }
  .page-title { font-size: 23px; }
  .show-money span, .hist-money span { display: none; }
  .tabbar a { font-size: 9px; }
  .tabbar a .ic { width: 21px; height: 21px; }
}
@media (max-width: 639px) {
  .data-table { min-width: 0; font-size: 11px; }
  .data-table th { padding: 10px 6px; font-size: 8px; letter-spacing: 0.3px; }
  .data-table td { padding: 10px 6px; }
  .data-table .num { font-size: 10.5px; }
  .bars { gap: 3px; }
  .bar-label { font-size: 7.5px; }
}
@media (min-width: 540px) {
  .field-row { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 640px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .summary { grid-template-columns: repeat(4, 1fr); }
  .sheet-wrap { align-items: center; }
  .sheet { border-radius: 22px; max-height: 85vh; }
  .sheet-grip { display: none; }
  .sheet-head { padding-top: 18px; }
  .login-card { padding: 32px 28px; }
}
@media (min-width: 900px) {
  .app { padding-bottom: 120px; }
  .page { padding: 24px 24px 12px; }
  .topbar { padding-left: max(24px, calc((100vw - 1080px) / 2)); padding-right: max(24px, calc((100vw - 1080px) / 2)); }
  .client-list { display: grid; grid-template-columns: 1fr 1fr; }
  .tabbar {
    left: 50%; right: auto; bottom: 16px; transform: translateX(-50%);
    width: auto; padding: 6px; gap: 2px;
    border: 1px solid var(--line); border-radius: 999px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  }
  .tabbar a { flex: none; flex-direction: row; gap: 8px; padding: 9px 15px; font-size: 12.5px; border-radius: 999px; }
  .tabbar a.active { background: rgba(124, 156, 255, 0.12); }
  .tabbar a .ic { width: 19px; height: 19px; }
  .fab { bottom: 92px; right: 28px; }
  .toasts { bottom: 92px; }
  .client-page { max-width: 840px; }
  .hero-name { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
