html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}
#map {
    width: 100vw;
    height: 100vh;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: transparent !important;
}
body {
    font-family: Arial, sans-serif;
    background: #f8f9fa;
    margin: 0;
    padding: 0;
}

/* Only apply margin for admin form page */
body:not(:has(#map)) {
    margin: 0;
}

h1 {
    color: #333;
}
form {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    max-width: 700px;
}
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
}
th, td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}
th {
    background: #f1f1f1;
}
button {
    padding: 6px 14px;
    border: none;
    background: #007bff;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 5px;
}
button[type="button"] {
    background: #6c757d;
}
button:hover {
    opacity: 0.9;
}
#message {
    margin-top: 10px;
    font-weight: bold;
}
a {
    color: #007bff;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
} 

/* Navigation bar styles */
.navbar {
    width: 100%;
    background: #222;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    position: relative;
    z-index: 1000;
    box-sizing: border-box;
    height: 54px;
    min-height: 0;
    padding-top: 10px;
    padding-bottom: 10px;
}

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

.navbar-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 6px;
    transition: transform 0.2s ease;
}

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

.navbar-title {
    font-size: 1.18em;
    font-weight: bold;
    letter-spacing: 1px;
    white-space: nowrap;
}

.navbar-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none !important;
    box-shadow: none;
    align-items: center;
    display: flex;
    margin: 0;
    padding: 0;
    height: 100%;
}

.filter-btn, .sidepanel-btn, .analytics-btn {
    padding: 6px 8px;
    border: 1px solid #ccc;
    background: #fff;
    color: #333;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    min-width: 36px;
    height: 36px;
    gap: 6px;
}

.analytics-btn {
    min-width: 36px;
    padding: 6px 8px;
}

.filter-btn:hover, .sidepanel-btn:hover, .analytics-btn:hover {
    background: #f8f9fa;
    border-color: #007bff;
    color: #007bff;
}

.filter-btn.active, .sidepanel-btn.active, .analytics-btn.active {
    background: #007bff;
    border-color: #007bff;
    color: #fff;
}

.navbar-search input[type="text"] {
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 1em;
    min-width: 120px;
}

.navbar-search button {
    padding: 6px 14px;
    border: none;
    background: #007bff;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    white-space: nowrap;
    min-width: 80px;
    width: 90px;
}

.navbar-search button:hover {
    background: #0056b3;
}

.navbar-login {
    color: #fff;
    background: #28a745;
    padding: 6px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.2s;
    font-size: 1em;
    white-space: nowrap;
    width: 110px;
    text-align: center;
    display: inline-block;
}

.navbar-login:hover {
    background: #218838;
}

/* Responsive Navigation */
@media (max-width: 768px) {
    .navbar {
        padding: 8px 16px;
        height: auto;
        min-height: 50px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .navbar-brand {
        order: 1;
        flex: 1;
        min-width: 0;
    }
    
    .navbar-logo {
        width: 28px;
        height: 28px;
    }
    
    .navbar-title {
        font-size: 1em;
        min-width: 0;
    }
    
    .navbar-search {
        order: 3;
        flex: 1 1 100%;
        margin-top: 8px;
        gap: 6px;
    }
    
    .filter-btn {
        min-width: 32px;
        height: 32px;
        padding: 4px 6px;
    }
    
    .navbar-search input[type="text"] {
        flex: 1;
        min-width: 0;
        font-size: 0.9em;
        padding: 5px 10px;
    }
    
    .navbar-search button {
        font-size: 0.9em;
        padding: 5px 10px;
        min-width: 70px;
        width: 80px;
    }
    
    .navbar-login {
        order: 2;
        font-size: 0.9em;
        padding: 5px 12px;
    }
}

@media (max-width: 480px) {
    .navbar {
        padding: 6px 12px;
        gap: 6px;
    }
    
    .navbar-brand {
        gap: 8px;
    }
    
    .navbar-logo {
        width: 24px;
        height: 24px;
    }
    
    .navbar-title {
        font-size: 0.9em;
    }
    
    .navbar-search {
        margin-top: 6px;
    }
    
    .navbar-search input[type="text"] {
        font-size: 0.85em;
        padding: 4px 8px;
    }
    
    .navbar-search button {
        font-size: 0.85em;
        padding: 4px 8px;
    }
    
    .navbar-login {
        font-size: 0.85em;
        padding: 4px 10px;
    }
}

@media (max-width: 360px) {
    .navbar {
        padding: 4px 8px;
    }
    
    .navbar-title {
        font-size: 0.85em;
    }
    
    .navbar-search input[type="text"] {
        font-size: 0.8em;
        padding: 3px 6px;
    }
    
    .navbar-search button {
        font-size: 0.8em;
        padding: 3px 6px;
    }
    
    .navbar-login {
        font-size: 0.8em;
        padding: 3px 8px;
    }
}

/* Clean Modern Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: #ffffff;
    margin: 8% auto;
    padding: 0;
    border-radius: 16px;
    width: 400px;
    position: relative;
    animation: modalSlideUp 0.3s ease-out;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close {
    position: absolute;
    right: 24px;
    top: 24px;
    color: #6b7280;
    font-size: 20px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

.close:hover {
    color: #374151;
    background: #f3f4f6;
    transform: scale(1.05);
}

.modal-content h2 {
    margin: 0;
    padding: 32px 32px 24px;
    color: #111827;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
}

.modal-content form {
    padding: 0 32px 32px;
}

.modal-content label {
    display: block;
    margin: 0 0 8px 0;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
    line-height: 1.4;
}

.modal-content input[type="text"],
.modal-content input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 20px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 16px;
    transition: all 0.2s ease;
    background: #ffffff;
    color: #111827;
}

.modal-content input[type="text"]:focus,
.modal-content input[type="password"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.modal-content input[type="text"]::placeholder,
.modal-content input[type="password"]::placeholder {
    color: #9ca3af;
}

.modal-content button[type="submit"] {
    width: 100%;
    padding: 12px 24px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.modal-content button[type="submit"]:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.modal-content button[type="submit"]:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
} 

/* Admin Dashboard - Minimal Modern Styles */
.admin-container {
    display: flex;
    min-height: 100vh;
    background: #f4f6f8;
    margin: 0;
    padding: 0;
}

.sidebar {
    width: 240px;
    background: #23272f;
    color: #f4f6f8;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 8px rgba(0,0,0,0.04);
    margin: 0;
    padding: 0;
    border-right: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    height: 100vh;
    min-height: 100vh;
    max-height: 100vh;
}

.sidebar-header {
    padding: 24px 20px 16px;
    border-bottom: 1px solid #2d323c;
    background: #23272f;
}

.sidebar-header h2 {
    margin: 0 0 6px 0;
    font-size: 1.3em;
    color: #fff;
    font-weight: 700;
}

.sidebar-header p {
    margin: 0;
    color: #b0b6be;
    font-size: 0.95em;
}

.sidebar-nav {
    flex: 1;
    padding: 18px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #f4f6f8;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    border-left: 3px solid transparent;
    margin: 2px 0;
    font-size: 1em;
}

.nav-item:hover {
    background: #2d323c;
    border-left-color: #3b82f6;
    color: #3b82f6;
}

.nav-item.active {
    background: #2d323c;
    border-left-color: #3b82f6;
    color: #3b82f6;
}

.sidebar .nav-item:hover, .sidebar .nav-item.active {
    text-decoration: none;
}

.nav-icon {
    margin-right: 10px;
    font-size: 1.1em;
}

.sidebar-footer {
    padding: 18px 20px;
    border-top: 1px solid #2d323c;
    background: #23272f;
}

.logout-btn {
    display: flex;
    align-items: center;
    color: #e74c3c;
    text-decoration: none;
    padding: 10px 0;
    font-weight: 600;
    transition: color 0.2s;
}

.logout-btn:hover {
    color: #c0392b;
}

.logout-btn, .logout-btn:hover {
    text-decoration: none;
}

.main-content {
    flex: 1;
    padding: 36px;
    overflow-y: auto;
    background: #f4f6f8;
    margin: 18px;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
    display: block; /* Ensure vertical stacking */
}

.locations-list-container {
    margin-top: 40px;
}

.content-header {
    margin-bottom: 32px;
    text-align: center;
}

.content-header h1 {
    margin: 0 0 8px 0;
    color: #23272f;
    font-size: 2em;
    font-weight: 700;
}

.content-header p {
    margin: 0;
    color: #6b7280;
    font-size: 1.08em;
}

#locationsForm {
    background: #fff;
    padding: 26px;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border: 1px solid #e5e7eb;
}

#locationsTable {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

#locationsTable th {
    background: #f4f6f8;
    color: #23272f;
    padding: 14px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.97em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e5e7eb;
}

#locationsTable td {
    padding: 12px;
    border-bottom: 1px solid #f1f1f1;
    background: #fff;
}

#locationsTable tr:last-child td {
    border-bottom: none;
}

#locationsTable tr:hover td {
    background: #f4f6f8;
}

#locationsTable input[type="text"],
#locationsTable input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    transition: border 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    background: #f9fafb;
}

#locationsTable input[type="text"]:focus,
#locationsTable input[type="number"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.08);
}

#locationsTable input[type="text"]::placeholder,
#locationsTable input[type="number"]::placeholder {
    color: #b0b6be;
}

.form-actions {
    margin-top: 22px;
    display: flex;
    gap: 12px;
    justify-content: center;
}

button {
    padding: 10px 22px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s, box-shadow 0.2s, color 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

button[type="submit"] {
    background: #3b82f6;
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.10);
}

button[type="submit"]:hover {
    background: #2563eb;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.13);
}

button[type="button"] {
    background: #6b7280;
    color: white;
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.10);
}

button[type="button"]:hover {
    background: #4b5563;
}

button[onclick*="removeRow"] {
    background: #e74c3c;
    color: white;
    padding: 7px 14px;
    font-size: 12px;
    box-shadow: 0 1px 4px rgba(231, 76, 60, 0.10);
}

button[onclick*="removeRow"]:hover {
    background: #c0392b;
}

#message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 6px;
    font-weight: 600;
    text-align: center;
    background: #e3f6e8;
    color: #1b5e20;
    border: 1px solid #b7e4c7;
}

@media (max-width: 1024px) {
    .sidebar {
        width: 200px;
    }
    .main-content {
        padding: 18px;
        margin: 8px;
    }
}

@media (max-width: 768px) {
    .admin-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
    }
    .main-content {
        padding: 10px;
        margin: 4px;
        border-radius: 8px;
    }
    .content-header h1 {
        font-size: 1.3em;
    }
    .form-actions {
        flex-direction: column;
        align-items: center;
    }
    button {
        width: 100%;
        max-width: 220px;
    }
} 

.maplibregl-ctrl-bottom-left .maplibregl-ctrl,
.maplibregl-ctrl-group {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

.maplibregl-ctrl-group > button {
    background: rgba(255,255,255,0.7);
    border: none;
    box-shadow: none;
    transition: background 0.2s;
}

.maplibregl-ctrl-group > button:hover {
    background: rgba(59,130,246,0.15);
} 

/* Login Form Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-box {
    background: #ffffff;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 400px;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.login-box h2 {
    margin: 0 0 30px 0;
    color: #23272f;
    font-size: 28px;
    font-weight: 700;
    text-align: center;
}

.error-message {
    background: #fee2e2;
    color: #dc2626;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #fecaca;
    font-size: 14px;
    font-weight: 500;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #374151;
    font-weight: 600;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s ease;
    box-sizing: border-box;
    background: #ffffff;
}

.form-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.login-btn {
    width: 100%;
    padding: 14px 24px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s ease;
    margin-bottom: 20px;
}

.login-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.login-btn:active {
    transform: translateY(0);
}

.login-footer {
    text-align: center;
}

.login-footer a {
    color: #6b7280;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.login-footer a:hover {
    color: #3b82f6;
}

/* Map Sidepanel Styles */
.map-sidepanel {
    position: absolute;
    top: 54px; /* Account for navbar height */
    right: 0;
    width: 340px;
    height: calc(100vh - 54px); /* Subtract navbar height */
    background: rgba(255,255,255,0.97);
    box-shadow: -2px 0 12px rgba(0,0,0,0.07);
    z-index: 1200;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #e5e7eb;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.map-sidepanel.visible {
    transform: translateX(0);
}

.sidepanel-header {
    padding: 24px 24px 12px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

/* Style preview classes */
.hybrid-preview {
    background: linear-gradient(135deg, #4a90e2 0%, #7bb3f0 50%, #2c5aa0 100%);
    width: 100%;
    height: 100%;
    border-radius: 2px;
}

.streets-preview {
    background: linear-gradient(135deg, #f4d03f 0%, #f39c12 50%, #e67e22 100%);
    width: 100%;
    height: 100%;
    border-radius: 2px;
}

.outdoor-preview {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 50%, #16a085 100%);
    width: 100%;
    height: 100%;
    border-radius: 2px;
}

.terrain-preview {
    background: linear-gradient(135deg, #8b4513 0%, #a0522d 50%, #cd853f 100%);
    width: 100%;
    height: 100%;
    border-radius: 2px;
}

.dark-preview {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 50%, #1a252f 100%);
    width: 100%;
    height: 100%;
    border-radius: 2px;
}

.light-preview {
    background: linear-gradient(135deg, #ecf0f1 0%, #bdc3c7 50%, #95a5a6 100%);
    width: 100%;
    height: 100%;
    border-radius: 2px;
}

.satellite-streets-preview {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 50%, #a93226 100%);
    width: 100%;
    height: 100%;
    border-radius: 2px;
}

.navigation-preview {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 50%, #7d3c98 100%);
    width: 100%;
    height: 100%;
    border-radius: 2px;
}

/* Map Style Selector - Bottom Right */
.map-style-selector {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    min-width: 120px;
}

/* Current Style Display */
.current-style-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 8px;
}

.current-style-display:hover {
    background: rgba(37, 99, 235, 0.1);
}

.current-style-preview {
    width: 20px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.current-style-name {
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
    flex-grow: 1;
}

.style-arrow {
    font-size: 10px;
    color: #6b7280;
    transition: transform 0.2s ease;
}

/* Style Options (Hidden by default) */
.map-style-options {
    display: none;
    flex-direction: column;
    gap: 2px;
    padding: 6px;
    border-top: 1px solid #e5e7eb;
    max-height: 250px;
    overflow-y: auto;
}

.map-style-options.visible {
    display: flex;
}

.map-style-options .style-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 70px;
}

.map-style-options .style-option:hover {
    background: rgba(37, 99, 235, 0.1);
    transform: translateX(-2px);
}

.map-style-options .style-option.active {
    background: rgba(37, 99, 235, 0.2);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.map-style-options .style-preview {
    width: 18px;
    height: 12px;
    border-radius: 2px;
    border: 1px solid #e5e7eb;
    transition: border-color 0.2s ease;
    flex-shrink: 0;
}

.map-style-options .style-option:hover .style-preview {
    border-color: #2563eb;
}

.map-style-options .style-option.active .style-preview {
    border-color: #2563eb;
}

.map-style-options span {
    font-size: 11px;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
}

/* Scrollbar styling for the style options */
.map-style-options::-webkit-scrollbar {
    width: 4px;
}

.map-style-options::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
}

.map-style-options::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 2px;
}

.map-style-options::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.5);
}
.sidepanel-header h3 {
    margin: 0 0 4px 0;
    font-size: 1.2em;
    color: #222;
}
.sidepanel-header p {
    margin: 0;
    color: #6b7280;
    font-size: 0.98em;
}

/* Sidepanel Tabs */
.sidepanel-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.tab-button {
    flex: 1;
    padding: 12px 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-bottom: 2px solid transparent;
}

.tab-button:hover {
    background: #f3f4f6;
    color: #374151;
}

.tab-button.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    background: #eff6ff;
}

.tab-icon {
    font-size: 16px;
}

/* Tab Content */
.tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
}

.tab-content.active {
    display: block;
}

/* Legend Tab Styles */
.legend-content {
    padding: 20px;
}

.legend-content h4 {
    margin: 0 0 16px 0;
    color: #374151;
    font-size: 16px;
    font-weight: 600;
}

#sidepanel-legend-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f9fafb;
    border-radius: 6px;
    border-left: 3px solid transparent;
}

.legend-item:hover {
    background: #f3f4f6;
}

.sidepanel-list {
    flex: 1;
    overflow-y: auto;
    list-style: none;
    margin: 0;
    padding: 16px 0 16px 0;
}

.sidepanel-list li {
    padding: 14px 24px;
    border-bottom: 1px solid #f1f1f1;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sidepanel-list li:last-child {
    border-bottom: none;
}
.sidepanel-list li:hover {
    background: #f3f4f6;
}

.sidepanel-pin-title {
    font-weight: 600;
    color: #2563eb;
    font-size: 1.05em;
    margin-bottom: 2px;
}
.sidepanel-pin-desc {
    color: #374151;
    font-size: 0.97em;
    margin-bottom: 0;
}

@media (max-width: 900px) {
    .map-sidepanel {
        width: 100vw;
        height: 220px;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        border-left: none;
        border-top: 1px solid #e5e7eb;
        flex-direction: column;
        box-shadow: 0 -2px 12px rgba(0,0,0,0.07);
    }
    .sidepanel-header {
        padding: 16px 16px 8px 16px;
    }
    .sidepanel-list {
        padding: 8px 0 8px 0;
    }
    .sidepanel-list li {
        padding: 10px 16px;
    }
} 

.locations-form-container {
    background: #fff;
    padding: 32px 24px 24px 24px;
    border-radius: 18px;
    box-shadow: 0 6px 32px rgba(0,0,0,0.10);
    max-width: 900px;
    margin: 0 auto 32px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: auto;
}
.locations-form-container table {
    width: 100%;
    min-width: 700px;
    max-width: 100%;
    table-layout: auto;
}
@media (max-width: 900px) {
    .locations-form-container {
        padding: 18px 4px 16px 4px;
        max-width: 99vw;
    }
    .locations-form-container table {
        min-width: 600px;
    }
} 

@media (max-width: 700px) {
  .locations-form-container {
    padding: 8px 2px 8px 2px;
    max-width: 100vw;
  }
  #locationsTable, .locations-form-container table {
    display: block;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
  }
  #locationsTable thead {
    display: none;
  }
  #locationsTable tbody {
    display: block;
    width: 100%;
  }
  #locationsTable tr {
    display: block;
    margin-bottom: 18px;
    background: #f8f9fa;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    padding: 12px 8px;
  }
  #locationsTable td {
    display: flex;
    align-items: center;
    padding: 8px 4px;
    border: none;
    width: 100%;
  }
  #locationsTable td:before {
    content: attr(data-label);
    flex: 0 0 110px;
    font-weight: 600;
    color: #23272f;
    margin-right: 10px;
    font-size: 0.98em;
  }
  #locationsTable input[type="text"],
  #locationsTable input[type="number"],
  #locationsTable input[type="file"] {
    width: 100%;
    min-width: 0;
    font-size: 1em;
  }
  .form-actions {
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }
} 

@media (max-width: 900px) {
  .admin-container {
    flex-direction: column;
  }
  .sidebar {
    width: 100vw;
    height: auto;
    min-height: 0;
    max-height: none;
    flex-direction: row;
    align-items: center;
    position: static;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
    z-index: 100;
    padding: 0 0 0 0;
  }
  .sidebar-header {
    display: none;
  }
  .sidebar-nav {
    display: flex;
    flex-direction: row;
    gap: 8px;
    padding: 0 12px;
  }
  .nav-item {
    padding: 10px 12px;
    border-left: none;
    border-bottom: 3px solid transparent;
    font-size: 1em;
  }
  .nav-item.active, .nav-item:hover {
    border-bottom: 3px solid #3b82f6;
    background: #23272f;
    color: #3b82f6;
  }
  .sidebar-footer {
    margin-left: auto;
    padding: 0 16px;
  }
}
@media (max-width: 600px) {
  .sidebar {
    flex-direction: column;
    align-items: stretch;
    width: 100vw;
    height: auto;
    min-height: 0;
    max-height: none;
    position: static;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  }
  .sidebar-nav {
    flex-direction: column;
    gap: 0;
    padding: 0;
  }
  .nav-item {
    padding: 12px 18px;
    border-bottom: 1px solid #2d323c;
    border-left: none;
    font-size: 1em;
  }
  .sidebar-footer {
    padding: 12px 18px;
    margin-left: 0;
  }
} 

/* --- Improved Admin Add Location Table Style --- */
#locationsForm {
    background: #fff;
    padding: 32px 32px 24px 32px;
    border-radius: 16px;
    box-shadow: 0 6px 32px rgba(0,0,0,0.10);
    border: 1px solid #e5e7eb;
    max-width: 1100px;
    margin: 32px auto 0 auto;
}

#locationsTable {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    background: #f9fafb;
}

#locationsTable th, #locationsTable td {
    padding: 16px 10px;
}

#locationsTable th {
    background: #f4f6f8;
    color: #23272f;
    font-weight: 700;
    font-size: 1em;
    border-bottom: 2px solid #e5e7eb;
    letter-spacing: 0.5px;
}

#locationsTable td {
    background: #fff;
    border-bottom: 1px solid #f1f1f1;
}

#locationsTable tr:last-child td {
    border-bottom: none;
}

#locationsTable tr:hover td {
    background: #f0f4fa;
}

#locationsTable input[type="text"],
#locationsTable input[type="number"] {
    background: #f5f7fa;
    border: 1.5px solid #e5e7eb;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 15px;
    transition: border 0.2s, box-shadow 0.2s;
}

#locationsTable input[type="text"]:focus,
#locationsTable input[type="number"]:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.10);
}

.form-actions {
    margin-top: 24px;
    display: flex;
    justify-content: center;
}

button[type="submit"] {
    background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    font-size: 1.1em;
    padding: 12px 36px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.13);
    font-weight: 700;
    letter-spacing: 1px;
    border: none;
    transition: background 0.2s, box-shadow 0.2s;
}

button[type="submit"]:hover {
    background: linear-gradient(90deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.18);
}

/* Process Type Styling */
.sidepanel-process-type {
    display: block;
    background: #f0f9ff;
    color: #0369a1;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    margin-bottom: 6px;
    font-weight: 600;
}

.bottom-location-process-type {
    background: #f0f9ff;
    color: #0369a1;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.85em;
    margin-bottom: 8px;
    font-weight: 600;
    text-align: center;
}

/* Analytics Modal Styles */
.analytics-modal-content {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    max-width: 1000px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    margin: 20px auto;
    padding: 0;
}

.analytics-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 20px 24px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.analytics-title {
    font-size: 1.4em;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.analytics-close {
    font-size: 2em;
    cursor: pointer;
    font-weight: 300;
    line-height: 1;
    transition: opacity 0.2s;
}

.analytics-close:hover {
    opacity: 0.7;
}

.analytics-controls {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
}

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

.analytics-filter label {
    font-weight: 600;
    color: #374151;
    font-size: 0.95em;
}

.analytics-filter select {
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.9em;
    background: #fff;
    color: #374151;
    cursor: pointer;
    transition: border-color 0.2s;
}

.analytics-filter select:focus {
    outline: none;
    border-color: #667eea;
}

.analytics-farmer-dropdown {
    display: flex;
    align-items: center;
    gap: 12px;
}

.analytics-farmer-dropdown label {
    font-weight: 600;
    color: #374151;
    font-size: 0.95em;
}

.analytics-farmer-dropdown select {
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.9em;
    background: #fff;
    color: #374151;
    cursor: pointer;
    transition: border-color 0.2s;
    min-width: 200px;
}

.analytics-farmer-dropdown select:focus {
    outline: none;
    border-color: #667eea;
}

.analytics-municipality-dropdown {
    display: flex;
    align-items: center;
    gap: 12px;
}

.analytics-municipality-dropdown label {
    font-weight: 600;
    color: #374151;
    font-size: 0.95em;
}

.analytics-municipality-dropdown select {
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.9em;
    background: #fff;
    color: #374151;
    cursor: pointer;
    transition: border-color 0.2s;
    min-width: 200px;
}

.analytics-municipality-dropdown select:focus {
    outline: none;
    border-color: #667eea;
}

.analytics-location-dropdown {
    display: flex;
    align-items: center;
    gap: 12px;
}

.analytics-location-dropdown label {
    font-weight: 600;
    color: #374151;
    font-size: 0.95em;
}

.analytics-location-dropdown select {
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.9em;
    background: #fff;
    color: #374151;
    cursor: pointer;
    transition: border-color 0.2s;
    min-width: 200px;
}

.analytics-location-dropdown select:focus {
    outline: none;
    border-color: #667eea;
}

.analytics-elevation-dropdown {
    display: flex;
    align-items: center;
    gap: 12px;
}

.analytics-elevation-dropdown label {
    font-weight: 600;
    color: #374151;
    font-size: 0.95em;
}

.analytics-elevation-dropdown select {
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.9em;
    background: #fff;
    color: #374151;
    cursor: pointer;
    transition: border-color 0.2s;
    min-width: 200px;
}

.analytics-elevation-dropdown select:focus {
    outline: none;
    border-color: #667eea;
}

.analytics-balutakay-dropdown {
    display: flex;
    align-items: center;
    gap: 12px;
}

.analytics-balutakay-dropdown label {
    font-weight: 600;
    color: #374151;
    font-size: 0.95em;
}

.analytics-balutakay-dropdown select {
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.9em;
    background: #fff;
    color: #374151;
    cursor: pointer;
    transition: border-color 0.2s;
    min-width: 200px;
}

.analytics-balutakay-dropdown select:focus {
    outline: none;
    border-color: #667eea;
}

.analytics-info {
    font-size: 0.9em;
    color: #6b7280;
    font-style: italic;
}

.analytics-chart-container {
    padding: 24px;
    background: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 500px;
}

.analytics-farmer-details {
    padding: 20px 24px;
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
}

.farmer-details-header h4 {
    margin: 0 0 16px 0;
    color: #374151;
    font-size: 1.1em;
    font-weight: 600;
}

.farmer-details-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.farmer-detail-item {
    background: #fff;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.farmer-detail-label {
    font-size: 0.85em;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.farmer-detail-value {
    font-size: 1.1em;
    color: #374151;
    font-weight: 600;
}

.farmer-detail-score {
    font-size: 1.2em;
    color: #059669;
    font-weight: 700;
}

.analytics-legend {
    padding: 20px 24px;
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
    border-radius: 0 0 12px 12px;
}

.analytics-legend h4 {
    margin: 0 0 12px 0;
    color: #374151;
    font-size: 1.1em;
    font-weight: 600;
}

.analytics-legend ul {
    margin: 0;
    padding-left: 20px;
    list-style-type: none;
}

.analytics-legend li {
    margin-bottom: 8px;
    color: #6b7280;
    font-size: 0.9em;
    line-height: 1.4;
}

.analytics-legend li strong {
    color: #374151;
}

/* Filter Labels */
.filter-label {
    position: absolute;
    top: 80px;
    left: 20px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
}

.filter-label span {
    font-size: 2.5em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Coffee Variety Label */
.coffee-variety-label {
    border: 2px solid #2563eb;
}

.coffee-variety-label span {
    color: #2563eb;
}

/* Process Type Label */
.process-type-label {
    border: 2px solid #059669;
}

.process-type-label span {
    color: #059669;
}

/* Elevation Label */
.elevation-label {
    border: 2px solid #dc2626;
}

.elevation-label span {
    color: #dc2626;
}

/* Fragrance Label */
.fragrance-label {
    border: 2px solid #7c3aed;
}

.fragrance-label span {
    color: #7c3aed;
}

/* Flavor Label */
.flavor-label {
    border: 2px solid #ea580c;
}

.flavor-label span {
    color: #ea580c;
}

/* Body Label */
.body-label {
    border: 2px solid #16a34a;
}

.body-label span {
    color: #16a34a;
}

/* Acidity Label */
.acidity-label {
    border: 2px solid #0891b2;
}

.acidity-label span {
    color: #0891b2;
}

/* Sweetness Label */
.sweetness-label {
    border: 2px solid #be185d;
}

.sweetness-label span {
    color: #be185d;
}

/* Responsive Analytics */
@media (max-width: 768px) {
    .analytics-modal-content {
        width: 95%;
        margin: 10px auto;
    }
    
    .analytics-controls {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .analytics-farmer-dropdown,
    .analytics-municipality-dropdown,
    .analytics-location-dropdown,
    .analytics-elevation-dropdown,
    .analytics-balutakay-dropdown {
        width: 100%;
    }
    
    .analytics-farmer-dropdown select,
    .analytics-municipality-dropdown select,
    .analytics-location-dropdown select,
    .analytics-elevation-dropdown select,
    .analytics-balutakay-dropdown select {
        min-width: 100%;
        width: 100%;
    }
    
    .analytics-farmer-details {
        padding: 16px;
    }
    
    .farmer-details-content {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .analytics-chart-container {
        padding: 16px;
        min-height: 400px;
    }
    
    .analytics-chart-container canvas {
        max-width: 100%;
        height: auto !important;
    }
    
    .filter-label {
        top: 70px;
        left: 10px;
        padding: 10px 15px;
        margin-bottom: 10px;
    }
    
    .filter-label span {
        font-size: 1.8em;
        letter-spacing: 1px;
    }
    

} 