:root {
    --brand: #5b4cf0;
    --brand-dark: #3e32bb;
    --brand-soft: #efedff;
    --ink: #172033;
    --muted: #6f7890;
    --surface: #ffffff;
    --canvas: #f5f6fa;
    --border: #e7e9f1;
    --sidebar: #171a2f;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    color: var(--ink);
    background: var(--canvas);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: var(--brand); text-decoration: none; }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-dark); --bs-btn-hover-border-color: var(--brand-dark); }
.form-control, .input-group-text { border-color: var(--border); }
.form-control:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgb(91 76 240 / 12%); }

.app-shell { min-height: 100vh; display: flex; }
.sidebar {
    width: 270px;
    flex: 0 0 270px;
    min-height: 100vh;
    background: var(--sidebar);
    color: #fff;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 1040;
}
.sidebar-brand { display: flex; align-items: center; gap: .75rem; padding: .25rem .25rem 1.5rem; }
.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(145deg, #766aff, #4b3bd7);
    font-size: .8rem;
    font-weight: 800;
    letter-spacing: .04em;
    box-shadow: 0 9px 22px rgb(77 61 215 / 30%);
}
.brand-title { font-weight: 800; line-height: 1.1; }
.sidebar-brand small { color: #9ea5c3; }
.sidebar-nav { display: grid; gap: .35rem; }
.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .72rem .9rem;
    border-radius: .75rem;
    color: #b7bdd4;
    font-weight: 600;
}
.sidebar-nav .nav-link:hover, .sidebar-nav .nav-link.active { color: #fff; background: rgb(255 255 255 / 9%); }
.sidebar-nav .nav-link.active { box-shadow: inset 3px 0 var(--brand); }
.sidebar-nav .nav-link i { width: 1.25rem; font-size: 1.05rem; }
.nav-label { margin: 1.25rem .85rem .35rem; color: #737b9e; font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.sidebar-status {
    margin-top: auto;
    display: flex;
    gap: .7rem;
    align-items: flex-start;
    padding: .85rem;
    border: 1px solid rgb(255 255 255 / 8%);
    border-radius: .8rem;
    background: rgb(255 255 255 / 4%);
}
.sidebar-status strong, .sidebar-status small { display: block; }
.sidebar-status strong { font-size: .8rem; }
.sidebar-status small { color: #8f97b8; font-size: .7rem; margin-top: .2rem; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: .35rem; flex: 0 0 auto; }
.status-warning { background: #f7b84b; box-shadow: 0 0 0 4px rgb(247 184 75 / 13%); }
.sidebar-backdrop { display: none; }

.app-main { flex: 1; min-width: 0; }
.topbar {
    min-height: 82px;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border);
    background: rgb(255 255 255 / 92%);
    position: sticky;
    top: 0;
    z-index: 1020;
    backdrop-filter: blur(12px);
}
.topbar-title { margin: 0; font-size: 1.15rem; font-weight: 800; text-transform: capitalize; }
.profile-button { display: flex; align-items: center; gap: .65rem; border: 0; }
.profile-button small { display: block; color: var(--muted); font-size: .66rem; }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 800; }
.notification-pip { position: absolute; width: 7px; height: 7px; top: 8px; right: 8px; border-radius: 50%; background: #ef476f; }
.app-content { padding: 2rem; max-width: 1600px; margin: 0 auto; }

.dashboard-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: 2rem;
    color: #fff;
    border-radius: 1.25rem;
    background:
        radial-gradient(circle at 85% 15%, rgb(255 255 255 / 22%), transparent 20%),
        linear-gradient(120deg, #4b3bd7, #6f60f6);
    box-shadow: 0 18px 44px rgb(63 50 187 / 20%);
}
.dashboard-hero h2 { margin: .2rem 0 .4rem; font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 800; }
.dashboard-hero p { color: #dfdcff; }
.eyebrow { font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.metric-card, .panel { background: var(--surface); border: 1px solid var(--border); border-radius: 1rem; box-shadow: 0 8px 30px rgb(26 34 51 / 5%); }
.metric-card { min-height: 112px; padding: 1.2rem; display: flex; align-items: center; gap: 1rem; }
.metric-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: .85rem; font-size: 1.25rem; }
.metric-card span { display: block; color: var(--muted); font-size: .82rem; }
.metric-card strong { display: block; margin-top: .2rem; font-size: 1.55rem; }
.panel { padding: 1.4rem; }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--border); padding-bottom: 1rem; margin-bottom: 1rem; }
.panel-header h3 { margin: 0; font-size: 1.05rem; font-weight: 800; }
.panel-header p { margin: .2rem 0 0; color: var(--muted); font-size: .82rem; }
.pipeline-list { display: grid; gap: 1rem; }
.pipeline-row { font-size: .84rem; }
.pipeline-row .progress { margin-top: .45rem; height: 7px; background: var(--brand-soft); }
.pipeline-row .progress-bar { background: var(--brand); border-radius: 999px; }
.activity-list { display: grid; gap: 1rem; }
.activity-item { display: flex; gap: .8rem; }
.activity-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; color: #198754; background: #e8f8ef; flex: 0 0 auto; }
.activity-item strong { font-size: .86rem; }
.activity-item p { margin: .15rem 0; color: var(--muted); font-size: .8rem; }
.activity-item small { color: #9aa1b3; font-size: .7rem; }
.empty-state { text-align: center; color: var(--muted); padding: 2rem; }
.empty-state i { display: block; color: var(--brand); font-size: 2rem; margin-bottom: .75rem; }
.empty-state h2 { color: var(--ink); font-weight: 800; }
.empty-state-mark { display: inline-grid; place-items: center; width: 68px; height: 68px; border-radius: 1.1rem; background: var(--brand-soft); margin-bottom: 1rem; }

.auth-body { background: #fff; }
.auth-showcase {
    position: relative;
    align-items: flex-end;
    overflow: hidden;
    padding: 5rem;
    color: #fff;
    background:
        linear-gradient(145deg, rgb(23 26 47 / 95%), rgb(55 43 158 / 88%)),
        radial-gradient(circle at 30% 20%, #766aff, transparent 50%);
}
.auth-showcase::before, .auth-showcase::after { content: ""; position: absolute; border: 1px solid rgb(255 255 255 / 10%); border-radius: 50%; }
.auth-showcase::before { width: 520px; height: 520px; top: -180px; right: -180px; }
.auth-showcase::after { width: 340px; height: 340px; top: -90px; right: -90px; }
.auth-showcase-content { position: relative; z-index: 1; max-width: 680px; }
.brand-lockup { display: flex; align-items: center; gap: .85rem; font-size: 1.2rem; font-weight: 800; }
.brand-mark-light { background: rgb(255 255 255 / 15%); box-shadow: none; }
.auth-showcase h1 { margin: .8rem 0 1rem; max-width: 650px; font-size: clamp(2.8rem, 5.3vw, 5.2rem); line-height: .99; font-weight: 850; letter-spacing: -.04em; }
.auth-showcase p { max-width: 580px; color: #d7d5eb; font-size: 1.1rem; }
.showcase-stat { padding: 1rem; border: 1px solid rgb(255 255 255 / 12%); border-radius: 1rem; background: rgb(255 255 255 / 5%); }
.showcase-stat strong, .showcase-stat span { display: block; }
.showcase-stat strong { font-size: 1.35rem; }
.showcase-stat span { color: #b8b5d1; font-size: .75rem; }
.auth-card { max-width: 470px; }
.auth-card h2 { font-weight: 850; letter-spacing: -.02em; }
.auth-card .input-group-text { background: #fff; }
.security-note { display: flex; align-items: center; justify-content: center; gap: .45rem; margin: 2rem 0 0; color: var(--muted); font-size: .75rem; }
.error-page { min-height: 70vh; display: grid; place-content: center; text-align: center; padding: 2rem; }
.error-page > span { color: var(--brand); font-size: 5rem; line-height: 1; font-weight: 900; opacity: .18; }
.error-page h1 { font-weight: 850; }
.error-page p { color: var(--muted); }
.error-page .btn { justify-self: center; }

@media (max-width: 991.98px) {
    .sidebar { position: fixed; transform: translateX(-100%); transition: transform .2s ease; }
    body.sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-backdrop { position: fixed; inset: 0; z-index: 1030; background: rgb(16 20 35 / 50%); }
    body.sidebar-open .sidebar-backdrop { display: block; }
    .topbar, .app-content { padding-left: 1rem; padding-right: 1rem; }
}
@media (max-width: 575.98px) {
    .dashboard-hero { align-items: flex-start; flex-direction: column; padding: 1.4rem; }
    .dashboard-hero .btn { width: 100%; }
    .app-content { padding-top: 1rem; }
}

