﻿:root {
    --navy: #061a3a;
    --navy-light: #0c3268;
    --page: #f3f6fb;
    --border: #e5eaf2;
    --text: #17233d;
    --muted: #7c879c;
    --green: #54a75c;
    --blue: #2361b5;
    --purple: #7b56c2;
    --orange: #f19a36;
    --red: #e24c4b;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--page);
    color: var(--text);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    font-size: 13px;
}

.dashboard-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1000;
    display: flex;
    width: 230px;
    min-height: 100vh;
    flex-direction: column;
    overflow-y: auto;
    color: white;
    background: linear-gradient(180deg, #071d40, #04142e);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 25px 20px 10px;
}

.brand-mark {
    color: #efc75e;
    font-size: 35px;
}

.brand-country,
.brand-name {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
}

.brand-slogan {
    padding: 8px 20px 20px;
    color: #e5bd55;
    font-size: 11px;
    font-weight: 700;
}

.sidebar-nav {
    padding: 5px 10px 20px;
}

    .sidebar-nav .nav-link {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 3px;
        padding: 12px;
        border-radius: 5px;
        color: #dbe6f8;
        font-size: 12px;
    }

        .sidebar-nav .nav-link:hover,
        .sidebar-nav .nav-link.active {
            color: white;
            background: #103d79;
        }

    .sidebar-nav i {
        width: 18px;
        font-size: 16px;
    }

.filters {
    padding: 18px;
    border-top: 1px solid rgb(255 255 255 / 12%);
}

.filters-title {
    margin-bottom: 15px;
    color: #a9b9d1;
    font-size: 11px;
    font-weight: 700;
}

.filters .form-label {
    margin: 8px 0 4px;
    color: #cad6e7;
    font-size: 10px;
}

.filters .form-select {
    border-color: rgb(255 255 255 / 10%);
    color: white;
    background-color: #0a254d;
    font-size: 11px;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding: 18px;
    border-top: 1px solid rgb(255 255 255 / 12%);
}

.user-avatar {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 50%;
    color: #17233d;
    background: white;
}

.user-office {
    font-size: 11px;
    font-weight: 700;
}

.sidebar-user small {
    color: #aebbd0;
}

.dashboard-content {
    width: calc(100% - 230px);
    min-width: 0;
    margin-left: 230px;
    padding: 18px;
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 16px;
}

    .dashboard-header h1 {
        margin: 0;
        color: #152044;
        font-size: clamp(18px, 2vw, 28px);
        font-weight: 800;
    }

.header-subtitle {
    margin-top: 3px;
    color: #536078;
    font-size: 12px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

    .header-actions .form-select,
    .header-actions .btn {
        min-height: 39px;
        border-color: var(--border);
        font-size: 12px;
        white-space: nowrap;
    }

.btn-navy {
    color: white;
    background: var(--navy);
}

    .btn-navy:hover {
        color: white;
        background: var(--navy-light);
    }

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.metric-card {
    position: relative;
    display: flex;
    min-height: 105px;
    gap: 10px;
    overflow: hidden;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: white;
    box-shadow: 0 2px 7px rgb(25 46 84 / 5%);
}

.metric-icon {
    display: grid;
    width: 39px;
    height: 39px;
    flex: 0 0 39px;
    place-items: center;
    border-radius: 50%;
    font-size: 20px;
}

.metric-success {
    color: var(--green);
    background: #eef8ed;
}

.metric-primary {
    color: var(--blue);
    background: #edf4ff;
}

.metric-purple {
    color: var(--purple);
    background: #f3edff;
}

.metric-warning {
    color: var(--orange);
    background: #fff4e7;
}

.text-purple {
    color: var(--purple) !important;
}

.metric-title {
    min-height: 26px;
    color: #2c3750;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
}

.metric-value {
    margin: 2px 0;
    font-size: 24px;
    font-weight: 800;
}

.metric-change {
    color: var(--muted);
    font-size: 9px;
}

.mini-chart {
    position: absolute;
    right: 8px;
    bottom: 10px;
    width: 55px;
    height: 25px;
    color: var(--green);
    opacity: .9;
}

    .mini-chart svg {
        width: 100%;
        height: 100%;
    }

.dashboard-grid {
    display: grid;
    gap: 12px;
    margin-bottom: 12px;
}

.dashboard-grid-top {
    grid-template-columns: 1.25fr 1fr 1fr;
}

.dashboard-grid-middle {
    grid-template-columns: .75fr .8fr 1.15fr 1.15fr;
}

.dashboard-grid-bottom {
    grid-template-columns: .85fr 1.05fr 1.25fr 1.25fr .65fr;
}

.panel {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: white;
    box-shadow: 0 2px 7px rgb(25 46 84 / 4%);
}

    .panel h2 {
        margin: 0 0 13px;
        color: #273451;
        font-size: 11px;
        font-weight: 800;
        text-transform: uppercase;
    }

.panel-link {
    display: inline-block;
    margin-top: 13px;
    color: #1d5aad;
    font-size: 10px;
    font-weight: 700;
    text-decoration: none;
}

.theme-head,
.theme-row {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    align-items: center;
    gap: 12px;
}

.theme-head {
    padding: 0 0 7px 33px;
    color: var(--muted);
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
}

.theme-row {
    min-height: 29px;
    font-size: 9px;
}

.theme-name,
.theme-performance {
    display: flex;
    align-items: center;
}

.theme-name {
    min-width: 0;
    gap: 6px;
}

.theme-number {
    width: 13px;
    color: #5d6980;
}

.theme-round-icon {
    display: grid;
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
    place-items: center;
    border-radius: 50%;
    color: white;
    background: var(--green);
    font-size: 9px;
}

.theme-performance {
    gap: 8px;
}

    .theme-performance .progress {
        width: 100%;
        height: 5px;
        background: #eaf0eb;
    }

    .theme-performance strong {
        min-width: 30px;
    }

.change {
    min-width: 35px;
    font-size: 8px;
}

    .change.positive {
        color: var(--green);
    }

    .change.negative {
        color: var(--red);
    }

.chart-container {
    position: relative;
    width: 100%;
    height: 230px;
}

.chart-legend {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    color: #6d778a;
    font-size: 9px;
}

.legend-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 4px;
    border-radius: 50%;
}

.funnel-row {
    display: grid;
    grid-template-columns: 82px 1fr;
    align-items: center;
    margin-bottom: 7px;
}

    .funnel-row strong,
    .funnel-row small {
        display: block;
    }

    .funnel-row strong {
        font-size: 13px;
    }

    .funnel-row small {
        color: var(--muted);
        font-size: 8px;
    }

.funnel-bar {
    height: 33px;
    margin-inline: auto;
    padding-top: 9px;
    clip-path: polygon(5% 0, 95% 0, 85% 100%, 15% 100%);
    color: white;
    text-align: center;
    font-size: 9px;
    font-weight: 700;
}

.funnel-100 {
    width: 100%;
}

.funnel-86 {
    width: 86%;
}

.funnel-69 {
    width: 69%;
}

.funnel-45 {
    width: 45%;
}

.funnel-28 {
    width: 28%;
}

.funnel-blue {
    background: #174d9b;
}

.funnel-cyan {
    background: #258ac4;
}

.funnel-green {
    background: #55aa54;
}

.funnel-orange {
    background: #f0a234;
}

.funnel-red {
    background: #e3413f;
}

.risk-matrix {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
    min-height: 180px;
}

.risk-cell {
    display: grid;
    place-items: center;
    font-size: 14px;
    font-weight: 800;
}

    .risk-cell.low {
        color: #497339;
        background: #dff0d8;
    }

    .risk-cell.medium {
        color: #8c6622;
        background: #f8e4ad;
    }

    .risk-cell.high {
        color: #a53b36;
        background: #f4bbb5;
    }

.risk-label {
    padding-top: 10px;
    color: var(--muted);
    font-size: 9px;
    text-align: center;
}

.budget-row {
    display: grid;
    grid-template-columns: 1.4fr 1fr 35px;
    align-items: center;
    gap: 8px;
    min-height: 29px;
    font-size: 9px;
}

    .budget-row .progress {
        height: 5px;
    }

.map-placeholder {
    display: flex;
    min-height: 175px;
    align-items: center;
    justify-content: center;
    gap: 25px;
    color: #62ae70;
    background: linear-gradient(135deg, #f6fbf7, #edf7ef);
}

    .map-placeholder > i {
        font-size: 105px;
    }

    .map-placeholder div {
        display: flex;
        flex-direction: column;
    }

    .map-placeholder strong {
        font-size: 23px;
    }

    .map-placeholder span {
        color: var(--muted);
        font-size: 9px;
    }

.map-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
}

    .map-stats div {
        display: flex;
        flex-direction: column;
        padding: 8px;
        border: 1px solid var(--border);
    }

    .map-stats span {
        color: var(--muted);
        font-size: 8px;
    }

.outcomes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.outcome-item {
    display: grid;
    grid-template-columns: 32px 1fr;
    padding: 10px;
    border-radius: 5px;
    background: #fafbfd;
}

    .outcome-item i {
        grid-row: 1 / 3;
        align-self: center;
        font-size: 25px;
    }

    .outcome-item span {
        color: var(--muted);
        font-size: 8px;
    }

    .outcome-item strong {
        font-size: 15px;
    }

.initiatives-panel .table {
    margin: 0;
    font-size: 8px;
}

.initiatives-panel th {
    color: #768197;
    font-size: 7px;
    text-transform: uppercase;
}

.initiatives-panel td {
    padding: 7px 4px;
}

    .initiatives-panel td strong,
    .initiatives-panel td small {
        display: block;
    }

    .initiatives-panel td small {
        color: var(--muted);
    }

.status-badge {
    display: inline-block;
    padding: 4px 6px;
    border-radius: 10px;
    white-space: nowrap;
    font-size: 7px;
    font-weight: 700;
}

.status-danger {
    color: #c94742;
    background: #ffefed;
}

.status-success {
    color: #418a4a;
    background: #eaf7ec;
}

.action-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.action-row {
    display: grid;
    grid-template-columns: 38px 1fr;
    align-items: center;
    gap: 7px;
    padding: 9px;
}

    .action-row strong {
        font-size: 18px;
    }

    .action-row span {
        font-size: 8px;
        font-weight: 700;
    }

.action-red {
    color: #ae423d;
    background: #fff0ee;
}

.action-orange {
    color: #b87520;
    background: #fff4e4;
}

.action-blue {
    color: #2d6aa7;
    background: #ebf3fc;
}

.action-green {
    color: #43894b;
    background: #eaf7eb;
}

.dashboard-footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 7px 2px;
    color: #7a8597;
    font-size: 9px;
}

@media (max-width: 1500px) {
    .metrics-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .dashboard-grid-bottom {
        grid-template-columns: repeat(2, 1fr);
    }

    .action-panel {
        grid-column: span 2;
    }
}

@media (max-width: 1200px) {
    .dashboard-grid-top,
    .dashboard-grid-middle {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .header-actions {
        width: 100%;
        overflow-x: auto;
    }
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .25s ease;
    }

        .sidebar.open {
            transform: translateX(0);
        }

    .dashboard-content {
        width: 100%;
        margin-left: 0;
    }
}

@media (max-width: 767.98px) {
    .dashboard-content {
        padding: 10px;
    }

    .metrics-grid,
    .dashboard-grid-top,
    .dashboard-grid-middle,
    .dashboard-grid-bottom {
        grid-template-columns: 1fr;
    }

    .action-panel {
        grid-column: auto;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .theme-head,
    .theme-row {
        grid-template-columns: 1fr;
    }

    .theme-head {
        display: none;
    }

    .theme-performance {
        padding: 0 0 7px 32px;
    }
}

@media (max-width: 480px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .outcomes-grid,
    .map-stats {
        grid-template-columns: 1fr;
    }

    .dashboard-footer {
        flex-direction: column;
    }
}

@media print {
    .sidebar,
    .header-actions,
    #sidebarToggle {
        display: none !important;
    }

    .dashboard-content {
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .panel,
    .metric-card {
        break-inside: avoid;
        box-shadow: none;
    }
}
