/* Темы. «Оригинал» — по умолчанию (тёплый чёрный + золото). Тема выбирается в расписании: Настройки → Тема. */
:root {
  --bg: #161613; --panel: #201f1b; --panel-2: #29271f; --line: #3d382c; --line-2: #5c503e;
  --ivory: #f3ead8; --muted: #a9a090; --gold: #e3b66d; --gold-2: #d9ab65;
  --red: #e0535b; --amber: #e8b04a; --green: #5fbf7a; --blue: #6ea8ff;
  --bar: #161613ee; --input-bg: #12110f; --soft: #ffffff08; --toast-bg: #2b2a24; --scrim: #000a; --shadow: #0008;
  --accent-grad: linear-gradient(115deg, #ebc37e, #d9ab65); --accent-line: #f0cd8f; --on-accent: #211c13; --accent-soft: #e3b66d22;
  --red-text: #ffb3b7; --red-line: #7a2e33; --amber-line: #6b5524; --green-line: #2f5e3b; --cancel-line: #6b2a2e; --mine-bg: #5fbf7a14;
  --radius: 8px; color-scheme: dark;
}
/* Тёмная: нейтральный графит, акцент — спокойный голубой. */
:root[data-theme="dark"] {
  --bg: #0f1115; --panel: #171a21; --panel-2: #1e222b; --line: #2a2f3a; --line-2: #3b4252;
  --ivory: #e8eaf0; --muted: #9aa3b2; --gold: #8fb0ff; --gold-2: #7aa2ff;
  --red: #ef6b73; --amber: #e8b04a; --green: #5fc488; --blue: #8fb0ff;
  --bar: #0f1115ee; --input-bg: #0b0d11; --soft: #ffffff08; --toast-bg: #1e222b; --scrim: #000b; --shadow: #0009;
  --accent-grad: linear-gradient(115deg, #a9c1ff, #7aa2ff); --accent-line: #b9cdff; --on-accent: #0b1020; --accent-soft: #8fb0ff22;
  --red-text: #ffb3b8; --red-line: #7a2f37; --amber-line: #6b5524; --green-line: #2b5e44; --cancel-line: #6b2a31; --mine-bg: #5fc48814;
  color-scheme: dark;
}
/* Светлая: тёплый белый, золото потемнее — чтобы читалось на светлом. */
:root[data-theme="light"] {
  --bg: #f6f4ef; --panel: #ffffff; --panel-2: #f1ede4; --line: #e4ddcf; --line-2: #cfc5b1;
  --ivory: #1f1c16; --muted: #6f6757; --gold: #9a6a12; --gold-2: #b07b1c;
  --red: #c23a43; --amber: #a86d12; --green: #2e8b4f; --blue: #2f63c8;
  --bar: #f6f4efee; --input-bg: #ffffff; --soft: #0000000a; --toast-bg: #ffffff; --scrim: #0007; --shadow: #0003;
  --accent-grad: linear-gradient(115deg, #f2cf8c, #e3ad5b); --accent-line: #d9a24f; --on-accent: #2a2110; --accent-soft: #e3ad5b33;
  --red-text: #b42a33; --red-line: #e7b4b8; --amber-line: #e6c98f; --green-line: #a6d6b8; --cancel-line: #ecbcc0; --mine-bg: #2e8b4f14;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ivory); font: 15px/1.45 Manrope, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--gold); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--panel-2); color: var(--ivory); font-weight: 700; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--gold); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-gold { background: var(--accent-grad); border-color: var(--accent-line); color: var(--on-accent); }
.btn-red { border-color: var(--red-line); color: var(--red-text); }
.btn-ghost { background: none; }
/* Переход между админкой и расписанием: синяя кнопка, чтобы не путать с действиями на странице */
.btn-switch { border-color: #3e6fb8; background: #6ea8ff1f; color: #cfe0ff; text-decoration: none; }
.btn-switch:hover { border-color: #6ea8ff; background: #6ea8ff33; }
:root[data-theme="light"] .btn-switch { border-color: #7fa5e6; background: #2f63c814; color: #1f4fa8; }
.btn-sm { min-height: 32px; padding: 4px 10px; font-size: 13px; }

.field { display: grid; gap: 6px; }
.field > span { color: var(--muted); font-size: 12px; letter-spacing: .04em; }
.input, select.input, textarea.input { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--input-bg); }
.input:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: transparent; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--gold); }

.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 12px; font-weight: 600; white-space: nowrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.team-empty { background: var(--red); } .team-partial { background: var(--amber); } .team-full { background: var(--green); } .team-none { background: var(--muted); }
.status-new { color: var(--amber); border-color: var(--amber-line); } .status-confirmed { color: var(--green); border-color: var(--green-line); }
.status-done { color: var(--muted); } .status-cancelled { color: var(--red); border-color: var(--cancel-line); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; max-width: min(92vw, 460px); padding: 12px 16px; border-radius: 8px; background: var(--toast-bg); border: 1px solid var(--line-2); box-shadow: 0 10px 30px var(--shadow); }
.toast.error { border-color: var(--red-line); }

.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: var(--scrim); }
.modal-card { width: min(100%, 420px); display: grid; gap: 14px; padding: 22px; }
.modal-card h2 { font-size: 20px; }
.modal-card p { margin: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.modal-actions .btn { min-height: 44px; }
.modal-code { padding: 12px; border-radius: 6px; background: var(--input-bg); border: 1px solid var(--line-2); font: 700 20px/1 ui-monospace, Consolas, monospace; letter-spacing: .06em; text-align: center; user-select: all; }
/* Роли-теги: актёр — красный, рилсмейкер — фирменный розовый (как на сайте), монтажёр — синий,
   аниматор — зелёный, администратор — золотой. Для светлой темы — оттенки потемнее. */
.tags { display: inline-flex; flex-wrap: wrap; gap: 5px; }
.tag { --c: var(--muted); display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--c) 55%, transparent);
  background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c); font-size: 12px; font-weight: 700; line-height: 1.5; white-space: nowrap; }
.tag-admin { --c: #e3b66d; } .tag-actor { --c: #f0616a; } .tag-animator { --c: #5fc47f; } .tag-editor { --c: #6ea8ff; } .tag-reels { --c: #ff5c96; }
:root[data-theme="light"] .tag-admin { --c: #9a6a12; } :root[data-theme="light"] .tag-actor { --c: #c3313b; }
:root[data-theme="light"] .tag-animator { --c: #237a43; } :root[data-theme="light"] .tag-editor { --c: #2457b8; } :root[data-theme="light"] .tag-reels { --c: #d81b65; }
button.tag { cursor: pointer; font-family: inherit; min-height: 30px; }
.acc-finance-btn { justify-self: start; min-height: 44px; padding: 8px 22px; }
.acc-sections { display: flex; flex-wrap: wrap; gap: 8px; }
.acc-hint { margin: 0; font-size: 13px; }
.acc-settings-link { margin: 12px 0 0; color: var(--muted); font-size: 13.5px; }
.acc-settings-link.is-warn { color: var(--amber); }
.link-btn { padding: 0; border: 0; background: none; color: var(--gold); font: inherit; font-weight: 700; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.acc-fav { font-size: 18px !important; line-height: 1.3; }
.acc-quests { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.acc-quest { display: grid; gap: 8px; padding: 14px 16px; }
.acc-quest.is-empty { opacity: .55; }
.acc-quest-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.acc-quest-head h3 { margin: 0; font-size: 16px; }
.acc-quest-head b { color: var(--gold); font-size: 22px; }
.acc-quest-roles { display: flex; flex-wrap: wrap; gap: 6px; }
.acc-quest-roles span { padding: 2px 9px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); font-size: 12px; }
.acc-payout { padding: 10px 12px; border-radius: 6px; background: var(--soft); font-size: 14px; }
.acc-stat-main b { font-size: 30px; }
.acc-fine { color: var(--red); }
.acc-fine-form { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line-2); }
.acc-fine-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.acc-total td { border-top: 2px solid var(--line-2); font-weight: 800; }
.acc-tags { display: grid; gap: 6px; margin: 8px 0 6px; font-size: 13px; }
button.tag.off { --c: var(--muted); opacity: .55; border-style: dashed; background: none; }

/* Страница аккаунта (админка и расписание) */
.acc { display: grid; gap: 14px; max-width: 900px; }
.acc-back { justify-self: start; }
.acc-profile { display: grid; gap: 12px; padding: 18px; }
.acc-profile h2 { font-size: 22px; }
.acc-contacts { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; font-size: 14px; }
.acc-contacts dt { color: var(--muted); }
.acc-contacts dd { margin: 0; }
.people-title { font-size: 20px; margin-top: 6px; }
.person { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 12px 14px; text-align: left; cursor: pointer; }
.person:hover { border-color: var(--gold); }
.person-phone { white-space: nowrap; font-size: 14px; }
/* Достижения */
.ach { --ach: var(--gold); }
.ach-experienced { --ach: #e3b66d; } .ach-many_faces { --ach: #c38bff; } .ach-mentor { --ach: #5fbf7a; }
.ach-backstage { --ach: #6ea8ff; } .ach-nightmare_author { --ach: #ff6b72; } .ach-veteran { --ach: #f0a04b; }
:root[data-theme="light"] .ach-experienced { --ach: #9a6a12; } :root[data-theme="light"] .ach-many_faces { --ach: #8a3fd1; }
:root[data-theme="light"] .ach-mentor { --ach: #237a43; } :root[data-theme="light"] .ach-backstage { --ach: #2457b8; }
:root[data-theme="light"] .ach-nightmare_author { --ach: #c3313b; } :root[data-theme="light"] .ach-veteran { --ach: #b0600f; }
.acc-ach-summary { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 16px; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.acc-ach-summary:hover { border-color: var(--gold); }
.acc-ach-summary-text { display: grid; gap: 1px; flex: none; }
.acc-ach-summary-text b { color: var(--gold); font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.acc-ach-summary-text .muted { font-size: 13px; }
.acc-ach-summary-icons { display: flex; flex-wrap: wrap; gap: 5px; flex: 1; min-width: 0; font-size: 13px; }
.acc-ach-summary-icons .ach-mini { width: 30px; height: 30px; }
.acc-ach-summary-icons .ach-mini svg { width: 17px; height: 17px; }
.acc-ach-summary-more { flex: none; color: var(--gold); font-weight: 700; font-size: 14px; }
.acc-ach-note { margin: 6px 0 0; font-size: 13px; }
.acc-ach-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-top: 4px; }
.ach { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--soft); }
.ach-icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--ach);
  border: 1.5px solid color-mix(in srgb, var(--ach) 60%, transparent); background: color-mix(in srgb, var(--ach) 14%, transparent); }
.ach-icon svg { width: 24px; height: 24px; }
.ach.is-earned { border-color: color-mix(in srgb, var(--ach) 55%, transparent); background: linear-gradient(135deg, color-mix(in srgb, var(--ach) 13%, transparent), transparent 70%); }
.ach.is-earned .ach-icon { box-shadow: 0 0 14px color-mix(in srgb, var(--ach) 35%, transparent); }
.ach.is-locked .ach-icon { color: var(--muted); border-color: var(--line-2); border-style: dashed; background: none; }
.ach.is-locked .ach-body > b { color: var(--muted); }
.ach-body { display: grid; gap: 3px; min-width: 0; }
.ach-body > b { font-size: 15px; }
.ach-body > small { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.ach.is-earned .ach-meta { color: var(--ach); font-weight: 600; }
.ach-progress { height: 6px; margin-top: 4px; border-radius: 999px; background: var(--line); overflow: hidden; }
.ach-progress i { display: block; height: 100%; border-radius: inherit; background: var(--ach); }
.ach-btn { justify-self: start; margin-top: 6px; }
.person-ach { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.ach-mini { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: var(--ach); border: 1px solid color-mix(in srgb, var(--ach) 55%, transparent);
  background: color-mix(in srgb, var(--ach) 14%, transparent); }
.ach-mini svg { width: 14px; height: 14px; }
.ach-mini { --ach: var(--gold); }
.ach-mini.ach-experienced { --ach: #e3b66d; } .ach-mini.ach-many_faces { --ach: #c38bff; } .ach-mini.ach-mentor { --ach: #5fbf7a; }
.ach-mini.ach-backstage { --ach: #6ea8ff; } .ach-mini.ach-nightmare_author { --ach: #ff6b72; } .ach-mini.ach-veteran { --ach: #f0a04b; }
.acc-edit summary { cursor: pointer; color: var(--gold); font-weight: 700; }
.acc-form { display: grid; gap: 10px; margin-top: 12px; max-width: 420px; }
.acc-form .btn { justify-self: start; }
.acc-period { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { min-height: 34px; padding: 4px 12px; border: 1px solid var(--line-2); border-radius: 999px; background: none; font-size: 13px; font-weight: 700; cursor: pointer; }
.chip-btn[aria-pressed="true"] { border-color: var(--gold); background: var(--accent-soft); color: var(--gold); }
.acc-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.acc-stat { display: grid; gap: 2px; padding: 12px 14px; }
.acc-stat span { color: var(--muted); font-size: 12px; }
.acc-stat b { font-size: 26px; }
.acc-stat small { font-size: 12px; }
.acc-money { color: var(--green); }
.acc-warn { margin: 0; padding: 10px 12px; border: 1px solid var(--amber-line); border-radius: 6px; color: var(--amber); font-size: 14px; }
.acc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.acc-box { padding: 14px 16px; overflow: auto; }
.acc-box h3 { margin: 0 0 8px; color: var(--gold); font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.acc-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.acc-table td { padding: 7px 6px 7px 0; border-top: 1px solid var(--line); vertical-align: top; }
.acc-table tr:first-child td { border-top: 0; }
.acc-table .num { text-align: right; white-space: nowrap; }
.acc-table .nowrap { white-space: nowrap; }
@media (max-width: 700px) { .acc-grid { grid-template-columns: 1fr; } .acc-stat b { font-size: 22px; } .acc-list td:nth-child(3) { display: none; } }

.login { min-height: 100svh; display: grid; place-items: center; padding: 20px; }
.login form { width: min(100%, 360px); display: grid; gap: 14px; padding: 28px; }
.login h1 { font-size: 22px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.brand b { color: var(--gold); }
/* Логотип + «Дом 121» в шапке — кнопка «на главную» (календарь / расписание на сегодня) */
.brand-home { display: inline-flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; margin-left: -4px; border: 1px solid transparent; border-radius: 8px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background .2s, border-color .2s; }
.brand-home:hover { background: var(--soft); border-color: var(--line); }
.brand-home:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.brand-home .brand-logo { display: block; width: 40px; height: 30px; object-fit: contain; flex: none; }
.brand-home .brand { gap: 6px; white-space: nowrap; }
.brand-home .brand-text { display: grid; gap: 1px; }
.brand-home .who { display: block; }
:root[data-theme="light"] .brand-home .brand-logo { filter: brightness(.55) sepia(.4); }

/* Нижняя панель разделов, как в приложениях (расписание — всегда, админка — на телефоне) */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: center; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: var(--bar, #161613f2); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
.tabbar-item { flex: 1 1 0; max-width: 128px; display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 50px; padding: 5px 2px 3px; border: 0; border-radius: 10px; background: none; color: var(--muted); font: inherit; font-size: 11px; font-weight: 700; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.tabbar-item svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar-item[aria-current="page"] { color: var(--gold); }
.tabbar-item[aria-current="page"] svg { stroke-width: 2.2; }
.tabbar-item:active { background: var(--soft, #ffffff0d); }
.tabbar-item { position: relative; }
.tabbar-item .badge { position: absolute; top: 2px; left: calc(50% + 6px); margin: 0; border: 2px solid var(--bar-solid, var(--panel)); }
/* Счётчик (непрочитанное, «пора звонить») — общий для админки и приложения сотрудников */
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; line-height: 1; vertical-align: 1px; }
/* Аватарка: фото или инициалы на цветном круге */
.ava { flex-shrink: 0; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: hsl(var(--h, 30) 45% 32%); color: #fff; font-size: 13px; font-weight: 800; letter-spacing: .02em; object-fit: cover; }
img.ava { background: var(--soft); }
.ava-xl { width: 88px; height: 88px; font-size: 28px; }
.ava-sm { width: 28px; height: 28px; font-size: 10px; }
.avatar-edit { display: flex; align-items: center; gap: 16px; }
.avatar-edit-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.avatar-edit-btns label { cursor: pointer; }
.acc-profile-head { display: flex; align-items: center; gap: 14px; }
.person-main { display: flex; align-items: center; gap: 12px; min-width: 0; }

.people-level { margin: 10px 0 0; color: var(--gold); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.people-level .muted { letter-spacing: 0; }

/* Праздники — дни рождения команды */
.holidays-btn { width: 100%; margin-top: 12px; min-height: 48px; }
.acc-birth { align-items: end; }
.holiday { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; text-align: left; color: inherit; font: inherit; cursor: pointer; }
.holiday-who { display: grid; gap: 2px; flex: 1; min-width: 0; }
.holiday-who .muted { font-size: 13px; }
.holiday-when { color: var(--gold); font-size: 13px; font-weight: 700; white-space: nowrap; }
.holiday-next { display: grid; gap: 10px; padding: 16px; border-color: var(--gold); background: var(--accent-soft); }
.holiday-next.is-today { box-shadow: 0 0 0 2px var(--gold) inset; }
.holiday-next-label { color: var(--gold); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.holiday-next-person { display: flex; align-items: center; gap: 14px; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.holiday-next-person b { font-size: 19px; }
.holiday-next-when { font-size: 22px; font-weight: 800; }
.holiday-hint { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; }
.holiday-missing { font-size: 13px; margin: 6px 2px 0; }
.ava-lg { width: 54px; height: 54px; font-size: 18px; }

/* Аватарка в своём профиле: нажать — сменить фото */
.acc-ava-edit { position: relative; display: inline-block; cursor: pointer; border-radius: 50%; }
.acc-ava-edit:hover .ava, .acc-ava-edit:focus-within .ava { filter: brightness(.85); }
.acc-ava-cam { position: absolute; right: -2px; bottom: -2px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--panel-2); border: 2px solid var(--panel); font-size: 14px; }
.acc-profile-name { display: grid; gap: 4px; min-width: 0; }
.acc-ava-links { font-size: 13px; color: var(--muted); }
.acc-ava-links label.link-btn { cursor: pointer; }
