/* ==========================================================================
   АЙЧҮРӨК — дизайн-система (SPEC раздел 2)
   Кремовый фон, burgundy акценты, золотые hairline, мягкие тени, radius 20px.
   ========================================================================== */

:root {
    /* Палитра */
    --cream: #FAF5EF;
    --ivory: #FFFDF9;
    --burgundy: #7A1E2E;
    --burgundy-dark: #5C1422;
    --rose: #A64D5E;
    --dusty: #E9D2C9;
    --champagne: #C9A96A;
    --beige: #EFE6DA;
    --brown: #3E2A25;

    /* Производные */
    --text: var(--brown);
    --text-soft: rgba(62, 42, 37, .68);
    --text-faint: rgba(62, 42, 37, .45);
    --line: rgba(201, 169, 106, .5);            /* золотой hairline */
    --line-soft: rgba(62, 42, 37, .10);
    --shadow-card: 0 10px 30px rgba(122, 30, 46, .08);
    --shadow-lift: 0 16px 40px rgba(122, 30, 46, .14);
    --shadow-soft: 0 4px 16px rgba(122, 30, 46, .06);
    --radius: 20px;
    --radius-sm: 12px;
    --radius-pill: 999px;
    --grad-primary: linear-gradient(135deg, #7A1E2E, #9C2B40);

    /* Типографика */
    --font-serif: 'Playfair Display', Georgia, serif;
    --font-sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;

    /* Статусы записей (SPEC 8: новая=beige, подтв=зелёный, пришёл=champagne,
       завершена=серая, отмена=красная бледная, no_show=тёмная) */
    --st-new-bg: #EFE6DA;       --st-new-fg: #6B5335;
    --st-pending-bg: #F6E9D4;   --st-pending-fg: #9A6B1F;
    --st-confirmed-bg: #DDEADD; --st-confirmed-fg: #3E6B45;
    --st-arrived-bg: #EADFC4;   --st-arrived-fg: #8A6B28;
    --st-completed-bg: #E5E3E0; --st-completed-fg: #6E6A66;
    --st-cancelled-bg: #F3DCDA; --st-cancelled-fg: #A14A44;
    --st-noshow-bg: #4A3A38;    --st-noshow-fg: #F3E9E4;

    --header-h: 76px;
}

/* --------------------------------------------------------------------------
   База
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--cream);
    background-image:
        radial-gradient(ellipse 60% 40% at 85% -5%, rgba(166, 77, 94, .10), transparent 70%),
        radial-gradient(ellipse 45% 35% at -10% 30%, rgba(201, 169, 106, .10), transparent 70%);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.modal-open, body.nav-open { overflow: hidden; }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--burgundy); text-decoration: none; }
a:hover { color: var(--burgundy-dark); }

h1, h2, h3, h4, h5 {
    font-family: var(--font-serif);
    font-weight: 600;
    line-height: 1.2;
    color: var(--brown);
    margin: 0 0 .5em;
}
h1 { font-size: clamp(2rem, 4.5vw, 3.4rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.05rem; font-family: var(--font-sans); font-weight: 700; }

p { margin: 0 0 1em; }
::selection { background: var(--dusty); color: var(--burgundy-dark); }

.container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 20px;
}

.section { padding: 64px 0; }
.section-title { text-align: center; margin-bottom: 8px; }
.section-subtitle {
    text-align: center;
    color: var(--text-soft);
    max-width: 560px;
    margin: 0 auto 40px;
}

/* Золотой hairline-разделитель */
.hairline {
    border: 0;
    height: 1px;
    background: var(--line);
    opacity: 1;
    margin: 24px 0;
}
.hairline-center {
    width: 72px;
    margin: 16px auto 28px;
    background: var(--champagne);
    opacity: .5;
}

/* --------------------------------------------------------------------------
   Кнопки
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 15px;
    line-height: 1;
    padding: 15px 28px;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease, border-color .18s ease;
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn-primary {
    background: var(--grad-primary);
    color: #fff;
    box-shadow: 0 8px 22px rgba(122, 30, 46, .28);
}
.btn-primary:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(122, 30, 46, .34);
}

.btn-outline {
    background: transparent;
    color: var(--burgundy);
    border-color: var(--burgundy);
}
.btn-outline:hover {
    background: var(--burgundy);
    color: #fff;
    transform: translateY(-2px);
}

.btn-outline-light {
    background: transparent;
    color: #F3E9E4;
    border-color: rgba(243, 233, 228, .6);
}
.btn-outline-light:hover { background: rgba(243, 233, 228, .14); color: #fff; }

.btn-ghost {
    background: transparent;
    color: var(--burgundy);
    padding: 12px 18px;
}
.btn-ghost:hover { background: rgba(122, 30, 46, .07); }

.btn-sm { padding: 10px 18px; font-size: 13.5px; }
.btn-lg { padding: 18px 36px; font-size: 16.5px; }
.btn-block { width: 100%; }

/* --------------------------------------------------------------------------
   Карточки
   -------------------------------------------------------------------------- */
.card {
    background: var(--ivory);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 28px;
    border: 1px solid rgba(201, 169, 106, .18);
    transition: transform .22s ease, box-shadow .22s ease;
}
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.card-title { margin-bottom: 6px; }
.card-text { color: var(--text-soft); font-size: 15px; }
.card-flat { box-shadow: var(--shadow-soft); }

/* --------------------------------------------------------------------------
   Формы
   -------------------------------------------------------------------------- */
.field { margin-bottom: 18px; }
.field-label {
    display: block;
    font-weight: 600;
    font-size: 13.5px;
    letter-spacing: .02em;
    margin-bottom: 7px;
    color: var(--brown);
}
.input, .select, .textarea {
    width: 100%;
    font-family: var(--font-sans);
    font-size: 15.5px;
    color: var(--text);
    background: var(--ivory);
    border: 1.5px solid rgba(62, 42, 37, .16);
    border-radius: var(--radius-sm);
    padding: 13px 16px;
    transition: border-color .16s ease, box-shadow .16s ease;
    outline: none;
}
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.input:focus, .select:focus, .textarea:focus {
    border-color: var(--burgundy);
    box-shadow: 0 0 0 3px rgba(122, 30, 46, .12);
}
.input.is-invalid, .select.is-invalid, .textarea.is-invalid {
    border-color: #B3402F;
    box-shadow: 0 0 0 3px rgba(179, 64, 47, .10);
}
.textarea { min-height: 110px; resize: vertical; }
.select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%237A1E2E' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 42px;
}
.field-hint { font-size: 13px; color: var(--text-faint); margin-top: 5px; }
.field-error { font-size: 13px; color: #B3402F; margin-top: 5px; }

.checkbox, .radio {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 15px;
    cursor: pointer;
}
.checkbox input, .radio input {
    width: 18px; height: 18px;
    accent-color: var(--burgundy);
    cursor: pointer;
}

/* --------------------------------------------------------------------------
   Бейджи статусов записей (7 статусов)
   -------------------------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .03em;
    padding: 5px 13px;
    border-radius: var(--radius-pill);
    white-space: nowrap;
}
.badge::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
}
.badge-new       { background: var(--st-new-bg);       color: var(--st-new-fg); }
.badge-pending   { background: var(--st-pending-bg);   color: var(--st-pending-fg); }
.badge-confirmed { background: var(--st-confirmed-bg); color: var(--st-confirmed-fg); }
.badge-arrived   { background: var(--st-arrived-bg);   color: var(--st-arrived-fg); }
.badge-completed { background: var(--st-completed-bg); color: var(--st-completed-fg); }
.badge-cancelled { background: var(--st-cancelled-bg); color: var(--st-cancelled-fg); }
.badge-no_show   { background: var(--st-noshow-bg);    color: var(--st-noshow-fg); }

/* --------------------------------------------------------------------------
   Header / навигация
   -------------------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(250, 245, 239, .88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    height: var(--header-h);
}

.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-logo {
    width: 48px; height: 48px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 1.5px var(--champagne), var(--shadow-soft);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 21px;
    letter-spacing: .06em;
    color: var(--burgundy);
}
.brand-sub {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .24em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.main-nav { display: flex; align-items: center; gap: 4px; }
.nav-link {
    position: relative;
    font-weight: 600;
    font-size: 14.5px;
    color: var(--text);
    padding: 9px 13px;
    border-radius: var(--radius-pill);
    transition: color .16s ease, background .16s ease;
}
.nav-link:hover { color: var(--burgundy); background: rgba(122, 30, 46, .06); }
.nav-link.is-active { color: var(--burgundy); }
.nav-link.is-active::after {
    content: '';
    position: absolute;
    left: 13px; right: 13px; bottom: 4px;
    height: 1.5px;
    background: var(--champagne);
}

.header-actions { display: flex; align-items: center; gap: 16px; }
.header-phone {
    font-weight: 700;
    font-size: 15px;
    color: var(--brown);
    white-space: nowrap;
}
.header-phone:hover { color: var(--burgundy); }
.btn-book { padding: 13px 24px; font-size: 14px; }

/* Burger */
.burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px; height: 44px;
    padding: 10px;
    background: transparent;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.burger span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--burgundy);
    border-radius: 2px;
    transition: transform .22s ease, opacity .18s ease;
}
.burger.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.is-active span:nth-child(2) { opacity: 0; }
.burger.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
    position: relative;
    overflow: hidden;
    padding: 80px 0 90px;
    background:
        radial-gradient(ellipse 55% 60% at 78% 40%, rgba(166, 77, 94, .12), transparent 70%),
        radial-gradient(ellipse 40% 45% at 15% 85%, rgba(201, 169, 106, .14), transparent 70%),
        var(--cream);
}
.hero-inner {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    align-items: center;
    gap: 48px;
}
.hero-eyebrow {
    display: inline-block;
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--rose);
    margin-bottom: 18px;
}
.hero-title { margin-bottom: 18px; }
.hero-title em { font-style: italic; color: var(--burgundy); }
.hero-sub {
    font-size: 18px;
    color: var(--text-soft);
    max-width: 480px;
    margin-bottom: 32px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-media { position: relative; display: flex; justify-content: center; }
.hero-media img {
    width: min(420px, 90%);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lift), 0 0 0 1px rgba(201, 169, 106, .35);
}
.hero-media::before {
    content: '';
    position: absolute;
    inset: -18px -18px auto auto;
    width: 130px; height: 130px;
    border-top: 1px solid var(--champagne);
    border-right: 1px solid var(--champagne);
    border-radius: 0 var(--radius) 0 0;
    opacity: .6;
}

/* Преимущества */
.features {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.feature { text-align: center; padding: 30px 20px; }
.feature-icon {
    width: 58px; height: 58px;
    margin: 0 auto 16px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--beige);
    color: var(--burgundy);
}
.feature-icon svg { width: 26px; height: 26px; }

/* --------------------------------------------------------------------------
   Сетка карточек услуг / мастеров
   -------------------------------------------------------------------------- */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.service-card { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.service-card .card-img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: var(--beige);
}
.service-card .card-body { padding: 22px 24px 24px; display: flex; flex-direction: column; flex: 1; }
.service-price {
    font-family: var(--font-serif);
    font-size: 21px;
    font-weight: 700;
    color: var(--burgundy);
}
.service-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13.5px;
    color: var(--text-faint);
    margin: 8px 0 18px;
}
.service-card .btn { margin-top: auto; }

.master-card { text-align: center; }
.master-card .avatar {
    width: 110px; height: 110px;
    margin: 0 auto 16px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--beige);
    box-shadow: 0 0 0 1.5px var(--champagne), var(--shadow-soft);
}
.master-spec { font-size: 13.5px; color: var(--rose); font-weight: 700; letter-spacing: .04em; }
.master-exp { font-size: 13px; color: var(--text-faint); }

/* --------------------------------------------------------------------------
   Табы
   -------------------------------------------------------------------------- */
.tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 36px;
}
.tab {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 14px;
    color: var(--text-soft);
    background: transparent;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-pill);
    padding: 11px 22px;
    cursor: pointer;
    transition: all .18s ease;
}
.tab:hover { color: var(--burgundy); border-color: var(--burgundy); }
.tab.is-active {
    background: var(--grad-primary);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 6px 16px rgba(122, 30, 46, .25);
}

/* --------------------------------------------------------------------------
   Модальные окна
   -------------------------------------------------------------------------- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(62, 42, 37, .45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .22s ease, visibility .22s ease;
}
.modal.is-open { opacity: 1; visibility: visible; }
.modal-dialog {
    width: 100%;
    max-width: 520px;
    max-height: 88vh;
    overflow-y: auto;
    background: var(--ivory);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lift);
    padding: 32px;
    transform: translateY(14px) scale(.985);
    transition: transform .24s cubic-bezier(.2, .9, .3, 1.2);
}
.modal.is-open .modal-dialog { transform: none; }
.modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}
.modal-title { margin: 0; }
.modal-close {
    flex: none;
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    background: var(--beige);
    border: 0;
    border-radius: 50%;
    color: var(--burgundy);
    font-size: 18px;
    cursor: pointer;
    transition: background .16s ease, transform .16s ease;
}
.modal-close:hover { background: var(--dusty); transform: rotate(90deg); }

/* --------------------------------------------------------------------------
   Тосты
   -------------------------------------------------------------------------- */
.toast-container {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(380px, calc(100vw - 40px));
}
.toast {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    background: var(--brown);
    color: #F7EFE8;
    font-size: 14.5px;
    font-weight: 600;
    box-shadow: var(--shadow-lift);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .3s ease, transform .3s ease;
}
.toast.is-visible { opacity: 1; transform: none; }
.toast-success { background: var(--burgundy); }
.toast-error { background: #8C2F22; }
.toast-info { background: var(--brown); }

/* --------------------------------------------------------------------------
   Wizard (онлайн-запись): прогресс-бар и шаги
   -------------------------------------------------------------------------- */
.wizard {
    max-width: 720px;
    margin: 0 auto;
}
.wizard-progress {
    display: flex;
    align-items: flex-start;
    margin-bottom: 40px;
}
.wizard-step-dot {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 76px;
}
.wizard-dot {
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--ivory);
    border: 1.5px solid var(--line-soft);
    color: var(--text-faint);
    font-weight: 800;
    font-size: 14px;
    transition: all .2s ease;
}
.wizard-step-label {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .02em;
    color: var(--text-faint);
    text-align: center;
}
.wizard-bar {
    flex: 1;
    height: 2px;
    margin-top: 19px;
    background: var(--line-soft);
    position: relative;
    overflow: hidden;
}
.wizard-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--champagne);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .35s ease;
}
.wizard-step-dot.is-done .wizard-dot {
    background: var(--grad-primary);
    border-color: transparent;
    color: #fff;
}
.wizard-step-dot.is-current .wizard-dot {
    border-color: var(--burgundy);
    color: var(--burgundy);
    box-shadow: 0 0 0 4px rgba(122, 30, 46, .10);
}
.wizard-step-dot.is-current .wizard-step-label { color: var(--burgundy); }
.wizard-bar.is-done::after { transform: scaleX(1); }

.wizard-panel { display: none; }
.wizard-panel.is-active { display: block; animation: fadeUp .3s ease; }
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}
.wizard-nav {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-top: 28px;
}

/* Слоты времени */
.slot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
    gap: 10px;
}
.slot {
    padding: 11px 6px;
    text-align: center;
    font-weight: 700;
    font-size: 14.5px;
    border: 1.5px solid var(--line-soft);
    border-radius: var(--radius-sm);
    background: var(--ivory);
    cursor: pointer;
    transition: all .15s ease;
}
.slot:hover:not(:disabled) { border-color: var(--burgundy); color: var(--burgundy); }
.slot.is-selected {
    background: var(--grad-primary);
    border-color: transparent;
    color: #fff;
}
.slot:disabled {
    background: var(--beige);
    color: var(--text-faint);
    cursor: not-allowed;
    text-decoration: line-through;
}

/* --------------------------------------------------------------------------
   Таблицы (admin)
   -------------------------------------------------------------------------- */
.table-wrap {
    overflow-x: auto;
    background: var(--ivory);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(201, 169, 106, .18);
}
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14.5px;
    min-width: 640px;
}
.table th {
    text-align: left;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-faint);
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--line-soft);
    vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .14s ease; }
.table tbody tr:hover { background: rgba(233, 210, 201, .25); }
.table .cell-main { font-weight: 700; color: var(--brown); }
.table .cell-sub { font-size: 12.5px; color: var(--text-faint); }
.table-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* --------------------------------------------------------------------------
   Sidebar layout (admin / master / cabinet)
   -------------------------------------------------------------------------- */
.app-shell {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 100vh;
}
.sidebar {
    background: var(--ivory);
    border-right: 1px solid var(--line);
    padding: 26px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.sidebar-brand { padding: 0 10px 20px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14.5px;
    color: var(--text-soft);
    transition: all .15s ease;
}
.sidebar-link svg { width: 19px; height: 19px; flex: none; }
.sidebar-link:hover { background: var(--beige); color: var(--burgundy); }
.sidebar-link.is-active {
    background: var(--grad-primary);
    color: #fff;
    box-shadow: 0 6px 16px rgba(122, 30, 46, .25);
}
.sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.app-content { padding: 34px 36px; min-width: 0; }
.app-page-title { margin-bottom: 4px; }
.app-page-sub { color: var(--text-soft); margin-bottom: 28px; }

/* Метрики dashboard */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}
.stat-card { padding: 22px 24px; }
.stat-label {
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 8px;
}
.stat-value {
    font-family: var(--font-serif);
    font-size: 30px;
    font-weight: 700;
    color: var(--burgundy);
    line-height: 1.1;
}
.stat-delta { font-size: 12.5px; color: var(--text-soft); margin-top: 6px; }
.stat-delta.up { color: #3E6B45; }
.stat-delta.down { color: #A14A44; }

/* --------------------------------------------------------------------------
   Календарная сетка (admin calendar, master schedule)
   -------------------------------------------------------------------------- */
.calendar {
    display: grid;
    background: var(--ivory);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}
.calendar-head {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    background: var(--beige);
    border-bottom: 1px solid var(--line);
}
.calendar-head-cell {
    padding: 13px 14px;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--brown);
    border-left: 1px solid var(--line-soft);
    text-align: center;
}
.calendar-head-cell:first-child { border-left: 0; }
.calendar-body {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
}
.calendar-col { border-left: 1px solid var(--line-soft); position: relative; min-height: 480px; }
.calendar-col:first-child { border-left: 0; }
.calendar-slot {
    height: 44px;
    border-bottom: 1px dashed rgba(62, 42, 37, .07);
    padding: 3px 6px;
    font-size: 11.5px;
    color: var(--text-faint);
}
.calendar-event {
    position: absolute;
    left: 6px; right: 6px;
    border-radius: 10px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
    overflow: hidden;
    cursor: grab;
    box-shadow: var(--shadow-soft);
    border-left: 3px solid currentColor;
}
.calendar-event small { display: block; font-weight: 600; opacity: .8; }
.calendar-event.st-new       { background: var(--st-new-bg);       color: var(--st-new-fg); }
.calendar-event.st-pending   { background: var(--st-pending-bg);   color: var(--st-pending-fg); }
.calendar-event.st-confirmed { background: var(--st-confirmed-bg); color: var(--st-confirmed-fg); }
.calendar-event.st-arrived   { background: var(--st-arrived-bg);   color: var(--st-arrived-fg); }
.calendar-event.st-completed { background: var(--st-completed-bg); color: var(--st-completed-fg); }
.calendar-event.st-cancelled { background: var(--st-cancelled-bg); color: var(--st-cancelled-fg); }
.calendar-event.st-no_show   { background: var(--st-noshow-bg);    color: var(--st-noshow-fg); }

/* Мини-календарь выбора даты (wizard) */
.date-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}
.date-cell {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border-radius: var(--radius-sm);
    border: 1.5px solid transparent;
    background: var(--ivory);
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    font-weight: 700;
    transition: all .15s ease;
}
.date-cell small { font-size: 10.5px; font-weight: 700; text-transform: uppercase; color: var(--text-faint); }
.date-cell:hover:not(:disabled) { border-color: var(--burgundy); }
.date-cell.is-selected { background: var(--grad-primary); color: #fff; }
.date-cell.is-selected small { color: rgba(255, 255, 255, .75); }
.date-cell:disabled { background: transparent; box-shadow: none; color: var(--text-faint); cursor: not-allowed; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
    margin-top: auto;
    background: var(--brown);
    color: rgba(243, 233, 228, .85);
    padding: 56px 0 0;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr 1fr;
    gap: 36px;
    padding-bottom: 40px;
}
.brand-footer .brand-name { color: #F3E9E4; }
.brand-footer .brand-sub { color: rgba(243, 233, 228, .5); }
.footer-tagline {
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--champagne);
    margin-top: 14px;
    margin-bottom: 0;
}
.footer-title {
    color: #F3E9E4;
    font-size: 13px;
    letter-spacing: .14em;
    text-transform: uppercase;
    margin-bottom: 16px;
}
.footer-link { color: rgba(243, 233, 228, .9); font-weight: 700; font-size: 17px; }
.footer-link:hover { color: var(--champagne); }
.footer-text { color: rgba(243, 233, 228, .6); font-size: 14px; margin-bottom: 8px; }
.footer-social { display: flex; flex-direction: column; gap: 10px; }
.social-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: rgba(243, 233, 228, .85);
    font-weight: 600;
    font-size: 14.5px;
    transition: color .16s ease;
}
.social-link svg { width: 21px; height: 21px; }
.social-link:hover { color: var(--champagne); }
.footer-bottom {
    border-top: 1px solid rgba(243, 233, 228, .14);
    padding: 20px 0;
    text-align: center;
    font-size: 13px;
    color: rgba(243, 233, 228, .45);
}

/* --------------------------------------------------------------------------
   Прочее
   -------------------------------------------------------------------------- */
.site-main { flex: 1; }
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-soft);
}
.empty-state svg {
    width: 54px; height: 54px;
    margin: 0 auto 16px;
    color: var(--dusty);
}
.spinner {
    width: 34px; height: 34px;
    border: 3px solid var(--dusty);
    border-top-color: var(--burgundy);
    border-radius: 50%;
    animation: spin .8s linear infinite;
    margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.text-center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 16px; } .mb-2 { margin-bottom: 16px; }
.mt-3 { margin-top: 28px; } .mb-3 { margin-bottom: 28px; }
.hidden { display: none !important; }

/* --------------------------------------------------------------------------
   Адаптив: ≤1024px
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .features { grid-template-columns: repeat(2, 1fr); }
    .grid-cards { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .hero-inner { grid-template-columns: 1fr; gap: 40px; }
    .hero { padding: 56px 0 64px; }
    .hero-media { order: -1; }
    .hero-media img { width: min(340px, 80%); }
    .app-shell { grid-template-columns: 210px 1fr; }
    .app-content { padding: 26px 22px; }
    .header-phone { display: none; }
}

/* --------------------------------------------------------------------------
   Адаптив: ≤640px — burger-меню
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
    :root { --header-h: 64px; }
    body { font-size: 15.5px; }
    .section { padding: 44px 0; }

    .brand-logo { width: 40px; height: 40px; }
    .brand-name { font-size: 17px; }
    .brand-sub { font-size: 9.5px; }
    .btn-book { display: none; }
    .burger { display: flex; }

    .main-nav {
        position: fixed;
        inset: var(--header-h) 0 0 0;
        z-index: 99;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 24px 20px;
        background: var(--ivory);
        border-top: 1px solid var(--line);
        transform: translateX(100%);
        transition: transform .28s ease;
        overflow-y: auto;
    }
    .main-nav.is-open { transform: none; }
    .main-nav .nav-link {
        font-size: 18px;
        padding: 14px 16px;
        border-radius: var(--radius-sm);
    }
    .main-nav .nav-link.is-active { background: var(--beige); }
    .main-nav .nav-link.is-active::after { display: none; }
    /* Кнопка записи внутри мобильного меню */
    .main-nav .btn-book-mobile {
        display: inline-flex;
        margin-top: 14px;
        justify-content: center;
    }

    .features { grid-template-columns: 1fr; }
    .grid-cards { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 28px; }
    .hero { padding: 40px 0 48px; }
    .hero-sub { font-size: 16px; }
    .hero-actions .btn { width: 100%; }

    .wizard-step-label { display: none; }
    .wizard-step-dot { width: 46px; }

    .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: 250px;
        z-index: 150;
        transform: translateX(-100%);
        transition: transform .26s ease;
        box-shadow: var(--shadow-lift);
    }
    .sidebar.is-open { transform: none; }
    .app-content { padding: 20px 16px; }

    .modal { padding: 12px; align-items: flex-end; }
    .modal-dialog { padding: 24px 20px; border-radius: var(--radius) var(--radius) 0 0; max-width: 100%; }
    .toast-container { right: 12px; bottom: 12px; }

    .table { font-size: 13.5px; }
    .table th, .table td { padding: 11px 12px; }
    .calendar-body { overflow-x: auto; }
    .calendar-col { min-width: 150px; }
}
