/* ============================================================
   Панель косметолога — дизайн в стиле Aviasales
   Светлая/тёмная темы + интеграция с Telegram themeParams
   ============================================================ */

:root {
    --bg: #f4f5f7;
    --card: #ffffff;
    --text: #1f2124;
    --muted: #8a8d94;
    --border: #ebedf0;

    --accent: #ff5c00;
    --accent-dark: #e85400;
    --accent-soft: #ffede0;

    --blue: #2e7cf6;
    --blue-soft: #e8f1ff;
    --green: #2fb460;
    --green-soft: #e6f7ed;
    --red: #ff4d4f;
    --red-soft: #ffecec;
    --yellow: #ffa800;
    --yellow-soft: #fff3dc;
    --purple: #8b5cf6;
    --purple-soft: #f0eaff;

    --radius: 16px;
    --radius-sm: 12px;
    --shadow-sm: 0 1px 2px rgba(18, 24, 34, 0.05);
    --shadow-md: 0 4px 16px rgba(18, 24, 34, 0.07);

    --nav-h: 64px;
}

:root[data-theme="dark"] {
    --bg: #0e1013;
    --card: #191c21;
    --text: #f1f3f5;
    --muted: #969ca6;
    --border: #272c33;

    --accent: #ff7a2f;
    --accent-dark: #ff8f4f;
    --accent-soft: #3a2416;

    --blue-soft: #16273f;
    --green-soft: #14321f;
    --red-soft: #3a1d1e;
    --yellow-soft: #3a2f14;
    --purple-soft: #2a2140;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html { height: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI',
        Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.45;
    min-height: 100%;
    padding-bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom));
}

.shell { max-width: 720px; margin: 0 auto; }

/* ===== Экран входа ===== */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--card);
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    padding: 32px 26px;
    text-align: center;
}

.login-logo {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    border-radius: 22px;
    background: var(--accent-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
}

.login-title { font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.login-sub { font-size: 14px; color: var(--muted); margin-bottom: 22px; line-height: 1.5; }

.login-card .form-group { text-align: left; }
.code-input {
    text-align: center;
    font-size: 24px;
    letter-spacing: 10px;
    font-weight: 800;
}

.login-error {
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--red-soft);
    color: var(--red);
    font-size: 13.5px;
    font-weight: 600;
}

/* ===== Навигация (мобайл: снизу) ===== */
#nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    display: flex;
    background: var(--card);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
    height: calc(var(--nav-h) + env(safe-area-inset-bottom));
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 600;
    font-family: inherit;
    transition: color 0.15s;
}

.nav-item svg { width: 23px; height: 23px; }

.nav-item.active { color: var(--accent); }

/* ===== Шапка ===== */
#header { padding: 18px 16px 10px; }

#page-title { font-size: 26px; font-weight: 800; letter-spacing: -0.4px; }

#header-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

#content { padding: 0 16px 24px; }

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.2s ease; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
}
/* ===== Карточки ===== */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 16px;
    margin-bottom: 12px;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.card-title { font-size: 15px; font-weight: 700; }
.card-sub { font-size: 12.5px; color: var(--muted); }

/* ===== Hero-баннер на дашборде ===== */
.hero {
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 12px;
    color: #fff;
    background: linear-gradient(118deg, #ff9d4d 0%, #ff6a00 55%, #ff4f1f 100%);
    box-shadow: 0 8px 24px rgba(255, 92, 0, 0.28);
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: "";
    position: absolute;
    right: -40px;
    top: -60px;
    width: 190px;
    height: 190px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
}

.hero::before {
    content: "";
    position: absolute;
    right: 30px;
    bottom: -70px;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.hero-date {
    font-size: 12.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    opacity: 0.85;
}

.hero-title { font-size: 22px; font-weight: 800; margin-top: 6px; letter-spacing: -0.3px; }
.hero-sub { margin-top: 4px; font-size: 14px; opacity: 0.92; }

/* ===== Статистика ===== */
.stats-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

.stat-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
}

.stat-value { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; line-height: 1; }
.stat-label { font-size: 12px; color: var(--muted); }

/* ===== График записей ===== */
.chart {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 96px;
    padding-top: 18px;
}

.chart-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    position: relative;
}

.chart-count {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 4px;
}

.chart-bar {
    width: 100%;
    max-width: 34px;
    border-radius: 8px 8px 4px 4px;
    background: var(--accent-soft);
    min-height: 6px;
    transition: height 0.3s ease;
}

.chart-col.today .chart-bar { background: linear-gradient(180deg, #ff8a3d, #ff5c00); }
.chart-col.today .chart-count { color: var(--accent); }
.chart-day { font-size: 11px; color: var(--muted); margin-top: 6px; font-weight: 600; }
.chart-col.today .chart-day { color: var(--text); }
/* ===== Заголовки дней ===== */
.day-head { display: flex; align-items: baseline; gap: 8px; margin: 18px 4px 8px; }
.day-head:first-child { margin-top: 0; }
.day-title { font-size: 16px; font-weight: 800; }
.day-sub { font-size: 12.5px; color: var(--muted); }

/* ===== Записи ===== */
.appt {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
}

.appt:last-child { border-bottom: none; padding-bottom: 2px; }
.appt-time { min-width: 52px; text-align: center; flex-shrink: 0; }
.appt-start { font-size: 15px; font-weight: 800; letter-spacing: -0.2px; }
.appt-end { font-size: 12px; color: var(--muted); }
.appt-info { flex: 1; min-width: 0; }

.appt-client {
    font-weight: 700;
    font-size: 14.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.appt-services {
    font-size: 12.5px;
    color: var(--muted);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.appt-price { font-size: 13px; font-weight: 700; color: var(--accent); white-space: nowrap; flex-shrink: 0; }

/* ===== Интервалы ===== */
.slot {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.slot:last-child { border-bottom: none; }

.slot-time {
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 10px;
    padding: 7px 11px;
    font-weight: 800;
    font-size: 13.5px;
    white-space: nowrap;
}

.slot-meta { flex: 1; min-width: 0; font-size: 12.5px; color: var(--muted); }
.slot-actions { display: flex; gap: 6px; }

/* ===== Клиенты ===== */
.client {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    width: 100%;
    background: none;
    border-left: none;
    border-right: none;
    border-top: none;
    text-align: left;
    font-family: inherit;
    color: inherit;
}

.client:last-child { border-bottom: none; }
.client:active { opacity: 0.7; }

.avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    color: #fff;
    flex-shrink: 0;
}

.av-0 { background: linear-gradient(135deg, #ff9d4d, #ff5c00); }
.av-1 { background: linear-gradient(135deg, #5ba0ff, #2e7cf6); }
.av-2 { background: linear-gradient(135deg, #4fd08a, #2fb460); }
.av-3 { background: linear-gradient(135deg, #b18cff, #8b5cf6); }
.av-4 { background: linear-gradient(135deg, #ff8a80, #ff4d4f); }
.av-5 { background: linear-gradient(135deg, #ffc554, #ffa800); }

.client-info { flex: 1; min-width: 0; }

.client-name {
    font-weight: 700;
    font-size: 14.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.client-phone { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
/* ===== Бейджи ===== */
.badge {
    display: inline-block;
    border-radius: 8px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-yellow { background: var(--yellow-soft); color: #c77f00; }
.badge-blue { background: var(--blue-soft); color: var(--blue); }

/* ===== Кнопки ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    border-radius: var(--radius-sm);
    padding: 13px 18px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.1s, background 0.15s;
}

.btn:active { transform: scale(0.97); }
.btn svg { width: 18px; height: 18px; }

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 12px rgba(255, 92, 0, 0.25);
}

.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { background: var(--bg); color: var(--text); }
.btn-block { width: 100%; }

.icon-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: var(--bg);
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.1s, background 0.15s;
}

.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:active { transform: scale(0.92); }
.icon-btn.danger { background: var(--red-soft); color: var(--red); }

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--accent);
    font-weight: 700;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    padding: 8px 0;
    margin-bottom: 6px;
}

.back-btn svg { width: 18px; height: 18px; }

/* ===== Формы ===== */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }

.input {
    width: 100%;
    padding: 13px 14px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s, background 0.15s;
}

.input:focus { border-color: var(--accent); background: var(--card); }
/* ===== Меню «Ещё» ===== */
.menu-list {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 4px 16px;
    margin-bottom: 12px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 13px 0;
    background: none;
    border: none;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    font-family: inherit;
    color: var(--text);
    text-align: left;
}

.menu-item:last-child { border-bottom: none; }
.menu-item:active { opacity: 0.7; }

.menu-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.mi-orange { background: var(--accent-soft); }
.mi-blue { background: var(--blue-soft); }
.mi-green { background: var(--green-soft); }
.mi-purple { background: var(--purple-soft); }
.mi-red { background: var(--red-soft); }

.menu-label { flex: 1; font-weight: 700; font-size: 14.5px; }
.menu-item-danger .menu-label { color: var(--red); }
.menu-chev { width: 18px; height: 18px; color: var(--muted); }

/* ===== Заказы / Абонементы / Услуги ===== */
.order { padding: 12px 0; border-bottom: 1px solid var(--border); }
.order:last-child { border-bottom: none; }

.order-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.order-client { font-weight: 700; font-size: 14.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.order-text { font-size: 13px; color: var(--muted); margin-top: 3px; }

.sub { padding: 12px 0; border-bottom: 1px solid var(--border); }
.sub:last-child { border-bottom: none; }
.sub-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.sub-name { font-weight: 700; font-size: 14.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sub-meta { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }

.progress { height: 6px; border-radius: 3px; background: var(--bg); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, #ffa04d, #ff5c00); }

.svc {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
}

.svc:last-child { border-bottom: none; }
.svc-info { flex: 1; min-width: 0; }
.svc-name { font-weight: 700; font-size: 14.5px; }
.svc-dur { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.svc-price { font-weight: 800; font-size: 14px; white-space: nowrap; flex-shrink: 0; }
/* ===== Модалка (bottom-sheet) ===== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
}

.modal.open { display: block; }

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 18, 24, 0.45);
    animation: fadeIn 0.2s ease;
}

.modal-sheet {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card);
    border-radius: 20px 20px 0 0;
    padding: 12px 20px calc(20px + env(safe-area-inset-bottom));
    animation: slideUp 0.25s cubic-bezier(0.2, 0.8, 0.3, 1);
    max-height: 85vh;
    overflow-y: auto;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: none; }
}

.modal-grip {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    margin: 0 auto 14px;
}

#modal-title { font-size: 18px; font-weight: 800; margin-bottom: 16px; }

.modal-actions { display: flex; gap: 10px; margin-top: 6px; }
.modal-actions .btn { flex: 1; }

/* ===== Тост ===== */
.toast {
    position: fixed;
    bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px);
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #22262c;
    color: #fff;
    padding: 11px 18px;
    border-radius: 14px;
    font-size: 13.5px;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 200;
    max-width: calc(100vw - 32px);
    text-align: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--red); }

/* ===== Скелетоны загрузки ===== */
.skeleton {
    background: linear-gradient(90deg, var(--border) 25%, var(--bg) 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.2s infinite;
    border-radius: var(--radius);
    margin-bottom: 12px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== Пустые состояния ===== */
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty-icon { font-size: 40px; margin-bottom: 8px; }
.empty-text { font-size: 14.5px; font-weight: 600; }

.hidden { display: none !important; }

/* ===== Десктоп (≥768px) ===== */
@media (min-width: 768px) {
    body { padding-bottom: 24px; }

    #nav {
        position: sticky;
        top: 0;
        bottom: auto;
        border-top: none;
        border-bottom: 1px solid var(--border);
        padding: 8px 16px;
        height: auto;
        gap: 4px;
    }

    .nav-item {
        flex: 0 0 auto;
        flex-direction: row;
        gap: 7px;
        font-size: 14px;
        padding: 9px 16px;
        border-radius: 12px;
    }

    .nav-item.active { background: var(--accent-soft); }
    .nav-item svg { width: 20px; height: 20px; }

    .stats-row { grid-template-columns: repeat(4, 1fr); }

    .modal-sheet {
        left: 50%;
        right: auto;
        bottom: auto;
        top: 12vh;
        transform: translateX(-50%);
        width: 420px;
        border-radius: 20px;
        animation: popIn 0.2s cubic-bezier(0.2, 0.8, 0.3, 1);
    }

    .modal-grip { display: none; }

    @keyframes popIn {
        from { opacity: 0; transform: translateX(-50%) scale(0.96); }
        to { opacity: 1; transform: translateX(-50%) scale(1); }
    }
}

/* ===== Дополнения: кликабельные карточки, действия, заказы, услуги ===== */

/* Кликабельные карточки дашборда */
.stat-card.clickable, .card.clickable {
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.stat-card.clickable:active, .card.clickable:active {
    transform: scale(0.985);
}

/* Сводка заказов на дашборде */
.orders-stats {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}
.orders-stat { flex: 1; text-align: center; }
.orders-stat-value { font-size: 22px; font-weight: 800; line-height: 1.2; }
.orders-stat-label { font-size: 12px; color: var(--muted); margin-top: 2px; }
.orders-revenue {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--muted);
}
.orders-revenue b { color: var(--text); font-size: 14px; }

/* Кнопки в строках (заказы/абонементы) */
.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 10px;
    font-weight: 700;
}
.btn-success {
    background: var(--green-soft);
    color: var(--green);
}
.btn-danger {
    background: var(--red) !important;
    color: #fff !important;
}
.btn-danger-text { color: var(--red); }
.badge-muted { background: var(--bg); color: var(--muted); }

/* Заказы: номер и доп. информация */
.order-num {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--muted);
}
.order-extra {
    margin-top: 4px;
    font-size: 13px;
    color: var(--text);
    background: var(--green-soft);
    border-radius: 8px;
    padding: 5px 8px;
    display: inline-block;
}

/* Абонементы: дата оформления */
.sub-meta + .sub-meta { margin-top: 1px; }

/* История посещений в модалке */
.visits-list { max-height: 40vh; overflow-y: auto; }
.visit-row {
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
}
.visit-row:last-child { border-bottom: none; }
.visit-date { font-weight: 700; font-size: 14px; }
.visit-notes { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* Услуги: кнопка добавления, подсказка, DnD */
.hint-line {
    font-size: 12.5px;
    color: var(--muted);
    margin: -4px 4px 10px;
    text-align: center;
}
.svc.draggable {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: grab;
}
.svc.draggable:active { cursor: grabbing; }
.svc-drag {
    color: var(--muted);
    font-size: 15px;
    line-height: 1;
    flex-shrink: 0;
    user-select: none;
}
.svc.dragging {
    opacity: 0.45;
    background: var(--accent-soft);
    border-radius: var(--radius-sm);
}
.svc-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* Модалка записи: выбор услуг чекбоксами */
.svc-checks {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
}
.svc-check {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
}
.svc-check input[type="checkbox"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 6px;
    flex-shrink: 0;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    background: var(--bg);
}

.svc-check input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent);
}

.svc-check input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
}

.svc-check input[type="checkbox"]:hover {
    border-color: var(--accent);
}
.svc-check-name { font-weight: 600; flex: 1; min-width: 0; }
.svc-check-meta { font-size: 12px; color: var(--muted); white-space: nowrap; flex-shrink: 0; }

.field-hint { font-size: 12px; color: var(--muted); margin-top: 5px; }

.booking-summary {
    margin-top: 4px;
    padding: 10px 12px;
    background: var(--accent-soft);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    text-align: center;
}
.booking-summary:empty { display: none; }

/* Комментарий в строке записи */
.appt-comment {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Select — нативный вид с фоном как у инпутов */
select.input {
    appearance: auto;
    -webkit-appearance: menulist;
    cursor: pointer;
}

textarea.input { resize: vertical; min-height: 44px; }

/* В тёмной теме: светлый фон инпутов — тёмные иконки видны */
:root[data-theme="dark"] .input {
    background: #dfe1e6;
    color: #1f2124;
    border-color: #c4c7cc;
}

:root[data-theme="dark"] .input::placeholder {
    color: #6b6f76;
}

:root[data-theme="dark"] .input:focus {
    border-color: var(--accent);
    background: #eaecf0;
}

/* Нативные иконки date/time остаются тёмными на светлом фоне */
:root[data-theme="dark"] input[type="date"],
:root[data-theme="dark"] input[type="time"] {
    color-scheme: light;
}

/* Убираем спиннеры у number инпутов */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
}

/* ===== Кастомный Select ===== */
.cs-wrap {
    position: relative;
}

.cs-trigger {
    width: 100%;
    padding: 13px 40px 13px 14px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.cs-trigger:disabled {
    opacity: 0.5;
    cursor: default;
}

.cs-trigger:focus {
    border-color: var(--accent);
    background: var(--card);
}

.cs-trigger::after {
    content: '';
    position: absolute;
    right: 14px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: translateY(-65%) rotate(45deg);
    transition: transform 0.2s;
    pointer-events: none;
}

.cs-wrap.open .cs-trigger::after {
    transform: translateY(-30%) rotate(-135deg);
}

.cs-dropdown {
    display: none;
    position: fixed;
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    max-height: 240px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.cs-wrap.open .cs-dropdown,
.cs-dropdown.cs-open {
    display: block;
}

.cs-option {
    padding: 12px 14px;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.1s;
    color: var(--text);
}

.cs-option:hover,
.cs-option:active {
    background: var(--accent-soft);
}

.cs-option.selected {
    color: var(--accent);
    font-weight: 700;
}

.cs-option:first-child {
    border-radius: 10px 10px 0 0;
}

.cs-option:last-child {
    border-radius: 0 0 10px 10px;
}

.cs-option:only-child {
    border-radius: 10px;
}

/* Тёмная тема для кастомного select */
:root[data-theme="dark"] .cs-trigger {
    background: #dfe1e6;
    color: #1f2124;
    border-color: #c4c7cc;
}

:root[data-theme="dark"] .cs-trigger:focus {
    border-color: var(--accent);
    background: #eaecf0;
}

/* ===== Мобильные адаптации (≤480px) ===== */
@media (max-width: 480px) {
    #header { padding: 14px 12px 8px; }
    #page-title { font-size: 22px; }
    #content { padding: 0 12px 24px; }

    .hero { padding: 16px; border-radius: 16px; }
    .hero-title { font-size: 19px; }
    .hero-sub { font-size: 13px; }
    .hero::after { width: 140px; height: 140px; right: -30px; top: -40px; }
    .hero::before { width: 100px; height: 100px; right: 20px; bottom: -50px; }

    .card { padding: 14px 12px; }

    .stats-row { gap: 8px; }
    .stat-card { padding: 12px 10px; gap: 6px; }
    .stat-icon { width: 30px; height: 30px; font-size: 15px; border-radius: 9px; }
    .stat-value { font-size: 20px; }
    .stat-label { font-size: 11px; }

    .chart { gap: 4px; }
    .chart-count { font-size: 10px; }
    .chart-bar { max-width: 28px; }
    .chart-day { font-size: 10px; }

    .orders-stats { gap: 10px; }
    .orders-stat-value { font-size: 19px; }

    .day-head { margin: 14px 2px 6px; }
    .day-title { font-size: 15px; }

    .appt { gap: 10px; }
    .appt-time { min-width: 46px; }
    .appt-start { font-size: 14px; }
    .appt-client { font-size: 14px; }

    .slot { gap: 8px; }
    .slot-time { padding: 6px 9px; font-size: 12.5px; border-radius: 8px; }
    .slot-actions { gap: 4px; }

    .client { gap: 10px; }
    .avatar { width: 38px; height: 38px; font-size: 14px; }
    .client-name { font-size: 14px; }

    .svc.draggable { gap: 6px; }
    .svc-drag { font-size: 13px; }
    .svc-name { font-size: 13.5px; }
    .svc-price { font-size: 13px; }
    .svc-actions { gap: 4px; }
    .svc-actions .icon-btn { width: 32px; height: 32px; }
    .svc-actions .icon-btn svg { width: 16px; height: 16px; }

    .svc-check { padding: 7px 8px; gap: 6px; font-size: 13px; }
    .svc-check-meta { white-space: normal; text-align: right; }

    .row-actions { gap: 6px; }
    .btn-sm { padding: 5px 10px; font-size: 12px; }

    .icon-btn { width: 34px; height: 34px; }
    .icon-btn svg { width: 16px; height: 16px; }

    .modal-sheet { padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
    #modal-title { font-size: 17px; margin-bottom: 14px; }

    .menu-list { padding: 4px 12px; }
    .menu-icon { width: 34px; height: 34px; font-size: 16px; }
    .menu-label { font-size: 14px; }

    /* Инпуты и селекты */
    .input { padding: 11px 12px; font-size: 16px; border-radius: 10px; }
    select.input { 
        font-size: 16px;
        padding: 11px 32px 11px 12px;
        background-color: var(--bg);
    }
    :root[data-theme="dark"] select.input {
        background-color: #dfe1e6;
    }
    textarea.input { min-height: 40px; }

    /* Кастомный select на мобильных */
    .cs-trigger { padding: 11px 36px 11px 12px; font-size: 16px; border-radius: 10px; }
    .cs-option { padding: 10px 12px; font-size: 14px; }
    .cs-dropdown { max-height: 200px; }

    .form-group { margin-bottom: 12px; }
    .form-group label { font-size: 12px; margin-bottom: 5px; }

    .login-card { padding: 28px 20px; }
    .login-title { font-size: 20px; }
    .code-input { font-size: 22px; letter-spacing: 8px; }
}