@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@500;600;700;800&display=swap');

:root {
    --ink: #17142a;
    --ink-soft: #68647a;
    --surface: #ffffff;
    --surface-soft: #f7f6fb;
    --line: #e8e5ef;
    --primary: #6d28d9;
    --primary-dark: #4c1d95;
    --teal: #0f9f8f;
    --orange: #ea7b22;
    --blue: #2478e5;
    --shadow: 0 20px 60px rgba(40, 30, 70, .09);
    --radius: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--ink);
    background: #faf9fc;
    font-family: "DM Sans", system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .navbar-brand { font-family: "Manrope", system-ui, sans-serif; }
a { text-decoration: none; }

.site-header {
    position: absolute;
    inset: 0 0 auto;
    z-index: 20;
}
.navbar { background: transparent; }
.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    color: #fff;
}
.brand-mark {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border-radius: 13px;
    color: #fff;
    background: rgba(255,255,255,.16);
    border: 1px solid rgba(255,255,255,.22);
    backdrop-filter: blur(10px);
}
.brand-lockup > span:last-child { display: flex; flex-direction: column; line-height: 1.15; }
.brand-lockup strong { font-size: .98rem; font-weight: 800; }
.brand-lockup small { margin-top: .2rem; color: rgba(255,255,255,.62); font-size: .68rem; font-weight: 500; }
.site-header .nav-link { color: rgba(255,255,255,.72); font-size: .9rem; font-weight: 600; }
.site-header .nav-link:hover,
.site-header .nav-link.active { color: #fff; }

.hero-section {
    min-height: 500px;
    padding: 158px 0 98px;
    color: #fff;
    overflow: hidden;
    position: relative;
    background:
        linear-gradient(120deg, rgba(19, 12, 45, .96), rgba(70, 27, 121, .9)),
        radial-gradient(circle at 20% 10%, #8b5cf6, transparent 45%);
}
.hero-section::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .16;
    background-image:
        linear-gradient(rgba(255,255,255,.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, #000, transparent 95%);
}
.hero-orb { position: absolute; border-radius: 50%; filter: blur(1px); pointer-events: none; }
.hero-orb-one {
    width: 370px; height: 370px; right: 4%; top: -140px;
    background: radial-gradient(circle, rgba(168,85,247,.55), transparent 68%);
}
.hero-orb-two {
    width: 280px; height: 280px; left: -100px; bottom: -160px;
    background: radial-gradient(circle, rgba(20,184,166,.38), transparent 67%);
}
.eyebrow, .section-kicker {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin-bottom: .9rem;
    font-size: .77rem;
    font-weight: 800;
    letter-spacing: .11em;
    text-transform: uppercase;
}
.eyebrow {
    padding: .48rem .72rem;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 999px;
    color: #dfd4ff;
    background: rgba(255,255,255,.08);
}
.hero-section h1 {
    max-width: 850px;
    margin: 0 0 1.15rem;
    font-size: clamp(2.2rem, 5vw, 4.65rem);
    line-height: 1.02;
    letter-spacing: -.055em;
    font-weight: 800;
}
.hero-copy {
    max-width: 760px;
    margin: 0;
    color: rgba(255,255,255,.72);
    font-size: 1.08rem;
    line-height: 1.75;
}
.period-selector {
    padding: 1.1rem;
    border-radius: 18px;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.16);
    backdrop-filter: blur(16px);
}
.period-selector label { display: block; margin-bottom: .5rem; color: rgba(255,255,255,.7); font-size: .75rem; font-weight: 700; }
.period-selector .form-select {
    min-height: 46px;
    border: 0;
    box-shadow: none;
    font-weight: 700;
}
.period-selector .btn { min-width: 48px; border: 0; background: var(--primary); }
.period-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem 1.2rem;
    margin-top: 2.25rem;
    color: rgba(255,255,255,.68);
    font-size: .8rem;
}
.period-meta span { display: inline-flex; align-items: center; gap: .42rem; }
.status-dot i {
    width: 7px; height: 7px; border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 0 5px rgba(74,222,128,.12);
}

.metrics-wrap {
    position: relative;
    z-index: 5;
    margin-top: -52px;
}
.metric-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 100%;
    min-height: 145px;
    padding: 1.3rem;
    border-radius: 20px;
    background: #fff;
    border: 1px solid rgba(232,229,239,.85);
    box-shadow: var(--shadow);
}
.metric-icon {
    flex: 0 0 auto;
    width: 48px; height: 48px;
    display: inline-grid; place-items: center;
    border-radius: 15px;
    font-size: 1.2rem;
}
.metric-icon.is-purple { color: #6d28d9; background: #f0e8ff; }
.metric-icon.is-teal { color: #0f766e; background: #dcf8f3; }
.metric-icon.is-orange { color: #c55a0a; background: #fff0df; }
.metric-icon.is-blue { color: #1d64bd; background: #e4f0ff; }
.metric-card > div { min-width: 0; display: flex; flex-direction: column; }
.metric-label { color: var(--ink-soft); font-size: .75rem; font-weight: 700; }
.metric-card strong { margin: .18rem 0; font-family: "Manrope", sans-serif; font-size: 1.85rem; line-height: 1; letter-spacing: -.04em; }
.metric-card small { color: #9792a4; font-size: .68rem; }

.dashboard-section { padding-top: 78px; }
.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1.5rem;
    margin-bottom: 1.6rem;
}
.section-kicker { color: var(--primary); margin-bottom: .45rem; }
.section-heading h2 {
    margin: 0;
    font-size: clamp(1.65rem, 3vw, 2.35rem);
    letter-spacing: -.04em;
    font-weight: 800;
}
.section-heading p { margin: .55rem 0 0; color: var(--ink-soft); }
.dashboard-card {
    padding: 1.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 10px 40px rgba(28, 20, 55, .045);
}
.card-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.card-heading > div:first-child { min-width: 0; }
.card-heading span { display: block; color: #9590a2; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.card-heading h3 { margin: .28rem 0 0; font-size: 1.08rem; font-weight: 800; }
.chart-total {
    min-width: 58px;
    padding: .55rem .7rem;
    border-radius: 12px;
    text-align: center;
    color: var(--primary) !important;
    background: #f4effc;
    font-size: 1rem !important;
    letter-spacing: 0 !important;
}
.badge-soft, .matrix-hint {
    display: inline-flex !important;
    align-items: center;
    gap: .35rem;
    padding: .45rem .65rem;
    border-radius: 999px;
    color: #4c1d95 !important;
    background: #f4effc;
    font-size: .68rem !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
}
.chart-holder { position: relative; width: 100%; }
.chart-holder-donut { height: 290px; }
.chart-holder-wide { height: 360px; }
.chart-holder-territory { height: 370px; }
.chart-holder-trend { height: 300px; }
.chart-legend {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: .65rem;
    margin-top: 1rem;
}
.chart-legend > div {
    display: flex;
    align-items: center;
    gap: .55rem;
    min-width: 0;
    padding: .62rem .72rem;
    border-radius: 12px;
    background: var(--surface-soft);
}
.legend-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; }
.chart-legend span { min-width: 0; overflow: hidden; color: var(--ink-soft); font-size: .73rem; text-overflow: ellipsis; white-space: nowrap; }
.chart-legend strong { margin-left: auto; font-size: .78rem; }

.insight-panel {
    position: relative;
    overflow: hidden;
    padding: 1.8rem;
    color: #fff;
    border-radius: var(--radius);
    background: linear-gradient(145deg, #3a1765, #19122e);
}
.insight-panel::after {
    content: "";
    position: absolute; width: 180px; height: 180px; right: -70px; top: -60px;
    border-radius: 50%;
    background: rgba(168,85,247,.2);
}
.insight-icon {
    width: 46px; height: 46px;
    display: grid; place-items: center;
    margin-bottom: 2.4rem;
    border-radius: 15px;
    color: #e9d5ff;
    background: rgba(255,255,255,.1);
    font-size: 1.2rem;
}
.insight-panel .section-kicker { color: #c4b5fd; }
.insight-panel h3 { max-width: 300px; margin: 0 0 .85rem; font-size: 1.5rem; line-height: 1.2; }
.insight-panel p { color: rgba(255,255,255,.68); line-height: 1.7; font-size: .9rem; }
.insight-divider { height: 1px; margin: 1.7rem 0; background: rgba(255,255,255,.12); }
.insight-caption { display: block; margin-bottom: .25rem; color: rgba(255,255,255,.48); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
.insight-panel > strong { font-size: 1.4rem; }

.matrix-card { padding-bottom: .35rem; }
.matrix-card .table-responsive { margin: 0 -1.5rem; }
.matrix-table { min-width: 960px; }
.matrix-table thead th {
    padding: .9rem .75rem;
    border-color: var(--line);
    color: #7f798e;
    background: #faf9fc;
    font-size: .67rem;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.matrix-table thead th:first-child,
.matrix-table tbody th { padding-left: 1.5rem; text-align: left; }
.matrix-table tbody th, .matrix-table td {
    padding: .75rem;
    border-color: #f0edf4;
    font-size: .76rem;
}
.matrix-table tbody th { min-width: 185px; font-weight: 700; }
.matrix-table td { text-align: center; }
.matrix-table td span {
    display: inline-grid;
    place-items: center;
    width: 34px; height: 34px;
    border-radius: 10px;
    color: #514b5c;
}
.matrix-table .row-total { font-weight: 800; color: var(--primary); background: #fbf9ff; }
.person-dot { display: inline-block; width: 8px; height: 8px; margin-right: .55rem; border-radius: 50%; background: var(--dot); }

.territory-section {
    margin-top: 78px;
    padding: 74px 0 84px;
    background: #f1eff6;
}
.territory-list { display: flex; flex-direction: column; gap: .75rem; }
.territory-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: .8rem;
    padding: .8rem;
    border-radius: 15px;
    background: var(--surface-soft);
}
.territory-rank {
    width: 30px; height: 30px; display: grid; place-items: center;
    border-radius: 10px; color: var(--primary); background: #eee6fb;
    font-size: .72rem; font-weight: 800;
}
.territory-item div { min-width: 0; }
.territory-item strong, .territory-item small { display: block; }
.territory-item strong { font-size: .82rem; }
.territory-item small { margin-top: .12rem; color: #9691a2; font-size: .67rem; }
.territory-item > strong { font-size: 1rem; }
.territory-progress { grid-column: 2 / 4; height: 5px; overflow: hidden; border-radius: 999px; background: #e8e4ed; }
.territory-progress i { display: block; height: 100%; border-radius: inherit; background: var(--bar-color); }

.empty-state, .admin-empty {
    padding: 4rem 1.5rem;
    text-align: center;
    border: 1px dashed #d9d4e2;
    border-radius: var(--radius);
    background: #fff;
}
.empty-state > i { display: block; margin-bottom: 1rem; color: var(--primary); font-size: 2.8rem; }
.empty-state h2 { font-size: 1.5rem; }
.empty-state p { color: var(--ink-soft); }

.site-footer {
    padding: 34px 0;
    color: rgba(255,255,255,.62);
    background: #151123;
}
.site-footer .container-xxl { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.site-footer div div { display: flex; flex-direction: column; }
.site-footer strong { color: #fff; font-size: .85rem; }
.site-footer span, .site-footer p { margin: 0; font-size: .72rem; }

@media (max-width: 991.98px) {
    .site-header { position: absolute; }
    .navbar-collapse {
        margin-top: .8rem;
        padding: 1rem;
        border-radius: 18px;
        background: rgba(20,14,40,.96);
        box-shadow: 0 20px 50px rgba(0,0,0,.2);
    }
    .hero-section { padding-top: 145px; }
    .period-selector { max-width: 520px; }
    .metrics-wrap { margin-top: -38px; }
}
@media (max-width: 767.98px) {
    .hero-section { min-height: auto; padding: 128px 0 78px; }
    .hero-section h1 { font-size: 2.55rem; }
    .hero-copy { font-size: .95rem; }
    .brand-lockup strong { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .metrics-wrap { margin-top: -25px; }
    .metric-card { min-height: 145px; padding: 1rem; flex-direction: column; align-items: flex-start; gap: .65rem; }
    .metric-card strong { font-size: 1.55rem; }
    .metric-card small { display: none; }
    .metric-icon { width: 40px; height: 40px; border-radius: 12px; }
    .dashboard-section { padding-top: 58px; }
    .section-heading { align-items: flex-start; flex-direction: column; }
    .dashboard-card { padding: 1.15rem; border-radius: 20px; }
    .chart-holder-wide { height: 330px; }
    .chart-holder-donut { height: 250px; }
    .chart-legend { grid-template-columns: 1fr; }
    .matrix-card .table-responsive { margin: 0 -1.15rem; }
    .matrix-table thead th:first-child, .matrix-table tbody th { padding-left: 1.15rem; }
    .matrix-hint { display: none !important; }
    .territory-section { margin-top: 58px; padding: 58px 0; }
    .site-footer .container-xxl { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 420px) {
    .hero-section h1 { font-size: 2.15rem; }
    .metric-label { font-size: .68rem; }
    .metric-card strong { font-size: 1.4rem; }
    .card-heading { flex-wrap: wrap; }
}
