/* Трекер «Хола» — тёплый крем, бордо, золото. Concert-hall тон. */
:root {
  --cream: #FAF6F0;
  --card: #FFFFFF;
  --border: #E8E0D4;
  --ink: #221D1B;
  --burgundy: #7E2438;
  --burgundy-dk: #6A1D2F;
  --gold: #C9A227;
  --green: #2E6B4F;
  --terra: #B4552D;
  --gray: #8A8178;
  --muted: #9B9288;
  --shadow: 0 2px 8px rgba(34, 29, 27, .06), 0 1px 2px rgba(34, 29, 27, .04);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body {
  margin: 0; background: var(--cream); color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px; line-height: 1.5;
}
h1, h2, h3, h4 { font-family: Georgia, "Times New Roman", serif; font-weight: 700; color: var(--ink); }
a { color: var(--burgundy); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }

/* ---------- Навигация ---------- */
.topnav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 246, 240, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topnav-inner { max-width: 1080px; margin: 0 auto; padding: 8px 20px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.topnav a { color: var(--ink); font-size: 14px; }
.topnav a:hover { color: var(--burgundy); text-decoration: none; }
.brand { font-family: Georgia, serif; font-weight: 700; color: var(--burgundy); font-size: 17px; }
.topnav-spacer { flex: 1; }
.role-badge { font-size: 13px; padding: 2px 10px; border-radius: 12px; font-weight: 600; }
.role-admin { background: var(--burgundy); color: #fff; }
.role-staff { background: var(--gold); color: #3a2e00; }

/* ---------- Кнопки ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  border: 1px solid transparent; border-radius: 8px; padding: 8px 16px;
  font-size: 14px; font-family: inherit; font-weight: 600; transition: all .15s; }
.btn-sm { padding: 5px 11px; font-size: 13px; }
.btn-primary { background: var(--burgundy); color: #fff; }
.btn-primary:hover { background: var(--burgundy-dk); text-decoration: none; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--ink); }
.btn-ghost:hover { background: #F2ECE2; text-decoration: none; }
.icon-btn { cursor: pointer; background: transparent; border: 1px solid var(--border);
  border-radius: 6px; width: 28px; height: 28px; font-size: 13px; color: var(--ink); line-height: 1; }
.icon-btn:hover { background: #F2ECE2; }
.icon-btn.danger:hover { background: #FBEAEA; border-color: var(--terra); }
.mini { cursor: pointer; background: transparent; border: none; color: var(--muted);
  font-size: 13px; padding: 2px 5px; border-radius: 5px; }
.mini:hover { background: #F2ECE2; color: var(--ink); }
.mini.danger:hover { color: var(--terra); }

/* ---------- Hero ---------- */
.hero { background: linear-gradient(180deg, #fff 0%, var(--cream) 100%);
  border-bottom: 1px solid var(--border); padding: 28px 0 24px; }
.hero h1 { font-size: 26px; margin: 0 0 6px; line-height: 1.2; }
.hero-sub { color: #5b534c; margin: 0 0 20px; }
.hero-stats { display: flex; gap: 24px; align-items: stretch; flex-wrap: wrap; }
.progress-block { flex: 1; min-width: 260px; }
.progress-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.progress-num { font-family: Georgia, serif; font-weight: 700; color: var(--gold); font-size: 22px; }
.progress-num.sm { font-size: 13px; color: var(--muted); font-family: inherit; }
.progress { height: 12px; background: #EDE5D9; border-radius: 8px; overflow: hidden; }
.progress.sm { height: 7px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--burgundy), var(--gold));
  border-radius: 8px; transition: width .5s ease; }
.progress-cap { font-size: 13px; color: var(--muted); margin-top: 5px; }
.countdown { background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 22px; text-align: center; box-shadow: var(--shadow); align-self: center; }
.count-num { font-family: Georgia, serif; font-weight: 700; font-size: 34px; color: var(--burgundy); line-height: 1; }
.count-cap { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-top: 4px; }

/* ---------- Секции ---------- */
.section { padding: 32px 0; border-bottom: 1px solid var(--border); }
.section h2 { font-size: 22px; margin: 0 0 18px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-head h2 { margin: 0; }

/* ---------- Карточки ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow); padding: 18px; }

/* ---------- Таймлайн ---------- */
.timeline-scroll { overflow-x: auto; padding-bottom: 8px; }
.timeline { position: relative; min-width: 720px; height: auto; padding-top: 26px; }
.tl-weeks { position: relative; height: 18px; border-bottom: 1px solid var(--border); }
.tl-week { position: absolute; top: 0; transform: translateX(-50%); font-size: 11px; color: var(--muted); }
.tl-week span { border-left: 1px solid var(--border); padding-left: 3px; }
.tl-bars { position: relative; margin-top: 8px; }
.tl-bar { position: relative; display: block; height: 30px; margin-bottom: 6px; border-radius: 6px;
  background: color-mix(in srgb, var(--barcolor) 22%, white); border: 1px solid var(--barcolor);
  overflow: hidden; }
.tl-bar-fill { position: absolute; inset: 0; background: var(--barcolor); opacity: .55; }
.tl-bar-label { position: absolute; left: 8px; top: 50%; transform: translateY(-50%);
  font-size: 12px; font-weight: 600; color: var(--ink); white-space: nowrap; z-index: 1; }
.tl-today { position: absolute; top: 20px; bottom: 0; width: 2px; background: var(--burgundy); z-index: 3; }
.tl-today::after { content: "сегодня"; position: absolute; top: -18px; left: 3px; font-size: 10px; color: var(--burgundy); font-weight: 700; }

/* ---------- Этапы ---------- */
.phase-card { margin-bottom: 16px; scroll-margin-top: 70px; }
.phase-top { display: flex; gap: 14px; align-items: flex-start; }
.phase-num { font-family: Georgia, serif; font-weight: 700; font-size: 22px; color: #fff;
  background: var(--burgundy); width: 38px; height: 38px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.phase-head { flex: 1; }
.phase-head h3 { margin: 0 0 2px; font-size: 18px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.phase-sub { color: #5b534c; font-size: 14px; }
.phase-dates { color: var(--muted); font-size: 13px; margin-top: 2px; }
.phase-admin { display: flex; gap: 4px; }
.phase-progress { display: flex; align-items: center; gap: 10px; margin: 12px 0; }
.phase-progress .progress { flex: 1; }

.badge { font-size: 12px; padding: 2px 9px; border-radius: 11px; font-weight: 600; font-family: system-ui, sans-serif; }
.status-planned.badge, .badge.status-planned { background: #EAE5DC; color: #6a6259; }
.status-active.badge, .badge.status-active { background: #F5E1E5; color: var(--burgundy); }
.status-done.badge, .badge.status-done { background: #DCEDE4; color: var(--green); }
.status-behind.badge, .badge.status-behind { background: #F7E3D6; color: var(--terra); }

/* чипы */
.chips-line { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0 4px; }
.chips-label { font-size: 13px; color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 4px; background: #F2ECE2;
  border: 1px solid var(--border); border-radius: 12px; padding: 2px 9px; font-size: 13px; }
.chip.sm { font-size: 12px; padding: 1px 7px; }
.chip-x { cursor: pointer; background: none; border: none; color: var(--muted); font-size: 14px; padding: 0; line-height: 1; }
.chip-x:hover { color: var(--terra); }
.chip-add select { border: 1px dashed var(--border); border-radius: 12px; background: transparent;
  font-size: 12px; padding: 2px 6px; color: var(--muted); }

/* задачи */
.task-list { list-style: none; margin: 10px 0 0; padding: 0; }
.task { display: flex; gap: 10px; align-items: flex-start; padding: 9px 4px;
  border-top: 1px solid #F0EAE0; }
.task-check { cursor: pointer; background: none; border: none; font-size: 18px; line-height: 1;
  padding: 0; width: 24px; flex-shrink: 0; color: var(--gray); }
.task-check.ro { cursor: default; }
.task.status-doing .task-check { color: var(--gold); }
.task.status-done .task-check { color: var(--green); }
.task.status-blocked .task-check { color: var(--terra); }
.task.status-done .task-title { color: var(--muted); text-decoration: line-through; }
.task.status-blocked .task-title { color: var(--terra); }
.task-main { flex: 1; }
.task-title { font-size: 14.5px; }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.task-due { font-size: 12px; color: var(--muted); }
.aud { font-size: 11px; padding: 1px 7px; border-radius: 9px; border: 1px solid var(--border); color: #5b534c; }
.aud-staff { background: #EEF1F6; } .aud-teachers { background: #F0EDF8; }
.aud-parents { background: #FBF3DE; } .aud-students { background: #E6F2EA; } .aud-all { background: #F2ECE2; }
.task-actions { display: flex; gap: 2px; align-items: center; }
.task-empty { padding: 8px 4px; }
.task-add { margin-top: 12px; }

/* ---------- Формы ---------- */
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  background: #FBF8F3; border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 14px; }
.inline-form input, .inline-form select { padding: 6px 9px; border: 1px solid var(--border);
  border-radius: 7px; font-size: 14px; font-family: inherit; background: #fff; }
.inline-form input[type=text], .inline-form input:not([type]) { flex: 1; min-width: 140px; }
.hidden { display: none !important; }

/* ---------- Классы ---------- */
.classes-summary { display: flex; gap: 24px; margin-bottom: 16px; flex-wrap: wrap; }
.cs-item { font-size: 14px; color: #5b534c; }
.cs-num { font-family: Georgia, serif; font-weight: 700; font-size: 20px; color: var(--gold); }
.class-group { font-size: 15px; color: var(--muted); margin: 16px 0 8px; font-family: system-ui, sans-serif; font-weight: 600; }
.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.class-card { padding: 13px; border-left: 4px solid var(--gray); }
.class-card.stage-0 { border-left-color: var(--gray); }
.class-card.stage-1 { border-left-color: #C9B896; }
.class-card.stage-2 { border-left-color: var(--gold); }
.class-card.stage-3 { border-left-color: var(--burgundy); }
.class-card.stage-4 { border-left-color: var(--green); }
.class-name { font-family: Georgia, serif; font-weight: 700; font-size: 17px; }
.class-stage-badge { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 10px; margin-top: 5px; font-weight: 600; }
.class-stage-badge.stage-0 { background: #EAE5DC; color: #6a6259; }
.class-stage-badge.stage-1 { background: #EFE7D5; color: #7a6a45; }
.class-stage-badge.stage-2 { background: #FBF0CF; color: #8a6f10; }
.class-stage-badge.stage-3 { background: #F5E1E5; color: var(--burgundy); }
.class-stage-badge.stage-4 { background: #DCEDE4; color: var(--green); }
.class-curator, .class-note, .class-updated { font-size: 12px; color: var(--muted); margin-top: 5px; }
.class-note { color: #5b534c; }
.class-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; align-items: center; }

/* ---------- Таблица участников ---------- */
.table-scroll { overflow-x: auto; }
.people-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.people-table th { text-align: left; font-family: system-ui, sans-serif; font-size: 12px;
  text-transform: uppercase; letter-spacing: .03em; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--border); }
.people-table td { padding: 9px 10px; border-bottom: 1px solid #F0EAE0; }
.people-table .p-name { font-weight: 600; }
.people-table .num { text-align: center; font-family: Georgia, serif; color: var(--gold); font-weight: 700; }
.row-actions { display: flex; gap: 4px; }

/* ---------- Риски ---------- */
.risk-list { display: flex; flex-direction: column; gap: 10px; }
.risk-row { display: flex; gap: 12px; align-items: flex-start; background: var(--card);
  border: 1px solid var(--border); border-radius: 10px; padding: 13px; box-shadow: var(--shadow); }
.risk-row.risk-closed { opacity: .6; }
.risk-level { font-size: 11px; padding: 2px 9px; border-radius: 10px; font-weight: 700; flex-shrink: 0; margin-top: 2px; }
.level-high { background: #FBE3E3; color: #A22; }
.level-mid { background: #FBF0CF; color: #8a6f10; }
.level-low { background: #EAE5DC; color: #6a6259; }
.risk-main { flex: 1; }
.risk-title { font-weight: 600; }
.risk-done-tag { font-size: 11px; color: var(--green); font-weight: 700; }
.risk-note, .risk-owner { font-size: 13px; color: var(--muted); margin-top: 3px; }
.risk-actions { display: flex; gap: 5px; align-items: center; }
.risk-empty { color: var(--green); font-weight: 600; font-family: Georgia, serif; font-size: 17px; }

/* ---------- Журнал ---------- */
.log-list { display: flex; flex-direction: column; gap: 2px; max-height: 420px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: 10px; padding: 8px; background: var(--card); }
.log-row { display: flex; gap: 10px; align-items: baseline; padding: 6px 8px; font-size: 13px; border-bottom: 1px solid #F5F0E8; flex-wrap: wrap; }
.log-row:last-child { border-bottom: none; }
.log-ts { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.log-actor { font-weight: 700; font-size: 11px; padding: 1px 7px; border-radius: 8px; }
.actor-админ { background: var(--burgundy); color: #fff; }
.actor-сотрудник { background: var(--gold); color: #3a2e00; }
.actor-система { background: #EAE5DC; color: #6a6259; }
.log-action { font-weight: 600; }
.log-detail { color: #5b534c; }

/* ---------- О внедрении (аккордеон) ---------- */
.accordion details { background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  margin-bottom: 8px; padding: 4px 16px; box-shadow: var(--shadow); }
.accordion summary { cursor: pointer; font-family: Georgia, serif; font-weight: 700;
  padding: 10px 0; font-size: 16px; }
.accordion p { margin: 4px 0 12px; color: #423b36; }

/* ---------- Логин ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #fff, var(--cream)); padding: 20px; }
.login-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 10px 40px rgba(34,29,27,.12); padding: 36px; max-width: 380px; width: 100%; }
.login-back { font-size: 13px; color: var(--muted); }
.login-title { font-size: 24px; margin: 14px 0 2px; color: var(--burgundy); }
.login-sub { color: var(--muted); margin: 0 0 22px; font-size: 14px; }
.login-form label { display: block; font-size: 13px; color: #5b534c; margin-bottom: 6px; }
.login-form input { width: 100%; padding: 11px 13px; border: 1px solid var(--border);
  border-radius: 9px; font-size: 16px; margin-bottom: 14px; font-family: inherit; }
.login-form input:focus { outline: 2px solid var(--burgundy); border-color: var(--burgundy); }
.login-form .btn { width: 100%; justify-content: center; }
.login-error { background: #FBE3E3; color: #A22; padding: 8px 12px; border-radius: 8px; font-size: 14px; margin-bottom: 14px; }
.login-note { font-size: 12px; color: var(--muted); margin-top: 16px; text-align: center; }

/* ---------- Модалка ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(34,29,27,.4); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: var(--card); border-radius: 14px; padding: 24px; max-width: 460px; width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,.25); max-height: 90vh; overflow-y: auto; }
.modal h3 { margin: 0 0 16px; font-size: 19px; }
.modal label { display: block; font-size: 13px; color: #5b534c; margin-bottom: 12px; }
.modal input, .modal select, .modal textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px; font-family: inherit; margin-top: 4px; }
.modal-row { display: flex; gap: 12px; }
.modal-row label { flex: 1; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }

.footer { padding: 28px 0; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- Адаптив ---------- */
@media (max-width: 560px) {
  .hero h1 { font-size: 21px; }
  .section h2 { font-size: 19px; }
  .topnav-inner { gap: 10px; }
  .topnav a { font-size: 13px; }
}

/* ---------- Печать ---------- */
@media print {
  body { background: #fff; }
  .topnav, .btn, .icon-btn, .mini, .phase-admin, .task-actions, .class-actions,
  .row-actions, .risk-actions, .inline-form, .chip-add, .modal-overlay, .countdown { display: none !important; }
  .card, .risk-row { box-shadow: none; break-inside: avoid; }
  .section { border-color: #ccc; }
}
