/* UNCDF Projects List View - Complete Styles */

/* ==============================================
   UNIVERSAL RESET & BASE STYLES
   ============================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f7fafc;
}

/* ==============================================
   CONTAINER
   ============================================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
}

.list-container {
    width: 100%;
    background: white;
    margin: 0;
}

/* ==============================================
   HEADER SECTION
   ============================================== */
.list-header {
    background: linear-gradient(135deg, #0a2463 0%, #3e92cc 100%);
    padding: 32px 40px;
    color: white;
}

.list-header h1,
.list-header h2 {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.list-header p {
    font-size: 16px;
    opacity: 0.95;
    margin: 0;
}

/* ==============================================
   MAP HEADER WITH TOGGLE
   ============================================== */
.map-header {
    background: linear-gradient(135deg, #0a2463 0%, #3e92cc 100%);
    padding: 32px 40px;
    color: white;
}

.map-header .header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.map-header .header-text {
    flex: 1;
}

.map-header .header-text h2 {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: white;
}

.map-header .header-text p {
    font-size: 16px;
    opacity: 0.95;
    margin: 0;
    color: white;
}

.map-header .view-toggle {
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin-top: 4px;
}

.map-header .view-toggle button,
.map-header .view-toggle a {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-right: 1px solid rgba(255, 255, 255, 0.3);
}

.map-header .view-toggle button:last-child,
.map-header .view-toggle a:last-child {
    border-right: none;
}

.map-header .view-toggle button:hover,
.map-header .view-toggle a:hover {
    background: rgba(255, 255, 255, 0.2);
}

.map-header .view-toggle button.active,
.map-header .view-toggle a.active {
    background: white;
    color: #0a2463;
}

/* ==============================================
   CONTROLS BAR
   ============================================== */
.controls-bar {
    background: white;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
}

.search-wrapper {
    flex: 1;
    max-width: 400px;
}

.search-wrapper input {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 14px;
    color: #4a5568;
    outline: none;
}

.search-wrapper input::placeholder {
    color: #a0aec0;
}

.search-wrapper input:focus {
    border-color: #0a2463;
    box-shadow: 0 0 0 3px rgba(10, 36, 99, 0.1);
}

.view-toggle {
    display: flex;
    gap: 0;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
}

.view-toggle button {
    padding: 10px 24px;
    border: none;
    background: white;
    color: #4a5568;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-right: 1px solid #e2e8f0;
}

.view-toggle button:last-child {
    border-right: none;
}

.view-toggle button:hover {
    background: #f7fafc;
}

.view-toggle button.active {
    background: #0a2463;
    color: white;
}

/* ==============================================
   LEGACY CONTROLS (Backward Compatibility)
   ============================================== */
.list-controls {
    padding: 16px 32px;
    background: white;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.search-box {
    flex: 1;
    min-width: 250px;
    max-width: 400px;
}

.search-box input {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
}

.search-box input:focus {
    border-color: #0a2463;
    box-shadow: 0 0 0 3px rgba(10, 36, 99, 0.1);
}

.toggle-btn {
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #4a5568;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

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

.toggle-btn.active {
    background: #0a2463;
    color: white;
    border-color: #0a2463;
}

/* ==============================================
   FILTERS BAR
   ============================================== */
.filters-bar {
    background: #f7fafc;
    padding: 20px 40px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    gap: 24px;
    align-items: flex-end;
}

.filter-section {
    padding: 16px 32px;
    background: #f7fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-size: 11px;
    font-weight: 600;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group select {
    padding: 10px 36px 10px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 14px;
    color: #4a5568;
    background: white;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%234a5568' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    min-width: 160px;
}

.filter-group select:hover {
    border-color: #0a2463;
}

.filter-group select:focus {
    border-color: #0a2463;
    box-shadow: 0 0 0 3px rgba(10, 36, 99, 0.1);
}

/* ==============================================
   TABLE SECTION
   ============================================== */
.table-wrapper {
    background: white;
    padding: 0;
}

.table-container {
    padding: 40px;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

thead {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}

th {
    padding: 12px 16px;
    text-align: left;
    font-size: 16px;
    font-weight: 600;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Hide thead visually but keep for accessibility */
thead {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

tbody {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

tbody tr {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

tbody tr:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    background: white;
}

td {
    padding: 0;
    font-size: 14px;
    color: #1a202c;
    border: none;
}

/* ==============================================
   CARD LAYOUT FOR TABLE ROWS - SINGLE ROW FORMAT
   ============================================== */

tbody tr {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 20px 24px;
    width: 100%;
}

/* Project Information - Column 1 - Vertical Stack */
tbody tr td:nth-child(1) {
    flex: 0 0 70%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 16px;
}

/* Project name - Primary heading */
tbody tr td:nth-child(1) .project-name,
tbody tr td:nth-child(1) > strong,
tbody tr td:nth-child(1) > *:first-child {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
}

/* Project ID - Below name */
tbody tr td:nth-child(1) .project-id {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 0.3px;
}

/* Country and Region - Single line with divider */
tbody tr td:nth-child(1) .project-location,
tbody tr td:nth-child(1) > div {
    display: flex;
    align-items: left;
    justify-content: flex-start;
    gap: 12px;
    font-size: 14px;
    line-height: 1.2;
}

/* Country within location */
tbody tr td:nth-child(1) .project-country {
    font-weight: 600;
    color: #475569;
}

/* Divider between country and region */
tbody tr td:nth-child(1) .location-separator {
    color: #cbd5e0;
    font-weight: 400;
}

/* Region within location */
tbody tr td:nth-child(1) .project-region {
    font-weight: 500;
    color: #64748b;
}

/* Number of Projects - Column 2 - 25% */
tbody tr td:nth-child(2) {
    flex: 0 0 5%;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    color: #0a2463;
    padding: 0 16px;
    border-left: 1px solid #e2e8f0;
}

/* Budget - Column 3 - 10% */
tbody tr td:nth-child(3) {
    flex: 0 0 5%;
    text-align: right;
    font-size: 16px;
    font-weight: 700;
    color: #059669;
    padding: 0 16px;
    border-left: 1px solid #e2e8f0;
}

/* Expenditure - Column 4 - 10% */
tbody tr td:nth-child(4) {
    flex: 0 0 10%;
    display: block !important;
    text-align: right;
    font-size: 16px;
    font-weight: 700;
    color: #64748b;
    padding: 0 16px;
    border-left: 1px solid #e2e8f0;
}

/* Status badge - Column 5 - 10% */
tbody tr td:nth-child(5) {
    flex: 0 0 10%;
    text-align: center;
    padding: 0 16px;
    border-left: 1px solid #e2e8f0;
}

/* Action button - Column 6 - 20% */
tbody tr td:nth-child(6) {
    flex: 0 0 20%;
    text-align: center;
    padding-left: 16px;
    border-left: 1px solid #e2e8f0;
}

tbody tr td:nth-child(6) a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 20px;
    background: #0468B1;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
}

tbody tr td:nth-child(6) a:hover {
    background: #035a94;
}

tbody tr td:nth-child(6) a::after {
    content: "→";
    font-size: 16px;
    margin-left: 4px;
}

/* ==============================================
   LEGACY TABLE STYLES (Backward Compatibility)
   ============================================== */
.projects-table-wrapper {
    padding: 32px;
    overflow-x: auto;
}

.projects-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.projects-table thead {
    background: #f7fafc;
    border-bottom: 2px solid #e2e8f0;
}

.projects-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.projects-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.projects-table th.sortable:hover {
    background: #edf2f7;
}

.projects-table tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: background 0.2s ease;
}

.projects-table tbody tr:hover {
    background: #f7fafc;
}

.projects-table td {
    padding: 16px;
    font-size: 14px;
    color: #1a202c;
}

/* ==============================================
   SUMMARY BAR
   ============================================== */
.summary-bar {
    background: #f7fafc;
    padding: 16px 40px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #718096;
}

.summary-stats {
    padding: 16px 32px;
    background: #f7fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #718096;
}

/* ==============================================
   TAB SECTION
   ============================================== */
.tab-section {
    background: white;
    border-bottom: 2px solid #e2e8f0;
}

.tabs {
    display: flex;
    gap: 0;
    padding: 0 40px;
}

.tab {
    padding: 16px 32px;
    border: none;
    background: transparent;
    color: #4a5568;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}

.tab:hover {
    background: #f7fafc;
    color: #0a2463;
}

.tab.active {
    color: #0a2463;
    border-bottom-color: #0a2463;
    background: white;
}

/* ==============================================
   SECONDARY HEADER
   ============================================== */
.secondary-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    padding: 32px 40px;
    color: white;
}

.secondary-header h2 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.secondary-header p {
    font-size: 16px;
    opacity: 0.95;
    margin: 0;
}

/* ==============================================
   SECONDARY CONTROLS
   ============================================== */
.secondary-controls {
    background: white;
    padding: 20px 40px;
    display: flex;
    gap: 16px;
    align-items: flex-end;
    border-bottom: 1px solid #e2e8f0;
}

.secondary-controls .search-wrapper {
    flex: 1;
    max-width: 350px;
}

/* ==============================================
   COUNTRY & PROJECT SPECIFIC STYLES
   ============================================== */
.country-name {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    font-weight: 600;
    color: #0a2463;
}

.country-name > strong {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
}

.region-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: #dbeafe;
    border: 1px solid #93c5fd;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #1e40af;
    margin-top: 6px;
}

/* ==============================================
   STATUS BADGES (TOOLTIP STYLE)
   ============================================== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.status-badge.status-active {
    background: #dbeafe;
    color: #1e40af;
}

.status-badge.status-planning {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.status-completed {
    background: #d1fae5;
    color: #065f46;
}

.view-details-link {
    color: #0a2463;
    text-decoration: none;
    font-weight: 500;
}

.view-details-link:hover {
    text-decoration: underline;
}


/* ==============================================
   LAYOUT
   ============================================== */

       .container {
            max-width: 1400px;
            margin: 0 auto;
        }

        /* Header Section */
        .list-header {
            background: linear-gradient(135deg, #0a2463 0%, #3e92cc 100%);
            padding: 32px 40px;
            color: white;
        }

        .list-header h1,
        .list-header h2 {
            font-size: 32px;
            font-weight: 700;
            margin: 0 0 8px 0;
        }

        .list-header p {
            font-size: 16px;
            opacity: 0.95;
            margin: 0;
        }

        /* Controls Bar */
        .controls-bar {
            background: white;
            padding: 20px 40px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid #e2e8f0;
        }

        .search-wrapper {
            flex: 1;
            max-width: 400px;
        }

        .search-wrapper input {
            width: 100%;
            padding: 10px 16px;
            border: 1px solid #cbd5e0;
            border-radius: 6px;
            font-size: 14px;
            color: #4a5568;
            outline: none;
        }

        .search-wrapper input::placeholder {
            color: #a0aec0;
        }

        .search-wrapper input:focus {
            border-color: #0a2463;
            box-shadow: 0 0 0 3px rgba(10, 36, 99, 0.1);
        }

        .view-toggle {
            display: flex;
            gap: 16px;
            border: 1px solid #e2e8f0;
            border-radius: 6px;
            overflow: hidden;
        }

        .view-toggle button {
            padding: 10px 24px;
            border: none;
            background: white;
            color: #4a5568;
            cursor: pointer;
            font-size: 14px;
            font-weight: 500;
            transition: all 0.2s ease;
            border-right: 1px solid #e2e8f0;
        }

        .view-toggle button:last-child {
            border-right: none;
        }

        .view-toggle button:hover {
            background: #f7fafc;
        }

        .view-toggle button.active {
            background: #0a2463;
            color: white;
        }

        /* Filters Section */
        .filters-bar {
            background: #f7fafc;
            padding: 20px 40px;
            border-bottom: 1px solid #e2e8f0;
            display: flex;
            gap: 24px;
            align-items: flex-end;
        }

        .filter-group {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .filter-group label {
            font-size: 11px;
            font-weight: 600;
            color: #718096;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .filter-group select {
            padding: 10px 36px 10px 12px;
            border: 1px solid #cbd5e0;
            border-radius: 6px;
            font-size: 14px;
            color: #4a5568;
            background: white;
            cursor: pointer;
            outline: none;
            appearance: none;
            background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%234a5568' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 12px center;
            min-width: 160px;
        }

        .filter-group select:hover {
            border-color: #0a2463;
        }

        .filter-group select:focus {
            border-color: #0a2463;
            box-shadow: 0 0 0 3px rgba(10, 36, 99, 0.1);
        }

        /* Table Section */
        .table-wrapper {
            background: white;
            padding: 0;
        }

        .table-container {
            padding: 40px;
        }

        table {
            width: 100%;
            border-collapse: collapse;
        }

        thead {
            background: #f8fafc;
            border-bottom: 2px solid #e2e8f0;
        }

        th {
            padding: 12px 16px;
            text-align: left;
            font-size: 16px;
            font-weight: 600;
            color: #718096;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        th:nth-child(2),
        th:nth-child(3) {
            text-align: center;
        }

        th:last-child {
            text-align: center;
        }

        tbody tr {
            border-bottom: 1px solid #e2e8f0;
        }

        tbody tr:hover {
            background: #f7fafc;
        }

        td {
            padding: 16px;
            font-size: 14px;
            color: #1a202c;
        }

        /* Summary Bar */
        .summary-bar {
            background: #f7fafc;
            padding: 16px 40px;
            border-top: 1px solid #e2e8f0;
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 14px;
            color: #718096;
        }

        /* Tab Section */
        .tab-section {
            background: white;
            border-bottom: 2px solid #e2e8f0;
        }

        .tabs {
            display: flex;
            gap: 0;
            padding: 0 40px;
        }

        .tab {
            padding: 16px 32px;
            border: none;
            background: transparent;
            color: #4a5568;
            cursor: pointer;
            font-size: 14px;
            font-weight: 500;
            border-bottom: 3px solid transparent;
            transition: all 0.2s ease;
        }

        .tab:hover {
            background: #f7fafc;
            color: #0a2463;
        }

        .tab.active {
            color: #0a2463;
            border-bottom-color: #0a2463;
            background: white;
        }

        /* Secondary Header */
        .secondary-header {
            background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
            padding: 32px 40px;
            color: white;
        }

        .secondary-header h2 {
            font-size: 28px;
            font-weight: 700;
            margin: 0 0 8px 0;
        }

        .secondary-header p {
            font-size: 16px;
            opacity: 0.95;
            margin: 0;
        }

        /* Secondary Controls */
        .secondary-controls {
            background: white;
            padding: 20px 40px;
            display: flex;
            gap: 16px;
            align-items: flex-end;
            border-bottom: 1px solid #e2e8f0;
        }

        .secondary-controls .search-wrapper {
            flex: 1;
            max-width: 350px;
        }

        /* Empty State */
        .empty-state {
            padding: 80px 40px;
            text-align: center;
            color: #718096;
        }

        .empty-state-icon {
            font-size: 48px;
            color: #cbd5e0;
            margin-bottom: 16px;
        }

        .empty-state-text {
            font-size: 16px;
        }








/* ==============================================
   EMPTY STATE
   ============================================== */
.empty-state {
    padding: 80px 40px;
    text-align: center;
    color: #718096;
}

.empty-state-icon {
    font-size: 48px;
    color: #cbd5e0;
    margin-bottom: 16px;
}

.empty-state-text {
    font-size: 16px;
}

.no-results {
    padding: 48px 32px;
    text-align: center;
    color: #718096;
    font-size: 16px;
}

/* ==============================================
   RESPONSIVE DESIGN - MOBILE
   ============================================== */
@media (max-width: 768px) {
    .list-header {
        padding: 20px;
    }

    .controls-bar {
        padding: 16px 20px;
        flex-direction: column;
        align-items: stretch;
    }

    .search-wrapper {
        max-width: 100%;
    }

    .list-controls {
        padding: 16px 20px;
    }

    .filters-bar {
        padding: 16px 20px;
        flex-direction: column;
    }

    .filter-section {
        padding: 16px 20px;
    }

    .filter-group {
        width: 100%;
    }

    .filter-group select {
        width: 100%;
    }

    .table-container {
        padding: 20px;
    }

    .projects-table-wrapper {
        padding: 20px;
    }

    /* Card styles remain the same on mobile */
    tbody {
        gap: 16px;
    }

    tbody tr {
        padding: 16px;
    }

    /* Mobile: Stack columns vertically within each card */
    tbody tr {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    tbody tr td:nth-child(1) {
        flex: 1 1 auto;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    tbody tr td:nth-child(1) .project-location,
    tbody tr td:nth-child(1) div {
        gap: 8px;
        flex-wrap: wrap;
    }

    tbody tr td:nth-child(2),
    tbody tr td:nth-child(3),
    tbody tr td:nth-child(4),
    tbody tr td:nth-child(5),
    tbody tr td:nth-child(6) {
        flex: 1 1 auto;
        text-align: left;
    }

    .summary-bar {
        padding: 16px 20px;
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .tabs {
        padding: 0 20px;
        overflow-x: auto;
    }

    .tab {
        padding: 12px 20px;
        white-space: nowrap;
    }

    .secondary-header {
        padding: 20px;
    }

    .secondary-controls {
        padding: 16px 20px;
        flex-direction: column;
        align-items: stretch;
    }

    .secondary-controls .search-wrapper {
        max-width: 100%;
    }
}

/* ==============================================
   PROJECT CARDS - MULTI-COUNTRY DISPLAY
   ============================================== */

/* Single Country Display */
.project-location-single {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #64748b;
    margin-top: 2px;
}

.project-country {
    font-weight: 600;
    color: #475569;
}

.location-separator {
    color: #cbd5e0;
    font-weight: 400;
}

.project-region {
    font-weight: 500;
    color: #94a3b8;
}

/* Multiple Countries Display */
.project-location-multi {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-top: 4px;
}

.countries-count {
    font-size: 12px;
    font-weight: 600;
    color: #0a2463;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
}

.countries-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-start;
}

.country-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #475569;
    transition: all 0.2s ease;
    text-align: left;
}

.country-badge:hover {
    background: #e2e8f0;
    border-color: #cbd5e0;
}

/* Country Projects Display (for Countries View) */
.country-projects {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-top: 6px;
    margin-bottom: 6px;
}

.projects-count {
    font-size: 12px;
    font-weight: 600;
    color: #0a2463;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
}

.projects-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-start;
}

.project-id-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #475569;
    transition: all 0.2s ease;
    text-align: left;
    font-family: 'Courier New', Courier, monospace;
}

.project-id-badge:hover {
    background: #e2e8f0;
    border-color: #cbd5e0;
}

/* Year Filter Bar */
.year-filter-bar {
    background: white;
    padding: 20px 40px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    gap: 16px;
    align-items: center;
}

.year-filter-label {
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
}

.year-buttons {
    display: flex;
    gap: 8px;
}

.year-button {
    padding: 8px 20px;
    border: 2px solid #e2e8f0;
    background: white;
    color: #4a5568;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.year-button:hover {
    border-color: #0a2463;
    color: #0a2463;
}

.year-button.active {
    background: #0a2463;
    color: white;
    border-color: #0a2463;
}

/* Project Cards Adjustments */
.project-name {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
}

.project-id {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    font-family: 'Courier New', monospace;
}

.duration-range {
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
    line-height: 1.3;
}

.duration-years {
    font-size: 12px;
    font-weight: 500;
    color: #94a3b8;
    margin-top: 4px;
}

/* Adjust tbody tr for projects with multiple countries */
tbody tr {
    align-items: flex-start;
}

/* Re-center financial columns when needed */
tbody tr td:nth-child(2),
tbody tr td:nth-child(3),
tbody tr td:nth-child(4),
tbody tr td:nth-child(5) {
    align-self: center;
}

/* ==============================================
   PROJECTS VIEW - SPECIFIC STYLES
   ============================================== */

/* Projects View: Adjust column widths */
tbody.projects-view tr td:nth-child(1) {
    flex: 0 0 40% !important; /* Project Info */
}

tbody.projects-view tr td:nth-child(2) {
    flex: 0 0 15% !important; /* Duration */
    text-align: center;
    padding: 0 16px;
}

tbody.projects-view tr td:nth-child(3) {
    flex: 0 0 15% !important; /* Budget */
    text-align: right;
}

tbody.projects-view tr td:nth-child(4) {
    flex: 0 0 15% !important; /* Expenses */
    text-align: right;
}

tbody.projects-view tr td:nth-child(5) {
    flex: 0 0 15% !important; /* Utilization */
    text-align: center;
}

/* Budget and Expenses Amount Styling */
.budget-amount {
    font-size: 16px;
    font-weight: 700;
    color: #059669;
}

.expenses-amount {
    font-size: 16px;
    font-weight: 700;
    color: #dc2626;
}

/* Utilization Bar */
.utilization-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}

.utilization-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.utilization-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.utilization-text {
    font-size: 13px;
    font-weight: 600;
    color: #059669;
}

/* Summary Stats for Projects View */
.summary-stats {
    background: #f7fafc;
    padding: 16px 40px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #718096;
}

.summary-stats span {
    font-weight: 500;
}

/* Summary Stats */
.summary-stats {
    background: #f7fafc;
    padding: 16px 40px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #718096;
}

.summary-stats span {
    font-weight: 500;
}

/* ============================================
   MAP CONTAINER & HEADER
   ============================================ */

.map-container {
    position: relative;
    width: 100%;
    margin-bottom: 50px;
}

.map-header {
    padding: 30px 20px 20px;
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.header-text h2 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-text h2 i {
    font-size: 32px;
}

.header-text p {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
    font-weight: 400;
}

/* ============================================
   VIEW TOGGLE BUTTONS (Screenshot Style)
   ============================================ */

.view-toggle {
    display: flex;
    gap: 8px;
    align-items: center;
}

.toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    border: 2px solid transparent;
    white-space: nowrap;
}

/* Active State (Map Button - Dark Blue) */
.toggle-btn.active {
    background-color: #1e40af;
    color: white;
    border-color: #1e40af;
    box-shadow: 0 4px 6px rgba(30, 64, 175, 0.3);
}

/* Inactive State (List Button - White) */
.toggle-btn:not(.active) {
    background-color: white;
    color: #1e40af;
    border-color: #e5e7eb;
}

/* Hover Effects */
.toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.toggle-btn.active:hover {
    background-color: #1e3a8a;
    border-color: #1e3a8a;
}

.toggle-btn:not(.active):hover {
    background-color: #f3f4f6;
    border-color: #1e40af;
    color: #1e3a8a;
}

/* Icon Styling */
.toggle-btn i {
    font-size: 16px;
}

.toggle-btn span {
    font-family: inherit;
}

/* ============================================
   MAP ELEMENT
   ============================================ */

#map {
    width: 100%;
    height: 600px;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .view-toggle {
        width: 100%;
    }
    
    .toggle-btn {
        flex: 1;
        justify-content: center;
    }
    
    .header-text h2 {
        font-size: 22px;
    }
    
    .header-text h2 i {
        font-size: 24px;
    }
    
    #map {
        height: 450px;
    }
}

@media (max-width: 480px) {
    .toggle-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .toggle-btn i {
        font-size: 14px;
    }
}}

/* ============================================
   ENHANCED FILTER SYSTEM - NEW STYLES
   ============================================ */

/* Search and Filter Row */
.search-filter-row {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

/* Search Wrapper with Icon */
.search-wrapper {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #9ca3af;
    pointer-events: none;
}

.search-wrapper input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

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

/* Filter Toggle Button */
.btn-filter-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-filter-toggle:hover {
    background: #e5e7eb;
}

.btn-filter-toggle svg {
    transition: transform 0.2s;
}

/* Active state when filters are applied */
.btn-filter-toggle.active {
    background: #dbeafe;
    color: #1e40af;
    border-color: #3b82f6;
}

/* Sort Wrapper */
.sort-wrapper {
    flex-shrink: 0;
}

.sort-select {
    padding: 12px 40px 12px 16px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-size: 14px;
    color: #374151;
    background: white;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%234a5568' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: all 0.2s;
}

.sort-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Export Button */
.btn-export {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-export:hover {
    background: #2563eb;
}

/* Collapsible Filter Panel */
.filter-panel {
    border-top: 1px solid #e5e7eb;
    padding-top: 20px;
    margin-top: 20px;
    transition: all 0.3s ease-in-out;
}

.filter-panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    color: #6b7280;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Filter Grid - Responsive */
.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    .filter-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .filter-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Filter Group */
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-size: 14px;
    color: #374151;
    background: white;
    outline: none;
    transition: all 0.2s;
}

.filter-group select {
    padding-right: 40px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%234a5568' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
}

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

/* Active Filter Indicator */
.filter-group.has-value select,
.filter-group.has-value input {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

/* Filter Actions */
.filter-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.active-filters-display {
    font-size: 14px;
    color: #6b7280;
}

.active-filter-count {
    font-weight: 600;
    color: #3b82f6;
}

.btn-clear-filters {
    padding: 10px 20px;
    background: white;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-clear-filters:hover {
    background: #f9fafb;
    color: #374151;
    border-color: #d1d5db;
}

/* Responsive Adjustments for Enhanced Filters */
@media (max-width: 768px) {
    .search-filter-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-wrapper,
    .view-toggle {
        width: 100%;
    }
    
    .btn-filter-toggle,
    .btn-export {
        width: 100%;
        justify-content: center;
    }
    
    .view-toggle button {
        flex: 1;
    }
    
    .filter-actions {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .btn-clear-filters {
        width: 100%;
    }
}
