/* Preserve typography and branding from the approved visual prototype. */
.corpu-public,
.login-page {
    font-family: var(--corpu-font-body);
}

.corpu-public h1,
.corpu-public h2,
.corpu-public h3,
.corpu-public .brand,
.login-page h1,
.login-page h2,
.login-page h3 {
    font-family: var(--corpu-font-heading);
}

.corpu-app-body {
    --dashboard-brand: #051650;
    --dashboard-accent: #2479d8;
    --dashboard-line: #e2e8f0;
    --dashboard-ink: #182433;
    --dashboard-muted: #758295;
    margin: 0;
    background: #f8fafc;
    color: var(--dashboard-ink);
    font-family: var(--corpu-font-app);
    font-size: 13px;
}

.corpu-app-body .ic {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: 0 0 auto;
}

.corpu-app-body button,
.corpu-app-body input,
.corpu-app-body select,
.corpu-app-body textarea {
    font: inherit;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 235px;
    padding: 25px 16px;
    background: var(--dashboard-brand);
    color: #b4c9e9;
    display: flex;
    flex-direction: column;
    z-index: 25;
    overflow: auto;
}

.sidebar-brand {
    min-height: 77px;
    align-items: center;
    gap: 12px;
    padding: 13px 12px;
    margin-bottom: 25px;
    background: #fff;
    border-radius: 8px;
    display: flex;
}

.sidebar-brand img.crest {
    width: 28px;
    height: 36px;
    max-height: none;
    object-fit: contain;
    flex: 0 0 auto;
}

.sidebar-brand img.wordmark {
    width: 140px;
    height: 52px;
    max-height: none;
    object-fit: contain;
}

.sidebar-nav {
    display: block;
}

.side-label {
    margin: 0;
    padding: 12px 14px;
    color: #7899ca;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 1.4px;
}

.navitem {
    width: 100%;
    min-height: 44px;
    margin: 3px 0;
    padding: 12px 14px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    background: transparent;
    color: inherit;
    text-align: left;
    font-size: 12px;
    transition: background .2s ease, color .2s ease;
}

.navitem:hover {
    background: #ffffff0c;
    color: #fff;
}

.navitem.active {
    background: #ffffff19;
    color: #fff;
    box-shadow: inset 3px 0 #6db8ff;
    font-weight: 600;
}

.navitem .nav-count {
    margin-left: auto;
    padding: 2px 6px;
    border-radius: 4px;
    background: #ffffff15;
    color: inherit;
    font-size: 9px;
}

.navitem .nav-icon {
    width: 20px;
    height: 20px;
}

.side-bottom {
    margin-top: auto;
    padding-top: 20px;
}

.side-utility {
    border: 0;
}

.side-user {
    width: 100%;
    padding: 18px 6px 0;
    border: 0;
    border-top: 1px solid #ffffff18;
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    color: #fff;
    text-align: left;
}

.side-user-copy {
    min-width: 0;
    flex: 1;
}

.side-user strong,
.side-user small {
    display: block;
}

.side-user strong {
    font-size: 11px;
}

.side-user small {
    margin-top: 5px;
    color: #8caad4;
    font-size: 9px;
}

.side-user-icon {
    width: 16px !important;
    height: 16px !important;
    margin-left: auto;
}

.avatar-frame {
    position: relative;
    display: inline-block;
    width: 37px;
    height: 37px;
    flex: 0 0 auto;
    overflow: hidden;
    border: 2px solid #ffffff35;
    border-radius: 50%;
    background: #dce6f2;
}

.avatar-frame img.avatar {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
    object-fit: cover;
    object-position: center center;
    transform: none;
    transform-origin: center center;
}

.app-main {
    min-height: 100vh;
    margin-left: 235px;
    padding: 0 28px 28px;
}

.topbar {
    height: 68px;
    margin-bottom: 27px;
    border-bottom: 1px solid #e9eef5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.topbar-path,
.top-actions {
    display: flex;
    align-items: center;
}

.topbar-path {
    gap: 12px;
}

.top-actions {
    gap: 12px;
}

.breadcrumb {
    padding: 0;
    color: var(--dashboard-muted);
    font-size: 11px;
}

.breadcrumb span {
    margin: 0 9px;
}

.breadcrumb b {
    color: #60718a;
    font-weight: 600;
}

.status-chip {
    padding: 6px 9px;
    border: 1px solid #dce7f3;
    border-radius: 4px;
    background: #eef5fc;
    color: #54708f;
    font-size: 9px;
    letter-spacing: .6px;
}

.iconbtn {
    position: relative;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--dashboard-line);
    border-radius: 6px;
    display: inline-grid;
    place-items: center;
    background: #fff;
    color: var(--dashboard-ink);
}

.iconbtn .ic {
    width: 18px;
    height: 18px;
}

.mobile-toggle {
    display: none;
}

.notif-dot {
    position: absolute;
    top: 5px;
    right: 6px;
    width: 6px;
    height: 6px;
    border: 1px solid #fff;
    border-radius: 50%;
    background: #e75959;
}

.topbar-profile {
    padding: 0;
    border: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: transparent;
}

.pagehead {
    margin: 0 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.pagehead .eyebrow {
    margin: 0 0 7px;
    color: var(--dashboard-muted);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 1.4px;
}

.pagehead h1 {
    margin: 0;
    font-size: 25px;
    font-weight: 600;
    letter-spacing: -.7px;
}

.head-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.head-actions select {
    min-width: 270px;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid #dce4ef;
    border-radius: 6px;
    background: #fff;
    color: #283b52;
}

.corpu-app-body .btn {
    min-height: 40px;
    padding: 10px 14px;
    border: 1px solid var(--dashboard-line);
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #fff;
    color: inherit;
    font-size: 11px;
    font-weight: 500;
}

.corpu-app-body .btn.primary {
    border-color: var(--dashboard-brand);
    background: var(--dashboard-brand);
    color: #fff;
}

.corpu-app-body .btn .ic {
    width: 16px;
    height: 16px;
}

.card {
    min-width: 0;
    border: 1px solid var(--dashboard-line);
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 2px 2px #132e5402;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.card:hover {
    border-color: #c9d8ec;
    box-shadow: 0 9px 25px #132e5410;
    transform: scale(1.01);
}

.top-grid {
    margin-bottom: 18px;
    display: grid;
    grid-template-columns: 2.05fr 1fr 1fr;
    gap: 18px;
}

.welcome {
    position: relative;
    min-height: 247px;
    padding: 24px;
    overflow: hidden;
    background: linear-gradient(120deg, #e7f1ff, #fff 70%);
}

.welcome-copy {
    position: relative;
    z-index: 2;
    max-width: 65%;
}

.welcome-eyebrow {
    margin: 0 0 8px !important;
    color: #3576bb !important;
}

.welcome h2 {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -.6px;
}

.welcome-copy > p:not(.eyebrow) {
    max-width: 270px;
    margin: 0 0 17px;
    color: #6e7f96;
    font-size: 11px;
    line-height: 1.7;
}

.welcome-image {
    position: absolute;
    right: -12px;
    bottom: 0;
    width: 43%;
    height: 100%;
    object-fit: cover;
    object-position: 27% center;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 30%);
    mask-image: linear-gradient(90deg, transparent, #000 30%);
}

.link-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: #1865b9;
    font-size: 10px;
    font-weight: 600;
}

.welcome-metrics {
    margin-top: 28px;
    display: flex;
    gap: 24px;
}

.welcome-metrics > div {
    min-width: 108px;
}

.label {
    color: var(--dashboard-muted);
    font-size: 9px;
    letter-spacing: .7px;
    text-transform: uppercase;
}

.welcome-metric {
    display: block;
    margin: 8px 0;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -.4px;
}

.trend {
    color: #2da86b;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0;
}

.tiny,
.muted,
.smallcard-meta {
    color: var(--dashboard-muted);
    font-size: 10px;
}

.thin-progress {
    width: 100%;
    height: 4px;
    border: 0;
    border-radius: 9px;
    overflow: hidden;
    background: #e9eef5;
    appearance: none;
}

.thin-progress::-webkit-progress-bar {
    background: #e9eef5;
    border-radius: 9px;
}

.thin-progress::-webkit-progress-value {
    background: var(--dashboard-accent);
    border-radius: 9px;
}

.thin-progress::-moz-progress-bar {
    background: var(--dashboard-accent);
    border-radius: 9px;
}

.thin-progress.success::-webkit-progress-value {
    background: #2da86b;
}

.thin-progress.success::-moz-progress-bar {
    background: #2da86b;
}

.metric-card {
    position: relative;
    min-height: 247px;
    padding: 22px 18px 0;
    overflow: hidden;
    display: block;
}

.metric-card .metric,
.smallcard .metric {
    display: block;
    margin: 8px 0;
    font-size: 27px;
    font-weight: 600;
    letter-spacing: -.8px;
}

.metric-card p {
    margin: 0;
    color: var(--dashboard-muted);
    font-size: 10px;
}

.sparkline {
    width: 100%;
    height: 85px;
    margin-top: 19px;
    overflow: visible;
}

.sparkline-line {
    fill: none;
    stroke: var(--dashboard-accent);
    stroke-width: 2.3;
    stroke-linecap: round;
}

.sparkline-area {
    fill: #2479d814;
    stroke: none;
}

.sparkline--compact {
    height: 49px;
    margin: 8px -20px 0;
    width: calc(100% + 40px);
}

.sparkline--bars rect {
    fill: var(--dashboard-accent);
}

.target-chart {
    position: relative;
    height: 135px;
    margin-top: 3px;
}

.target-gauge {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.target-gauge-track,
.target-gauge-value {
    fill: none;
    stroke-width: 18;
    stroke-linecap: round;
}

.target-gauge-track {
    stroke: #e6edf6;
}

.target-gauge-value {
    stroke: var(--dashboard-accent);
}

.donut-center {
    position: absolute;
    inset: 50px 0 auto;
    text-align: center;
    font-size: 29px;
    font-weight: 600;
}

.donut-center small {
    display: block;
    margin-top: 2px;
    color: var(--dashboard-muted);
    font-size: 8px;
    font-weight: 400;
    letter-spacing: 1px;
}

.grid4 {
    margin-bottom: 18px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.smallcard {
    position: relative;
    min-height: 158px;
    padding: 19px 20px 0;
    overflow: hidden;
}

.smallcard .metric {
    margin: 9px 0 12px;
    font-size: 24px;
}

.smallcard-head,
.smallcard-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.smallcard .badge {
    padding: 4px 7px;
    border-radius: 4px;
    background: #edf4fc;
    color: #4d719e;
    font-size: 8px;
}

.main-progress {
    margin-top: 13px;
}

.quickcard {
    min-height: 70px;
    padding: 16px 18px;
    border: 1px solid var(--dashboard-line);
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
}

.quickicon {
    width: 37px;
    height: 37px;
    border-radius: 7px;
    display: grid;
    place-items: center;
    background: #1973ce;
    color: #fff;
}

.quickicon.green { background: #29a85f; }
.quickicon.dark { background: #152d4d; }
.quickicon.sky { background: #329cda; }
.quickicon .ic { width: 19px; height: 19px; }

.quickcard strong {
    display: block;
    font-size: 12px;
}

.quickcard small {
    display: block;
    margin-top: 5px;
    color: var(--dashboard-muted);
    font-size: 9px;
}

.analytics {
    margin-bottom: 22px;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 18px;
}

.analytics-card {
    min-height: 290px;
}

.card-head {
    padding: 20px 22px 0;
}

.card-head h2 {
    font-size: 14px;
    font-weight: 600;
}

.card-head p {
    margin: 6px 0 0;
    color: var(--dashboard-muted);
    font-size: 10px;
}

.mini-chart {
    height: 190px;
    padding: 25px 22px 8px;
}

.map-placeholder {
    min-height: 190px;
    margin-top: 20px;
}

[data-theme-mode="dark"] .corpu-app-body {
    background: #101827;
    color: #dce5f2;
}

[data-theme-mode="dark"] .card,
[data-theme-mode="dark"] .iconbtn,
[data-theme-mode="dark"] .head-actions select,
[data-theme-mode="dark"] .corpu-app-body .btn {
    border-color: #2c3c53;
    background: #172235;
    color: #dce5f2;
}

[data-theme-mode="dark"] .corpu-app-body .btn.primary {
    border-color: #2d76d2;
    background: #2d76d2;
    color: #fff;
}

[data-theme-mode="dark"] .welcome {
    background: linear-gradient(120deg, #1d3557, #172235 80%);
}

[data-theme-mode="dark"] .topbar {
    border-color: #2c3c53;
}

[data-theme-mode="dark"] .status-chip {
    border-color: #365273;
    background: #223753;
    color: #b7d2f0;
}

@media (max-width: 1200px) {
    .top-grid {
        grid-template-columns: 1.55fr 1fr 1fr;
    }

    .grid4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .sidebar {
        position: static;
        width: auto;
        min-height: auto;
    }

    .app-main {
        margin-left: 0;
        padding: 0 18px 28px;
    }

    .mobile-toggle {
        display: inline-grid;
    }

    .top-grid,
    .analytics {
        grid-template-columns: 1fr;
    }

    .welcome {
        min-height: 250px;
    }

    .pagehead {
        align-items: flex-start;
    }

    .head-actions {
        flex-wrap: wrap;
    }
}

@media (max-width: 650px) {
    .top-actions .status-chip,
    .topbar-profile {
        display: none;
    }

    .breadcrumb {
        display: none;
    }

    .pagehead {
        display: block;
    }

    .head-actions {
        margin-top: 14px;
    }

    .head-actions select {
        min-width: 0;
        width: 100%;
    }

    .grid4 {
        grid-template-columns: 1fr;
    }

    .welcome-copy {
        max-width: 72%;
    }
}
