/* ==========================================================================
   FLAG Driver — Корпоративный дизайн-код АК «ФЛАГ» (100% идентичен FLAG SNO)
   Цветовая палитра: Charcoal Black / Dark Gray / Brand Red (#DC2626)
   Шрифт: Inter
   ========================================================================== */

:root {
    --bg-primary: #121214;       /* Угольный темно-серый фон */
    --bg-secondary: #1E1E22;     /* Темно-серый для карточек и блоков */
    --bg-tertiary: #2D2D34;      /* Поля ввода и второстепенные кнопки */
    --accent-color: #DC2626;     /* Фирменный авиационный красный акцент */
    --accent-hover: #B91C1C;
    --gpa-color: #38BDF8;        /* Небесно-голубой для машины в текущей смене */
    --text-primary: #F8FAFC;     /* Белый / яркий текст */
    --text-secondary: #94A3B8;   /* Приглушенный серый текст */
    --border-color: #2D2D34;     /* Бордеры */
    --error-color: #EF4444;      /* Ошибка / ТО */
    --success-color: #10B981;    /* Зеленый / Свободен */
    --warning-color: #F59E0B;    /* Оранжевый / В работе */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    width: 100%;
}

/* --- СТИЛИ АВТОРИЗАЦИИ (ИДЕНТИЧНЫ SNO) --- */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background-color: var(--bg-primary);
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 40px 30px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
}

.login-header {
    text-align: center;
    margin-bottom: 35px;
}

.company-logo {
    max-width: 160px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.logo-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 8px;
}

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

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

input[type="text"],
input[type="password"],
input[type="date"],
select,
textarea {
    width: 100%;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 15px;
    font-family: var(--font-family);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    box-sizing: border-box;
}

input[type="text"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    padding-right: 44px;
}

.btn-toggle-password {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-toggle-password:hover {
    color: var(--text-primary);
}

.error-message {
    background-color: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--error-color);
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 20px;
    text-align: center;
}

/* Кнопки */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    border: none;
    font-family: var(--font-family);
    text-decoration: none;
    box-sizing: border-box;
    gap: 8px;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: var(--accent-color);
    color: #ffffff;
}

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

.btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: #3b3b44;
}

.btn-success {
    background-color: var(--success-color);
    color: #ffffff;
}

.btn-success:hover {
    background-color: #059669;
}

.btn-warning {
    background-color: rgba(245, 158, 11, 0.2);
    border: 1px solid var(--warning-color);
    color: var(--warning-color);
}

.btn-warning:hover {
    background-color: var(--warning-color);
    color: #ffffff;
}

.btn-large {
    padding: 16px 20px;
    font-size: 16px;
}

/* --- ШАПКА ПРИЛОЖЕНИЯ (КАК В SNO) --- */
.mobile-header {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 14px;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(8px);
    width: 100%;
    box-sizing: border-box;
}

.header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

.header-logo-wrapper {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.header-logo {
    height: 24px;
    max-height: 26px;
    width: auto;
    object-fit: contain;
}

.user-info {
    display: flex;
    flex-direction: column;
    text-align: right;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    line-height: 1.25;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.user-id {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-user-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.btn-mobile-nav {
    width: auto;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 600;
    height: 32px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    flex-shrink: 0;
}

.btn-logout {
    height: 32px;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-logout:hover {
    color: var(--error-color);
    border-color: var(--error-color);
}

/* Адаптивный текст и шапка на мобильных */
.desktop-text {
    display: inline;
}
.mobile-text {
    display: none;
}

@media (max-width: 520px) {
    .mobile-header {
        padding: 8px 10px;
    }
    .header-top-row {
        gap: 6px;
    }
    .header-logo {
        height: 22px;
        max-height: 22px;
    }
    .desktop-text {
        display: none;
    }
    .mobile-text {
        display: inline;
    }
    .user-name {
        max-width: 120px;
        font-size: 12px;
    }
    .user-id {
        font-size: 10px;
    }
    .header-user-actions {
        gap: 4px;
    }
    .btn-mobile-nav,
    .btn-logout {
        height: 30px;
        padding: 0 8px;
        font-size: 11px;
        border-radius: 6px;
    }
}

@media (max-width: 380px) {
    .header-top-row {
        gap: 4px;
    }
    .header-logo {
        height: 20px;
    }
    .header-user-actions {
        gap: 4px;
    }
    .user-name {
        max-width: 85px;
        font-size: 11px;
    }
    .btn-mobile-nav,
    .btn-logout {
        height: 28px;
        padding: 0 6px;
        font-size: 11px;
    }
}

@media (max-width: 330px) {
    .user-info .user-name {
        display: none;
    }
}

/* --- СЕКЦИЯ СКАНЕРА QR НАВЕРХУ --- */
.scanner-section {
    padding: 14px 16px 8px;
    max-width: 540px;
    margin: 0 auto;
    width: 100%;
}

/* --- ВЕРТИКАЛЬНЫЕ БЛОКИ АВТОМОБИЛЕЙ (3 БЛОКА) --- */
.vehicles-viewport {
    flex: 1;
    padding: 8px 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 540px;
    width: 100%;
    margin: 0 auto;
}

/* ==========================================================================
   FLAG Driver — Бесшовная автомобильная карточка (Unibody Cockpit Card)
   Отказ от жестких складских прямоугольников в пользу цельного автомобильного силуэта
   ========================================================================== */

.vehicle-card {
    background: linear-gradient(180deg, #1C1F27 0%, #131418 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 22px;
    padding: 16px 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.45), 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
                box-shadow 0.25s ease, 
                border-color 0.25s ease;
}

.vehicle-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 36px -5px rgba(0, 0, 0, 0.55), 0 6px 16px rgba(0, 0, 0, 0.35);
    border-color: rgba(255, 255, 255, 0.15);
}

/* Верхняя световая нить статуса (вместо грубого border-left) */
.card-status-glow {
    position: absolute;
    top: 0;
    left: 8%;
    right: 8%;
    height: 2px;
    border-radius: 2px;
    filter: blur(1px);
    pointer-events: none;
    z-index: 5;
    opacity: 0.9;
}

.vehicle-card.status-free .card-status-glow {
    background: linear-gradient(90deg, transparent 0%, rgba(16, 185, 129, 0.8) 50%, transparent 100%);
}

.vehicle-card.status-busy .card-status-glow {
    background: linear-gradient(90deg, transparent 0%, rgba(245, 158, 11, 0.8) 50%, transparent 100%);
}

.vehicle-card.status-my-car .card-status-glow {
    background: linear-gradient(90deg, transparent 0%, rgba(56, 189, 248, 1) 50%, transparent 100%);
    height: 3px;
    filter: blur(1.5px);
}

.vehicle-card.status-maintenance .card-status-glow {
    background: linear-gradient(90deg, transparent 0%, rgba(239, 68, 68, 0.8) 50%, transparent 100%);
}

/* Статусные акценты контура карточки */
.vehicle-card.status-free {
    border-color: rgba(16, 185, 129, 0.25);
}

.vehicle-card.status-busy {
    border-color: rgba(245, 158, 11, 0.25);
}

.vehicle-card.status-my-car {
    border-color: rgba(56, 189, 248, 0.45);
    box-shadow: 0 12px 35px -5px rgba(0, 0, 0, 0.5), 0 0 24px rgba(56, 189, 248, 0.16);
}

.vehicle-card.status-maintenance {
    border-color: rgba(239, 68, 68, 0.25);
    opacity: 0.85;
}

/* ВЕРХ: Название, бортовой шильдик и статус */
.card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: relative;
    z-index: 4;
}

.vehicle-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.vehicle-name {
    font-size: 17.5px;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: -0.3px;
    line-height: 1.25;
}

.vehicle-code-chip {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
    padding: 2px 7px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.07);
    color: #94A3B8;
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

.status-pill {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 11px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    letter-spacing: 0.2px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.status-pill.free {
    background: rgba(16, 185, 129, 0.12);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.status-pill.busy {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning-color);
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.status-pill.my {
    background: rgba(56, 189, 248, 0.15);
    color: var(--gpa-color);
    border: 1px solid rgba(56, 189, 248, 0.45);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

.status-pill.maintenance {
    background: rgba(239, 68, 68, 0.12);
    color: var(--error-color);
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: currentColor;
    flex-shrink: 0;
}

.status-dot-pulse {
    animation: statusDotPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes statusDotPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.45;
        transform: scale(1.35);
    }
}

/* ==========================================================================
   СЕРЕДИНА: Бесшовный подиум автомобиля (Seamless Floating Stage)
   Никаких прямоугольных рамок сверху и снизу — автомобиль дышит на холсте
   ========================================================================== */
.card-stage {
    position: relative;
    width: 100%;
    height: 165px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    margin: 2px 0 4px;
    user-select: none;
}

/* Рассеянный верхний свет софтбокса */
.stage-lighting {
    position: absolute;
    top: -20px;
    left: 10%;
    right: 10%;
    height: 90px;
    background: radial-gradient(ellipse at 50% 50%, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.015) 50%, transparent 80%);
    filter: blur(10px);
    pointer-events: none;
    z-index: 1;
}

/* Тонкая линия перронного горизонта */
.stage-horizon {
    position: absolute;
    bottom: 22px;
    left: 5%;
    right: 5%;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.04) 20%, 
        rgba(255, 255, 255, 0.12) 50%, 
        rgba(255, 255, 255, 0.04) 80%, 
        transparent 100%);
    pointer-events: none;
    z-index: 1;
}

/* Мягкая контактная тень под колесами */
.stage-shadow {
    position: absolute;
    bottom: 12px;
    left: 10%;
    right: 10%;
    height: 22px;
    border-radius: 50%;
    background: radial-gradient(ellipse at 50% 50%, 
        rgba(0, 0, 0, 0.88) 0%, 
        rgba(0, 0, 0, 0.45) 45%, 
        rgba(0, 0, 0, 0.1) 70%, 
        transparent 85%);
    filter: blur(3px);
    pointer-events: none;
    z-index: 2;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
}

/* Изображение автомобиля (прозрачный PNG / SVG) */
.card-image {
    position: relative;
    z-index: 3;
    max-width: 92%;
    max-height: 140px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.6));
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), filter 0.35s ease;
}

/* Интерактивный подъем автомобиля */
.vehicle-card:hover .card-image {
    transform: translateY(-4px) scale(1.025);
    filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.75));
}

.vehicle-card:hover .stage-shadow {
    transform: scaleX(0.96) scaleY(0.92);
    opacity: 0.85;
}

/* Подсветка пола для активной машины */
.vehicle-card.status-my-car .card-stage::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 10%;
    right: 10%;
    height: 70px;
    background: radial-gradient(ellipse 70% 45% at 50% 90%, rgba(56, 189, 248, 0.15) 0%, transparent 75%);
    pointer-events: none;
    z-index: 1;
}

/* ==========================================================================
   НИЗ: Информационный островок приборной панели (Cockpit Deck)
   ========================================================================== */
.card-deck {
    background: rgba(14, 16, 21, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 11px 12px;
    display: flex;
    flex-direction: column;
    gap: 9px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

/* ==========================================================================
   РЕАЛИСТИЧНЫЙ ШТАМПОВАННЫЙ ГОСНОМЕР РФ ГОСТ Р 50577 В ПЛАСТИКОВОЙ РАМКЕ
   ========================================================================== */
.car-plate-frame {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(180deg, #18191d 0%, #0d0e11 100%);
    border: 1px solid #2a2d35;
    border-radius: 6px;
    padding: 2.5px 6px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.09);
    flex-shrink: 0;
    user-select: none;
    position: relative;
}

/* Металлические крепежные винты/болты по бокам рамки */
.plate-bolt {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #cbd5e1 0%, #64748b 60%, #1e293b 100%);
    box-shadow: 0 0.5px 1px rgba(0, 0, 0, 0.8), inset 0 0.5px 0.5px rgba(255, 255, 255, 0.7);
    flex-shrink: 0;
}

/* Белая штампованная алюминиевая пластина номера */
.plate-embossed {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(180deg, #FFFFFF 0%, #F5F6F8 50%, #DFE2E8 100%);
    border: 1.5px solid #111215;
    border-radius: 5px;
    padding: 2px 6px 2px 7px;
    height: 27px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(255, 255, 255, 0.95);
    color: #0b0c0e;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    flex-shrink: 0;
    user-select: none;
}

.plate-main-box {
    display: flex;
    align-items: baseline;
    gap: 1px;
    line-height: 1;
}

.plate-char.plate-series {
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.95), 0 -0.5px 0.5px rgba(0, 0, 0, 0.45);
}

.plate-digits {
    font-size: 16px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0.6px;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.95), 0 -0.5px 0.5px rgba(0, 0, 0, 0.45);
    margin: 0 1px;
}

/* Вертикальный штампованный разделитель */
.plate-divider {
    width: 1.2px;
    height: 18px;
    background: #18191c;
    margin: 0 4px;
    opacity: 0.85;
    flex-shrink: 0;
}

/* Секция региона */
.plate-region-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    line-height: 1;
}

.plate-region {
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.95), 0 -0.5px 0.5px rgba(0, 0, 0, 0.45);
    margin-bottom: 1.5px;
}

.plate-rus-group {
    display: flex;
    align-items: center;
    gap: 2.5px;
}

.plate-rus {
    font-size: 6.5px;
    font-weight: 900;
    letter-spacing: 0.3px;
    line-height: 1;
    color: #111;
}

.plate-flag-nano {
    width: 9px;
    height: 5.5px;
    border: 0.5px solid #666;
    display: flex;
    flex-direction: column;
    border-radius: 0.5px;
    overflow: hidden;
}

.plate-flag-nano .flag-w { height: 1.8px; background: #ffffff; }
.plate-flag-nano .flag-b { height: 1.8px; background: #0039a6; }
.plate-flag-nano .flag-r { height: 1.8px; background: #d52b1e; }

.plate-custom-box {
    padding: 0 4px;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: 0.8px;
}

/* Старый плоский бейдж (для таблиц админки) */
.plate-badge {
    background: #ffffff;
    color: #000000;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: 1px;
    padding: 2.5px 7px;
    border-radius: 5px;
    border: 2px solid #000000;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
    flex-shrink: 0;
}

/* ==========================================================================
   ИНДИКАТОРЫ ВОДИТЕЛЯ И СТАТУСА ГОТОВНОСТИ В СТРОКЕ НОМЕРА
   ========================================================================== */
.current-driver-info {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 4px 9px;
    font-size: 11.5px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
}

.current-driver-info strong {
    color: var(--text-primary);
    font-weight: 600;
}

.current-driver-info.driver-info-active {
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.3);
    color: #38bdf8;
    font-weight: 600;
}

.driver-time {
    color: var(--text-secondary);
    font-size: 10px;
    background: rgba(255, 255, 255, 0.08);
    padding: 1.5px 5px;
    border-radius: 4px;
}

.ready-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border-radius: 8px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.22);
    font-size: 11.5px;
    font-weight: 600;
    color: #6ee7b7;
}

.ready-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
    animation: statusDotPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ==========================================================================
   ПРИБОРНЫЕ HUD-ВИДЖЕТЫ: ТОПЛИВО И ПРОПУСК (Cockpit HUD Instruments)
   ========================================================================== */
.hud-instruments-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 2px;
}

.hud-widget {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.035) 0%, rgba(255, 255, 255, 0.015) 100%);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 7px 10px;
    display: flex;
    align-items: center;
    gap: 9px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.hud-widget:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.045);
}

.hud-widget-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Виджет топлива: янтарно-золотой акцент со шкалой */
.hud-widget-fuel .hud-widget-icon {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.25);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.12);
}

.hud-fuel-bars {
    display: flex;
    gap: 2px;
    align-items: center;
}

.hud-fuel-bars .hud-bar {
    width: 2.5px;
    height: 6px;
    border-radius: 1px;
    background: rgba(255, 255, 255, 0.12);
}

.hud-fuel-bars .hud-bar.active {
    background: #f59e0b;
    box-shadow: 0 0 4px rgba(245, 158, 11, 0.6);
}

/* Виджет пропуска: Аэродромный перрон */
.hud-widget-pass.pass-airfield .hud-widget-icon {
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.25);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.15);
}

.hud-widget-pass.pass-airfield .hud-status-dot {
    background: #38bdf8;
    box-shadow: 0 0 6px rgba(56, 189, 248, 0.8);
}

/* Городской допуск */
.hud-widget-pass.pass-city .hud-widget-icon {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.25);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.15);
}

.hud-widget-pass.pass-city .hud-status-dot {
    background: #10b981;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.8);
}

/* Спецпропуск */
.hud-widget-pass.pass-special .hud-widget-icon {
    background: rgba(168, 85, 247, 0.12);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.25);
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.15);
}

.hud-widget-pass.pass-special .hud-status-dot {
    background: #c084fc;
    box-shadow: 0 0 6px rgba(168, 85, 247, 0.8);
}

/* Без пропуска */
.hud-widget-pass.pass-none .hud-widget-icon {
    background: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hud-widget-pass.pass-none .hud-status-dot {
    background: #94a3b8;
}

.hud-widget-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5px;
}

.hud-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hud-widget-title {
    font-size: 8.5px;
    font-weight: 700;
    color: #8b92a2;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.hud-status-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
}

.hud-widget-value {
    font-size: 13px;
    font-weight: 700;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.2px;
}

/* ==========================================================================
   КНОПКИ ДЕЙСТВИЯ КАРТОЧКИ
   ========================================================================== */
.card-actions {
    margin-top: 2px;
}

.btn-car-action {
    height: 46px;
    font-size: 14.5px;
    font-weight: 600;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.2px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    width: 100%;
    cursor: pointer;
    box-sizing: border-box;
}

.btn-car-action svg {
    flex-shrink: 0;
}

.btn-take {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.28);
    border: none;
}

.btn-take:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.38);
}

.btn-release {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid var(--gpa-color);
    color: var(--gpa-color);
}

.btn-release:hover {
    background: rgba(56, 189, 248, 0.22);
    box-shadow: 0 4px 14px rgba(56, 189, 248, 0.25);
}

.btn-takeover {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid var(--warning-color);
    color: var(--warning-color);
}

.btn-takeover:hover {
    background: var(--warning-color);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

@media (max-width: 480px) {
    .vehicle-card {
        padding: 13px 13px 15px;
        border-radius: 20px;
    }
    .card-stage {
        height: 145px;
    }
    .card-image {
        max-height: 120px;
    }
    .plate-digits {
        font-size: 15px;
    }
    .plate-char.plate-series {
        font-size: 12px;
    }
    .plate-embossed {
        height: 25px;
        padding: 1px 3px 1px 4px;
    }
    .hud-widget {
        padding: 6px 8px;
        gap: 7px;
    }
    .hud-widget-icon {
        width: 26px;
        height: 26px;
    }
    .hud-widget-icon svg {
        width: 13px;
        height: 13px;
    }
    .hud-widget-value {
        font-size: 12px;
    }
}

@media (max-width: 360px) {
    .hud-instruments-row {
        grid-template-columns: 1fr;
    }
    .meta-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

/* --- МОДАЛЬНЫЕ ОКНА --- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-box {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 100%;
    max-width: 440px;
    padding: 24px 20px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
}

.btn-close:hover {
    color: var(--text-primary);
}

/* Сканер QR */
#reader {
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    background-color: #000;
}

/* --- TOASTS --- */
#toast-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 90%;
    max-width: 400px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-success { border-left: 4px solid var(--success-color); }
.toast-error { border-left: 4px solid var(--error-color); }
.toast-warning { border-left: 4px solid var(--warning-color); }

/* Интерактивный предпросмотр кропа автомобиля на подиуме в админке */
.crop-stage-viewport {
    position: relative;
    width: 100%;
    height: 170px;
    background: radial-gradient(ellipse at 50% 50%, #1a1c22 0%, #101115 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    user-select: none;
    touch-action: none;
}

.crop-stage-viewport:active {
    cursor: grabbing;
}

.crop-stage-viewport canvas {
    position: relative;
    z-index: 3;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

/* --- АДМИН ПАНЕЛЬ --- */
.admin-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 16px;
    width: 100%;
}

.admin-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    margin-bottom: 20px;
}

.tab-btn {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-family);
    transition: all 0.2s ease;
}

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

.admin-section { display: none; }
.admin-section.active { display: block; }

.table-responsive {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background-color: var(--bg-secondary);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.data-table th {
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    font-weight: 600;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
}

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

.data-table tr:hover td {
    background-color: #24242a;
}
