/* ==================================================================
   Royal CRM - Panel design system
   Light and dark, blue forward, soft cards with sparklines.
   Scoped to the panel shells so the public website keeps its palette.
   ================================================================== */

.panel-body,
.auth-wrap,
.install-wrap,
.error-wrap {
    --bg: #F5F8FD;
    --card: #FFFFFF;
    --card-2: #FAFBFE;
    --line: #E7EDF7;
    --line-soft: #EFF3FA;

    --ink: #0F1B33;
    --ink-soft: #46536B;
    --muted: #7B8799;

    --primary: #2E6BFF;
    --primary-600: #1E56E6;
    --primary-soft: #E9F0FF;
    --primary-ring: rgba(46, 107, 255, .18);

    --teal: #0FB5A5;
    --teal-soft: #E1F7F4;
    --green: #16A34A;
    --green-soft: #E6F6EC;
    --amber: #EA9214;
    --amber-soft: #FDF2E1;
    --rose: #EF4B4B;
    --rose-soft: #FDECEC;
    --violet: #7A5CFF;
    --violet-soft: #EFEBFF;

    --side-1: #0B1B3A;
    --side-2: #122349;
    --side-text: rgba(226, 235, 250, .78);
    --side-muted: rgba(226, 235, 250, .42);

    --r-sm: 10px;
    --r: 14px;
    --r-lg: 18px;
    --r-xl: 24px;

    --shadow-sm: 0 1px 2px rgba(15, 27, 51, .05);
    --shadow: 0 1px 2px rgba(15, 27, 51, .04), 0 10px 28px -16px rgba(15, 27, 51, .22);
    --shadow-lg: 0 18px 44px -22px rgba(15, 27, 51, .34);

    --font: 'Plus Jakarta Sans', 'Segoe UI', Helvetica, Arial, sans-serif;
}

/* Dark mode ------------------------------------------------------- */
.panel-body.is-dark,
.auth-wrap.is-dark,
.install-wrap.is-dark {
    --bg: #0A1122;
    --card: #121A2E;
    --card-2: #16203A;
    --line: #22304C;
    --line-soft: #1B2740;

    --ink: #E9EFFB;
    --ink-soft: #B7C4DA;
    --muted: #8695B0;

    --primary-soft: #17264C;
    --teal-soft: #0E2C31;
    --green-soft: #102A20;
    --amber-soft: #2E2312;
    --rose-soft: #331A1C;
    --violet-soft: #221C42;

    --side-1: #070E1D;
    --side-2: #0D1830;

    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 30px -18px rgba(0, 0, 0, .8);
    --shadow-lg: 0 20px 46px -22px rgba(0, 0, 0, .85);
}

/* Base ------------------------------------------------------------ */
.panel-body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    transition: background .2s ease, color .2s ease;
}

.panel-body h1, .panel-body h2, .panel-body h3, .panel-body h4,
.auth-wrap h1, .auth-wrap h2, .install-wrap h1 {
    font-family: var(--font);
    color: var(--ink);
    letter-spacing: -0.02em;
}

.panel-shell { display: flex; min-height: 100vh; }

/* Sidebar --------------------------------------------------------- */
.sidebar {
    width: 268px;
    flex-shrink: 0;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, var(--side-1) 0%, var(--side-2) 100%);
    color: var(--side-text);
    overflow-y: auto;
    overflow-x: hidden;
    transition: width .22s ease, transform .26s ease;
    scrollbar-width: thin;
}

.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 6px; }

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1.3rem 1.2rem 1.1rem;
    position: sticky;
    top: 0;
    background: var(--side-1);
    z-index: 3;
}

.sidebar-brand img {
    height: 42px; width: 42px; border-radius: 13px; flex-shrink: 0;
    box-shadow: 0 6px 18px -8px rgba(46,107,255,.9);
}

.sidebar-brand .brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.sidebar-brand .brand-name { font-size: 1.06rem; font-weight: 800; color: #fff; letter-spacing: -0.03em; white-space: nowrap; }
.sidebar-brand .brand-name em { font-style: normal; color: #6FA0FF; }
.sidebar-brand .brand-sub { font-size: .72rem; color: var(--side-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-collapse {
    margin-left: auto; width: 30px; height: 30px; flex-shrink: 0;
    display: grid; place-items: center; border: 0; border-radius: 9px;
    background: rgba(255,255,255,.07); color: rgba(255,255,255,.6);
    cursor: pointer; font-size: .95rem; transition: all .15s ease;
}
.sidebar-collapse:hover { background: rgba(255,255,255,.14); color: #fff; }

.sidebar-section {
    padding: 1.15rem 1.4rem .45rem;
    font-size: .66rem; font-weight: 700; letter-spacing: .1em;
    text-transform: uppercase; color: var(--side-muted); white-space: nowrap;
}

.sidebar-nav { list-style: none; margin: 0; padding: 0 .8rem; }

.sidebar-nav a {
    display: flex; align-items: center; gap: .85rem;
    padding: .72rem .8rem; border-radius: 12px;
    color: var(--side-text); font-size: .93rem; font-weight: 500;
    margin-bottom: 3px; white-space: nowrap; position: relative;
    transition: background .15s ease, color .15s ease;
}

.sidebar-nav a i { font-size: 1.15rem; width: 22px; text-align: center; flex-shrink: 0; }
.sidebar-nav a span:not(.nav-count) { overflow: hidden; text-overflow: ellipsis; }
.sidebar-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }

.sidebar-nav a.active {
    background: linear-gradient(135deg, var(--primary) 0%, #4B84FF 100%);
    color: #fff; font-weight: 600;
    box-shadow: 0 10px 22px -12px rgba(46,107,255,.95);
}

.sidebar-nav .nav-count {
    margin-left: auto; min-width: 24px; text-align: center;
    background: rgba(255,255,255,.13); color: #fff;
    font-size: .72rem; font-weight: 700; padding: .13rem .45rem;
    border-radius: 100px; font-variant-numeric: tabular-nums; flex-shrink: 0;
}

.sidebar-nav a.active .nav-count { background: rgba(255,255,255,.26); }
.sidebar-nav .nav-count.tone-alert { background: var(--rose); }
.sidebar-nav .nav-count.tone-warn { background: var(--amber); }
.sidebar-nav .nav-count.tone-soon { background: rgba(255,255,255,.07); color: var(--side-muted); font-weight: 600; }

.side-card {
    margin: 1.1rem .9rem 1.35rem; padding: 1.2rem 1.15rem;
    border-radius: var(--r-lg);
    background: linear-gradient(140deg, #4B37C4 0%, #6E4BFF 100%);
    color: #fff; position: relative; overflow: hidden;
}

.side-card::after {
    content: ''; position: absolute; right: -30px; top: -30px;
    width: 110px; height: 110px; border-radius: 50%; background: rgba(255,255,255,.1);
}

.side-card-icon {
    width: 38px; height: 38px; display: grid; place-items: center;
    border-radius: 11px; background: rgba(255,255,255,.18);
    font-size: 1.1rem; margin-bottom: .8rem; position: relative; z-index: 2;
}

.side-card h4 { color: #fff; font-size: .97rem; font-weight: 700; margin: 0 0 .3rem; position: relative; z-index: 2; }
.side-card p { font-size: .81rem; color: rgba(255,255,255,.82); margin: 0 0 .95rem; line-height: 1.55; position: relative; z-index: 2; }
.side-card .btn { background: #fff; color: #3A2AA8; border-color: #fff; font-weight: 700; width: 100%; position: relative; z-index: 2; }
.side-card .btn:hover { background: #F1EEFF; border-color: #F1EEFF; color: #3A2AA8; }

.sidebar-foot { margin-top: auto; padding: 0 1.4rem 1.3rem; font-size: .74rem; color: var(--side-muted); white-space: nowrap; }

.panel-shell.is-collapsed .sidebar { width: 82px; }
.panel-shell.is-collapsed .sidebar .brand-text,
.panel-shell.is-collapsed .sidebar-section,
.panel-shell.is-collapsed .sidebar-nav a span:not(.nav-count),
.panel-shell.is-collapsed .side-card,
.panel-shell.is-collapsed .sidebar-foot { display: none; }
.panel-shell.is-collapsed .sidebar-nav a { justify-content: center; padding: .72rem 0; }
.panel-shell.is-collapsed .sidebar-nav .nav-count { position: absolute; top: 3px; right: 8px; min-width: 17px; font-size: .6rem; padding: 0 .24rem; }
.panel-shell.is-collapsed .sidebar-collapse { transform: rotate(180deg); }
.panel-shell.is-collapsed .sidebar-brand { justify-content: center; padding-inline: .5rem; }
.panel-shell.is-collapsed .panel-main { margin-left: 82px; }

.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(9,17,33,.5); z-index: 55; }

@media (max-width: 1100px) {
    .sidebar { transform: translateX(-100%); width: 268px; }
    .sidebar.open { transform: translateX(0); }
    .sidebar-backdrop.show { display: block; }
    .panel-shell.is-collapsed .sidebar { width: 268px; }
    .sidebar-collapse { display: none; }
}

/* Main and topbar -------------------------------------------------- */
.panel-main { flex: 1; min-width: 0; margin-left: 268px; display: flex; flex-direction: column; transition: margin .22s ease; }
@media (max-width: 1100px) { .panel-main { margin-left: 0; } }

.topbar {
    position: sticky; top: 0; z-index: 40;
    background: var(--card);
    border-bottom: 1px solid var(--line);
    padding: .8rem clamp(1rem, 2.5vw, 1.75rem);
    display: flex; align-items: center; gap: 1rem;
}

.topbar-toggle {
    display: none; background: var(--card-2); border: 1px solid var(--line);
    border-radius: 12px; width: 42px; height: 42px; font-size: 1.2rem;
    color: var(--ink); cursor: pointer;
}
@media (max-width: 1100px) { .topbar-toggle { display: inline-grid; place-items: center; } }

.topbar-search { flex: 1 1 auto; max-width: 470px; position: relative; }

.topbar-search input {
    width: 100%; background: var(--card-2); border: 1px solid var(--line);
    border-radius: 100px; padding: .7rem 5rem .7rem 2.85rem;
    font-family: var(--font); font-size: .91rem; color: var(--ink);
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.topbar-search input::placeholder { color: var(--muted); }
.topbar-search input:focus { outline: none; background: var(--card); border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); }
.topbar-search > i { position: absolute; left: 1.05rem; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 1.05rem; pointer-events: none; }

.topbar-search kbd {
    position: absolute; right: .5rem; top: 50%; transform: translateY(-50%);
    background: var(--card); border: 1px solid var(--line); border-radius: 8px;
    padding: .22rem .5rem; font-family: var(--font); font-size: .71rem; font-weight: 600; color: var(--muted);
}

@media (max-width: 780px) { .topbar-search { display: none; } }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .5rem; }

.theme-switch {
    display: inline-flex; align-items: center; gap: .25rem;
    background: var(--card-2); border: 1px solid var(--line);
    border-radius: 100px; padding: .22rem;
}

.theme-switch button {
    width: 30px; height: 30px; border: 0; border-radius: 100px;
    background: transparent; color: var(--muted); font-size: .95rem;
    cursor: pointer; display: grid; place-items: center; transition: all .15s ease;
}

.theme-switch button.on { background: var(--primary); color: #fff; }

.icon-btn {
    position: relative; width: 42px; height: 42px; display: grid; place-items: center;
    background: var(--card-2); border: 1px solid var(--line); border-radius: 13px;
    color: var(--ink-soft); font-size: 1.1rem; cursor: pointer; transition: all .15s ease;
}

.icon-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

.icon-btn .dot {
    position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px;
    padding: 0 4px; border-radius: 100px; background: var(--rose); color: #fff;
    font-size: .65rem; font-weight: 700; display: grid; place-items: center;
    font-variant-numeric: tabular-nums; border: 2px solid var(--card);
}

@media (max-width: 620px) { .icon-btn.hide-sm { display: none; } }

.user-chip {
    display: flex; align-items: center; gap: .6rem;
    background: var(--card-2); border: 1px solid var(--line); border-radius: 100px;
    padding: .27rem .85rem .27rem .3rem; cursor: pointer; transition: border-color .15s ease;
}

.user-chip:hover { border-color: var(--primary); }
.user-chip .avatar { width: 34px; height: 34px; font-size: .76rem; }
.user-chip-meta { text-align: left; line-height: 1.25; }
.user-chip-name { font-size: .87rem; font-weight: 700; color: var(--ink); display: block; }
.user-chip-role { font-size: .73rem; color: var(--muted); display: block; }
@media (max-width: 660px) { .user-chip-meta { display: none; } }

.panel-content { padding: clamp(1.1rem, 2.5vw, 1.85rem); flex: 1; }

/* Page header ------------------------------------------------------ */
.page-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.25rem; flex-wrap: wrap; margin-bottom: 1.55rem; }
.page-head-row h1 { font-size: clamp(1.4rem, 2.6vw, 1.8rem); font-weight: 800; margin: 0 0 .28rem; }
.page-head-row p { color: var(--muted); font-size: .94rem; margin: 0; }
.head-tools { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }

.pill-select {
    display: inline-flex; align-items: center; gap: .5rem;
    background: var(--card); border: 1px solid var(--line); border-radius: 100px;
    padding: .55rem 1rem; font-size: .89rem; font-weight: 600; color: var(--ink); box-shadow: var(--shadow-sm);
}

.pill-select i { color: var(--primary); }
.pill-select select { border: 0; background: transparent; font-family: var(--font); font-size: .89rem; font-weight: 600; color: var(--ink); cursor: pointer; }
.pill-select select:focus { outline: none; }
.pill-select option { background: var(--card); color: var(--ink); }
.stamp { display: inline-flex; align-items: center; gap: .45rem; font-size: .83rem; color: var(--muted); }

/* Cards ------------------------------------------------------------ */
.card-panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }

.card-panel-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap; padding: 1.15rem 1.4rem; border-bottom: 1px solid var(--line-soft);
}

.card-panel-head h3, .card-panel-head h2 { margin: 0; font-size: 1.01rem; font-weight: 700; display: flex; align-items: center; gap: .55rem; }
.card-panel-head h3 i { color: var(--primary); font-size: 1.05rem; }
.card-panel-body { padding: 1.4rem; }
.card-panel-body.tight { padding: 0; }
.link-more { font-size: .85rem; font-weight: 600; color: var(--primary); display: inline-flex; align-items: center; gap: .3rem; }

/* Metric cards ----------------------------------------------------- */
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(212px, 1fr)); gap: 1.05rem; margin-bottom: 1.4rem; }

.metric {
    position: relative; background: var(--card); border: 1px solid var(--line);
    border-radius: var(--r-lg); box-shadow: var(--shadow);
    padding: 1.2rem 1.25rem 0; display: flex; flex-direction: column;
    overflow: hidden; min-height: 168px;
}

.metric-top { display: flex; align-items: flex-start; justify-content: space-between; gap: .7rem; margin-bottom: .85rem; }

.metric-icon {
    width: 44px; height: 44px; display: grid; place-items: center;
    border-radius: 13px; font-size: 1.2rem; background: var(--primary-soft); color: var(--primary); flex-shrink: 0;
}

.metric-label { font-size: .89rem; font-weight: 600; color: var(--ink-soft); flex: 1; padding-top: .5rem; }

.metric-trend {
    display: inline-flex; align-items: center; gap: .18rem;
    font-size: .73rem; font-weight: 700; padding: .22rem .5rem; border-radius: 100px;
    background: var(--line-soft); color: var(--muted); white-space: nowrap;
}

.metric-trend.up { background: var(--green-soft); color: var(--green); }
.metric-trend.down { background: var(--rose-soft); color: var(--rose); }

.metric-value { font-size: 1.9rem; font-weight: 800; color: var(--ink); letter-spacing: -0.035em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.metric-foot { font-size: .81rem; color: var(--muted); margin-top: .22rem; margin-bottom: .85rem; }
.metric-foot.has-up { color: var(--green); font-weight: 600; }
.metric-foot.has-down { color: var(--rose); font-weight: 600; }
.metric-spark { margin: auto -1.25rem 0; display: block; width: calc(100% + 2.5rem); height: 52px; }

.metric.tone-navy .metric-icon { background: var(--primary-soft); color: var(--primary); }
.metric.tone-amber .metric-icon { background: var(--amber-soft); color: var(--amber); }
.metric.tone-green .metric-icon { background: var(--green-soft); color: var(--green); }
.metric.tone-rose .metric-icon { background: var(--rose-soft); color: var(--rose); }
.metric.tone-violet .metric-icon { background: var(--violet-soft); color: var(--violet); }
.metric.tone-teal .metric-icon { background: var(--teal-soft); color: var(--teal); }

/* Charts ----------------------------------------------------------- */
.chart-row { display: grid; grid-template-columns: 1.62fr 1fr; gap: 1.25rem; margin-bottom: 1.4rem; align-items: start; }
@media (max-width: 1150px) { .chart-row { grid-template-columns: 1fr; } }

.seg { display: inline-flex; background: var(--card-2); border: 1px solid var(--line); border-radius: 100px; padding: .2rem; gap: .12rem; }
.seg a { padding: .4rem .9rem; border-radius: 100px; font-size: .83rem; font-weight: 600; color: var(--muted); white-space: nowrap; transition: all .15s ease; }
.seg a:hover { color: var(--ink); }
.seg a.active { background: var(--primary); color: #fff; }

.chart-legend { display: flex; gap: 1rem; font-size: .83rem; color: var(--muted); align-items: center; }
.chart-legend .swatch { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: .4rem; }
.swatch-leads { background: var(--primary); }
.swatch-disbursed { background: var(--teal); }

.chart-wrap { position: relative; }
.line-chart { width: 100%; height: auto; display: block; }
.line-chart .grid-line { stroke: var(--line-soft); stroke-width: 1; }
.line-chart .axis-text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.line-chart .hit { cursor: pointer; fill: transparent; }

.chart-tip {
    position: absolute; pointer-events: none; background: #0F1B33; color: #fff;
    border-radius: 10px; padding: .5rem .7rem; font-size: .78rem; font-weight: 700;
    line-height: 1.35; white-space: nowrap; opacity: 0;
    transform: translate(-50%, -130%); transition: opacity .12s ease; z-index: 5; box-shadow: var(--shadow-lg);
}

.chart-tip.show { opacity: 1; }
.chart-tip small { display: block; font-weight: 500; color: rgba(255,255,255,.6); }

.donut-wrap { display: grid; place-items: center; padding: .75rem 0 1.1rem; }
.donut { width: 195px; height: 195px; }
.donut-track { stroke: var(--line-soft); }
.donut-value { fill: var(--ink); font-size: 30px; font-weight: 800; font-family: var(--font); }
.donut-label { fill: var(--muted); font-size: 11px; font-family: var(--font); }

.chart { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: .5rem; height: 200px; align-items: end; padding-top: .5rem; }
.chart-col { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; min-width: 0; }
.chart-stack { display: flex; align-items: flex-end; justify-content: center; gap: 3px; height: 100%; padding-bottom: .4rem; border-bottom: 1px solid var(--line); }
.chart-stack .bar { width: 46%; max-width: 16px; min-height: 3px; border-radius: 4px 4px 0 0; display: block; }
.bar-leads { background: var(--primary); }
.bar-disbursed { background: var(--teal); }
.chart-label { text-align: center; font-size: .72rem; color: var(--muted); padding-top: .35rem; }

/* Promo ------------------------------------------------------------ */
.promo {
    position: relative; border-radius: var(--r-lg); padding: 1.6rem 1.7rem;
    background: linear-gradient(135deg, #1E56E6 0%, #2E6BFF 48%, #12B5A6 135%);
    color: #fff; overflow: hidden; min-height: 168px;
    display: flex; flex-direction: column; justify-content: center;
    box-shadow: 0 18px 40px -22px rgba(46,107,255,.9);
}

.promo::after { content: ''; position: absolute; right: -50px; bottom: -70px; width: 210px; height: 210px; border-radius: 50%; background: rgba(255,255,255,.1); }
.promo h3 { color: #fff; font-size: 1.2rem; font-weight: 800; margin: 0 0 .5rem; max-width: 20ch; position: relative; z-index: 2; }
.promo p { color: rgba(255,255,255,.85); font-size: .88rem; margin: 0 0 1.1rem; max-width: 33ch; line-height: 1.6; position: relative; z-index: 2; }
.promo .btn { background: #fff; color: var(--primary-600); border-color: #fff; align-self: flex-start; font-weight: 700; position: relative; z-index: 2; }
.promo .btn:hover { background: #EDF3FF; border-color: #EDF3FF; color: var(--primary-600); }
.promo-art { position: absolute; right: 1rem; bottom: .5rem; width: 130px; opacity: .95; z-index: 1; }
@media (max-width: 620px) { .promo-art { display: none; } }

/* Quick actions ---------------------------------------------------- */
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }

.quick-tile {
    display: flex; align-items: center; gap: .65rem; padding: .78rem .85rem;
    border-radius: var(--r); background: var(--card-2); border: 1px solid var(--line);
    font-size: .86rem; font-weight: 600; color: var(--ink); transition: all .15s ease;
}

.quick-tile:hover { transform: translateY(-2px); border-color: var(--primary); color: var(--ink); box-shadow: var(--shadow); }
.quick-tile i { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; font-size: 1rem; flex-shrink: 0; background: var(--primary-soft); color: var(--primary); }
.quick-tile.t-teal i { background: var(--teal-soft); color: var(--teal); }
.quick-tile.t-amber i { background: var(--amber-soft); color: var(--amber); }
.quick-tile.t-violet i { background: var(--violet-soft); color: var(--violet); }
.quick-tile.t-green i { background: var(--green-soft); color: var(--green); }
.quick-tile.t-rose i { background: var(--rose-soft); color: var(--rose); }
@media (max-width: 480px) { .quick-grid { grid-template-columns: 1fr; } }

/* Layout columns --------------------------------------------------- */
.panel-columns { display: grid; grid-template-columns: 1.62fr 1fr; gap: 1.25rem; align-items: start; }
@media (max-width: 1150px) { .panel-columns { grid-template-columns: 1fr; } }
.alert-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; margin-bottom: 1.4rem; }
@media (max-width: 900px) { .alert-columns { grid-template-columns: 1fr; } }

.mini-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line-soft); }
@media (max-width: 480px) { .mini-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mini-stat { background: var(--card); padding: 1.15rem .9rem; text-align: center; }
.mini-value { display: block; font-size: 1.55rem; font-weight: 800; color: var(--ink); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.mini-label { display: block; font-size: .78rem; color: var(--muted); margin-top: .2rem; }
.mini-stat.is-alert .mini-value { color: var(--rose); }

/* Tables ----------------------------------------------------------- */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-royal { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .89rem; }

.table-royal th {
    text-align: left; font-weight: 600; font-size: .77rem; color: var(--muted);
    background: var(--card-2); padding: .8rem 1.1rem; border-bottom: 1px solid var(--line); white-space: nowrap;
}

.table-royal td { padding: .9rem 1.1rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; color: var(--ink-soft); }
.table-royal td strong { color: var(--ink); font-weight: 700; }
.table-royal tbody tr:last-child td { border-bottom: 0; }
.table-royal tbody tr:hover { background: var(--card-2); }
.table-royal .amount { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); }
.table-royal .num { font-variant-numeric: tabular-nums; }
.table-royal tr.is-inactive td { opacity: .5; }

.table-royal tfoot tr.report-total td {
    background: var(--primary); color: #fff; font-weight: 700; font-size: .89rem;
    padding: .9rem 1.1rem; border-bottom: 0; font-variant-numeric: tabular-nums;
}

.cell-user { display: flex; align-items: center; gap: .65rem; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1rem 1.4rem; border-top: 1px solid var(--line-soft); font-size: .86rem; color: var(--muted); }

.empty-state { text-align: center; padding: 3rem 1.5rem; color: var(--muted); }
.empty-state i { font-size: 2.5rem; color: var(--line); display: block; margin-bottom: .8rem; }
.empty-state h4 { color: var(--ink-soft); margin-bottom: .35rem; font-size: 1rem; }
.empty-state p { font-size: .91rem; margin-bottom: 1rem; }

/* Avatars, badges -------------------------------------------------- */
.avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); font-weight: 800; font-size: .79rem; flex-shrink: 0; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.2rem; border-radius: 18px; }
.avatar-navy { background: var(--primary); color: #fff; }
.avatar.a1 { background: var(--teal-soft); color: var(--teal); }
.avatar.a2 { background: var(--amber-soft); color: var(--amber); }
.avatar.a3 { background: var(--violet-soft); color: var(--violet); }
.avatar.a4 { background: var(--green-soft); color: var(--green); }
.avatar.a5 { background: var(--rose-soft); color: var(--rose); }

.status { display: inline-flex; align-items: center; gap: .36rem; font-size: .755rem; font-weight: 700; line-height: 1; padding: .4rem .7rem; border-radius: 100px; white-space: nowrap; }
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-new { background: var(--primary-soft); color: var(--primary); }
.status-query { background: var(--amber-soft); color: var(--amber); }
.status-process { background: var(--violet-soft); color: var(--violet); }
.status-approved { background: var(--green-soft); color: var(--green); }
.status-rejected { background: var(--rose-soft); color: var(--rose); }
.status-disbursed { background: var(--teal-soft); color: var(--teal); }
.status-cancelled { background: var(--line-soft); color: var(--muted); }

.chip { display: inline-flex; align-items: center; gap: .25rem; font-size: .73rem; font-weight: 700; background: var(--line-soft); color: var(--muted); border-radius: 100px; padding: .2rem .55rem; margin-right: .25rem; font-variant-numeric: tabular-nums; }
.chip-warn { background: var(--amber-soft); color: var(--amber); }
.reg-plate { display: inline-block; font-size: .77rem; font-weight: 700; letter-spacing: .04em; background: var(--card-2); border: 1px solid var(--line); border-radius: 6px; padding: .12rem .42rem; color: var(--ink); }

/* Buttons ---------------------------------------------------------- */
.panel-body .btn, .auth-wrap .btn, .install-wrap .btn, .error-wrap .btn {
    font-family: var(--font); font-weight: 600; border-radius: 12px; padding: .7rem 1.2rem; font-size: .9rem;
}

.panel-body .btn-primary, .auth-wrap .btn-primary, .install-wrap .btn-primary, .error-wrap .btn-primary {
    background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 10px 22px -14px var(--primary);
}
.panel-body .btn-primary:hover, .auth-wrap .btn-primary:hover, .install-wrap .btn-primary:hover { background: var(--primary-600); border-color: var(--primary-600); }
.panel-body .btn-navy, .auth-wrap .btn-navy { background: var(--side-1); border-color: var(--side-1); color: #fff; }
.panel-body .btn-navy:hover { background: var(--side-2); border-color: var(--side-2); }
.panel-body .btn-outline, .auth-wrap .btn-outline, .install-wrap .btn-outline { background: var(--card); border-color: var(--line); color: var(--ink); }
.panel-body .btn-outline:hover { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.panel-body .btn-danger { background: var(--rose); border-color: var(--rose); }
.panel-body .btn-sm { padding: .44rem .82rem; font-size: .83rem; border-radius: 9px; }
.panel-body .btn-lg { padding: .86rem 1.65rem; font-size: 1rem; }

/* Forms ------------------------------------------------------------ */
.panel-body .input, .panel-body .form-control, .panel-body .form-select,
.auth-wrap .input, .install-wrap .input {
    background: var(--card); border: 1px solid var(--line); border-radius: 12px;
    color: var(--ink); font-family: var(--font); padding: .7rem .9rem;
}

/* Inputs that carry an icon need the room reserved explicitly. The
   shorthand above would otherwise reset it. */
.panel-body .input-with-icon .input,
.auth-wrap .input-with-icon .input,
.install-wrap .input-with-icon .input {
    padding-left: 2.95rem;
    padding-right: 2.95rem;
}

.panel-body .input-with-icon > i,
.auth-wrap .input-with-icon > i,
.install-wrap .input-with-icon > i {
    position: absolute;
    left: 1.05rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.05rem;
    color: var(--muted);
    pointer-events: none;
    z-index: 2;
}

.panel-body .input-with-icon .password-toggle,
.auth-wrap .input-with-icon .password-toggle {
    position: absolute;
    right: .75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: 0;
    padding: .25rem;
    cursor: pointer;
    line-height: 1;
    z-index: 2;
}

.panel-body .input:focus, .auth-wrap .input:focus, .install-wrap .input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); }
.panel-body .input:disabled { background: var(--card-2); color: var(--muted); }
.panel-body .input::placeholder, .auth-wrap .input::placeholder { color: var(--muted); }
.panel-body .input.is-invalid, .auth-wrap .input.is-invalid { border-color: var(--rose); }
.panel-body .field label, .auth-wrap .field label, .install-wrap .field label { color: var(--ink-soft); font-weight: 600; }
.panel-body .field-hint, .auth-wrap .field-hint { color: var(--muted); }
.panel-body .field-error, .auth-wrap .field-error { color: var(--rose); }
.panel-body textarea.input { min-height: 108px; }

.panel-body select.input, .auth-wrap select.input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%237B8799' d='M1.4 0 6 4.6 10.6 0 12 1.4 6 7.4 0 1.4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right .95rem center; padding-right: 2.4rem;
}

.panel-body select.input option { background: var(--card); color: var(--ink); }
.panel-body .password-toggle { color: var(--muted); }
.panel-body .password-toggle:hover { color: var(--primary); }
.panel-body .input-with-icon > i { color: var(--muted); }

.filter-bar {
    display: flex; align-items: end; gap: .7rem; flex-wrap: wrap;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm); padding: 1.05rem 1.2rem; margin-bottom: 1.25rem;
}

.filter-bar label { display: block; font-size: .77rem; font-weight: 600; color: var(--muted); margin-bottom: .35rem; }
.filter-bar .input { min-width: 150px; padding: .56rem .85rem; font-size: .89rem; }

@media (max-width: 575px) {
    .filter-bar > div { flex: 1 1 100%; }
    .filter-bar .input { width: 100%; }
    .filter-bar .btn { flex: 1; }
}

/* Alerts ----------------------------------------------------------- */
.panel-body .alert-note, .auth-wrap .alert-note, .install-wrap .alert-note {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
    color: var(--ink-soft); padding: .9rem 1.1rem; font-size: .91rem;
}

.panel-body .alert-note.success, .auth-wrap .alert-note.success { background: var(--green-soft); border-color: transparent; color: var(--green); }
.panel-body .alert-note.error, .auth-wrap .alert-note.error { background: var(--rose-soft); border-color: transparent; color: var(--rose); }
.panel-body .alert-note.warning, .auth-wrap .alert-note.warning { background: var(--amber-soft); border-color: transparent; color: var(--amber); }
.panel-body .alert-note.info, .auth-wrap .alert-note.info { background: var(--primary-soft); border-color: transparent; color: var(--primary); }

/* Notifications and feeds ------------------------------------------ */
.notice-list { list-style: none; margin: 0; padding: 0; }
.notice-item { display: flex; gap: .85rem; padding: 1rem 1.4rem; border-bottom: 1px solid var(--line-soft); align-items: flex-start; transition: background .15s ease; }
.notice-item:last-child { border-bottom: 0; }
.notice-item:hover { background: var(--card-2); }
.notice-item.unread { background: var(--primary-soft); }
.notice-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--card-2); color: var(--primary); font-size: 1.05rem; flex-shrink: 0; }
.notice-item.unread .notice-icon { background: var(--card); }
.notice-body { min-width: 0; flex: 1; }
.notice-body strong { display: block; font-size: .9rem; color: var(--ink); font-weight: 700; }
.notice-body p { font-size: .86rem; color: var(--ink-soft); margin: .15rem 0 0; }
.notice-time { font-size: .75rem; color: var(--muted); white-space: nowrap; }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; align-items: center; gap: .8rem; padding: .85rem 1.4rem; border-bottom: 1px solid var(--line-soft); transition: background .15s ease; }
.feed li:last-child { border-bottom: 0; }
.feed li:hover { background: var(--card-2); }
.feed-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; font-size: 1rem; flex-shrink: 0; background: var(--primary-soft); color: var(--primary); }
.feed-icon.f-green { background: var(--green-soft); color: var(--green); }
.feed-icon.f-rose { background: var(--rose-soft); color: var(--rose); }
.feed-icon.f-amber { background: var(--amber-soft); color: var(--amber); }
.feed-icon.f-violet { background: var(--violet-soft); color: var(--violet); }
.feed-body { flex: 1; min-width: 0; }
.feed-body strong { display: block; font-size: .87rem; font-weight: 600; color: var(--ink); }
.feed-body span { font-size: .76rem; color: var(--muted); }
.feed li > i.bi-chevron-right { color: var(--muted); font-size: .85rem; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 1.4rem; position: relative; }
.timeline::before { content: ''; position: absolute; left: 5px; top: .5rem; bottom: .5rem; width: 2px; background: var(--line); border-radius: 2px; }
.timeline li { position: relative; padding: 0 0 1.15rem .35rem; }
.timeline li::before { content: ''; position: absolute; left: -1.4rem; top: .4rem; width: 12px; height: 12px; border-radius: 50%; background: var(--card); border: 3px solid var(--primary); }
.timeline strong { font-size: .89rem; color: var(--ink); font-weight: 700; }
.timeline p { font-size: .85rem; color: var(--ink-soft); margin: .1rem 0 0; }
.timeline .when { font-size: .75rem; color: var(--muted); }

/* Module classes --------------------------------------------------- */
.page-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.3rem; }
.status-tabs { display: flex; gap: .45rem; flex-wrap: wrap; }

.status-tab {
    display: inline-flex; align-items: center; gap: .45rem; padding: .5rem .95rem;
    background: var(--card); border: 1px solid var(--line); border-radius: 100px;
    font-size: .85rem; font-weight: 600; color: var(--ink-soft); white-space: nowrap; transition: all .15s ease;
}

.status-tab span { font-variant-numeric: tabular-nums; font-size: .75rem; color: var(--muted); background: var(--card-2); padding: .06rem .42rem; border-radius: 100px; }
.status-tab:hover { border-color: var(--primary); color: var(--primary); }
.status-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.status-tab.active span { background: rgba(255,255,255,.22); color: #fff; }

.master-tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.3rem; }
.master-tab { display: inline-flex; align-items: center; gap: .5rem; padding: .65rem 1.05rem; background: var(--card); border: 1px solid var(--line); border-radius: 12px; font-size: .88rem; font-weight: 600; color: var(--ink-soft); transition: all .15s ease; }
.master-tab:hover { border-color: var(--primary); color: var(--primary); }
.master-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.master-tab i { font-size: 1rem; }
.master-layout { display: grid; grid-template-columns: 1.65fr 1fr; gap: 1.25rem; align-items: start; }
@media (max-width: 1050px) { .master-layout { grid-template-columns: 1fr; } }

.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.05rem 1.5rem; margin: 0; }
@media (max-width: 560px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-grid dt { font-size: .77rem; color: var(--muted); font-weight: 500; margin-bottom: .2rem; }
.detail-grid dd { margin: 0; font-size: .94rem; color: var(--ink); font-weight: 600; }

.note-box { margin-top: 1.25rem; padding: .95rem 1.1rem; background: var(--card-2); border-radius: var(--r); border-left: 3px solid var(--primary); }
.note-box strong { font-size: .77rem; color: var(--muted); display: block; margin-bottom: .3rem; }
.note-box p { margin: 0; font-size: .9rem; color: var(--ink-soft); }

.upload-row { display: grid; grid-template-columns: 1fr 1.4fr .8fr auto; gap: .75rem; align-items: end; }
@media (max-width: 900px) { .upload-row { grid-template-columns: 1fr 1fr; } .upload-row .btn { grid-column: 1 / -1; } }
@media (max-width: 520px) { .upload-row { grid-template-columns: 1fr; } }

.stage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; }
.stage { display: flex; flex-direction: column; gap: .2rem; padding: 1rem; border: 1px dashed var(--line); border-radius: var(--r); background: var(--card-2); }
.stage i { font-size: 1.2rem; color: var(--muted); }
.stage strong { font-size: .88rem; color: var(--ink-soft); }
.stage span { font-size: .75rem; color: var(--muted); }

.form-sections { display: grid; gap: 1.25rem; }
.form-actions { display: flex; justify-content: flex-end; gap: .75rem; margin-top: 1.25rem; flex-wrap: wrap; }
@media (max-width: 520px) { .form-actions .btn { flex: 1; } }

.switch-row { display: flex; align-items: flex-start; gap: .75rem; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; background: var(--card-2); margin-bottom: 0; }
.switch-row:hover { border-color: var(--primary); }
.switch-row input[type="checkbox"] { width: 18px; height: 18px; margin-top: .15rem; accent-color: var(--primary); flex-shrink: 0; cursor: pointer; }
.switch-row strong { display: block; font-size: .91rem; font-weight: 700; color: var(--ink); }
.switch-row small { display: block; font-size: .81rem; color: var(--muted); line-height: 1.5; margin-top: .1rem; }

.thread { display: flex; flex-direction: column; gap: 1.1rem; }
.thread-item { display: flex; gap: .75rem; align-items: flex-start; }
.thread-item.is-mine { flex-direction: row-reverse; }
.thread-bubble { flex: 1; max-width: 78%; background: var(--card-2); border: 1px solid var(--line); border-radius: 14px; padding: .85rem 1.05rem; }
.thread-item.is-mine .thread-bubble { background: var(--primary-soft); border-color: transparent; }
.thread-meta { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; margin-bottom: .3rem; }
.thread-meta strong { font-size: .87rem; color: var(--ink); font-weight: 700; }
.thread-meta span { font-size: .74rem; color: var(--muted); }
.thread-bubble p { margin: 0; font-size: .91rem; color: var(--ink-soft); line-height: 1.6; }
.thread-file { display: inline-flex; align-items: center; gap: .4rem; margin-top: .6rem; font-size: .83rem; font-weight: 600; background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: .34rem .62rem; }
@media (max-width: 640px) { .thread-bubble { max-width: 100%; } }

.decision-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
@media (max-width: 640px) { .decision-grid { grid-template-columns: 1fr; } }
.decision-option { display: flex; align-items: flex-start; gap: .7rem; padding: 1.05rem 1.15rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); cursor: pointer; transition: all .15s ease; margin: 0; }
.decision-option:hover { border-color: var(--primary); }
.decision-option input[type="radio"] { width: 18px; height: 18px; margin-top: .15rem; accent-color: var(--primary); flex-shrink: 0; }
.decision-option strong { display: flex; align-items: center; gap: .4rem; font-size: .94rem; color: var(--ink); }
.decision-option small { display: block; font-size: .81rem; color: var(--muted); margin-top: .15rem; line-height: 1.5; }
.decision-option i { color: var(--green); }
.decision-option.is-reject i { color: var(--rose); }
.decision-option.is-reject input[type="radio"] { accent-color: var(--rose); }
.decision-option:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.decision-option.is-reject:has(input:checked) { border-color: var(--rose); background: var(--rose-soft); }

.doc-list { list-style: none; margin: 0; padding: 0; }
.doc-list li { display: flex; align-items: center; gap: .7rem; padding: .65rem 0; border-bottom: 1px solid var(--line-soft); }
.doc-list li:last-child { border-bottom: 0; }
.doc-list i { color: var(--primary); font-size: 1.1rem; }
.doc-list span { flex: 1; min-width: 0; }
.doc-list strong { display: block; font-size: .88rem; color: var(--ink); }
.doc-list small { display: block; font-size: .77rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.done-list { margin: 0 0 1.25rem; padding-left: 1.15rem; }
.done-list li { font-size: .91rem; color: var(--ink-soft); padding: .3rem 0; }
.done-list strong { color: var(--ink); }

.loan-stack { display: flex; flex-direction: column; }
.loan-card-row { display: flex; gap: 1rem; padding: 1.3rem 1.4rem; border-bottom: 1px solid var(--line-soft); }
.loan-card-row:last-child { border-bottom: 0; }
.loan-card-row.is-current { background: var(--primary-soft); }
.loan-seq { flex-shrink: 0; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; background: var(--primary); color: #fff; font-weight: 800; font-size: .87rem; }
.loan-body { flex: 1; min-width: 0; }
.loan-top { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.loan-top strong { font-size: 1rem; color: var(--ink); }
.loan-progress { display: flex; align-items: center; gap: .6rem; margin-top: .85rem; font-size: .84rem; color: var(--muted); flex-wrap: wrap; }
.loan-actions { display: flex; gap: .45rem; flex-wrap: wrap; margin-top: .85rem; }

.emi-pay { display: flex; gap: .35rem; align-items: center; }
.emi-pay .input { padding: .34rem .55rem; font-size: .79rem; width: 132px; }
.followup-actions { display: flex; flex-direction: column; gap: .35rem; }
.followup-actions form { display: flex; gap: .35rem; }
.followup-actions .input { padding: .34rem .55rem; font-size: .79rem; min-width: 0; flex: 1; }

.pay-steps { display: flex; gap: 3px; margin-bottom: .25rem; }
.pay-step { width: 21px; height: 21px; display: grid; place-items: center; border-radius: 6px; background: var(--card-2); color: var(--muted); font-size: .67rem; font-weight: 800; border: 1px solid var(--line); }
.pay-step.done { background: var(--primary); color: #fff; border-color: var(--primary); }
.pay-edit { display: flex; gap: .3rem; }
.pay-edit .input { padding: .32rem .5rem; font-size: .78rem; min-width: 0; }
.pay-edit input[name="deductions"] { width: 92px; }
.pay-edit input[name="admin_pin"] { width: 112px; }

.log-values { font-size: .79rem; color: var(--ink-soft); max-width: 220px; word-break: break-word; }

.panel-body code, .auth-wrap code { background: var(--card-2); border-radius: 5px; padding: .06rem .32rem; font-size: .85em; color: var(--primary); }
.panel-body .hr-soft { background: var(--line-soft); }
.panel-body .text-muted-2, .auth-wrap .text-muted-2 { color: var(--muted); }
.panel-body .check-list li { border-bottom-color: var(--line-soft); color: var(--ink-soft); }
.panel-body .check-list i { color: var(--primary); }

/* Dropdown --------------------------------------------------------- */
.panel-body .dropdown-menu { border-radius: 14px; border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow-lg); padding: .4rem; min-width: 214px; }
.panel-body .dropdown-item { border-radius: 9px; padding: .6rem .75rem; font-size: .89rem; font-weight: 500; color: var(--ink-soft); }
.panel-body .dropdown-item:hover { background: var(--primary-soft); color: var(--primary); }
.panel-body .dropdown-item.text-danger:hover { background: var(--rose-soft); color: var(--rose); }
.panel-body .dropdown-divider { border-color: var(--line-soft); }

/* Auth ------------------------------------------------------------- */
.auth-wrap {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.28fr) minmax(400px, .72fr);
    font-family: var(--font);
    background: var(--card);
}

@media (max-width: 1050px) { .auth-wrap { grid-template-columns: 1fr; } }

.auth-aside {
    position: relative;
    overflow: hidden;
    padding: clamp(1.8rem, 3.5vw, 3rem) clamp(1.8rem, 3.5vw, 3.4rem);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    color: #fff;
    background:
        radial-gradient(circle at 12% 6%, #1B4BD6 0%, transparent 46%),
        radial-gradient(circle at 88% 88%, #0C7FE0 0%, transparent 52%),
        linear-gradient(140deg, #0A2A8C 0%, #1450D8 45%, #1E63EE 100%);
}

.auth-aside::before,
.auth-aside::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .1);
    pointer-events: none;
}

.auth-aside::before { width: 460px; height: 460px; right: -160px; top: -180px; }
.auth-aside::after { width: 300px; height: 300px; left: -120px; bottom: -110px; background: rgba(255, 255, 255, .05); border: 0; }

@media (max-width: 1050px) { .auth-aside { display: none; } }

.auth-brand { display: inline-flex; align-items: center; gap: .85rem; position: relative; z-index: 2; }
.auth-brand .brand-text,
.auth-card .brand-mark .brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.auth-brand img { width: 52px; height: 52px; border-radius: 16px; }
.auth-brand .brand-name { font-size: 1.5rem; font-weight: 800; color: #fff; letter-spacing: -0.035em; line-height: 1.1; }
.auth-brand .brand-name em { font-style: normal; color: #5FD3FF; }
.auth-brand .brand-sub { font-size: .84rem; color: rgba(255, 255, 255, .66); }

.auth-aside-body {
    position: relative;
    z-index: 2;
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr);
    gap: 1.5rem;
    align-items: center;
}

@media (max-width: 1400px) { .auth-aside-body { grid-template-columns: 1fr; } .auth-art { display: none; } }

.auth-aside h2 {
    color: #fff;
    font-size: clamp(1.75rem, 2.5vw, 2.5rem);
    line-height: 1.16;
    letter-spacing: -0.035em;
    margin-bottom: 1rem;
    max-width: 15ch;
}

.auth-aside h2 .grad {
    background: linear-gradient(100deg, #6FD8FF, #7FE3D8);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.auth-aside > p,
.auth-aside-copy > p { color: rgba(255, 255, 255, .76); font-size: .96rem; line-height: 1.7; max-width: 44ch; margin-bottom: 1.9rem; }

.auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.05rem; }

.auth-points li {
    display: flex;
    gap: .9rem;
    align-items: center;
    color: #fff;
    font-size: .95rem;
    line-height: 1.45;
}

.auth-points li i {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: rgba(255, 255, 255, .13);
    border: 1px solid rgba(255, 255, 255, .16);
    color: #8FD8FF;
    font-size: 1.15rem;
}

.auth-points li span { color: rgba(255, 255, 255, .88); }
.auth-points li strong { display: block; font-weight: 600; color: #fff; }

/* Laptop artwork with floating notification cards */
.auth-art { position: relative; }
.auth-art > img { width: 100%; height: auto; display: block; filter: drop-shadow(0 30px 50px rgba(4, 20, 60, .5)); }

.art-card {
    position: absolute;
    display: flex;
    align-items: center;
    gap: .6rem;
    background: rgba(255, 255, 255, .95);
    border-radius: 13px;
    padding: .6rem .8rem;
    box-shadow: 0 18px 34px -18px rgba(4, 20, 60, .8);
    animation: artFloat 5.5s ease-in-out infinite;
}

.art-card i {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    font-size: .95rem;
    flex-shrink: 0;
}

.art-card strong { display: block; font-size: .82rem; font-weight: 700; color: #0F1B33; line-height: 1.25; white-space: nowrap; }
.art-card span { font-size: .72rem; color: #7B8799; white-space: nowrap; }

.art-card.a-leads { top: 6%; left: -6%; animation-delay: 0s; }
.art-card.a-leads i { background: #E6F6EC; color: #16A34A; }
.art-card.a-approved { top: 0; right: -2%; animation-delay: 1.1s; }
.art-card.a-approved i { background: #E9F0FF; color: #2E6BFF; }
.art-card.a-follow { bottom: 20%; left: -12%; animation-delay: 2.2s; }
.art-card.a-follow i { background: #EFEBFF; color: #7A5CFF; }
.art-card.a-disbursed { bottom: 8%; right: -6%; animation-delay: 3.3s; }
.art-card.a-disbursed i { background: #E1F7F4; color: #0FB5A5; }

@keyframes artFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@media (prefers-reduced-motion: reduce) { .art-card { animation: none; } }

/* Trust strip along the bottom */
.auth-trust {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    padding: 1.1rem 1.35rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .16);
    backdrop-filter: blur(10px);
}

.auth-trust div { display: flex; align-items: center; gap: .7rem; }
.auth-trust i { color: #8FD8FF; font-size: 1.3rem; flex-shrink: 0; }
.auth-trust strong { display: block; font-size: .85rem; font-weight: 600; color: #fff; line-height: 1.35; }
.auth-trust span { font-size: .78rem; color: rgba(255, 255, 255, .62); }

@media (max-width: 1250px) { .auth-trust { grid-template-columns: 1fr; gap: .75rem; } }

/* Right hand panel */
.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1.75rem, 5vw, 3.5rem);
    background: var(--card);
    position: relative;
    overflow: hidden;
}

.auth-panel::before,
.auth-panel::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(140deg, rgba(46, 107, 255, .07), rgba(15, 181, 165, .05));
    pointer-events: none;
}

.auth-panel::before { width: 260px; height: 260px; right: -90px; top: -80px; }
.auth-panel::after { width: 200px; height: 200px; left: -70px; bottom: -70px; }

.auth-card { width: 100%; max-width: 420px; position: relative; z-index: 2; }
.auth-card .brand-mark { display: flex; align-items: center; gap: .85rem; margin-bottom: 2.1rem; }
.auth-card .brand-mark img { height: 52px; width: 52px; border-radius: 16px; }
.auth-card .brand-mark .brand-name { color: var(--ink); font-size: 1.4rem; font-weight: 800; letter-spacing: -0.035em; line-height: 1.1; }
.auth-card .brand-mark .brand-name em { font-style: normal; color: var(--primary); }
.auth-card .brand-mark .brand-sub { color: var(--muted); font-size: .84rem; }
.auth-card h1 { font-size: 1.75rem; margin-bottom: .4rem; font-weight: 800; }
.auth-card > p { color: var(--muted); font-size: .95rem; margin-bottom: 1.75rem; }

.auth-card .input { padding-block: .88rem; padding-inline: 1rem; border-radius: 12px; background: var(--card); }
.auth-card .input-with-icon .input { padding-left: 3rem; padding-right: 3rem; }
.auth-card .input-with-icon > i { left: 1.1rem; font-size: 1.05rem; }

.forgot-row { display: flex; justify-content: flex-end; margin: -.35rem 0 1.5rem; }
.forgot-row a { font-size: .88rem; font-weight: 600; color: var(--primary); }
.forgot-row a:hover { color: var(--primary-600); }
.auth-card a { color: var(--primary); }

.panel-body .btn-gradient,
.auth-wrap .btn-gradient {
    background: linear-gradient(100deg, #2E6BFF 0%, #1E56E6 55%, #2B44C8 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 16px 30px -16px rgba(46, 107, 255, .95);
}

.auth-wrap .btn-gradient:hover { color: #fff; box-shadow: 0 20px 38px -16px rgba(46, 107, 255, 1); }

.or-divide {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.35rem 0;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 600;
}

.or-divide::before,
.or-divide::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.auth-foot { margin-top: 1.6rem; font-size: .84rem; color: var(--muted); text-align: center; }

/* Install and errors ----------------------------------------------- */
.install-wrap { min-height: 100vh; display: grid; place-items: center; padding: 2.5rem 1.25rem; font-family: var(--font); background: linear-gradient(150deg, var(--side-1) 0%, #16306B 100%); }
.install-card { width: 100%; max-width: 640px; background: var(--card); border-radius: var(--r-xl); padding: clamp(1.75rem, 4vw, 2.75rem); box-shadow: 0 34px 70px -34px rgba(0,0,0,.7); }
.check-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .72rem 0; border-bottom: 1px solid var(--line-soft); font-size: .92rem; color: var(--ink-soft); }
.check-row:last-of-type { border-bottom: 0; }
.check-row .ok { color: var(--green); font-weight: 700; }
.check-row .bad { color: var(--rose); font-weight: 700; }

.error-wrap { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 2.5rem 1.5rem; font-family: var(--font); background: linear-gradient(150deg, var(--side-1) 0%, #16306B 100%); color: #fff; }
.error-code { font-size: clamp(4rem, 14vw, 8rem); font-weight: 800; color: #6FA0FF; line-height: 1; letter-spacing: -0.05em; }
.error-wrap h1 { color: #fff; margin: 1rem 0 .5rem; }
.error-wrap p { color: rgba(255,255,255,.7); max-width: 46ch; margin: 0 auto 1.75rem; }

/* Utility ---------------------------------------------------------- */
.stack > * + * { margin-top: 1.25rem; }
.panel-body :focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 6px; }

@media print {
    .sidebar, .topbar, .page-actions, .filter-bar, .side-card, .sidebar-backdrop { display: none !important; }
    .panel-main { margin-left: 0; }
    .card-panel { box-shadow: none; }
}

/* Dashboard top row: chart, conversion, promo ----------------------- */
.dash-top { display: grid; grid-template-columns: 1.5fr .82fr 1fr; gap: 1.25rem; margin-bottom: 1.4rem; align-items: stretch; }
@media (max-width: 1400px) { .dash-top { grid-template-columns: 1.4fr 1fr; } .dash-top > .promo { grid-column: 1 / -1; } }
@media (max-width: 900px) { .dash-top { grid-template-columns: 1fr; } .dash-top > .promo { grid-column: auto; } }
.dash-top > * { min-width: 0; }

/* ==================================================================
   Platform sign in portals
   Each door has its own colour so nobody has to wonder which one
   they landed on.
   ================================================================== */
.portal-badge {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: .45rem .9rem;
    border-radius: 100px;
    margin-bottom: 1.1rem;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .2);
    color: #fff;
}

.portal-badge.solid {
    background: var(--primary-soft);
    border-color: transparent;
    color: var(--primary);
}

/* Superadmin: deep indigo */
.auth-wrap.portal-superadmin .auth-aside {
    background:
        radial-gradient(circle at 14% 8%, #2A1D8F 0%, transparent 48%),
        radial-gradient(circle at 86% 90%, #1450D8 0%, transparent 52%),
        linear-gradient(140deg, #141C63 0%, #23299C 48%, #2E5BE0 100%);
}

.auth-wrap.portal-superadmin { --primary: #3A45D8; --primary-600: #2B33B4; --primary-soft: #ECEDFF; }
.auth-wrap.portal-superadmin .auth-aside h2 .grad { background: linear-gradient(100deg, #8FA6FF, #7FE3D8); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-wrap.portal-superadmin .auth-points li i { color: #A9B8FF; }
.auth-wrap.portal-superadmin .auth-trust i { color: #A9B8FF; }
.auth-wrap.portal-superadmin .btn-gradient { background: linear-gradient(100deg, #3A45D8 0%, #2B33B4 60%, #1F2790 100%); box-shadow: 0 16px 30px -16px rgba(58, 69, 216, .95); }

/* Broker: violet */
.auth-wrap.portal-broker .auth-aside {
    background:
        radial-gradient(circle at 12% 10%, #5B21B6 0%, transparent 48%),
        radial-gradient(circle at 88% 88%, #C026D3 0%, transparent 50%),
        linear-gradient(140deg, #3B0D77 0%, #6D28D9 50%, #9333EA 100%);
}

.auth-wrap.portal-broker { --primary: #7A3FE4; --primary-600: #6528CC; --primary-soft: #F3ECFF; }
.auth-wrap.portal-broker .auth-aside h2 .grad { background: linear-gradient(100deg, #E9B8FF, #FFD48F); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-wrap.portal-broker .auth-points li i { color: #E2C4FF; }
.auth-wrap.portal-broker .auth-trust i { color: #E2C4FF; }
.auth-wrap.portal-broker .btn-gradient { background: linear-gradient(100deg, #7A3FE4 0%, #6528CC 60%, #4C1D95 100%); box-shadow: 0 16px 30px -16px rgba(122, 63, 228, .95); }
