* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
    font-size: 14px;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 28px;
    font-weight: 600;
}

header h2 {
    font-size: 20px;
    font-weight: 400;
    margin-top: 8px;
    opacity: 0.95;
}

.header-nav {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    justify-content: center;
    margin-top: 16px;
    height: fit-content;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    display: inline-block;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

main {
    padding: 30px;
}

.hidden {
    display: none !important;
}

.booking-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.form-group.form-actions {
    flex-direction:row;
}

.form-group label {
    font-weight: 500;
    color: #555;
    font-size: 14px;
}

.form-actions .btn-submit, .form-actions .btn-common, .form-actions .btn-cancel{
    padding: 12px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
}

.form-group input,
.form-group select {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-group input:invalid {
    border-color: #e74c3c;
}

.date-error {
    color: #dc3545;
    font-size: 13px;
    margin-top: 4px;
    display: none;
}

.time-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.time-selector select {
    flex: 0 0 auto;
    min-width: 80px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.time-separator {
    font-size: 18px;
    font-weight: 600;
    color: #555;
    flex: 0 0 auto;
}

/* Поля времени начала и длительности на одной строке */
.booking-time-duration-row {
    display: flex;
    flex-direction: row;
    gap: 20px;
    align-items: flex-start;
}

.booking-time-duration-row > .form-group {
    flex: 1;
    margin-bottom: 0;
}

.price-display {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid #667eea;
    margin-top: 10px;
}

.price-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.price-value {
    font-size: 32px;
    font-weight: 700;
    color: #667eea;
}

.btn-submit {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.form-message {
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    display: none;
    margin-bottom: 10px;
}

.form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

.form-message.loading {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    display: block;
}

@media (max-width: 640px) {
    .container {
        margin: 10px;
        border-radius: 8px;
    }

    header {
        padding: 20px;
    }

    header h1 {
        font-size: 24px;
    }

    main {
        padding: 20px;
    }

    .form-group.form-actions {
        flex-direction: column;
        gap: 12px;
    }

    .form-group.form-actions .btn-submit,
    .form-group.form-actions .btn-common,
    .form-group.form-actions .btn-cancel {
        width: 100%;
    }

    .price-value {
        font-size: 28px;
    }
}

/* Стили для страницы списка бронирований */
/* Меню теперь стилизуется в admin-mobile.css */

.bookings-summary {
    margin-bottom: 12px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    color: #555;
    font-size: 14px;
}

.bookings-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.booking-card, .settings {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.settings .edit-form {
    border: none;
    padding: 0;
    margin: 0;
}

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

.booking-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.booking-id {
    font-weight: 600;
    font-size: 14px;
    color: #667eea;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
}


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

.booking-info-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.booking-info-row-full {
    grid-template-columns: 1fr;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.info-label {
    font-size: 11px;
    color: #888;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.info-value.price {
    color: #667eea;
    font-size: 16px;
    font-weight: 700;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state p {
    font-size: 18px;
    margin-bottom: 20px;
}

.btn-link {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-link:hover {
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

/* Контейнер для страницы списка бронирований */
body.bookings-page .container {
    max-width: 900px;
}

.booking-actions {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
    text-align: right;
}

.btn-edit {
    display: inline-block;
    padding: 6px 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    font-size: 13px;
}

.btn-edit:hover {
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.edit-form {
    margin-top: 20px;
    padding-top: 20px;
    padding-bottom: 20px;
    border-top: 2px solid #f0f0f0;
    border-bottom: 2px solid #f0f0f0;
}

.edit-form .form-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    align-items: end;
}

.edit-form .form-footer {
    margin-top: 16px;
}

.btn-cancel, .btn-common {
    display: inline-block;
    padding: 5px 10px;
    background: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.2s ease;
    display: inline-block;
    text-align: center;
    border: none;
}

button.btn-cancel, button.btn-common {
    height: 29px;
    cursor: pointer;
}

.form-actions button.btn-cancel, .form-actions button.btn-common {
    height: auto;
}

.btn-common {
    text-align: center;
}

.btn-cancel:hover, .btn-common:hover {
    background: #5a6268;
}

/* Календарь - элементы управления */
.calendar-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.calendar-controls .date-label {
    font-weight: 600;
    font-size: 18px;
}

.calendar-controls .calendar-nav-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Календарь - секция */
.calendar {
    overflow: auto;
}

/* Календарь - таблица */
.cal-table {
    border-collapse: collapse;
    width: 100%;
    table-layout: fixed;
}

.cal-table-header {
    padding: 8px 6px;
    background: #fafafa;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    font-size: 12px;
}

.cal-table-header.sticky {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #fafafa;
    white-space: normal;
    width: 50px;
}

.cal-time {
    font-size: 12px;
    color: #6b7280;
    text-align: right;
    padding: 4px 6px;
    white-space: nowrap;
    position: sticky;
    left: 0;
    background: #f9fafb;
    z-index: 1;
}

.cal-cell {
    border-top: 1px solid #f3f4f6;
    border-left: 1px solid #f3f4f6;
    min-width: 120px;
}

/* Слоты бронирований */
.slot {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #f3f4f6;
    padding: 4px 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.calendar-public .slot {
    cursor: not-allowed;
}

/* На рассмотрении - желто-оранжевая гамма */
.slot_pending,
.slot.slot_pending {
    background: #fef3c7;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #78350f;
    box-shadow: 0 1px 2px rgba(251, 191, 36, 0.2);
}

.slot_pending:hover,
.slot.slot_pending:hover {
    background: linear-gradient(135deg, #fde68a 0%, #fcd34d 100%);
    box-shadow: 0 2px 4px rgba(251, 191, 36, 0.3);
}

/* Подтверждено - зеленая гамма */
.slot_approved,
.slot.slot_approved {
    background: #d1fae5;
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #064e3b;
    box-shadow: 0 1px 2px rgba(52, 211, 153, 0.2);
}

.slot_approved:hover,
.slot.slot_approved:hover {
    background: linear-gradient(135deg, #a7f3d0 0%, #6ee7b7 100%);
    box-shadow: 0 2px 4px rgba(52, 211, 153, 0.3);
}

/* Отклонено - красная/серая гамма */
.slot_rejected,
.slot.slot_rejected {
    background: #fee2e2;
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #7f1d1d;
    box-shadow: 0 1px 2px rgba(248, 113, 113, 0.2);
    opacity: 0.85;
}

.slot_rejected:hover,
.slot.slot_rejected:hover {
    background: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%);
    box-shadow: 0 2px 4px rgba(248, 113, 113, 0.3);
}

.slot-empty {
    border: 1px solid #f3f4f6;
    min-width: 50px;
    min-height: 28px;
    cursor: pointer;
    background: #f9fafb;
    transition: background 0.2s;
    user-select: none;
}

.slot-empty:hover {
    background: #e5e7eb;
}

.slot-empty.selectable {
    cursor: crosshair;
}

.slot-empty.selected {
    background: #bfdbfe !important;
    border-color: #3b82f6 !important;
}

.slot-empty.selecting {
    background: #dbeafe !important;
    border-color: #60a5fa !important;
}

.slot-unavailable {
    background-color: #e5e7eb !important;
    cursor: not-allowed !important;
    opacity: 0.6;
    border: 1px solid #f3f4f6;
    min-width: 50px;
    min-height: 28px;
}

.cal-table td:not(.slot):not(.slot-unavailable) {
    cursor: pointer;
}

.cal-table td:not(.slot):not(.slot-unavailable):hover {
    background-color: #f3f4f6;
}

/* Фильтры */
.filters {
    margin-bottom: 16px;
}

.filters .form-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filters .form-group {
    margin-bottom: 0;
}

.filters .form-group label {
    font-size: 12px;
    margin-bottom: 4px;
    gap: 4px;
}

.filters .form-group input,
.filters .form-group select {
    padding: 6px 8px;
    font-size: 13px;
    min-height: 32px;
}

.filters label.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    margin-bottom: 0;
}

.filters .form-group.block {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}


.user-info span, .user-info strong {

        padding: 1px;
        display: inline-block;
        transition: all 0.2s ease;
        font-size: 13px;
        white-space: nowrap;
}

.form-group textarea {
    padding: 3px;
}

@media (max-width: 900px) {
    .cal-table {
     width: 175%;   
    }

    .booking-info-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .booking-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    body.bookings-page .container {
        max-width: 100%;
    }

    .btn-cancel {
        display: block;
        margin-left: 0;
        margin-top: 10px;
        text-align: center;
    }
}

@media (max-width: 640px) {
    header {
        padding: 20px;
    }

    header h1 {
        font-size: 24px;
    }

    header h2 {
        font-size: 18px;
    }

    .header-nav {
        margin-top: 12px;
        gap: 4px;
    }

    .nav-link {
        padding: 6px 12px;
        font-size: 13px;
    }

    /* На мобильных полях времени и длительности идут друг под другом */
    .booking-time-duration-row {
        flex-direction: column;
        gap: 20px;
    }

    .booking-time-duration-row > .form-group {
        margin-bottom: 10px;
    }
}

.service-inactive-message {
    text-align: center;
    padding: 40px 20px;
}

.service-inactive-message p {
    font-size: 20px;
    color: #555;
    font-weight: 500;
    line-height: 1.6;
}