/* ============================================================
   ROOT VARIABLES
   ============================================================ */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --primary-gradient: linear-gradient(135deg, #2563eb 0%, #1d4ed8 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);
    
    --safe-bottom: env(safe-area-inset-bottom, 16px);
    --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; }

/* ============================================================
   ВЕРХНЯЯ ПАНЕЛЬ
   ============================================================ */
.top-bar {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}
.top-bar > * { pointer-events: auto; }

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 18px;
    color: var(--gray-900);
    box-shadow: var(--shadow);
    border: 1px solid rgba(255,255,255,0.3);
    cursor: pointer;
    transition: transform 0.2s;
}
.logo:active { transform: scale(0.96); }
.logo span { color: var(--primary); }

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow);
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
    color: var(--gray-700);
    position: relative;
    flex-shrink: 0;
}
.btn-icon:hover {
    background: rgba(255,255,255,1);
    transform: scale(1.05);
}
.btn-icon:active { transform: scale(0.95); }
.btn-icon .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 9px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border: 2px solid white;
}
.badge-count {
    position: absolute;
    top: -2px;
    right: -2px;
    font-size: 9px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border: 2px solid white;
}

.btn-text {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    text-decoration: none;
    transition: all 0.2s;
    user-select: none;
    white-space: nowrap;
}
.btn-text:hover {
    background: rgba(255,255,255,1);
    transform: scale(1.02);
}
.btn-text:active { transform: scale(0.96); }
.btn-text.primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn-text.primary:hover { background: var(--primary-dark); }
.btn-text.vk { background: var(--vk); color: white; border-color: var(--vk); }
.btn-text.vk:hover { background: #1a6bc4; }

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

.profile-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-700);
    transition: all 0.2s;
    user-select: none;
}
.profile-btn:hover {
    background: rgba(255,255,255,1);
    transform: scale(1.02);
}
.profile-btn img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.profile-btn .name-text {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.profile-btn .arrow {
    font-size: 12px;
    color: var(--gray-400);
    transition: transform 0.2s;
    flex-shrink: 0;
}
.profile-btn .arrow.open { transform: rotate(180deg); }

.profile-dropdown {
    position: absolute;
    top: 48px;
    right: 0;
    min-width: 220px;
    padding: 8px;
    background: white;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 20;
    animation: slideDown 0.2s ease;
    border: 1px solid var(--gray-200);
}
.profile-dropdown.open { display: block; }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.profile-dropdown .user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 12px 8px;
    border-bottom: 1px solid var(--gray-100);
}
.profile-dropdown .user-info img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}
.profile-dropdown .user-info .name {
    font-weight: 600;
    font-size: 14px;
}
.profile-dropdown .user-info .id {
    font-size: 11px;
    color: var(--gray-400);
}

.profile-dropdown .menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 10px;
    background: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-700);
    transition: background 0.15s;
}
.profile-dropdown .menu-item:hover { background: var(--gray-100); }
.profile-dropdown .menu-item.danger { color: var(--danger); }
.profile-dropdown .menu-item.danger:hover { background: var(--danger-light); }
.profile-dropdown .menu-item .icon { font-size: 16px; width: 24px; text-align: center; }

/* ============================================================
   КНОПКИ УПРАВЛЕНИЯ
   ============================================================ */
.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(12px);
    border: 1px solid rgba(255,255,255,0.3);
    box-shadow: var(--shadow);
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: var(--gray-700);
    position: relative;
    user-select: none;
    flex-shrink: 0;
}
.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: var(--gray-900);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 30;
}
.map-controls .btn-circle:hover .tooltip { opacity: 1; }
.map-controls .btn-circle .distance-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--primary);
    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;
}
.map-controls .btn-circle.dark { background: var(--gray-900); color: white; border-color: var(--gray-700); }
.map-controls .btn-circle.dark:hover { background: #1a1a2e; }

.controls-divider {
    width: 30px;
    height: 2px;
    margin: 2px auto;
    background: var(--gray-300);
    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: var(--radius-full);
    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: var(--warning); box-shadow: 0 4px 20px rgba(245,158,11,0.4); }

/* ============================================================
   ФОРМА ДРУЗЕЙ
   ============================================================ */
.friends-overlay {
    position: absolute;
    top: 60px;
    right: 12px;
    z-index: 15;
    width: 380px;
    max-width: 92vw;
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-lg);
    display: none;
    animation: slideDown 0.3s ease;
    max-height: 85vh;
    overflow-y: auto;
    border: 1px solid var(--gray-200);
}
.friends-overlay.active { display: block; }
.friends-overlay .header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.friends-overlay .header h3 { font-size: 16px; font-weight: 700; }
.friends-overlay .close-btn { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--gray-400); padding: 4px; }
.friends-overlay .close-btn:hover { color: var(--gray-600); }

.friends-overlay .search-box {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.friends-overlay .search-box input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 14px;
    font-family: var(--font);
    outline: none;
    transition: border-color 0.2s;
}
.friends-overlay .search-box input:focus { border-color: var(--primary); }
.friends-overlay .search-box button {
    padding: 8px 16px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.friends-overlay .search-box button:hover { opacity: 0.9; }

.friends-overlay .tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    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: var(--gray-600);
    transition: all 0.2s;
}
.friends-overlay .tabs button.active { background: white; color: var(--gray-900); box-shadow: var(--shadow); }
.friends-overlay .tabs button:hover:not(.active) { background: rgba(255,255,255,0.5); }

.friends-overlay .friend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    border-bottom: 1px solid var(--gray-100);
}
.friends-overlay .friend-item:hover { background: var(--gray-50); }
.friends-overlay .friend-item img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}
.friends-overlay .friend-item .info { flex: 1; min-width: 0; }
.friends-overlay .friend-item .name { font-weight: 500; font-size: 14px; }
.friends-overlay .friend-item .status { font-size: 12px; color: var(--gray-400); }
.friends-overlay .friend-item .online { color: var(--success); }
.friends-overlay .friend-item .offline { color: var(--gray-400); }
.friends-overlay .friend-item .share-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--gray-500);
}
.friends-overlay .friend-item .share-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--purple);
    cursor: pointer;
}
.friends-overlay .friend-item .remove-btn {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
}
.friends-overlay .friend-item .remove-btn:hover { color: var(--danger); }
.friends-overlay .friend-item .add-btn {
    padding: 4px 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}
.friends-overlay .friend-item .add-btn:hover { opacity: 0.9; }

.friends-overlay .empty-state {
    text-align: center;
    color: var(--gray-400);
    padding: 20px;
}
.friends-overlay .empty-state .icon { font-size: 32px; margin-bottom: 8px; }

.friends-overlay .search-results {
    margin-top: 8px;
    max-height: 200px;
    overflow-y: auto;
}
.friends-overlay .search-results .result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid var(--gray-100);
}
.friends-overlay .search-results .result-item:hover { background: var(--gray-50); }
.friends-overlay .search-results .result-item img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}
.friends-overlay .search-results .result-item .info { flex: 1; }
.friends-overlay .search-results .result-item .name { font-size: 13px; font-weight: 500; }
.friends-overlay .search-results .result-item .sub { font-size: 11px; color: var(--gray-400); }
.friends-overlay .search-results .result-item .add-btn {
    padding: 4px 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}
.friends-overlay .search-results .result-item .add-btn:hover { opacity: 0.9; }

/* ============================================================
   ФОРМА НА КАРТЕ
   ============================================================ */
.map-form-overlay {
    position: absolute;
    bottom: 180px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    width: 92%;
    max-width: 420px;
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-xl);
    display: none;
    animation: slideUpForm 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 80vh;
    overflow-y: auto;
}
.map-form-overlay.active { display: block; }
@keyframes slideUpForm {
    from { opacity: 0; transform: translateX(-50%) translateY(30px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.map-form-overlay .close-btn {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--gray-400);
    transition: all 0.2s;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.map-form-overlay .close-btn:hover { background: var(--gray-100); color: var(--gray-600); }
.map-form-overlay .form-title { font-size: 18px; font-weight: 700; margin-bottom: 4px; color: var(--gray-900); }
.map-form-overlay .coords-info {
    font-size: 12px;
    color: var(--gray-400);
    margin-bottom: 16px;
    padding: 8px 12px;
    background: var(--gray-50);
    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: var(--gray-600); margin-bottom: 4px; }
.map-form-overlay .form-input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    font-size: 14px;
    font-family: var(--font);
    transition: all 0.2s;
    background: white;
}
.map-form-overlay .form-input:focus { outline: none; border-color: var(--primary); 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.2s;
    margin-top: 4px;
}
.map-form-overlay .btn-primary:hover { transform: scale(1.01); 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: var(--radius) var(--radius) 0 0;
    box-shadow: 0 -4px 30px rgba(0,0,0,0.08);
    max-height: 45vh;
    transition: transform 0.4s 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: var(--gray-300);
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s;
}
.panel-handle:hover { background: var(--gray-400); 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: var(--gray-800);
}
.panel-header .count {
    font-weight: 400;
    font-size: 13px;
    color: var(--gray-400);
}

.panel-content {
    padding: 0 20px 20px;
    overflow-y: auto;
    max-height: 35vh;
    scroll-behavior: smooth;
}
.panel-content::-webkit-scrollbar { width: 4px; }
.panel-content::-webkit-scrollbar-track { background: transparent; }
.panel-content::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 2px; }

/* ============================================================
   СТАТИСТИКА
   ============================================================ */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 12px;
    padding: 4px 0;
}
.stat-item {
    padding: 8px 4px;
    text-align: center;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}
.stat-item:hover { background: var(--gray-100); }
.stat-item .value { font-size: 16px; font-weight: 700; color: var(--gray-900); line-height: 1.2; }
.stat-item .label {
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-400);
    margin-top: 2px;
}
.stat-item.help {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}
.stat-item.help .value { color: var(--success); }

/* ============================================================
   СПИСОК ЗАПИСЕЙ
   ============================================================ */
.record-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
    transition: all 0.2s;
}
.record-item:last-child { border-bottom: none; }
.record-item:hover { background: var(--gray-50); 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: var(--gray-100);
}
.record-icon.verified { background: var(--success-light); color: var(--success); }
.record-icon.guest { background: var(--gray-100); color: var(--gray-400); }

.record-info { flex: 1; min-width: 0; }
.record-info .name {
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}
.record-info .meta { font-size: 11px; color: var(--gray-400); }
.record-price { font-weight: 600; font-size: 14px; color: var(--gray-800); flex-shrink: 0; }

.record-fuel-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
}
.record-fuel-badge.yes { background: var(--success-light); color: var(--success); }
.record-fuel-badge.no { background: var(--danger-light); color: var(--danger); }
.record-fuel-badge.limited { background: var(--warning-light); color: var(--warning); }
.record-fuel-badge.unknown { background: var(--gray-100); color: var(--gray-400); }

.record-confidence {
    font-size: 11px;
    color: var(--gray-500);
    margin-left: 4px;
}
.record-confidence.high { color: var(--success); }
.record-confidence.medium { color: var(--warning); }
.record-confidence.low { color: var(--danger); }

/* ============================================================
   КАРТОЧКА ЗАПРАВКИ (как на gdebenz.ru)
   ============================================================ */
.station-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-lg);
    max-width: 380px;
    width: 100%;
    font-family: var(--font);
}

.station-card .header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 12px;
}

.station-card .name {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
}

.station-card .distance {
    font-size: 14px;
    color: var(--gray-500);
    background: var(--gray-100);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.station-card .status-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

.station-card .status-badge.yes {
    background: var(--success-light);
    color: var(--success);
}

.station-card .status-badge.no {
    background: var(--danger-light);
    color: var(--danger);
}

.station-card .status-badge.limited {
    background: var(--warning-light);
    color: var(--warning);
}

.station-card .status-badge.queue {
    background: var(--primary-light);
    color: var(--primary);
}

.station-card .status-badge.unknown {
    background: var(--gray-100);
    color: var(--gray-400);
}

.station-card .confidence-section {
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin: 12px 0;
}

.station-card .confidence-section .label {
    font-size: 12px;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.station-card .confidence-section .value {
    font-size: 28px;
    font-weight: 700;
    margin: 2px 0;
}

.station-card .confidence-section .value.high { color: var(--success); }
.station-card .confidence-section .value.medium { color: var(--warning); }
.station-card .confidence-section .value.low { color: var(--danger); }

.station-card .confidence-section .description {
    font-size: 13px;
    color: var(--gray-500);
}

.station-card .last-update {
    font-size: 12px;
    color: var(--gray-400);
    margin: 8px 0;
}

.station-card .details {
    margin: 8px 0;
    font-size: 13px;
    color: var(--gray-600);
}

.station-card .actions {
    display: flex;
    gap: 8px;
    margin: 12px 0;
}

.station-card .actions .btn-confirm {
    flex: 1;
    padding: 10px;
    border: 2px solid var(--success);
    background: white;
    color: var(--success);
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.station-card .actions .btn-confirm:hover {
    background: var(--success-light);
}

.station-card .actions .btn-change {
    flex: 1;
    padding: 10px;
    border: 2px solid var(--danger);
    background: white;
    color: var(--danger);
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.station-card .actions .btn-change:hover {
    background: var(--danger-light);
}

.station-card .history {
    margin-top: 12px;
    border-top: 1px solid var(--gray-200);
    padding-top: 12px;
}

.station-card .history .history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
    border-bottom: 1px solid var(--gray-100);
}

.station-card .history .history-item:last-child {
    border-bottom: none;
}

.station-card .history .history-item .status-label {
    font-weight: 500;
}

.station-card .history .history-item .status-label.yes { color: var(--success); }
.station-card .history .history-item .status-label.no { color: var(--danger); }
.station-card .history .history-item .status-label.limited { color: var(--warning); }

.station-card .history .history-item .time {
    color: var(--gray-400);
    font-size: 12px;
}

.station-card .route-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 12px;
}

.station-card .route-btn:hover {
    transform: scale(1.02);
    opacity: 0.9;
}

.station-card .no-station {
    text-align: center;
    padding: 20px;
    color: var(--gray-400);
}

.station-card .no-station .icon {
    font-size: 40px;
    margin-bottom: 8px;
}

.station-card .verified-badge {
    margin-top: 4px;
    font-size: 11px;
    color: var(--primary);
}

/* ============================================================
   КОНТЕКСТНОЕ МЕНЮ
   ============================================================ */
.context-menu {
    position: fixed;
    z-index: 9999;
    min-width: 200px;
    padding: 6px 0;
    background: white;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    display: none;
    border: 1px solid var(--gray-200);
    animation: slideDown 0.15s ease;
}
.context-menu.active { display: block; }

.context-menu .menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    color: var(--gray-700);
    transition: background 0.15s;
}
.context-menu .menu-item:hover { background: var(--gray-100); }
.context-menu .menu-item.danger { color: var(--danger); }
.context-menu .menu-item.danger:hover { background: var(--danger-light); }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    padding: 12px 24px;
    background: var(--gray-900);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: var(--font);
    box-shadow: var(--shadow-lg);
    display: none;
    max-width: 92%;
    text-align: center;
    animation: slideUpToast 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
}
@keyframes slideUpToast {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.auth-toast {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    padding: 16px 24px;
    background: var(--gray-900);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: var(--font);
    box-shadow: var(--shadow-lg);
    display: none;
    max-width: 92%;
    text-align: center;
    flex-direction: column;
    gap: 12px;
    animation: slideUpToast 0.3s ease;
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
}
.auth-toast .btn-vk {
    padding: 10px 24px;
    border: none;
    border-radius: 10px;
    background: #2787F5;
    color: white;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}
.auth-toast .btn-vk:hover { background: #1a6bc4; transform: scale(1.02); }

/* ============================================================
   МАРКЕРЫ
   ============================================================ */
.station-marker {
    transition: transform 0.2s;
    cursor: pointer;
}
.station-marker:hover { transform: scale(1.15); }

.cluster-marker {
    transition: transform 0.2s;
}
.cluster-marker:hover { transform: scale(1.1); }

.user-marker {
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 4px var(--primary), 0 4px 12px rgba(0,0,0,0.2); }
    50% { box-shadow: 0 0 0 10px rgba(37,99,235,0.2), 0 4px 12px rgba(0,0,0,0.2); }
    100% { box-shadow: 0 0 0 4px var(--primary), 0 4px 12px rgba(0,0,0,0.2); }
}

.friend-marker {
    animation: friendPulse 2s infinite;
}
@keyframes friendPulse {
    0% { box-shadow: 0 0 0 4px var(--purple), 0 4px 12px rgba(0,0,0,0.2); }
    50% { box-shadow: 0 0 0 12px rgba(139,92,246,0.2), 0 4px 12px rgba(0,0,0,0.2); }
    100% { box-shadow: 0 0 0 4px var(--purple), 0 4px 12px rgba(0,0,0,0.2); }
}

/* ============================================================
   ПОПАПЫ
   ============================================================ */
.station-popup .leaflet-popup-content-wrapper {
    border-radius: var(--radius);
    padding: 0;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.station-popup .leaflet-popup-content {
    margin: 0;
    padding: 0;
    width: 100% !important;
    max-width: 380px;
    min-width: 300px;
}

.station-popup .leaflet-popup-tip {
    background: white;
}

.leaflet-popup-content-wrapper {
    border-radius: var(--radius-sm) !important;
    box-shadow: var(--shadow-lg) !important;
}
.leaflet-popup-content {
    margin: 8px 12px !important;
    font-size: 13px !important;
    line-height: 1.6 !important;
    font-family: var(--font) !important;
}
.leaflet-popup-tip {
    background: white !important;
}

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

body.dark-theme .bottom-panel {
    background: #1e293b;
    color: #e2e8f0;
    border-top-color: #334155;
}
body.dark-theme .bottom-panel .panel-header { color: #e2e8f0; }
body.dark-theme .bottom-panel .panel-header .count { color: #94a3b8; }
body.dark-theme .bottom-panel .panel-handle { background: #475569; }

body.dark-theme .stat-item {
    background: #334155;
}
body.dark-theme .stat-item .value { color: #e2e8f0; }
body.dark-theme .stat-item .label { color: #94a3b8; }
body.dark-theme .stat-item:hover { background: #3d4a62; }
body.dark-theme .stat-item.help { background: #064e3b; border-color: #065f46; }
body.dark-theme .stat-item.help .value { color: #4ade80; }

body.dark-theme .record-item {
    border-bottom-color: #334155;
}
body.dark-theme .record-item:hover { background: #334155; }
body.dark-theme .record-item .record-info .name { color: #e2e8f0; }
body.dark-theme .record-item .record-info .meta { color: #94a3b8; }
body.dark-theme .record-item .record-price { color: #e2e8f0; }
body.dark-theme .record-icon.guest { background: #334155; }

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

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

body.dark-theme .map-form-overlay {
    background: #1e293b;
    color: #e2e8f0;
}
body.dark-theme .map-form-overlay .form-title { color: #e2e8f0; }
body.dark-theme .map-form-overlay .form-label { color: #94a3b8; }
body.dark-theme .map-form-overlay .form-input {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
}
body.dark-theme .map-form-overlay .form-input:focus { border-color: var(--primary); }
body.dark-theme .map-form-overlay .close-btn:hover { background: #334155; color: #e2e8f0; }
body.dark-theme .map-form-overlay .coords-info { background: #334155; }

body.dark-theme .context-menu {
    background: #1e293b;
    border-color: #334155;
}
body.dark-theme .context-menu .menu-item { color: #e2e8f0; }
body.dark-theme .context-menu .menu-item:hover { background: #334155; }
body.dark-theme .context-menu .menu-item.danger { color: #f87171; }
body.dark-theme .context-menu .menu-item.danger:hover { background: #450a0a; }

body.dark-theme .profile-btn {
    background: rgba(30,41,59,0.92);
    border-color: #334155;
    color: #e2e8f0;
}
body.dark-theme .profile-btn:hover { background: #1e293b; }

body.dark-theme .profile-dropdown {
    background: #1e293b;
    border-color: #334155;
}
body.dark-theme .profile-dropdown .user-info { border-bottom-color: #334155; }
body.dark-theme .profile-dropdown .user-info .name { color: #e2e8f0; }
body.dark-theme .profile-dropdown .user-info .id { color: #94a3b8; }
body.dark-theme .profile-dropdown .menu-item { color: #e2e8f0; }
body.dark-theme .profile-dropdown .menu-item:hover { background: #334155; }
body.dark-theme .profile-dropdown .menu-item.danger { color: #f87171; }
body.dark-theme .profile-dropdown .menu-item.danger:hover { background: #450a0a; }

body.dark-theme .logo {
    background: rgba(30,41,59,0.92);
    border-color: #334155;
    color: #e2e8f0;
}
body.dark-theme .logo span { color: #60a5fa; }

body.dark-theme .btn-icon {
    background: rgba(30,41,59,0.92);
    border-color: #334155;
    color: #e2e8f0;
}
body.dark-theme .btn-icon:hover { background: #1e293b; }

body.dark-theme .btn-text {
    background: rgba(30,41,59,0.92);
    border-color: #334155;
    color: #e2e8f0;
}
body.dark-theme .btn-text:hover { background: #1e293b; }
body.dark-theme .btn-text.primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
body.dark-theme .btn-text.vk {
    background: var(--vk);
    color: white;
    border-color: var(--vk);
}

body.dark-theme .map-controls .btn-circle {
    background: rgba(30,41,59,0.92);
    border-color: #334155;
    color: #e2e8f0;
}
body.dark-theme .map-controls .btn-circle:hover { background: #1e293b; }
body.dark-theme .map-controls .btn-circle.dark {
    background: #e2e8f0;
    color: var(--gray-900);
    border-color: #cbd5e1;
}

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

body.dark-theme .friends-overlay {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}
body.dark-theme .friends-overlay .header h3 { color: #e2e8f0; }
body.dark-theme .friends-overlay .friend-item { border-bottom-color: #334155; }
body.dark-theme .friends-overlay .friend-item:hover { background: #334155; }
body.dark-theme .friends-overlay .friend-item .name { color: #e2e8f0; }
body.dark-theme .friends-overlay .tabs { background: #334155; }
body.dark-theme .friends-overlay .tabs button { color: #94a3b8; }
body.dark-theme .friends-overlay .tabs button.active { background: #1e293b; color: #e2e8f0; }
body.dark-theme .friends-overlay .search-box input {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
}
body.dark-theme .friends-overlay .search-box input::placeholder { color: #94a3b8; }
body.dark-theme .friends-overlay .search-results .result-item { border-bottom-color: #334155; }
body.dark-theme .friends-overlay .search-results .result-item:hover { background: #334155; }
body.dark-theme .friends-overlay .close-btn { color: #94a3b8; }
body.dark-theme .friends-overlay .close-btn:hover { color: #e2e8f0; }

body.dark-theme .station-card {
    background: #1e293b;
    color: #e2e8f0;
}
body.dark-theme .station-card .name { color: #e2e8f0; }
body.dark-theme .station-card .distance {
    background: #334155;
    color: #94a3b8;
}
body.dark-theme .station-card .confidence-section { background: #334155; }
body.dark-theme .station-card .confidence-section .label { color: #94a3b8; }
body.dark-theme .station-card .confidence-section .description { color: #94a3b8; }
body.dark-theme .station-card .details { color: #94a3b8; }
body.dark-theme .station-card .last-update { color: #64748b; }
body.dark-theme .station-card .history { border-top-color: #334155; }
body.dark-theme .station-card .history .history-item { border-bottom-color: #334155; }
body.dark-theme .station-card .history .history-item .time { color: #64748b; }
body.dark-theme .station-card .actions .btn-confirm {
    border-color: #4ade80;
    color: #4ade80;
    background: transparent;
}
body.dark-theme .station-card .actions .btn-confirm:hover { background: #064e3b; }
body.dark-theme .station-card .actions .btn-change {
    border-color: #f87171;
    color: #f87171;
    background: transparent;
}
body.dark-theme .station-card .actions .btn-change:hover { background: #7f1d1d; }

body.dark-theme .station-popup .leaflet-popup-tip { background: #1e293b !important; }
body.dark-theme .leaflet-popup-content-wrapper { background: #1e293b; color: #e2e8f0; }
body.dark-theme .leaflet-popup-tip { background: #1e293b !important; }

/* ============================================================
   АДАПТИВ
   ============================================================ */
@media (max-width: 480px) {
    .top-bar { top: 8px; left: 8px; right: 8px; gap: 4px; }
    .btn-icon { width: 36px; height: 36px; font-size: 16px; }
    .btn-text { font-size: 12px; padding: 4px 10px; }
    .profile-btn { padding: 3px 10px 3px 3px; }
    .profile-btn img { width: 28px; height: 28px; }
    .profile-btn .name-text { max-width: 50px; }
    .bottom-panel { max-height: 40vh; }
    .bottom-panel.collapsed { transform: translateY(calc(100% - 50px)); }
    .panel-content { max-height: 30vh; padding: 0 16px 16px; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .map-form-overlay .form-row { grid-template-columns: 1fr; }
    .map-form-overlay { bottom: 160px; padding: 18px; }
    .map-controls { left: 8px; bottom: 80px; gap: 6px; }
    .map-controls .btn-circle { width: 38px; height: 38px; font-size: 16px; }
    .map-controls .btn-circle .tooltip { display: none; }
    .add-station-btn { padding: 8px 16px; font-size: 13px; bottom: 140px; left: 50%; transform: translateX(-50%); }
    .add-station-btn:hover { transform: translateX(-50%) scale(1.05); }
    .add-station-btn:active { transform: translateX(-50%) scale(0.95); }
    .toast { bottom: 100px; font-size: 13px; padding: 10px 18px; max-width: 96%; }
    .auth-toast { bottom: 100px; max-width: 96%; }
    .profile-dropdown { min-width: 180px; right: -10px; }
    .record-item { padding: 8px 0; }
    .record-item:hover { margin: 0 -8px; padding: 8px 8px; }
    .friends-overlay { top: 50px; right: 8px; left: 8px; width: auto; max-width: none; padding: 16px; }
    .station-card { max-width: 100%; min-width: 260px; }
    .station-card .header { flex-direction: column; gap: 8px; }
}

@media (max-width: 380px) {
    .top-bar { gap: 3px; }
    .btn-icon { width: 32px; height: 32px; font-size: 14px; }
    .btn-text { font-size: 11px; padding: 3px 8px; }
    .profile-btn { padding: 2px 8px 2px 2px; }
    .profile-btn img { width: 24px; height: 24px; }
    .profile-btn .name-text { max-width: 40px; font-size: 11px; }
    .profile-dropdown { min-width: 160px; right: -5px; }
}

@media (min-width: 768px) {
    .bottom-panel {
        max-width: 420px;
        left: auto;
        right: 0;
        border-radius: var(--radius) 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); }
    .add-station-btn:active { transform: scale(0.95); }
    .map-controls { bottom: 24px; left: 24px; }
    .map-form-overlay { bottom: 100px; }
    .friends-overlay { right: 24px; top: 70px; }
    .station-card { max-width: 380px; }
}

/* ============================================================
   ОБЩИЕ ВСПОМОГАТЕЛЬНЫЕ КЛАССЫ
   ============================================================ */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 2px; }
body.dark-theme ::-webkit-scrollbar-thumb { background: #475569; }

.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mb-8 { margin-bottom: 8px; }
.gap-8 { gap: 8px; }

/* ============================================================
   СЕЛЕКТОР РЕГИОНОВ
   ============================================================ */

.region-selector {
    position: absolute;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 8px 12px;
    display: none;
    max-width: 95%;
    max-height: 80vh;
    overflow-y: auto;
    min-width: 300px;
}

.region-selector.active {
    display: block;
}

.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 var(--gray-200);
    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.2s;
    background: var(--gray-100);
    color: var(--gray-700);
}

.region-selector .btn-region:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.region-selector .btn-region.active {
    background: var(--primary);
    color: white;
}

.region-selector .btn-region-all {
    background: var(--gray-200);
    font-weight: 600;
}

.region-selector .btn-region-all:hover {
    background: var(--gray-300);
}

.region-selector .btn-city {
    padding: 4px 10px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
    background: var(--gray-50);
    color: var(--gray-600);
}

.region-selector .btn-city:hover {
    background: var(--gray-200);
    transform: scale(1.05);
}

.region-selector .section-title {
    font-size: 11px;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 0 2px;
    width: 100%;
    text-align: center;
}

/* ============================================================
   ПОИСК ГОРОДА
   ============================================================ */

.city-search-container {
    position: absolute;
    top: 120px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    width: 320px;
    max-width: 90%;
    padding: 8px;
}

.city-search-container input {
    width: 100%;
    padding: 10px 16px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    font-family: var(--font);
}

.city-search-container input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

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

.city-search-results .result-item {
    padding: 8px 12px;
    border-bottom: 1px solid var(--gray-100);
    cursor: pointer;
    transition: background 0.15s;
}

.city-search-results .result-item:hover {
    background: var(--gray-50);
}

.city-search-results .result-item:last-child {
    border-bottom: none;
}

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

.city-search-results .result-item .region {
    font-size: 12px;
    color: var(--gray-400);
}

/* ============================================================
   ТЁМНАЯ ТЕМА ДЛЯ РЕГИОНОВ
   ============================================================ */

body.dark-theme .region-selector {
    background: var(--gray-800);
    border-color: var(--gray-700);
}

body.dark-theme .region-selector .region-group {
    border-bottom-color: var(--gray-700);
}

body.dark-theme .region-selector .btn-region {
    background: var(--gray-700);
    color: var(--gray-300);
}

body.dark-theme .region-selector .btn-region:hover {
    background: var(--gray-600);
}

body.dark-theme .region-selector .btn-region-all {
    background: var(--gray-600);
    color: var(--gray-300);
}

body.dark-theme .region-selector .btn-city {
    background: var(--gray-700);
    color: var(--gray-400);
}

body.dark-theme .region-selector .btn-city:hover {
    background: var(--gray-600);
}

body.dark-theme .city-search-container {
    background: var(--gray-800);
    border-color: var(--gray-700);
}

body.dark-theme .city-search-container input {
    background: var(--gray-700);
    border-color: var(--gray-600);
    color: var(--gray-200);
}

body.dark-theme .city-search-container input:focus {
    border-color: var(--primary);
}

body.dark-theme .city-search-results .result-item {
    border-bottom-color: var(--gray-700);
}

body.dark-theme .city-search-results .result-item:hover {
    background: var(--gray-700);
}

body.dark-theme .city-search-results .result-item .region {
    color: var(--gray-500);
}

/* ============================================================
   АДАПТИВ
   ============================================================ */

@media (max-width: 480px) {
    .region-selector {
        top: 60px;
        min-width: auto;
        width: 95%;
        padding: 8px;
    }
    
    .region-selector .btn-region {
        font-size: 11px;
        padding: 4px 10px;
    }
    
    .region-selector .btn-city {
        font-size: 10px;
        padding: 3px 8px;
    }
    
    .city-search-container {
        top: 100px;
        width: 95%;
    }
}

/* ============================================================
   НОВЫЙ СТИЛЬ ДЛЯ ДРУЗЕЙ
   ============================================================ */

/* Бэйдж с заявками */
.badge.request {
    background: var(--warning);
    color: white;
}

/* Секция заявок */
.requests-section {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 2px dashed var(--gray-200);
}

.requests-section .section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 8px;
}

.friends-section .section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 8px;
}

/* Элемент друга с заявкой */
.friend-item.request-item {
    background: var(--warning-light);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
}

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

.friend-item.request-item .btn-accept {
    padding: 4px 10px;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.friend-item.request-item .btn-accept:hover {
    background: #16a34a;
    transform: scale(1.05);
}

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

.friend-item.request-item .btn-reject:hover {
    background: #dc2626;
    transform: scale(1.05);
}

/* Кнопки в друзьях */
.friend-item .friend-actions {
    display: flex;
    gap: 4px;
}

.friend-item .btn-chat {
    padding: 4px 8px;
    background: var(--primary-light);
    color: var(--primary);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.friend-item .btn-chat:hover {
    background: var(--primary);
    color: white;
}

.friend-item .btn-remove {
    padding: 4px 8px;
    background: var(--danger-light);
    color: var(--danger);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.friend-item .btn-remove:hover {
    background: var(--danger);
    color: white;
}

/* Кнопка добавления */
.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;
    transition: all 0.2s;
}

.btn-add-friend:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

/* Статус-точка */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: 4px;
}

.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 6px rgba(34,197,94,0.5);
    animation: pulse-dot 1.5s infinite;
}

.status-dot.offline {
    background: var(--gray-400);
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Уведомления */
.notifications-overlay {
    position: absolute;
    top: 60px;
    right: 12px;
    z-index: 15;
    width: 380px;
    max-width: 92vw;
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-lg);
    max-height: 85vh;
    overflow-y: auto;
    border: 1px solid var(--gray-200);
}

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

.notification-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-sm);
    border-bottom: 1px solid var(--gray-100);
    transition: all 0.2s;
    cursor: pointer;
}

.notification-item:hover {
    background: var(--gray-50);
}

.notification-item.unread {
    background: var(--primary-light);
}

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

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

.notification-item .content .text {
    font-size: 14px;
    color: var(--gray-800);
}

.notification-item .content .time {
    font-size: 12px;
    color: var(--gray-400);
}

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

/* Тёмная тема */
body.dark-theme .friend-item.request-item {
    background: #78350f;
}

body.dark-theme .btn-chat {
    background: var(--primary-dark);
    color: var(--primary-light);
}

body.dark-theme .btn-chat:hover {
    background: var(--primary);
    color: white;
}

body.dark-theme .requests-section {
    border-bottom-color: var(--gray-700);
}

body.dark-theme .notifications-overlay {
    background: var(--gray-800);
    border-color: var(--gray-700);
}

body.dark-theme .notification-item {
    border-bottom-color: var(--gray-700);
}

body.dark-theme .notification-item:hover {
    background: var(--gray-700);
}

body.dark-theme .notification-item.unread {
    background: var(--primary-dark);
}

body.dark-theme .notification-item .content .text {
    color: var(--gray-200);
}