/* ============================================================
   Электронная очередь НУРМК — единая дизайн-система
   Институциональный, спокойный, доступный интерфейс.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

/* ---------- Токены ---------- */
:root {
    /* Палитра — глубокий медицинский синий + спокойный фон */
    --ink:          #0b1f33;
    --brand-700:    #0a3d73;
    --brand-600:    #0056b3;
    --brand-500:    #1a6fce;
    --brand-100:    #e7f0fb;
    --brand-050:    #f2f7fd;

    --accent-600:   #0a8f93;   /* бирюзовый акцент */
    --accent-100:   #e2f4f4;

    --success-600:  #1f9d57;
    --success-050:  #eaf8f0;
    --danger-600:   #d64550;
    --danger-050:   #fdecee;
    --warning-600:  #c47d04;
    --warning-050:  #fdf4e3;

    --bg:           #eef2f7;
    --surface:      #ffffff;
    --surface-2:    #f7f9fc;
    --border:       #dce3ec;
    --border-soft:  #e8edf3;

    --text:         #1f2c3d;
    --muted:        #647285;
    --muted-2:      #8b97a8;

    /* Типографика */
    --font-display: 'Manrope', 'Segoe UI', system-ui, sans-serif;
    --font-body:    'Inter', 'Segoe UI', system-ui, sans-serif;

    /* Форма и тень */
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 18px;
    --r-pill: 999px;

    --sh-1: 0 1px 2px rgba(11, 31, 51, .06);
    --sh-2: 0 6px 18px rgba(11, 31, 51, .08);
    --sh-3: 0 18px 48px rgba(11, 31, 51, .12);

    --ring: 0 0 0 3px rgba(0, 86, 179, .18);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-body);
    background:
        radial-gradient(1100px 480px at 88% -8%, var(--brand-050), transparent 60%),
        var(--bg);
    color: var(--text);
    line-height: 1.6;
    padding: clamp(14px, 3vw, 36px);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); line-height: 1.2; letter-spacing: -.01em; }

a { color: var(--brand-600); }

/* ---------- Контейнер ---------- */
.container {
    max-width: 820px;
    margin: 0 auto;
    background: var(--surface);
    padding: clamp(20px, 4vw, 38px);
    border-radius: var(--r-lg);
    border: 1px solid var(--border-soft);
    box-shadow: var(--sh-2);
}

/* ---------- Шапка ---------- */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding-bottom: 18px;
    margin-bottom: 26px;
    border-bottom: 1px solid var(--border-soft);
}

.header h2 {
    font-size: clamp(20px, 3.6vw, 27px);
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
}

.header h2::before {
    content: "";
    width: 10px; height: 28px;
    border-radius: 4px;
    background: linear-gradient(180deg, var(--brand-500), var(--accent-600));
    flex: none;
}

.brand-sub { color: var(--muted); font-size: 13px; font-weight: 500; display: block; }

/* ---------- Кнопки ---------- */
.btn-admin,
.btn-primary,
.btn-secondary,
.btn-ghost {
    font-family: var(--font-body);
    font-weight: 600;
    border: none;
    border-radius: var(--r-sm);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform .15s ease, background .2s ease, box-shadow .2s ease;
    line-height: 1;
}
.btn-admin:active,
.btn-primary:active,
.btn-secondary:active { transform: translateY(1px); }

.btn-admin {
    background: var(--brand-600);
    color: #fff;
    padding: 10px 16px;
    box-shadow: var(--sh-1);
}
.btn-admin:hover { background: var(--brand-700); transform: translateY(-1px); }

.btn-primary {
    background: var(--success-600);
    color: #fff;
    padding: 13px 20px;
    font-size: 15px;
    box-shadow: var(--sh-1);
}
.btn-primary:hover:not(:disabled) { background: #178a4a; transform: translateY(-1px); box-shadow: var(--sh-2); }
.btn-primary:disabled { background: #aeb8c4; cursor: not-allowed; }

.btn-secondary {
    background: var(--surface-2);
    color: var(--brand-700);
    border: 1px solid var(--border);
    padding: 10px 16px;
    font-size: 14px;
}
.btn-secondary:hover { background: var(--brand-100); border-color: var(--brand-500); }

.btn-ghost {
    background: transparent;
    color: var(--muted);
    padding: 8px 12px;
    font-size: 14px;
}
.btn-ghost:hover { color: var(--brand-600); }

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-sm); }

/* ---------- Прогресс-степпер (публичная запись) ---------- */
.stepper {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 28px;
    padding-bottom: 4px;
}
.stepper .node {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted-2);
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
}
.stepper .dot {
    width: 26px; height: 26px;
    border-radius: 50%;
    display: grid; place-items: center;
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    font-size: 12px;
    color: var(--muted-2);
    flex: none;
    transition: .25s;
}
.stepper .node.done .dot { background: var(--success-050); border-color: var(--success-600); color: var(--success-600); }
.stepper .node.current .dot { background: var(--brand-600); border-color: var(--brand-600); color: #fff; box-shadow: var(--ring); }
.stepper .node.current { color: var(--brand-700); }
.stepper .bar { flex: 1; height: 2px; min-width: 14px; background: var(--border); border-radius: 2px; }
.stepper .bar.filled { background: var(--success-600); }

/* ---------- Ошибки/уведомления ---------- */
.error-msg {
    color: var(--danger-600);
    font-weight: 600;
    margin-bottom: 14px;
    min-height: 20px;
    text-align: center;
    transition: opacity .3s;
}
.error-msg:not(:empty) {
    background: var(--danger-050);
    border: 1px solid #f3c4c8;
    border-radius: var(--r-sm);
    padding: 10px 14px;
}

/* ---------- Шаги ---------- */
.step { display: none; }
.step.active { display: block; animation: fadeInScale .4s ease-out forwards; }
.step h3 { font-size: 20px; margin-bottom: 6px; }
.step > p { color: var(--muted); margin-bottom: 12px; }

/* ---------- Сетки списков ---------- */
.grid-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 14px;
    margin-top: 18px;
}

/* ---------- Карточка специалиста ---------- */
.card-select {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--r-md);
    padding: 18px 14px;
    text-align: center;
    cursor: pointer;
    transition: transform .22s cubic-bezier(.25,.8,.25,1), box-shadow .22s, border-color .22s;
}
.card-select:hover {
    border-color: var(--brand-500);
    box-shadow: var(--sh-2);
    transform: translateY(-4px);
}
.card-select img {
    width: 84px; height: 84px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 12px;
    box-shadow: 0 0 0 4px var(--brand-050);
    background: var(--surface-2);
}
.card-select span { display: block; font-size: 14px; font-weight: 600; color: var(--ink); }

/* ---------- Кнопки выбора (даты/время) ---------- */
.btn-select {
    padding: 13px 10px;
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    border-radius: var(--r-sm);
    cursor: pointer;
    text-align: center;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    color: var(--brand-700);
    transition: .18s;
}
.btn-select:hover:not(.disabled) {
    background: var(--brand-600);
    color: #fff;
    border-color: var(--brand-600);
    transform: translateY(-2px);
    box-shadow: var(--sh-2);
}
.btn-select.disabled {
    background: var(--surface-2);
    color: var(--muted-2);
    cursor: not-allowed;
    text-decoration: line-through;
    opacity: .7;
}

.month-title {
    grid-column: 1 / -1;
    margin: 14px 0 2px;
    color: var(--brand-700);
    font-size: 15px;
    font-weight: 700;
    padding-bottom: 6px;
    border-bottom: 1px dashed var(--border);
}

/* ---------- Формы ---------- */
.form-group { margin-bottom: 16px; text-align: left; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; color: var(--ink); font-size: 14px; }
.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--r-sm);
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--text);
    background: var(--surface);
    transition: border-color .2s, box-shadow .2s;
}
.form-group input:focus,
.form-group select:focus { border-color: var(--brand-500); outline: none; box-shadow: var(--ring); }
.form-group small { display: block; color: var(--muted); margin-top: 5px; font-size: 12.5px; }

/* ---------- Сводка ---------- */
.summary-box {
    background: var(--brand-050);
    padding: 20px 22px;
    border: 1px solid var(--brand-100);
    border-left: 4px solid var(--brand-600);
    margin-bottom: 20px;
    border-radius: var(--r-md);
}
.summary-box p { margin: 7px 0; font-size: 15px; color: var(--text); }
.summary-box strong { color: var(--ink); }

/* ---------- Экран успеха ---------- */
.success-card {
    text-align: center;
    padding: 14px 0;
}
.success-card .badge-uid {
    display: inline-block;
    margin-top: 10px;
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: .04em;
    background: var(--success-050);
    color: #157a40;
    border: 1px dashed var(--success-600);
    padding: 8px 16px;
    border-radius: var(--r-pill);
}

/* ============================================================
   ПАНЕЛЬ АДМИНИСТРАТОРА
   ============================================================ */
.admin-shell { max-width: 1120px; }

.auth-card {
    max-width: 420px;
    margin: clamp(30px, 8vh, 90px) auto;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-3);
    padding: 34px 32px;
}
.auth-card h2 { font-size: 23px; margin-bottom: 4px; }
.auth-card .lead { color: var(--muted); margin-bottom: 22px; font-size: 14px; }
.auth-card .auth-logo {
    width: 46px; height: 46px; border-radius: 12px;
    background: linear-gradient(135deg, var(--brand-600), var(--accent-600));
    display: grid; place-items: center; color: #fff; font-weight: 800;
    font-family: var(--font-display); margin-bottom: 16px;
}
.auth-card form { margin-top: 4px; }
.link-muted { color: var(--muted); font-size: 13.5px; text-decoration: none; }
.link-muted:hover { color: var(--brand-600); text-decoration: underline; }

/* OTP-поле */
.otp-input {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 700;
    text-align: center;
    letter-spacing: .5em;
    padding: 14px 10px 14px 18px;
    width: 100%;
}

/* Топбар админки */
.admin-bar {
    display: flex; justify-content: space-between; align-items: center;
    gap: 14px; flex-wrap: wrap;
    padding-bottom: 18px; margin-bottom: 20px;
    border-bottom: 1px solid var(--border-soft);
}
.admin-bar h2 { font-size: 22px; }
.admin-bar .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Вкладки */
.tab-menu {
    display: flex; gap: 6px; flex-wrap: wrap;
    margin-bottom: 22px;
    background: var(--surface-2);
    padding: 6px;
    border-radius: var(--r-md);
    border: 1px solid var(--border-soft);
}
.tab-btn {
    padding: 9px 18px;
    text-decoration: none;
    color: var(--muted);
    border-radius: var(--r-sm);
    font-weight: 600;
    font-size: 14px;
    transition: .2s;
}
.tab-btn.active { background: var(--surface); color: var(--brand-700); box-shadow: var(--sh-1); }
.tab-btn:hover:not(.active) { color: var(--brand-600); }

/* Карточки статистики */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-md);
    padding: 18px 20px;
    box-shadow: var(--sh-1);
    position: relative;
    overflow: hidden;
}
.stat-card::after {
    content: ""; position: absolute; right: -18px; top: -18px;
    width: 70px; height: 70px; border-radius: 50%;
    background: var(--brand-050);
}
.stat-card .k { font-size: 13px; color: var(--muted); font-weight: 600; position: relative; }
.stat-card .v { font-family: var(--font-display); font-size: 32px; font-weight: 800; color: var(--ink); position: relative; line-height: 1.1; margin-top: 4px; }
.stat-card.accent .v { color: var(--brand-600); }
.stat-card.green .v { color: var(--success-600); }
.stat-card.green::after { background: var(--success-050); }
.stat-card.teal .v { color: var(--accent-600); }
.stat-card.teal::after { background: var(--accent-100); }

/* Панель фильтров */
.toolbar {
    display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end;
    background: var(--surface-2);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-md);
    padding: 14px 16px;
    margin-bottom: 18px;
}
.toolbar .field { display: flex; flex-direction: column; gap: 4px; }
.toolbar label { font-size: 12px; font-weight: 600; color: var(--muted); }
.toolbar input, .toolbar select {
    padding: 9px 12px; border: 1.5px solid var(--border);
    border-radius: var(--r-sm); font-family: var(--font-body); font-size: 14px; background: var(--surface);
}
.toolbar input:focus, .toolbar select:focus { border-color: var(--brand-500); outline: none; box-shadow: var(--ring); }
.toolbar .grow { flex: 1 1 220px; }
.result-count { color: var(--muted); font-size: 13px; margin: 0 2px 12px; }

/* Таблицы */
.admin-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--sh-1); border: 1px solid var(--border-soft); }
.admin-table th, .admin-table td { padding: 13px 14px; text-align: left; border-bottom: 1px solid var(--border-soft); font-size: 14px; }
.admin-table thead th {
    background: var(--surface-2);
    color: var(--brand-700);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: .03em;
    position: sticky; top: 0;
}
.admin-table tbody tr:hover { background: var(--brand-050); }
.admin-table tbody tr:last-child td { border-bottom: none; }
.uid-chip {
    font-family: var(--font-display); font-weight: 700; font-size: 12.5px;
    background: var(--brand-050); color: var(--brand-700);
    padding: 3px 9px; border-radius: var(--r-pill); border: 1px solid var(--brand-100);
}
.empty-row td { text-align: center; color: var(--muted); padding: 34px 14px; font-style: italic; }

.pill-gender { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: var(--r-pill); }
.pill-gender.m { background: var(--brand-050); color: var(--brand-700); }
.pill-gender.f { background: var(--accent-100); color: var(--accent-600); }

/* Иконки-действия */
.badge-del, .badge-edit {
    text-decoration: none; font-size: 13px; font-weight: 600;
    padding: 5px 10px; border-radius: var(--r-sm); display: inline-block;
}
.badge-edit { color: var(--brand-600); background: var(--brand-050); margin-right: 6px; }
.badge-edit:hover { background: var(--brand-100); }
.badge-del { color: var(--danger-600); background: var(--danger-050); border: none; cursor: pointer; font-family: var(--font-body); }
.badge-del:hover { background: #fbd9dd; }
.inline-form { display: inline; }

/* Формы в админке */
.form-inline {
    background: var(--surface);
    padding: 22px;
    border-radius: var(--r-md);
    margin-bottom: 22px;
    border: 1px solid var(--border-soft);
    box-shadow: var(--sh-1);
}
.form-inline h4 { margin-bottom: 14px; font-size: 16px; }
.img-admin { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; background: var(--surface-2); box-shadow: 0 0 0 3px var(--brand-050); }
.photo-preview { max-width: 110px; max-height: 110px; margin-top: 8px; border-radius: var(--r-md); box-shadow: var(--sh-1); }

/* Уведомления */
.alert-error, .alert-success {
    padding: 12px 16px; margin-bottom: 18px; border-radius: var(--r-md); font-weight: 500;
    display: flex; align-items: center; gap: 10px;
}
.alert-error { background: var(--danger-050); border: 1px solid #f3c4c8; color: #b3303b; }
.alert-success { background: var(--success-050); border: 1px solid #bfe6cd; color: #157a40; }
.alert-error::before { content: "⚠"; }
.alert-success::before { content: "✓"; }

/* ---------- Капча ---------- */
.smart-captcha { display: flex; justify-content: center; margin: 22px 0; }

/* ---------- Утилиты ---------- */
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.flex-row { display: flex; gap: 20px; flex-wrap: wrap; }
.flex-row > * { flex: 1; min-width: 160px; }
.divider { border: 0; border-top: 1px solid var(--border-soft); margin: 22px 0; }

/* ---------- Анимации ---------- */
@keyframes fadeInScale {
    0% { opacity: 0; transform: scale(.98) translateY(8px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes slideIn {
    0% { opacity: 0; transform: translateX(-12px); }
    100% { opacity: 1; transform: translateX(0); }
}
.anim-item { opacity: 0; animation: slideIn .3s ease-out forwards; }
.anim-item:nth-child(1) { animation-delay: .04s; }
.anim-item:nth-child(2) { animation-delay: .08s; }
.anim-item:nth-child(3) { animation-delay: .12s; }
.anim-item:nth-child(4) { animation-delay: .16s; }
.anim-item:nth-child(5) { animation-delay: .20s; }
.anim-item:nth-child(n+6) { animation-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
    *, .step.active, .anim-item { animation: none !important; transition: none !important; opacity: 1 !important; }
}

/* ============================================================
   HERO (публичная страница) — иллюстрированный 2D/3D-баннер
   ============================================================ */
.hero {
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    align-items: center;
    gap: 18px;
    padding: clamp(18px, 3vw, 30px);
    margin-bottom: 26px;
    border-radius: var(--r-lg);
    background:
        radial-gradient(120% 140% at 90% 0%, rgba(10, 143, 147, .10), transparent 55%),
        linear-gradient(135deg, var(--brand-050), #fff 70%);
    border: 1px solid var(--border-soft);
    overflow: hidden;
    position: relative;
}
.hero-eyebrow {
    display: inline-block;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--accent-600);
    background: var(--accent-100);
    padding: 5px 12px;
    border-radius: var(--r-pill);
    margin-bottom: 12px;
}
.hero-title {
    font-size: clamp(28px, 5.4vw, 44px);
    font-weight: 800;
    line-height: 1.02;
    letter-spacing: -.02em;
    background: linear-gradient(120deg, var(--brand-700), var(--brand-500) 60%, var(--accent-600));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero-lead { color: var(--muted); font-size: 14.5px; margin: 12px 0 18px; max-width: 38ch; }
.hero-staff { background: var(--brand-700); }
.hero-staff:hover { background: var(--brand-600); }

.hero-art { display: flex; justify-content: center; align-items: center; }
.hero-art svg { width: 100%; max-width: 280px; height: auto; animation: heroFloat 6s ease-in-out infinite; }
.art-card  { transform-box: fill-box; transform-origin: center; animation: heroTilt 7s ease-in-out infinite; }
.art-cross { transform-box: fill-box; transform-origin: center; animation: crossPop 5s ease-in-out infinite; }
.art-pill  { transform-box: fill-box; transform-origin: center; animation: pillFloat 4.5s ease-in-out infinite; }
.art-blob  { transform-box: fill-box; transform-origin: center; animation: blobPulse 9s ease-in-out infinite; }
.art-check { stroke-dasharray: 40; stroke-dashoffset: 40; animation: drawCheck 5s ease-in-out infinite; }

@keyframes heroFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes heroTilt  { 0%,100% { transform: rotate(0deg); } 50% { transform: rotate(-2deg); } }
@keyframes crossPop  { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-6px) scale(1.05); } }
@keyframes pillFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(7px); } }
@keyframes blobPulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.04); opacity: .85; } }
@keyframes drawCheck { 0%,55% { stroke-dashoffset: 40; } 80%,100% { stroke-dashoffset: 0; } }

/* Подпись текущего шага (особенно полезна на мобильных) */
.step-label {
    text-align: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 13px;
    color: var(--brand-700);
    margin: -14px 0 22px;
    letter-spacing: .01em;
}
.step-label.done { color: var(--success-600); }

/* 3D-наведение на карточку специалиста */
.card-select { transform-style: preserve-3d; }
.grid-list { perspective: 900px; }
.card-select:hover { transform: translateY(-4px) rotateX(4deg) rotateY(-4deg); }

/* ============================================================
   ЛИНИЯ ДНЯ (таймлайн на дашборде)
   ============================================================ */
.timeline-panel {
    background:
        radial-gradient(90% 120% at 100% 0%, var(--brand-050), transparent 60%),
        var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-1);
    padding: 20px 22px;
    margin-bottom: 24px;
}
.timeline-head {
    display: flex; justify-content: space-between; align-items: flex-end;
    gap: 14px; flex-wrap: wrap; margin-bottom: 16px;
}
.timeline-title { font-size: 18px; }
.timeline-title::before {
    content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%;
    background: var(--accent-600); margin-right: 9px; vertical-align: middle;
    box-shadow: 0 0 0 4px var(--accent-100);
}
.timeline-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.timeline-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.timeline-nav input[type="date"] {
    padding: 8px 12px; border: 1.5px solid var(--border); border-radius: var(--r-sm);
    font-family: var(--font-body); font-size: 14px; background: var(--surface);
}
.tl-arrow {
    width: 34px; height: 34px; display: grid; place-items: center;
    border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--border);
    color: var(--brand-700); font-size: 20px; font-weight: 700; text-decoration: none; line-height: 1;
}
.tl-arrow:hover { background: var(--brand-100); border-color: var(--brand-500); }
.tl-today { padding: 8px 14px; }

.timeline-empty {
    text-align: center; color: var(--muted); font-style: italic;
    padding: 26px; background: var(--surface-2); border-radius: var(--r-md);
    border: 1px dashed var(--border);
}

.timeline { list-style: none; position: relative; margin: 6px 0 0; padding: 0; }
.timeline::before {
    content: ""; position: absolute; left: 96px; top: 6px; bottom: 6px; width: 2px;
    background: linear-gradient(var(--brand-100), var(--accent-100)); border-radius: 2px;
}
.tl-item {
    display: grid; grid-template-columns: 78px 24px 1fr; align-items: center;
    gap: 6px; padding: 7px 0;
}
.tl-time {
    font-family: var(--font-display); font-weight: 800; font-size: 16px;
    color: var(--brand-700); text-align: right; padding-right: 8px;
}
.tl-track { display: flex; justify-content: center; position: relative; z-index: 1; }
.tl-node {
    width: 15px; height: 15px; border-radius: 50%; background: var(--brand-600);
    box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px var(--brand-100);
}
.tl-node.f { background: var(--accent-600); box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px var(--accent-100); }
.tl-card {
    background: var(--surface); border: 1px solid var(--border-soft);
    border-left: 3px solid var(--brand-500); border-radius: var(--r-md);
    padding: 10px 14px; box-shadow: var(--sh-1);
    transition: transform .18s ease, box-shadow .18s ease;
}
.tl-item:hover .tl-card { transform: translateX(3px); box-shadow: var(--sh-2); }
.tl-name { font-weight: 700; color: var(--ink); font-size: 14.5px; }
.tl-meta { color: var(--muted); font-size: 13px; }
.tl-meta strong { color: var(--brand-700); }
.tl-uid {
    display: inline-block; margin-top: 4px; font-family: var(--font-display);
    font-size: 11px; font-weight: 700; letter-spacing: .03em;
    color: var(--muted-2); background: var(--surface-2);
    padding: 2px 8px; border-radius: var(--r-pill);
}

/* ============================================================
   МОДАЛКА РЕДАКТИРОВАНИЯ ЗАПИСИ
   ============================================================ */
.modal-overlay {
    position: fixed; inset: 0; z-index: 50;
    background: rgba(11, 31, 51, .5);
    backdrop-filter: blur(3px);
    display: flex; align-items: flex-start; justify-content: center;
    padding: clamp(16px, 6vh, 70px) 16px;
    overflow-y: auto;
    animation: fadeInScale .25s ease-out;
}
.modal-card {
    background: var(--surface); border-radius: var(--r-lg);
    box-shadow: var(--sh-3); border: 1px solid var(--border-soft);
    width: 100%; max-width: 640px; padding: 24px 26px;
    animation: modalIn .3s cubic-bezier(.2,.8,.25,1);
}
@keyframes modalIn { 0% { opacity: 0; transform: translateY(14px) scale(.98); } 100% { opacity: 1; transform: translateY(0) scale(1); } }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.modal-head h4 { font-size: 19px; }
.modal-close {
    width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--r-sm);
    color: var(--muted); text-decoration: none; font-size: 24px; line-height: 1;
    background: var(--surface-2); border: 1px solid var(--border);
}
.modal-close:hover { color: var(--danger-600); background: var(--danger-050); border-color: #f3c4c8; }
.modal-uid { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.modal-hint {
    background: var(--brand-050); border: 1px solid var(--brand-100);
    border-radius: var(--r-sm); padding: 9px 12px; font-size: 13px; color: var(--brand-700);
}

/* ============================================================
   ЗАЩИТА ГЛАВНОГО АДМИНИСТРАТОРА
   ============================================================ */
.row-main-admin { background: linear-gradient(90deg, var(--brand-050), transparent 70%); }
.pill-main {
    display: inline-block; margin-left: 8px; font-size: 11px; font-weight: 700;
    color: #fff; background: linear-gradient(135deg, var(--brand-600), var(--accent-600));
    padding: 2px 9px; border-radius: var(--r-pill); vertical-align: middle;
    letter-spacing: .02em;
}
.lock-note { color: var(--muted-2); font-size: 12.5px; font-style: italic; }
.lock-note::before { content: "🔒"; margin-right: 5px; font-style: normal; }

@media (prefers-reduced-motion: reduce) {
    .hero-art svg, .art-card, .art-cross, .art-pill, .art-blob, .art-check { animation: none !important; }
    .art-check { stroke-dashoffset: 0; }
    .card-select:hover { transform: translateY(-4px); }
}

/* ============================================================
   АДАПТИВНОСТЬ
   ============================================================ */
@media (max-width: 760px) {
    .hero { grid-template-columns: 1fr; text-align: left; }
    .hero-art { order: -1; max-width: 220px; margin: 0 auto 4px; }
    .hero-lead { max-width: none; }
}

@media (max-width: 640px) {
    body { padding: 10px; }
    .container { padding: 16px; border-radius: var(--r-md); }
    .grid-list { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
    .card-select:hover { transform: translateY(-3px); }

    /* Компактный степпер: только точки + бары, подпись отдельной строкой */
    .stepper { gap: 4px; justify-content: space-between; overflow-x: visible; }
    .stepper .node-label { display: none; }
    .stepper .node { gap: 0; }
    .step-label { margin: -8px 0 18px; font-size: 14px; }

    .tab-menu { flex-direction: column; }
    .tab-btn { text-align: center; }
    .admin-table { font-size: 13px; }
    .admin-table th, .admin-table td { padding: 10px; }
    .toolbar .field, .toolbar .grow { flex: 1 1 100%; }
    .flex-row > * { min-width: 100%; }

    /* Таймлайн на узких экранах */
    .timeline::before { left: 64px; }
    .tl-item { grid-template-columns: 52px 20px 1fr; }
    .tl-time { font-size: 14px; }
    .timeline-head { flex-direction: column; align-items: stretch; }
    .timeline-nav { justify-content: space-between; }

    .modal-card { padding: 18px; }
}

@media (max-width: 380px) {
    .stepper .dot { width: 22px; height: 22px; font-size: 11px; }
    .grid-list { grid-template-columns: repeat(2, 1fr); }
}
