:root {
    --brand: #1a4e8e;
    --brand-dark: #143968;
    --brand-light: #e8f0fa;
    --accent: #e87722;
    --accent-soft: #fff4eb;
    --bg: #f4f6f8;
    --surface: #ffffff;
    --ink: #1c2430;
    --muted: #5c6773;
    --line: #e2e8ef;
    --radius: 0.75rem;
    --shadow: 0 12px 40px rgba(26, 78, 142, 0.08);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    line-height: 1.5;
}

.btn-primary {
    background: var(--brand);
    border-color: var(--brand);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
}

.btn-outline-brand {
    color: var(--brand);
    border: 1px solid var(--brand);
    background: transparent;
}

.btn-outline-brand:hover {
    background: var(--brand-light);
    color: var(--brand-dark);
    border-color: var(--brand-dark);
}

.btn-accent {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.btn-accent:hover {
    background: #cf6416;
    color: #fff;
}

.text-accent {
    color: var(--accent);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 0.2rem rgba(26, 78, 142, 0.15);
}

/* —— Guest (landing, login, MFA) —— */

.guest-body {
    min-height: 100vh;
    margin: 0;
}

.guest-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(ellipse 80% 60% at 100% 0%, rgba(232, 119, 34, 0.12), transparent 55%),
        radial-gradient(ellipse 70% 50% at 0% 100%, rgba(26, 78, 142, 0.1), transparent 50%),
        var(--bg);
}

.guest-header,
.guest-main,
.guest-footer {
    padding-left: max(1.25rem, env(safe-area-inset-left));
    padding-right: max(1.25rem, env(safe-area-inset-right));
}

.guest-header {
    padding-top: 1.25rem;
    padding-bottom: 0.5rem;
}

.guest-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 1.5rem;
    padding-bottom: 2rem;
    max-width: 1140px;
    margin: 0 auto;
    width: 100%;
}

.guest-footer {
    padding-top: 1rem;
    padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
    text-align: center;
    font-size: 0.8125rem;
    color: var(--muted);
}

.guest-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: var(--ink);
    font-size: 1.125rem;
}

.guest-brand strong {
    color: var(--brand);
    font-weight: 700;
}

.guest-brand-mark {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.5rem;
    background: linear-gradient(145deg, var(--brand), var(--brand-dark));
    position: relative;
    box-shadow: 0 4px 12px rgba(26, 78, 142, 0.25);
}

.guest-brand-mark::after {
    content: "";
    position: absolute;
    inset: 0.45rem;
    border: 2px solid var(--accent);
    border-radius: 50%;
    border-right-color: transparent;
    transform: rotate(-35deg);
}

.hero-section {
    width: 100%;
}

.hero-kicker {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.hero-title {
    font-size: clamp(1.75rem, 4vw, 2.35rem);
    font-weight: 700;
    line-height: 1.2;
    color: var(--brand-dark);
    margin-bottom: 1rem;
}

.hero-lead {
    font-size: clamp(1rem, 2.2vw, 1.125rem);
    color: var(--muted);
    max-width: 36rem;
    margin-bottom: 0;
}

.hero-features li {
    position: relative;
    padding-left: 1.35rem;
    margin-bottom: 0.5rem;
    color: var(--muted);
    font-size: 0.9375rem;
}

.hero-features li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--accent);
}

.hero-panel {
    background: var(--surface);
    border-radius: calc(var(--radius) + 0.25rem);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
}

.hero-panel-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--brand);
    margin-bottom: 1.25rem;
}

.hero-panel-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--accent);
}

.hero-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (min-width: 576px) {
    .hero-metrics {
        grid-template-columns: repeat(2, 1fr);
    }
}

.hero-metric {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    border: 1px solid var(--line);
}

.hero-metric-label {
    display: block;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    margin-bottom: 0.25rem;
}

.hero-metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--brand-dark);
    line-height: 1.2;
}

.hero-panel-note {
    margin-top: 1rem;
    font-size: 0.8125rem;
    color: var(--muted);
}

.auth-wrap {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

.auth-wrap-wide {
    max-width: 520px;
}

.auth-card {
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) + 0.25rem);
    box-shadow: var(--shadow);
}

/* —— App shell —— */

.app-shell {
    min-height: 100vh;
    display: flex;
    background: var(--bg);
}

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    min-height: 100vh;
}

.sidebar .brand {
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

.sidebar .brand span {
    color: #ffd7b8;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.92);
    border-radius: 0.5rem;
    padding: 0.65rem 0.75rem;
    margin-bottom: 0.15rem;
}

.sidebar .nav-link:hover,
.sidebar .nav-link:focus {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--surface);
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 10;
}

.metric {
    border: 0;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06);
    border-radius: var(--radius);
}

.card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.05);
}

.offcanvas .sidebar {
    width: auto;
    min-height: auto;
    padding: 0;
    background: transparent;
    color: inherit;
}

.offcanvas .sidebar .brand,
.offcanvas .sidebar .nav-link {
    color: var(--ink);
}

.offcanvas .sidebar .nav-link:hover {
    background: var(--brand-light);
    color: var(--brand-dark);
}
