:root {
    --bg-color: #ffffff;
    --text-color: #212529;
    --sidebar-bg: #f8f9fa;
    --sidebar-text: #333;
    --card-bg: #ffffff;
    --border-color: #dee2e6;
    --input-bg: #ffffff;
    --input-border: #ced4da;
    --table-bg: #ffffff;
    --table-hover: #f8f9fa;
    --modal-bg: #ffffff;
}

.dark,
[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #e9ecef;
    --sidebar-bg: #2d2d2d;
    --sidebar-text: #e9ecef;
    --card-bg: #2d2d2d;
    --border-color: #495057;
    --input-bg: #383838;
    --input-border: #495057;
    --table-bg: #2d2d2d;
    --table-hover: #3d3d3d;
    --modal-bg: #2d2d2d;
}

body {
    font-size: .875rem;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.card {
    background-color: var(--card-bg);
    color: var(--text-color);
    border-color: var(--border-color);
    transition: all 0.3s ease;
}

.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 48px 0 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
    background-color: var(--sidebar-bg);
    transition: background-color 0.3s ease;
}

.sidebar-sticky {
    position: relative;
    top: 0;
    height: calc(100vh - 48px);
    padding-top: .5rem;
    overflow-x: hidden;
    overflow-y: auto;
}

.sidebar-sticky::-webkit-scrollbar {
    width: 6px;
}

.sidebar-sticky::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.sidebar-sticky::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.sidebar-sticky::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.sidebar .nav-link {
    font-weight: 500;
    color: var(--sidebar-text);
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}

.sidebar .nav-link:hover {
    color: #007bff;
    background-color: rgba(0, 123, 255, 0.1);
    transform: translateX(5px);
}

.sidebar .nav-link.active {
    color: #007bff;
}

.sidebar .nav-link i {
    margin-right: 0.5rem;
}

.navbar-brand {
    padding-top: .75rem;
    padding-bottom: .75rem;
    font-size: 1rem;
}

.navbar .navbar-toggler {
    top: .25rem;
    right: 1rem;
}

main {
    padding-top: 48px;
}

.card {
    margin-bottom: 1.5rem;
}

.leaflet-popup-content {
    margin: 13px 19px;
    line-height: 1.4;
}

.marker-popup h6 {
    margin-bottom: 0.5rem;
}

.marker-popup p {
    margin: 0.25rem 0;
    font-size: 0.875rem;
}

.theme-switcher {
    cursor: pointer;
    padding: 0.5rem;
    margin-right: 1rem;
    transition: transform 0.3s ease;
}

.theme-switcher:hover {
    transform: scale(1.1);
}

.progress-container {
    margin-bottom: 1rem;
}

.progress {
    height: 25px;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    transition: width 0.6s ease;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.status-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

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

.fade-in {
    animation: fadeIn 0.5s ease;
}

.dark .form-control:focus,
[data-theme="dark"] .form-control:focus,
.dark .form-select:focus,
[data-theme="dark"] .form-select:focus {
    background-color: var(--input-bg);
    border-color: #6ea8fe;
    color: var(--text-color);
}

.dark .form-control::placeholder,
[data-theme="dark"] .form-control::placeholder {
    color: #adb5bd;
}

.dark .table-striped > tbody > tr:nth-of-type(odd) > *,
[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
    color: var(--text-color);
}

.dark .modal-header {, [data-theme="dark"] .modal-header {
    border-bottom-color: var(--border-color);
}

.dark .modal-footer {, [data-theme="dark"] .modal-footer {
    border-top-color: var(--border-color);
}

.dark .dropdown-item {, [data-theme="dark"] .dropdown-item {
    color: var(--text-color);
}

.dark .dropdown-item:hover,, [data-theme="dark"] .dropdown-item:hover,
.dark .dropdown-item:focus {, [data-theme="dark"] .dropdown-item:focus {
    background-color: var(--table-hover);
    color: var(--text-color);
}

.dark .sidebar-sticky::-webkit-scrollbar-thumb {, [data-theme="dark"] .sidebar-sticky::-webkit-scrollbar-thumb {
    background: #555;
}

.dark .sidebar-sticky::-webkit-scrollbar-thumb:hover {, [data-theme="dark"] .sidebar-sticky::-webkit-scrollbar-thumb:hover {
    background: #777;
}
