/* ============================================================
   RESET / БАЗОВОЕ
   ============================================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    /* Цвета */
    --color-primary: #6c5ce7;
    --color-primary-light: #f0edff;
    --color-success: #00b894;
    --color-success-hover: #00a381;
    --color-warning: #fdcb6e;
    --color-danger: #e17055;
    --color-danger-hover: #d63031;
    --color-text: #2d3436;
    --color-text-muted: #636e72;
    --color-border: #dfe6e9;
    --color-bg-light: #f8f9fa;
    --color-bg-info: #e8f4fd;
    --color-white: #fff;

    /* Размеры */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;

    /* Тени */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
}


/* ============================================================
   FLASH-СООБЩЕНИЯ
   ============================================================ */
.flash {
    padding: 10px 14px;
    margin: 8px 0;
    border-radius: var(--radius-md);
    font-size: 14px;
}

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

.flash-danger {
    background: #f8d7da;
    color: #721c24;
}

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

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


/* ============================================================
   ВЕРХНЯЯ ПАНЕЛЬ
   ============================================================ */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 8px;
    border-bottom: 1px solid #eaeaea;
}

.topbar__link {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.topbar__link:hover {
    background: var(--color-primary-light);
}

.topbar__user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.topbar__login {
    color: var(--color-text);
    font-weight: 500;
}

.topbar__logout-form {
    display: inline;
    margin: 0;
}

.topbar__logout-btn {
    background: none;
    border: none;
    color: var(--color-danger);
    cursor: pointer;
    text-decoration: underline;
    font-size: 14px;
    padding: 0;
}


/* ============================================================
   ФУТЕР
   ============================================================ */
.footer {
    text-align: center;
    padding: 12px;
    color: #999;
    font-size: 12px;
    border-top: 1px solid #eaeaea;
    margin-top: 20px;
}


/* ============================================================
   СЕЛЕКТ ВОДИТЕЛЯ (для админа)
   ============================================================ */
.admin-driver-select {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
    padding: 8px 12px;
    background: var(--color-bg-info);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--color-primary);
    font-size: 13px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.admin-driver-select label {
    white-space: nowrap;
    flex-shrink: 0;
    font-weight: 600;
    color: var(--color-text);
}

.admin-driver-select select {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: white;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}


/* ============================================================
   ФИО ВОДИТЕЛЯ (шапка расписания)
   ============================================================ */
.driver-header {
    text-align: center;
    margin-bottom: 12px;
    color: var(--color-text);
}

.driver-header__fio {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.driver-header__un {
    font-size: 14px;
    color: var(--color-primary);
    font-weight: 600;
    margin-top: 2px;
}


/* ============================================================
   ЛЕГЕНДА
   ============================================================ */
.legend {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 8px 12px;
    background: var(--color-bg-light);
    border-radius: var(--radius-md);
    font-size: 13px;
    white-space: nowrap;
}

.legend__item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.legend__swatch {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 3px;
    flex-shrink: 0;
}

.legend__swatch--mine {
    background: var(--color-success);
}

.legend__swatch--free {
    background: var(--color-warning);
}


/* ============================================================
   ПОДСКАЗКА (сворачиваемая)
   ============================================================ */
.hint {
    margin-top: 10px;
    background: var(--color-bg-info);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--color-primary);
    overflow: hidden;
}

.hint__summary {
    padding: 8px 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    color: var(--color-text);
    list-style: none;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hint__summary::-webkit-details-marker {
    display: none;
}

.hint__summary::after {
    content: '▾';
    margin-left: auto;
    transition: transform 0.2s;
    font-size: 12px;
    color: var(--color-primary);
}

.hint[open] .hint__summary::after {
    transform: rotate(180deg);
}

.hint__body {
    padding: 0 12px 10px 12px;
    font-size: 13px;
    color: var(--color-text);
    line-height: 1.5;
}

/* ============================================================
   ЯЧЕЙКА ТАБЛИЦЫ (базовые размеры)
   ============================================================ */
.cell-content {
    display: block;
    width: 80%;
    height: 80%;
    margin: 10% auto;
    border-radius: 6px;
    min-height: 24px;
    min-width: 24px;
    transition: all 0.2s;
}

.hint__swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    vertical-align: middle;
    margin: 0 2px;
}

.hint__swatch--mine {
    background: var(--color-success);
}

kbd {
    display: inline-block;
    padding: 1px 5px;
    border: 1px solid #ccc;
    border-radius: 3px;
    background: #f5f5f5;
    font-family: monospace;
    font-size: 11px;
}


/* ============================================================
   СОСТОЯНИЯ ЯЧЕЕК ТАБЛИЦЫ
   ============================================================ */
.cell-content.slots-mine {
    background: var(--color-success);
    color: white;
    font-size: 16px;
    font-weight: 700;
}

.cell-content.slots-free {
    background: var(--color-warning);
    color: var(--color-text);
    font-size: 14px;
    font-weight: 700;
}

.cell-content.slots-zero {
    background: var(--color-border);
    color: #b2bec3;
}

.my-booking {
    background: #e8fff4;
}

.no-slots {
    opacity: 0.5;
    cursor: not-allowed;
}


/* ============================================================
   КНОПКИ БРОНИРОВАНИЯ
   ============================================================ */
.booking-buttons {
    display: none;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
    flex-direction: row;
}

.booking-buttons.active {
    display: flex;
}

.btn {
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1 1 0;
    min-width: 0;
    color: white;
}

.btn:active {
    transform: translateY(1px);
}

.btn--primary {
    background-color: var(--color-success);
    color: white;
}

.btn--primary:hover {
    background-color: var(--color-success-hover);
}

.btn--danger {
    background-color: var(--color-danger);
    color: white;
}

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

.btn--ghost {
    background-color: var(--color-border);
    color: var(--color-text);
    flex-basis: 100%;
}

.btn--ghost:hover {
    background-color: #b2bec3;
}

/* ============================================================
   ФОРМА ВХОДА
   ============================================================ */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 0;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 30px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.login-card__title {
    text-align: center;
    font-size: 24px;
    margin-bottom: 20px;
    color: #1a1a2e;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.login-form__field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.login-form__label {
    font-weight: 600;
    font-size: 14px;
    color: #2d3436;
}

.login-form__input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #dfe6e9;
    border-radius: 6px;
    font-size: 15px;
    transition: border-color 0.2s;
}

.login-form__input:focus {
    outline: none;
    border-color: #6c5ce7;
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
}

.login-form__error {
    color: #e17055;
    font-size: 13px;
}

.login-form__actions {
    margin-top: 5px;
}

.login-form__submit {
    width: 100%;
    padding: 12px;
    background: #00b894;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.login-form__submit:hover {
    background: #00a381;
}

.login-form__submit:active {
    transform: translateY(1px);
}

.login-hint {
    margin-top: 20px;
    text-align: center;
    color: #636e72;
    font-size: 13px;
    line-height: 1.5;
}

.login-hint code {
    display: inline-block;
    padding: 1px 6px;
    background: #f5f5f5;
    border-radius: 3px;
    font-family: monospace;
    font-size: 12px;
    color: #2d3436;
}

/* Мобильная версия */
@media (max-width: 480px) {
    .login-wrapper {
        padding: 20px 0;
    }

    .login-card {
        padding: 20px 15px;
    }

    .login-card__title {
        font-size: 20px;
    }
}
