body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.navbar-brand span {
    font-weight: 600;
    letter-spacing: 0.04em;
}

.card {
    border-radius: 1rem;
}

.badge-seat {
    font-size: 0.75rem;
    padding: 0.35rem 0.6rem;
}

.booking-table th,
.booking-table td {
    vertical-align: middle;
}

.booking-table .status-free {
    color: #198754;
    font-weight: 500;
}

.booking-table .status-busy {
    color: #dc3545;
    font-weight: 500;
}

.booking-table .status-own {
    color: #0d6efd;
    font-weight: 500;
}

.balance-card {
    border-left: 4px solid #9ca3af;
}

.balance-card.balance-positive {
    border-left-color: #198754;
}

.balance-card.balance-negative {
    border-left-color: #dc3545;
}

.balance-amount {
    font-size: 1.6rem;
    font-weight: 600;
}

.balance-amount.balance-positive {
    color: #198754;
}

.balance-amount.balance-negative {
    color: #dc3545;
}

.text-muted-small {
    font-size: 0.85rem;
}

.section-title {
    color: #111827;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.section-title-muted {
    color: #374151;
    font-weight: 600;
}

.calendar-wrapper {
    background-color: #ffffff;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 0.25rem 0.75rem rgba(15, 23, 42, 0.08);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.calendar-title {
    font-weight: 600;
    font-size: 1rem;
}

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.75rem;
    margin-bottom: 0.75rem;
}

.calendar-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
}

.calendar-legend-color {
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.15);
}

.calendar-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 0.8rem;
}

.calendar-table th {
    text-align: center;
    padding: 0.4rem 0.25rem;
    font-weight: 500;
    color: #6c757d;
}

.calendar-table td {
    border: 1px solid #e5e7eb;
    vertical-align: top;
    padding: 0.25rem;
    background-color: #ffffff;
}

.calendar-day-outside {
    background-color: #f8fafc;
    color: #9ca3af;
}

.calendar-day-number {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0;
    color: #111827;
}

.calendar-day-today .calendar-day-number {
    color: #0d6efd;
    font-weight: 700;
}

/* Убрали рамку у текущего дня — достаточно подсветки числа */

.calendar-day-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem 0.25rem;
}

.calendar-badge {
    min-width: 1.8rem;
    padding: 0.1rem 0.25rem;
    border-radius: 999px;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

/* Более компактный вид календаря мест в админке */
.calendar-seats-scroll {
    overflow: auto;
    max-height: 70vh;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
}

.calendar-weekend {
    background: #f9fafb;
}
/* Для календаря с местами цвет бронирования важнее фона выходного дня */
.calendar-table-seats td.calendar-weekend[style*="background-color"] {
    background: inherit !important;
}

.calendar-seat-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 0.03em;
    line-height: 1.1;
    min-height: 44px;
}


.calendar-booking-day-checkbox {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.calendar-booking-day {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 0.75rem;
    padding: 0.25rem 0.3rem;
    border: 1px solid #e5e7eb;
    cursor: default;
    position: relative;
    transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.calendar-booking-day-free {
    cursor: pointer;
    background-color: rgba(25, 135, 84, 0.06);
    border-color: rgba(25, 135, 84, 0.28);
    color: #111827;
}

.calendar-booking-day-free:hover {
    background-color: rgba(25, 135, 84, 0.15);
    border-color: rgba(25, 135, 84, 0.50);
    color: #0f5132;
}

.calendar-booking-day-free:hover .calendar-day-number {
    color: #0f5132;
    font-weight: 700;
}

/* Сегодняшний день при наведении - более темный синий текст */
.calendar-day-today .calendar-booking-day-free:hover .calendar-day-number {
    color: #0a58ca;
    font-weight: 700;
}

.calendar-booking-day-own {
    background-color: rgba(13, 110, 253, 0.08);
    border-color: #0d6efd;
    color: #0d6efd;
}

.calendar-booking-day-busy {
    background-color: rgba(220, 53, 69, 0.06);
    border-color: rgba(220, 53, 69, 0.25);
    color: #6b7280;
    cursor: not-allowed;
}

.calendar-booking-day-past {
    background:
        repeating-linear-gradient(
            135deg,
            rgba(156, 163, 175, 0.18),
            rgba(156, 163, 175, 0.18) 6px,
            rgba(249, 250, 251, 0.9) 6px,
            rgba(249, 250, 251, 0.9) 12px
        );
    color: #9ca3af;
    cursor: not-allowed;
}

.calendar-day-busy-with-alternatives {
    position: relative;
}

.calendar-day-busy-with-alternatives:hover {
    background-color: rgba(220, 53, 69, 0.10) !important;
    border-color: rgba(220, 53, 69, 0.40) !important;
}

.calendar-day-number-with-icon {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.2rem;
    width: 100%;
}

.calendar-day-indicator-icon {
    font-size: 0.65rem;
    color: #0d6efd;
    opacity: 0.8;
    flex-shrink: 0;
    line-height: 1;
}

/* Скрываем значок информации в мобильной версии */
@media (max-width: 767.98px) {
    .calendar-day-indicator-icon {
        display: none !important;
    }
}

.calendar-day-busy-with-alternatives:hover .calendar-day-indicator-icon {
    opacity: 1;
    color: #0b5ed7;
}

.calendar-day-alternative-selected {
    background-color: rgba(13, 110, 253, 0.12) !important;
    border-color: rgba(13, 110, 253, 0.50) !important;
    color: #0d6efd !important;
}

.calendar-day-alternative-selected .calendar-day-number {
    color: #0d6efd !important;
    font-weight: 700;
}

.calendar-day-alternative-selected .calendar-day-indicator-icon {
    color: #0d6efd;
    opacity: 1;
}

/* Переопределяем белый цвет для выбранного дня с альтернативным местом */
.calendar-booking-day-selected.calendar-day-alternative-selected {
    background-color: rgba(13, 110, 253, 0.12) !important;
    border-color: rgba(13, 110, 253, 0.50) !important;
    color: #0d6efd !important;
}

.calendar-booking-day-selected.calendar-day-alternative-selected .calendar-day-number {
    color: #0d6efd !important;
    font-weight: 700;
}

.calendar-alternative-seats {
    min-width: 180px;
    max-width: 280px;
}

.calendar-alternative-seats .btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    white-space: nowrap;
}

.calendar-switch-seat-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Улучшаем отображение popover для альтернативных мест */
.popover {
    max-width: 320px;
}

.popover-body {
    padding: 0.75rem;
}


.calendar-booking-day-checkbox:checked + .calendar-booking-day,
.calendar-booking-day-selected {
    background-color: #0d6efd !important;
    border-color: #0b5ed7 !important;
    color: #ffffff !important;
    transform: translateY(-1px);
}

.calendar-booking-day-checkbox:checked + .calendar-booking-day .calendar-day-number,
.calendar-booking-day-selected .calendar-day-number {
    color: #ffffff !important;
    font-weight: 700;
}

/* Переопределяем зеленый цвет свободного дня при выборе */
.calendar-booking-day-free.calendar-booking-day-selected {
    background-color: #0d6efd !important;
    border-color: #0b5ed7 !important;
    color: #ffffff !important;
}

.calendar-booking-day-free.calendar-booking-day-selected .calendar-day-number {
    color: #ffffff !important;
    font-weight: 700;
}

.calendar-booking-day-checkbox:checked + .calendar-booking-day .text-muted-small,
.calendar-booking-day-selected .text-muted-small {
    color: rgba(255, 255, 255, 0.92);
}

/* Сегодняшний день при выборе - белый текст */
.calendar-day-today .calendar-booking-day-selected .calendar-day-number,
.calendar-day-today .calendar-booking-day-checkbox:checked + .calendar-booking-day .calendar-day-number {
    color: #ffffff;
    font-weight: 700;
}


.calendar-legend-mini {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    align-items: center;
}

.calendar-legend-mini-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: #6b7280;
}

.calendar-legend-mini-swatch {
    display: inline-block;
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 0.25rem;
    border: 1px solid rgba(15, 23, 42, 0.16);
    background-color: #ffffff;
}

.calendar-legend-mini-swatch-free {
    background-color: rgba(25, 135, 84, 0.10);
    border-color: rgba(25, 135, 84, 0.35);
}

.calendar-legend-mini-swatch-busy {
    background-color: rgba(220, 53, 69, 0.10);
    border-color: rgba(220, 53, 69, 0.30);
}

.calendar-legend-mini-swatch-own {
    background-color: rgba(13, 110, 253, 0.10);
    border-color: rgba(13, 110, 253, 0.50);
}

.calendar-legend-mini-swatch-today {
    background-color: rgba(13, 110, 253, 0.06);
    border-color: rgba(13, 110, 253, 0.55);
}

.calendar-legend-mini-swatch-past {
    background:
        repeating-linear-gradient(
            135deg,
            rgba(156, 163, 175, 0.18),
            rgba(156, 163, 175, 0.18) 6px,
            rgba(249, 250, 251, 0.9) 6px,
            rgba(249, 250, 251, 0.9) 12px
        );
    border-color: rgba(156, 163, 175, 0.35);
}

/* Чек-лист материалов (модалка) */
.materials-legend {
    font-size: 0.85rem;
    color: #6b7280;
}

.materials-legend-dot {
    display: inline-block;
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 999px;
    border: 2px solid #d1d5db;
    vertical-align: middle;
}
.materials-legend-dot-1 { border-color: rgba(220, 53, 69, 0.75); }
.materials-legend-dot-2 { border-color: rgba(253, 126, 20, 0.80); }
.materials-legend-dot-3 { border-color: rgba(25, 135, 84, 0.80); }

.materials-modal-body {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior: contain;
}

.materials-table-wrapper {
    overflow-x: auto;
}

.materials-table .materials-item {
    font-size: 0.95rem;
    line-height: 1.2;
}

.materials-stars {
    display: inline-flex;
    gap: 0.3rem;
    flex-wrap: nowrap;
    justify-content: flex-end;
    align-items: center;
}

.materials-star-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.materials-star {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #cbd5e1; /* серые контурные звезды */
    cursor: pointer;
    user-select: none;
    touch-action: manipulation;
    transition: border-color 120ms ease, color 120ms ease, transform 120ms ease;
}

.materials-star i {
    font-size: 1.15rem;
    line-height: 1;
}

.materials-star:hover {
    transform: translateY(-1px);
    border-color: rgba(17, 24, 39, 0.18);
}

/* 1 звезда = красный контур */
.materials-stars input[value="1"]:checked ~ .materials-star-1,
.materials-stars input[value="1"]:checked ~ .materials-star-2,
.materials-stars input[value="1"]:checked ~ .materials-star-3 {
    color: #cbd5e1;
}
.materials-stars input[value="1"]:checked ~ .materials-star-1 {
    color: #dc3545;
    border-color: rgba(220, 53, 69, 0.45);
}

/* 2 звезды = оранжевый контур */
.materials-stars input[value="2"]:checked ~ .materials-star-1,
.materials-stars input[value="2"]:checked ~ .materials-star-2 {
    color: #fd7e14;
    border-color: rgba(253, 126, 20, 0.45);
}
.materials-stars input[value="2"]:checked ~ .materials-star-3 {
    color: #cbd5e1;
}

/* 3 звезды = зелёный контур */
.materials-stars input[value="3"]:checked ~ .materials-star-1,
.materials-stars input[value="3"]:checked ~ .materials-star-2,
.materials-stars input[value="3"]:checked ~ .materials-star-3 {
    color: #198754;
    border-color: rgba(25, 135, 84, 0.45);
}

@media (max-width: 576px) {
    .materials-table .materials-item {
        font-size: 0.95rem;
    }
    .materials-star {
        width: 2.15rem;
        height: 2.15rem;
        border-radius: 0.8rem;
    }
}

/* Отображение отчётов по материалам в админке (звёзды) */
.rating-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    vertical-align: middle;
    white-space: nowrap;
}

.rating-inline i {
    font-size: 1.1rem;
    line-height: 1;
    width: 1.1rem;
    height: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.materials-report-compact {
    font-size: 0.85rem;
}

.materials-report-line {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: flex-start;
}

.materials-report-line .label {
    font-weight: 700;
    color: #374151;
}

.materials-report-items {
    color: #4b5563;
}

.materials-report-details summary {
    cursor: pointer;
}

.materials-report-item-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0;
    line-height: 1.4;
    min-height: 2rem;
}

.materials-report-item-row .rating-inline {
    flex: 0 0 auto;
    min-width: 4rem;
}

.materials-report-item-row span {
    color: #374151;
    font-size: 0.95rem;
}

.table-materials-reports th,
.table-materials-reports td {
    vertical-align: top;
}

.materials-report-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem 1.5rem;
}

.materials-report-category {
    padding: 1rem 1.25rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    background: #ffffff;
}

.materials-report-category > .fw-semibold {
    font-size: 1.05rem;
    margin-bottom: 0.75rem !important;
    color: #111827;
    font-weight: 700;
}

.materials-report-category ul {
    margin: 0;
    padding: 0;
}

@media (min-width: 992px) {
    .materials-report-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1200px) {
    .materials-report-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.materials-report-modal {
    z-index: 1055 !important;
}

.materials-report-modal .modal-dialog {
    z-index: 1056 !important;
}

.materials-report-modal .modal-body {
    -webkit-overflow-scrolling: touch;
    padding: 1.5rem;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    background-color: #ffffff;
}

.materials-report-modal .materials-report-category {
    background: #fbfdff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.materials-report-modal .materials-report-category ul {
    margin-bottom: 0;
}

.materials-report-modal .materials-report-item-row {
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
}

.materials-report-modal .materials-report-item-row:last-child {
    border-bottom: none;
}

/* Календарь мест в админке: скролл + sticky заголовки */
.calendar-table-seats {
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    min-width: 1200px; /* чтобы не сжималось в кашу, а скроллилось */
}

.calendar-table-seats th,
.calendar-table-seats td {
    padding: 0.35rem;
    vertical-align: middle;
    text-align: center;
    border: 1px solid #e5e7eb;
    background: #ffffff;
}

.calendar-table-seats th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #f8fafc;
    border-bottom: 2px solid #e5e7eb;
    font-weight: 700;
    color: #374151;
    font-size: 0.85rem;
    padding: 0.5rem 0.35rem;
    min-height: 2.5rem;
}

.calendar-table-seats td {
    width: 48px;
    min-width: 48px;
    height: 48px;
    min-height: 48px;
    aspect-ratio: 1 / 1;
    padding: 0.35rem;
}

.calendar-table-seats th:first-child,
.calendar-table-seats td:first-child {
    position: sticky;
    left: 0;
    z-index: 4;
    background: #ffffff;
    border-right: 2px solid #e5e7eb;
    font-weight: 800;
    color: #111827;
    width: 64px;
    min-width: 64px;
    padding: 0.5rem;
    font-size: 1rem;
}

.calendar-table-seats thead th:first-child {
    background: #f8fafc;
    z-index: 5;
}

.calendar-seat-header {
    font-size: 0.75rem !important;
    white-space: nowrap;
    line-height: 1.2;
}

/* Адаптивная таблица пользователей для мобильных */
.table-users-admin {
    min-width: 800px;
}

.table-users-admin .col-name {
    min-width: 160px;
    width: 180px;
}

.table-users-admin .col-phone {
    min-width: 150px;
    width: 160px;
}

.table-users-admin .col-password {
    min-width: 140px;
    width: 150px;
}

.table-users-admin .col-role {
    min-width: 100px;
    width: 110px;
}

.table-users-admin .col-balance {
    min-width: 100px;
    width: 120px;
}

.table-users-admin .col-color {
    min-width: 60px;
    width: 70px;
}

.table-users-admin .col-actions {
    min-width: 90px;
    width: 100px;
}

@media (max-width: 991.98px) {
    .table-users-admin {
        min-width: 900px;
    }
    
    .table-users-admin .col-name {
        min-width: 180px;
        width: 190px;
    }
    
    .table-users-admin .col-phone {
        min-width: 140px;
        width: 150px;
    }
    
    .table-users-admin .col-password {
        min-width: 120px;
        width: 130px;
    }
    
    .table-users-admin .col-role {
        min-width: 90px;
        width: 100px;
    }
    
    .table-users-admin .col-balance {
        min-width: 90px;
        width: 100px;
    }
    
    .table-users-admin .col-color {
        min-width: 55px;
        width: 60px;
    }
    
    .table-users-admin .col-actions {
        min-width: 85px;
        width: 90px;
    }
    
    .table-users-admin .col-name .row {
        margin-left: -0.25rem;
        margin-right: -0.25rem;
    }
    
    .table-users-admin .col-name .col-12,
    .table-users-admin .col-name .col-sm-6 {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
    
    .table-users-admin input.form-control-sm,
    .table-users-admin select.form-select-sm {
        font-size: 0.8rem;
        padding: 0.25rem 0.4rem;
    }
    
    .table-users-admin .form-control-color {
        width: 2.5rem;
        height: 2rem;
        padding: 0.1rem;
    }
    
    .table-users-admin .btn-sm {
        padding: 0.25rem 0.4rem;
        font-size: 0.8rem;
    }
    
    .table-users-admin th,
    .table-users-admin td {
        padding: 0.5rem 0.35rem;
        font-size: 0.85rem;
    }
}

.calendar-table-seats .calendar-badge {
    min-width: 0;
    padding: 0;
    font-size: 0.8rem;
    font-weight: 800;
}

.calendar-table-seats .calendar-weekend {
    background: rgba(253, 126, 20, 0.05);
}

.calendar-table-seats tr:hover td {
    background-image: linear-gradient(rgba(13, 110, 253, 0.04), rgba(13, 110, 253, 0.04));
}

.calendar-table-seats tr:hover td[style*="background-color"] {
    filter: saturate(1.05);
}

/* Режим редактирования календаря администратора */
.calendar-edit-mode .calendar-cell-editable {
    cursor: pointer;
    transition: all 150ms ease;
}

.calendar-edit-mode .calendar-cell-editable:hover {
    transform: scale(1.05);
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.3);
    z-index: 10;
    position: relative;
}

.calendar-edit-mode .calendar-cell-editable[data-booking-id] {
    cursor: pointer;
}

.calendar-edit-mode .calendar-cell-editable[data-booking-id]:hover {
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.5);
}

.calendar-cell-selected {
    box-shadow: 0 0 0 3px #0d6efd !important;
    background-color: rgba(13, 110, 253, 0.2) !important;
    z-index: 20 !important;
    position: relative !important;
    animation: calendar-pulse 1.5s ease-in-out infinite;
}

@keyframes calendar-pulse {
    0%, 100% {
        box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.5);
    }
    50% {
        box-shadow: 0 0 0 5px rgba(13, 110, 253, 0.3);
    }
}

.calendar-edit-mode .calendar-cell-editable:not([data-booking-id]):hover {
    box-shadow: 0 0 0 2px rgba(25, 135, 84, 0.4);
    background-color: rgba(25, 135, 84, 0.1) !important;
}

/* Исправление мобильной версии кнопок в админке */
@media (max-width: 991.98px) {
    .navbar .d-flex.align-items-center.gap-3 {
        flex-wrap: wrap;
    }
    
    .navbar .btn.btn-outline-secondary.btn-sm {
        min-width: auto;
        width: auto;
        padding: 0.375rem 0.75rem;
        white-space: nowrap;
    }
}




