/* user/css/user.css */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --light-bg: #f8f9fa;
    --dark-text: #2c3e50;
    --border-color: #dee2e6;
}

/* Общие стили */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--dark-text);
    line-height: 1.6;
    background: var(--light-bg);
    min-height: 100vh;
}

/* Навигация */
.user-navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, #34495e 100%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 1rem 0;
}

.user-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    padding: 30px;
    margin: 20px 0;
}

/* Карточки */
.user-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.stats-card {
    text-align: center;
    padding: 25px 15px;
    border: none;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.stats-number {
    font-size: 2.0rem;
    font-weight: bold;
    color: var(--secondary-color);
    margin-bottom: 5px;
}

.stats-label {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Кнопки */
.btn-primary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #2980b9 100%);
    border: none;
    border-radius: 25px;
    padding: 12px 30px;
    font-weight: 600;
}

.btn-outline-primary {
    border-radius: 25px;
    padding: 10px 25px;
}

/* Навигация в кабинете */
.user-sidebar {
    background: white;
    border-radius: 10px;
    padding: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.user-sidebar .user-info {
    padding: 25px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #34495e 100%);
    color: white;
    border-radius: 10px 10px 0 0;
    text-align: center;
}

.user-sidebar .user-info h5 {
    margin-bottom: 5px;
}

.user-sidebar .user-info p {
    opacity: 0.9;
    margin: 0;
    font-size: 0.9rem;
}

.user-sidebar .nav {
    padding: 15px 0;
}

.user-sidebar .nav-link {
    color: var(--dark-text);
    padding: 12px 20px;
    margin: 2px 0;
    border-radius: 0;
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
}

.user-sidebar .nav-link:hover,
.user-sidebar .nav-link.active {
    background: #f8f9fa;
    border-left-color: var(--secondary-color);
    color: var(--secondary-color);
}

.user-sidebar .nav-link i {
    width: 20px;
    margin-right: 10px;
}

/* Заказы */
.order-item {
    border-left: 4px solid var(--secondary-color);
    padding: 15px;
    margin-bottom: 12px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

.status-confirmed { background: #d4edda; color: #155724; }
.status-pending { background: #fff3cd; color: #856404; }
.status-paid { background: #d1ecf1; color: #0c5460; }
.status-active { background: #d4edda; color: #155724; }
.status-completed { background: #e2e3e5; color: #383d41; }

/* Таблицы */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.data-table th {
    background: var(--light-bg);
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
}

.data-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
}

.data-table tr:hover {
    background: #f8f9fa;
}

/* Формы */
.form-group {
    margin-bottom: 1.5rem;
}

.form-control {
    border-radius: 8px;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
}

.form-control:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

/* Уведомления */
.alert {
    border-radius: 10px;
    border: none;
    padding: 15px 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
}

/* Загрузка */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* === СТИЛИ КАЛЕНДАРЯ === */

/* Навигация по месяцам */
.month-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
    padding: 0;
    flex-wrap: nowrap;
}

.month-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    min-width: 140px;
    text-align: center;
    margin: 0;
    flex-shrink: 0;
}

.nav-btn {
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-btn:hover {
    background: #0056b3;
}

.nav-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.nav-btn i {
    font-size: 0.8rem;
}

/* Контейнер календаря */
.calendar-container {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* === СОВРЕМЕННЫЙ КАЛЕНДАРЬ С 3 СТРОКАМИ === */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 24px;
}

.calendar-weekdays {
    display: contents;
}

.calendar-weekdays div {
    text-align: center;
    font-weight: 600;
    padding: 12px 8px;
    background: var(--primary-color);
    color: white;
    border-radius: 6px;
    font-size: 0.85rem;
    border-bottom: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Современные ячейки дней */
.calendar-day {
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    padding: 12px 8px;
    min-height: 160px;
    background: white;
    position: relative;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.calendar-day:hover {
    border-color: var(--secondary-color);
    box-shadow: 0 4px 16px rgba(52, 152, 219, 0.15);
    transform: translateY(-2px);
}

.calendar-day.empty {
    background: #fafbfc;
    border: 1px dashed #e1e5e9;
    opacity: 0.6;
}

.calendar-day.today {
    border: 2px solid var(--accent-color);
    background: linear-gradient(135deg, #fff9f0 0%, #fff3e0 100%);
    box-shadow: 0 4px 16px rgba(231, 76, 60, 0.1);
}

/* Номер дня - современный */
.day-number {
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--dark-text);
    align-self: flex-start;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 6px;
    min-width: 24px;
    text-align: center;
}

.calendar-day.today .day-number {
    background: var(--accent-color);
    color: white;
}

/* УБРАН СЧЕТЧИК СЛОТОВ */
.slots-count {
    display: none; /* Убираем синий квадратик с цифрой */
}

/* Детали слотов - современные с 3 строками */
.slot-details {
    flex-grow: 1;
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Современные карточки слотов с 3 строками */
.slot-item {
    background: white;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    padding: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.slot-item:hover {
    border-color: var(--secondary-color);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.1);
}

/* Три строки с иконками */
.slot-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 0;
    min-height: 18px;
}

.slot-row:not(:last-child) {
    border-bottom: 1px solid #f8f9fa;
}

/* Иконки */
.slot-icon {
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    opacity: 0.7;
    flex-shrink: 0;
}

/* Сообщество - первая строка */
.community-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary-color);
    line-height: 1.2;
}

/* Время - вторая строка */
.slot-time {
    font-size: 0.7rem;
    color: var(--dark-text);
    font-weight: 500;
}

/* Стоимость - третья строка */
.slot-price {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--success-color);
}

/* Статусы дней через градиенты */
.calendar-day.has-slots.completed {
    background: linear-gradient(135deg, #f8fff8 0%, #f0f9f0 100%);
    border-color: #e8f5e8;
}

.calendar-day.has-slots.upcoming {
    background: linear-gradient(135deg, #f8fbff 0%, #f0f8ff 100%);
    border-color: #e8f2ff;
}

.calendar-day.has-slots.today {
    background: linear-gradient(135deg, #fff9f0 0%, #fff3e0 100%);
    border-color: var(--accent-color);
}

/* Текст "Нет выходов" - УБРАНА ИКОНКА */
.calendar-day .text-muted.small {
    font-size: 0.75rem;
    text-align: center;
    margin: auto;
    color: #a0a4a8;
}

/* АДАПТИВНОСТЬ */
@media (max-width: 768px) {
    .calendar-grid {
        grid-template-columns: repeat(1, 1fr);
        gap: 12px;
    }
    
    .calendar-weekdays {
        display: none;
    }
    
    .calendar-day {
        min-height: auto;
        padding: 16px;
        flex-direction: row;
        align-items: flex-start;
        gap: 12px;
    }
    
    .day-number {
        margin-bottom: 0;
        min-width: 28px;
    }
    
    .slot-details {
        flex-grow: 1;
        margin-top: 0;
    }
    
    .slot-item {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }
    
    .slot-row {
        border-bottom: none !important;
        padding: 1px 0;
    }
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.calendar-day {
    animation: fadeIn 0.3s ease-out;
}

/* Легенда - современная */
.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    margin-right: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.legend-color.completed {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.legend-color.upcoming {
    background: linear-gradient(135deg, #17a2b8 0%, #6f42c1 100%);
}

.legend-color.today {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
}

/* Пустое состояние */
.calendar-empty-state {
    text-align: center;
    padding: 40px 16px;
    color: #6c757d;
}

.calendar-empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.calendar-empty-state h5 {
    margin-bottom: 8px;
    color: #495057;
    font-size: 1.1rem;
}

.calendar-empty-state p {
    margin-bottom: 20px;
    font-size: 0.9rem;
}

/* === ОСТАЛЬНЫЕ СТИЛИ (сохраняются без изменений) === */

/* СТИЛИ ДЛЯ ТАБЛИЦЫ ЗАКАЗОВ БЕЗ РАМОК */
.table-orders {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0;
    border: none;
}

.table-orders th {
    background: var(--light-bg);
    padding: 10px 8px;
    font-weight: 600;
    border: none;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.table-orders td {
    padding: 10px 8px;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.table-orders tr:last-child td {
    border-bottom: none;
}

.table-orders tr:hover {
    background: #fafafa;
}

/* Убираем рамки у контейнера таблицы */
.table-responsive {
    border: none;
}

/* Обновляем стили карточки заказа */
.order-item .card {
    border: none;
    box-shadow: none;
}

.order-item .card-body {
    padding: 15px 0 0 0;
    background: transparent;
}

/* Специальные стили для ячеек */
.community-cell {
    min-width: 140px;
    max-width: 160px;
}

.datetime-cell {
    min-width: 100px;
    max-width: 120px;
}

.price-cell {
    min-width: 80px;
    max-width: 100px;
}

.status-cell {
    min-width: 90px;
    max-width: 110px;
}

.datetime-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.date-text {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--dark-text);
}

.time-text {
    font-size: 0.8rem;
    color: #6c757d;
}

/* Специальные бейджи для статусов слотов */
.slot-status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    min-width: 80px;
}

/* Статусы слотов */
.slot-status-badge.bg-warning {
    background-color: #ffc107 !important;
    color: #000 !important;
}

.slot-status-badge.bg-primary {
    background-color: #007bff !important;
    color: #fff !important;
}

.slot-status-badge.bg-success {
    background-color: #28a745 !important;
    color: #fff !important;
}

.slot-status-badge.bg-secondary {
    background-color: #6c757d !important;
    color: #fff !important;
}

/* === ОБЩИЕ СТИЛИ ДЛЯ BOOKING.HTML === */
.booking-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #34495e 100%);
    color: white;
    padding: 3rem 0;
    text-align: center;
    margin-bottom: 2rem;
    border-radius: 15px;
}

.hero-section h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero-section p {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 0;
}

/* Календарь бронирования */
.booking-calendar-container {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.booking-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.booking-weekdays {
    display: contents;
}

.booking-weekdays div {
    text-align: center;
    font-weight: bold;
    padding: 15px 10px;
    background: var(--primary-color);
    color: white;
    border-radius: 8px;
    font-size: 0.9rem;
}

.booking-day {
    border: 2px solid #f8f9fa;
    border-radius: 10px;
    padding: 15px 10px;
    min-height: 120px;
    background: white;
    position: relative;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
}

.booking-day.empty {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
}

.booking-day.past {
    background: #f8f9fa;
    color: #6c757d;
    opacity: 0.6;
}

.booking-day.today {
    border-color: var(--accent-color);
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
}

.booking-day-number {
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 1rem;
    color: var(--dark-text);
    align-self: flex-start;
}

/* Временные слоты */
.booking-time-slots {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 5px;
}

.booking-time-slot {
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    text-align: center;
    border: 1px solid transparent;
    cursor: pointer;
}

.booking-time-slot.free {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.booking-time-slot.selected {
    background: var(--secondary-color);
    color: white;
    border-color: #2980b9;
}

.booking-time-slot.occupied {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
    cursor: not-allowed;
}

.booking-time-slot.past {
    background: #e2e3e5;
    color: #383d41;
    border-color: #d6d8db;
    cursor: not-allowed;
}

/* Информация о клиенте */
.client-info-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.client-info-alert {
    background: linear-gradient(135deg, var(--primary-color) 0%, #34495e 100%);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1rem 0;
}

.auth-badge {
    background: var(--success-color);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.login-prompt {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

/* Корзина */
.cart-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    position: sticky;
    top: 20px;
}

.cart-item {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1rem;
    background: #f8f9fa;
}

.tariff-info {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

/* Тарифы */
.tariff-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.tariff-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: none;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
}

.tariff-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--secondary-color);
    margin-bottom: 5px;
}

.tariff-label {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Кнопка оформления */
.checkout-btn {
    background: linear-gradient(135deg, var(--success-color) 0%, #20c997 100%);
    border: none;
    border-radius: 25px;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    width: 100%;
    margin-top: 20px;
}

.checkout-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* Формы */
.booking-form-group {
    margin-bottom: 1.5rem;
}

.booking-form-control {
    border-radius: 8px;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    font-size: 1rem;
}

.booking-form-control:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

#client-contacts {
    min-height: 120px;
    resize: vertical;
}

.form-text.text-muted {
    font-size: 0.85rem;
    color: #6c757d !important;
}

/* Сообщения */
.booking-alert {
    border-radius: 10px;
    border: none;
    padding: 15px 20px;
    margin: 15px 0;
}

.booking-alert.success {
    background: #d4edda;
    color: #155724;
}

.booking-alert.error {
    background: #f8d7da;
    color: #721c24;
}

.booking-alert.info {
    background: #d1ecf1;
    color: #0c5460;
}

/* Стили для временных слотов бронирования */
.time-slots {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
}

.time-slot {
    padding: 8px 6px;
    border-radius: 6px;
    font-size: 0.8rem;
    text-align: center;
    border: 2px solid transparent;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 45px;
    justify-content: center;
}

/* Свободные слоты */
.time-slot.free {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border-color: #28a745;
}

/* Выбранные слоты */
.time-slot.selected {
    background: #aed5ff;
    color: white;
    border-color: #0056b3;
    font-weight: bold;
}

/* Занятые слоты */
.time-slot.occupied {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border-color: #dc3545;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Прошедшие даты */
.time-slot.past {
    background: #e9ecef;
    color: #6c757d;
    border-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.5;
}

/* Текст в слотах */
.time-slot div:first-child {
    font-weight: 600;
    font-size: 0.75rem;
}

.time-slot div:last-child {
    font-size: 0.7rem;
    opacity: 0.9;
}

.occupied-text {
    font-weight: bold;
    font-size: 0.65rem !important;
}

.past-text {
    font-size: 0.65rem !important;
}

/* Переопределение Bootstrap стилей */
.bg-warning {
    background-color: #ffc107 !important;
    color: #000 !important;
}

.text-dark {
    color: #000 !important;
}

/* АДАПТИВНОСТЬ */
@media (max-width: 768px) {
    .user-container {
        padding: 16px;
        margin: 10px 0;
    }
    
    .user-card {
        padding: 16px;
        margin-bottom: 16px;
    }
    
    .stats-number {
        font-size: 2rem;
    }
    
    .user-sidebar {
        position: static;
        margin-bottom: 20px;
    }
    
    /* Навигация */
    .month-navigation {
        gap: 12px;
        margin: 16px 0;
        padding: 0 8px;
    }
    
    .month-title {
        font-size: 1.2rem;
        min-width: 120px;
        padding: 0 8px;
    }
    
    .nav-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
        min-width: auto;
    }
    
    /* Календарь */
    .calendar-container {
        padding: 12px;
        border-radius: 8px;
    }
    
    .calendar-grid {
        grid-template-columns: repeat(1, 1fr);
        gap: 8px;
    }
    
    .calendar-weekdays {
        display: none;
    }
    
    .calendar-day {
        min-height: 70px;
        padding: 6px 8px;
        flex-direction: row;
        align-items: flex-start;
        gap: 8px;
    }
    
    .calendar-day.has-slots {
        min-height: 90px;
    }
    
    .calendar-day.has-many-slots {
        min-height: 110px;
    }
    
    .day-number {
        font-size: 0.8rem;
        margin-bottom: 0;
        min-width: 20px;
    }
    
    .slots-count {
        width: 16px;
        height: 16px;
        font-size: 0.6rem;
        position: static;
        order: -1;
    }
    
    .slot-details {
        flex-grow: 1;
        max-height: none;
        margin-top: 0;
    }
    
    .slot-item {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        gap: 1px;
    }
    
    .slot-item .fw-bold {
        font-size: 0.6rem;
    }
    
    .slot-item .text-muted {
        font-size: 0.55rem;
        text-align: right;
    }
    
    .slot-item .text-success {
        font-size: 0.6rem;
        grid-column: 1 / span 2;
    }
    
    /* Статистика */
    .calendar-stats-container .row {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    
    .calendar-stats-container .col-md-3 {
        width: 100%;
    }
    
    .calendar-stats-container .stats-card {
        padding: 12px;
    }
    
    .calendar-stats-container .stats-number {
        font-size: 1.5rem;
    }
    
    .calendar-stats-container .stats-label {
        font-size: 0.8rem;
    }
    
    /* Фильтры */
    .calendar-filters .row {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    
    .calendar-filters .col-md-6 {
        width: 100%;
    }
    
    /* Заказы */
    .order-item {
        padding: 12px;
        margin-bottom: 10px;
    }
    
    .table-orders {
        font-size: 0.8rem;
    }
    
    .table-orders th,
    .table-orders td {
        padding: 8px 6px;
    }
    
    .community-cell {
        min-width: 120px;
        max-width: 140px;
    }
    
    .datetime-cell {
        min-width: 90px;
        max-width: 110px;
    }
    
    .price-cell {
        min-width: 70px;
        max-width: 90px;
    }
    
    .status-cell {
        min-width: 80px;
        max-width: 100px;
    }
    
    .date-text {
        font-size: 0.8rem;
    }
    
    .time-text {
        font-size: 0.75rem;
    }
    
    .slot-status-badge {
        font-size: 0.7rem;
        padding: 3px 6px;
        min-width: 70px;
        border-radius: 5px;
    }
    
    /* Booking */
    .booking-container {
        padding: 15px;
    }
    
    .hero-section {
        padding: 2rem 0;
        margin-bottom: 1rem;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section p {
        font-size: 1rem;
    }
    
    .month-navigation {
        gap: 15px;
        margin: 1.5rem 0;
    }
    
    .month-title {
        font-size: 1.3rem;
        min-width: 160px;
    }
    
    .nav-btn {
        padding: 10px 15px;
        font-size: 0.85rem;
    }
    
    .booking-calendar-container,
    .client-info-section,
    .cart-section,
    .tariff-section {
        padding: 20px;
        margin: 15px 0;
    }
    
    .booking-calendar-grid {
        grid-template-columns: repeat(1, 1fr);
        gap: 10px;
    }
    
    .booking-weekdays {
        display: none;
    }
    
    .booking-day {
        min-height: 100px;
        padding: 12px;
        flex-direction: row;
        align-items: flex-start;
        gap: 10px;
    }
    
    .booking-day-number {
        font-size: 0.9rem;
        margin-bottom: 0;
        min-width: 30px;
    }
    
    .booking-time-slots {
        flex-grow: 1;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .booking-time-slot {
        flex: 1;
        min-width: 60px;
        padding: 8px 4px;
        font-size: 0.75rem;
    }
    
    .cart-section {
        position: static;
    }
}

@media (max-width: 576px) {
    .calendar-day {
        min-height: 60px;
        padding: 4px 6px;
    }
    
    .calendar-day.has-slots {
        min-height: 80px;
    }
    
    .calendar-day.has-many-slots {
        min-height: 100px;
    }
    
    .day-number {
        font-size: 0.75rem;
    }
    
    .slot-item .fw-bold {
        font-size: 0.55rem;
    }
    
    .slot-item .text-muted {
        font-size: 0.5rem;
    }
    
    .slot-item .text-success {
        font-size: 0.55rem;
    }
    
    .order-item {
        padding: 10px;
        margin-bottom: 8px;
    }
    
    .order-item .card-body {
        padding: 12px 0 0 0;
    }
    
    .table-orders {
        font-size: 0.75rem;
    }
    
    .table-orders th,
    .table-orders td {
        padding: 6px 4px;
    }
    
    .community-cell {
        min-width: 100px;
        max-width: 120px;
    }
    
    .datetime-cell {
        min-width: 80px;
        max-width: 100px;
    }
    
    .datetime-wrapper {
        gap: 1px;
    }
    
    .date-text {
        font-size: 0.75rem;
    }
    
    .time-text {
        font-size: 0.7rem;
    }
    
    .price-cell {
        min-width: 60px;
        max-width: 80px;
    }
    
    .status-cell {
        min-width: 70px;
        max-width: 90px;
    }
    
    .slot-status-badge {
        font-size: 0.65rem;
        padding: 2px 4px;
        min-width: 65px;
        border-radius: 5px;
    }
}

@media (max-width: 480px) {
    .order-item {
        padding: 8px;
        margin-bottom: 6px;
        border-left-width: 3px;
    }
    
    .table-orders {
        font-size: 0.7rem;
        min-width: 300px;
    }
    
    .table-orders th,
    .table-orders td {
        padding: 5px 3px;
    }
    
    .community-cell {
        min-width: 90px;
        max-width: 110px;
    }
    
    .datetime-cell {
        min-width: 70px;
        max-width: 90px;
    }
    
    .price-cell {
        min-width: 50px;
        max-width: 70px;
    }
    
    .status-cell {
        min-width: 60px;
        max-width: 80px;
    }
    
    .slot-status-badge {
        font-size: 0.6rem;
        padding: 2px 3px;
        min-width: 55px;
        border-radius: 5px;
    }
    
    /* Booking */
    .booking-container {
        padding: 10px;
    }
    
    .hero-section {
        padding: 1.5rem 0;
    }
    
    .hero-section h1 {
        font-size: 1.5rem;
    }
    
    .month-navigation {
        gap: 10px;
        margin: 1rem 0;
    }
    
    .month-title {
        font-size: 1.1rem;
        min-width: 120px;
    }
    
    .nav-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    .nav-btn span {
        display: none;
    }
    
    .booking-calendar-container,
    .client-info-section,
    .cart-section,
    .tariff-section {
        padding: 15px;
    }
    
    .booking-day {
        min-height: 90px;
        padding: 10px;
    }
    
    .booking-time-slots {
        gap: 4px;
    }
    
    .booking-time-slot {
        font-size: 0.7rem;
        padding: 6px 3px;
    }
}

/* СТИЛИ ДЛЯ ДОГОВОРОВ */
.contract-item {
    border-left: 4px solid var(--secondary-color);
    padding: 15px;
    margin-bottom: 12px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* Бейджи статусов договоров */
.contract-status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    min-width: 80px;
}

.payment-status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    min-width: 100px;
}

/* СТИЛИ ДЛЯ ТАБЛИЦЫ ДОГОВОРОВ */
.table-contracts {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0;
    border: none;
}

.table-contracts th {
    background: var(--light-bg);
    padding: 10px 8px;
    font-weight: 600;
    border: none;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.table-contracts td {
    padding: 10px 8px;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.table-contracts tr:last-child td {
    border-bottom: none;
}

.table-contracts tr:hover {
    background: #fafafa;
}

/* Специальные стили для ячеек договоров */
.amount-cell {
    min-width: 120px;
    max-width: 140px;
}

.paid-cell {
    min-width: 100px;
    max-width: 120px;
}

.balance-cell {
    min-width: 100px;
    max-width: 120px;
}

.payment-status-cell {
    min-width: 120px;
    max-width: 140px;
}

/* АДАПТИВНОСТЬ ДЛЯ ДОГОВОРОВ */
@media (max-width: 768px) {
    .contract-item {
        padding: 12px;
        margin-bottom: 10px;
    }
    
    .table-contracts {
        font-size: 0.8rem;
    }
    
    .table-contracts th,
    .table-contracts td {
        padding: 8px 6px;
    }
    
    .amount-cell {
        min-width: 100px;
        max-width: 120px;
    }
    
    .paid-cell {
        min-width: 80px;
        max-width: 100px;
    }
    
    .balance-cell {
        min-width: 80px;
        max-width: 100px;
    }
    
    .payment-status-cell {
        min-width: 100px;
        max-width: 120px;
    }
    
    .contract-status-badge {
        font-size: 0.7rem;
        padding: 3px 5px;
        min-width: 70px;
    }
    
    .payment-status-badge {
        font-size: 0.7rem;
        padding: 3px 6px;
        min-width: 90px;
    }
}

@media (max-width: 576px) {
    .contract-item {
        padding: 10px;
        margin-bottom: 8px;
    }
    
    .contract-item .card-body {
        padding: 12px;
    }
    
    .table-contracts {
        font-size: 0.75rem;
    }
    
    .table-contracts th,
    .table-contracts td {
        padding: 6px 4px;
    }
    
    .amount-cell {
        min-width: 80px;
        max-width: 100px;
    }
    
    .paid-cell {
        min-width: 70px;
        max-width: 90px;
    }
    
    .balance-cell {
        min-width: 70px;
        max-width: 90px;
    }
    
    .payment-status-cell {
        min-width: 90px;
        max-width: 110px;
    }
    
    .contract-status-badge {
        font-size: 0.65rem;
        padding: 2px 5px;
        min-width: 65px;
    }
    
    .payment-status-badge {
        font-size: 0.65rem;
        padding: 2px 4px;
        min-width: 80px;
    }
}

@media (max-width: 480px) {
    .contract-item {
        padding: 8px;
        margin-bottom: 6px;
        border-left-width: 3px;
    }
    
    .table-contracts {
        font-size: 0.7rem;
        min-width: 280px;
    }
    
    .table-contracts th,
    .table-contracts td {
        padding: 5px 3px;
    }
    
    .contract-status-badge {
        font-size: 0.6rem;
        padding: 2px 5px;
        min-width: 55px;
    }
    
    .payment-status-badge {
        font-size: 0.6rem;
        padding: 2px 3px;
        min-width: 70px;
    }
}

/* Стили для таблицы выходов рекламы */
.table-bordered {
    border: 1px solid var(--border-color);
}

.table-bordered th,
.table-bordered td {
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    font-size: 0.85rem;
}

.table-bordered thead th {
    background: var(--light-bg);
    font-weight: 600;
}

.table-light {
    background-color: #f8f9fa;
}

/* Обновляем стили для компактного отображения информации о договоре */
.contract-item .row.text-muted.small .col-md-3 {
    margin-bottom: 5px;
}

.contract-item .row.text-muted.small strong {
    color: var(--dark-text);
    font-weight: 600;
}

/* Адаптивность для компактного отображения */
@media (max-width: 768px) {
    .contract-item .row.text-muted.small .col-md-3 {
        width: 50%;
        margin-bottom: 8px;
    }
}

@media (max-width: 576px) {
    .contract-item .row.text-muted.small .col-md-3 {
        width: 100%;
        margin-bottom: 5px;
    }
}

.tariff-info {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.tariff-info:hover {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.empty-cart-message {
    padding: 2rem;
    text-align: center;
    color: #6c757d;
}

.empty-cart-message i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* === АДАПТИВНЫЕ СТИЛИ ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ === */

@media (max-width: 768px) {
    .calendar-grid {
        grid-template-columns: repeat(1, 1fr);
        gap: 12px;
    }
    
    .calendar-weekdays {
        display: none;
    }
    
    .calendar-day {
        min-height: auto;
        padding: 16px;
        flex-direction: row;
        align-items: flex-start;
        gap: 12px;
    }
    
    .day-number {
        margin-bottom: 0;
        min-width: 28px;
        flex-shrink: 0;
    }
    
    /* Контейнер для временных слотов - адаптивная сетка */
    .time-slots {
        flex-grow: 1;
        margin-top: 0;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 6px;
        align-content: start;
    }
    
    /* Базовые стили слотов для мобильных */
    .time-slot {
        min-height: 50px;
        padding: 8px 4px;
        font-size: 0.7rem;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
    }
    
    .time-slot .slot-time {
        font-size: 0.65rem;
        margin-bottom: 2px;
    }
    
    .time-slot .slot-price {
        font-size: 0.6rem;
    }
    
    .occupied-text, .past-text {
        font-size: 0.55rem !important;
    }
}

/* Для очень маленьких экранов */
@media (max-width: 480px) {
    .calendar-day {
        padding: 12px;
        gap: 10px;
    }
    
    .day-number {
        min-width: 24px;
        font-size: 0.8rem;
    }
    
    .time-slots {
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
        gap: 4px;
    }
    
    .time-slot {
        min-height: 45px;
        padding: 6px 3px;
        font-size: 0.65rem;
    }
    
    .time-slot .slot-time {
        font-size: 0.6rem;
    }
    
    .time-slot .slot-price {
        font-size: 0.55rem;
    }
}

/* Для горизонтальной ориентации на мобильных */
@media (max-width: 768px) and (orientation: landscape) {
    .time-slots {
        grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
        gap: 8px;
    }
    
    .time-slot {
        min-height: 40px;
        padding: 6px 4px;
    }
}

/* Для планшетов */
@media (min-width: 769px) and (max-width: 1024px) {
    .calendar-grid {
        grid-template-columns: repeat(7, 1fr);
        gap: 6px;
    }
    
    .calendar-day {
        min-height: 140px;
        padding: 10px 6px;
    }
    
    .time-slots {
        gap: 4px;
    }
    
    .time-slot {
        min-height: 40px;
        padding: 6px 4px;
        font-size: 0.7rem;
    }
    
    .time-slot .slot-time {
        font-size: 0.65rem;
    }
    
    .time-slot .slot-price {
        font-size: 0.6rem;
    }
}

/* Точный контроль количества колонок для разных количеств слотов */
@media (max-width: 768px) {
    /* Для 1-2 слотов - 2 колонки */
    .calendar-day.slots-1 .time-slots,
    .calendar-day.slots-2 .time-slots {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Для 3-4 слотов - 3 колонки */
    .calendar-day.slots-3 .time-slots,
    .calendar-day.slots-4 .time-slots {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Для 5+ слотов - 4 колонки */
    .calendar-day.slots-5-plus .time-slots {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Для очень маленьких экранов - уменьшаем колонки */
    @media (max-width: 360px) {
        .calendar-day.slots-3 .time-slots,
        .calendar-day.slots-4 .time-slots {
            grid-template-columns: repeat(2, 1fr);
        }
        
        .calendar-day.slots-5-plus .time-slots {
            grid-template-columns: repeat(3, 1fr);
        }
    }
}

/* Увеличиваем минимальную ширину для лучшего отображения */
@media (max-width: 768px) {
    .time-slots {
        grid-template-columns: repeat(auto-fit, minmax(85px, 1fr));
    }
}

@media (max-width: 480px) {
    .time-slots {
        grid-template-columns: repeat(auto-fit, minmax(75px, 1fr));
    }
}

@media (max-width: 360px) {
    .time-slots {
        grid-template-columns: repeat(auto-fit, minmax(65px, 1fr));
    }
}

/* СТИЛИ ДЛЯ СТРАНИЦЫ ПЛАТЕЖЕЙ */

.payment-item {
    border-left: 4px solid var(--success-color);
    transition: all 0.3s ease;
}

.payment-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.payment-status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    min-width: 80px;
}

/* АДАПТИВНОСТЬ ДЛЯ ПЛАТЕЖЕЙ */
@media (max-width: 768px) {
    .payment-item .row.align-items-center {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 12px;
    }
    
    .payment-item .col-md-2,
    .payment-item .col-md-3 {
        width: 100%;
        margin-bottom: 8px;
    }
    
    .payment-status-badge {
        align-self: flex-start;
    }
    
    .payment-item .mt-3.pt-3.border-top .row {
        flex-direction: column;
        gap: 8px;
    }
    
    .payment-item .mt-3.pt-3.border-top .col-md-4 {
        width: 100%;
        margin-bottom: 5px;
    }
}

@media (max-width: 576px) {
    .payment-item {
        padding: 12px;
    }
    
    .payment-status-badge {
        font-size: 0.7rem;
        padding: 3px 6px;
        min-width: 70px;
    }
}

@media (max-width: 480px) {
    .payment-item {
        padding: 10px;
        border-left-width: 3px;
    }
    
    .payment-status-badge {
        font-size: 0.65rem;
        padding: 2px 5px;
        min-width: 65px;
    }
}