/* ── Шапка страницы ─────────────────── */

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

.page-header__title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* ── Сетка залов ────────────────────── */

.rooms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.rooms-empty {
    grid-column: 1 / -1;
    padding: 48px 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 15px;
}

/* ── Карточка зала ──────────────────── */

.room-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.15s;
    position: relative;
}

.room-card:hover {
    box-shadow: var(--shadow-md);
}

.room-card--inactive {
    opacity: 0.55;
}

.room-card__top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.room-card__dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
}

.room-card__info {
    flex: 1;
    min-width: 0;
}

.room-card__name {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 2px;
}

.room-card__badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    background: #f5f5f4;
    border-radius: 4px;
    padding: 2px 6px;
    margin-left: auto;
    flex-shrink: 0;
}

.room-card__desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.room-card__price {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-top: auto;
}

.room-card__price span {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-secondary);
}

.room-card__actions {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.room-card__actions .btn {
    flex: 1;
    font-size: 13px;
}

.btn--danger {
    background: rgba(220, 38, 38, 0.07);
    border-color: rgba(220, 38, 38, 0.2);
    color: var(--accent);
}

.btn--danger:hover {
    background: rgba(220, 38, 38, 0.13);
    border-color: rgba(220, 38, 38, 0.35);
}

.btn--restore {
    background: rgba(22, 163, 74, 0.07);
    border-color: rgba(22, 163, 74, 0.2);
    color: #15803d;
}

.btn--restore:hover {
    background: rgba(22, 163, 74, 0.13);
    border-color: rgba(22, 163, 74, 0.35);
}

/* ── Модал ──────────────────────────── */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
    backdrop-filter: blur(2px);
}

.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 480px;
    max-height: 90dvh;
    overflow-y: auto;
}

.modal--sm {
    max-width: 360px;
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
}

.modal__title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.modal__form {
    padding: 20px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal__text {
    padding: 12px 24px 0;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.modal__actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding-top: 4px;
}

.modal--sm .modal__actions {
    padding: 16px 24px 24px;
}

.modal__error {
    font-size: 13px;
    color: var(--accent);
    background: rgba(220, 38, 38, 0.07);
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: var(--radius);
    padding: 8px 12px;
}

/* ── Поля формы ─────────────────────── */

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.field__label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.req {
    color: var(--accent);
}

.field__input {
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 9px 12px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 100%;
}

.field__input:focus {
    border-color: #a8a29e;
    box-shadow: 0 0 0 3px rgba(168, 162, 158, 0.15);
}

.field__input.is-invalid {
    border-color: var(--accent);
}

.field__textarea {
    resize: vertical;
    min-height: 80px;
}

/* ── Colour picker ──────────────────── */

.color-picker {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 12px;
    background: var(--surface);
}

.color-picker__input {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 4px;
    padding: 0;
    cursor: pointer;
    background: none;
    flex-shrink: 0;
}

.color-picker__hex {
    font-size: 13px;
    font-family: monospace;
    color: var(--text-secondary);
}

/* ── Checkbox ───────────────────────── */

.field--checkbox {
    flex-direction: row;
    align-items: center;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.checkbox__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox__box {
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--border);
    border-radius: 4px;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
}

.checkbox__input:checked + .checkbox__box {
    background: var(--header-bg);
    border-color: var(--header-bg);
}

.checkbox__input:checked + .checkbox__box::after {
    content: '';
    width: 10px;
    height: 6px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) translateY(-1px);
    display: block;
}

.checkbox__label {
    font-size: 14px;
    color: var(--text);
}

/* ── Primary btn (переиспользуем из login.css) ── */

.btn--primary {
    background: var(--header-bg);
    color: var(--header-text);
    border-color: var(--header-bg);
}

.btn--primary:hover {
    background: #1c1917;
    border-color: #1c1917;
}

.btn--primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
