/* ==========================================================================
   Flats CRM — design system
   Brand: indigo → blue → sky gradient. Cities keep their fixed chart hue.
   ========================================================================== */
:root {
    --crm-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    --crm-bg: #f4f6fb;
    --crm-surface: #ffffff;
    --crm-surface-2: #f8f9fd;
    --crm-ink: #0f172a;
    --crm-ink-2: #475569;
    --crm-ink-3: #94a3b8;
    --crm-border: #e6e9f2;
    --crm-grid: rgba(15, 23, 42, .06);

    --crm-primary: #4f46e5;
    --crm-primary-2: #2563eb;
    --crm-primary-soft: #eef0ff;
    --crm-gradient: linear-gradient(135deg, #4f46e5 0%, #2563eb 55%, #0ea5e9 100%);
    --crm-gradient-soft: linear-gradient(135deg, #eef0ff 0%, #e8f1ff 55%, #e6f7fd 100%);

    --crm-side-1: #0b1224;
    --crm-side-2: #1b1847;
    --crm-side-ink: #b8c1d9;

    --crm-good: #059669;  --crm-good-soft: #e7f8f1;
    --crm-warn: #b45309;  --crm-warn-soft: #fff5e1;
    --crm-bad: #dc2626;   --crm-bad-soft: #fdecec;
    --crm-info: #0284c7;  --crm-info-soft: #e5f5fd;

    --crm-radius: 14px;
    --crm-radius-sm: 10px;
    --crm-shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
    --crm-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -12px rgba(15, 23, 42, .12);
    --crm-shadow-lg: 0 24px 60px -20px rgba(30, 27, 75, .45);

    --bs-body-font-family: var(--crm-font);
    --bs-primary: #4f46e5;
    --bs-primary-rgb: 79, 70, 229;
    --bs-link-color: #4f46e5;
    --bs-link-color-rgb: 79, 70, 229;
    --bs-link-hover-color: #3730a3;
    --bs-border-color: var(--crm-border);
}

body {
    font-family: var(--crm-font);
    background: var(--crm-bg);
    color: var(--crm-ink);
    font-size: .925rem;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; }
code { color: #7c3aed; }

/* ---------- Buttons ---------- */
.btn { border-radius: 10px; font-weight: 500; }
.btn-sm { border-radius: 8px; }
.btn-primary {
    background: var(--crm-gradient); border: 0;
    box-shadow: 0 6px 16px -8px rgba(79, 70, 229, .8);
}
.btn-primary:hover, .btn-primary:focus { background: linear-gradient(135deg, #4338ca, #1d4ed8 55%, #0284c7); }
.btn-success { background: linear-gradient(135deg, #10b981, #059669); border: 0; }
.btn-success:hover { background: linear-gradient(135deg, #059669, #047857); }
.btn-outline-secondary { --bs-btn-color: var(--crm-ink-2); --bs-btn-border-color: var(--crm-border); --bs-btn-hover-bg: var(--crm-surface-2); --bs-btn-hover-color: var(--crm-ink); --bs-btn-hover-border-color: #cfd5e4; --bs-btn-active-bg: var(--crm-primary-soft); --bs-btn-active-color: var(--crm-primary); --bs-btn-active-border-color: #c7c9fb; background: var(--crm-surface); }
.btn-outline-primary { --bs-btn-color: var(--crm-primary); --bs-btn-border-color: #c7c9fb; --bs-btn-hover-bg: var(--crm-primary); --bs-btn-hover-border-color: var(--crm-primary); }
.btn-soft {
    background: var(--crm-primary-soft); color: var(--crm-primary); border: 0;
}
.btn-soft:hover { background: #e0e3ff; color: #3730a3; }

.form-control, .form-select { border-radius: 10px; border-color: var(--crm-border); }
.form-control:focus, .form-select:focus { border-color: #a5a8f6; box-shadow: 0 0 0 4px rgba(79, 70, 229, .12); }
.form-check-input:checked { background-color: var(--crm-primary); border-color: var(--crm-primary); }
.form-label { font-weight: 500; font-size: .85rem; color: var(--crm-ink-2); }

/* ---------- Shell ---------- */
.crm-shell { display: flex; min-height: 100vh; }

.crm-sidebar {
    width: 260px; flex: 0 0 260px;
    background: linear-gradient(180deg, var(--crm-side-1) 0%, var(--crm-side-2) 100%);
    color: var(--crm-side-ink);
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
    display: flex; flex-direction: column;
}
.crm-sidebar::-webkit-scrollbar { width: 6px; }
.crm-sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 6px; }

.crm-brand { display: flex; align-items: center; gap: .75rem; padding: 1.25rem 1.1rem 1rem; }
.crm-logo {
    width: 40px; height: 40px; border-radius: 12px; flex: 0 0 40px;
    display: grid; place-items: center; color: #fff; font-size: 1.2rem;
    background: var(--crm-gradient); box-shadow: 0 8px 20px -8px rgba(37, 99, 235, .9);
}
.crm-brand-title { font-weight: 800; letter-spacing: -.01em; font-size: 1.05rem; color: #fff; }
.crm-brand-sub { font-size: .72rem; opacity: .65; }

.crm-nav { display: flex; flex-direction: column; padding: 0 .75rem; gap: 2px; }
.crm-nav-label { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: #7480a4; margin: 1.1rem .7rem .4rem; }
.crm-nav a {
    color: var(--crm-side-ink); display: flex; align-items: center; gap: .7rem;
    padding: .55rem .75rem; border-radius: 10px; font-size: .88rem; font-weight: 500;
    transition: background .15s, color .15s;
}
.crm-nav a > i:first-child { font-size: 1.05rem; width: 1.2rem; text-align: center; opacity: .85; }
.crm-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.crm-nav a.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, .9), rgba(37, 99, 235, .9));
    color: #fff; box-shadow: 0 8px 20px -10px rgba(79, 70, 229, 1);
}
.crm-nav a.active > i:first-child { opacity: 1; }
.crm-nav .crm-site-link { font-size: .84rem; padding-top: .42rem; padding-bottom: .42rem; }
.crm-nav .crm-site-link .bi-box-arrow-up-right { opacity: 0; transition: opacity .15s; }
.crm-nav .crm-site-link:hover .bi-box-arrow-up-right { opacity: .7; }

.crm-side-foot {
    margin: auto .9rem 1rem; padding: .9rem; border-radius: 12px;
    background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .07);
    font-size: .75rem;
}
.crm-side-foot strong { color: #fff; font-weight: 600; }

.crm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.crm-topbar {
    display: flex; align-items: center; gap: .9rem; padding: .8rem 1.5rem;
    background: rgba(255, 255, 255, .85); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--crm-border); position: sticky; top: 0; z-index: 20;
}
.crm-page-icon {
    width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
    background: var(--crm-gradient-soft); color: var(--crm-primary); font-size: 1.1rem;
}
.crm-page-title { font-size: 1.12rem; margin: 0; font-weight: 700; letter-spacing: -.01em; }
.crm-page-sub { font-size: .78rem; color: var(--crm-ink-3); }
.crm-chip {
    display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .65rem;
    border-radius: 999px; font-size: .75rem; font-weight: 500;
    background: var(--crm-surface-2); border: 1px solid var(--crm-border); color: var(--crm-ink-2);
}
.crm-user { display: flex; align-items: center; gap: .6rem; padding: .25rem .35rem .25rem .25rem; border-radius: 999px; border: 1px solid var(--crm-border); background: var(--crm-surface); }
.crm-user:hover { border-color: #cfd5e4; }
.crm-avatar {
    width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
    background: var(--crm-gradient); color: #fff; font-weight: 700; font-size: .78rem;
}
.crm-user-name { font-size: .82rem; font-weight: 600; line-height: 1.1; }
.crm-user-role { font-size: .68rem; color: var(--crm-ink-3); }
.dropdown-menu { border-radius: 12px; border-color: var(--crm-border); box-shadow: var(--crm-shadow); padding: .4rem; }
.dropdown-item { border-radius: 8px; font-size: .88rem; }

.crm-content { padding: 1.5rem; max-width: 1600px; width: 100%; }

/* ---------- Toolbars / filters ---------- */
.crm-filters {
    display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; margin-bottom: 1.1rem;
    padding: .65rem .75rem; background: var(--crm-surface); border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius); box-shadow: var(--crm-shadow-sm);
}
.crm-filters .form-select, .crm-filters .form-control { border-radius: 9px; }
.crm-search { position: relative; }
.crm-search > i { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--crm-ink-3); }
.crm-search > .form-control { padding-left: 2rem; min-width: 240px; }
.crm-seg { display: inline-flex; background: var(--crm-surface-2); border: 1px solid var(--crm-border); border-radius: 10px; padding: 3px; gap: 2px; }
.crm-seg a, .crm-seg button {
    border: 0; background: transparent; color: var(--crm-ink-2); font-size: .8rem; font-weight: 500;
    padding: .28rem .7rem; border-radius: 7px;
}
.crm-seg a:hover, .crm-seg button:hover { color: var(--crm-ink); }
.crm-seg .active { background: var(--crm-surface); color: var(--crm-primary); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); font-weight: 600; }

/* ---------- Hero ---------- */
.crm-hero {
    position: relative; overflow: hidden; border-radius: 18px; padding: 1.4rem 1.6rem; margin-bottom: 1.25rem;
    background: var(--crm-gradient); color: #fff; box-shadow: var(--crm-shadow-lg);
}
.crm-hero::before, .crm-hero::after {
    content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .09);
}
.crm-hero::before { width: 320px; height: 320px; right: -80px; top: -160px; }
.crm-hero::after { width: 200px; height: 200px; right: 160px; bottom: -130px; }
.crm-hero h2 { font-weight: 800; letter-spacing: -.02em; font-size: 1.45rem; margin: 0; }
.crm-hero p { margin: .25rem 0 0; opacity: .85; }
.crm-hero .crm-hero-stats { display: flex; gap: 1.75rem; flex-wrap: wrap; position: relative; z-index: 1; }
.crm-hero .crm-hero-stat-value { font-size: 1.5rem; font-weight: 800; line-height: 1; }
.crm-hero .crm-hero-stat-label { font-size: .72rem; opacity: .8; text-transform: uppercase; letter-spacing: .08em; }
.crm-hero > * { position: relative; z-index: 1; }

/* ---------- KPI tiles ---------- */
.crm-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.crm-kpi {
    position: relative; overflow: hidden;
    background: var(--crm-surface); border: 1px solid var(--crm-border); border-radius: var(--crm-radius);
    padding: 1rem 1.1rem; color: inherit; display: block; box-shadow: var(--crm-shadow);
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.crm-kpi::after {
    content: ""; position: absolute; inset: auto -30px -40px auto; width: 110px; height: 110px; border-radius: 50%;
    background: var(--tone-soft, var(--crm-primary-soft)); opacity: .7;
}
.crm-kpi > * { position: relative; z-index: 1; }
.crm-kpi-link:hover { transform: translateY(-2px); border-color: var(--tone, var(--crm-primary)); color: inherit; }
.crm-kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: .55rem; }
.crm-kpi-icon {
    width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.15rem;
    background: var(--tone-soft, var(--crm-primary-soft)); color: var(--tone, var(--crm-primary));
}
.crm-kpi-label { font-size: .78rem; font-weight: 600; color: var(--crm-ink-2); }
.crm-kpi-value { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.crm-kpi-sub { font-size: .76rem; color: var(--crm-ink-3); margin-top: .1rem; }
.crm-kpi-sub .up { color: var(--crm-good); font-weight: 600; }

.tone-blue   { --tone: #2563eb; --tone-soft: #e6efff; }
.tone-violet { --tone: #7c3aed; --tone-soft: #f1eaff; }
.tone-amber  { --tone: #d97706; --tone-soft: #fff3dd; }
.tone-green  { --tone: #059669; --tone-soft: #e3f8ef; }
.tone-rose   { --tone: #e11d48; --tone-soft: #ffe8ee; }
.tone-cyan   { --tone: #0891b2; --tone-soft: #e2f7fb; }

/* ---------- Cards / tables ---------- */
.crm-card { border: 1px solid var(--crm-border); border-radius: var(--crm-radius); box-shadow: var(--crm-shadow); background: var(--crm-surface); overflow: hidden; }
.crm-card > .card-header {
    background: var(--crm-surface); border-bottom: 1px solid var(--crm-border);
    font-weight: 700; font-size: .93rem; padding: .85rem 1.1rem; display: flex; align-items: center; gap: .55rem;
}
.crm-card-icon { width: 30px; height: 30px; border-radius: 9px; display: inline-grid; place-items: center; font-size: .95rem; background: var(--tone-soft, var(--crm-primary-soft)); color: var(--tone, var(--crm-primary)); }
.crm-card > .card-footer { background: var(--crm-surface-2); border-top: 1px solid var(--crm-border); }

.crm-table { --bs-table-bg: transparent; margin: 0; }
.crm-table thead th {
    font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--crm-ink-3); font-weight: 700;
    white-space: nowrap; background: var(--crm-surface-2); border-bottom: 1px solid var(--crm-border); padding: .65rem .9rem;
}
.crm-table td { padding: .6rem .9rem; border-color: #eef1f7; font-variant-numeric: tabular-nums; }
.crm-table tbody tr { transition: background .12s; }
.crm-table tbody tr:hover { background: #fafbff; }
.crm-table tbody tr:last-child td { border-bottom: 0; }

.crm-empty { padding: 2.5rem 1rem; text-align: center; color: var(--crm-ink-3); }
.crm-empty > i { display: block; font-size: 2rem; margin-bottom: .4rem; color: #c3c8f7; }

/* ---------- City identity ---------- */
.crm-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .5rem; vertical-align: baseline; }
.crm-city { display: inline-flex; align-items: center; gap: .45rem; font-weight: 600; white-space: nowrap; }
.crm-city-badge {
    width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
    color: #fff; font-weight: 800; font-size: .72rem; letter-spacing: .02em;
    background: var(--city, #4f46e5); box-shadow: 0 6px 14px -8px var(--city, #4f46e5);
}
.crm-city-tag {
    display: inline-flex; align-items: center; gap: .35rem; padding: .18rem .55rem .18rem .4rem; border-radius: 999px;
    font-size: .75rem; font-weight: 600; white-space: nowrap;
    background: color-mix(in srgb, var(--city, #4f46e5) 12%, white); color: color-mix(in srgb, var(--city, #4f46e5) 80%, black);
}
.crm-city-tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--city, #4f46e5); }

/* ---------- Status pills & badges ---------- */
.crm-pill { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 600; padding: .2rem .55rem; border-radius: 999px; white-space: nowrap; }
.crm-pill-up { color: var(--crm-good); background: var(--crm-good-soft); }
.crm-pill-down { color: var(--crm-bad); background: var(--crm-bad-soft); }
.crm-pill-muted { color: var(--crm-ink-3); background: #f1f4f9; }
.crm-pulse { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 currentColor; animation: crm-pulse 2s infinite; }
@keyframes crm-pulse { 0% { box-shadow: 0 0 0 0 rgba(5, 150, 105, .5); } 70% { box-shadow: 0 0 0 6px rgba(5, 150, 105, 0); } 100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); } }
.crm-err { font-size: .75rem; word-break: break-word; }
.crm-ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }

.badge { font-weight: 600; border-radius: 7px; padding: .35em .6em; }
.badge.crm-status-pending, .badge.crm-status-open { background: var(--crm-warn-soft); color: var(--crm-warn); }
.badge.crm-status-approved, .badge.crm-status-resolved { background: var(--crm-good-soft); color: var(--crm-good); }
.badge.crm-status-rejected { background: var(--crm-bad-soft); color: var(--crm-bad); }
.badge.crm-status-closed { background: #eef1f6; color: #475569; }
.badge.crm-role { background: var(--crm-primary-soft); color: var(--crm-primary); }
.badge.crm-role-super { background: linear-gradient(135deg, #f43f5e, #e11d48); color: #fff; }

.crm-thumb { width: 64px; height: 48px; object-fit: cover; border-radius: 9px; box-shadow: var(--crm-shadow-sm); }
.crm-thumb + .crm-thumb-fallback { display: none; }
.crm-thumb-empty {width: 64px; height: 48px; border-radius: 9px; display: grid; place-items: center; background: var(--crm-gradient-soft); color: #a5a8f6; }
.crm-site-checks { display: flex; flex-wrap: wrap; gap: .4rem; }
.crm-site-checks .form-check {
    margin: 0; padding: .3rem .6rem .3rem 1.9rem; border: 1px solid var(--crm-border); border-radius: 999px; font-size: .82rem;
}
.crm-site-checks .form-check:has(input:checked) { border-color: #a5a8f6; background: var(--crm-primary-soft); color: var(--crm-primary); }

.nav-pills.crm-tabs { gap: .35rem; margin-bottom: 1rem; }
.nav-pills.crm-tabs .nav-link {
    border-radius: 10px; color: var(--crm-ink-2); font-weight: 600; font-size: .86rem; background: var(--crm-surface);
    border: 1px solid var(--crm-border); display: flex; align-items: center; gap: .4rem;
}
.nav-pills.crm-tabs .nav-link.active { background: var(--crm-gradient); color: #fff; border-color: transparent; box-shadow: 0 8px 18px -10px rgba(79, 70, 229, .9); }

.modal-content { border: 0; border-radius: 18px; box-shadow: var(--crm-shadow-lg); }
.modal-header { border-bottom: 1px solid var(--crm-border); }
.modal-footer { border-top: 1px solid var(--crm-border); background: var(--crm-surface-2); border-radius: 0 0 18px 18px; }
.modal-title { font-weight: 700; font-size: 1.05rem; }

.alert { border-radius: 12px; border: 0; }
.alert-success { background: var(--crm-good-soft); color: #065f46; }
.alert-warning { background: var(--crm-warn-soft); color: #92400e; }
.alert-danger { background: var(--crm-bad-soft); color: #991b1b; }
.alert-info { background: var(--crm-info-soft); color: #075985; }

/* ---------- Charts ---------- */
.crm-chart { position: relative; height: 290px; }
.crm-chart-sm { height: 230px; }
.crm-chart-total { font-size: .78rem; font-weight: 600; color: var(--crm-ink-3); margin-left: auto; }
.crm-chart-total strong { color: var(--crm-ink); font-size: .95rem; }

/* ---------- Status page ---------- */
.crm-status-card { border-top: 4px solid var(--city, #4f46e5); }
.crm-endpoint { display: flex; align-items: center; gap: .6rem; padding: .55rem 1.1rem; border-bottom: 1px solid #eef1f7; font-size: .85rem; }
.crm-endpoint:last-child { border-bottom: 0; }
.crm-endpoint i.ep { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--crm-surface-2); color: var(--crm-ink-2); }
.crm-latency { margin-left: auto; font-size: .75rem; color: var(--crm-ink-3); font-variant-numeric: tabular-nums; }
.crm-latency-bar { height: 4px; border-radius: 4px; background: #eef1f7; width: 60px; overflow: hidden; }
.crm-latency-bar > span { display: block; height: 100%; background: var(--crm-good); border-radius: 4px; }

/* ---------- Auth (login) ---------- */
.crm-auth { min-height: 100vh; background: var(--crm-bg); }
.crm-auth-split { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.crm-auth-brand {
    position: relative; overflow: hidden; color: #fff; padding: 3rem 3.5rem;
    background:
        radial-gradient(circle at 15% 20%, rgba(14, 165, 233, .35), transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(124, 58, 237, .45), transparent 45%),
        linear-gradient(140deg, #0b1224 0%, #1e1b4b 50%, #312e81 100%);
    display: flex; flex-direction: column;
}
.crm-auth-brand::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image: linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
    background-size: 42px 42px; mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
}
.crm-auth-brand > * { position: relative; z-index: 1; }
.crm-auth-brand h1 { font-size: 2.4rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.12; margin: 2.5rem 0 .8rem; }
.crm-auth-brand h1 span { background: linear-gradient(90deg, #7dd3fc, #c4b5fd); -webkit-background-clip: text; background-clip: text; color: transparent; }
.crm-auth-brand p.lead { color: #c7d2fe; font-size: 1.02rem; max-width: 460px; }
.crm-city-cloud { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.6rem 0 2rem; max-width: 520px; }
.crm-city-cloud span {
    display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .8rem; border-radius: 999px; font-size: .82rem; font-weight: 600;
    background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); backdrop-filter: blur(6px);
}
.crm-city-cloud span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--city); box-shadow: 0 0 10px var(--city); }
.crm-auth-features { display: grid; gap: 1rem; max-width: 470px; margin-top: auto; }
.crm-auth-feature { display: flex; gap: .85rem; align-items: flex-start; }
.crm-auth-feature i {
    width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.1rem;
    background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .14);
}
.crm-auth-feature strong { display: block; font-size: .92rem; }
.crm-auth-feature small { color: #a5b4fc; }
.crm-auth-panel { display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.crm-auth-card { width: 100%; max-width: 420px; }
.crm-auth-card h2 { font-weight: 800; letter-spacing: -.02em; font-size: 1.6rem; margin-bottom: .3rem; }
.crm-auth-card .crm-auth-sub { color: var(--crm-ink-2); margin-bottom: 1.5rem; }
.crm-steps { display: flex; gap: .4rem; margin-bottom: 1.4rem; }
.crm-steps span { flex: 1; height: 5px; border-radius: 5px; background: #e4e7f2; }
.crm-steps span.done { background: var(--crm-gradient); }
.crm-input-icon { position: relative; }
.crm-input-icon > i.lead-icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--crm-ink-3); font-size: 1.1rem; }
.crm-input-icon > .form-control { padding-left: 2.8rem; padding-right: 3rem; height: 54px; font-size: 1.05rem; border-radius: 12px; }
.crm-input-icon > .crm-eye { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--crm-ink-3); padding: .4rem .6rem; }
.crm-auth-card .btn-lg { height: 52px; border-radius: 12px; font-weight: 600; }
.crm-auth-note { display: flex; gap: .5rem; align-items: center; margin-top: 1.4rem; font-size: .78rem; color: var(--crm-ink-3); }
.crm-auth-mobile-brand { display: none; }

.crm-otp-wrap { position: relative; margin-bottom: 1.2rem; }
.crm-otp-wrap > input {
    position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; z-index: 2;
    font-size: 16px; caret-color: transparent; cursor: text;
}
.crm-otp-boxes { display: flex; gap: .55rem; justify-content: space-between; }
.crm-otp-boxes span {
    flex: 1; max-width: 58px; height: 62px; display: grid; place-items: center; font-size: 1.6rem; font-weight: 700;
    border: 1.5px solid var(--crm-border); border-radius: 13px; background: var(--crm-surface); color: var(--crm-ink);
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.crm-otp-boxes span.filled { border-color: #a5a8f6; background: var(--crm-primary-soft); }
.crm-otp-wrap.focused .crm-otp-boxes span.current {
    border-color: var(--crm-primary); box-shadow: 0 0 0 4px rgba(79, 70, 229, .14);
}
.crm-otp-wrap.focused .crm-otp-boxes span.current:empty::after {
    content: ""; width: 2px; height: 26px; background: var(--crm-primary); animation: crm-blink 1s steps(1) infinite;
}
@keyframes crm-blink { 50% { opacity: 0; } }
.crm-otp-sent { display: flex; align-items: center; gap: .75rem; padding: .8rem 1rem; border-radius: 12px; background: var(--crm-gradient-soft); margin-bottom: 1.3rem; }
.crm-otp-sent i { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: #fff; color: var(--crm-primary); font-size: 1.15rem; box-shadow: var(--crm-shadow-sm); }
.crm-otp-masked { letter-spacing: .1em; font-variant-numeric: tabular-nums; font-weight: 700; }

.crm-otp-choice {
    display: flex; align-items: center; gap: .9rem; padding: 1rem 1.1rem; margin-bottom: .7rem; cursor: pointer;
    border: 1.5px solid var(--crm-border); border-radius: 14px; background: var(--crm-surface); transition: border-color .15s, box-shadow .15s, background .15s;
}
.crm-otp-choice:hover { border-color: #c7c9fb; }
.crm-otp-choice:has(input:checked) { border-color: var(--crm-primary); background: var(--crm-primary-soft); box-shadow: 0 0 0 4px rgba(79, 70, 229, .1); }
.crm-otp-choice .phone { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.25rem; background: var(--crm-gradient); color: #fff; }
.crm-otp-choice input { display: none; }
.crm-otp-choice .check { margin-left: auto; font-size: 1.3rem; color: #d3d7e6; }
.crm-otp-choice:has(input:checked) .check { color: var(--crm-primary); }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .crm-sidebar { position: fixed; left: -280px; z-index: 40; transition: left .2s; }
    .crm-sidebar.open { left: 0; box-shadow: 0 0 60px rgba(0, 0, 0, .35); }
    .crm-content { padding: 1rem; }
    .crm-topbar { padding: .7rem 1rem; }
    .crm-auth-split { grid-template-columns: 1fr; }
    .crm-auth-brand { display: none; }
    .crm-auth-mobile-brand { display: flex; align-items: center; gap: .7rem; margin-bottom: 2rem; }
}
