/* =============================================
   ENHANCED SIM ASET CSS - COMPLETE VERSION
   Dark/Light Mode + Map Fixes + Layer Control Minimalis
   Version: 4.0 - Complete Edition
   ============================================= */

/* =============================================
   ROOT VARIABLES & THEMING
   ============================================= */

:root {
    /* Primary Colors */
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;
    --primary-300: #93c5fd;
    --primary-400: #60a5fa;
    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    --primary-800: #1e40af;
    --primary-900: #1e3a8a;

    /* Gray Scale */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Semantic Colors */
    --success-50: #ecfdf5;
    --success-100: #d1fae5;
    --success-500: #10b981;
    --success-600: #059669;
    --success-700: #047857;

    --warning-50: #fffbeb;
    --warning-100: #fef3c7;
    --warning-500: #f59e0b;
    --warning-600: #d97706;
    --warning-700: #b45309;

    --error-50: #fef2f2;
    --error-100: #fee2e2;
    --error-500: #ef4444;
    --error-600: #dc2626;
    --error-700: #b91c1c;

    --info-50: #eff6ff;
    --info-100: #dbeafe;
    --info-500: #3b82f6;
    --info-600: #2563eb;
    --info-700: #1d4ed8;

    /* Light Mode Variables */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --text-primary: #111827;
    --text-secondary: #374151;
    --text-tertiary: #6b7280;
    --border-primary: #e5e7eb;
    --border-secondary: #d1d5db;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Borders */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;

    /* Typography */
    --font-sans: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-mono: 'Fira Code', 'Monaco', 'Consolas', monospace;

    /* Z-Index Scale */
    --z-dropdown: 1000;
    --z-sticky: 1001;
    --z-fixed: 1002;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --z-toast: 9999;
}

/* =============================================
   DARK MODE VARIABLES
   ============================================= */

.dark {
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --bg-tertiary: #374151;
    --text-primary: #f9fafb;
    --text-secondary: #e5e7eb;
    --text-tertiary: #9ca3af;
    --border-primary: #374151;
    --border-secondary: #4b5563;

    /* Enhanced shadows for dark mode */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 10px 10px -5px rgba(0, 0, 0, 0.5);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.8);

    color-scheme: dark;
}

/* =============================================
   BASE STYLES & RESET
   ============================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    line-height: 1.5;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    transition: background-color var(--transition-normal), color var(--transition-normal);
    min-height: 100vh;
    overflow-x: hidden;
}

/* =============================================
   TYPOGRAPHY
   ============================================= */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

h1 {
    font-size: 2.25rem;
}

/* 36px */
h2 {
    font-size: 1.875rem;
}

/* 30px */
h3 {
    font-size: 1.5rem;
}

/* 24px */
h4 {
    font-size: 1.25rem;
}

/* 20px */
h5 {
    font-size: 1.125rem;
}

/* 18px */
h6 {
    font-size: 1rem;
}

/* 16px */

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

a {
    color: var(--primary-600);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-700);
    text-decoration: underline;
}

.dark a {
    color: var(--primary-400);
}

.dark a:hover {
    color: var(--primary-300);
}

/* =============================================
   CARD COMPONENTS
   ============================================= */

.card {
    background-color: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-primary);
    transition: all var(--transition-normal);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.card-header {
    border-bottom: 1px solid var(--border-primary);
    padding: 1.5rem;
    background-color: var(--bg-secondary);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.card-subtitle {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    margin-top: 0.25rem;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    border-top: 1px solid var(--border-primary);
    padding: 1rem 1.5rem;
    background-color: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Card variants */
.card-elevated {
    box-shadow: var(--shadow-lg);
}

.card-flat {
    box-shadow: none;
    border: 1px solid var(--border-primary);
}

.card-ghost {
    background-color: transparent;
    border: 1px dashed var(--border-secondary);
}

/* =============================================
   BUTTON COMPONENTS
   ============================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.875rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    user-select: none;
    vertical-align: middle;
    line-height: 1;
    gap: 0.5rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.btn:focus {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

/* Button loading animation */
.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--transition-slow);
    pointer-events: none;
}

.btn:hover::before {
    left: 100%;
}

/* Button variants */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
}

.btn-secondary:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--border-secondary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-500) 0%, var(--success-600) 100%);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, var(--success-600) 0%, var(--success-700) 100%);
    transform: translateY(-1px);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-500) 0%, var(--warning-600) 100%);
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(135deg, var(--warning-600) 0%, var(--warning-700) 100%);
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--error-500) 0%, var(--error-600) 100%);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, var(--error-600) 0%, var(--error-700) 100%);
    transform: translateY(-1px);
}

.btn-ghost {
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
}

.btn-ghost:hover {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-link {
    background: none;
    color: var(--primary-600);
    border: none;
    padding: 0;
    text-decoration: underline;
}

.btn-link:hover {
    color: var(--primary-700);
}

/* Button sizes */
.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 1.5rem;
    font-size: 1rem;
}

.btn-xl {
    padding: 1.25rem 2rem;
    font-size: 1.125rem;
}

/* Button states */
.btn-loading {
    position: relative;
    color: transparent;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 1rem;
    height: 1rem;
    top: 50%;
    left: 50%;
    margin-left: -0.5rem;
    margin-top: -0.5rem;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* =============================================
   FORM COMPONENTS
   ============================================= */

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-label.required::after {
    content: '*';
    color: var(--error-500);
    margin-left: 0.25rem;
}

.input-field {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: all var(--transition-fast);
    position: relative;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background-color: var(--bg-primary);
}

.input-field:hover:not(:focus) {
    border-color: var(--border-secondary);
}

.input-field::placeholder {
    color: var(--text-tertiary);
}

.input-field:disabled {
    background-color: var(--bg-secondary);
    color: var(--text-tertiary);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Input variants */
.input-field.error {
    border-color: var(--error-500);
}

.input-field.error:focus {
    border-color: var(--error-500);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.input-field.success {
    border-color: var(--success-500);
}

.input-field.success:focus {
    border-color: var(--success-500);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Form feedback */
.form-error {
    color: var(--error-600);
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.form-success {
    color: var(--success-600);
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.form-help {
    color: var(--text-tertiary);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* Input groups */
.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .input-field {
    border-radius: 0;
    border-right: none;
}

.input-group .input-field:first-child {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.input-group .input-field:last-child {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    border-right: 1px solid var(--border-primary);
}

.input-group-addon {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-left: none;
    color: var(--text-tertiary);
}

.input-group-addon:last-child {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* Select elements */
select.input-field {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
    appearance: none;
}

/* Textarea */
textarea.input-field {
    resize: vertical;
    min-height: 100px;
}

/* Checkbox and Radio */
.checkbox,
.radio {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
}

.checkbox input,
.radio input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--primary-500);
}

/* =============================================
   TABLE COMPONENTS
   ============================================= */

.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-primary);
    background-color: var(--bg-primary);
    box-shadow: var(--shadow-sm);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table th {
    background-color: var(--bg-secondary);
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    border-bottom: 1px solid var(--border-primary);
    white-space: nowrap;
}

.table td {
    padding: 1rem 0.75rem;
    border-bottom: 1px solid var(--border-primary);
    color: var(--text-primary);
    vertical-align: middle;
}

.table tbody tr {
    transition: background-color var(--transition-fast);
}

.table tbody tr:hover {
    background-color: var(--bg-secondary);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Table variants */
.table-striped tbody tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.02);
}

.dark .table-striped tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.02);
}

.table-bordered {
    border: 1px solid var(--border-primary);
}

.table-bordered th,
.table-bordered td {
    border: 1px solid var(--border-primary);
}

/* =============================================
   NAVIGATION COMPONENTS
   ============================================= */

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    margin: 0.25rem 0;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
    font-weight: 500;
}

.nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--primary-500);
    transform: scaleY(0);
    transition: transform var(--transition-fast);
}

.nav-link:hover {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    transform: translateX(4px);
}

.nav-link:hover::before {
    transform: scaleY(1);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--primary-50) 0%, var(--primary-100) 100%);
    color: var(--primary-700);
    font-weight: 600;
}

.dark .nav-link.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0.2) 100%);
    color: var(--primary-400);
}

.nav-link.active::before {
    transform: scaleY(1);
}

.nav-link i {
    width: 1.25rem;
    margin-right: 0.75rem;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
}

/* =============================================
   BADGE & LABEL COMPONENTS
   ============================================= */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
}

.badge-primary {
    background-color: var(--primary-100);
    color: var(--primary-800);
}

.dark .badge-primary {
    background-color: rgba(59, 130, 246, 0.2);
    color: var(--primary-400);
}

.badge-success {
    background-color: var(--success-100);
    color: var(--success-800);
}

.dark .badge-success {
    background-color: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.badge-warning {
    background-color: var(--warning-100);
    color: var(--warning-800);
}

.dark .badge-warning {
    background-color: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.badge-danger {
    background-color: var(--error-100);
    color: var(--error-800);
}

.dark .badge-danger {
    background-color: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.badge-info {
    background-color: var(--info-100);
    color: var(--info-800);
}

.dark .badge-info {
    background-color: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.badge-gray {
    background-color: var(--gray-100);
    color: var(--gray-800);
}

.dark .badge-gray {
    background-color: var(--gray-700);
    color: var(--gray-300);
}

/* Badge sizes */
.badge-sm {
    padding: 0.125rem 0.5rem;
    font-size: 0.625rem;
}

.badge-lg {
    padding: 0.375rem 1rem;
    font-size: 0.875rem;
}

/* =============================================
   MODAL & OVERLAY COMPONENTS
   ============================================= */

.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: var(--z-modal-backdrop);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity var(--transition-normal);
    cursor: pointer;
}

.modal-overlay.show {
    opacity: 1;
}

.modal-content {
    background-color: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
    border: 1px solid var(--border-primary);
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform var(--transition-normal);
    cursor: default;
    z-index: var(--z-modal);
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-secondary);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    padding: 0.5rem;
    color: var(--text-tertiary);
    background: none;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
}

.modal-close:hover {
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
}

.modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-primary);
    background-color: var(--bg-secondary);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Modal sizes */
.modal-sm .modal-content {
    max-width: 400px;
}

.modal-md .modal-content {
    max-width: 600px;
}

.modal-lg .modal-content {
    max-width: 800px;
}

.modal-xl .modal-content {
    max-width: 1200px;
}

.modal-full .modal-content {
    max-width: 95vw;
    max-height: 95vh;
    margin: 2.5vh 2.5vw;
}

/* =============================================
   ALERT & NOTIFICATION COMPONENTS
   ============================================= */

.alert {
    padding: 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert-success {
    background-color: var(--success-50);
    border-color: var(--success-200);
    color: var(--success-800);
}

.dark .alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.alert-error {
    background-color: var(--error-50);
    border-color: var(--error-200);
    color: var(--error-800);
}

.dark .alert-error {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.alert-warning {
    background-color: var(--warning-50);
    border-color: var(--warning-200);
    color: var(--warning-800);
}

.dark .alert-warning {
    background-color: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

.alert-info {
    background-color: var(--info-50);
    border-color: var(--info-200);
    color: var(--info-800);
}

.dark .alert-info {
    background-color: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: #60a5fa;
}

.alert-icon {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.alert-description {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Notification toasts */
.notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: var(--z-toast);
    max-width: 24rem;
    padding: 1rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateX(100%);
    transition: transform var(--transition-normal);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: linear-gradient(135deg, var(--success-500) 0%, var(--success-600) 100%);
    color: white;
}

.notification.error {
    background: linear-gradient(135deg, var(--error-500) 0%, var(--error-600) 100%);
    color: white;
}

.notification.warning {
    background: linear-gradient(135deg, var(--warning-500) 0%, var(--warning-600) 100%);
    color: white;
}

.notification.info {
    background: linear-gradient(135deg, var(--info-500) 0%, var(--info-600) 100%);
    color: white;
}

/* =============================================
   LOADING & ANIMATION COMPONENTS
   ============================================= */

.loading-skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes loading-shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--border-primary);
    border-radius: 50%;
    border-top-color: var(--primary-500);
    animation: spin 1s ease-in-out infinite;
}

.loading-dots {
    display: inline-flex;
    gap: 0.25rem;
}

.loading-dots span {
    width: 0.5rem;
    height: 0.5rem;
    background-color: var(--primary-500);
    border-radius: 50%;
    animation: loading-bounce 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes loading-bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* =============================================
   MAP CONTAINER & LEAFLET CUSTOMIZATIONS
   ============================================= */

.map-container {
    width: 100%;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-primary);
    background-color: var(--bg-tertiary);
    overflow: hidden;
    position: relative;
}

.map-container.small {
    height: 12rem;
}

.map-container.medium {
    height: 24rem;
}

.map-container.large {
    height: 32rem;
}

.map-container.full {
    height: 70vh;
}

/* =============================================
   LEAFLET LAYER CONTROL MINIMALIS FIX
   ============================================= */

/* Toggle Button - Compact Design */
.leaflet-control-layers-toggle {
    background-color: rgba(255, 255, 255, 0.95) !important;
    border-radius: 6px !important;
    width: 32px !important;
    height: 32px !important;
    background-image: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid rgba(0, 0, 0, 0.15) !important;
    transition: all var(--transition-fast) !important;
    box-shadow: var(--shadow-sm) !important;
}

.dark .leaflet-control-layers-toggle {
    background-color: rgba(31, 41, 55, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

/* Custom minimalis icon */
.leaflet-control-layers-toggle::before {
    content: "⚙️";
    font-size: 14px;
    line-height: 1;
}

/* Hover effect */
.leaflet-control-layers-toggle:hover {
    background-color: rgba(59, 130, 246, 0.1) !important;
    transform: scale(1.05) !important;
    box-shadow: var(--shadow-md) !important;
}

.dark .leaflet-control-layers-toggle:hover {
    background-color: rgba(59, 130, 246, 0.2) !important;
}

/* Expanded Panel - Compact & Safe Positioning */
.leaflet-control-layers-expanded {
    /* Safe positioning yang tidak keluar viewport */
    position: fixed !important;
    top: 15px !important;
    right: 15px !important;
    z-index: var(--z-fixed) !important;

    /* Compact sizing */
    min-width: 180px !important;
    max-width: 220px !important;
    max-height: 300px !important;

    /* Minimalis styling */
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(10px) !important;
    border-radius: 8px !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    box-shadow: var(--shadow-lg) !important;
    padding: 8px !important;
    overflow-y: auto !important;

    /* Smooth animation */
    transition: all var(--transition-fast) !important;
    transform: translateY(0) !important;
}

/* Dark mode untuk expanded panel */
.dark .leaflet-control-layers-expanded {
    background: rgba(31, 41, 55, 0.98) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #f9fafb !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
}

/* Layer Items - Compact Styling */
.leaflet-control-layers-base {
    margin-bottom: 0 !important;
}

.leaflet-control-layers-base label {
    display: flex !important;
    align-items: center !important;
    padding: 6px 8px !important;
    margin: 2px 0 !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: all var(--transition-fast) !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    line-height: 1.3 !important;
}

.leaflet-control-layers-base label:hover {
    background-color: rgba(59, 130, 246, 0.08) !important;
    transform: translateX(2px) !important;
}

.dark .leaflet-control-layers-base label:hover {
    background-color: rgba(59, 130, 246, 0.15) !important;
}

/* Radio buttons - Compact size */
.leaflet-control-layers-base input[type="radio"] {
    margin-right: 6px !important;
    margin-top: 0 !important;
    accent-color: var(--primary-500) !important;
    width: 14px !important;
    height: 14px !important;
    flex-shrink: 0 !important;
}

/* Selected state */
.leaflet-control-layers-base input[type="radio"]:checked+span {
    color: var(--primary-600) !important;
    font-weight: 600 !important;
}

.dark .leaflet-control-layers-base input[type="radio"]:checked+span {
    color: var(--primary-400) !important;
}

/* Minimalis scrollbar */
.leaflet-control-layers-expanded::-webkit-scrollbar {
    width: 4px;
}

.leaflet-control-layers-expanded::-webkit-scrollbar-track {
    background: transparent;
}

.leaflet-control-layers-expanded::-webkit-scrollbar-thumb {
    background-color: rgba(59, 130, 246, 0.5);
    border-radius: 2px;
}

.leaflet-control-layers-expanded::-webkit-scrollbar-thumb:hover {
    background-color: rgba(59, 130, 246, 0.7);
}

/* =============================================
   ATTRIBUTION POSITIONING FIX
   ============================================= */

/* Attribution dipindah ke bottom-left untuk avoid bentrok */
.leaflet-control-attribution {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: auto !important;

    /* Safe margins */
    margin-bottom: 5px !important;
    margin-left: 5px !important;
    margin-right: 0 !important;

    /* Enhanced visibility */
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(8px) !important;
    border-radius: 4px !important;
    padding: 3px 8px !important;
    font-size: 10px !important;
    border: 1px solid rgba(0, 0, 0, 0.15) !important;
    box-shadow: var(--shadow-sm) !important;

    /* Safe z-index */
    z-index: var(--z-sticky) !important;

    /* Responsive constraints */
    max-width: calc(100vw - 60px) !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* Dark mode attribution */
.dark .leaflet-control-attribution {
    background: rgba(31, 41, 55, 0.95) !important;
    color: #d1d5db !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

/* Scale Control - Positioned above attribution */
.leaflet-control-scale {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;

    /* Positioned above attribution */
    margin-bottom: 25px !important;
    margin-left: 5px !important;
    z-index: var(--z-sticky) !important;

    /* Consistent styling */
    background: rgba(255, 255, 255, 0.9) !important;
    border-radius: 3px !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    box-shadow: var(--shadow-sm) !important;
}

.dark .leaflet-control-scale {
    background: rgba(31, 41, 55, 0.9) !important;
    color: #d1d5db !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.leaflet-control-scale-line {
    background: rgba(255, 255, 255, 0.9) !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--text-secondary) !important;
    font-size: 9px !important;
    line-height: 1.2 !important;
    padding: 1px 3px !important;
}

.dark .leaflet-control-scale-line {
    background: rgba(31, 41, 55, 0.9) !important;
    color: #d1d5db !important;
    border: 1px solid #d1d5db !important;
}

/* Ensure layer control stays in safe area */
.leaflet-control-layers {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    bottom: auto !important;
    z-index: var(--z-fixed) !important;
    max-height: calc(100vh - 60px) !important;
}

/* Other Leaflet controls positioning */
.leaflet-control-zoom {
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
    z-index: var(--z-sticky) !important;
}

.leaflet-control-fullscreen {
    position: absolute !important;
    top: 70px !important;
    left: 10px !important;
    z-index: var(--z-sticky) !important;
}

/* =============================================
   DROPDOWN & MENU COMPONENTS
   ============================================= */

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.25rem;
    background: var(--bg-primary);
    min-width: 200px;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-primary);
    z-index: var(--z-dropdown);
    padding: 0.5rem;
}

.dropdown:hover .dropdown-content,
.dropdown.active .dropdown-content {
    display: block;
}

.dropdown-item {
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
    text-decoration: none;
    display: block;
    transition: all var(--transition-fast);
    border-radius: var(--radius-md);
    margin: 0.125rem 0;
    font-size: 0.875rem;
}

.dropdown-item:hover {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    transform: translateX(2px);
}

.dropdown-item.danger {
    color: var(--error-600);
}

.dropdown-item.danger:hover {
    background-color: var(--error-50);
    color: var(--error-700);
}

.dark .dropdown-item.danger:hover {
    background-color: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

.dropdown-divider {
    height: 1px;
    background-color: var(--border-primary);
    margin: 0.5rem 0;
}

/* =============================================
   STATUS & CONDITION INDICATORS
   ============================================= */

.condition-excellent {
    background-color: var(--success-100);
    color: var(--success-800);
}

.dark .condition-excellent {
    background-color: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.condition-good {
    background-color: var(--info-100);
    color: var(--info-800);
}

.dark .condition-good {
    background-color: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.condition-fair {
    background-color: var(--warning-100);
    color: var(--warning-800);
}

.dark .condition-fair {
    background-color: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.condition-poor {
    background-color: var(--error-100);
    color: var(--error-800);
}

.dark .condition-poor {
    background-color: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.user-status {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    background-color: var(--success-100);
    color: var(--success-700);
    border: 1px solid var(--success-300);
}

.dark .user-status {
    background-color: rgba(34, 197, 94, 0.1);
    border-color: #22c55e;
    color: #4ade80;
}

.offline-banner {
    position: fixed;
    right: 16px;
    bottom: 16px;
    background: var(--warning-500);
    color: white;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    z-index: var(--z-toast);
    font-size: 0.875rem;
    box-shadow: var(--shadow-lg);
}

/* =============================================
   ASSET & FORM SPECIFIC COMPONENTS
   ============================================= */

.asset-card {
    background-color: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-primary);
    padding: 1rem;
    transition: all var(--transition-fast);
}

.asset-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-300);
    transform: translateY(-1px);
}

.dark .asset-card:hover {
    border-color: var(--primary-600);
}

.form-section {
    border-bottom: 1px solid var(--border-primary);
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.form-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-section h3 i {
    color: var(--primary-600);
}

.dark .form-section h3 i {
    color: var(--primary-400);
}

/* File upload areas */
.file-upload-area {
    border: 2px dashed var(--border-secondary);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: var(--primary-400);
    background-color: var(--primary-50);
}

.dark .file-upload-area:hover {
    border-color: var(--primary-500);
    background-color: rgba(59, 130, 246, 0.05);
}

.file-upload-area.dragover {
    border-color: var(--primary-500);
    background-color: var(--primary-50);
}

.dark .file-upload-area.dragover {
    background-color: rgba(59, 130, 246, 0.1);
}

/* =============================================
   RESPONSIVE DESIGN
   ============================================= */

/* Mobile First Responsive Breakpoints */
@media (max-width: 640px) {

    /* Mobile adjustments */
    .card {
        border-radius: var(--radius-md);
        margin: 0.5rem;
    }

    .modal-content {
        margin: 0.5rem;
        max-width: calc(100vw - 1rem);
        border-radius: var(--radius-lg);
    }

    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }

    .table-container {
        border-radius: var(--radius-md);
    }

    .nav-link {
        padding: 0.625rem 0.75rem;
    }

    .nav-link i {
        margin-right: 0.5rem;
    }

    /* Mobile layer control */
    .leaflet-control-layers-toggle {
        width: 28px !important;
        height: 28px !important;
    }

    .leaflet-control-layers-toggle::before {
        font-size: 12px;
    }

    .leaflet-control-layers-expanded {
        top: 10px !important;
        right: 10px !important;
        left: 10px !important;
        max-width: calc(100vw - 20px) !important;
        min-width: auto !important;
        max-height: 250px !important;
    }

    .leaflet-control-layers-base label {
        font-size: 11px !important;
        padding: 5px 6px !important;
    }

    .leaflet-control-layers-base input[type="radio"] {
        width: 12px !important;
        height: 12px !important;
        margin-right: 4px !important;
    }

    /* Mobile attribution */
    .leaflet-control-attribution {
        font-size: 8px !important;
        padding: 2px 6px !important;
        max-width: calc(100vw - 40px) !important;
        margin-left: 3px !important;
        margin-bottom: 3px !important;
    }

    .leaflet-control-scale {
        margin-bottom: 20px !important;
        margin-left: 3px !important;
    }

    .leaflet-control-scale-line {
        font-size: 8px !important;
        padding: 1px 2px !important;
    }
}

@media (max-width: 768px) {
    .map-container.large {
        height: 24rem;
    }

    .modal-body {
        max-height: 50vh;
    }

    /* Mobile-specific utilities */
    .mobile-hide {
        display: none !important;
    }

    .mobile-full {
        width: 100% !important;
    }

    .mobile-stack {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }

    .mobile-text-sm {
        font-size: 0.875rem !important;
    }
}

/* =============================================
   UTILITY CLASSES
   ============================================= */

/* Animation utilities */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(1rem);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(1rem);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.bounce {
    animation: bounce 1s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(-25%);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }

    50% {
        transform: none;
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

/* Transition utilities */
.transition-all {
    transition: all var(--transition-normal);
}

.transition-colors {
    transition: color var(--transition-normal), background-color var(--transition-normal), border-color var(--transition-normal);
}

.transition-transform {
    transition: transform var(--transition-normal);
}

/* Focus utilities for accessibility */
.focus-ring:focus {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

.focus-visible:focus-visible {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Custom scrollbar for all scrollable elements */
.custom-scrollbar::-webkit-scrollbar,
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track,
::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.custom-scrollbar::-webkit-scrollbar-thumb,
::-webkit-scrollbar-thumb {
    background: var(--border-secondary);
    border-radius: var(--radius-sm);
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover,
::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* =============================================
   PRINT STYLES
   ============================================= */

@media print {
    .no-print {
        display: none !important;
    }

    .print-break {
        page-break-before: always;
    }

    .print-avoid-break {
        page-break-inside: avoid;
    }

    .card {
        box-shadow: none;
        border: 1px solid #000;
    }

    .btn {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    .map-container {
        border: 1px solid #000;
    }
}

/* =============================================
   PWA & OFFLINE MODES
   ============================================= */

/* PWA specific styles */
@media (display-mode: standalone) {
    body {
        -webkit-user-select: none;
        -webkit-touch-callout: none;
        -webkit-tap-highlight-color: transparent;
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    .pwa-safe-area {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    .nav-header {
        padding-top: calc(env(safe-area-inset-top) + 1rem);
    }
}

/* Offline mode styles */
.offline-mode {
    filter: saturate(0.8);
}

.offline-mode .card {
    border-color: var(--warning-500);
}

.offline-indicator {
    background: linear-gradient(135deg, var(--warning-500) 0%, var(--warning-600) 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 500;
}

/* =============================================
   DARK MODE SPECIFIC ENHANCEMENTS
   ============================================= */

.dark {

    /* Enhanced image opacity for better dark mode experience */
    img {
        opacity: 0.9;
    }

    /* Dark mode specific border enhancements */
    .map-container {
        border-color: var(--border-primary);
    }

    /* Leaflet attribution dark mode */
    .leaflet-control-attribution {
        background: rgba(0, 0, 0, 0.8) !important;
        color: white !important;
    }
}

/* =============================================
   DEBUGGING UTILITIES (Remove in production)
   ============================================= */

/* Uncomment for debugging layout issues */
/*
.debug-borders * {
    outline: 1px solid red;
}

.debug-attribution .leaflet-control-attribution {
    border: 2px solid red !important;
}

.debug-layers .leaflet-control-layers {
    border: 2px solid blue !important;
}

.debug-scale .leaflet-control-scale {
    border: 2px solid green !important;
}
*/

/* =============================================
   COMPONENT COMBINATIONS
   ============================================= */

/* Card with form */
.card .form-group:last-child {
    margin-bottom: 0;
}

/* Button groups */
.btn-group {
    display: flex;
    gap: 0.5rem;
}

.btn-group .btn {
    flex: 1;
}

.btn-group-sm .btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

/* Input with button */
.input-with-button {
    display: flex;
    gap: 0.5rem;
}

.input-with-button .input-field {
    flex: 1;
}

/* Status combinations */
.status-online {
    color: var(--success-600);
}

.status-offline {
    color: var(--error-600);
}

.status-pending {
    color: var(--warning-600);
}

/* =============================================
   FINAL OPTIMIZATIONS
   ============================================= */

/* Smooth scroll for all elements */
html {
    scroll-behavior: smooth;
}

/* Improve performance for animations */
.card,
.btn,
.nav-link,
.modal-content,
.dropdown-content {
    will-change: transform;
    backface-visibility: hidden;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        border-width: 2px;
    }

    .btn {
        border-width: 2px;
    }
}

/* =============================================
   END OF FILE
   ============================================= */
