:root {
    --epgip-ink: #172033;
    --epgip-ink-2: #24324a;
    --epgip-bg: #f5f7fb;
    --epgip-surface: #ffffff;
    --epgip-line: #dde4ef;
    --epgip-muted: #667085;
    --epgip-primary: #273c75;
    --epgip-primary-2: #3c5aa6;
    --epgip-success: #168557;
    --epgip-warning: #b7791f;
    --epgip-danger: #c53030;
    --epgip-info: #087ea4;
    --epgip-neutral: #536173;
}

[x-cloak] {
    display: none !important;
}

body {
    min-height: 100vh;
    background: var(--epgip-bg);
    color: var(--epgip-ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    overflow-x: hidden;
}

.app-frame {
    min-height: 100vh;
    overflow-x: hidden;
}

.app-content {
    min-width: 0;
}

.app-main {
    min-width: 0;
}

.min-w-0 {
    min-width: 0;
}

.app-sidebar {
    background: linear-gradient(180deg, #111827 0%, #172033 52%, #1e2a44 100%);
    color: #f8fafc;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: #eef4ff;
    color: var(--epgip-primary);
    font-weight: 800;
}

.brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    object-fit: contain;
    background: #eef4ff;
    padding: .25rem;
}

.brand-logo-lg {
    width: 54px;
    height: 54px;
}

.sidebar-brand {
    margin-bottom: 1.15rem;
}

.sidebar-nav {
    gap: .28rem;
}

.nav-group {
    min-width: 0;
}

.nav-group-toggle {
    color: #dbe6f7;
    width: 100%;
    display: flex;
    align-items: center;
    gap: .62rem;
    padding: .58rem .72rem;
    border-radius: 8px;
    border: 0;
    border-left: 3px solid transparent;
    background: transparent;
    text-align: left;
    transition: background-color .16s ease, color .16s ease, border-color .16s ease;
}

.nav-group-toggle:hover,
.nav-group-toggle.active {
    background: linear-gradient(90deg, color-mix(in srgb, var(--nav-accent) 25%, transparent), rgba(255, 255, 255, .06));
    border-left-color: var(--nav-accent);
    color: #fff;
}

.nav-group-toggle .nav-caret {
    color: color-mix(in srgb, var(--nav-accent) 70%, #fff);
}

.nav-group-items {
    display: grid;
    gap: .2rem;
    padding: .18rem 0 .35rem .55rem;
}

.nav-link-epgip {
    --nav-accent: #7aa2ff;
    color: #c8d2e4;
    display: flex;
    align-items: center;
    gap: .62rem;
    padding: .58rem .72rem;
    border-radius: 8px;
    text-decoration: none;
    border-left: 3px solid transparent;
    min-width: 0;
    transition: background-color .16s ease, color .16s ease, border-color .16s ease, transform .16s ease;
}

.nav-group-items .nav-link-epgip {
    padding: .48rem .62rem;
    font-size: .92rem;
}

.nav-link-epgip .nav-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: var(--nav-accent);
    background: color-mix(in srgb, var(--nav-accent) 14%, transparent);
    flex: 0 0 auto;
}

.nav-link-epgip .nav-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-link-epgip:hover,
.nav-link-epgip.active {
    background: linear-gradient(90deg, color-mix(in srgb, var(--nav-accent) 23%, transparent), rgba(255, 255, 255, .075));
    border-left-color: var(--nav-accent);
    color: #fff;
}

.nav-link-epgip:hover {
    transform: translateX(1px);
}

.nav-link-epgip.active .nav-icon {
    background: var(--nav-accent);
    color: #08111f;
}

.nav-badge {
    margin-left: auto;
    min-width: 1.35rem;
    height: 1.35rem;
    border-radius: 999px;
    background: var(--nav-accent);
    color: #08111f;
    display: inline-grid;
    place-items: center;
    font-size: .72rem;
    font-weight: 800;
}

.topbar {
    background: rgba(255, 255, 255, .86);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--epgip-line);
}

.app-footer {
    background: rgba(255, 255, 255, .86);
    border-top: 1px solid var(--epgip-line);
}

.page-title {
    letter-spacing: 0;
}

.surface {
    background: var(--epgip-surface);
    border: 1px solid var(--epgip-line);
    border-radius: 8px;
    min-width: 0;
}

.console-section {
    margin-bottom: 1rem;
}

.section-head {
    padding: .78rem 1rem;
    border-bottom: 1px solid var(--epgip-line);
}

.metric-tile {
    min-height: 96px;
    position: relative;
    overflow: hidden;
}

.metric-tile::after {
    content: "";
    position: absolute;
    inset: auto -18px -28px auto;
    width: 76px;
    height: 76px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--tile-tone, var(--epgip-primary)) 11%, transparent);
}

.metric-tile:hover {
    border-color: color-mix(in srgb, var(--tile-tone, var(--epgip-primary)) 34%, var(--epgip-line));
}

.metric-label {
    color: var(--epgip-muted);
    font-size: .84rem;
    font-weight: 700;
    line-height: 1.25;
}

.metric-value {
    color: var(--epgip-ink);
    font-size: 2rem;
    line-height: 1.05;
    font-weight: 800;
    letter-spacing: 0;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.metric-hint {
    font-size: .76rem;
    color: var(--epgip-muted);
}

.icon-box {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: var(--tile-tone, var(--epgip-primary));
    background: color-mix(in srgb, var(--tile-tone, var(--epgip-primary)) 12%, white);
    flex: 0 0 auto;
}

.badge-epgip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    border-radius: 999px;
    padding: .32rem .62rem;
    font-size: .78rem;
    font-weight: 700;
    border: 1px solid transparent;
}

.tone-success { --tone: var(--epgip-success); color: #0f5132; background: #e9f8f1; border-color: #bfe8d3; }
.tone-warning { --tone: var(--epgip-warning); color: #7a4b12; background: #fff5db; border-color: #f3d38c; }
.tone-danger { --tone: var(--epgip-danger); color: #842029; background: #fdecec; border-color: #f3b9b9; }
.tone-info { --tone: var(--epgip-info); color: #075985; background: #e7f6fb; border-color: #b9e3f1; }
.tone-neutral { --tone: var(--epgip-neutral); color: #344054; background: #eef2f6; border-color: #d5dce7; }

.btn-epgip {
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    font-weight: 700;
}

.btn-primary-epgip {
    background: var(--epgip-primary);
    border-color: var(--epgip-primary);
    color: #fff;
}

.btn-primary-epgip:hover {
    background: var(--epgip-primary-2);
    border-color: var(--epgip-primary-2);
    color: #fff;
}

.table-epgip th {
    color: var(--epgip-muted);
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .02em;
    background: #f8fafc;
}

.table-epgip > :not(caption) > * > * {
    padding: .58rem .78rem;
}

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

.timeline-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: var(--epgip-primary);
    box-shadow: 0 0 0 4px #e6ecfa;
}

.stage-rail {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: .5rem;
}

.stage-step {
    border: 1px solid var(--epgip-line);
    border-radius: 8px;
    padding: .65rem;
    min-height: 80px;
    background: #fff;
    color: var(--epgip-ink);
    text-align: left;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
    width: 100%;
}

button.stage-step:hover {
    border-color: var(--epgip-info);
    box-shadow: 0 8px 20px rgba(15, 23, 42, .08);
    transform: translateY(-1px);
}

.stage-step.active {
    border-color: var(--epgip-primary);
    background: #eef4ff;
}

.stage-step.done {
    border-color: #bfe8d3;
    background: #f0fbf6;
}

.stage-step.selected {
    box-shadow: inset 0 0 0 2px var(--epgip-primary), 0 8px 20px rgba(39, 60, 117, .12);
}

.stage-hover-stats {
    color: var(--epgip-muted);
}

.workflow-event {
    scroll-margin-top: 90px;
}

.login-panel {
    min-height: 100vh;
    background:
        linear-gradient(135deg, rgba(39, 60, 117, .94), rgba(17, 24, 39, .96)),
        radial-gradient(circle at 20% 20%, rgba(14, 165, 233, .16), transparent 30%);
}

.login-card {
    max-width: 430px;
    border-radius: 8px;
}

.page-header-compact {
    margin-bottom: 1.15rem;
}

.page-kicker {
    color: var(--epgip-muted);
    font-size: .84rem;
    margin-bottom: .18rem;
}

.page-subtitle {
    color: var(--epgip-muted);
    margin-bottom: 0;
}

.report-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    color: inherit;
    text-decoration: none;
}

.report-card > div:first-child {
    min-width: 0;
}

.report-card:hover {
    border-color: color-mix(in srgb, var(--tile-tone, var(--epgip-primary)) 34%, var(--epgip-line));
}

.report-card .metric-value {
    font-size: 1.8rem;
}

.admin-link {
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .6rem .7rem;
    border: 1px solid var(--epgip-line);
    border-radius: 8px;
    text-decoration: none;
    color: var(--epgip-ink);
    background: #fff;
    font-weight: 700;
}

.admin-link:hover {
    border-color: color-mix(in srgb, var(--epgip-primary) 30%, var(--epgip-line));
    background: #f8fbff;
}

.admin-kv {
    display: grid;
    gap: .7rem;
}

.admin-kv > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--epgip-line);
    padding-bottom: .55rem;
}

.admin-kv span {
    color: var(--epgip-muted);
}

.admin-kv strong {
    text-align: right;
}

.compact-list {
    max-height: 310px;
    overflow: auto;
}

.form-label {
    margin-bottom: .32rem;
}

.form-control,
.form-select,
.input-group-text {
    border-radius: 8px;
}

.registration-steps {
    display: grid;
    gap: .5rem;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.step-pill {
    border: 1px solid var(--epgip-line);
    background: #fff;
    color: var(--epgip-muted);
    border-radius: 8px;
    padding: .55rem .65rem;
    display: flex;
    align-items: center;
    gap: .45rem;
    font-weight: 800;
}

.step-pill span {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    background: #edf2ff;
    color: var(--epgip-primary);
    font-size: .8rem;
}

.step-pill.active {
    border-color: color-mix(in srgb, var(--epgip-primary) 42%, var(--epgip-line));
    background: #f7f9ff;
    color: var(--epgip-ink);
    box-shadow: inset 3px 0 0 var(--epgip-primary);
}

.section-title {
    font-size: 1rem;
    font-weight: 900;
    color: var(--epgip-ink);
    padding-bottom: .65rem;
    margin-bottom: .8rem;
    border-bottom: 1px solid var(--epgip-line);
}

.info-strip,
.review-panel {
    border: 1px solid var(--epgip-line);
    background: #f8fbff;
    border-radius: 8px;
    padding: .8rem;
}

.info-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.review-panel {
    min-height: 132px;
}

.review-panel strong {
    display: block;
    margin-top: .5rem;
}

.review-panel p {
    margin: .35rem 0 0;
    color: var(--epgip-muted);
}

@media (min-width: 992px) {
    .app-sidebar {
        min-height: 100vh;
        position: sticky;
        top: 0;
    }
}

@media (max-width: 1199.98px) {
    .metric-value {
        font-size: 1.72rem;
    }
}

.enterprise-context {
    border-left: 3px solid var(--epgip-info);
}
.enterprise-context .advanced-filter .form-control {
    max-width: 150px;
}
.enterprise-context .advanced-filter .fy-filter {
    max-width: 86px;
}
.geo-filter-grid {
    display: grid;
    gap: .5rem;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.enterprise-context .geo-filter-grid {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
}
.enterprise-context .geo-filter-grid .form-label {
    display: none;
}
.enterprise-context .geo-filter-control {
    max-width: 190px;
}
.geo-filter-grid-compact .geo-filter-control {
    min-width: 135px;
}
.executive-brief {
    border-left: 3px solid var(--epgip-primary);
}
.registration-snapshot-card {
    background: linear-gradient(180deg, #fff, #f8fafc);
}
.executive-summary-strip {
    border-top: 3px solid var(--epgip-primary);
}
.executive-summary-grid {
    display: grid;
    gap: .5rem;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.summary-cell {
    background: #f8fafc;
    border: 1px solid #d8e1ee;
    border-radius: 8px;
    min-width: 0;
    padding: .65rem .75rem;
}
.summary-cell span {
    color: var(--epgip-muted);
    display: block;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
}
.summary-cell strong {
    color: var(--epgip-ink);
    display: block;
    font-size: .92rem;
    line-height: 1.2;
    margin-top: .2rem;
    overflow-wrap: anywhere;
}
.summary-cell.tone-success {
    border-color: rgba(22, 163, 74, .35);
    background: #f0fdf4;
}
.summary-cell.tone-warning {
    border-color: rgba(217, 119, 6, .35);
    background: #fffbeb;
}
.summary-cell.tone-danger {
    border-color: rgba(220, 38, 38, .35);
    background: #fef2f2;
}
.registration-pills {
    gap: .35rem;
}
.registration-pills .nav-link {
    border: 1px solid #d8e1ee;
    border-radius: 8px;
    color: var(--epgip-muted);
    font-size: .86rem;
    font-weight: 700;
    padding: .45rem .75rem;
}
.registration-pills .nav-link.active {
    background: var(--epgip-primary);
    border-color: var(--epgip-primary);
    color: #fff;
}
.geo-path {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #d8e1ee;
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    padding: .65rem .75rem;
}
.geo-path span {
    color: var(--epgip-ink);
    font-size: .88rem;
    font-weight: 700;
}
.geo-path span:not(:last-child)::after {
    color: var(--epgip-muted);
    content: ">";
    margin-left: .35rem;
}
.snapshot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: .65rem .85rem;
}
.snapshot-grid div {
    min-width: 0;
}
.snapshot-grid dt {
    color: var(--epgip-muted);
    font-size: .72rem;
    font-weight: 700;
    margin-bottom: .12rem;
    text-transform: uppercase;
}
.snapshot-grid dd {
    color: var(--epgip-ink);
    font-size: .86rem;
    font-weight: 650;
    margin-bottom: 0;
    overflow-wrap: anywhere;
}
.snapshot-wide {
    grid-column: 1 / -1;
}
@media (max-width: 991.98px) {
    .app-sidebar {
        position: relative;
        max-height: 44vh;
        overflow-y: auto;
    }
    .enterprise-context .advanced-filter {
        width: 100%;
        flex-wrap: wrap;
    }
    .enterprise-context .advanced-filter .form-control {
        max-width: none;
        flex: 1 1 140px;
    }
    .enterprise-context .geo-filter-control {
        max-width: none;
        flex: 1 1 150px;
    }
    .topbar {
        align-items: flex-start !important;
        gap: .5rem;
    }
}
@media print {
    .app-sidebar,
    .topbar,
    .app-footer,
    .enterprise-context,
    .btn,
    .nav-group {
        display: none !important;
    }
    .app-content,
    .app-main {
        width: 100% !important;
        padding: 0 !important;
    }
    .surface {
        box-shadow: none !important;
        border: 1px solid #d6dee8 !important;
    }
}
