/* 
    DRIVER PORTAL «ООО ПЕРВЫЙ ПАРК»
    DESIGN SYSTEM: Game UI / Blue-Cyan RP Style
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700;800&family=Outfit:wght@300;400;600;700;900&display=swap');

:root {
    /* Основные цвета компании */
    --brand-primary: #0088ff;
    --brand-accent: #00d2ff;
    --brand-glow: rgba(0, 210, 255, 0.4);
    
    /* Темный фон */
    --bg-deep: #080a12;
    --bg-surface: #121625;
    --bg-glass: rgba(18, 22, 37, 0.7);
    
    /* Текст */
    --text-main: #ffffff;
    --text-muted: #8b9bb4;
    --text-dim: #546076;

    /* Функциональные цвета */
    --success: #00e676;
    --warning: #ffb300;
    --danger: #ff1744;
    --repair: #7c4dff;

    /* Параметры UI */
    --radius-lg: 20px;
    --radius-md: 14px;
    --shadow-glow: 0 0 20px var(--brand-glow);
    --transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Fluid spacing — масштабируется при любом zoom */
    --space-xs:  clamp(4px,  0.4vw, 8px);
    --space-sm:  clamp(8px,  0.8vw, 14px);
    --space-md:  clamp(14px, 1.2vw, 20px);
    --space-lg:  clamp(20px, 2vw,   30px);
    --space-xl:  clamp(30px, 3vw,   50px);
}

html {
    width: 100%;
    height: 100%;
}

/* \u0424\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0444\u043e\u043d, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u044b\u0439 viewport \u043f\u0440\u0438 \u043b\u044e\u0431\u043e\u043c zoom */
html::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, #151b33 0%, #080a12 60%);
    z-index: -1;
}

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

body {
    background: var(--bg-deep);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    /* Фон, который всегда покрывает всю область при любом zoom */
    background: radial-gradient(circle at 50% 0%, #151b33 0%, #080a12 60%) fixed;
    background-size: 100% 100%;
}

h1, h2, h3, .brand-font {
    font-family: 'Outfit', sans-serif;
}

/* ─────────────────────────────────────────────
   LAYOUT
   ───────────────────────────────────────────── */

.app-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: clamp(10px, 2vw, 24px);
}

/* Header & Nav */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 30px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    background: none !important;
    box-shadow: none !important;
    border: none;
    width: 36px;
    height: 36px;
}

.header-logo {
    height: 36px;
    width: auto;
    object-fit: contain;
    transition: var(--transition);
}

.header-logo:hover {
    transform: scale(1.05);
}

.brand-name {
    font-weight: 900;
    font-size: clamp(1rem, 1.5vw, 1.5rem);
    letter-spacing: -0.5px;
    text-transform: uppercase;
    background: linear-gradient(to right, #fff, var(--brand-accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-bar {
    background: var(--bg-glass);
    backdrop-filter: blur(8px); /* Снизил с 12px для стабильного FPS */
    will-change: transform;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px;
    border-radius: 100px;
    display: flex;
    gap: 5px;
}

.nav-item {
    padding: clamp(7px, 0.8vw, 10px) clamp(12px, 1.5vw, 20px);
    border-radius: 100px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: clamp(0.78rem, 0.9vw, 0.9rem);
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    background: var(--brand-primary);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 136, 255, 0.4);
}

/* ─────────────────────────────────────────────
   HERO / WELCOME
   ───────────────────────────────────────────── */

.hero-card {
    background: linear-gradient(135deg, rgba(0, 136, 255, 0.1), rgba(0, 210, 255, 0.05));
    border: 1px solid rgba(0, 210, 255, 0.2);
    border-radius: var(--radius-lg);
    padding: 40px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.hero-card::after {
    content: "";
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: var(--brand-primary);
    filter: blur(120px);
    opacity: 0.2;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(0, 210, 255, 0.15);
    color: var(--brand-accent);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 12px;
    border: 1px solid rgba(0, 210, 255, 0.3);
}

.hero-title {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    margin-bottom: 10px;
}

/* ─────────────────────────────────────────────
   WIDGETS & CARDS
   ───────────────────────────────────────────── */

.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.card {
    background: var(--bg-surface);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 24px;
    transition: var(--transition);
    position: relative;
    will-change: transform; /* GPU Acceleration */
    contain: content;
}

.card:hover {
    border-color: var(--brand-primary);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.stats-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.stats-value {
    font-size: clamp(1.8rem, 2.5vw, 2.5rem);
    font-weight: 900;
    color: var(--brand-accent);
    line-height: 1;
}

.stats-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    font-weight: 700;
    margin-top: 5px;
}

/* Driver Info */
.driver-profile {
    display: flex;
    align-items: center;
    gap: 20px;
}

.driver-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--brand-accent);
    padding: 4px;
    box-shadow: var(--shadow-glow);
}

.driver-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.driver-details h2 {
    font-size: 1.4rem;
    margin-bottom: 2px;
}

.driver-rank {
    color: var(--brand-accent);
    font-weight: 700;
    font-size: 0.9rem;
}

/* ─────────────────────────────────────────────
   TABLE STYLING (LDR BRD / USERS)
   ───────────────────────────────────────────── */

.table-container {
    overflow-x: auto;
    background: var(--bg-glass);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    margin-top: 20px;
    contain: paint; /* Изоляция области отрисовки для списков */
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 16px 24px;
    color: var(--text-dim);
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

td {
    padding: 16px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 0.95rem;
}

tr {
    will-change: transform; /* Плавный скролл списков через GPU */
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.rank-badge {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(255,255,255,0.1);
}

/* Цвета по рангам */
.rank-tier-mgmt { background: rgba(255, 23, 68, 0.15); color: #ff1744; border-color: rgba(255, 23, 68, 0.3); }
.rank-tier-rs { background: rgba(124, 77, 255, 0.15); color: #7c4dff; border-color: rgba(124, 77, 255, 0.3); }
.rank-tier-staff { background: rgba(0, 210, 255, 0.15); color: #00d2ff; border-color: rgba(0, 210, 255, 0.3); }
.rank-tier-trainee { background: rgba(255, 255, 255, 0.05); color: var(--text-muted); }

.user-identity {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-small {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255,255,255,0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--brand-accent);
    font-size: 1rem;
}

.punish-box {
    display: flex;
    gap: 6px;
}

.punish-badge {
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 0.7rem;
    font-weight: 800;
    border: 1px solid transparent;
}

.pun-reprimand { background: rgba(255, 23, 68, 0.1); color: #ff1744; border-color: rgba(255, 23, 68, 0.2); }
.pun-warning { background: rgba(255, 179, 0, 0.1); color: #ffb300; border-color: rgba(255, 179, 0, 0.2); }

.activity-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-dim);
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.dot-online { background: var(--success); box-shadow: 0 0 6px var(--success); } /* Снизил радиус тени для скорости */
.dot-offline { background: var(--text-dim); }

/* Action Search Bar */
.search-bar {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 14px 20px;
    border-radius: var(--radius-md);
    color: #fff;
    font-family: inherit;
    margin-bottom: 20px;
    transition: var(--transition);
}

.search-bar:focus {
    outline: none;
    border-color: var(--brand-primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 15px rgba(0, 136, 255, 0.2);
}

/* ─────────────────────────────────────────────
   MODALS & SCHEMAS
   ───────────────────────────────────────────── */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: clamp(10px, 2vw, 20px);
}

.modal-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.close-btn:hover {
    color: #fff;
    transform: rotate(90deg);
}

.schema-img-container {
    padding: 20px;
    text-align: center;
}

.schema-img-container img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: var(--radius-md);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

/* ─────────────────────────────────────────────
   ORDERS & PENALTIES
   ───────────────────────────────────────────── */

.order-preview-box {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--brand-primary);
    border-radius: 12px;
    padding: 20px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #e0e0e0;
    white-space: pre-wrap;
    max-height: 350px;
    overflow-y: auto;
    margin-top: 10px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}

.penalty-link {
    color: var(--danger);
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
    opacity: 0.6;
    margin-left: 8px;
}

.penalty-link:hover {
    opacity: 1;
    transform: scale(1.15);
}

/* Переключатель в модалке (Segmented Control) */
.segmented-control {
    display: flex;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 5px;
    gap: 5px;
    margin-top: 10px;
}

.segment {
    flex: 1;
    padding: 12px;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.segment i {
    font-size: 0.9rem;
    opacity: 0.7;
}

.segment:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.segment.active {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 210, 255, 0.3);
}

.segment.active i {
    opacity: 1;
}

.modal-body label {
    display: block;
    margin-bottom: 10px;
    font-size: 0.75rem;
    font-family: var(--font-main);
    color: var(--brand-accent);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
}

/* Кастомные поля ввода */
.themed-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px 15px;
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
    outline: none;
    box-sizing: border-box;
}

.themed-input:focus {
    border-color: var(--brand-accent);
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.2);
    background: rgba(0, 0, 0, 0.6);
}

select.themed-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
    color-scheme: dark; /* Важно для темных выпадающих списков в Chrome */
}

/* Карточка графика */
.chart-container-card {
    background: rgba(18, 22, 37, 0.4) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-left: 4px solid var(--brand-accent) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}

.chart-container-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(0, 210, 255, 0.15) !important;
}

/* Карточки техники в "Мой Автопарк" */
.fleet-card {
    display: flex !important;
    align-items: center;
    gap: 20px;
    padding: 20px !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 12px !important;
    position: relative;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s ease, background-color 0.3s ease !important;
    overflow: hidden;
    contain: content;
}

.fleet-card:hover {
    transform: translateY(-5px);
    border-color: var(--brand-accent) !important;
    background: rgba(0, 210, 255, 0.05) !important;
    box-shadow: 0 10px 25px rgba(0, 210, 255, 0.1) !important;
}

.fleet-icon {
    width: 54px;
    height: 54px;
    background: rgba(0, 210, 255, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: var(--brand-accent);
}

.fleet-info {
    flex: 1;
}

.fleet-name {
    font-weight: 700;
    color: #fff;
    font-size: 0.95rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fleet-stats {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.fleet-badge {
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 0.65rem;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(0, 210, 255, 0.15);
    color: var(--brand-accent);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ПУЛЬС ПАРКА - ГЛОБАЛЬНАЯ СТАТИСТИКА (GLASSMORPHISM) */
.pulse-container {
    background: rgba(255, 255, 255, 0.02) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 15px !important;
    padding: 18px 30px !important;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1) !important;
}

.pulse-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.pulse-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.pulse-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.pulse-value {
    font-size: 1.2rem;
    color: #fff;
    font-weight: 800;
    font-family: var(--font-secondary);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: #ff3b30;
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 10px #ff3b30;
    margin-top: 2px;
}

.pulse-dot::after {
    content: '';
    position: absolute;
    top: -4px; left: -4px; right: -4px; bottom: -4px;
    border: 2px solid #ff3b30;
    border-radius: 50%;
    animation: live-pulse-glow 1.8s infinite ease-out;
}

@keyframes live-pulse-glow {
    0% { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(2.2); opacity: 0; }
}

.pulse-divider {
    width: 1px;
    height: 35px;
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.1), transparent);
}

@media (max-width: 768px) {
    .pulse-container {
        flex-direction: column;
        gap: 20px;
        padding: 25px !important;
        text-align: center;
    }
    .pulse-item {
        flex-direction: column;
        gap: 8px;
    }
    .pulse-divider {
        width: 60%;
        height: 1px;
        background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.05), transparent);
    }
}

/* ЗАЛ СЛАВЫ - НЕОБЫЧНОЕ ОФОРМЛЕНИЕ */
.hof-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    perspective: 1200px;
    margin-bottom: 20px;
}

.hof-card {
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 20px !important;
    padding: 35px 20px !important;
    text-align: center;
    position: relative;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.6s ease, border-color 0.4s ease !important;
    transform-style: preserve-3d;
    overflow: visible !important;
    backdrop-filter: blur(10px);
}

.hof-card:hover {
    transform: rotateX(10deg) rotateY(2deg) translateY(-15px) !important;
    border-color: var(--brand-accent) !important;
    box-shadow: 0 30px 60px rgba(0, 210, 255, 0.2) !important;
    background: rgba(0, 210, 255, 0.03) !important;
}

.hof-avatar-container {
    width: 90px;
    height: 90px;
    margin: 0 auto 20px;
    position: relative;
    transform: translateZ(40px);
}

.hof-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--brand-accent);
    box-shadow: 0 0 25px rgba(0, 210, 255, 0.3);
}

.hof-medal {
    position: absolute;
    bottom: -5px;
    right: -5px;
    background: linear-gradient(135deg, #ffd700, #ffae00);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-size: 1rem;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
    z-index: 2;
    border: 2px solid #fff;
}

.hof-title {
    font-size: 0.85rem;
    color: var(--brand-accent);
    font-weight: 900;
    letter-spacing: 2px;
    margin-bottom: 8px;
    text-transform: uppercase;
    transform: translateZ(20px);
}

.hof-name {
    font-size: 1.2rem;
    color: #fff;
    font-weight: 700;
    margin-bottom: 18px;
    transform: translateZ(25px);
}

.hof-stat {
    display: inline-block;
    padding: 10px 22px;
    background: rgba(0, 210, 255, 0.1);
    border: 1px solid rgba(0, 210, 255, 0.2);
    border-radius: 50px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    transform: translateZ(15px);
    transition: background 0.3s ease;
}

.hof-card:hover .hof-stat {
    background: var(--brand-accent);
    color: #000;
}

.hof-crown {
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2.2rem;
    color: #ffd700;
    filter: drop-shadow(0 0 8px #ffd700);
    animation: floating-crown 2.5s infinite ease-in-out;
}

@keyframes floating-crown {
    0%, 100% { transform: translateX(-50%) translateY(0) rotate(-5deg); }
    50% { transform: translateX(-50%) translateY(-8px) rotate(5deg); }
}

/* Спиннер загрузки... */
.spinner {
    padding: 12px 25px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid transparent;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.modal-btn-primary {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 210, 255, 0.3);
}

.modal-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 210, 255, 0.5);
    filter: brightness(1.1);
}

.modal-btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border-color: rgba(255, 255, 255, 0.1);
}

.modal-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: var(--brand-accent);
}

.modal-btn-danger {
    background: linear-gradient(135deg, #ff416c, #ff4b2b);
    color: #fff;
    box-shadow: 0 4px 15px rgba(255, 75, 43, 0.3);
}

.modal-btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 75, 43, 0.5);
}

.modal-content {
    background: var(--bg-surface);
    width: 100%;
    max-width: 900px;
    border-radius: 20px;
    border: 1px solid rgba(0, 210, 255, 0.3);
    overflow: hidden;
    position: relative;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 210, 255, 0.1);
}

.modal-body {
    padding: 30px;
}

/* ─────────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────────── */

@media (max-width: 900px) {
    header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .nav-bar {
        width: 100%;
        overflow-x: auto;
        justify-content: flex-start;
        border-radius: 12px;
        scrollbar-width: none;
    }
    .nav-bar::-webkit-scrollbar { display: none; }

    .grid-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .app-container {
        padding: 10px;
    }
    .hero-card {
        padding: 20px;
    }
    .modal-content {
        border-radius: 14px;
    }
    .modal-body {
        padding: 20px;
    }
}

/* ─────────────────────────────────────────────
   AUTH / LOGIN OVERLAY
   ───────────────────────────────────────────── */

.login-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(10px, 2vw, 20px);
}

.login-card {
    background: var(--bg-surface);
    width: 100%;
    max-width: 400px;
    padding: 40px;
    border-radius: 24px;
    border: 1px solid rgba(0, 210, 255, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(0, 210, 255, 0.1);
    text-align: center;
}

.login-header {
    margin-bottom: 30px;
}

.login-icon {
    font-size: 3rem;
    color: var(--brand-accent);
    margin-bottom: 15px;
    filter: drop-shadow(0 0 10px var(--brand-glow));
}

.login-header h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--brand-accent);
    opacity: 0.7;
    font-size: 1.1rem;
}

.input-group input {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px 15px 15px 50px;
    border-radius: 14px;
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
    outline: none;
}

.input-group input:focus {
    border-color: var(--brand-primary);
    background: rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 20px rgba(0, 136, 255, 0.2);
}

.full-width {
    width: 100%;
}

.login-hint {
    font-size: 0.85rem;
    color: var(--brand-accent);
    margin-bottom: 15px;
    background: rgba(0, 210, 255, 0.1);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(0, 210, 255, 0.2);
    line-height: 1.4;
}

.login-error {
    margin-top: 20px;
    padding: 12px;
    background: rgba(255, 23, 68, 0.1);
    color: #ff1744;
    border-radius: 10px;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 23, 68, 0.2);
    animation: shake 0.4s ease;
    font-weight: 600;
}

.btn-primary, .btn-success {
    padding: 16px 25px;
    border-radius: 14px;
    border: none;
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 136, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 8px 25px rgba(0, 136, 255, 0.5);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #00b0ff);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 230, 118, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 8px 25px rgba(0, 230, 118, 0.5);
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 5px;
}

.btn-text:hover {
    color: var(--brand-accent);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

/* Animation Utilities */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-in {
    animation: fadeIn 0.6s ease forwards;
}

/* Custom Scrollbar for better performance and UI flow */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.3);
}


/* ──────────────────────────────────────────────
   GLONASS MONITORING
   ────────────────────────────────────────────── */

.glonass-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-top: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.glonass-container {
    display: flex;
    height: 600px;
    background: #0d1117;
}

.glonass-map {
    flex: 1;
    position: relative;
    background-color: #161b22;
    background-image: 
        radial-gradient(circle, rgba(0, 210, 255, 0.05) 1px, transparent 1px);
    background-size: 30px 30px;
    overflow: hidden;
    cursor: grab;
}

.glonass-map:active {
    cursor: grabbing;
}

.glonass-sidebar {
    width: 280px;
    background: var(--bg-card);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
}

.sidebar-title {
    padding: 15px;
    font-size: 0.8rem;
    letter-spacing: 2px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.fleet-list {
    flex: 1;
    overflow-y: auto;
}

.fleet-item {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.2s;
    cursor: pointer;
}

.fleet-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.fleet-icon {
    width: 36px;
    height: 36px;
    background: var(--brand-primary-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-accent);
}

.fleet-info {
    display: flex;
    flex-direction: column;
}

.fleet-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.fleet-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Маркеры на карте */
.bus-marker {
    position: absolute;
    width: 24px;
    height: 24px;
    transform: translate(-50%, -50%);
    z-index: 10;
    transition: all 1s linear; /* Плавное движение */
}

.bus-icon {
    width: 100%;
    height: 100%;
    background: var(--brand-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 10px;
    box-shadow: 0 0 10px var(--brand-accent);
    border: 2px solid #fff;
}

.bus-marker:hover .bus-tooltip {
    display: block;
}

.bus-tooltip {
    display: none;
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    padding: 5px 10px;
    border-radius: 4px;
    white-space: nowrap;
    font-size: 0.8rem;
    pointer-events: none;
    border: 1px solid var(--brand-accent);
}

.glonass-live-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: bold;
    color: var(--brand-accent);
    padding: 4px 10px;
    background: rgba(0, 210, 255, 0.1);
    border-radius: 20px;
}

.map-overlay {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    color: #fff;
    pointer-events: none;
}

@media (max-width: 768px) {
    .glonass-container {
        flex-direction: column;
        height: 600px; /* Увеличим для мобайла */
    }
    .glonass-sidebar {
        width: 100%;
        height: 200px;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
    }
}

.glonass-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: rgba(13, 17, 23, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.placeholder-content {
    animation: fadeInUp 0.8s ease-out;
}

.badge-dev {
    display: inline-block;
    padding: 4px 12px;
    background: var(--brand-accent);
    color: #fff;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    letter-spacing: 1px;
    margin-top: 15px;
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.3);
}

.glonass-main-layout {
    display: flex;
    width: 100%;
    height: 100%;
}

/* ─────────────────────────────────────────────
   TOAST NOTIFICATIONS
   ───────────────────────────────────────────── */

#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: min(380px, calc(100vw - 48px));
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 18px;
    border-radius: 14px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    pointer-events: all;
    cursor: pointer;
    animation: toast-in 0.38s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    font-size: 0.88rem;
    line-height: 1.45;
    background: rgba(18, 22, 37, 0.92);
    min-width: 260px;
    overflow: hidden;
    position: relative;
}

.toast::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    border-radius: 0 0 14px 14px;
    animation: toast-progress linear forwards;
    animation-duration: inherit;
}

.toast.toast-success { border-left: 4px solid var(--success); }
.toast.toast-success::after { background: var(--success); }

.toast.toast-error { border-left: 4px solid var(--danger); }
.toast.toast-error::after { background: var(--danger); }

.toast.toast-warning { border-left: 4px solid var(--warning); }
.toast.toast-warning::after { background: var(--warning); }

.toast.toast-info { border-left: 4px solid var(--brand-accent); }
.toast.toast-info::after { background: var(--brand-accent); }

.toast-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 1px;
}
.toast.toast-success .toast-icon { color: var(--success); }
.toast.toast-error   .toast-icon { color: var(--danger); }
.toast.toast-warning .toast-icon { color: var(--warning); }
.toast.toast-info    .toast-icon { color: var(--brand-accent); }

.toast-body {
    flex: 1;
}
.toast-title {
    font-weight: 700;
    color: #fff;
    font-size: 0.9rem;
    margin-bottom: 2px;
}
.toast-msg {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
    flex-shrink: 0;
    align-self: flex-start;
}
.toast-close:hover { color: #fff; }

.toast.toast-out {
    animation: toast-out 0.3s ease forwards;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(60px) scale(0.9); }
    to   { opacity: 1; transform: translateX(0)   scale(1); }
}
@keyframes toast-out {
    from { opacity: 1; transform: translateX(0)   scale(1); max-height: 120px; margin-bottom: 0; }
    to   { opacity: 0; transform: translateX(60px) scale(0.9); max-height: 0;   margin-bottom: -10px; padding: 0; }
}
@keyframes toast-progress {
    from { width: 100%; }
    to   { width: 0%; }
}

/* Confirm dialog (нативный confirm → красивый) */
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(8px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}
.confirm-card {
    background: var(--bg-surface);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    padding: 30px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.7), 0 0 30px rgba(0,210,255,0.08);
    text-align: center;
}
.confirm-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}
.confirm-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: #fff;
    margin-bottom: 8px;
    font-family: 'Outfit', sans-serif;
}
.confirm-text {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.5;
    margin-bottom: 24px;
}
.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}
.confirm-btn-ok {
    flex: 1;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--danger), #c62828);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.9rem;
    transition: filter 0.2s, transform 0.2s;
}
.confirm-btn-ok:hover { filter: brightness(1.15); transform: translateY(-1px); }
.confirm-btn-cancel {
    flex: 1;
    padding: 12px 20px;
    background: rgba(255,255,255,0.06);
    color: var(--text-muted);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s, color 0.2s;
}
.confirm-btn-cancel:hover { background: rgba(255,255,255,0.1); color: #fff; }
