/* ============================================================
   ROOT VARIABLES
   ============================================================ */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --primary-gradient: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    
    --success: #22c55e;
    --success-light: #dcfce7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --purple: #8b5cf6;
    --purple-light: #ede9fe;
    --vk: #2787F5;
    --vk-light: #e8f0fe;
    
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    --radius: 16px;
    --radius-sm: 10px;
    --radius-full: 9999px;
    
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.15);
    
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; font-family: var(--font); background: var(--gray-100); color: var(--gray-900); overflow: hidden; }

/* ============================================================
   КАРТА
   ============================================================ */
#map { position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 1; background: #e9edf4; }
#map .leaflet-container { height: 100% !important; width: 100% !important; }
.leaflet-control-attribution { display: none !important; }
.leaflet-bottom { display: none !important; }

/* ============================================================
   ГЛАВНОЕ МЕНЮ (РАБОТАЕТ НА ВСЕХ УСТРОЙСТВАХ)
   ============================================================ */
.main-nav {
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
    right: 10px !important;
    z-index: 10000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 4px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    padding: 6px 10px !important;
    border-radius: 14px !important;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.12) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    min-height: 48px !important;
    pointer-events: auto !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
}

.nav-group {
    display: flex !important;
    align-items: center !important;
    gap: 2px !important;
}

.nav-group-left {
    flex: 0 1 auto !important;
}

.nav-group-right {
    flex: 0 1 auto !important;
}

.nav-center {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    min-width: 0 !important;
}

.nav-logo {
    font-size: 16px !important;
    font-weight: 700 !important;
    background: linear-gradient(135deg, #2563eb, #7c3aed) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    letter-spacing: -0.3px !important;
    white-space: nowrap !important;
    padding: 0 4px !important;
}

.nav-logo-icon {
    font-size: 18px !important;
    -webkit-text-fill-color: initial !important;
}

.nav-btn {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 10px !important;
    color: #475569 !important;
    cursor: pointer !important;
    transition: all 0.15s !important;
    flex-shrink: 0 !important;
}

.nav-btn:hover {
    background: rgba(37, 99, 235, 0.08) !important;
    color: #2563eb !important;
}

.nav-btn:active {
    transform: scale(0.92) !important;
}

.nav-btn svg {
    stroke: currentColor !important;
    width: 18px !important;
    height: 18px !important;
}

.nav-badge {
    position: absolute !important;
    top: -2px !important;
    right: -2px !important;
    font-size: 8px !important;
    font-weight: 700 !important;
    background: #2563eb !important;
    color: white !important;
    border-radius: 50% !important;
    min-width: 16px !important;
    height: 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 3px !important;
    border: 2px solid rgba(255, 255, 255, 0.9) !important;
}

.nav-badge-warning { background: #f59e0b !important; }
.nav-badge-orange { background: #f97316 !important; }
.nav-badge-red { background: #ef4444 !important; }
.nav-badge-filter { 
    background: #f59e0b !important;
    font-size: 7px !important;
    min-width: 14px !important;
    height: 14px !important;
    top: -1px !important;
    right: -1px !important;
    border-width: 1.5px !important;
}

.nav-divider {
    width: 1px !important;
    height: 24px !important;
    background: #e2e8f0 !important;
    margin: 0 2px !important;
    flex-shrink: 0 !important;
}

.nav-btn-auth {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 4px 14px !important;
    background: var(--primary-gradient) !important;
    color: white !important;
    border: none !important;
    border-radius: 10px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    text-decoration: none !important;
    height: 34px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    font-family: var(--font) !important;
    transition: all 0.15s !important;
}

.nav-btn-auth:hover {
    opacity: 0.9 !important;
    transform: scale(1.02) !important;
}

.nav-btn-auth:active {
    transform: scale(0.94) !important;
}

.nav-btn-auth svg {
    stroke: white !important;
    width: 16px !important;
    height: 16px !important;
}

.nav-btn-admin {
    color: #8b5cf6 !important;
}

.nav-btn-admin:hover {
    background: rgba(139, 92, 246, 0.12) !important;
    color: #7c3aed !important;
}

/* ============================================================
   ПРОФИЛЬ
   ============================================================ */
.nav-profile {
    position: relative !important;
    flex-shrink: 0 !important;
}

.nav-profile-btn {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 2px 8px 2px 2px !important;
    background: transparent !important;
    border: none !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    height: 34px !important;
    font-family: var(--font) !important;
    transition: background 0.15s !important;
}

.nav-profile-btn:hover {
    background: rgba(0, 0, 0, 0.04) !important;
}

.nav-avatar {
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    border: 2px solid rgba(37, 99, 235, 0.15) !important;
    flex-shrink: 0 !important;
}

.nav-profile-name {
    font-size: 12px !important;
    font-weight: 500 !important;
    color: #1e293b !important;
    max-width: 60px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.nav-profile-arrow {
    color: #94a3b8 !important;
    transition: transform 0.2s !important;
    flex-shrink: 0 !important;
}

.nav-profile-arrow.open {
    transform: rotate(180deg) !important;
}

/* ============================================================
   ВЫПАДАЮЩЕЕ МЕНЮ
   ============================================================ */
.nav-dropdown {
    position: absolute !important;
    top: calc(100% + 6px) !important;
    right: 0 !important;
    min-width: 200px !important;
    background: white !important;
    border-radius: 12px !important;
    padding: 6px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15) !important;
    border: 1px solid #e2e8f0 !important;
    display: none !important;
    z-index: 10001 !important;
}

.nav-dropdown.open {
    display: block !important;
}

.nav-dropdown-header {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 6px 10px 10px !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

.nav-dropdown-avatar {
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
}

.nav-dropdown-name {
    font-weight: 600 !important;
    font-size: 13px !important;
    color: #0f172a !important;
}

.nav-dropdown-id {
    font-size: 10px !important;
    color: #94a3b8 !important;
}

.nav-dropdown-divider {
    height: 1px !important;
    margin: 4px 0 !important;
    background: #e2e8f0 !important;
}

.nav-dropdown-item {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
    padding: 8px 10px !important;
    border: none !important;
    border-radius: 8px !important;
    background: transparent !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    color: #334155 !important;
    cursor: pointer !important;
    font-family: var(--font) !important;
    transition: background 0.15s !important;
}

.nav-dropdown-item:hover {
    background: #f1f5f9 !important;
}

.nav-dropdown-icon {
    font-size: 14px !important;
    width: 20px !important;
    text-align: center !important;
}

.nav-dropdown-danger {
    color: #ef4444 !important;
}

.nav-dropdown-danger:hover {
    background: #fee2e2 !important;
}

/* ============================================================
   МОБИЛЬНАЯ НИЖНЯЯ ПАНЕЛЬ (ПОКАЗЫВАЕТСЯ ТОЛЬКО НА МОБИЛЬНЫХ)
   ============================================================ */
.mobile-bottom-nav {
    position: absolute !important;
    bottom: 12px !important;
    left: 12px !important;
    right: 12px !important;
    z-index: 9999 !important;
    display: none !important;
    justify-content: space-around !important;
    align-items: center !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    padding: 6px 8px !important;
    border-radius: 16px !important;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.12) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.mobile-bottom-nav .nav-btn {
    width: 40px !important;
    height: 40px !important;
}

.mobile-bottom-nav .nav-btn svg {
    width: 20px !important;
    height: 20px !important;
}

.mobile-bottom-nav .nav-btn.active {
    background: var(--primary-gradient) !important;
    color: white !important;
}

.mobile-bottom-nav .nav-btn.active svg {
    stroke: white !important;
}

.mobile-bottom-nav .nav-badge {
    top: -1px !important;
    right: -1px !important;
    min-width: 18px !important;
    height: 18px !important;
    font-size: 9px !important;
}

/* ============================================================
   АДАПТИВ — ПОКАЗЫВАЕМ/СКРЫВАЕМ ЭЛЕМЕНТЫ
   ============================================================ */

/* Мобильные устройства (до 768px) */
@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex !important;
    }
    
    .main-nav {
        top: 8px !important;
        left: 8px !important;
        right: 8px !important;
        padding: 4px 8px !important;
        min-height: 42px !important;
        border-radius: 12px !important;
    }
    
    .nav-logo {
        font-size: 14px !important;
    }
    
    .nav-logo-icon {
        font-size: 16px !important;
    }
    
    .nav-btn {
        width: 32px !important;
        height: 32px !important;
    }
    
    .nav-btn svg {
        width: 16px !important;
        height: 16px !important;
    }
    
    .nav-badge {
        font-size: 7px !important;
        min-width: 14px !important;
        height: 14px !important;
        top: -3px !important;
        right: -3px !important;
    }
    
    .nav-badge-filter {
        min-width: 12px !important;
        height: 12px !important;
        font-size: 6px !important;
    }
    
    .nav-divider {
        height: 18px !important;
    }
    
    .nav-profile-btn {
        height: 32px !important;
        padding: 2px 6px 2px 2px !important;
    }
    
    .nav-avatar {
        width: 24px !important;
        height: 24px !important;
    }
    
    .nav-profile-name {
        font-size: 11px !important;
        max-width: 50px !important;
    }
    
    .nav-btn-auth {
        padding: 4px 10px !important;
        font-size: 11px !important;
        height: 32px !important;
        border-radius: 8px !important;
    }
    
    .nav-btn-auth svg {
        width: 14px !important;
        height: 14px !important;
    }
    
    .nav-dropdown {
        min-width: 180px !important;
        right: -8px !important;
        padding: 4px !important;
    }
    
    .nav-dropdown-item {
        font-size: 12px !important;
        padding: 6px 8px !important;
    }
}

/* Очень маленькие экраны */
@media (max-width: 400px) {
    .main-nav {
        padding: 3px 6px !important;
        min-height: 36px !important;
        top: 6px !important;
        left: 6px !important;
        right: 6px !important;
    }
    
    .nav-logo {
        font-size: 12px !important;
    }
    
    .nav-logo-icon {
        font-size: 14px !important;
    }
    
    .nav-btn {
        width: 28px !important;
        height: 28px !important;
    }
    
    .nav-btn svg {
        width: 14px !important;
        height: 14px !important;
    }
    
    .nav-profile-name {
        display: none !important;
    }
    
    .nav-profile-btn {
        padding: 2px !important;
    }
    
    .nav-avatar {
        width: 22px !important;
        height: 22px !important;
    }
    
    .nav-btn-auth {
        padding: 3px 8px !important;
        font-size: 10px !important;
        height: 28px !important;
    }
    
    .nav-btn-auth svg {
        width: 12px !important;
        height: 12px !important;
    }
    
    .nav-badge {
        font-size: 6px !important;
        min-width: 12px !important;
        height: 12px !important;
        top: -4px !important;
        right: -4px !important;
    }
    
    .nav-divider {
        height: 14px !important;
    }
    
    .mobile-bottom-nav .nav-btn {
        width: 34px !important;
        height: 34px !important;
    }
    
    .mobile-bottom-nav .nav-btn svg {
        width: 17px !important;
        height: 17px !important;
    }
}

/* Десктопы (от 769px) — нижняя панель СКРЫТА */
@media (min-width: 769px) {
    .mobile-bottom-nav {
        display: none !important;
    }
    
    .bottom-panel {
        max-width: 420px;
        left: auto;
        right: 0;
        border-radius: 16px 0 0 0;
        max-height: 70vh;
    }
    
    .bottom-panel.collapsed {
        transform: translateY(calc(100% - 56px));
    }
    
    .panel-content {
        max-height: 55vh;
    }
    
    .add-station-btn {
        bottom: 24px;
        left: 24px;
        transform: none;
    }
    
    .add-station-btn:hover {
        transform: scale(1.05);
    }
    
    .map-controls {
        bottom: 24px;
        left: 24px;
    }
    
    .map-form-overlay {
        bottom: 100px;
    }
    
    .friends-overlay,
    .notifications-overlay,
    .news-overlay {
        right: 24px;
        top: 72px;
    }
    
    .region-selector {
        top: 72px;
    }
}

/* ============================================================
   ОСТАЛЬНЫЕ СТИЛИ (ОВЕРЛЕИ, ФОРМЫ, КНОПКИ КАРТЫ)
   ============================================================ */

/* ОВЕРЛЕИ */
.news-overlay,
.friends-overlay,
.notifications-overlay {
    position: absolute;
    top: 68px;
    right: 10px;
    z-index: 9998;
    width: 380px;
    max-width: calc(100vw - 20px);
    background: white;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: none;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
    border: 1px solid #e2e8f0;
}

.news-overlay.active,
.friends-overlay.active,
.notifications-overlay.active {
    display: block;
}

.news-overlay .header,
.friends-overlay .header,
.notifications-overlay .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.news-overlay .header h3,
.friends-overlay .header h3,
.notifications-overlay .header h3 {
    font-size: 16px;
    font-weight: 700;
}

.news-overlay .close-btn,
.friends-overlay .close-btn,
.notifications-overlay .close-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #94a3b8;
    padding: 4px;
}

.news-overlay .close-btn:hover,
.friends-overlay .close-btn:hover,
.notifications-overlay .close-btn:hover {
    color: #475569;
}

/* Новости */
.news-item {
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    margin-bottom: 10px;
    cursor: pointer;
    transition: border-color 0.15s;
}

.news-item:hover {
    border-color: #2563eb;
}

.news-item .title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.news-item .preview {
    font-size: 13px;
    color: #64748b;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-item .meta {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 11px;
    color: #94a3b8;
}

.news-item .status-badge {
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
}

.news-item .status-badge.published {
    background: #dcfce7;
    color: #16a34a;
}

.news-item .status-badge.draft {
    background: #f1f5f9;
    color: #64748b;
}

/* Друзья */
.friends-overlay .search-box {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.friends-overlay .search-box input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-family: var(--font);
    outline: none;
}

.friends-overlay .search-box input:focus {
    border-color: #2563eb;
}

.friends-overlay .search-box button {
    padding: 8px 16px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.friends-overlay .tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 4px;
}

.friends-overlay .tabs button {
    flex: 1;
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    background: transparent;
    color: #64748b;
}

.friends-overlay .tabs button.active {
    background: white;
    color: #0f172a;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.friends-overlay .friend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    border-bottom: 1px solid #f1f5f9;
}

.friends-overlay .friend-item:hover {
    background: #f8fafc;
}

.friends-overlay .friend-item img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.friends-overlay .friend-item .info {
    flex: 1;
}

.friends-overlay .friend-item .name {
    font-weight: 500;
    font-size: 13px;
}

.friends-overlay .friend-item .status {
    font-size: 11px;
    color: #94a3b8;
}

.friends-overlay .friend-item .status-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-left: 4px;
}

.friends-overlay .friend-item .status-dot.online {
    background: #22c55e;
}

.friends-overlay .friend-item .status-dot.offline {
    background: #94a3b8;
}

.btn-add-friend {
    padding: 4px 12px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
}

.btn-add-friend:hover {
    opacity: 0.9;
}

.friend-item.request-item {
    background: #fef3c7;
}

.friend-item.request-item .request-actions {
    display: flex;
    gap: 4px;
}

.friend-item.request-item .btn-accept {
    padding: 4px 10px;
    background: #22c55e;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.friend-item.request-item .btn-reject {
    padding: 4px 10px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.friends-overlay .empty-state {
    text-align: center;
    color: #94a3b8;
    padding: 20px;
}

.friends-overlay .empty-state .icon {
    font-size: 32px;
    margin-bottom: 8px;
}

/* Уведомления */
.notification-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 8px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
}

.notification-item:hover {
    background: #f8fafc;
}

.notification-item.unread {
    background: #dbeafe;
}

.notification-item .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.notification-item .content {
    flex: 1;
}

.notification-item .content .text {
    font-size: 13px;
    color: #1e293b;
}

.notification-item .content .time {
    font-size: 11px;
    color: #94a3b8;
}

.notification-item .type-icon {
    font-size: 18px;
}

/* ============================================================
   КНОПКИ УПРАВЛЕНИЯ КАРТОЙ
   ============================================================ */
.map-controls {
    position: absolute;
    bottom: 100px;
    left: 12px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 6px;
    pointer-events: none;
}

.map-controls > * {
    pointer-events: auto;
}

.controls-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.map-controls .btn-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    color: #475569;
    position: relative;
}

.map-controls .btn-circle:hover {
    background: white;
    transform: scale(1.05);
}

.map-controls .btn-circle:active {
    transform: scale(0.92);
}

.map-controls .btn-circle .tooltip {
    position: absolute;
    left: 52px;
    top: 50%;
    transform: translateY(-50%);
    background: #0f172a;
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
}

.map-controls .btn-circle:hover .tooltip {
    opacity: 1;
}

.map-controls .btn-circle .distance-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #2563eb;
    color: white;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    border: 2px solid white;
    min-width: 20px;
    text-align: center;
    display: none;
}

.controls-divider {
    width: 30px;
    height: 2px;
    margin: 2px auto;
    background: #e2e8f0;
    border-radius: 1px;
    opacity: 0.3;
}

/* ============================================================
   АДМИН-КНОПКА
   ============================================================ */
.add-station-btn {
    position: absolute;
    bottom: 160px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4);
    transition: all 0.3s;
    pointer-events: auto;
    white-space: nowrap;
}

.add-station-btn:hover {
    transform: translateX(-50%) scale(1.05);
}

.add-station-btn:active {
    transform: translateX(-50%) scale(0.95);
}

.add-station-btn.active {
    display: flex;
}

.add-station-btn.adding {
    background: #f59e0b;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
}

/* ============================================================
   ФОРМА НА КАРТЕ
   ============================================================ */
.map-form-overlay {
    position: absolute;
    bottom: 180px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: 92%;
    max-width: 420px;
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 48px rgba(0, 0, 0, 0.2);
    display: none;
    max-height: 80vh;
    overflow-y: auto;
}

.map-form-overlay.active {
    display: block;
}

.map-form-overlay .close-btn {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #94a3b8;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-form-overlay .close-btn:hover {
    background: #f1f5f9;
    color: #475569;
}

.map-form-overlay .form-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.map-form-overlay .coords-info {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 16px;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 8px;
    font-family: monospace;
}

.map-form-overlay .form-group {
    margin-bottom: 12px;
}

.map-form-overlay .form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 4px;
}

.map-form-overlay .form-input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-family: var(--font);
    transition: all 0.15s;
    background: white;
}

.map-form-overlay .form-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.map-form-overlay .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.map-form-overlay .btn-primary {
    width: 100%;
    padding: 12px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.15s;
    margin-top: 4px;
}

.map-form-overlay .btn-primary:hover {
    opacity: 0.9;
}

.map-form-overlay .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================================
   НИЖНЯЯ ПАНЕЛЬ
   ============================================================ */
.bottom-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 5;
    background: white;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.08);
    max-height: 45vh;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.bottom-panel.collapsed {
    transform: translateY(calc(100% - 56px));
}

.panel-handle {
    width: 40px;
    height: 4px;
    margin: 10px auto 6px;
    background: #cbd5e1;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s;
}

.panel-handle:hover {
    background: #94a3b8;
    transform: scaleY(1.5);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px 10px;
    font-weight: 600;
    font-size: 15px;
    color: #1e293b;
}

.panel-header .count {
    font-weight: 400;
    font-size: 13px;
    color: #94a3b8;
}

.panel-content {
    padding: 0 20px 20px;
    overflow-y: auto;
    max-height: 35vh;
}

.panel-content::-webkit-scrollbar {
    width: 4px;
}

.panel-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

/* Статистика */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 12px;
}

.stat-item {
    padding: 8px 4px;
    text-align: center;
    background: #f8fafc;
    border-radius: 8px;
}

.stat-item .value {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}

.stat-item .label {
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    margin-top: 2px;
}

/* Список записей */
.record-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}

.record-item:last-child {
    border-bottom: none;
}

.record-item:hover {
    background: #f8fafc;
    margin: 0 -10px;
    padding: 10px 10px;
    border-radius: 8px;
}

.record-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    background: #f1f5f9;
}

.record-icon.verified {
    background: #dcfce7;
    color: #16a34a;
}

.record-icon.guest {
    background: #f1f5f9;
    color: #94a3b8;
}

.record-info {
    flex: 1;
    min-width: 0;
}

.record-info .name {
    font-size: 13px;
    font-weight: 500;
}

.record-info .meta {
    font-size: 11px;
    color: #94a3b8;
}

.record-price {
    font-weight: 600;
    font-size: 14px;
    color: #1e293b;
    flex-shrink: 0;
}

.record-fuel-badge {
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
}

.record-fuel-badge.yes {
    background: #dcfce7;
    color: #16a34a;
}

.record-fuel-badge.no {
    background: #fee2e2;
    color: #dc2626;
}

.record-fuel-badge.limited {
    background: #fef3c7;
    color: #d97706;
}

.record-fuel-badge.unknown {
    background: #f1f5f9;
    color: #94a3b8;
}

/* ============================================================
   СЕЛЕКТОР РЕГИОНОВ
   ============================================================ */
.region-selector {
    position: absolute;
    top: 68px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9998;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    padding: 8px 12px;
    display: none;
    max-width: 95%;
    max-height: 80vh;
    overflow-y: auto;
    min-width: 300px;
    border: 1px solid #e2e8f0;
}

.region-selector .region-group {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 4px 0;
}

.region-selector .region-group:not(:last-child) {
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 4px;
    padding-bottom: 8px;
}

.region-selector .btn-region {
    padding: 6px 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.15s;
    background: #f1f5f9;
    color: #475569;
}

.region-selector .btn-region:hover {
    transform: scale(1.05);
}

.region-selector .btn-region-all {
    background: #e2e8f0;
    font-weight: 600;
}

.region-selector .btn-region-all:hover {
    background: #cbd5e1;
}

.region-selector .btn-city {
    padding: 4px 10px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.15s;
    background: #f8fafc;
    color: #64748b;
}

.region-selector .btn-city:hover {
    background: #f1f5f9;
}

/* ============================================================
   ПОИСК ГОРОДА
   ============================================================ */
.city-search-container {
    position: absolute;
    top: 68px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9998;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    width: 320px;
    max-width: 90%;
    padding: 8px;
    border: 1px solid #e2e8f0;
}

.city-search-container input {
    width: 100%;
    padding: 10px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    font-family: var(--font);
}

.city-search-container input:focus {
    border-color: #2563eb;
}

.city-search-results {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 8px;
}

.city-search-results .result-item {
    padding: 8px 12px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
}

.city-search-results .result-item:hover {
    background: #f8fafc;
}

.city-search-results .result-item .name {
    font-weight: 500;
    font-size: 14px;
}

.city-search-results .result-item .region {
    font-size: 12px;
    color: #94a3b8;
}

/* ============================================================
   ТОСТ
   ============================================================ */
.toast {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    padding: 12px 24px;
    background: #0f172a;
    color: white;
    border-radius: 10px;
    font-size: 14px;
    font-family: var(--font);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: none;
    max-width: 92%;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ============================================================
   ТЁМНАЯ ТЕМА
   ============================================================ */
body.dark-theme {
    background: #0f172a;
}

body.dark-theme .main-nav {
    background: rgba(30, 41, 59, 0.95) !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
}

body.dark-theme .nav-btn {
    color: #94a3b8 !important;
}

body.dark-theme .nav-btn:hover {
    background: rgba(255, 255, 255, 0.06) !important;
    color: #60a5fa !important;
}

body.dark-theme .nav-divider {
    background: #334155 !important;
}

body.dark-theme .nav-profile-btn {
    color: #e2e8f0 !important;
}

body.dark-theme .nav-profile-btn:hover {
    background: rgba(255, 255, 255, 0.06) !important;
}

body.dark-theme .nav-profile-name {
    color: #e2e8f0 !important;
}

body.dark-theme .nav-dropdown {
    background: #1e293b !important;
    border-color: #334155 !important;
}

body.dark-theme .nav-dropdown-header {
    border-bottom-color: #334155 !important;
}

body.dark-theme .nav-dropdown-name {
    color: #e2e8f0 !important;
}

body.dark-theme .nav-dropdown-item {
    color: #94a3b8 !important;
}

body.dark-theme .nav-dropdown-item:hover {
    background: #334155 !important;
}

body.dark-theme .nav-dropdown-divider {
    background: #334155 !important;
}

body.dark-theme .nav-badge {
    border-color: #1e293b !important;
}

body.dark-theme .mobile-bottom-nav {
    background: rgba(30, 41, 59, 0.95) !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
}

body.dark-theme .mobile-bottom-nav .nav-btn {
    color: #94a3b8 !important;
}

body.dark-theme .mobile-bottom-nav .nav-btn.active {
    background: var(--primary-gradient) !important;
    color: white !important;
}

body.dark-theme .map-controls .btn-circle {
    background: rgba(30, 41, 59, 0.95) !important;
    border-color: #334155 !important;
    color: #94a3b8 !important;
}

body.dark-theme .map-controls .btn-circle:hover {
    background: #1e293b !important;
}

body.dark-theme .bottom-panel {
    background: #1e293b !important;
    border-top-color: #334155 !important;
}

body.dark-theme .bottom-panel .panel-header {
    color: #e2e8f0 !important;
}

body.dark-theme .bottom-panel .panel-header .count {
    color: #94a3b8 !important;
}

body.dark-theme .bottom-panel .panel-handle {
    background: #475569 !important;
}

body.dark-theme .stat-item {
    background: #334155 !important;
}

body.dark-theme .stat-item .value {
    color: #e2e8f0 !important;
}

body.dark-theme .stat-item .label {
    color: #94a3b8 !important;
}

body.dark-theme .record-item {
    border-bottom-color: #334155 !important;
}

body.dark-theme .record-item:hover {
    background: #334155 !important;
}

body.dark-theme .record-item .record-info .name {
    color: #e2e8f0 !important;
}

body.dark-theme .record-item .record-info .meta {
    color: #94a3b8 !important;
}

body.dark-theme .record-item .record-price {
    color: #e2e8f0 !important;
}

body.dark-theme .record-icon.guest {
    background: #334155 !important;
}

body.dark-theme .record-fuel-badge.yes {
    background: #064e3b !important;
    color: #4ade80 !important;
}

body.dark-theme .record-fuel-badge.no {
    background: #7f1d1d !important;
    color: #f87171 !important;
}

body.dark-theme .record-fuel-badge.limited {
    background: #78350f !important;
    color: #fbbf24 !important;
}

body.dark-theme .record-fuel-badge.unknown {
    background: #334155 !important;
    color: #94a3b8 !important;
}

body.dark-theme .map-form-overlay {
    background: #1e293b !important;
}

body.dark-theme .map-form-overlay .form-title {
    color: #e2e8f0 !important;
}

body.dark-theme .map-form-overlay .form-label {
    color: #94a3b8 !important;
}

body.dark-theme .map-form-overlay .form-input {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #e2e8f0 !important;
}

body.dark-theme .map-form-overlay .form-input:focus {
    border-color: #2563eb !important;
}

body.dark-theme .map-form-overlay .coords-info {
    background: #334155 !important;
    color: #94a3b8 !important;
}

body.dark-theme .news-overlay,
body.dark-theme .friends-overlay,
body.dark-theme .notifications-overlay {
    background: #1e293b !important;
    border-color: #334155 !important;
}

body.dark-theme .news-overlay .header h3,
body.dark-theme .friends-overlay .header h3,
body.dark-theme .notifications-overlay .header h3 {
    color: #e2e8f0 !important;
}

body.dark-theme .news-item {
    border-color: #334155 !important;
}

body.dark-theme .news-item .title {
    color: #e2e8f0 !important;
}

body.dark-theme .news-item .preview {
    color: #94a3b8 !important;
}

body.dark-theme .friends-overlay .friend-item {
    border-bottom-color: #334155 !important;
}

body.dark-theme .friends-overlay .friend-item:hover {
    background: #334155 !important;
}

body.dark-theme .friends-overlay .friend-item .name {
    color: #e2e8f0 !important;
}

body.dark-theme .friends-overlay .tabs {
    background: #334155 !important;
}

body.dark-theme .friends-overlay .tabs button {
    color: #94a3b8 !important;
}

body.dark-theme .friends-overlay .tabs button.active {
    background: #1e293b !important;
    color: #e2e8f0 !important;
}

body.dark-theme .friends-overlay .search-box input {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #e2e8f0 !important;
}

body.dark-theme .notification-item {
    border-bottom-color: #334155 !important;
}

body.dark-theme .notification-item:hover {
    background: #334155 !important;
}

body.dark-theme .notification-item.unread {
    background: #1e3a5f !important;
}

body.dark-theme .notification-item .content .text {
    color: #e2e8f0 !important;
}

body.dark-theme .region-selector {
    background: #1e293b !important;
    border-color: #334155 !important;
}

body.dark-theme .region-selector .region-group {
    border-bottom-color: #334155 !important;
}

body.dark-theme .region-selector .btn-region {
    background: #334155 !important;
    color: #94a3b8 !important;
}

body.dark-theme .region-selector .btn-region:hover {
    background: #475569 !important;
}

body.dark-theme .region-selector .btn-city {
    background: #334155 !important;
    color: #94a3b8 !important;
}

body.dark-theme .region-selector .btn-city:hover {
    background: #475569 !important;
}

body.dark-theme .city-search-container {
    background: #1e293b !important;
    border-color: #334155 !important;
}

body.dark-theme .city-search-container input {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #e2e8f0 !important;
}

body.dark-theme .city-search-results .result-item {
    border-bottom-color: #334155 !important;
}

body.dark-theme .city-search-results .result-item:hover {
    background: #334155 !important;
}

body.dark-theme .toast {
    background: #1e293b !important;
    color: #e2e8f0 !important;
}

body.dark-theme .add-station-btn {
    background: var(--primary-gradient) !important;
    color: white !important;
}

/* ============================================================
   СТАТУСЫ ДЛЯ ADMIN
   ============================================================ */
.badge-status.yes { background: #dcfce7; color: #16a34a; }
.badge-status.no { background: #fee2e2; color: #dc2626; }
.badge-status.limited { background: #fef3c7; color: #d97706; }
.badge-status.unknown { background: #f1f5f9; color: #64748b; }

body.dark-theme .badge-status.yes { background: #064e3b; color: #4ade80; }
body.dark-theme .badge-status.no { background: #7f1d1d; color: #f87171; }
body.dark-theme .badge-status.limited { background: #78350f; color: #fbbf24; }
body.dark-theme .badge-status.unknown { background: #334155; color: #94a3b8; }

/* ============================================================
   ОБЩИЕ ВСПОМОГАТЕЛЬНЫЕ КЛАССЫ
   ============================================================ */
.hidden { display: none !important; }
.text-center { text-align: center; }

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }
body.dark-theme ::-webkit-scrollbar-thumb { background: #475569; }