:root {
    --primary: #3498db;
    --success: #2ecc71;
    --danger: #e74c3c;
    --bg: #f8f9fa;
    --card-bg: #ffffff;
    --text: #2d3436;
}

body { 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg); color: var(--text); margin: 0; padding: 0;
}

/* Mobile First Layout */
.container { padding: 15px; max-width: 600px; margin: 0 auto; }

header { 
    background: #fff; padding: 20px; border-bottom: 1px solid #ddd;
    display: flex; justify-content: space-between; align-items: center;
}

/* Cards & Lists */
.card {
    background: var(--card-bg); border-radius: 12px; padding: 20px;
    margin-bottom: 15px; box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.btn {
    display: inline-block; padding: 12px 24px; border-radius: 8px;
    border: none; font-size: 16px; font-weight: 600; cursor: pointer;
    text-align: center; text-decoration: none; transition: opacity 0.2s;
}

.btn-primary { background: var(--primary); color: white; width: 100%; }
.btn-secondary { background: #dfe6e9; color: var(--text); }
.btn-danger { background: var(--danger); color: white; }
.btn-sm { padding: 4px 10px; font-size: 12px; width: auto; }

.bookings-table { width: 100%; border-collapse: collapse; }
.bookings-table thead tr { text-align: left; border-bottom: 2px solid #ddd; }
.bookings-table th { padding: 10px 8px; font-weight: 600; }
.bookings-table td { padding: 10px 8px; border-bottom: 1px solid #eee; vertical-align: middle; }
.bookings-table small { color: #888; }

/* Forms */
.form-group { margin-bottom: 20px; }
label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 14px; }
input, textarea, select {
    width: 90%; padding: 14px; border: 1px solid #ccc; border-radius: 8px;
    font-size: 16px; /* Предотвращает зум на iOS */
}

/* Features Grid (Checkboxes) */
.features-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
    background: #f1f2f6; padding: 15px; border-radius: 8px;
}

.feature-item {
    display: flex; align-items: center; font-size: 14px;
}

.feature-item input { width: auto; margin-right: 10px; transform: scale(1.3); }




.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); z-index: 9999; justify-content: center; align-items: center; }
.modal-window { background: #fff; width: 90%; max-width: 500px; border-radius: 12px; padding: 25px; position: relative; box-shadow: 0 5px 15px rgba(0,0,0,0.3); color: #333; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.modal-close { position: absolute; top: 15px; right: 15px; font-size: 24px; cursor: pointer; color: #999; line-height: 1; border: none; background: none; }
.modal-close:hover { color: #333; }
.modal-title { margin-top: 0; margin-bottom: 20px; font-size: 21px; color: #2d3436; padding-right: 30px; }
.modal-row { margin-bottom: 12px; font-size: 15px; }
.modal-label { font-weight: 600; color: #636e72; display: block; margin-bottom: 4px; }
.modal-value { color: #2d3436; }
.status-select { width: 100%; padding: 8px; border: 1px solid #dfe6e9; border-radius: 6px; font-size: 15px; background: #f8f9fa; }
.status-select.data-style {
    background-color: #3396d8;
    color: white;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='white' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}
.status-select:focus { outline: none; border-color: #3498db; }
.modal-footer { margin-top: 20px; text-align: right; }
.btn-save { background: #3498db; color: white; border: none; padding: 10px 20px; border-radius: 6px; cursor: pointer; font-weight: 600; }
.btn-save:hover { background: #2980b9; }

/* --- Гамбургер-меню --- */
.hamburger-btn {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    z-index: 1001;
}

.hamburger-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text);
    transition: all 0.3s ease;
}

.hamburger-btn.active span {
    background-color: #fff;
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}
.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}
.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}

/* --- Главная навигация --- */
nav.admin-nav {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: -320px;
    width: 280px;
    height: 100vh;
    background: #1e2a3a;
    box-shadow: 3px 0 20px rgba(0,0,0,0.35);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

nav.admin-nav.open {
    left: 0;
}

.nav-links {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding-top: 56px;
}

nav.admin-nav .nav-links a {
    padding: 13px 20px;
    text-decoration: none;
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    transition: background 0.18s, color 0.18s;
    font-weight: 500;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

nav.admin-nav .nav-links a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

nav.admin-nav .nav-links a.active {
    background: var(--primary);
    color: #fff;
}

/* --- Нижняя часть навигации: пользователь + выход --- */
.nav-footer {
    flex-shrink: 0;
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: #1e2a3a;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-footer-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.nav-user-info {
    font-size: 12px;
    color: #ffffff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-owner-info {
    font-size: 12px;
    color: #7fb3f5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-logout {
    font-size: 20px;
    line-height: 1;
    text-decoration: none;
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.15s, transform 0.15s;
    display: inline-block;
}

.nav-logout:hover {
    opacity: 1;
    transform: translateX(3px);
}

/* Оверлей для затемнения фона */
.nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s;
}

.nav-overlay.active {
    display: block;
    opacity: 1;
}

@media (max-width: 768px) {
    .hamburger-btn {
        display: flex;
        position: fixed;
        top: 10px;
        left: 10px;
        background: rgba(255, 255, 255, 0.92);
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    }
    .hamburger-btn.active {
        background: #1e2a3a;
    }
    header {
        padding-left: 50px;
    }

    /* На мобиле nav-footer идёт сразу за пунктами меню, а не прилипает к низу экрана */
    nav.admin-nav {
        overflow-y: auto;
    }
    .nav-links {
        flex: 0 0 auto;
        overflow-y: visible;
        padding-bottom: 40px;
    }
    .nav-footer {
        flex-shrink: 0;
        position: static;
    }
}

@media (min-width: 769px) {
    nav.admin-nav {
        position: relative;
        flex-direction: row;
        align-items: stretch;
        width: 100%;
        height: auto;
        left: 0;
        box-shadow: 0 2px 10px rgba(0,0,0,0.25);
    }

    .nav-links {
        flex: 1;
        min-height: unset;
        display: flex;
        flex-direction: row;
        align-items: center;
        overflow: visible;
        padding-top: 0;
    }

    nav.admin-nav .nav-links a {
        border-bottom: none;
        padding: 0 14px;
        height: 50px;
        font-size: 13px;
        white-space: nowrap;
        gap: 6px;
    }

    nav.admin-nav .nav-links a:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    nav.admin-nav .nav-links a.active {
        background: var(--primary);
    }

    .nav-footer {
        border-top: none;
        border-left: 1px solid rgba(255, 255, 255, 0.12);
        background: transparent;
        padding: 0 16px;
        height: 50px;
    }

    .hamburger-btn {
        display: none;
    }

    /* --- Выпадающие пункты меню (десктоп) --- */
    .nav-dropdown {
        position: relative;
        display: flex;
        align-items: stretch;
    }

    .nav-dropdown-toggle {
        padding: 0 14px;
        height: 50px;
        display: flex;
        align-items: center;
        color: #fff;
        font-size: 13px;
        font-weight: 500;
        white-space: nowrap;
        cursor: default;
        gap: 6px;
        transition: background 0.18s;
        user-select: none;
    }

    .nav-dropdown:hover > .nav-dropdown-toggle {
        background: rgba(255, 255, 255, 0.1);
    }

    .nav-dropdown.has-active > .nav-dropdown-toggle {
        background: var(--primary);
    }

    .nav-dropdown-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        background: #1e2a3a;
        min-width: 210px;
        z-index: 200;
        border-radius: 0 0 8px 8px;
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
        flex-direction: column;
    }

    .nav-dropdown:hover > .nav-dropdown-menu {
        display: flex;
    }

    .nav-dropdown-menu a {
        height: auto !important;
        padding: 12px 18px !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.07) !important;
        white-space: nowrap;
        font-size: 13px;
    }

    .nav-dropdown-menu a:last-child {
        border-bottom: none !important;
        border-radius: 0 0 8px 8px;
    }
}

/* --- Выпадающие пункты меню (мобильный вид — всё раскрыто) --- */
@media (max-width: 768px) {
    .nav-dropdown {
        display: flex;
        flex-direction: column;
    }

    .nav-dropdown-toggle {
        padding: 15px 14px;
        color: white;
        font-size: 14px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.6px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.07);
        cursor: default;
        user-select: none;
    }

    .nav-dropdown-menu {
        display: flex;
        flex-direction: column;
        position: static;
        background: rgba(0, 0, 0, 0.12);
        box-shadow: none;
        border-radius: 0;
        min-width: unset;
    }

    .nav-dropdown-menu a {
        padding-left: 36px !important;
    }
}

.fc .fc-toolbar {
    display: block;
}

.fc .fc-list-event-title a {
    color: white;
}
.fc-list-table td {
    color: white;
}

/* --- Toast-уведомления --- */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    padding: 12px 20px;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    max-width: 320px;
    pointer-events: auto;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success { background: var(--success); }
.toast-error   { background: var(--danger); }

/* --- Страница входа (login.php) --- */
body.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-card {
    width: 100%;
    max-width: 400px;
}

/* --- Кнопки фильтра календаря (bookings_calendar.php) --- */
.fc-button {
    padding: 0.4em 0.65em;
    white-space: nowrap;
    text-transform: capitalize;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s, border-color 0.2s;
    border: 1px solid var(--primary);
    background-color: var(--primary);
    color: white;
    border-radius: 4px;
}

.fc-button:hover {
    background-color: #2980b9;
    border-color: #2980b9;
}

.fc-button.fc-button-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.fc-button.fc-state-active {
    background-color: #34495e;
    border-color: var(--fc-button-active-border-color);
    color: var(--fc-button-text-color);
}

.fc-button:not(.fc-state-active):not(.fc-button-primary) {
    background-color: #fff;
    color: var(--text);
}

/* --- Скидки зала --- */
.discount-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f1f2f6;
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: 14px;
}

.discount-item-label { color: var(--text); }
.discount-item-label strong { font-size: 15px; }

.discount-delete-btn {
    background: none;
    border: none;
    color: #b2bec3;
    cursor: pointer;
    font-size: 15px;
    padding: 0 2px;
    line-height: 1;
    transition: color 0.15s;
}

.discount-delete-btn:hover { color: var(--danger); }

.discounts-add-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.discounts-add-row input {
    width: 70px;
    padding: 10px 12px;
    font-size: 14px;
}

.discounts-add-sep {
    font-size: 13px;
    color: #636e72;
    white-space: nowrap;
}

.discounts-add-btn {
    width: auto;
    padding: 10px 18px;
    font-size: 14px;
}

.discounts-empty {
    font-size: 13px;
    color: #b2bec3;
    margin: 4px 0 8px;
}

/* --- Списки email / VK ID в профиле владельца --- */
.notify-list-add-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.notify-list-add-row input {
    flex: 1;
    min-width: 180px;
    padding: 10px 12px;
    font-size: 14px;
}

.notify-list-add-btn {
    width: auto;
    padding: 10px 18px;
    font-size: 14px;
    white-space: nowrap;
}

/* --- Фотографии зала --- */
.photos-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
    min-height: 40px;
}

.photo-item {
    position: relative;
    width: 120px;
    height: 90px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    flex-shrink: 0;
    cursor: grab;
    transition: opacity 0.15s;
}

.photo-item.dragging {
    opacity: 0.4;
    box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}

.photo-item.drag-over {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

.photo-link {
    display: block;
    width: 100%;
    height: 100%;
}

/* --- Уведомление по e-mail в модальном окне --- */
.modal-notify-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 10px 12px;
    background: #f0f7ff;
    border: 1px solid #d0e8ff;
    border-radius: 8px;
}

.notify-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    cursor: pointer;
}

.notify-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.notify-slider {
    position: absolute;
    inset: 0;
    background: #b2bec3;
    border-radius: 24px;
    transition: background 0.2s;
}

.notify-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.notify-toggle input:checked + .notify-slider { background: var(--primary); }
.notify-toggle input:checked + .notify-slider::before { transform: translateX(20px); }

.notify-label {
    font-size: 13px;
    color: var(--text);
    line-height: 1.4;
}

.notify-label strong { color: var(--primary); }

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border: none;
    padding: 0;
}

.photo-delete-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: rgba(231,76,60,0.85);
    color: #fff;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0;
    transition: opacity 0.15s;
}

.photo-item:hover .photo-delete-btn {
    opacity: 1;
}

.photos-empty,
.photos-loading {
    font-size: 13px;
    color: #999;
    align-self: center;
}

.btn-upload-photo {
    display: inline-block;
    width: auto;
    padding: 10px 18px;
    font-size: 14px;
    cursor: pointer;
}


/* --- Список пользователей (users_list.php) --- */
.user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 8px;
    transition: box-shadow 0.15s;
}

.user-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

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

.user-login {
    font-weight: 600;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-owner {
    font-size: 13px;
    color: #888;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.user-actions .btn {
    padding: 6px 12px;
    font-size: 13px;
    white-space: nowrap;
}

.btn-switch {
    background: #8e44ad;
    color: white;
}

/* --- Двухколоночная строка формы: рядом на десктопе, столбцом на мобиле --- */
.form-row-2col {
    display: flex;
    gap: 15px;
}

.form-row-2col > .form-group {
    flex: 1;
    min-width: 0;
}

@media (max-width: 540px) {
    .form-row-2col {
        flex-direction: column;
        gap: 0;
    }
}

/* --- Ссылка «Сменить пароль» в нижней части навигации --- */
.nav-change-pass {
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.25);
    transition: color 0.15s, border-color 0.15s;
}

.nav-change-pass:hover {
    color: rgba(255, 255, 255, 0.75);
    border-bottom-color: rgba(255, 255, 255, 0.5);
}

/* --- Индикатор сложности пароля (password_change.php) --- */
.pw-strength-wrap {
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.pw-strength-bar {
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition: width 0.25s ease, background 0.25s ease;
}

.pw-strength-bar.pw-s1 { background: #e74c3c; }
.pw-strength-bar.pw-s2 { background: #e67e22; }
.pw-strength-bar.pw-s3 { background: #f1c40f; }
.pw-strength-bar.pw-s4 { background: #2ecc71; }

.pw-strength-msg {
    font-size: 12px;
    margin-top: 5px;
    min-height: 16px;
}

.pw-strength-msg.pw-msg-warn { color: #e67e22; }
.pw-strength-msg.pw-msg-ok   { color: #27ae60; }

/* --- Кнопка и превью поля «Правила аренды» --- */
.ck-open-btn {
    width: auto;
    padding: 10px 20px;
    font-size: 14px;
}

.ck-preview {
    margin-top: 8px;
    font-size: 13px;
    color: #636e72;
    min-height: 16px;
    font-style: italic;
}

/* --- Полноэкранное модальное окно CKEditor --- */
.ck-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    align-items: stretch;
}

.ck-modal-overlay.ck-modal-open {
    display: flex;
}

body.ck-modal-active {
    overflow: hidden;
}

.ck-modal {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    background: #fff;
}

.ck-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #dde1e7;
    background: #1e2a3a;
    flex-shrink: 0;
}

.ck-modal-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.ck-modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.15s;
}

.ck-modal-close:hover {
    color: #fff;
}

.ck-modal-body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.ck-modal-footer {
    flex-shrink: 0;
    padding: 12px 20px;
    border-top: 1px solid #dde1e7;
    background: #f8f9fa;
    display: flex;
    justify-content: flex-end;
}

/* --- Список залов (halls_global_list.php) --- */
.studio-block { margin-bottom: 25px; }

.studio-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.studio-title {
    font-size: 18px;
    font-weight: bold;
    color: var(--primary);
}

.studio-alias-hint {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
}

.studio-alias-hint a {
    color: var(--primary);
    font-family: monospace;
    text-decoration: none;
}

.studio-alias-hint a:hover {
    text-decoration: underline;
}

.sort-hint {
    background: #eaf4fb;
    border-left: 3px solid var(--primary);
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    color: #555;
    margin-bottom: 18px;
}

.hall-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 8px;
    cursor: default;
    transition: box-shadow 0.15s, opacity 0.15s;
    user-select: none;
}

.hall-item.dragging {
    opacity: 0.5;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.hall-item.drag-over {
    border-color: var(--primary);
    background: #f0f7ff;
}

.drag-handle {
    cursor: grab;
    color: #bbb;
    font-size: 18px;
    flex-shrink: 0;
    padding: 2px 4px;
    line-height: 1;
}

.drag-handle:active { cursor: grabbing; }

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

.hall-name {
    font-weight: 600;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hall-address {
    font-size: 13px;
    color: #888;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hall-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.hall-actions .btn {
    padding: 6px 12px;
    font-size: 13px;
    white-space: nowrap;
}

.no-halls {
    color: #999;
    font-style: italic;
    padding: 8px 0;
}

.add-hall-btn { margin-top: 10px; }

/* --- Индикатор загрузки данных --- */
.loading {
    color: #999;
    font-style: italic;
    padding: 12px 0;
}

/* --- Письмо разработчикам --- */
.dev-feedback-intro {
    font-size: 14px;
    color: #636e72;
    background: #f0f7ff;
    border: 1px solid #d0e8ff;
    border-radius: 8px;
    padding: 14px 16px;
    margin: 0 0 24px;
    line-height: 1.6;
}

/* ── Подвал admin-панели ─────────────────────────────────────── */
.admin-footer {
    border-top: 1px solid #ddd;
    padding: 24px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #101b28;
    margin-top: 20px;
}

.admin-footer-logo img {
    height: 28px;
    width: auto;
    display: block;
    opacity: 0.65;
}

.admin-footer-text {
    font-size: 12px;
    color: #999;
    letter-spacing: 0.04em;
}

.admin-brand {
    font-weight: 800;
    letter-spacing: 2px;
    color: #636e72;
}

.admin-brand-num {
    color: #C9A84C;
}

@media (max-width: 520px) {
    .admin-footer {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        padding: 20px 15px;
    }
}

/* ── Календарь: корректировка стилей событий ────────────────────── */
.fc-daygrid-event .fc-event-title { font-weight: normal; }

/* ── Цвет зала в календаре: color picker ────────────────────────── */
.hall-color-wrap {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.hall-color-pickers {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
    min-width: 260px;
}

.hall-color-picker-block {
    flex: 1;
}

.hall-color-picker-label {
    font-size: 13px;
    font-weight: 600;
    color: #636e72;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hall-color-selected-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.hall-color-chip {
    width: 21px;
    height: 21px;
    border-radius: 6px;
    border: 1px solid rgba(0,0,0,0.15);
    flex-shrink: 0;
}

.hall-color-hex {
    font-size: 13px;
    font-family: monospace;
    color: #636e72;
}

.hall-color-reset-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #b2bec3;
    font-size: 14px;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 4px;
    transition: color 0.15s;
}
.hall-color-reset-btn:hover { color: #e74c3c; }

.hall-color-palette {
    display: grid;
    grid-template-columns: repeat(13, 22px);
    gap: 3px;
    max-height: 230px;
    overflow-y: auto;
    overflow-x: auto;
    padding: 4px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    width: fit-content;
}

.hcp-swatch {
    width: 22px;
    height: 22px;
    border-radius: 3px;
    cursor: pointer;
    border: 2px solid transparent;
    box-sizing: border-box;
    transition: transform 0.1s, border-color 0.1s;
    flex-shrink: 0;
}
.hcp-swatch:hover {
    transform: scale(1.25);
    z-index: 1;
    border-color: rgba(0,0,0,0.3);
}
.hcp-swatch.hcps-selected {
    border-color: #2d3436;
    transform: scale(1.15);
    box-shadow: 0 0 0 1px #fff inset;
}

/* Preview */
.hall-color-preview-wrap {
    min-width: 200px;
    max-width: 280px;
    flex-shrink: 0;
}

.hall-calendar-preview {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 6px;
}

.hall-fc-event {
    border-radius: 4px;
    border-left: 3px solid #3498db;
    background: #3498db;
    overflow: hidden;
    cursor: pointer;
    min-height: 52px;
}

.hall-fc-event-main {
    padding: 3px 6px 4px;
    color: #fff;
}

.hall-fc-event-time {
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    line-height: 1.4;
}

.hall-fc-event-title {
    font-size: 12px;
    line-height: 1.4;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.hall-color-preview-hint {
    font-size: 11px;
    color: #b2bec3;
    text-align: center;
}

@media (max-width: 600px) {
    .hall-color-wrap { flex-direction: column; }
    .hall-color-preview-wrap { max-width: 100%; width: 100%; }
}

/* --- Мастер подключения к VK (vk_master.php) --- */
.vk-master-wrap { max-width: 90%; margin: 0 auto; padding: 0 15px; }

.vk-master-section { display: none; }
.vk-master-section.active { display: block; }

.vk-intro-card { text-align: center; padding: 36px 28px; }

.vk-intro-logo {
    font-size: 52px;
    margin-bottom: 12px;
    line-height: 1;
}

.vk-intro-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 18px;
    color: var(--text);
}

.vk-intro-desc {
    font-size: 15px;
    color: #636e72;
    line-height: 1.7;
    margin: 0 0 14px;
}

.vk-intro-desc a { color: var(--primary); word-break: break-all; }

.vk-intro-nav { justify-content: flex-end; }

.vk-step-layout {
    display: flex;
    gap: 28px;
    align-items: flex-start;
}

.vk-step-image {
    flex: 0 0 65%;
    max-width: 65%;
}

.vk-step-image img {
    width: auto;
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.12);
    display: block;
}

.vk-step-content { flex: 1; min-width: 0; }

.vk-step-badge {
    display: inline-block;
    background: #eaf4fb;
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.vk-step-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 14px;
}

.vk-step-body { font-size: 14px; line-height: 1.75; color: var(--text); }
.vk-step-body p { margin: 0 0 10px; }
.vk-step-body ol { padding-left: 20px; margin: 8px 0 12px; }
.vk-step-body ol li { margin-bottom: 6px; }
.vk-step-body a { color: var(--primary); word-break: break-all; }
.vk-step-body code {
    display: inline-block;
    background: #f1f2f6;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 12px;
    word-break: break-all;
    margin: 4px 0;
}
.vk-studio-url-label { margin: 10px 0 2px !important; color: var(--text-muted, #666); font-size: 13px; }
.vk-copy-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 2px 0 6px; }
.vk-copy-wrap code { margin: 0; }
.vk-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    font-size: 12px;
    color: var(--primary, #4a90e2);
    background: transparent;
    border: 1px solid var(--primary, #4a90e2);
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
    line-height: 1.6;
}
.vk-copy-btn:hover { background: var(--primary, #4a90e2); color: #fff; }
.vk-copy-btn--done { background: #27ae60; border-color: #27ae60; color: #fff; }

.vk-step-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #eef0f2;
}

.vk-step-nav .btn { width: auto; min-width: 120px; }

.vk-step-indicator {
    font-size: 13px;
    color: #aaa;
    white-space: nowrap;
}

.vk-id-field { margin-top: 16px; }
.vk-id-field label { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.vk-id-field input {
    width: 200px;
    padding: 10px 14px;
    border: 2px solid var(--primary);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.05em;
}

@media (max-width: 640px) {
    .vk-step-layout { flex-direction: column; }
    .vk-step-image { flex: none; max-width: 100%; width: 100%; }
    .vk-step-nav .btn { min-width: 90px; font-size: 14px; padding: 10px 14px; }
}

/* --- VK master шаг 9: определение VK ID по URL страницы --- */
.vk9-resolve-section { border-top: 1px dashed var(--border); padding-top: 14px; margin-top: 16px; }
.vk9-resolve-section label { font-weight: 600; display: block; margin-bottom: 4px; }
.vk9-resolve-hint { font-size: 12px; color: #888; margin-bottom: 8px; }
.vk9-resolve-wrap { display: flex; gap: 10px; align-items: flex-start; }
.vk9-resolve-wrap textarea {
    flex: 1;
    min-height: 80px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #f1f2f6;
    font-size: 13px;
    resize: vertical;
    font-family: monospace;
    line-height: 1.5;
}
.vk9-resolve-wrap textarea:focus { outline: none; border-color: var(--primary); }
.vk9-resolve-result { margin-top: 8px; font-size: 13px; }
.vk9-resolve-result-ok {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    background: #eafaf1;
    border: 1px solid #a9dfbf;
    border-radius: 6px;
    color: #1e8449;
    margin-bottom: 4px;
}
.vk9-resolve-result-err {
    padding: 7px 12px;
    background: #fdf2f2;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    color: #c0392b;
    margin-bottom: 4px;
}
.vk9-resolve-result-info {
    padding: 7px 12px;
    background: #fef9e7;
    border: 1px solid #f8d7a5;
    border-radius: 6px;
    color: #8d6218;
    margin-bottom: 4px;
}

/* --- Кнопка печати (bookings_calendar.php) --- */
.btn-print {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    background: #f0f3f4;
    border: 1px solid #d5dbdb;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.btn-print:hover { background: #e2e8ea; border-color: #bdc3c7; }

/* --- Печать: только календарь --- */
@media print {
    body * { visibility: hidden; }
    
    #calendar, #calendar * { visibility: visible; }
    #calendar {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
    }
    
    #calendar .fc-toolbar-chunk,
    #calendar .fc-toolbar-chunk *,
    #calendar .fc-button-group,
    #calendar .fc-button-group * { visibility: hidden; }

    #calendar .fc-toolbar-chunk .fc-toolbar-title { visibility: visible; }
    
    .btn-print { display: none; }
}

/* --- Google Calendar (google_calendar.php) --- */
.gcal-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 16px;
}
.gcal-status--connected {
    background: #eafaf1;
    border: 1px solid #a9dfbf;
    color: #1e8449;
    flex-wrap: wrap;
}
.gcal-status--disconnected {
    background: #fdfefe;
    border: 1px solid #d5d8dc;
    color: #7f8c8d;
}
.gcal-status-icon { font-size: 18px; }
.gcal-calendar-id { font-size: 12px; font-weight: 400; color: #555; width: 100%; margin-top: 4px; }
.gcal-hint { color: #636e72; font-size: 14px; margin-bottom: 20px; line-height: 1.5; }

.alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 18px;
    font-size: 14px;
}
.alert-success { background: #eafaf1; border: 1px solid #a9dfbf; color: #1e8449; }
.alert-error   { background: #fdedec; border: 1px solid #f1948a; color: #a93226; }