/* ==========================================================================
   GEOWAYAPP BRAND DESIGN SYSTEM (PREMIUM SLEEK DARK MODE)
   ========================================================================== */

:root {
    --bg-base: #03060d;
    --bg-surface: rgba(13, 22, 43, 0.75);
    --bg-card: rgba(20, 32, 60, 0.45);
    --border-color: rgba(0, 242, 254, 0.18);
    
    /* Branding Accent Colors */
    --accent: #00f2fe; /* Neon Cyan */
    --accent2: #d500f9; /* Neon Violet */
    --accent-glow: rgba(0, 242, 254, 0.4);
    --gold: #ffab00; /* Solar Gold */
    --gold-glow: rgba(255, 171, 0, 0.4);
    --text-primary: #f5f8fc;
    --text-secondary: #a1b2d4;
    --text-dim: #677b9f;
    
    /* Notification Statuses */
    --success: #00e676;
    --success-glow: rgba(0, 230, 118, 0.3);
    --warning: #ffb300;
    --danger: #ff1744;
    --danger-glow: rgba(255, 23, 68, 0.3);
    
    /* Fonts */
    --font-heading: 'Outfit', 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    /* System Shadows */
    --shadow-premium: 0 15px 35px rgba(0, 0, 0, 0.65), 
                      0 1px 2px rgba(255, 255, 255, 0.06) inset;
    --shadow-glow: 0 0 20px var(--accent-glow);
}

/* ==========================================================================
   GLOBAL RESET & UTILITIES
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--bg-base);
}

*::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
*::-webkit-scrollbar-track {
    background: var(--bg-base);
}
*::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 20px;
    border: 1px solid var(--bg-base);
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    height: 100%;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: -20%;
    left: -20%;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 242, 254, 0.08) 0%, transparent 70%);
    filter: blur(100px);
    pointer-events: none;
    z-index: -1;
    animation: floatOrb 15s infinite ease-in-out alternate;
}

body::after {
    content: '';
    position: fixed;
    bottom: -20%;
    right: -20%;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(213, 0, 249, 0.06) 0%, transparent 70%);
    filter: blur(80px);
    pointer-events: none;
    z-index: -1;
    animation: floatOrb 18s infinite ease-in-out alternate-reverse;
}

@keyframes floatOrb {
    0% {
        transform: translate(0, 0) scale(1);
    }
    100% {
        transform: translate(40px, -50px) scale(1.15);
    }
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   LAYOUT GRID STRUCTURE
   ========================================================================== */

.app-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: 100vh;
    width: 100vw;
}

/* ==========================================================================
   SIDEBAR COMPONENT
   ========================================================================== */

.sidebar {
    background: linear-gradient(180deg, #090c12 0%, #030406 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    flex-direction: column;
    padding: 25px;
    justify-content: space-between;
}

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

.brand-icon {
    font-size: 1.8rem;
    color: var(--accent);
    text-shadow: var(--shadow-glow);
}

.brand-name {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: 1.5px;
    color: var(--text-primary);
}

.brand-name span {
    color: var(--gold);
    text-shadow: 0 0 10px var(--gold-glow);
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.nav-item i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.nav-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.nav-item:hover i {
    transform: scale(1.15) rotate(5deg);
}

.nav-item.active {
    color: var(--accent);
    background: rgba(0, 242, 254, 0.05);
    border: 1px solid rgba(0, 242, 254, 0.1);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 4px;
    background: var(--accent);
    box-shadow: var(--shadow-glow);
    border-radius: 0 4px 4px 0;
}

/* Sidebar Active Tracker Card */
.active-tracker-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow-premium);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.tracker-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.pulse-indicator {
    width: 8px;
    height: 8px;
    background-color: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 0 0 var(--success-glow);
    animation: pulse 1.5s infinite;
}

.tracker-header h4 {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.tracker-id {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 15px;
    letter-spacing: 0.5px;
}

.tracker-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 12px;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    margin-bottom: 2px;
}

.stat-val {
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ==========================================================================
   MAIN WORKSPACE COMPONENT
   ========================================================================== */

.main-content {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Top Navigation Header */
.main-header {
    height: 80px;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    background: rgba(6, 7, 10, 0.8);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    z-index: 1000;
}

.header-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 10px 20px;
    border-radius: 50px;
    width: 320px;
    transition: all 0.3s ease;
}

.header-search:focus-within {
    width: 380px;
    border-color: var(--accent);
    background: rgba(0, 242, 254, 0.02);
}

.header-search i {
    color: var(--text-dim);
}

.header-search input {
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    width: 100%;
    outline: none;
}

.search-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    width: 100%;
    background: rgba(10, 15, 30, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.search-dropdown.hidden {
    display: none;
}

.search-result-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    transition: background 0.2s ease;
}

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

.search-result-item:hover {
    background: rgba(0, 242, 254, 0.1);
}

.search-result-item .item-name {
    color: #fff;
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.search-result-item .item-details {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 25px;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 50px;
}

.status-badge.online {
    background: rgba(0, 230, 118, 0.06);
    border: 1px solid rgba(0, 230, 118, 0.15);
    color: var(--success);
}

.btn-theme-toggle {
    background: linear-gradient(135deg, var(--gold) 0%, #b2902b 100%);
    color: black;
    border: none;
    padding: 10px 20px;
    font-family: var(--font-heading);
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2);
}

.btn-theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.btn-theme-toggle i {
    font-size: 0.8rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 20px;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.user-profile img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid var(--accent);
}

.user-profile span {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ==========================================================================
   DASHBOARD CONTENT GRID
   ========================================================================== */

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 30px;
    padding: 30px 40px;
    height: calc(100vh - 80px);
    overflow: hidden;
}

/* Standard Premium Glassmorphism Card styling */
.card {
    background: var(--bg-surface);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 24px;
    box-shadow: var(--shadow-premium);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

.card-header h3 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.5px;
}

.card-header h3 i {
    color: var(--accent);
}

/* ==========================================================================
   INTERACTIVE MAP PANEL
   ========================================================================== */

.map-card {
    grid-row: span 2;
    position: relative;
}

#map {
    width: 100%;
    height: 100%;
    flex-grow: 1;
    background: #0d0f14;
    z-index: 10;
}

/* Dark theme tweaks for Leaflet */
.leaflet-container {
    background: #0d0f14 !important;
    font-family: var(--font-body);
}

/* Fix missing Leaflet layers icon */
.leaflet-control-layers-toggle {
    background-image: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--accent) !important;
    width: 34px !important;
    height: 34px !important;
    background-color: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: 6px !important;
}
.leaflet-control-layers-toggle::after {
    content: "\f5fd"; /* fa-layer-group */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 1.1rem;
}
.leaflet-control-layers-expanded {
    background-color: var(--surface) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
    border-radius: 8px !important;
}

.compass-control {
    background-color: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: 50% !important;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.8) !important;
    cursor: pointer;
    position: relative;
    overflow: visible;
}
.compass-dial {
    width: 100%;
    height: 100%;
    transition: transform 0.2s ease-out;
}
.compass-forward-marker {
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 8px solid var(--gold);
    z-index: 10;
}

/* Pulse Custom Map Marker */
.map-pulse-marker {
    background: none;
    border: none;
}

.pulse-core {
    width: 14px;
    height: 14px;
    background: var(--accent);
    border: 2px solid white;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    z-index: 10;
}

.pulse-ring {
    width: 32px;
    height: 32px;
    border: 3px solid var(--accent);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: ringPulse 2s infinite ease-out;
}

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

.badge {
    background: rgba(0, 242, 254, 0.08);
    border: 1px solid rgba(0, 242, 254, 0.15);
    color: var(--accent);
    padding: 4px 10px;
    font-size: 0.75rem;
    border-radius: 4px;
    font-family: var(--font-heading);
    font-weight: 700;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: var(--accent);
    color: black;
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
}

/* ==========================================================================
   RIGHT CONSOLE / SIDEBAR PANELS
   ========================================================================== */

.sidebar-panels {
    display: flex;
    flex-direction: column;
    gap: 30px;
    overflow-y: auto;
    padding-right: 4px;
}

.control-card {
    min-height: 360px;
    flex-shrink: 0;
}

/* Telemetry statistics grid */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    padding: 20px 25px;
}

.stat-box {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 105px;
    position: relative;
    overflow: hidden;
}

.stat-box::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--accent) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-box:hover::after {
    opacity: 1;
}

.box-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.box-value-container {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-top: 5px;
}

.box-value {
    font-family: var(--font-heading);
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--text-primary);
}

.box-unit {
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* Speedometer Gauge Bar */
.gauge-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 10px;
}

.gauge-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, #007bff 100%);
    box-shadow: 0 0 10px var(--accent);
    transition: width 0.4s ease;
}

/* Custom Signal Bars */
.signal-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 16px;
    margin-top: 10px;
}

.signal-bars .bar {
    width: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.signal-bars .bar:nth-child(1) { height: 20%; }
.signal-bars .bar:nth-child(2) { height: 40%; }
.signal-bars .bar:nth-child(3) { height: 60%; }
.signal-bars .bar:nth-child(4) { height: 80%; }
.signal-bars .bar:nth-child(5) { height: 100%; }

.signal-bars .bar.active {
    background: var(--success);
}

.battery-icon {
    position: absolute;
    right: 15px;
    bottom: 15px;
    color: var(--success);
    font-size: 1.1rem;
}

/* Altitudinal graph mockup inside panel */
.graph-box {
    padding: 0 25px 25px 25px;
    margin-top: 5px;
}

.graph-title {
    display: block;
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 10px;
    text-transform: uppercase;
}

#telemetry-chart {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

/* ==========================================================================
   INTELLIGENT ROUTE PLANNER STYLE
   ========================================================================== */

.routing-inputs {
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

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

.input-row i {
    position: absolute;
    left: 18px;
    font-size: 0.95rem;
}

.input-row i.start-pin { color: var(--accent); }
.input-row i.end-pin { color: var(--danger); }

.input-row input {
    width: 100%;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 14px 14px 14px 45px;
    border-radius: 12px;
    color: white;
    font-family: var(--font-body);
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.input-row input:focus {
    border-color: var(--accent);
    background: rgba(0, 242, 254, 0.01);
    outline: none;
}

.optimization-options {
    margin-top: 5px;
}

.section-title {
    display: block;
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.radio-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.radio-btn {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.radio-btn input {
    display: none;
}

.radio-btn:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.radio-btn.active {
    background: rgba(0, 242, 254, 0.05);
    border-color: var(--accent);
    color: var(--accent);
}

.btn {
    padding: 14px 24px;
    border-radius: 12px;
    font-family: var(--font-heading);
    font-weight: 700;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
    color: black;
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    color: white;
    box-shadow: 0 6px 20px rgba(213, 0, 249, 0.45);
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--accent);
    color: var(--accent);
}

/* Route planning solution summary */
.route-summary {
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding: 25px;
    animation: slideDown 0.4s ease;
}

.route-summary h4 {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent);
    margin-bottom: 15px;
}

.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.sum-box {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    padding: 10px 15px;
}

.sum-lbl {
    display: block;
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
}

.sum-val {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.step-list {
    max-height: 180px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 5px;
}

.step-item {
    display: flex;
    gap: 12px;
    background: rgba(255, 255, 255, 0.005);
    border: 1px solid rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.step-item i {
    color: var(--accent);
    margin-top: 3px;
}

/* ==========================================================================
   VIRTUAL GEOFENCE CONSOLE
   ========================================================================== */

.panel-desc {
    padding: 20px 25px 0 25px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.geofence-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 20px 25px;
}

.geofence-actions .btn {
    font-size: 0.75rem;
    padding: 10px;
}

.geofence-list-container {
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding: 20px 25px;
}

.geofence-list-container h4 {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.fence-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.fence-item {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.03);
    padding: 12px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.fence-item:hover {
    border-color: rgba(0, 242, 254, 0.1);
    background: rgba(0, 242, 254, 0.005);
}

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

.fence-color-tag {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.fence-color-tag.circle { background: var(--accent); }
.fence-color-tag.polygon { background: var(--gold); }

.fence-name {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.fence-details {
    display: block;
    font-size: 0.7rem;
    color: var(--text-dim);
}

.btn-text-delete {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    transition: color 0.2s ease;
    font-size: 0.9rem;
    padding: 5px;
}

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

/* ==========================================================================
   ALERTS LOG CONSOLE
   ========================================================================== */

.alerts-card {
    height: 240px;
    flex-shrink: 0;
}

.btn-clear {
    background: none;
    border: none;
    color: var(--text-dim);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
    text-transform: uppercase;
}

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

.alerts-log {
    padding: 15px 25px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
}

.alert-item {
    display: flex;
    gap: 12px;
    border-radius: 12px;
    padding: 10px 15px;
    align-items: flex-start;
    animation: slideUp 0.3s ease;
}

.alert-item i {
    font-size: 0.95rem;
    margin-top: 2px;
}

.alert-item.info {
    background: rgba(0, 242, 254, 0.04);
    border: 1px solid rgba(0, 242, 254, 0.1);
    color: var(--accent);
}

.alert-item.success {
    background: rgba(0, 230, 118, 0.04);
    border: 1px solid rgba(0, 230, 118, 0.1);
    color: var(--success);
}

.alert-item.warning {
    background: rgba(255, 179, 0, 0.04);
    border: 1px solid rgba(255, 179, 0, 0.1);
    color: var(--warning);
}

.alert-item.danger {
    background: rgba(255, 23, 68, 0.04);
    border: 1px solid rgba(255, 23, 68, 0.1);
    color: var(--danger);
    box-shadow: 0 0 10px rgba(255, 23, 68, 0.05);
}

.alert-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.alert-text {
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--text-primary);
}

.alert-time {
    font-size: 0.7rem;
    color: var(--text-dim);
}

/* ==========================================================================
   ANIMATION KEYFRAMES
   ========================================================================== */

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.5);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(0, 230, 118, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 230, 118, 0);
    }
}

@keyframes ringPulse {
    0% {
        width: 14px;
        height: 14px;
        opacity: 1;
    }
    100% {
        width: 44px;
        height: 44px;
        opacity: 0;
    }
}

@keyframes slideUp {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    0% {
        opacity: 0;
        transform: translateY(-15px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.fa-spin-slow {
    animation: fa-spin 12s infinite linear;
}

/* ==========================================================================
   LIVE ADDRESS AUTOCOMPLETE SUGGESTIONS DROPDOWN
   ========================================================================== */

.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(13, 17, 28, 0.96);
    -webkit-backdrop-filter: blur(25px);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(0, 242, 254, 0.2);
    border-radius: 12px;
    margin-top: 6px;
    max-height: 240px;
    overflow-y: auto;
    z-index: 10000;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
}

.suggestion-item {
    padding: 12px 16px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.suggestion-item:hover {
    background: rgba(0, 242, 254, 0.08);
    color: var(--accent);
}

.suggestion-item i {
    color: var(--accent);
    font-size: 0.85rem;
}

/* ==========================================================================
   DESKTOP VISIBILITY FIXES
   ========================================================================== */

@media (min-width: 901px) {
    #nearby-card-mobile {
        display: none !important;
    }
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVENESS (100% MOBILE ERGONOMIC DESIGN)
   ========================================================================== */

@media (max-width: 900px) {
    body {
        overflow: hidden !important;
    }

    .app-container {
        display: flex !important;
        flex-direction: column !important;
        height: 100vh !important;
        height: 100dvh !important;
        min-height: 100vh !important;
        min-height: 100dvh !important;
        overflow: hidden !important;
    }

    /* Floating Glassmorphism Bottom Navigation for Mobile */
    .sidebar {
        position: fixed;
        bottom: 12px;
        left: 12px;
        right: 12px;
        height: 72px;
        flex-direction: row !important;
        padding: 0 15px !important;
        border-radius: 20px;
        background: rgba(9, 12, 18, 0.85) !important;
        -webkit-backdrop-filter: blur(25px) !important;
        backdrop-filter: blur(25px) !important;
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7) !important;
        z-index: 9999;
        justify-content: space-around;
        align-items: center;
        margin-bottom: 0 !important;
    }

    .brand, .active-tracker-card {
        display: none !important; /* Hide sidebar logo & status card to fit bottom row */
    }

    .nav-menu {
        flex-direction: row !important;
        width: 100%;
        justify-content: space-around;
        gap: 0 !important;
    }

    .nav-item {
        padding: 8px 10px !important;
        flex-direction: column;
        gap: 4px !important;
        font-size: 0.65rem !important;
        align-items: center;
        border: none !important;
        background: none !important;
        color: var(--text-secondary);
        flex-grow: 1;
        text-align: center;
    }

    .nav-item i {
        font-size: 1.25rem !important;
    }

    .nav-item span {
        display: block !important;
        font-weight: 600;
        font-size: 0.65rem;
    }

    .nav-item.active {
        color: var(--accent) !important;
        background: none !important;
        border: none !important;
    }

    .nav-item.active::before {
        display: none !important;
    }

    /* Main Workspace Restyling */
    .main-content {
        height: 100% !important;
        flex: 1 !important;
        min-height: 0 !important;
        overflow: hidden !important;
        display: flex;
        flex-direction: column;
    }

    .main-header {
        height: auto !important;
        padding: 15px 20px !important;
        flex-direction: column;
        gap: 12px;
        align-items: stretch !important;
        background: rgba(6, 7, 10, 0.95);
    }

    .header-search {
        width: 100% !important;
    }

    .header-actions {
        justify-content: space-between;
        width: 100%;
        gap: 10px !important;
    }
    
    #live-gps-trigger, #simulation-trigger {
        padding: 8px 16px !important;
        font-size: 0.75rem !important;
        flex-grow: 1;
        justify-content: center;
    }

    .user-profile {
        padding-left: 0 !important;
        border-left: none !important;
    }

    /* Stack grid panels vertically */
    .dashboard-grid {
        display: flex !important;
        flex-direction: column !important;
        padding: 10px !important;
        gap: 10px !important;
        height: 100% !important;
        flex: 1 !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .map-card {
        grid-row: auto !important;
        /* Let active tab display flex control height */
    }

    .sidebar-panels {
        gap: 10px !important;
    }

    .control-card {
        min-height: auto !important;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr !important;
        padding: 15px !important;
        gap: 10px !important;
    }

    .stat-box {
        height: 95px !important;
        padding: 12px !important;
    }

    .box-value {
        font-size: 1.4rem !important;
    }

    .graph-box {
        padding: 0 15px 15px 15px !important;
    }

    .radio-group {
        grid-template-columns: 1fr !important; /* Stack optimization buttons */
    }

    .geofence-actions {
        grid-template-columns: 1fr !important; /* Stack geofence draw buttons */
    }
}

/* ==========================================================================
   NAVIGATION ENGINE 3D PERSPECTIVE TILT (Google Maps CarPlay Style)
   ========================================================================== */
.map-card.navigation-active {
    /* Background override removed to keep map fullscreen */
}

.navigation-active #map {
    /* Removed aggressive 3D perspective tilt so map fills screen and controls work */
    z-index: 5;
}

#map {
    transition: transform 1.2s cubic-bezier(0.19, 1, 0.22, 1);
}

@media (max-width: 900px) {
    .app-container { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .main-header { flex-direction: column; height: auto; padding: 12px 15px; gap: 10px; }
    .header-actions { flex-wrap: wrap; justify-content: center; }
    .dashboard-grid { grid-template-columns: 1fr; overflow-y: auto; height: auto; }
}

@media (max-width: 900px) { .mobile-brand.hidden { display: flex !important; margin-bottom: 0px !important; } }

/* Mobile Fullscreen Navigation Fixes */
@media (max-width: 900px) {
    .map-card.navigation-active {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        height: 100vh !important;
        width: 100vw !important;
        z-index: 9999 !important;
        border-radius: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .navigation-active #nav-floating-header {
        top: 15px !important;
    }
}

/* Mobile Bottom Navigation Bar styling */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: rgba(13, 18, 32, 0.96);
    border-top: 1px solid rgba(0, 242, 254, 0.15);
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
    z-index: 10000;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.7rem;
    font-family: var(--font-heading);
    font-weight: 600;
    gap: 5px;
    transition: all 0.2s;
    width: 25%;
    height: 100%;
}

.mobile-nav-item i {
    font-size: 1.25rem;
}

.mobile-nav-item.active {
    color: var(--accent);
    text-shadow: 0 0 10px rgba(0, 242, 254, 0.3);
}

/* Floating Maximize Map toggle button on mobile map card */
.map-maximize-btn {
    display: none;
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 999;
    background: rgba(13, 18, 32, 0.9);
    border: 1px solid var(--accent);
    color: var(--accent);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
    transition: all 0.2s;
}
.map-maximize-btn:hover {
    transform: scale(1.05);
}

@media (max-width: 900px) {
    .mobile-bottom-nav {
        display: flex;
    }
    
    .map-maximize-btn {
        display: flex;
    }
    
    /* Full-screen app shell on mobile */
    html, body {
        height: 100%;
        overflow: hidden;
    }

    .app-container {
        height: 100vh;
        height: 100dvh; /* dynamic viewport height */
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
    .main-content {
        flex: 1;
        min-height: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
    .dashboard-grid {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        padding: 8px 8px 0 8px !important;
        gap: 0 !important;
        overflow: hidden;
    }
    
    /* Map card: hidden by default, shown when map tab active */
    .map-card {
        display: none;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        border-radius: 16px !important;
        position: relative;
    }
    .map-card.active-tab {
        display: flex;
    }

    /* Nearby card inside map-card: split vs maximized mode */
    .map-card .nearby-locations-card {
        display: none;
    }
    .map-card.split-mode #map {
        height: 55% !important;
    }
    .map-card.split-mode .nearby-locations-card {
        display: flex !important;
        height: 45% !important;
        flex-shrink: 0 !important;
        border-radius: 0 0 16px 16px !important;
        border-top: 1px solid rgba(0, 242, 254, 0.15) !important;
        background: rgba(13, 18, 32, 0.98) !important;
        box-shadow: none !important;
        border-left: none !important;
        border-right: none !important;
        border-bottom: none !important;
    }
    .map-card.maximized-mode #map,
    .map-card:not(.split-mode) #map {
        height: 100% !important;
        flex: 1;
    }
    .map-card.maximized-mode .nearby-locations-card {
        display: none !important;
    }
    
    /* Nearby tab: shown as its own scrollable view */
    .nearby-tab-view {
        display: none;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        padding-bottom: 80px;
        border-radius: 16px !important;
        background: var(--bg-surface);
        border: 1px solid rgba(255,255,255,0.04);
    }
    .nearby-tab-view.active-tab {
        display: flex;
    }
    
    /* Sidebar panels (stats, route, settings, history): hidden by default */
    .sidebar-panels {
        display: none;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        padding: 0 0 80px 0 !important;
        width: 100%;
        gap: 10px !important;
    }
    .sidebar-panels.active-tab {
        display: flex;
    }
    
    /* Cards inside sidebar panels: don't shrink */
    .control-card, .alerts-card {
        flex-shrink: 0 !important;
        min-height: auto !important;
    }
    
    /* Hide desktop nearby-locations-card inside sidebar-panels on mobile */
    .sidebar-panels .nearby-locations-card {
        display: none !important;
    }

    /* Header compaction */
    .main-header {
        padding: calc(env(safe-area-inset-top, 0px) + 10px) 15px 10px 15px !important;
        height: auto !important;
        min-height: 56px;
    }
    .header-search {
        width: 100% !important;
        flex: 1;
    }
    .status-badge {
        display: none !important;
    }
}
