/* Тема FL-Theme (tweakcn.com/themes/cmq57ht7w000204l2axo6ho9v). Цвета, шрифт и скругления заданы только здесь. */
:root {
  --background: oklch(0.9680 0.0059 239.8195);
  --foreground: oklch(0.3098 0.0748 248.9089);
  --card: oklch(1 0 0);
  --primary: oklch(0.7347 0.1447 228.9136);
  --primary-foreground: oklch(1 0 0);
  --secondary: oklch(0.3098 0.0748 248.9089);
  --secondary-foreground: oklch(1 0 0);
  --muted: oklch(0.9352 0.0412 217.6616);
  --muted-foreground: oklch(0.4186 0.0765 246.7831);
  --accent: oklch(0.9352 0.0412 217.6616);
  --destructive: oklch(0.5014 0.2027 23.8197);
  --border: oklch(0.8761 0 0);
  --input: oklch(1 0 0);
  --ring: oklch(0.3098 0.0748 248.9089);
  --chart-1: oklch(0.3098 0.0748 248.9089);
  --chart-2: oklch(0.7347 0.1447 228.9136);
  --chart-3: oklch(0.8353 0.0553 213.7694);
  --chart-4: oklch(0.9630 0.0296 94.3436);
  --sidebar: oklch(0.3098 0.0748 248.9089);
  --sidebar-foreground: oklch(1 0 0);
  --sidebar-primary: oklch(0.7347 0.1447 228.9136);
  --radius: 0.75rem;
  --font: Inter, ui-sans-serif, system-ui, sans-serif;
  --sp: 0.25rem;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.5 var(--font); color: var(--foreground); background: var(--background); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 14px; }
a { color: inherit; }
.muted { color: var(--muted-foreground); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.tc { text-align: center; }
.only-phone { display: none; }

/* ---------- кнопки и поля ---------- */
button, .btn {
  font: inherit; font-weight: 550; font-size: 14px; cursor: pointer; border: 1px solid transparent;
  border-radius: calc(var(--radius) - 4px); padding: calc(var(--sp) * 2) calc(var(--sp) * 3.5);
  background: var(--primary); color: var(--primary-foreground); display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none; transition: filter .15s, background .15s;
}
button:hover, .btn:hover { filter: brightness(0.95); }
button:disabled { opacity: .55; cursor: default; }
button.secondary { background: var(--secondary); color: var(--secondary-foreground); }
button.ghost { background: transparent; color: var(--foreground); border-color: var(--border); }
button.ghost:hover { background: var(--accent); filter: none; }
button.danger { background: transparent; color: var(--destructive); border-color: var(--border); }
button.link { background: none; padding: 0; color: var(--muted-foreground); font-weight: 500; }
button.link:hover { color: var(--foreground); }
input, select, textarea {
  font: inherit; color: inherit; background: var(--input); border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 4px); padding: calc(var(--sp) * 2) calc(var(--sp) * 3); width: 100%;
}
textarea { resize: vertical; min-height: 64px; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
label { display: grid; gap: 4px; font-size: 13px; font-weight: 550; color: var(--muted-foreground); }
.row { display: flex; gap: calc(var(--sp) * 3); align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: calc(var(--sp) * 3); }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: calc(var(--sp) * 5); }
.error { color: var(--destructive); font-size: 13px; min-height: 18px; }

/* ---------- каркас ---------- */
.layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: var(--sidebar); color: var(--sidebar-foreground); padding: calc(var(--sp) * 5) calc(var(--sp) * 4); display: flex; flex-direction: column; gap: calc(var(--sp) * 6); position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: 10px; align-items: center; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; background: var(--sidebar-primary); display: grid; place-items: center; font-weight: 750; font-size: 12.5px; letter-spacing: .02em; color: #fff; flex: none; }
.brand b { display: block; font-size: 15px; line-height: 1.2; }
.brand span { font-size: 12px; opacity: .7; }
.nav { display: grid; gap: 2px; }
.nav button { background: transparent; color: var(--sidebar-foreground); justify-content: flex-start; opacity: .78; font-weight: 500; width: 100%; }
.nav button:hover { background: rgb(255 255 255 / .08); opacity: 1; filter: none; }
.nav button.active { background: rgb(255 255 255 / .12); opacity: 1; }
.nav .count { margin-left: auto; font-size: 12px; opacity: .7; }
.me { margin-top: auto; border-top: 1px solid rgb(255 255 255 / .15); padding-top: calc(var(--sp) * 4); font-size: 13px; }
.me b { display: block; font-size: 14px; }
.me button { margin-top: 8px; color: rgb(255 255 255 / .7); }
.me button:hover { color: #fff; }
main { padding: calc(var(--sp) * 7) calc(var(--sp) * 8); min-width: 0; }
.topbar { display: flex; gap: calc(var(--sp) * 3); align-items: center; margin-bottom: calc(var(--sp) * 6); flex-wrap: wrap; }
.topbar h1 { margin-right: auto; }
.topbar input { width: 260px; }

/* ---------- стадии ---------- */
.stage-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.s-invited { --stage: var(--chart-3); }
.s-trial { --stage: var(--chart-2); }
.s-paid { --stage: var(--chart-1); }
.stage-dot { background: var(--stage); }
.badge { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--muted); color: var(--foreground); }

/* ---------- доска ---------- */
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: calc(var(--sp) * 4); align-items: start; }
.column { background: var(--muted); border-radius: var(--radius); padding: calc(var(--sp) * 3); min-height: 200px; border: 2px dashed transparent; transition: border-color .15s; }
.column.drop { border-color: var(--primary); }
.column-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 12px; border-bottom: 3px solid var(--stage); margin-bottom: 12px; }
.column-head h2 { font-size: 14px; }
.column-head .num { margin-left: auto; font-weight: 700; font-size: 13px; background: var(--card); border-radius: 999px; padding: 1px 9px; }
.column-sub { font-size: 12px; color: var(--muted-foreground); margin: -6px 6px 10px; }
.stage-tabs { display: none; }
.stage-tabs button { flex: 1; justify-content: center; background: transparent; color: var(--foreground); font-size: 13px; padding: 8px 4px; gap: 5px; }
.stage-tabs button b { font-size: 12px; background: var(--muted); border-radius: 999px; padding: 0 7px; }
.stage-tabs button.on { background: var(--card); border-color: var(--border); }
.stage-tabs button.on b { background: var(--stage); color: #fff; }
.stage-tabs button.s-invited.on b { color: var(--foreground); }   /* светлый фон — тёмные цифры */
.lead { background: var(--card); border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px); padding: 12px 14px; margin-bottom: 8px; cursor: pointer; display: grid; gap: 6px; }
.lead:hover { border-color: var(--primary); }
.lead.dragging { opacity: .5; }
.lead-name { font-weight: 600; }
.lead-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted-foreground); }
.lead-actions { display: flex; gap: 6px; margin-top: 4px; }
.lead-actions button { font-size: 12.5px; padding: 4px 10px; }
.empty { text-align: center; color: var(--muted-foreground); font-size: 13px; padding: 24px 8px; }

/* ---------- сводка ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: calc(var(--sp) * 4); margin-bottom: calc(var(--sp) * 6); }
.kpi .label { font-size: 13px; color: var(--muted-foreground); }
.kpi .value { font-size: 24px; font-weight: 700; margin-top: 4px; white-space: nowrap; }
.kpi .hint { font-size: 12.5px; color: var(--muted-foreground); }
.funnel { display: grid; gap: 14px; }
.funnel-row { display: grid; grid-template-columns: 170px 1fr 90px; gap: 14px; align-items: center; font-size: 14px; }
.bar { height: 28px; background: var(--muted); border-radius: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--stage); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: .04em; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.section-title { margin: calc(var(--sp) * 7) 0 calc(var(--sp) * 3); }

/* ---------- карточка ученика (боковая панель) ---------- */
dialog { border: 1px solid var(--border); border-radius: var(--radius); padding: 0; color: inherit; background: var(--card); max-width: calc(100vw - 24px); }
dialog::backdrop { background: oklch(0.3098 0.0748 248.9089 / .35); }
dialog.drawer { margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: 520px; border-radius: var(--radius) 0 0 var(--radius); }
dialog.modal { width: 440px; }
.dlg-body { padding: calc(var(--sp) * 6); display: grid; gap: calc(var(--sp) * 4); }
.dlg-body > *, .grid2 > *, .block > *, label { min-width: 0; }   /* поле даты не должно распирать карточку на телефоне */
input { min-width: 0; }
.dlg-head { display: flex; align-items: start; gap: 12px; }
.dlg-head h2 { font-size: 20px; }
.dlg-head > :first-child { margin-right: auto; }
.stage-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; background: var(--muted); padding: 4px; border-radius: var(--radius); }
.stage-switch button { background: transparent; color: var(--foreground); font-weight: 550; justify-content: center; font-size: 13px; }
.stage-switch button.on { background: var(--card); border-color: var(--border); }
.block { border-top: 1px solid var(--border); padding-top: calc(var(--sp) * 4); display: grid; gap: 10px; }
.list { display: grid; gap: 8px; }
.item { font-size: 13.5px; display: grid; gap: 2px; }
.item .when { font-size: 12px; color: var(--muted-foreground); }
.invite-box { background: var(--accent); border-radius: calc(var(--radius) - 4px); padding: 10px 12px; font-size: 13px; word-break: break-all; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--secondary); color: var(--secondary-foreground); padding: 10px 18px; border-radius: var(--radius); font-size: 14px; z-index: 50; }

/* ---------- абонементы и посещения ---------- */
.pkg-chip { font-weight: 600; color: var(--foreground); }
.pkg-chip.pkg-expired, .pkg-chip.pkg-used_up { color: var(--muted-foreground); font-weight: 500; }
.pay { border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px); padding: 10px 12px; display: grid; gap: 8px; }
.pay-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.pay .pkg { border-style: dashed; }
.pkg { border: 1px solid var(--border); border-radius: calc(var(--radius) - 4px); padding: 10px 12px; display: grid; gap: 6px; }
.pkg.pkg-expired, .pkg.pkg-used_up { opacity: .75; }
.small-btn { font-size: 12.5px; padding: 4px 10px; }
.visits { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.visit { display: inline-flex; gap: 4px; align-items: center; font-size: 12.5px; background: var(--muted); border-radius: 999px; padding: 2px 6px 2px 10px; }
.visit-free { outline: 1px dashed var(--muted-foreground); }
.visit button.link { font-size: 11px; padding: 0 4px; }
.subform { border-top: 1px dashed var(--border); padding-top: 10px; display: grid; gap: 8px; }
.announce-bar { display: grid; gap: 6px; margin-bottom: 12px; color: var(--muted-foreground); }
.announce-bar a { color: var(--primary); }
.issues { border: 1px dashed var(--border); border-radius: calc(var(--radius) - 4px); padding: 8px 12px; display: grid; gap: 4px; }
.lesson-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; scrollbar-width: thin; }
.lesson-chip { flex: 0 0 auto; display: grid; gap: 2px; justify-items: start; text-align: left; min-width: 150px; max-width: 220px; padding: 10px 12px;
  background: var(--card); color: var(--foreground); border: 1px solid var(--border); box-shadow: none; font-weight: 500; font-size: 13px; }
.lesson-chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.lesson-chip:hover { filter: none; border-color: var(--primary); }
.lesson-chip.on { border: 2px solid var(--primary); padding: 9px 11px; }
.lesson-chip.past { opacity: .7; }
.lesson-card { display: grid; gap: 8px; margin-bottom: 14px; padding: 14px 18px; }
.lesson-topic { font-weight: 650; color: var(--primary); margin: 0; }
.sheet-tools { margin-bottom: 4px; }
.sheet-tools input[type=search] { flex: 1; min-width: 160px; width: auto; }
label.inline { display: flex; align-items: center; gap: 8px; font-weight: 500; }
label.inline input { width: auto; }
.sheet-card { padding: 4px 0; }
.sheet-row { display: flex; gap: 14px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--border); cursor: pointer; color: var(--foreground); font-size: 14.5px; font-weight: 500; }
.sheet-row:last-child { border-bottom: 0; }
.sheet-row input { width: 22px; height: 22px; flex: none; accent-color: var(--primary); }
.sheet-row.on { background: var(--accent); }
.sheet-main { display: grid; gap: 2px; min-width: 0; }
.schedule { display: grid; gap: 2px; margin-top: 16px; border-top: 1px solid var(--border); padding-top: 12px; }
.schedule-row { display: grid; grid-template-columns: minmax(150px, auto) 1fr; gap: 2px 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.schedule-row:last-child { border-bottom: 0; }
.schedule-row .after-end { grid-column: 1 / -1; }
.after-end { display: inline-block; font-size: 12px; color: var(--destructive); margin: 2px 0 6px; }
@media (max-width: 520px) { .schedule-row { grid-template-columns: 1fr; } }
.pkg-big { font-size: 22px; font-weight: 700; margin: 4px 0; }

/* ---------- вход и кабинет ученика ---------- */
.center { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth { width: 100%; max-width: 380px; display: grid; gap: 16px; }
.auth .brand { color: var(--foreground); justify-content: center; margin-bottom: 8px; }
.auth .brand span { color: var(--muted-foreground); opacity: 1; }
.auth form { display: grid; gap: 14px; }
.auth button[type=submit] { justify-content: center; padding: 10px; }
.cabinet { max-width: 640px; margin: 0 auto; padding: 32px 20px 48px; display: grid; gap: 16px; }
.cabinet-top { display: flex; align-items: center; gap: 12px; }
.cabinet-top .brand { color: var(--foreground); margin-right: auto; }
.cabinet-top .brand span { color: var(--muted-foreground); opacity: 1; }
.hero { background: var(--sidebar); color: var(--sidebar-foreground); border: 0; }
.hero .muted { color: rgb(255 255 255 / .72); }
.hero h1 { font-size: 26px; margin: 6px 0 4px; }
.next-class .value { font-size: 20px; font-weight: 650; margin: 4px 0 12px; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  /* Шапка на телефоне: строка 1 — логотип, имя и «Выйти»; строка 2 — меню равными кнопками на всю ширину */
  .only-wide { display: none !important; }
  .only-phone { display: inline; }
  .sidebar { position: static; height: auto; display: grid; grid-template-columns: 1fr auto; align-items: center; padding: 10px 14px 12px; gap: 10px 12px; }
  .brand b { font-size: 14px; }
  .brand span { font-size: 12px; }
  .me { grid-column: 2; grid-row: 1; margin: 0; border: 0; padding: 0; }
  .me > div { display: none; }
  .me button { margin: 0; padding: 6px 12px; border: 1px solid rgb(255 255 255 / .25); border-radius: 999px; font-size: 13px; color: #fff; }
  .nav { grid-column: 1 / -1; display: flex; overflow-x: auto; scrollbar-width: none; gap: 4px; background: rgb(255 255 255 / .08); padding: 4px; border-radius: var(--radius); }
  .nav button { flex: 1 0 auto; }
  .nav button { width: auto; justify-content: center; padding: 7px 4px; font-size: 13px; gap: 5px; }
  .nav button.active { background: #fff; color: var(--foreground); }
  .nav .count { margin-left: 0; }
  main { padding: 20px 16px; }
  .board { grid-template-columns: 1fr; }
  .stage-tabs { display: flex; gap: 4px; background: var(--muted); padding: 4px; border-radius: var(--radius); margin-bottom: 12px; position: sticky; top: 8px; z-index: 5; }
  .column.off { display: none; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .topbar input { width: 100%; }
  dialog.drawer { width: 100vw; max-width: 100vw; border-radius: 0; }
  .dlg-body { padding: 20px 16px; }
  .stage-switch button { padding: 8px 4px; }
  .grid2 { grid-template-columns: 1fr; }
  .funnel-row { grid-template-columns: 110px 1fr 70px; }
  main .card:has(> table) { overflow-x: auto; padding: 12px; }   /* широкая таблица листается внутри карточки */
  th, td { padding: 8px; white-space: nowrap; }
}

/* страница записи (club.setelecktro.ru) */
.auth.apply { max-width: 460px; }
.apply-title { font-size: 20px; margin: 0 0 4px; }
.apply-done { display: grid; gap: 10px; text-align: center; padding: 8px 0; }
.consent { align-items: flex-start; font-size: 13px; color: var(--muted-foreground); }
.consent input { margin-top: 2px; width: 18px; height: 18px; padding: 0; flex: none; accent-color: #e8c062; }
.consent a, .apply-done a { color: var(--secondary); }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }   /* поле-ловушка для роботов */
.legal { max-width: 760px; margin: 0 auto; padding: 32px 20px 64px; line-height: 1.6; }
.legal h1 { font-size: 22px; } .legal h2 { font-size: 16px; margin-top: 24px; }
.src-site { font-size: 11px; padding: 1px 6px; border-radius: 6px; border: 1px solid rgb(232 192 98 / .45); color: var(--secondary); }
