/* Dashboard Styles - Professional GIP Design */
:root {
    --primary-color: #ff4000;
    --secondary-color: #3f334d;
    --success-color: #c1809d;
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --text-primary: #333;
    --text-secondary: #666;
    --border-color: #dee2e6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.4;
    padding: 40px;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    background-color: white;
    padding: 40px;
    border-radius: 0;
    box-shadow: none;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

header h1 {
    margin: 0;
    font-size: 2rem;
}

.subtitle {
    margin: 0.5rem 0 0 0;
    opacity: 0.95;
}

.header-nav {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.nav-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

/* Info Box */
.info-box {
    background-color: var(--bg-primary);
    padding: 20px;
    margin: 30px 0;
    border-left: 4px solid var(--primary-color);
}

.info-box h3 {
    margin-top: 0;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
}

.info-box p {
    margin-bottom: 10px;
    font-size: 13px;
    line-height: 1.6;
}

.info-box ul {
    margin: 10px 0 0 20px;
    font-size: 13px;
}

.info-box li {
    margin-bottom: 5px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
}

/* Statistics Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--bg-primary);
    border-radius: 0;
    padding: 20px;
    border: 1px solid var(--border-color);
}

.stat-card.highlight {
    background: var(--bg-secondary);
    border-left: 4px solid var(--success-color);
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
}

.stat-value {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Filters Section */
.filters-section {
    background: var(--bg-secondary);
    border-radius: 0;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.filters-section h2 {
    color: var(--text-primary);
    font-size: 24px;
    font-weight: normal;
    margin-top: 0;
    margin-bottom: 20px;
    text-transform: none;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

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

.filter-group label {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.filter-group input,
.filter-group select {
    padding: 0.625rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.filter-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-map {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #cc3300;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0;
    cursor: pointer;
    font-size: 0.9rem;
    margin-right: 0.5rem;
}

.btn-secondary:hover {
    background-color: #2a1f2e;
    opacity: 0.9;
}

.btn-map {
    background: var(--success-color);
    color: white;
}

.btn-map:hover {
    background: #a66d85;
}

/* Results Info */
.results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    flex-wrap: wrap;
    gap: 1rem;
}

.filtered-budget {
    color: var(--text-secondary);
}

.filtered-budget strong {
    color: var(--success-color);
    font-size: 1.125rem;
}

/* Table */
.table-container {
    background: var(--bg-secondary);
    border-radius: 0;
    overflow: hidden;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

table thead {
    background-color: var(--secondary-color);
    color: white;
}

th {
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    color: white;
    border: 1px solid var(--border-color);
    white-space: nowrap;
    font-size: 12px;
}

th.sortable {
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    position: relative;
}

th.sortable:hover {
    background: rgba(255, 255, 255, 0.1);
}

th.sortable::after {
    content: '⇅';
    margin-left: 0.5rem;
    opacity: 0.3;
}

th.sortable.asc::after {
    content: '↑';
    opacity: 1;
}

th.sortable.desc::after {
    content: '↓';
    opacity: 1;
}

th.numeric {
    text-align: right;
}

td {
    padding: 10px 8px;
    border: 1px solid var(--border-color);
    font-size: 13px;
}

td.numeric {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

tbody tr:hover {
    background: #f1f3f4;
}

.budget-cell {
    font-weight: 600;
}

.budget-positive {
    color: var(--success-color);
}

.start-year-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.year-2025 {
    background: rgba(255, 64, 0, 0.15);
    color: #ff4000;
}

.year-2026 {
    background: rgba(63, 51, 77, 0.15);
    color: #3f334d;
}

.year-2027 {
    background: rgba(193, 128, 157, 0.15);
    color: #c1809d;
}

.year-null {
    background: #f3f4f6;
    color: #6b7280;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 0;
    border: 1px solid var(--border-color);
    gap: 1rem;
    flex-wrap: wrap;
}

#page-info {
    color: var(--text-secondary);
    font-size: 13px;
}

#items-per-page {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0;
    font-size: 13px;
}

/* Source */
.source {
    margin-top: 40px;
    color: var(--text-secondary);
    font-size: 12px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.source p {
    margin-bottom: 5px;
}

/* Map Section */
.map-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 20px;
    margin-bottom: 30px;
}

/* Hide map when embedded */
body.hide-map .map-section {
    display: none;
}

.map-section h2 {
    color: var(--text-primary);
    font-size: 24px;
    font-weight: normal;
    margin-top: 0;
    margin-bottom: 20px;
    text-transform: none;
}

.map-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.map-controls .btn-secondary.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.map-legend {
    display: flex;
    gap: 15px;
    margin-left: auto;
    flex-wrap: wrap;
}

.map-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
}

.legend-marker {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

#map {
    width: 100%;
    height: 500px;
    border: 1px solid var(--border-color);
    background: #f8f9fa;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .table-container {
        overflow-x: auto;
    }

    table {
        min-width: 1000px;
    }

    .filters-grid {
        grid-template-columns: 1fr;
    }
}

/* Loading state */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(3, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}
