/* Оформление в духе Apple: светлый серый фон, белые карточки с крупным скруглением и мягкой тенью,
   системный шрифт SF, полупрозрачные меню и верхняя панель, цвета системной палитры Apple. */
:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #f5f5f7;
  --fill: rgba(118, 118, 128, .12);      /* серые кнопки и поля, как в iOS */
  --fill-2: rgba(118, 118, 128, .2);
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: #e5e5ea;
  --line-2: #d2d2d7;
  --brand: #0071e3;
  --brand-2: #0062c4;
  --brand-soft: #e8f2fd;
  --ring: 0 0 0 4px rgba(0, 113, 227, .18);
  --ok: #248a3d;
  --ok-soft: #e3f5e8;
  --warn: #b25000;
  --warn-soft: #fff2df;
  --bad: #d70015;
  --bad-soft: #ffe9e7;
  --info: #8944ab;
  --info-soft: #f4ebfa;
  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 6px 20px rgba(0, 0, 0, .04);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, .14), 0 2px 8px rgba(0, 0, 0, .06);
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 14px/1.47 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  letter-spacing: -.005em; background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: var(--brand); text-decoration: none; }
a:not([class]):hover { text-decoration: underline; text-underline-offset: 2px; }
h1 { font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -.022em; margin: 0 0 18px; }
h2 { font-size: 19px; line-height: 1.25; font-weight: 600; letter-spacing: -.016em; margin: 0 0 12px; }
h3 { font-size: 15px; font-weight: 600; letter-spacing: -.01em; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }
.stack > * + * { margin-top: 12px; }
.grid { display: grid; gap: 20px; }
/* cN — не больше N колонок; на узком экране карточки переносятся (минимум 420 / 260 / 200 px) */
.grid.c2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, max(420px, calc((100% - 20px) / 2))), 1fr)); }
.grid.c3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, max(260px, calc((100% - 40px) / 3))), 1fr)); }
.grid.c4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, max(200px, calc((100% - 60px) / 4))), 1fr)); }
/* карточка в сетке не раздвигает колонку: широкая таблица прокручивается внутри карточки, а не наезжает на соседнюю */
.grid > * { min-width: 0; }
.grid > .card { overflow-x: auto; }
/* таблица прямо в карточке (без .table-wrap) тоже прокручивается внутри карточки, а не растягивает страницу */
.card:has(> table) { overflow-x: auto; }
/* ровно две колонки (для блоков, где часть карточек растянута на всю ширину) */
.grid.cols2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid.cols2 { grid-template-columns: minmax(0, 1fr); } }
::selection { background: rgba(0, 113, 227, .2); }

/* ---------- каркас: боковое меню и верхняя панель ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; padding: 14px 10px 10px; flex-shrink: 0; color: var(--text);
  background: rgba(242, 242, 247, .82); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-right: 1px solid rgba(0, 0, 0, .06);
  position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column; transition: width .2s var(--ease);
}
.nav { flex: 1; }
.nav a, .brand, .collapse-btn { white-space: nowrap; }
.collapse-btn {
  display: flex; gap: 10px; align-items: center; width: 100%; margin-top: 8px; padding: 8px 10px;
  background: none; border: 0; border-top: 1px solid rgba(0, 0, 0, .06); color: var(--muted);
  font: inherit; font-size: 13px; cursor: pointer; text-align: left;
}
.collapse-btn:hover { color: var(--text); }
.version-btn {
  display: flex; gap: 10px; align-items: center; width: 100%; padding: 6px 10px; background: none; border: 0;
  color: #86868b; font: inherit; font-size: 12px; cursor: pointer; text-align: left; white-space: nowrap; border-radius: 8px;
}
.version-btn:hover { color: var(--text); background: rgba(0, 0, 0, .05); }
.version-btn .ico { width: 22px; text-align: center; font-size: 14px; position: relative; }
.version-btn .dot { position: absolute; top: 0; right: 1px; width: 7px; height: 7px; border-radius: 50%; background: #34c759; }
.version-btn.fresh { color: var(--ok); }
.version-btn .lbl { overflow: hidden; text-overflow: ellipsis; }
.collapse-btn .ico { width: 22px; text-align: center; font-size: 15px; }
/* свёрнутое меню: только иконки, подписи — во всплывающей подсказке */
.shell.collapsed .sidebar { width: 68px; }
.shell.collapsed .sidebar .lbl { display: none; }
.shell.collapsed .brand { padding: 4px 6px 16px; justify-content: center; }
.shell.collapsed .nav a, .shell.collapsed .collapse-btn, .shell.collapsed .version-btn { justify-content: center; padding: 8px 0; }
.shell.collapsed .nav .section { padding: 8px 0; margin: 6px 8px; border-top: 1px solid rgba(0, 0, 0, .08); }
.backdrop { display: none; }
.brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 16px; color: var(--text); font-weight: 700; font-size: 15px; letter-spacing: -.012em; }
.brand .logo {
  width: 36px; height: 36px; border-radius: 10px; background: #fff; flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .12), inset 0 0 0 .5px rgba(0, 0, 0, .06);
  display: grid; place-items: center; font-size: 19px; overflow: hidden;
}
.nav a {
  display: flex; gap: 10px; align-items: center; color: var(--text); padding: 7px 10px; border-radius: 8px; margin-bottom: 1px;
  font-size: 14px; transition: background-color .12s;
}
.nav a:hover { background: rgba(0, 0, 0, .05); }
.nav a.active { background: var(--brand); color: #fff; font-weight: 500; }
.nav .ico { width: 22px; text-align: center; font-size: 15px; }
.nav .section { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: #86868b; padding: 16px 10px 6px; }
.main { flex: 1; min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 10px 28px; min-height: 56px;
  background: rgba(255, 255, 255, .72); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, .07); position: sticky; top: 0; z-index: 5;
}
.topbar .org { font-weight: 600; font-size: 13px; color: var(--muted); }
.topbar .who { display: flex; align-items: center; gap: 10px; }
.topbar .who .nm { font-size: 13px; line-height: 1.2; text-align: right; }
.topbar .who .nm b { display: block; font-weight: 600; color: var(--text); }
.topbar .who .nm span { color: var(--muted); font-size: 12px; }
.me-ava { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  background: linear-gradient(180deg, #a1a1a6, #7c7c80); color: #fff; font-size: 13px; font-weight: 600; letter-spacing: .02em; }
.content { padding: 28px; max-width: 1600px; }
.burger { display: none; background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--text); }

/* ---------- элементы ---------- */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; }
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.kpi .v { font-size: 32px; line-height: 1.1; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--muted); font-size: 13px; margin-top: 4px; }
.t-ok { color: var(--ok); } .t-warn { color: var(--warn); } .t-bad { color: var(--bad); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: var(--fill);
  color: var(--text); padding: 8px 15px; border-radius: 980px; cursor: pointer; font: inherit; font-weight: 500;
  white-space: nowrap; transition: background-color .15s, transform .08s, opacity .15s; min-height: 34px;
}
.btn:hover { background: var(--fill-2); }
.btn:active { transform: scale(.97); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.sm { padding: 5px 12px; font-size: 13px; min-height: 28px; }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
/* вкладки — сегментированный переключатель, как в macOS */
.tabs { display: flex; gap: 2px; padding: 3px; margin-bottom: 20px; background: var(--fill); border-radius: 10px; overflow-x: auto;
  width: fit-content; max-width: 100%; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  background: none; border: 0; padding: 6px 14px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 500; color: var(--text);
  border-radius: 8px; white-space: nowrap; transition: background-color .15s, box-shadow .15s;
}
.tabs button:hover { background: rgba(255, 255, 255, .5); }
.tabs button.active { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .1), 0 0 0 .5px rgba(0, 0, 0, .04); }
input, select, textarea {
  font: inherit; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--text); width: 100%; transition: border-color .15s, box-shadow .15s; min-height: 38px;
}
input[type=checkbox], input[type=radio] { min-height: 0; accent-color: var(--brand); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
select { appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236e6e73' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center; }
textarea { min-height: 80px; resize: vertical; }
label.f { display: block; }
label.f > span { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 5px; }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.check { display: flex; gap: 8px; align-items: center; }
.check input { width: auto; }

.table-wrap { overflow-x: auto; }
table.compact th, table.compact td { padding: 8px 4px; }
table.compact th:first-child, table.compact td:first-child { padding-left: 8px; }
table.compact th { white-space: normal; }
table { width: 100%; border-collapse: collapse; background: var(--surface); font-variant-numeric: tabular-nums; }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface); position: sticky; top: 0;
  border-bottom-color: var(--line-2); }
tbody tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #f9f9fb; }
table.grid-t th, table.grid-t td { padding: 4px; text-align: center; font-size: 12px; border: 1px solid var(--line); }
table.grid-t td.name, table.grid-t th.name { text-align: left; white-space: nowrap; position: sticky; left: 0; background: var(--surface); z-index: 1; padding: 4px 8px; }
table.grid-t td.we { background: #f5f5f7; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--fill); color: var(--muted); line-height: 1.5; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }
.money.neg { color: var(--bad); font-weight: 600; }
.money.pos { color: var(--ok); }

.att { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; font-weight: 700; font-size: 11px; }
.att.present { background: var(--ok-soft); color: var(--ok); }
.att.sick { background: var(--bad-soft); color: var(--bad); }
.att.vacation { background: var(--info-soft); color: var(--info); }
.att.absent { background: var(--warn-soft); color: var(--warn); }
.att.planned { background: var(--brand-soft); color: var(--brand); }
.grid-t tr.total td { border-top: 2px solid var(--line); background: var(--surface-2); }
.access-t td.c, .access-t th.role-h { text-align: center; min-width: 120px; }
.access-t td.c input { width: 18px; height: 18px; cursor: pointer; }
.link { color: var(--brand); cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.hist-row { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); line-height: 1.5; }
.hist-row:last-child { border-bottom: 0; }
.hist-row .when { flex: 0 0 82px; padding-top: 2px; }
.grid-t th.click, .grid-t td.click { cursor: pointer; }
.grid-t th.click:hover, .grid-t td.click:hover { background: var(--brand-soft); }
.att.manual { box-shadow: inset 0 0 0 1.5px currentColor; }

.mark-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.mark-row .who { flex: 1; min-width: 0; }
/* выбор отметки — сегментированный переключатель */
.seg { display: inline-flex; gap: 2px; padding: 2px; background: var(--fill); border-radius: 9px; }
.seg button { border: 0; background: none; padding: 6px 10px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 500; border-radius: 7px; color: var(--text); }
.seg button:hover { background: rgba(255, 255, 255, .6); }
.seg button.on { background: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.seg button.on.present { background: #34c759; color: #fff; }
.seg button.on.sick { background: #ff3b30; color: #fff; }
.seg button.on.vacation { background: #af52de; color: #fff; }
.seg button.on.absent { background: #ff9500; color: #fff; }

.bars { display: flex; gap: 6px; align-items: flex-end; height: 120px; padding-top: 8px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bars .b i { display: block; width: 100%; max-width: 28px; max-height: calc(100% - 32px); background: linear-gradient(180deg, #409cff, var(--brand)); border-radius: 6px 6px 2px 2px; }
.bars .b span { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.progress { height: 6px; background: var(--fill); border-radius: 999px; overflow: hidden; }
.progress i { display: block; height: 100%; background: #34c759; border-radius: 999px; }

.feed .item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.feed .item:last-child { border-bottom: 0; }
.feed .t { font-weight: 600; }
.kanban { display: grid; grid-template-columns: repeat(3, minmax(240px, 1fr)); gap: 16px; overflow-x: auto; }
.kanban .col { background: rgba(118, 118, 128, .08); border-radius: var(--radius); padding: 12px; min-height: 200px; }
.task { background: var(--surface); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); margin-bottom: 10px; }

.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .28); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade-in .2s ease both; }
.modal { background: var(--surface); border-radius: 22px; width: min(860px, 100%); max-height: 92vh; overflow-y: auto; padding: 26px 28px;
  box-shadow: var(--shadow-lg); animation: pop-in .28s var(--ease) both; }
.modal.sm { width: min(460px, 100%); }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .modal-bg, .modal { animation: none; } }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: rgba(29, 29, 31, .92); color: #fff;
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); padding: 12px 20px; border-radius: 14px; z-index: 99;
  box-shadow: var(--shadow-lg); max-width: min(560px, 90vw); font-weight: 500; animation: toast-in .3s var(--ease) both; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
.toast.err { background: rgba(215, 0, 21, .94); }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(60% 50% at 15% 10%, rgba(47, 111, 222, .14), transparent 70%),
    radial-gradient(50% 45% at 90% 85%, rgba(122, 90, 248, .12), transparent 70%),
    radial-gradient(40% 40% at 85% 10%, rgba(31, 157, 85, .08), transparent 70%), #f5f5f7; }
.login-wrap > .card { border: 1px solid var(--line); box-shadow: 0 10px 40px rgba(16, 24, 40, .10), 0 2px 6px rgba(16, 24, 40, .05); }
.login { width: min(520px, 100%); }
.demo-users { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.demo-users button { text-align: left; }

.child-tile { display: flex; gap: 14px; align-items: center; }
.avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 18px; flex-shrink: 0; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .d { aspect-ratio: 1; display: grid; place-items: center; border-radius: 8px; background: var(--surface-2); font-size: 13px; }
.cal .h { font-size: 11px; color: var(--muted); text-align: center; }
.cal .d.present { background: var(--ok-soft); color: var(--ok); font-weight: 700; }
.cal .d.sick { background: var(--bad-soft); color: var(--bad); }
.cal .d.vacation { background: var(--info-soft); color: var(--info); }
.cal .d.absent { background: var(--warn-soft); color: var(--warn); }
.cal .d.planned { background: var(--brand-soft); color: var(--brand); }
.cal .d.today { outline: 2px solid var(--brand); }
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; gap: 6px; align-items: center; }

.bottom-nav { display: none; }
.print-only { display: none; }

@media (max-width: 900px) {
  .sidebar { position: fixed; left: -270px; z-index: 40; transition: left .25s var(--ease); background: rgba(242, 242, 247, .96); }
  .sidebar.open { box-shadow: var(--shadow-lg); }
  .sidebar.open { left: 0; }
  /* на телефоне меню выезжает целиком — режим «свёрнуто» не применяется */
  .shell.collapsed .sidebar { width: 248px; }
  .shell.collapsed .sidebar .lbl { display: inline; }
  .shell.collapsed .nav a, .shell.collapsed .collapse-btn, .shell.collapsed .version-btn { justify-content: flex-start; padding: 9px 12px; }
  .shell.collapsed .nav .section { padding: 14px 12px 6px; margin: 0; border: 0; }
  .shell.collapsed .brand { padding: 4px 10px 18px; }
  .collapse-btn { display: none; }
  .backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .25); z-index: 39; }
  .burger { display: inline-block; }
  .content { padding: 16px; }
  .topbar { padding: 10px 14px; }
  .topbar .org { font-size: 13px; }
  .kanban { grid-template-columns: repeat(3, 85vw); }
  .mark-row { flex-wrap: wrap; }
  .seg button { padding: 8px 9px; }
}

@media (max-width: 600px) {
  .mark-row .who { flex-basis: 100%; }
  .seg { display: flex; width: 100%; }
  .seg button { flex: 1; }
  .topbar .uname { display: none; }
  .topbar .org { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  h1 { font-size: 22px; }
}

@media print {
  .sidebar, .topbar, .no-print, .tabs, .btn { display: none !important; }
  .content { padding: 0; }
  .card { box-shadow: none; padding: 0; }
  .print-only { display: block; }
  body { background: #fff; }
  table.grid-t td.name { position: static; }
}

/* ---------- переключатели модулей (панель управления садами) ---------- */
.mod-row { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.mod-row:last-of-type { border-bottom: 0; }
.brand .logo img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; background: #fff; }
.brand .lbl { overflow: hidden; text-overflow: ellipsis; }
.logo-prev { width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--line); display: inline-grid; place-items: center; font-size: 20px; background: #fff; overflow: hidden; flex: none; }
.logo-prev.big { width: 64px; height: 64px; font-size: 30px; }
.logo-prev img { width: 100%; height: 100%; object-fit: contain; }
.mod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px 12px; }
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; background: rgba(120, 120, 128, .24); border-radius: 24px; transition: background .2s; }
.switch i::before {
  content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff;
  border-radius: 50%; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .15s;
}
.switch input:checked + i { background: #34c759; }
.switch input:checked + i::before { transform: translateX(18px); }
.switch input:disabled + i { opacity: .5; }
.switch input:focus-visible + i { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- график работы ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 7px;
  padding: 2px 6px; font: inherit; font-size: 12px; font-style: normal; background: var(--surface); line-height: 1.3;
}
button.chip { cursor: pointer; padding: 5px 9px; }
button.chip.on { outline: 2px solid currentColor; outline-offset: 1px; font-weight: 600; }
.brush { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px 12px; margin-bottom: 12px;
  background: var(--surface-2); border-radius: 12px; }
.sched-t td.cell { height: 38px; min-width: 44px; user-select: none; padding: 2px; }
.sched-t.week td.cell { min-width: 92px; }
.sched-t td.cell.edit { cursor: crosshair; }
.sched-t td.cell.edit:hover { background: var(--brand-soft); }
.sched-t td.cell .chip { width: 100%; justify-content: center; flex-direction: column; gap: 0; padding: 2px; }
.sched-t td.cell .chip .g { font-size: 10px; opacity: .85; white-space: nowrap; overflow: hidden; max-width: 100%; text-overflow: ellipsis; }
.sched-t th.td, .sched-t td.td { box-shadow: inset 0 0 0 2px var(--brand-soft); }
.sched-t th.we { color: var(--bad); }
.sched-t tr.me td.name { background: var(--brand-soft); }
.sched-t td.over { color: var(--warn); font-weight: 700; }
.sched-t td.gap { background: var(--bad-soft); }
.sched-t .mini { display: inline-block; margin: 1px; padding: 0 4px; border-radius: 4px; background: var(--ok-soft); color: var(--ok); font-weight: 700; font-size: 11px; }
.sched-t .miss { color: var(--bad); font-size: 10px; font-weight: 600; white-space: nowrap; }
.my-shifts { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.my-day { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.my-day.today { border-color: var(--brand); background: var(--brand-soft); }
/* дежурства сторожей */
.watch-t td.cell { min-width: 26px; padding: 1px; }
.watch-t th, .watch-t td { padding-left: 3px; padding-right: 3px; }
.watch-t td.cell .chip { padding: 2px 0; }
.watch-t td.cell.absent { background: var(--surface-2); }
.watch-t td.cell .abs { font-size: 10px; color: var(--muted); }
.watch-t td.cell .chip.other { color: var(--muted); background: var(--surface-2); }
.watch-t td.cell.conflict { box-shadow: inset 0 0 0 2px var(--bad); }
.watch-t th .hol { color: var(--bad); font-size: 10px; margin-left: 1px; }
.watch-t tr.cover-row td { text-align: center; font-size: 12px; }
.watch-t .ok-mark { color: var(--ok); font-weight: 700; }
.fill-order { padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; }
.watch-head .approve { margin-left: auto; width: 340px; text-align: left; line-height: 1.7; margin-bottom: 12px; }
.watch-head h2 { text-align: center; }
.watch-sign { margin-top: 18px; }
.watch-sign .sign-line { display: grid; grid-template-columns: 1fr 140px 180px; gap: 12px; padding: 8px 0; }
.duty { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-top: 10px; }
.duty-i { display: flex; gap: 10px; align-items: flex-start; }
@media print {
  .sched-t td.cell .chip { border: 0; }
  .sched-t.month td.cell { min-width: 0; }
}

/* ---------- специалисты группы ---------- */
.g-staff { margin: 10px 0; padding: 10px 12px; background: var(--surface-2); border-radius: 12px; }
.g-staff .row { padding: 2px 0; gap: 8px; }
.staff-row { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 8px; align-items: center; margin-bottom: 6px; }
@media (max-width: 600px) { .staff-row { grid-template-columns: 1fr; } }

/* выписка о персональных данных — поверх приложения */
.pd-report { position: fixed; inset: 0; z-index: 80; background: var(--surface); display: flex; flex-direction: column; }
.pd-bar { display: flex; gap: 8px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pd-report iframe { flex: 1; width: 100%; border: 0; background: #fff; }
@media print { .pd-report { display: none; } }

/* предупреждение на сводке (ЭЦП) */
.alert-card { background: linear-gradient(180deg, #fff8ee, #fff 70%); box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 149, 0, .18); }
.alert-card h2.fold { margin: 0; cursor: pointer; user-select: none; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.alert-card h2.fold .badge { font-size: 12px; }
.caret { display: inline-block; width: 12px; font-size: 13px; color: var(--muted); transition: transform .15s; }
.caret.on { transform: rotate(90deg); }
.alert-card .sig-row { padding: 8px 0; border-top: 1px solid rgba(0,0,0,.06); flex-wrap: wrap; gap: 4px; }

/* история обновлений */
.changelog { max-height: 70vh; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.cl-ver { padding: 12px 0; border-top: 1px solid var(--line); }
.cl-ver:first-child { border-top: 0; padding-top: 0; }
.cl-head { display: flex; gap: 10px; align-items: center; }
.cl-num { font-weight: 700; font-size: 17px; }
.cl-title { font-weight: 600; margin: 2px 0 6px; }
.cl-ver ul { margin: 0; padding-left: 20px; }
.cl-ver li { margin: 4px 0; line-height: 1.45; }
.cl-who { font-size: 11px; color: var(--muted); background: var(--fill); border-radius: 6px; padding: 1px 6px; white-space: nowrap; }

/* санитарные журналы */
.san-row { padding: 8px 0; border-top: 1px solid var(--line); flex-wrap: wrap; gap: 6px; }
.san-row:first-child { border-top: 0; }
.san-grid th, .san-grid td.cell { text-align: center; padding: 6px 4px; min-width: 34px; font-size: 13px; }
.san-grid td.cell.bad { background: var(--bad-soft); color: var(--bad); font-weight: 700; }
.san-grid .today { background: var(--warn-soft); }
.san-grid td.cell .hum { font-size: 10px; color: var(--muted); }
.san-grid td.cell.empty { box-shadow: inset 0 0 0 2px var(--warn); }
.san-meal { padding: 8px 0; border-top: 1px solid var(--line); }
.san-dish { padding: 4px 0 4px 8px; flex-wrap: wrap; gap: 8px; }
.san-pick { max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding: 6px 0; }
@media print {
  .san-print, .san-grid { font-size: 10px; border-collapse: collapse; width: 100%; }
  .san-print th, .san-print td, .san-grid th, .san-grid td { border: 1px solid #000 !important; padding: 2px 3px !important; }
  .san-grid .today, .san-grid td.cell.empty { background: none; box-shadow: none; }
  .table-wrap { overflow: visible !important; }
}
@media print {
  .grid.r85 { display: grid !important; }
  .card.r85 { display: block !important; margin-top: 12px; }
  .r85 table { font-size: 11px; }
}
.san-grid td.cell input, td > input[type=checkbox] { width: auto; }

/* официальные страницы сада */
.org-links { display: flex; flex-direction: column; gap: 6px; }
.login .org-links { margin-top: 14px; }
.org-link { text-decoration: none; }
.org-link .ol-ic { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 3px; border-radius: 6px; font-size: 11px; font-weight: 700; color: #fff; }
.ol-website .ol-ic { background: none; font-size: 15px; }
.ol-max .ol-ic { background: linear-gradient(135deg, #3b82f6, #8b5cf6); }
.ol-vk .ol-ic { background: #0077ff; }

/* дни рождения сотрудников */
.bday-card { background: linear-gradient(180deg, #fff5fa, #fff 70%); box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 45, 85, .14); }
.bday-card .sig-row { padding: 6px 0; border-top: 1px solid var(--line); flex-wrap: wrap; gap: 4px; }
.bday-card .bday-today { background: #ffeef5; margin: 0 -12px; padding: 10px 12px; border-radius: 12px; border-top-color: transparent; }
.bday-mark { color: #d6266b; font-size: 12px; font-weight: 600; }
tr.bday-row td { background: #fdf2f8; }

/* личное дело и график отпусков */
.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 16px; }
.vac-months { display: grid; grid-template-columns: repeat(12, 1fr); font-weight: 500; font-size: 11px; color: var(--muted); }
.vac-line { position: relative; height: 18px; background: var(--bg); border-radius: 4px; margin-top: 2px; }
.vac-grid { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.vac-today { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--bad); z-index: 1; }
.vac-bar { position: absolute; top: 2px; bottom: 2px; border-radius: 3px; background: var(--brand); }
.vac-bar.extra { background: #6366f1; }
.vac-bar.study, .vac-sw.study { background: #10b981; }
.vac-bar.unpaid, .vac-sw.unpaid { background: #94a3b8; }
.vac-sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--brand); margin-right: 4px; vertical-align: -1px; }
.vac-list span + span::before { content: ' · '; }
.alerts-row > .card { margin: 0; }
.course-row { padding: 6px 0; border-top: 1px solid var(--line); flex-wrap: wrap; gap: 4px; }
/* нечётное число предупреждений: последнее — во всю ширину */
.alerts-row > :last-child:nth-child(odd) { grid-column: 1 / -1; }

.feed-toggle { margin-top: 10px; }
@media print { .feed-toggle { display: none; } }

/* расписание уроков */
table.lgrid { table-layout: fixed; min-width: 640px; }
table.lgrid th, table.lgrid td { border: 1px solid var(--line); padding: 4px; vertical-align: top; text-align: left; }
table.lgrid th { text-align: center; font-size: 13px; }
table.lgrid .ln { width: 74px; text-align: center; }
table.lgrid td.hol, table.lgrid th.hol { background: #f5f5f7; }
table.lgrid td.edit { cursor: pointer; }
table.lgrid td.edit:hover { background: var(--brand-soft); }
.lcell { border-radius: 8px; padding: 5px 7px; background: var(--surface-2); font-size: 13px; line-height: 1.3; cursor: pointer; }
.lcell + .lcell { margin-top: 3px; }
.lcell.need { background: var(--bad-soft); box-shadow: inset 3px 0 0 var(--bad); }
.lcell.changed, .lcell.sub { background: var(--warn-soft); box-shadow: inset 3px 0 0 var(--warn); }
.lcell.cancel { opacity: .6; text-decoration: line-through; }
.lcell.away { opacity: .55; }
.lcell-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; background: var(--surface-2); }
.lcell-key.need { background: var(--bad); } .lcell-key.changed { background: var(--warn); } .lcell-key.cancel { background: var(--muted); }
.add-sub { display: block; font-size: 11px; color: var(--brand); margin-top: 3px; }
@media print { table.lgrid { min-width: 0; font-size: 11px; } .lcell { background: none; padding: 2px 0; } }

/* меню питания: блюда с выходом и калорийностью */
.menu-meal { padding: 8px 0; border-bottom: 1px solid var(--line); }
.menu-meal:last-child { border-bottom: 0; }
.menu-meal.click { cursor: pointer; }
.menu-items { width: 100%; margin-top: 4px; font-size: 13px; border-collapse: collapse; }
.menu-items td { padding: 2px 0; border: 0; vertical-align: top; }
.menu-items td + td { padding-left: 8px; }

/* вход через Яндекс ID */
.ya-ic { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%;
  background: #fc3f1d; color: #fff; font-weight: 700; font-size: 13px; line-height: 1; margin-right: 8px; vertical-align: -4px; }
.ya-btn { justify-content: center; background: #000; color: #fff; border-color: #000; text-decoration: none; }
.ya-btn:hover { background: #222; color: #fff; }
.or-line { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.or-line::before, .or-line::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.ya-err { padding: 10px 12px; border-radius: 12px; background: var(--bad-soft); color: var(--bad); line-height: 1.4; }
.ya-box { padding: 14px; border: 1px solid var(--line); border-radius: 14px; }
.ya-box p { margin: 8px 0; }
.ya-ic.sm { width: 16px; height: 16px; font-size: 11px; margin-right: 5px; vertical-align: -3px; }
.ya-badge { white-space: nowrap; font-size: 13px; }

/* ---------- страница входа (в духе Apple: матовая карточка, сгруппированные поля, крупные кнопки) ---------- */
.auth { --auth-blue: var(--brand); padding: 32px 16px; }
.auth-card { width: min(440px, 100%); padding: 40px 32px 28px; border-radius: 28px; text-align: center;
  background: rgba(255, 255, 255, .78); -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  border: 1px solid rgba(255, 255, 255, .7); box-shadow: 0 24px 64px rgba(15, 23, 42, .10), 0 2px 8px rgba(15, 23, 42, .04);
  animation: auth-in .45s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes auth-in { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .auth-card { animation: none; } }
.auth .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.auth-head { margin-bottom: 28px; }
.auth-logo { width: 76px; height: 76px; margin: 0 auto 18px; border-radius: 22px; display: grid; place-items: center; font-size: 38px;
  background: #fff; box-shadow: 0 8px 24px rgba(15, 23, 42, .12), inset 0 0 0 1px rgba(15, 23, 42, .05); overflow: hidden; }
.auth-logo img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.auth-head h1 { font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -.022em; margin: 0 0 8px; color: #1d1d1f; }
.auth-head p { margin: 0; font-size: 15px; line-height: 1.4; color: #6e6e73; }
.auth-fields { text-align: left; border: 1px solid #d2d2d7; border-radius: 14px; background: #fff; overflow: hidden;
  transition: border-color .15s, box-shadow .15s; }
.auth-fields:focus-within { border-color: var(--auth-blue); box-shadow: 0 0 0 4px rgba(47, 111, 222, .16); }
.auth-fields label { display: flex; align-items: center; position: relative; }
.auth-fields label + label { border-top: 1px solid #e5e5ea; }
.auth-fields input { border: 0; border-radius: 0; background: transparent; height: 54px; padding: 0 16px; font-size: 17px; color: #1d1d1f; outline: none; }
.auth-fields input::placeholder { color: #8e8e93; }
.auth-eye { flex-shrink: 0; margin-right: 10px; padding: 6px 8px; border: 0; background: none; color: var(--auth-blue); font: inherit; font-size: 13px; cursor: pointer; border-radius: 8px; }
.auth-eye:hover { background: rgba(47, 111, 222, .08); }
.auth-btn { display: flex; align-items: center; justify-content: center; width: 100%; height: 50px; margin-top: 14px; border: 0; border-radius: 14px;
  font: inherit; font-size: 17px; font-weight: 600; letter-spacing: -.01em; cursor: pointer; text-decoration: none;
  transition: background-color .15s, transform .08s, opacity .15s; }
.auth-btn:active { transform: scale(.985); }
.auth-btn:disabled { opacity: .55; cursor: default; transform: none; }
.auth-btn.primary { background: var(--auth-blue); color: #fff; }
.auth-btn.primary:hover:not(:disabled) { background: var(--brand-2); }
.auth-btn.ya { background: #1d1d1f; color: #fff; margin-top: 0; }
.auth-btn.ya:hover { background: #000; color: #fff; }
.auth-btn .ya-ic { width: 22px; height: 22px; font-size: 14px; margin-right: 10px; vertical-align: 0; }
.auth-or { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: #8e8e93; font-size: 13px; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; border-top: 1px solid #e5e5ea; }
.auth-msg { margin-top: 14px; text-align: left; border-radius: 12px; }
.auth-demo { margin-top: 24px; text-align: left; }
.auth-cap { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: #8e8e93; margin: 0 0 8px 4px; }
.auth .demo-users button { border: 0; border-radius: 12px; padding: 11px 12px; background: rgba(118, 118, 128, .10); color: #1d1d1f;
  font: inherit; font-size: 14px; cursor: pointer; transition: background-color .15s; }
.auth .demo-users button:hover { background: rgba(118, 118, 128, .18); }
.auth-links { margin-top: 26px; align-items: center; }
.auth-links .row { justify-content: center; gap: 6px !important; }
.auth-links .org-link { border: 0; border-radius: 999px; padding: 6px 10px; gap: 4px; background: rgba(118, 118, 128, .10); color: #1d1d1f; font-size: 13px; }
.auth-links .ol-website .ol-ic { min-width: 16px; font-size: 13px; }
.auth-links .org-link:hover { background: rgba(118, 118, 128, .18); }
.auth-apply { display: block; margin-top: 22px; font-size: 15px; color: var(--auth-blue); }
.auth-apply:hover, .auth-policy:hover { text-decoration: underline; }
.auth-policy { display: block; margin-top: 18px; font-size: 12px; color: #8e8e93; }
@media (max-width: 480px) {
  .auth { padding: 16px 12px; place-items: start center; }
  .auth-card { padding: 32px 20px 24px; border-radius: 24px; margin-top: 4vh; }
  .auth-head h1 { font-size: 24px; }
}

/* ---------- полезные ссылки на сводке: значки как у приложений iPhone ---------- */
.lessons-row { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.lessons-row.solo { grid-template-columns: minmax(0, 1fr); }
.lessons-row.solo .quick-card { max-width: 520px; }
@media (max-width: 1100px) { .lessons-row { grid-template-columns: minmax(0, 1fr); } }
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 16px 8px; margin-top: 16px; }
.app { display: flex; flex-direction: column; align-items: center; gap: 7px; color: var(--text); text-decoration: none; min-width: 0; }
.app:hover { text-decoration: none; }
.app-sq { width: 60px; height: 60px; border-radius: 15px; display: grid; place-items: center; font-size: 29px; line-height: 1; color: #fff;
  font-weight: 700; box-shadow: 0 4px 12px rgba(0, 0, 0, .14), inset 0 0 0 .5px rgba(255, 255, 255, .25); transition: transform .15s var(--ease), box-shadow .15s; }
.app:hover .app-sq { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0, 0, 0, .18); }
.app:active .app-sq { transform: scale(.94); }
.app-lbl { font-size: 12px; line-height: 1.25; text-align: center; max-width: 84px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ac-blue { background: linear-gradient(180deg, #5ac8fa, #007aff); }
.ac-green { background: linear-gradient(180deg, #6fe08a, #28b84c); }
.ac-orange { background: linear-gradient(180deg, #ffb340, #ff8a00); }
.ac-red { background: linear-gradient(180deg, #ff6b61, #ff3b30); }
.ac-purple { background: linear-gradient(180deg, #d17cf0, #a33fd6); }
.ac-teal { background: linear-gradient(180deg, #5fd7e0, #20a8b6); }
.ac-indigo { background: linear-gradient(180deg, #7d7af7, #4b47d6); }
.ac-pink { background: linear-gradient(180deg, #ff7aa2, #ff2d6f); }
.ac-yellow { background: linear-gradient(180deg, #ffe066, #ffc400); }
.ac-gray { background: linear-gradient(180deg, #b8b8bd, #8e8e93); }
.ql-row { display: grid; grid-template-columns: auto 64px 1fr 2fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ql-row .app-sq { width: 44px; height: 44px; border-radius: 11px; font-size: 22px; box-shadow: 0 2px 6px rgba(0, 0, 0, .12); }
.ql-colors { display: flex; gap: 6px; flex-wrap: wrap; grid-column: 2 / -1; }
.ql-colors button { width: 22px; height: 22px; border-radius: 7px; border: 0; cursor: pointer; padding: 0; }
.ql-colors button.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--brand); }
@media (max-width: 700px) { .ql-row { grid-template-columns: auto 1fr; } .ql-row > input, .ql-row > .ql-url { grid-column: 1 / -1; } }

/* Сводка: отсутствующие сегодня поимённо, телефоны родителей по нажатию */
.abs-list { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; max-height: 420px; overflow-y: auto; }
.abs-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; transition: background .15s; }
.abs-row:hover, .abs-row.on { background: var(--fill); }
.abs-nm { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.abs-gr { flex: none; font-size: 12px; font-weight: 600; color: var(--brand); background: var(--brand-soft); padding: 2px 8px; border-radius: 999px; }
.abs-ph { flex: none; color: var(--muted); font-size: 13px; opacity: .6; }
.abs-row.on .abs-ph, .abs-row:hover .abs-ph { opacity: 1; color: var(--brand); }
.abs-ct { margin: 0 4px 6px 10px; padding: 8px 12px; border-left: 2px solid var(--brand); display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.abs-tel { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Временный классный руководитель */
.sub-chip { margin-top: 6px; font-size: 12px; padding: 4px 8px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); }
.sub-hint { padding: 8px 10px; border-radius: 10px; background: var(--warn-soft); font-size: 14px; gap: 8px; flex-wrap: wrap; }
.sub-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.sub-row.past { opacity: .6; }

/* Сводка: сотрудники на больничном и в отпуске */
.away-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; transition: background .15s; }
.away-row:hover { background: var(--fill); }
.away-ic { font-size: 18px; line-height: 1.3; }
