/* Base & Typography */
body {
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
    color: #2c3e50;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1,
h2,
h3 {
    margin: 0;
    font-weight: 600;
}

/* Map */
#map {
    height: 100vh;
    width: 100%;
    z-index: 1;
}

/* Sidebar Styling */
#sidebar {
    position: absolute;
    top: 10px;
    left: 20px;
    width: 280px;
    max-height: calc(100vh - 130px);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#sidebar.closed {
    transform: translateX(-360px);
}

#sidebar .sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    background: #fff;
    border-bottom: 1px solid #f1f2f6;
}

#sidebar .sidebar-header h2 {
    font-size: 0.95rem;
}

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

.btn-icon-refresh {
    background: #f8f9fa;
    border: 1px solid #dfe6e9;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    color: #7f8c8d;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 0.8rem;
}

.btn-icon-refresh:hover {
    background: #fff;
    border-color: #27ae60;
    color: #27ae60;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}


#sidebar h3 {
    font-size: 1.1rem;
    color: #2c3e50;
    flex-grow: 1;
}

.scrollable-content {
    padding: 10px;
    overflow-y: auto;
    flex: 1;
}

/* Search Box */
.search-box {
    position: relative;
    margin-bottom: 10px;
}

.search-box i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #95a5a6;
    font-size: 0.8rem;
}

.search-box input {
    width: 100%;
    box-sizing: border-box;
    padding: 5px 8px 5px 25px;
    border: 1px solid #dfe6e9;
    border-radius: 5px;
    font-family: inherit;
    font-size: 0.75rem;
    outline: none;
    transition: border-color 0.2s;
    background: #fdfdfd;
}

.search-box input:focus {
    border-color: #27ae60;
    background: #fff;
}

.search-box i {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #95a5a6;
    font-size: 0.7rem;
}

.search-box.compact {
    margin-bottom: 8px;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #eee;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
}

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

.search-result-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #f9f9f9;
    font-size: 0.9rem;
}

.search-result-item:hover {
    background: #f1f2f6;
}

/* Accordions */
.accordion-section {
    border: 1px solid #f1f2f6;
    border-radius: 8px;
    margin-bottom: 10px;
    background: #fff;
    overflow: hidden;
    transition: all 0.2s;
}

.accordion-section[open] {
    border-color: #e1e2e6;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.accordion-section summary {
    padding: 8px 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    list-style: none;
    user-select: none;
    outline: none;
}

.accordion-section summary span {
    display: flex;
    align-items: center;
}

.accordion-section summary i {
    font-size: 0.8rem;
    color: #bdc3c7;
    transition: transform 0.2s;
}

.accordion-section[open] summary i {
    transform: rotate(180deg);
}

.accordion-section summary::-webkit-details-marker {
    display: none;
}

/* Hide default triangle */

.accordion-section summary:hover {
    background-color: #fbfbfb;
}

.badgem {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.badgem.producer {
    background: #27ae60;
    box-shadow: 0 0 4px #27ae60;
}

.badgem.outlet {
    background: #3498db;
    box-shadow: 0 0 4px #3498db;
}

.badgem.transporter {
    background: #9b59b6;
    box-shadow: 0 0 4px #9b59b6;
}

.count-badge {
    font-size: 0.75rem;
    color: #95a5a6;
    font-weight: 400;
    background: #f1f2f6;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: auto;
}

.accordion-content {
    padding: 5px 10px;
    border-top: 1px solid #f1f2f6;
    background: #fcfcfc;
}

/* Sub-Accordions */
.sub-accordion {
    margin-bottom: 5px;
    border: 1px solid #f1f2f6;
    border-radius: 6px;
    background: white;
}

.sub-accordion summary {
    padding: 6px 10px;
    font-size: 0.8rem;
    color: #34495e;
}

.summary-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sub-content {
    padding: 8px;
    border-top: 1px solid #f1f2f6;
}

/* Status Toggle (Visibility) */
.status-toggle {
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 0.9rem;
    color: #95a5a6;
    border: 1px solid #dfe6e9;
    background: white;
    margin-right: 8px;
}

.status-toggle:hover {
    background: #f1f2f6;
    color: #2c3e50;
}

.status-toggle.st-visible {
    color: #27ae60;
    border-color: #27ae60;
    background: rgba(39, 174, 96, 0.1);
}

.status-toggle.st-transparent {
    color: #3498db;
    border-color: #3498db;
    background: rgba(52, 152, 219, 0.1);
}

.status-toggle.st-hidden {
    color: #95a5a6;
    border-color: #dfe6e9;
    background: white;
}

.compact-list,
.filter-list.compact {
    max-height: 150px;
    font-size: 0.75rem;
}

/* Filters */
.filter-list {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 8px;
}

.filter-list label {
    display: flex;
    align-items: flex-start;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: #57606f;
    cursor: pointer;
    line-height: 1.4;
}

.filter-list label:hover {
    color: #2c3e50;
}

.filter-list input {
    margin-right: 8px;
    margin-top: 3px;
    accent-color: #2c3e50;
}

.toggle-control.main-toggle {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
    display: block;
}

/* Footer / Controls */
.footer-controls {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #f1f2f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #95a5a6;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: #b2bec3;
    transition: color 0.2s;
    padding: 5px;
}

.btn-icon:hover {
    color: #2d3436;
}

.btn-text {
    background: white;
    border: 1px solid #dfe6e9;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    color: #636e72;
    transition: all 0.2s;
}

.btn-text:hover {
    border-color: #b2bec3;
    color: #2d3436;
    background: #f9f9f9;
}

/* Sidebar Footer Info */
.sidebar-footer {
    padding: 8px 15px;
    border-top: 1px solid #f1f2f6;
    background: #fff;
    display: flex;
    justify-content: flex-end;
}

.footer-update-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.70rem;
    color: #95a5a6;
}

.footer-update-info .btn-icon-refresh {
    width: 24px;
    height: 24px;
    font-size: 0.7rem;
}

/* Hamburger / Tab Toggle */
#sidebar-toggle {
    position: absolute;
    top: 20px;
    left: 300px;
    /* Sidebar (20) + width (280) */
    z-index: 1101;
    background: white;
    border: 1px solid #f1f2f6;
    border-left: none;
    width: 28px;
    height: 36px;
    border-radius: 0 8px 8px 0;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    color: #2c3e50;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#sidebar.closed~#sidebar-toggle {
    left: 0;
    border-radius: 0 6px 6px 0;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
}


/* Show button when hovering it (prevents flickering) */
#sidebar-toggle:hover {
    background: #f8f9fa;
    color: #27ae60;
    width: 35px;
    /* Slight expansion */
}

/* Custom Marker Icons */
.custom-div-icon {
    background: transparent;
    border: none;
}

.marker-pin {
    width: 34px;
    height: 34px;
    border-radius: 50% 50% 50% 0;
    position: absolute;
    transform: rotate(-45deg);
    left: 50%;
    top: 50%;
    margin: -17px 0 0 -17px;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.25);
    /* More depth */
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid white;
    /* Crisp border */
    transition: transform 0.2s ease;
}

/* Hover Effect */
.marker-pin:hover {
    transform: rotate(-45deg) scale(1.1);
    z-index: 1000 !important;
}

/* Remove the inner white circle that was off-center */
.marker-pin::after {
    display: none;
}

.marker-pin i {
    transform: rotate(45deg);
    z-index: 10;
    font-size: 14px;
    color: white !important;
    /* Force white icon */
    margin: 0;
    /* Perfect centering */
}

/* Colors */
.marker-pin.producer {
    background: #27ae60;
}

.marker-pin.producer i {
    color: #27ae60;
}

.marker-pin.outlet {
    background: #3498db;
}

.marker-pin.outlet i {
    color: #3498db;
}

.marker-pin.transporter {
    background: #9b59b6;
}

.marker-pin.transporter i {
    color: #9b59b6;
}

/* Temporary Search Marker */
.marker-pin.search {
    background: #e74c3c;
    animation: bounce 0.5s ease infinite alternate;
}

.marker-pin.search i {
    color: #e74c3c;
}

@keyframes bounce {
    from {
        margin-top: -15px;
    }

    to {
        margin-top: -20px;
    }
}

/* Notification Toast */

#notification-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: rgba(30, 30, 30, 0.9);
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 0.85rem;
    animation: fadeIn 0.3s;
}

.toast.error {
    background: #e74c3c;
    /* Red */
}

.toast.success {
    background: #27ae60;
    /* Green */
}

.toast.info {
    background: #3498db;
    /* Blue */
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: 0;
    }
}

/* Login Screen */

/* Login Screen */
#login-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: calc(100vh - 40px);
    background: url('https://www.greenr.link/wp-content/uploads/2020/12/1AdobeStock_277658395-e1627401343981.jpeg') no-repeat center center/cover;
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    /* Align top */
    justify-content: flex-end;
    /* Align right */
    padding-right: 5%;
    /* Not stuck to right */
    padding-top: 25vh;
    /* Higher up (approx top 1/4) */
    box-sizing: border-box;
}

.login-box {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    text-align: center;
    width: 340px;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.login-box h2 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.login-box p {
    color: #7f8c8d;
    margin-bottom: 1.5rem;
}

.login-box input {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #dfe6e9;
    border-radius: 6px;
    font-size: 1rem;
    box-sizing: border-box;
    text-align: center;
}

.login-box button {
    width: 100%;
    background: #27ae60;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.login-box button:hover {
    background: #2ecc71;
}

/* Cluster override */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
    background-color: rgba(255, 255, 255, 0.8) !important;
    border: 2px solid #bdc3c7;
    color: #2c3e50;
    font-family: 'Outfit';
}

.marker-cluster div {
    background: transparent !important;
}

/* Route Info Box */
.route-info {
    position: fixed;
    /* Fixed to viewport */
    top: 20px;

    right: 20px;
    z-index: 9999;
}

#route-info-box,
#market-info-box {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 320px;
    max-height: 70vh;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 15px;
    z-index: 1000;
    font-family: 'Inter', sans-serif;
    border: 1px solid rgba(255, 255, 255, 0.5);
    scrollbar-width: thin;
    scrollbar-color: #bdc3c7 transparent;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#route-info-box.minimized,
#market-info-box.minimized {
    transform: translateX(340px);
    /* width 320 + right 20 */
}

.box-toggle-tab {
    position: absolute;
    top: 15px;
    left: -28px;
    width: 28px;
    height: 36px;
    background: white;
    border: 1px solid #f1f2f6;
    border-right: none;
    border-radius: 8px 0 0 8px;
    box-shadow: -4px 0 10px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    color: #2c3e50;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    z-index: 1001;
    transition: all 0.3s ease;
}

#route-info-box.minimized .box-toggle-tab i,
#market-info-box.minimized .box-toggle-tab i {
    transform: rotate(180deg);
}

#route-info-box::-webkit-scrollbar,
#market-info-box::-webkit-scrollbar {
    width: 6px;
}

#route-info-box::-webkit-scrollbar-thumb,
#market-info-box::-webkit-scrollbar-thumb {
    background-color: #bdc3c7;
    border-radius: 10px;
}

#market-info-box.hidden {
    display: none !important;
}

#market-info-box {
    top: 80px;
    /* Same position, usually mutually exclusive or stacked */
    display: block;
    /* Managed by hidden class */
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: #95a5a6;
    cursor: pointer;
    font-size: 1.1rem;
}

.close-btn:hover {
    color: #e74c3c;
}

/* Stats Styling */
.stat-header {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
    border-bottom: 1px solid #dfe6e9;
    padding-bottom: 5px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 4px;
    color: #34495e;
}

.stat-badge {
    background: #ecf0f1;
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: bold;
    color: #7f8c8d;
}

/* Radius Circle Colors */
.radius-circle-producer {
    stroke: #27ae60;
    fill: #27ae60;
}

.radius-circle-outlet {
    stroke: #3498db;
    fill: #3498db;
}

.route-detail-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #2c3e50;
}

.route-icon {
    width: 24px;
    text-align: center;
    margin-right: 10px;
    color: #3498db;
}

.route-info.hidden {
    display: none !important;
}

.route-info .close-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: #95a5a6;
    font-size: 1.1rem;
    padding: 0;
    width: 20px;
    height: 20px;
    line-height: 20px;
}

.route-info .close-btn:hover {
    color: #e74c3c;
}

.route-detail-row {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.route-icon {
    width: 20px;
    text-align: center;
    color: #3498db;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }


    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* --- V1 PLATFORM STYLES --- */

/* App Container */
#app-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
    width: 100%;
}

/* Navigation Bar */
/* STATS GRID & CARDS */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    background: rgba(39, 174, 96, 0.1);
    color: #27ae60;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-info .stat-label {
    font-size: 0.85rem;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-info h2 {
    margin: 5px 0 0 0;
    font-size: 1.6rem;
    color: #2c3e50;
}

/* CHART CONTAINER */
.chart-container {
    padding: 25px;
    margin-bottom: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* CARD COMPONENT */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}


/* SIDE PANEL */
.side-panel {
    position: fixed;
    top: 0;
    right: -650px;
    width: 600px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 5000;
    transition: right 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
}

.side-panel.open {
    right: 0;
}

.side-panel-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.side-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.details-section {
    margin-bottom: 25px;
}

.details-section h4 {
    border-bottom: 1px solid #f1f2f6;
    padding-bottom: 8px;
    margin-bottom: 12px;
    color: #7f8c8d;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.detail-label {
    color: #95a5a6;
}

.detail-value {
    color: #2c3e50;
    font-weight: 500;
}

/* 3-STATE TOGGLE */
.state-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 10px;
    font-weight: 600;
}

.state-controls {
    display: flex;
    gap: 4px;
    background: #f1f2f6;
    padding: 2px;
    border-radius: 6px;
}

.btn-state {
    border: none;
    background: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    color: #95a5a6;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-state.active {
    background: white;
    color: #27ae60;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-state[data-state="hidden"].active {
    color: #e74c3c;
}

/* GISEMENTS LIST */
#gisements-list {
    max-height: 250px;
    overflow-y: auto;
    border-radius: 8px;
    border: 1px solid #f1f2f6;
    margin-top: 10px;
}

.gisement-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f1f2f6;
    font-size: 0.9rem;
}

.gisement-item:hover {
    background: #f8f9fa;
}

.gisement-item.selected {
    background: #eafaf1;
    border-left: 3px solid #27ae60;
}

/* Navigation Bar */
/* Navigation Bar Redesign */
#main-nav {
    height: 70px;
    background: white;
    border-bottom: 1px solid #f1f2f6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.02);
    z-index: 2000;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-logo-img {
    height: 35px;
}

.nav-links {
    display: flex;
    gap: 10px;
}

.nav-link {
    background: none;
    border: none;
    font-size: 0.95rem;
    color: #7f8c8d;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s;
    font-weight: 500;
}

.nav-link:hover {
    color: #2c3e50;
    background: #f8f9fa;
}

.nav-link.active {
    color: #27ae60;
    font-weight: 600;
    background: #eafaf1;
}

.nav-link.disabled {
    opacity: 0.6;
    cursor: default;
}

.nav-link.disabled:hover {
    background: none;
    color: #7f8c8d;
}

.badge-soon {
    background: #f39c12;
    color: white;
    font-size: 0.6rem;
    padding: 2px 5px;
    border-radius: 4px;
    vertical-align: super;
    margin-left: 2px;
}

/* User Menu & Hamburger */
.user-menu-container {
    position: relative;
    cursor: pointer;
}

.user-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 5px 10px;
    border-radius: 8px;
    transition: background 0.2s;
}

.user-trigger:hover {
    background: #f8f9fa;
}

#nav-user-name {
    font-weight: 600;
    color: #2c3e50;
}

.hamburger-icon {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 18px;
    height: 14px;
}

.hamburger-icon span {
    display: block;
    height: 2px;
    width: 100%;
    background: #2c3e50;
    border-radius: 2px;
}

/* Dropdown */
.user-dropdown {
    position: absolute;
    top: 120%;
    right: 0;
    width: 200px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid #f1f2f6;
    padding: 10px 0;
    overflow: hidden;
    animation: fadeIn 0.2s ease;
}

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

.user-dropdown a {
    display: block;
    padding: 10px 20px;
    color: #34495e;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.1s;
}

.user-dropdown a:hover {
    background: #f8f9fa;
    color: #27ae60;
}

.dropdown-divider {
    height: 1px;
    background: #f1f2f6;
    margin: 5px 0;
}

/* Footer Style */
#main-footer {
    height: 40px;
    background: #fff;
    border-top: 1px solid #f1f2f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #95a5a6;
    font-size: 0.8rem;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 10000;
}

.footer-content {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* Dashboard Views */
.dashboard-view {
    flex: 1;
    overflow-y: auto;
    position: relative;
    padding-bottom: 40px;
    animation: fadeIn 0.4s ease;
}

.container-width {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.view-header h1 {
    font-size: 1.8rem;
    color: #2d3436;
}

/* Filters Bar */
.filters-bar {
    background: white;
    padding: 20px;
    border-radius: 12px;
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    align-items: center;
    flex-wrap: wrap;
    border: 1px solid #f1f2f6;
}

.filter-input-search {
    flex: 1;
    min-width: 200px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8f9fa;
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid #dfe6e9;
}

.filters-bar select,
.filters-bar input {
    padding: 10px 14px;
    border: 1px solid #dfe6e9;
    border-radius: 8px;
    font-family: inherit;
    color: #2c3e50;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s;
}

.filters-bar select:focus,
.filters-bar input:focus {
    border-color: #27ae60;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1);
}

.btn-export {
    background: #f8f9fa;
    color: #34495e;
    border: 1px solid #dfe6e9;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-export:hover {
    background: #fff;
    border-color: #27ae60;
    color: #27ae60;
}

/* Data Tables */
.table-responsive {
    overflow-x: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
    /* Force scroll on small screens */
}

.data-table th,
.data-table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid #f1f2f6;
}

.data-table th {
    background: #fbfbfb;
    font-weight: 600;
    color: #636e72;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    font-size: 0.95rem;
    color: #2d3436;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover {
    background: #fdfdfd;
}

/* Invoice Tables Specific Styling */
#invoices-table-body tr,
#purchase-orders-table-body tr {
    cursor: pointer;
    transition: background 0.2s ease;
}

#invoices-table-body tr:hover,
#purchase-orders-table-body tr:hover {
    background: #f8f9fa;
}

#invoices-table-body tr:hover .fa-chevron-right,
#purchase-orders-table-body tr:hover .fa-chevron-right {
    color: #27ae60;
}

/* Ensure invoice table columns fit on laptop screens */
#invoice-view .data-table {
    min-width: auto;
}

#invoice-view .data-table th,
#invoice-view .data-table td {
    padding: 12px 15px;
    white-space: nowrap;
}

#invoice-view .data-table th:first-child,
#invoice-view .data-table td:first-child {
    width: 140px;
    /* Numéro column */
}

#invoice-view .data-table th:nth-child(2),
#invoice-view .data-table td:nth-child(2) {
    width: 120px;
    /* Status column */
}

#invoice-view .data-table th:nth-child(3),
#invoice-view .data-table td:nth-child(3) {
    width: 100px;
    /* Date column */
}

#invoice-view .data-table th:nth-child(4),
#invoice-view .data-table td:nth-child(4) {
    width: 110px;
    /* Total HT */
}

#invoice-view .data-table th:nth-child(5),
#invoice-view .data-table td:nth-child(5) {
    width: auto;
    /* Total TTC with arrow */
}


/* Status Badges */
.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-badge.demande {
    background: #ffeaa7;
    color: #d35400;
}

.status-badge.planifie {
    background: #81ecec;
    color: #00cec9;
}

.status-badge.realise {
    background: #a8e6cf;
    color: #27ae60;
}

/* Invoice/Purchase Order Status Badges */
.status-badge.payee,
.status-badge.paye {
    background: #a8e6cf;
    color: #27ae60;
}

.status-badge.enattente,
.status-badge.attente {
    background: #ffeaa7;
    color: #d35400;
}

.status-badge.impayee,
.status-badge.impaye {
    background: #ffcccc;
    color: #e74c3c;
}

.status-badge.annulee,
.status-badge.annule {
    background: #dfe6e9;
    color: #636e72;
}


/* Buttons */
.btn-primary {
    background: #27ae60;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    background: #219150;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(39, 174, 96, 0.2);
}

.btn-secondary {
    background: #eee;
    color: #636e72;
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.9rem;
}

.btn-secondary:hover {
    background: #dfe6e9;
    color: #2d3436;
}

.btn-export {
    background: #fff;
    border: 1px solid #dfe6e9;
    color: #2c3e50;
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-export:hover {
    border-color: #27ae60;
    color: #27ae60;
}

.login-error {
    background: #ffe6e6;
    color: #e74c3c;
    padding: 10px;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-top: 15px;
    display: none;
    /* Hidden by default */
    border: 1px solid #fab1a0;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(44, 62, 80, 0.6);
    backdrop-filter: blur(4px);
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

.modal.hidden {
    display: none !important;
    /* Force override flex */
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.modal-content label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: #636e72;
    font-weight: 500;
}

.modal-content input,
.modal-content textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #dfe6e9;
    border-radius: 6px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 0.95rem;
}

.modal-content input:focus,
.modal-content textarea:focus {
    border-color: #27ae60;
    outline: none;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

/* Table Summary */
tfoot {
    background: #f9f9f9;
    border-top: 2px solid #dfe6e9;
}

.summary-row td {
    padding: 12px 15px;
    color: #2c3e50;
    font-size: 0.9rem;
}

/* Cards for Mobile (Transporter) */
.card-list {
    display: grid;
    gap: 15px;
}

.mission-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    border-left: 5px solid #bdc3c7;
}

.mission-card.blue {
    border-left-color: #3498db;
}

.mission-card.green {
    border-left-color: #27ae60;
}

.mission-card.orange {
    border-left-color: #e67e22;
}

.mission-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: 600;
    color: #2c3e50;
}

.mission-details div {
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: #636e72;
}

.mission-details i {
    width: 20px;
    text-align: center;
    color: #95a5a6;
}

.mission-actions {
    margin-top: 15px;
    border-top: 1px solid #f1f2f6;
    padding-top: 10px;
    text-align: right;
}

/* Helper */
.hidden {
    display: none !important;
}

.login-logo {
    height: 40px;
    margin-bottom: 15px;
}

.radius-handle {
    background: white;
    border: 2px solid #27ae60;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    cursor: grab;
}

.radius-handle:active {
    cursor: grabbing;
}

.radius-tooltip {
    background: rgba(44, 62, 80, 0.9);
    border: none !important;
    border-radius: 4px;
    color: white !important;
    font-weight: 600;
    font-size: 0.8rem;
    padding: 2px 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.radius-tooltip::before {
    display: none !important;
}

/* --- Collapsible Filters --- */
.collapsible-filters {
    max-height: 500px;
    overflow: visible;
    /* Changed from hidden to allow dropdowns to show */
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out, margin 0.3s ease;
    opacity: 1;
}

.collapsible-filters.collapsed {
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding-top: 0;
    padding-bottom: 0;
    pointer-events: none;
    overflow: hidden;
    /* Keep hidden when collapsed */
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

/* --- Custom Multiselect --- */
.custom-multiselect {
    position: relative;
    width: 220px;
}

.multiselect-trigger {
    width: 100%;
    padding: 8px 12px;
    background: white !important;
    border: 1px solid #dfe6e9 !important;
    border-radius: 6px;
    text-align: left;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #2c3e50;
}

.multiselect-trigger:hover {
    border-color: #27ae60 !important;
}

.multiselect-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #dfe6e9;
    border-radius: 6px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    margin-top: 5px;
    padding: 10px;
    width: 280px;
}

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

.multiselect-search input {
    width: 100% !important;
    padding: 6px 10px !important;
    border: 1px solid #f1f2f6 !important;
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 0.85rem;
    text-align: left !important;
}

.multiselect-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.multiselect-actions button {
    font-size: 0.75rem;
    background: none;
    border: none;
    color: #3498db;
    cursor: pointer;
    padding: 0;
}

.multiselect-actions button:hover {
    text-decoration: underline;
}

.multiselect-options {
    max-height: 200px;
    overflow-y: auto;
}

.multiselect-options label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
    font-size: 0.85rem;
    cursor: pointer;
}

.multiselect-options label:hover {
    background: #f8f9fa;
}

/* --- Details Panel Groupings --- */
.details-section h4 {
    border-bottom: 2px solid #f1f2f6;
    padding-bottom: 5px;
    margin-top: 25px;
    margin-bottom: 15px;
    color: #27ae60;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-group-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #7f8c8d;
    margin: 15px 0 5px 0;
    padding-left: 5px;
}

.sub-details {
    padding-left: 10px;
    border-left: 2px solid #ecf0f1;
    margin-bottom: 15px;
}

.env-impact {
    background: #f1f8f6;
    border-radius: 8px;
    padding: 12px;
    margin-top: 10px;
}

.env-impact .detail-row {
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.co2-badge {
    color: #e67e22;
    font-weight: 600;
}

/* --- General Adjustments --- */

/* --- New Filter Layout --- */
.filter-action-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    margin-bottom: 5px;
    background: white;
    padding: 12px 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.filter-action-bar .filter-input-search {
    flex: 1;
    max-width: 400px;
    margin-bottom: 0 !important;
    border: 1px solid #edf2f7;
    background: #f8fafc;
}

.btn-filter-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #4a5568;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.btn-filter-toggle:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
}

.btn-filter-toggle.active {
    background: #ebf8ff;
    border-color: #3182ce;
    color: #2b6cb0;
}

.btn-filter-toggle i {
    font-size: 0.9rem;
}

.active-filters-badge {
    background: #3182ce;
    color: white;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.collapsible-filters {
    background: white;
    padding: 0 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow: visible;
    /* Allow dropdowns to show */
    transition: all 0.3s ease;
}

.collapsible-filters.collapsed {
    max-height: 0;
    margin-top: 0;
    padding: 0 20px;
    opacity: 0;
    pointer-events: none;
    box-shadow: none;
    border: none;
    overflow: hidden;
    /* Hide when collapsed */
}

.collapsible-filters:not(.collapsed) {
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #edf2f7;
}