/* ===== GBee Daily Tracker — дизайн в стиле GBee Finance (liquid glass, тёплый янтарь) ===== */

:root {
  --bg: #faf4e8;
  --ink: #3d2b1f;        /* тёмно-коричневый текст */
  --ink-soft: #7a6650;
  --cream: #e8cfa0;
  --amber: #f29e1b;      /* основной */
  --amber-2: #e8a825;    /* акцент */
  --amber-600: #d9870f;
  --green: #0f9d6b;
  --green-700: #0a7d54;
  --red: #dc2626;
  --line: rgba(120, 80, 20, 0.14);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Calibri, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; margin: 0; }

body {
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1200px 600px at 8% -10%, rgba(255, 210, 110, 0.22), transparent 60%),
    radial-gradient(900px 500px at 110% 10%, rgba(255, 160, 90, 0.15), transparent 60%),
    radial-gradient(800px 600px at 50% 110%, rgba(255, 225, 150, 0.18), transparent 60%),
    linear-gradient(180deg, #fffaee 0%, #fbf1dc 100%);
  background-attachment: fixed;
}

/* Тонкое «зерно» для глубины стекла */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.18;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='matrix' values='0 0 0 0 0.2  0 0 0 0 0.15  0 0 0 0 0.05  0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
}
body > * { position: relative; z-index: 1; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; margin: 0; }

a { color: inherit; text-decoration: none; }

/* Скроллбар */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(180, 120, 40, 0.18);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* Фокус — мягкий янтарь */
:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(242, 158, 27, 0.35);
  border-radius: var(--radius-sm);
}

/* ===== Стеклянные поверхности ===== */
.glass {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.78) 0%, rgba(255, 255, 255, 0.5) 100%);
  backdrop-filter: blur(28px) saturate(150%);
  -webkit-backdrop-filter: blur(28px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.75) inset,
    0 10px 36px rgba(160, 110, 30, 0.06),
    0 2px 6px rgba(160, 110, 30, 0.04);
}
.glass-strong {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 252, 244, 0.72) 100%);
  backdrop-filter: blur(32px) saturate(160%);
  -webkit-backdrop-filter: blur(32px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.82);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 12px 44px rgba(160, 110, 30, 0.07),
    0 2px 8px rgba(160, 110, 30, 0.04);
}
.glass-amber {
  background: linear-gradient(135deg, rgba(242, 158, 27, 0.55) 0%, rgba(232, 168, 37, 0.42) 100%);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.62);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.78) inset,
    0 12px 36px rgba(217, 135, 15, 0.2);
}

.lift { transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 220ms cubic-bezier(0.22, 1, 0.36, 1); }
.lift:hover {
  transform: translateY(-2px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8) inset,
    0 16px 44px rgba(180, 100, 10, 0.14),
    0 4px 10px rgba(180, 100, 10, 0.06);
}

@keyframes gbee-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: gbee-fade-in 280ms cubic-bezier(0.22, 1, 0.36, 1) both; }

/* ===== Шапка ===== */
.topbar { position: sticky; top: 12px; z-index: 30; margin: 12px 16px 0; }
.topbar-inner {
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-logo {
  height: 42px; width: 42px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.brand-logo img { height: 42px; width: 42px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-title { font-family: var(--serif); font-size: 17px; font-weight: 600; }
.brand-sub { font-size: 12px; color: var(--ink-soft); }
.topbar-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav-link {
  font-size: 14px; font-weight: 600; color: var(--ink-soft);
  padding: 7px 13px; border-radius: var(--radius-sm); transition: background 140ms, color 140ms;
}
.nav-link:hover { background: rgba(255, 255, 255, 0.55); color: var(--ink); }
.nav-link.is-active { background: var(--amber); color: #3a2a12; }
.topbar-nav + .topbar-user { margin-left: 0; }
.topbar-user { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.user-name { font-weight: 600; font-size: 14px; }
.logout-form { margin: 0; }

/* ===== Контейнер ===== */
.wrap { max-width: 920px; margin: 0 auto; padding: 24px 16px 56px; }

.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-title { font-size: 26px; }
.block-title { font-size: 19px; margin: 28px 0 12px; }
.muted { color: var(--ink-soft); font-size: 13px; }
.back-link { font-size: 13px; color: var(--ink-soft); font-weight: 600; width: 100%; }

/* ===== Теги ===== */
.tag {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 3px 9px; border-radius: 999px;
  background: rgba(242, 158, 27, 0.16); color: var(--amber-600);
  border: 1px solid rgba(242, 158, 27, 0.25);
  white-space: nowrap;
}
.tag-role { background: rgba(61, 43, 31, 0.08); color: var(--ink-soft); border-color: rgba(61, 43, 31, 0.12); text-transform: none; letter-spacing: 0.01em; }
.tag-green { background: rgba(15, 157, 107, 0.16); color: var(--green-700); border-color: rgba(15, 157, 107, 0.28); }
.tag-done { background: var(--green); color: #fff; border-color: var(--green); }
.tag-result { background: rgba(15, 157, 107, 0.14); color: var(--green-700); border-color: rgba(15, 157, 107, 0.22); }
.tag-adhoc { background: rgba(242, 158, 27, 0.18); color: var(--amber-600); }
.tag-muted { background: rgba(61, 43, 31, 0.06); color: var(--ink-soft); border-color: transparent; }
.tag-today { background: var(--amber); color: #fff; border-color: transparent; }

/* ===== Кнопки ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; cursor: pointer; border: none;
  font-family: var(--sans); font-size: 14px; font-weight: 600;
  padding: 10px 18px; border-radius: var(--radius-md);
  transition: filter 160ms, transform 160ms;
}
.btn:hover { filter: brightness(1.04); }
.btn:active { transform: translateY(1px); }
.btn-sm { font-size: 13px; padding: 7px 13px; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }
.btn-amber { background: var(--amber); color: #3a2a12; box-shadow: 0 6px 18px rgba(217, 135, 15, 0.28); }
.btn-green { background: var(--green); color: #fff; box-shadow: 0 6px 18px rgba(15, 157, 107, 0.26); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink); border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 2px 8px rgba(160, 110, 30, 0.05);
}

/* ===== Поля ввода ===== */
.field {
  width: 100%;
  font-family: var(--sans); font-size: 15px; color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(150, 108, 42, 0.32);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  transition: background 160ms, border-color 160ms;
}
.field:focus { outline: none; background: #fff; border-color: var(--amber); }
textarea.field { resize: vertical; min-height: 44px; line-height: 1.45; }
select.field { appearance: none; -webkit-appearance: none; cursor: pointer; }
.field-label {
  display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-soft); margin: 4px 0 6px 4px;
}

/* ===== Flash ===== */
.flash {
  border-radius: var(--radius-md);
  padding: 11px 16px; margin-bottom: 16px; font-size: 14px; font-weight: 600;
}
.flash-ok { background: rgba(15, 157, 107, 0.14); color: var(--green-700); border: 1px solid rgba(15, 157, 107, 0.22); }
.flash-err { background: rgba(220, 38, 38, 0.12); color: var(--red); border: 1px solid rgba(220, 38, 38, 0.2); }

/* ===== Карточка «начать день» / ошибка ===== */
.start-card, .error-card {
  border-radius: var(--radius-lg);
  padding: 26px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.error-card { flex-direction: column; text-align: center; padding: 40px 26px; }
.start-icon {
  height: 56px; width: 56px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center; font-size: 26px; flex-shrink: 0;
}
.start-text { flex: 1; min-width: 200px; }
.start-title { font-family: var(--serif); font-size: 18px; font-weight: 600; margin-bottom: 4px; }

/* ===== Прогресс ===== */
.progress-card { border-radius: var(--radius-lg); padding: 18px 20px; margin-bottom: 20px; }
.progress-top { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.progress-pct { font-family: var(--serif); font-size: 30px; font-weight: 700; color: var(--amber-600); }
.progress { height: 10px; border-radius: 999px; background: rgba(61, 43, 31, 0.1); overflow: hidden; }
.progress-bar {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--amber), var(--amber-2));
  transition: width 320ms cubic-bezier(0.22, 1, 0.36, 1);
}
.mini-bar { display: inline-block; width: 90px; height: 7px; border-radius: 999px; background: rgba(61, 43, 31, 0.1); overflow: hidden; vertical-align: middle; }
.mini-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--amber), var(--amber-2)); }

/* ===== Секции чеклиста ===== */
.section { border-radius: var(--radius-lg); padding: 18px 20px; margin-bottom: 16px; }
.section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.section-title { font-size: 17px; }
.section-adhoc { border: 1px dashed rgba(242, 158, 27, 0.4); }
.section-items { display: flex; flex-direction: column; gap: 12px; }

/* Пункт-галочка */
.item-check {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  transition: background 140ms;
}
/* интерактив (палец/подсветка) только у редактируемого дня, где пункт — это <label> */
label.item-check { cursor: pointer; }
label.item-check:hover { background: rgba(255, 255, 255, 0.45); }
.item-check input[type="checkbox"] { position: absolute; opacity: 0; width: 0; height: 0; }
.check-box {
  flex-shrink: 0; margin-top: 1px;
  height: 22px; width: 22px; border-radius: 7px;
  border: 2px solid rgba(217, 135, 15, 0.5);
  background: rgba(255, 255, 255, 0.7);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 140ms, border-color 140ms;
}
.check-box::after {
  content: "✓"; color: #fff; font-size: 14px; font-weight: 800; opacity: 0; transform: scale(0.6);
  transition: opacity 140ms, transform 140ms;
}
.item-check input:checked + .check-box,
.check-box.checked {
  background: var(--amber); border-color: var(--amber);
}
.item-check input:checked + .check-box::after,
.check-box.checked::after { opacity: 1; transform: scale(1); }

/* Пункт-результат */
.item-result { padding: 8px 10px; border-radius: var(--radius-sm); }
.item-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.item-label { font-size: 14.5px; line-height: 1.4; }
.item.is-done .item-label { color: var(--ink); }
.item-check.is-done .item-label { color: var(--ink-soft); }
.result-text { font-size: 14px; background: rgba(255, 255, 255, 0.55); border-radius: var(--radius-sm); padding: 9px 12px; white-space: pre-wrap; }
.result-text.empty { color: var(--ink-soft); font-style: italic; background: transparent; padding: 4px 0; }

.day-form { margin: 0; }

/* Завершение дня */
.day-complete { display: flex; justify-content: flex-end; margin-top: 14px; }
.day-status {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 14px; padding: 14px 20px; border-radius: var(--radius-lg);
  background: rgba(15, 157, 107, 0.12); border: 1px solid rgba(15, 157, 107, 0.25);
}
.day-status-text { font-weight: 600; color: var(--green-700); }

/* Разовая задача: строка с чекбоксом + иконкой комментария */
.item-adhoc { padding: 4px 0; }
.adhoc-row { display: flex; align-items: flex-start; gap: 8px; }
.adhoc-row .item-check { flex: 1; }
.icon-btn {
  flex-shrink: 0; cursor: pointer; margin-top: 4px;
  height: 34px; width: 34px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(150, 108, 42, 0.28);
  color: var(--amber-600);
  transition: background 140ms, border-color 140ms, color 140ms;
}
.icon-btn:hover { background: rgba(242, 158, 27, 0.16); border-color: var(--amber); }
.adhoc-comment { margin: 6px 0 4px 40px; }
.adhoc-comment-view { margin: 6px 0 4px 36px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
@media (max-width: 480px) {
  .adhoc-comment { margin-left: 12px; }
  .adhoc-comment-view { margin-left: 12px; }
}

/* Плавающая панель сохранения — выезжает при первом изменении в чеклисте */
.save-bar {
  position: fixed; left: 50%; bottom: 20px; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  padding: 10px 12px 10px 20px; border-radius: 999px;
  transform: translate(-50%, 180%);
  transition: transform 340ms cubic-bezier(0.22, 1, 0.36, 1);
}
.save-bar.show { transform: translate(-50%, 0); }
.save-bar-text { font-size: 14px; font-weight: 600; }
@media (max-width: 480px) {
  .save-bar { left: 12px; right: 12px; bottom: 12px; transform: translateY(180%); width: auto; justify-content: space-between; }
  .save-bar.show { transform: translateY(0); }
}

/* ===== Добавление разовой задачи ===== */
.adhoc-add { border-radius: var(--radius-lg); padding: 4px 20px; margin-top: 12px; }
.adhoc-add > summary { cursor: pointer; font-weight: 600; font-size: 14px; padding: 14px 0; color: var(--amber-600); list-style: none; }
.adhoc-add > summary::-webkit-details-marker { display: none; }
.adhoc-add-form { display: flex; gap: 10px; flex-wrap: wrap; padding-bottom: 18px; }
.adhoc-add-form .field { flex: 1; min-width: 160px; width: auto; }
.adhoc-add-form select.field { flex: 0 0 auto; min-width: 150px; }

/* ===== История ===== */
.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-row {
  border-radius: var(--radius-md); padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.history-date { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.history-prog { display: flex; align-items: center; gap: 10px; }
.history-pct { font-weight: 700; font-size: 14px; color: var(--amber-600); min-width: 38px; text-align: right; }

/* ===== Дашборд ===== */
.board-toolbar {
  border-radius: var(--radius-lg); padding: 12px 16px; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.date-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.date-form { margin: 0; }
.date-form .field { width: auto; padding: 8px 12px; }
.filter-form { margin: 0; }
.filter-form .field { width: auto; min-width: 160px; padding: 8px 12px; }

.board { display: flex; flex-direction: column; gap: 8px; }
.board-head {
  display: grid; grid-template-columns: 2.2fr 0.9fr 2.2fr 0.8fr 1.3fr;
  gap: 28px; padding: 4px 22px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); font-weight: 700;
}
.board-row {
  display: grid; grid-template-columns: 2.2fr 0.9fr 2.2fr 0.8fr 1.3fr;
  gap: 28px; align-items: center;
  border-radius: var(--radius-md); padding: 14px 22px;
}
.cell { min-width: 0; }
/* длинная роль не вылезает в соседнюю колонку */
.cell-person .tag-role { white-space: normal; }
.cell.cell-person { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.cell-person .user-name { font-size: 15px; }
.person-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.cell-prog { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.prog-num { font-size: 13px; font-weight: 600; }
.cell-open { font-size: 13px; }
.ok-text { color: var(--green-700); font-weight: 600; }
.open-list { width: 100%; }
.open-list > summary {
  cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--red);
  background: rgba(220, 38, 38, 0.08); border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: 999px; padding: 4px 12px;
}
.open-list > summary::-webkit-details-marker { display: none; }
.open-list > summary::after { content: "▾"; font-size: 11px; transition: transform 160ms; }
.open-list[open] > summary::after { transform: rotate(180deg); }
.open-groups { margin-top: 10px; display: flex; flex-direction: column; gap: 12px; }
.open-group-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--ink-soft); margin-bottom: 5px;
}
.open-list ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.open-list li { font-size: 13px; color: var(--ink); }
.cell-adhoc { font-size: 14px; font-weight: 600; }
.cell-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; position: relative; }
.cell-label { display: none; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); font-weight: 700; margin-right: 6px; }

.adhoc-pop { position: relative; }
/* пока форма «+ задача» открыта — строка выше соседних */
.board-row.row-raised { position: relative; z-index: 50; }
.adhoc-pop > summary { list-style: none; }
.adhoc-pop > summary::-webkit-details-marker { display: none; }
.adhoc-form {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20;
  width: 260px; border-radius: var(--radius-md); padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
}

/* ===== Календарь (в стиле сайта) ===== */
.cal { position: relative; flex: 0 0 auto; }
/* пока календарь открыт — карточка выше соседних стеклянных блоков
   (только z-index, чтобы не ломать уже спозиционированные элементы вроде попапа) */
.cal-open { z-index: 60; }
/* карточки, которые могут содержать календарь — позиционируем для z-index */
.adhoc-add, .board-toolbar, .tmpl-section { position: relative; }
/* в узком попапе календарь открываем к правому краю, чтобы не уезжал за экран */
.cal-right { width: 100%; }
.cal-right .cal-trigger { width: 100%; justify-content: flex-start; }
.cal-right .cal-pop { right: 0; left: auto; }
.cal-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer; text-align: left; white-space: nowrap; width: auto;
  color: var(--ink);
}
.cal-trigger svg { color: var(--amber-600); flex-shrink: 0; }
.cal-pop {
  position: absolute; z-index: 50; top: calc(100% + 6px); left: 0;
  width: 286px; max-width: 86vw;
  border-radius: var(--radius-md); padding: 12px;
}
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-title { font-weight: 600; font-size: 14px; font-family: var(--serif); }
.cal-nav {
  cursor: pointer; border: none; background: rgba(255, 255, 255, 0.6);
  height: 30px; width: 30px; border-radius: 9px; font-size: 18px; line-height: 1;
  color: var(--amber-600); display: inline-flex; align-items: center; justify-content: center;
  transition: background 140ms;
}
.cal-nav:hover { background: rgba(242, 158, 27, 0.16); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-weekdays { margin-bottom: 4px; }
.cal-weekdays span { text-align: center; font-size: 11px; color: var(--ink-soft); padding: 3px 0; font-weight: 600; }
.cal-day {
  cursor: pointer; border: none; background: transparent;
  aspect-ratio: 1 / 1; min-height: 34px; border-radius: 9px; font-size: 13px; color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 120ms;
}
.cal-day:hover { background: rgba(242, 158, 27, 0.16); }
.cal-blank { visibility: hidden; cursor: default; }
.cal-day.is-today { box-shadow: inset 0 0 0 1.5px var(--amber); color: var(--amber-600); font-weight: 700; }
.cal-day.is-selected { background: var(--amber); color: #3a2a12; font-weight: 700; }
.cal-day.is-selected:hover { background: var(--amber); }

/* ===== Регулярные задачи ===== */
.recurring-list { display: flex; flex-direction: column; gap: 8px; margin: 2px 0 14px; }
.recurring-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: rgba(255, 255, 255, 0.5); border-radius: var(--radius-sm); padding: 10px 12px;
  border: 1px solid rgba(150, 108, 42, 0.28);
}
.recurring-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.recurring-freq { font-size: 12px; color: var(--ink-soft); }
.recurring-del { margin: 0; }
.icon-btn-danger { color: var(--red); border-color: rgba(220, 38, 38, 0.25); }
.icon-btn-danger:hover { background: rgba(220, 38, 38, 0.1); border-color: var(--red); }
.recurring-form { display: flex; flex-direction: column; gap: 12px; padding-bottom: 18px; }
.recurring-form .field { width: 100%; }
.freq-row { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-pill { cursor: pointer; }
.radio-pill input { position: absolute; opacity: 0; width: 0; height: 0; }
.radio-pill span {
  display: inline-flex; align-items: center; padding: 8px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 600;
  background: rgba(255, 255, 255, 0.6); border: 1px solid rgba(150, 108, 42, 0.28); color: var(--ink-soft);
  transition: background 140ms, color 140ms, border-color 140ms;
}
.radio-pill input:checked + span { background: var(--amber); color: #3a2a12; border-color: var(--amber); }
.wd-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.wd-picker[hidden] { display: none; }
.wd-chip { cursor: pointer; }
.wd-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.wd-chip span {
  display: inline-flex; align-items: center; justify-content: center;
  height: 38px; width: 44px; border-radius: 11px; font-size: 13px; font-weight: 600;
  background: rgba(255, 255, 255, 0.6); border: 1px solid rgba(150, 108, 42, 0.28); color: var(--ink-soft);
  transition: background 140ms, color 140ms, border-color 140ms;
}
.wd-chip input:checked + span { background: var(--amber); color: #3a2a12; border-color: var(--amber); }

/* ===== Сотрудники ===== */
.staff-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.staff-item {
  border-radius: var(--radius-md); padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.staff-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.staff-form { display: flex; flex-direction: column; gap: 10px; padding-bottom: 18px; }
.staff-form .btn { align-self: flex-start; }

/* ===== Редактор задач ===== */
.role-pick { border-radius: var(--radius-lg); padding: 14px 20px; margin-bottom: 14px; }
.role-pick .field { max-width: 360px; }
/* почти непрозрачный фон — чтобы все секции выглядели одинаково, а не тинтились градиентом фона */
.tmpl-section { padding: 16px 18px; background: rgba(255, 251, 243, 0.96); }
.tmpl-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tmpl-rename { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 200px; }
.tmpl-title { font-family: var(--serif); font-weight: 600; }
.tmpl-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.tmpl-actions form { margin: 0; }
.tmpl-tasks { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.tmpl-task { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tmpl-task-edit { display: flex; align-items: flex-start; gap: 8px; flex: 1; min-width: 240px; flex-wrap: wrap; }
/* поле задачи растёт; область периодичности — фиксированной ширины (= «Каждый день») */
.tmpl-task-edit > .field { flex: 1; min-width: 160px; }
.tmpl-freq-wrap { flex: 0 0 250px; display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.tmpl-freq-wrap .tmpl-freq { flex: 1 1 130px; width: auto; min-width: 0; }
.tmpl-freq-wrap .tmpl-freqday { flex: 0 0 84px; width: auto; min-width: 0; }
.tmpl-freq-wrap .tmpl-n { flex: 0 0 54px; width: auto; min-width: 0; text-align: center; }
.tmpl-freq-wrap .tmpl-start { flex: 1 1 130px; width: auto; min-width: 0; }
textarea.autogrow { resize: none; overflow: hidden; min-height: 0; line-height: 1.4; }
.tmpl-add-task { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; margin-top: 4px; padding-top: 12px; border-top: 1px dashed var(--line); }
.tmpl-add-task > .field { flex: 1; min-width: 160px; }
.tmpl-add-block { display: flex; align-items: center; gap: 10px; padding: 14px 20px; }
.tmpl-add-block .field { flex: 1; }

/* ===== Логин ===== */
.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; position: relative; overflow: hidden; }
.login-watermark { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; z-index: 0; }
.login-watermark img { width: 46vh; max-width: 460px; opacity: 0.1; mix-blend-mode: multiply; }
.login-card { position: relative; z-index: 1; width: 100%; max-width: 380px; border-radius: var(--radius-lg); padding: 28px; }
.login-head { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.login-title { font-family: var(--serif); font-size: 19px; font-weight: 600; }
.login-sub { font-size: 13px; color: var(--ink-soft); }
.login-form { display: flex; flex-direction: column; gap: 6px; }
.login-form .field { margin-bottom: 8px; }
.login-form .btn { margin-top: 8px; }
.login-error { background: rgba(220, 38, 38, 0.12); color: var(--red); border-radius: var(--radius-md); padding: 9px 13px; font-size: 13px; margin-bottom: 6px; }

/* ===== Мобильная адаптация ===== */
@media (max-width: 720px) {
  .board-head { display: none; }
  .board-row { grid-template-columns: 1fr; gap: 10px; }
  .cell { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .cell-label { display: inline-block; min-width: 92px; }
  .cell-actions { justify-content: flex-start; }
  .adhoc-form { position: static; width: 100%; }
  .page-title { font-size: 22px; }
  .field { font-size: 16px; } /* без авто-зума на iOS */
}

@media (max-width: 480px) {
  .wrap { padding: 18px 12px 48px; }
  .topbar { margin: 10px 10px 0; }
  .brand-sub { display: none; }
}
