/* СИГМА CRM — стиль сайта сигмацентр.рф. Сначала телефон, потом компьютер. */

@font-face { font-family: 'Nunito Sans'; font-weight: 400; font-display: swap; src: url(/static/vendor/fonts/nunito-sans-cyrillic-400-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Nunito Sans'; font-weight: 400; font-display: swap; src: url(/static/vendor/fonts/nunito-sans-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20BD; }
@font-face { font-family: 'Nunito Sans'; font-weight: 600; font-display: swap; src: url(/static/vendor/fonts/nunito-sans-cyrillic-600-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Nunito Sans'; font-weight: 600; font-display: swap; src: url(/static/vendor/fonts/nunito-sans-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20BD; }
@font-face { font-family: 'Nunito Sans'; font-weight: 700; font-display: swap; src: url(/static/vendor/fonts/nunito-sans-cyrillic-700-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Nunito Sans'; font-weight: 700; font-display: swap; src: url(/static/vendor/fonts/nunito-sans-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20BD; }
@font-face { font-family: 'Nunito Sans'; font-weight: 800; font-display: swap; src: url(/static/vendor/fonts/nunito-sans-cyrillic-800-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Nunito Sans'; font-weight: 800; font-display: swap; src: url(/static/vendor/fonts/nunito-sans-latin-800-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20BD; }

:root {
  --green: #234547;
  --green-2: #2f5b5e;
  --green-soft: #e3ecea;
  --beige: #f0eeeb;
  --beige-2: #e7e2dc;
  --paper: #ffffff;
  --rose: #cb6a7e;
  --rose-dark: #b24f65;
  --rose-soft: #f7e4e8;
  --olive: #a3c459;
  --olive-soft: #edf3dc;
  --ink: #1e2b2c;
  --muted: #5b6a6b;
  --line: #ddd7cf;
  --danger: #b3261e;
  --danger-soft: #fbe5e3;
  --warn: #9a5b00;
  --warn-soft: #fdf0d8;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(35, 69, 71, .06), 0 4px 16px rgba(35, 69, 71, .06);
  --nav-h: 64px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--beige); color: var(--ink);
  font: 400 16px/1.45 'Nunito Sans', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
}
body:has(> .nav) { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px); }
a { color: var(--green); }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.2; color: var(--green); }
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 20px; font-weight: 800; }
h3 { font-size: 17px; font-weight: 700; }
p { margin: 0 0 .75em; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* Шапка */
.top {
  position: sticky; top: 0; z-index: 20; background: var(--green); color: #fff;
  display: flex; align-items: center; gap: 12px; padding: 10px 16px; min-height: 56px;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; letter-spacing: .04em; font-size: 18px; }
.logo { width: 46px; height: 46px; border-radius: 50%; display: block; box-shadow: 0 0 0 2px rgba(255,255,255,.55); }
.logo-big { width: 140px; height: 140px; border-radius: 50%; display: block; margin: 0 auto 14px; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.top { min-height: 60px; padding-top: 7px; padding-bottom: 7px; }
.brand-mark { width: 32px; height: 32px; border-radius: 50%; background: var(--olive); color: var(--green); display: grid; place-items: center; font-size: 19px; font-weight: 800; }
.top .spacer { flex: 1; }
.top .who { font-size: 14px; opacity: .85; display: none; }
.help-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 2px solid rgba(255,255,255,.5); color: #fff;
  display: grid; place-items: center; text-decoration: none; font-weight: 800; background: transparent; cursor: pointer; font-size: 17px;
}
.help-btn:hover { background: rgba(255,255,255,.12); }

/* Переключатель «Смотреть как» (открытый показ) */
.demo-bar { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; padding: 6px 12px; background: var(--olive-soft); font-size: 14px; font-weight: 700; color: #3d5410; position: sticky; top: 56px; z-index: 19; }
.demo-bar a { padding: 5px 11px; border-radius: 99px; text-decoration: none; color: var(--green); background: #fff; }
.demo-bar a.on { background: var(--green); color: #fff; }

/* Навигация: снизу на телефоне, слева на компьютере */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--paper);
  border-top: 1px solid var(--line); display: flex; justify-content: space-around;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 2px;
  color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 700; border-radius: 12px; min-height: 48px; justify-content: center;
}
.nav a svg { width: 24px; height: 24px; }
.nav a.on { color: var(--green); background: var(--green-soft); }
.nav .desk-only { display: none; }
.nav .badge { position: absolute; }

main { padding: 16px; max-width: 1280px; margin: 0 auto; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 16px; }
.page-head h1 { margin: 0; flex: 1 1 auto; }

/* Карточки */
.card { background: var(--paper); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.card-head h2, .card-head h3 { margin: 0; flex: 1; }
.grid { display: grid; gap: 16px; }
.count { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 99px; background: var(--beige); color: var(--green); font-size: 14px; font-weight: 800; }
.count.hot { background: var(--rose); color: #fff; }

.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-top: 1px solid var(--line); padding: 12px 0; }
.list > li:first-child { border-top: 0; padding-top: 4px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row .grow { flex: 1 1 180px; min-width: 0; }
.item-title { font-weight: 700; color: var(--ink); text-decoration: none; }
a.item-title:hover { color: var(--green); text-decoration: underline; }
.empty { color: var(--muted); padding: 8px 0; }

/* Метки */
.tag { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 13px; font-weight: 700; background: var(--beige); color: var(--green); white-space: nowrap; }
.tag.rose { background: var(--rose-soft); color: var(--rose-dark); }
.tag.olive { background: var(--olive-soft); color: #4f6a17; }
.tag.danger { background: var(--danger-soft); color: var(--danger); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.green { background: var(--green); color: #fff; }

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 18px;
  border-radius: 99px; border: 2px solid var(--green); background: var(--green); color: #fff;
  font: 700 15px/1 inherit; font-family: inherit; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--green-2); border-color: var(--green-2); }
.btn.rose { background: var(--rose); border-color: var(--rose); }
.btn.rose:hover { background: var(--rose-dark); border-color: var(--rose-dark); }
.btn.ghost { background: transparent; color: var(--green); }
.btn.ghost:hover { background: var(--green-soft); }
.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn.block { width: 100%; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; }
button.link { background: none; border: 0; color: var(--green); font: inherit; text-decoration: underline; cursor: pointer; padding: 0; }

/* Формы */
label { display: block; font-weight: 700; font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.field { margin-bottom: 14px; }
.fields { display: grid; gap: 0 16px; }
input[type=text], input[type=tel], input[type=email], input[type=password], input[type=date], input[type=datetime-local],
input[type=time], input[type=number], input[type=search], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink); font: inherit; font-size: 16px;
}
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(163, 196, 89, .45); border-color: var(--green); }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--ink); font-size: 16px; min-height: 44px; }
.check input { width: 22px; height: 22px; accent-color: var(--green); }
.hint { font-size: 13px; color: var(--muted); margin-top: 4px; }
details.more > summary { cursor: pointer; font-weight: 700; color: var(--green); padding: 10px 0; list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: '+ '; }
details.more[open] > summary::before { content: '− '; }

/* Сообщения */
.flash { border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 16px; font-weight: 600; }
.flash.ok { background: var(--olive-soft); color: #3d5410; }
.flash.error { background: var(--danger-soft); color: var(--danger); }
.alert { border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 12px; background: var(--rose-soft); color: var(--rose-dark); font-weight: 600; }
.allergy { background: var(--danger-soft); color: var(--danger); border-radius: var(--radius-sm); padding: 10px 14px; font-weight: 700; }

/* Доска заявок */
.board { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.col { flex: 0 0 82%; max-width: 320px; scroll-snap-align: start; background: var(--beige-2); border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; font-weight: 800; color: var(--green); }
.col-head span:first-child { flex: 1; }
.col-body { min-height: 80px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.lead-card { user-select: none; -webkit-user-select: none; background: var(--paper); border-radius: 14px; padding: 12px; box-shadow: var(--shadow); cursor: grab; text-decoration: none; color: var(--ink); display: block; touch-action: manipulation; }
.lead-card:active { cursor: grabbing; }
.lead-card .name { font-weight: 800; }
.lead-card .meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.lead-card .tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.sortable-ghost { opacity: .35; }
.sortable-fallback { opacity: .95 !important; transform: rotate(2deg); }
.sortable-chosen { box-shadow: 0 8px 24px rgba(35, 69, 71, .25); }
.col-waitlist { background: var(--warn-soft); }
.col-won { background: var(--olive-soft); }
.drag-handle { float: right; color: var(--muted); padding: 0 0 6px 8px; font-size: 18px; line-height: 1; cursor: grab; }

/* История */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 22px; }
.timeline li::before { content: ''; position: absolute; left: 5px; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--olive); }
.timeline li::after { content: ''; position: absolute; left: 9px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline .when { font-size: 13px; color: var(--muted); }

/* Таблицы */
.table-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; color: var(--muted); font-weight: 700; }

/* Расписание */
.week { display: grid; gap: 12px; }
.day h3 { margin-bottom: 8px; }
.lesson { background: var(--paper); border-radius: 14px; padding: 10px 12px; border-left: 5px solid var(--olive); margin-bottom: 8px; box-shadow: var(--shadow); }
.lesson.conflict { border-left-color: var(--danger); background: var(--danger-soft); }
.lesson .time { font-weight: 800; color: var(--green); }
.lesson .who { font-size: 13px; color: var(--muted); }

/* Сегменты (посещаемость) */
.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 99px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 0 12px; min-height: 40px; font: 700 14px inherit; font-family: inherit; color: var(--muted); cursor: pointer; }
.seg button + button { border-left: 1.5px solid var(--line); }
.seg button.on[value=present] { background: var(--olive); color: #fff; }
.seg button.on[value=absent] { background: var(--beige-2); color: var(--ink); }
.seg button.on[value=sick] { background: var(--rose); color: #fff; }

/* Цифры */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--paper); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); text-decoration: none; color: inherit; }
.stat .n { font-size: 30px; font-weight: 800; color: var(--green); line-height: 1.1; }
.stat .l { font-size: 14px; color: var(--muted); font-weight: 600; }
.stat.hot .n { color: var(--rose); }
.money { font-size: 28px; font-weight: 800; }
.money.debt { color: var(--danger); }
.money.ok { color: #4f6a17; }

/* Столбики аналитики: одна полоса на строку, число — текстом */
.bar-row { display: grid; grid-template-columns: minmax(110px, 38%) 1fr auto; align-items: center; gap: 10px; padding: 6px 0; }
.bar-label { font-size: 14px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 14px; background: var(--beige); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--green); border-radius: 0 4px 4px 0; min-width: 0; }
.bar-fill.rose { background: var(--rose); }
.bar-row:hover .bar-fill { filter: brightness(1.15); }
.bar-value { font-size: 14px; font-weight: 800; color: var(--ink); min-width: 44px; text-align: right; }

/* Меню «Ещё» */
.menu-list a { display: flex; align-items: center; gap: 12px; padding: 14px 4px; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 700; font-size: 17px; }
.menu-list a:first-child { border-top: 0; }
.menu-list svg { width: 24px; height: 24px; color: var(--green); }

/* Справка */
.help-body h3 { margin-top: 1em; }
.help-body ul, .help-body ol { padding-left: 1.2em; }
.help-body li { margin-bottom: 4px; }

/* Вход */
main:has(> .auth) { padding: 0; max-width: none; }
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--green); }
.auth .card { width: 100%; max-width: 420px; padding: 28px 24px; }
.auth .brand-big { text-align: center; margin-bottom: 20px; }
.auth .brand-big .brand-mark { width: 64px; height: 64px; font-size: 36px; margin: 0 auto 10px; }

/* Родитель */
.parent-hero { background: var(--green); color: #fff; border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.parent-hero h1 { color: #fff; }
.parent-hero .tag { background: rgba(255,255,255,.15); color: #fff; }
.att-strip { display: flex; flex-wrap: wrap; gap: 6px; }
.att-day { width: 40px; text-align: center; border-radius: 10px; padding: 4px 0; font-size: 12px; font-weight: 700; background: var(--beige); color: var(--muted); }
.att-day.present { background: var(--olive-soft); color: #4f6a17; }
.att-day.sick { background: var(--rose-soft); color: var(--rose-dark); }
.att-day.absent { background: var(--beige-2); color: var(--ink); }

@media (min-width: 720px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
  .fields.two { grid-template-columns: 1fr 1fr; }
  .grid.two { grid-template-columns: 1fr 1fr; }
  .top .who { display: block; }
  .col { flex-basis: 280px; }
}

@media (min-width: 1024px) {
  body { padding-bottom: 0; }
  body:has(> .nav) { padding-left: 232px; }
  .top { padding-left: 24px; }
  .nav {
    top: 0; bottom: 0; right: auto; width: 232px; flex-direction: column; justify-content: flex-start; gap: 4px;
    top: 56px; border-top: 0; border-right: 1px solid var(--line); padding: 16px 12px;
  }
  .nav a { flex: 0 0 auto; flex-direction: row; justify-content: flex-start; gap: 12px; font-size: 15px; padding: 10px 14px; min-height: 44px; }
  .nav .desk-only { display: flex; }
  .nav .mobile-only { display: none; }
  .top { position: fixed; left: 0; right: 0; }
  .demo-bar { position: fixed; top: 56px; left: 0; right: 0; padding-left: 24px; }
  body:has(> .nav) > .demo-bar { padding-left: 248px; }
  body:has(> .demo-bar) main { padding-top: 136px; }
  body:has(> .demo-bar) > .nav { top: 100px; }
  main { padding: 88px 24px 24px; }
  .grid.three { grid-template-columns: 1fr 1fr 1fr; }
  .grid.main-side { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); align-items: start; }
  .week { grid-template-columns: repeat(5, 1fr); }
  .board { margin: 0; padding-left: 0; padding-right: 0; }
  .table-wrap { margin: 0; padding: 0; }
}

@media print {
  .nav, .top, .btn { display: none !important; }
  body { padding: 0; background: #fff; }
}
