/* ============================================================
   VIVAAN NEXA — Admin panel styles
   Palette: brand tokens defined below
   ============================================================ */

:root {
    --primary: #083D8B;
    --primary-dark: #032E75;
    --primary-blue: #0054CE;
    --blue-bright: #0188FC;

    --accent: #FE8713;
    --accent-orange: #FF610B;
    --accent-red: #FE3D06;

    --bg: #F7F9FC;
    --surface: #FFFFFF;

    --text-primary: #032E75;
    --text-secondary: #64748B;

    --border: #E5E7EB;

    /* derived */
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 1px 2px rgba(3, 46, 117, .05), 0 6px 18px rgba(3, 46, 117, .06);
    --shadow-lg: 0 10px 34px rgba(3, 46, 117, .16);
    --sidebar-w: 238px;
    --topbar-h: 68px;
    --font: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

/* No page-level left-right scroll anywhere in the CRM.
   Tables keep their own inner scroll (.table-wrap).
   `clip` (not hidden) keeps position:sticky working. */
html, body {
    overflow-x: hidden;
    overflow-x: clip;
}

/* sales pipeline strip + bulk bar — static, no animation */
.pipe-wrap {
    display: flex;
    gap: 10px;
    padding: 16px 18px;
    overflow-x: auto;
}

.pipe-card {
    flex: 1 1 0;
    min-width: 130px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    text-decoration: none;
}

.pipe-card span {
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.pipe-card strong {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.pipe-card small {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--primary-blue);
    font-variant-numeric: tabular-nums;
}

.bulk-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.bulk-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: auto;
}

.bulk-check input { width: 16px; height: 16px; accent-color: var(--primary-blue); }

/* service checkbox grid (lead form) — static */
.check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-size: 13.2px;
    font-weight: 500;
    cursor: pointer;
}

.check-item input { width: 15px; height: 15px; accent-color: var(--primary-blue); flex: none; }
.check-item:has(input:checked) { border-color: var(--blue-bright); background: #F2F7FF; }
.table thead input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--primary-blue); }
.table tbody input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--primary-blue); }

/* print: invoice / document preview prints cleanly */
@media print {
    .sidebar, .topbar, .app__overlay, .app-footer,
    .page-head__actions, .qf-actions, .no-print {
        display: none !important;
    }
    .app__main { margin-left: 0; }
    .content { max-width: none; padding: 0; margin: 0; }
    .card, .card--saas { box-shadow: none; border: 1px solid #ddd; }
    body { background: #fff; font-size: 12px; }
    a { color: inherit; text-decoration: none; }
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--text-primary);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p { margin: 0; }

a { color: var(--primary-blue); text-decoration: none; }
a:hover { color: var(--primary); }

img, svg { display: block; }

button { font-family: inherit; }

::selection { background: rgba(1, 136, 252, .22); }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }

.app__main {
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.content {
    flex: 1;
    padding: 26px 30px 34px;
    width: 100%;
    max-width: 1360px;
    margin: 0 auto;
}

.app-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 30px;
    font-size: 12.5px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.app__overlay {
    position: fixed;
    inset: 0;
    background: rgba(3, 46, 117, .45);
    opacity: 0;
    visibility: hidden;
    transition: .22s ease;
    z-index: 40;
}

/* ---------- sidebar (black theme like reference) ---------- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    background: #0A1122;
    color: #CBD5E1;
    z-index: 50;
    transition: transform .25s ease;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 22px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    background: linear-gradient(135deg, rgba(56, 189, 248, .14) 0%, rgba(255, 106, 0, .10) 55%, transparent 100%);
    position: relative;
    overflow: hidden;
}
.sidebar__brand::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: linear-gradient(90deg, #38BDF8 0%, #818CF8 45%, #FF6A00 100%);
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    flex: none;
    overflow: hidden;
}

.brand-logo {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    height: auto;
    max-height: 52px;
    object-fit: contain;
    object-position: left center;
    display: block;
    border-radius: 0;
    background: transparent;
    border: 0;
}

.sidebar__brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; flex: 1; }
.sidebar__brand-text strong {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 1.2px;
    white-space: nowrap;
    background: linear-gradient(90deg, #FFFFFF 5%, #7DD3FC 45%, #FB923C 85%, #FF6A00 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 8px rgba(56, 189, 248, .35));
}
.sidebar__brand-text small {
    margin-top: 4px;
    align-self: flex-start;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 2.2px;
    color: #FFE7D1;
    background: linear-gradient(90deg, rgba(255, 106, 0, .35), rgba(56, 189, 248, .25));
    border: 1px solid rgba(255, 106, 0, .45);
    padding: 3px 9px;
    border-radius: 999px;
}

.sidebar__nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px 10px;
}

.sidebar__label {
    margin: 14px 10px 8px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: #5B6B82;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 13px;
    margin-bottom: 4px;
    border-radius: var(--radius-sm);
    color: #CBD5E1;
    font-weight: 500;
    font-size: 14px;
    position: relative;
    transition: background .16s ease, color .16s ease;
}

.nav-item svg { flex: none; opacity: .85; }

.nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.nav-item.is-active {
    background: rgba(255, 255, 255, 0.09);
    color: #FFFFFF;
    font-weight: 700;
    box-shadow: none;
}

.nav-item.is-active svg { opacity: 1; }

/* ---------- advanced sidebar nav (static SaaS, no animation) ---------- */
.sidebar__label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar__label::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.07);
}

.nav-item svg {
    width: 18px;
    height: 18px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: 0;
    opacity: 1;
    color: #8A94A6;
}

.nav-item:hover svg {
    background: transparent;
    color: #fff;
}

.nav-item.is-active svg {
    background: transparent;
    border: 0;
    color: #38BDF8;
}

.nav-item.is-active::before {
    content: "";
    position: absolute;
    left: -14px;
    top: 9px;
    bottom: 9px;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: #38BDF8;
}

.sidebar__foot {
    display: flex;
    justify-content: space-between;
    padding: 14px 22px;
    font-size: 11.5px;
    color: rgba(203, 213, 225, .5);
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

/* ---------- topbar ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: var(--topbar-h);
    padding: 0 30px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.topbar__left { display: flex; align-items: center; gap: 14px; min-width: 0; }

.topbar__title {
    font-size: 16.5px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.icon-btn {
    display: none;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-primary);
    cursor: pointer;
    transition: .15s ease;
}
.icon-btn:hover { background: var(--bg); border-color: var(--blue-bright); color: var(--primary-blue); }

/* ---------- user menu ---------- */
.topbar__right { display: flex; align-items: center; gap: 10px; }

.user-menu { position: relative; }

.user-menu__btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px 6px 6px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    transition: .15s ease;
}
.user-menu__btn:hover, .user-menu__btn[aria-expanded="true"] {
    background: var(--bg);
    border-color: var(--border);
}

.user-menu__meta { display: none; flex-direction: column; line-height: 1.2; text-align: left; }
.user-menu__meta strong { font-size: 13.5px; }
.user-menu__meta small { font-size: 11.5px; color: var(--text-secondary); text-transform: capitalize; }

.avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary));
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .5px;
    flex: none;
}
.avatar--sm { width: 36px; height: 36px; font-size: 12.5px; }
.avatar--lg { width: 54px; height: 54px; font-size: 17px; }

.dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 226px;
    padding: 7px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: .16s ease;
    z-index: 60;
}

.dropdown.is-open { opacity: 1; visibility: visible; transform: translateY(0); }

.dropdown__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 11px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-primary);
    font-size: 13.8px;
    text-align: left;
    cursor: pointer;
    transition: .13s ease;
}
.dropdown__item:hover { background: var(--bg); color: var(--primary-blue); }
.dropdown__item--danger { color: var(--accent-red); }
.dropdown__item--danger:hover { background: #FFEDE8; color: var(--accent-red); }

.dropdown__divider { height: 1px; margin: 6px 4px; background: var(--border); }

/* ---------- page head ---------- */
.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 22px;
}

.page-head h2 { font-size: 21px; font-weight: 700; letter-spacing: -.2px; }
.page-head p { font-size: 13.5px; color: var(--text-secondary); margin-top: 3px; }
.page-head__actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 17px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
    transition: .15s ease;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn--primary { background: var(--primary-blue); color: #fff; box-shadow: 0 6px 14px rgba(0, 84, 206, .25); }
.btn--primary:hover { background: var(--primary); color: #fff; }

.btn--accent { background: var(--accent); color: #fff; box-shadow: 0 6px 14px rgba(254, 135, 19, .28); }
.btn--accent:hover { background: var(--accent-orange); color: #fff; }

.btn--danger { background: var(--accent-red); color: #fff; }
.btn--danger:hover { background: #DC3406; color: #fff; }

.btn--ghost { background: var(--surface); color: var(--text-primary); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--blue-bright); color: var(--primary-blue); background: var(--bg); }

.btn--sm { padding: 6px 12px; font-size: 13px; }
.btn--block { width: 100%; }

.btn:disabled { opacity: .6; cursor: not-allowed; }

/* ---------- cards ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 17px 20px;
    border-bottom: 1px solid var(--border);
}

.card__head h3 { font-size: 15.5px; font-weight: 700; }
.card__head small { display: block; font-size: 12.5px; color: var(--text-secondary); font-weight: 400; }
.card__body { padding: 20px; }

/* ---------- stat cards ---------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}

.stat-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 19px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.stat-card::after {
    content: "";
    position: absolute;
    right: -34px;
    top: -34px;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: currentColor;
    opacity: .06;
}

.stat-card__icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 13px;
    flex: none;
}

.stat-card__icon--blue   { background: rgba(0, 84, 206, .10); color: var(--primary-blue); }
.stat-card__icon--navy   { background: rgba(8, 61, 139, .10); color: var(--primary); }
.stat-card__icon--orange { background: rgba(254, 135, 19, .14); color: var(--accent-orange); }
.stat-card__icon--red    { background: rgba(254, 61, 6, .10); color: var(--accent-red); }

.stat-card__info { min-width: 0; display: flex; flex-direction: column; }
.stat-card__label { font-size: 12.5px; color: var(--text-secondary); font-weight: 600; letter-spacing: .2px; }
.stat-card__value { font-size: 26px; font-weight: 700; line-height: 1.15; color: var(--text-primary); }
.stat-card__sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.stat-card__sub b { color: var(--primary-blue); font-weight: 700; }
.stat-card__sub b.is-accent { color: var(--accent-orange); }

/* ---------- dashboard grid ---------- */
.grid-2 {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
    gap: 18px;
    margin-bottom: 22px;
}

.grid-2--even { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---------- charts ---------- */
.chart { width: 100%; }
.chart svg { width: 100%; height: auto; display: block; }

.chart-empty {
    display: grid;
    place-items: center;
    min-height: 220px;
    color: var(--text-secondary);
    font-size: 13.5px;
}

.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; }

.legend__item { display: flex; align-items: center; gap: 7px; font-size: 12.8px; color: var(--text-secondary); }
.legend__dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend__item b { color: var(--text-primary); font-weight: 700; }

.donut-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }

/* ---------- table ---------- */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--border);
}

.toolbar .field { margin: 0; }
.toolbar .input, .toolbar .select { min-width: 170px; }

.table-wrap { overflow-x: auto; }

table.table { width: 100%; border-collapse: collapse; font-size: 13.8px; }

.table th {
    padding: 12px 18px;
    text-align: left;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .7px;
    text-transform: uppercase;
    color: var(--text-secondary);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table td {
    padding: 13px 18px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--text-primary);
}

.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s ease; }
.table tbody tr:hover { background: rgba(1, 136, 252, .035); }

.table .muted { color: var(--text-secondary); font-size: 13px; }
.table .num { color: var(--text-secondary); font-variant-numeric: tabular-nums; }

.cell-user { display: flex; align-items: center; gap: 11px; min-width: 0; }
.cell-user strong { display: block; font-size: 14px; }
.cell-user small { display: block; font-size: 12.3px; color: var(--text-secondary); }

.row-actions { display: flex; gap: 7px; justify-content: flex-end; }

.icon-btn-sm {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: .14s ease;
}
.icon-btn-sm:hover { border-color: var(--blue-bright); color: var(--primary-blue); background: var(--bg); }
.icon-btn-sm.is-danger:hover { border-color: var(--accent-red); color: var(--accent-red); background: #FFEDE8; }

/* ---------- badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3.5px 10px;
    border-radius: 999px;
    font-size: 11.8px;
    font-weight: 700;
    letter-spacing: .3px;
    text-transform: capitalize;
    white-space: nowrap;
}

.badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.badge--success { background: #E6F6EC; color: #157F3D; }
.badge--warning { background: #FFF2E1; color: #C75B09; }
.badge--muted   { background: #EEF1F6; color: #64748B; }
.badge--primary { background: #E4EDFD; color: var(--primary-blue); }
.badge--info    { background: #E2F3FE; color: #0369A1; }
.badge--danger  { background: #FFEAE4; color: var(--accent-red); }

/* ---------- pagination ---------- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 18px;
    border-top: 1px solid var(--border);
}

.pagination__info { font-size: 13px; color: var(--text-secondary); }

.pagination__list { display: flex; gap: 6px; flex-wrap: wrap; }

.page-link {
    display: grid;
    place-items: center;
    min-width: 34px;
    height: 34px;
    padding: 0 9px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-primary);
    font-size: 13.4px;
    font-weight: 600;
    transition: .14s ease;
}
.page-link:hover { border-color: var(--blue-bright); color: var(--primary-blue); }
.page-link.is-active { background: var(--primary-blue); border-color: var(--primary-blue); color: #fff; box-shadow: 0 5px 12px rgba(0, 84, 206, .28); }
.page-link.is-disabled { opacity: .45; pointer-events: none; }

/* ---------- forms ---------- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 17px;
}

/* grid gap already spaces rows — drop the extra field margin inside grids */
.form-grid .field {
    margin-bottom: 0;
}

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 17px; }
.field:last-child { margin-bottom: 0; }

.field label { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.field label .req { color: var(--accent-red); margin-left: 2px; }

.input, .select, .textarea {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: .14s ease;
    outline: none;
}

.textarea { min-height: 96px; resize: vertical; }

.input::placeholder, .textarea::placeholder { color: #9AA5B5; }

.input:focus, .select:focus, .textarea:focus {
    border-color: var(--blue-bright);
    box-shadow: 0 0 0 3px rgba(1, 136, 252, .16);
}

.input[readonly] { background: var(--bg); color: var(--text-secondary); }

.select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

.field__hint { font-size: 12.2px; color: var(--text-secondary); }

.form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.form-error {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 12px 15px;
    margin-bottom: 18px;
    border: 1px solid #FFD3C7;
    background: #FFF1EC;
    border-radius: var(--radius-sm);
    color: #B42C05;
    font-size: 13.6px;
}

.form-error ul { margin: 0; padding-left: 17px; }

/* ---------- toasts ---------- */
.toast {
    position: fixed;
    top: 22px;
    right: 22px;
    z-index: 90;
    display: flex;
    align-items: center;
    gap: 11px;
    max-width: 380px;
    padding: 13px 15px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    font-size: 13.8px;
    color: var(--text-primary);
    animation: toast-in .25s ease both;
}

.toast svg { flex: none; }
.toast--success svg { color: #157F3D; }
.toast--info { border-left: 4px solid var(--primary-blue); }
.toast--success { border-left: 4px solid #157F3D; }
.toast--error { border-left: 4px solid var(--accent-red); }
.toast--error svg { color: var(--accent-red); }

.toast__msg { flex: 1; }

.toast__close {
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
}
.toast__close:hover { color: var(--accent-red); }

.toast.is-leaving { animation: toast-out .22s ease both; }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(-10px) translateX(14px); }
    to   { opacity: 1; transform: none; }
}

@keyframes toast-out {
    to { opacity: 0; transform: translateX(24px); }
}

/* ---------- activity feed ---------- */
.feed { display: flex; flex-direction: column; }

.feed__item {
    display: flex;
    gap: 13px;
    padding: 13px 0;
    border-bottom: 1px dashed var(--border);
}
.feed__item:last-child { border-bottom: 0; padding-bottom: 0; }
.feed__item:first-child { padding-top: 0; }

.feed__dot {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    flex: none;
    background: rgba(0, 84, 206, .10);
    color: var(--primary-blue);
}
.feed__dot.is-accent { background: rgba(254, 135, 19, .14); color: var(--accent-orange); }
.feed__dot.is-navy { background: rgba(8, 61, 139, .10); color: var(--primary); }

.feed__body { min-width: 0; }
.feed__body p { font-size: 13.6px; color: var(--text-primary); }
.feed__body time { font-size: 12.2px; color: var(--text-secondary); }

/* ---------- empty state ---------- */
.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 44px 20px;
    text-align: center;
    color: var(--text-secondary);
}
.empty svg { color: #B9C3D3; }
.empty strong { color: var(--text-primary); font-size: 15px; }
.empty p { font-size: 13.4px; max-width: 380px; }

/* ---------- auth / login ---------- */
.auth {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-height: 100vh;
}

.auth__brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 46px;
    overflow: hidden;
    background: linear-gradient(150deg, var(--primary) 0%, var(--primary-dark) 62%, #021F52 100%);
    color: #fff;
}

.auth__brand::before,
.auth__brand::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, .06);
}
.auth__brand::before { width: 340px; height: 340px; right: -110px; top: -90px; }
.auth__brand::after  { width: 240px; height: 240px; left: -80px; bottom: -70px; background: rgba(254, 135, 19, .14); }

.auth__brand > * { position: relative; z-index: 1; }

.auth__logo { display: flex; align-items: center; gap: 13px; }
.auth__logo .brand-mark { background: rgba(255, 255, 255, .16); width: 46px; height: 46px; }
.auth__logo strong { display: block; font-size: 18px; letter-spacing: .5px; }
.auth__logo small { color: rgba(255, 255, 255, .62); font-size: 12.5px; }

.auth__pitch h2 { font-size: 33px; line-height: 1.25; font-weight: 700; letter-spacing: -.4px; }
.auth__pitch h2 span { color: var(--accent); }
.auth__pitch p { margin-top: 14px; font-size: 14.5px; color: rgba(255, 255, 255, .72); max-width: 420px; }

.auth__points { display: flex; flex-direction: column; gap: 11px; margin-top: 26px; }
.auth__point { display: flex; align-items: center; gap: 10px; font-size: 14px; color: rgba(255, 255, 255, .85); }
.auth__point svg { color: var(--accent); flex: none; }

.auth__foot { font-size: 12.5px; color: rgba(255, 255, 255, .5); }

.auth__panel {
    display: grid;
    place-items: center;
    padding: 34px;
    background: var(--bg);
}

.auth__card {
    width: 100%;
    max-width: 420px;
    padding: 36px 34px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
}

.auth__card h1 { font-size: 24px; font-weight: 700; letter-spacing: -.3px; }
.auth__card > p { margin-top: 6px; margin-bottom: 26px; font-size: 13.8px; color: var(--text-secondary); }

.auth__demo {
    margin-top: 20px;
    padding: 11px 14px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    font-size: 12.6px;
    color: var(--text-secondary);
}
.auth__demo b { color: var(--text-primary); }

/* ---------- responsive ---------- */
@media (min-width: 640px) {
    .user-menu__meta { display: flex; }
}

@media (max-width: 1100px) {
    .grid-2, .grid-2--even { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    body.sidebar-open .sidebar { transform: translateX(0); }
    body.sidebar-open .app__overlay { opacity: 1; visibility: visible; }
    .app__main { margin-left: 0; }
    .icon-btn { display: grid; }
    .auth { grid-template-columns: minmax(0, 1fr); }
    .auth__brand { display: none; }
}

@media (max-width: 640px) {
    .content { padding: 20px 16px 28px; }
    .topbar { padding: 0 16px; }
    .app-footer { padding: 14px 16px; flex-direction: column; gap: 4px; }
    .stat-grid { grid-template-columns: minmax(0, 1fr); }
    .page-head h2 { font-size: 18.5px; }
    .toolbar .input, .toolbar .select { min-width: 0; flex: 1 1 140px; }
    .auth__panel { padding: 20px; }
    .auth__card { padding: 28px 22px; }
}

/* ============================================================
   VIVAAN NEXA — SaaS UI + Advanced Animations + Scroll Reveal
   ============================================================ */
:root {
    --saas-grad: linear-gradient(135deg, #032E75 0%, #0054CE 45%, #0188FC 100%);
    --saas-accent-grad: linear-gradient(135deg, #FE8713, #FF610B 55%, #FE3D06);
    --saas-glass: rgba(255,255,255,.72);
    --saas-ring: rgba(1,136,252,.18);
}

/* ---------- scroll reveal ---------- */
[data-reveal] {
    opacity: 0;
    transform: translateY(28px) scale(.985);
    filter: blur(6px);
    transition: opacity .8s cubic-bezier(.16,1,.3,1), transform .8s cubic-bezier(.16,1,.3,1), filter .8s;
    transition-delay: var(--d, 0ms);
    will-change: opacity, transform;
}
[data-reveal].is-visible {
    opacity: 1;
    transform: none;
    filter: blur(0);
}

/* ---------- segmented / live ---------- */
.segmented { position: relative; overflow: hidden; }
.segmented::after { content:""; position:absolute; inset:0; border-radius:12px; pointer-events:none;
    background: linear-gradient(110deg, transparent 30%, rgba(1,136,252,.12) 50%, transparent 70%);
    background-size: 200% 100%; animation: shimmer 3.5s linear infinite; }
.segmented-btn { position:relative; z-index:1; transition: .25s; }
.segmented-btn.is-active { animation: popIn .35s cubic-bezier(.34,1.56,.64,1); }
.live-badge { display:inline-flex; align-items:center; gap:6px; padding:2px 10px; border-radius:999px;
    background:#E6F6EC; color:#157F3D; font-size:11px; font-weight:800; letter-spacing:.6px; }
.pulse-dot { width:8px; height:8px; border-radius:50%; background:#22C55E; position:relative; flex:none; }
.pulse-dot::after { content:""; position:absolute; inset:-4px; border-radius:50%; border:2px solid #22C55E; opacity:.6; animation: pulseRing 1.8s ease-out infinite; }

/* ---------- SaaS hero ---------- */
.saas-hero { position:relative; overflow:hidden; border-radius:22px; padding:34px 32px; margin-bottom:22px;
    background: linear-gradient(120deg, #021F52 0%, #032E75 35%, #0054CE 70%, #0188FC 110%);
    background-size: 220% 220%; animation: gradientPan 12s ease infinite;
    color:#fff; box-shadow: 0 20px 60px rgba(3,46,117,.35); isolation:isolate; }
.saas-hero__bg { position:absolute; inset:0; z-index:0; overflow:hidden; }
.orb { position:absolute; border-radius:50%; filter: blur(60px); opacity:.55; animation: float 9s ease-in-out infinite; }
.orb--1 { width:340px; height:340px; right:-80px; top:-120px; background: radial-gradient(circle, #FE8713, transparent 70%); animation-delay:0s; }
.orb--2 { width:280px; height:280px; left:30%; bottom:-140px; background: radial-gradient(circle, #0188FC, transparent 70%); animation-delay:-3s; }
.orb--3 { width:200px; height:200px; left:-60px; top:-60px; background: radial-gradient(circle, #7DD3FC, transparent 70%); opacity:.4; animation-delay:-6s; }
.saas-grid-lines { position:absolute; inset:0;
    background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px);
    background-size: 44px 44px; mask-image: radial-gradient(ellipse 80% 90% at 30% 20%, black 30%, transparent 75%); }
.saas-hero__content { position:relative; z-index:1; display:grid; grid-template-columns: 1.1fr .9fr; gap:28px; align-items:center; }
.saas-pill { display:inline-flex; align-items:center; gap:8px; padding:7px 14px; border-radius:999px;
    background: rgba(255,255,255,.14); border:1px solid rgba(255,255,255,.22); backdrop-filter: blur(10px);
    font-size:12.5px; font-weight:600; letter-spacing:.2px; }
.saas-hero__title { font-size: clamp(24px, 3vw, 36px); font-weight:800; letter-spacing:-.5px; line-height:1.15; margin:14px 0 8px; color:#fff; }
.wave { display:inline-block; animation: wave 2.2s ease-in-out infinite; transform-origin: 70% 70%; }
.saas-hero__sub { color: rgba(255,255,255,.82); font-size:14.5px; max-width:480px; }
.saas-hero__sub strong { color:#FFD9B8; }
.saas-hero__actions { display:flex; gap:10px; flex-wrap:wrap; margin-top:18px; }
.btn--glass { background: rgba(255,255,255,.16); color:#fff; border:1px solid rgba(255,255,255,.28); backdrop-filter: blur(10px); }
.btn--glass:hover { background: rgba(255,255,255,.26); color:#fff; transform: translateY(-2px); }
.saas-hero__meta { display:flex; gap:22px; margin-top:20px; }
.saas-mini { display:flex; flex-direction:column; }
.saas-mini strong { font-size:24px; font-weight:800; font-variant-numeric: tabular-nums; }
.saas-mini span { font-size:12px; color: rgba(255,255,255,.65); text-transform:uppercase; letter-spacing:1px; }

/* floating cards */
.saas-hero__right { position:relative; min-height:260px; }
.saas-float-card { background: rgba(255,255,255,.96); border-radius:16px; padding:14px 16px; color: var(--text-primary);
    box-shadow: 0 18px 50px rgba(0,0,0,.28); transition: transform .35s cubic-bezier(.34,1.56,.64,1), box-shadow .3s; }
.saas-float-card--main { animation: floatY 6s ease-in-out infinite; }
.saas-float-head { display:flex; align-items:center; gap:6px; font-size:12px; font-weight:700; color: var(--text-secondary); margin-bottom:8px; }
.dot { width:9px; height:9px; border-radius:50%; }
.dot--r { background:#FE3D06; } .dot--y { background:#F9A825; } .dot--g { background:#22C55E; }
.saas-area { width:100%; height:auto; }
.area-line { stroke-dasharray: 620; stroke-dashoffset: 620; animation: drawLine 2.2s .4s cubic-bezier(.4,0,.2,1) forwards; }
.area-fill { opacity:0; animation: fadeIn 1.2s 1.4s forwards; }
.area-dot { animation: dotPulse 2s 2s ease-in-out infinite; transform-origin:center; transform-box: fill-box; }
.saas-float-foot { display:flex; gap:8px; align-items:center; font-size:12.5px; color:var(--text-secondary); margin-top:6px; }
.saas-float-foot .up { background:#E6F6EC; color:#157F3D; font-weight:800; padding:2px 9px; border-radius:999px; }
.saas-float-card--small { position:absolute; display:flex; align-items:center; gap:10px; padding:10px 14px; font-size:13px; }
.saas-float-card--small strong { display:block; font-size:13.5px; } .saas-float-card--small small { color:var(--text-secondary); }
.saas-float-a { right: -6px; top: -18px; animation: floatY 5s -2s ease-in-out infinite; }
.saas-float-b { left: -10px; bottom: -14px; animation: floatY 7s -4s ease-in-out infinite; }
.saas-emoji { font-size:22px; animation: bounceSoft 2.4s ease-in-out infinite; }

/* ---------- SaaS cards ---------- */
.page-head--saas h2 { background: linear-gradient(90deg, var(--text-primary), var(--primary-blue)); -webkit-background-clip:text; background-clip:text; }
.card--saas { position:relative; overflow:hidden; border-radius:18px; transition: transform .35s cubic-bezier(.16,1,.3,1), box-shadow .35s, border-color .3s; }
.card--saas:hover { transform: translateY(-5px); box-shadow: 0 18px 48px rgba(3,46,117,.14); border-color:#C9DBFA; }
.card--saas::before { content:""; position:absolute; top:0; left:0; right:0; height:3px;
    background: linear-gradient(90deg, var(--accent), var(--blue-bright), var(--primary-blue)); opacity:0; transition:.4s; }
.card--saas:hover::before { opacity:1; }
.stat-grid--saas { grid-template-columns: repeat(6, minmax(0,1fr)); }
.stat-card--saas { flex-direction:column; align-items:flex-start; gap:10px; border-radius:18px; cursor:pointer; }
.stat-card--saas:hover { transform: translateY(-6px) scale(1.015); box-shadow: 0 16px 44px rgba(3,46,117,.16); }
.stat-card--saas:hover .stat-card__icon { transform: scale(1.12) rotate(-6deg); }
.stat-card__icon { transition: transform .35s cubic-bezier(.34,1.56,.64,1); }
.stat-glow { position:absolute; width:120px; height:120px; right:-30px; top:-30px; border-radius:50%;
    background: radial-gradient(circle, rgba(1,136,252,.16), transparent 70%); transition:.4s; }
.stat-card--saas:hover .stat-glow { transform: scale(1.6); }
.spark { width:100%; height:30px; color:#0188FC; opacity:.85; }
.spark path { stroke-dasharray: 220; stroke-dashoffset: 220; animation: drawLine 1.8s .3s forwards; }
.stat-card--saas:nth-child(3n) .spark { color:#FE8713; }
.stat-card__sub b.is-live { background:#E6F6EC; color:#157F3D; padding:1px 8px; border-radius:999px; animation: liveBlink 1.6s infinite; }

/* ---------- charts / progress ---------- */
.chart--animated svg { animation: fadeIn .8s ease both; }
.grid-2--saas { margin-bottom:18px; }
.progress-rows { display:flex; flex-direction:column; gap:10px; margin-top:16px; }
.progress-row { display:grid; grid-template-columns: 1fr auto; gap:4px 10px; font-size:12.8px; color:var(--text-secondary); align-items:center; }
.progress-row span:first-child { grid-column: 1 / -1; font-weight:600; color:var(--text-primary); }
.progress { height:9px; border-radius:999px; background:#EEF1F6; overflow:hidden; grid-column:1; min-width:120px; }
.progress span { display:block; height:100%; width:0; border-radius:999px;
    background: linear-gradient(90deg,#0054CE,#0188FC); transition: width 1.4s cubic-bezier(.16,1,.3,1); }
.is-visible .progress span, .progress span { width: var(--w, 50%); animation: fillBar 1.4s cubic-bezier(.16,1,.3,1) both; }
.progress--orange span { background: linear-gradient(90deg,#FE8713,#F9A825); }
.progress--green span { background: linear-gradient(90deg,#157F3D,#34C77B); }
.progress--red span { background: linear-gradient(90deg,#FE3D06,#FF7A45); }

/* funnel + quick actions */
.funnel { display:flex; flex-direction:column; gap:10px; margin-top:16px; }
.funnel-row { display:grid; grid-template-columns: 64px 1fr 34px; gap:10px; align-items:center; font-size:13px; }
.funnel-bar { height:12px; background:#EEF1F6; border-radius:999px; overflow:hidden; }
.funnel-bar span { display:block; height:100%; width: var(--w); background: var(--c); border-radius:999px; animation: fillBar 1.3s cubic-bezier(.16,1,.3,1) both; }
.quick-actions { display:grid; grid-template-columns: repeat(3,1fr); gap:10px; margin-top:16px; }
.qa { display:flex; align-items:center; gap:8px; justify-content:center; padding:11px; border-radius:12px;
    background: var(--bg); border:1px dashed var(--border); font-size:13px; font-weight:700; transition:.25s; }
.qa span { display:grid; place-items:center; width:26px; height:26px; border-radius:8px; background:#fff; border:1px solid var(--border); }
.qa:hover { background: var(--primary-blue); color:#fff; border-style:solid; border-color:var(--primary-blue); transform: translateY(-3px); box-shadow:0 10px 22px rgba(0,84,206,.3); }

/* feed timeline */
.feed--timeline { position:relative; padding-left:4px; }
.feed--timeline::before { content:""; position:absolute; left:16px; top:8px; bottom:8px; width:2px;
    background: linear-gradient(180deg, var(--blue-bright), var(--accent), transparent); opacity:.4; }
.feed--timeline .feed__item { position:relative; animation: slideIn .5s both; }
.feed--timeline .feed__item:nth-child(2){animation-delay:.08s} .feed--timeline .feed__item:nth-child(3){animation-delay:.16s}
.feed--timeline .feed__item:nth-child(4){animation-delay:.24s} .feed--timeline .feed__item:nth-child(5){animation-delay:.32s}
.feed__dot { position:relative; overflow:visible; }
.pulse-ring { position:absolute; inset:-4px; border-radius:50%; border:2px solid var(--blue-bright); opacity:0; animation: pulseRing 2s infinite; }

/* tables */
.table--saas tbody tr { transition: .2s; }
.table--saas tbody tr:hover { background: linear-gradient(90deg, rgba(1,136,252,.06), rgba(254,135,19,.05)); transform: scale(1.005); }
.avatar--glow { box-shadow: 0 0 0 3px rgba(1,136,252,.15), 0 6px 14px rgba(0,84,206,.3); }

/* pay tiles */
.pay-grid { display:grid; grid-template-columns: repeat(2,1fr); gap:12px; }
.pay-tile { padding:16px; border-radius:14px; border:1px solid var(--border); background: linear-gradient(180deg,#fff,#F7F9FC); transition:.3s; }
.pay-tile:hover { transform: translateY(-4px) scale(1.02); box-shadow: var(--shadow-lg); }
.pay-tile span { font-size:11px; font-weight:800; letter-spacing:1px; text-transform:uppercase; color:var(--text-secondary); }
.pay-tile strong { display:block; font-size:26px; margin:4px 0 8px; font-variant-numeric:tabular-nums; }
.hint { margin-top:14px; font-size:12.8px; color:var(--text-secondary); background: #FFF7ED; border:1px dashed #FDBA74; padding:10px 12px; border-radius:10px; }

/* finance revenue chart — static CSS bars, no animation */
.fin-chart {
    display: flex;
    align-items: stretch;
    gap: 10px;
    min-height: 190px;
}

.fin-bar {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.fin-bar__val {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-secondary);
    min-height: 15px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.fin-bar__col {
    flex: 1;
    width: 100%;
    max-width: 44px;
    min-height: 80px;
    display: flex;
    align-items: flex-end;
    background: #EEF1F6;
    border-radius: 8px;
    overflow: hidden;
}

.fin-bar__col > span {
    display: block;
    width: 100%;
    background: linear-gradient(180deg, #0188FC, #0054CE);
    border-radius: 8px;
    min-height: 6px;
}

.fin-bar__lbl {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* invoice preview — static, print-ready */
.inv-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--primary-blue);
    margin-bottom: 16px;
}

.inv-brand {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.3px;
}

.inv-head .muted, .inv-head p {
    font-size: 12.8px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.inv-title { text-align: right; }
.inv-title h2 {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--primary);
}

.inv-no { font-size: 14px; font-weight: 700; margin: 2px 0 6px; }
.inv-title .badge { margin-top: 4px; }

.inv-meta {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    padding: 12px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.inv-meta span {
    display: block;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.inv-meta strong { font-size: 13.2px; }

.inv-parties {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.inv-parties > div {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
}

.inv-parties h4, .inv-bank h4, .inv-subhead {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.inv-parties p { font-size: 13.2px; margin-top: 2px; }
.inv-parties strong { font-size: 14.5px; }

.inv-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 18px;
    margin-top: 16px;
}

.inv-words {
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 13.2px;
    align-self: start;
}

.inv-words span {
    display: block;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.inv-words p { margin-top: 10px; }

.inv-bank {
    margin-top: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px 14px;
}

.inv-bank h4 { grid-column: 1 / -1; }
.inv-bank p { font-size: 13px; }
.inv-bank span {
    display: block;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.inv-subhead { margin: 18px 0 8px; }

@media (max-width: 900px) {
    .inv-meta { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .inv-summary { grid-template-columns: minmax(0, 1fr); }
    .inv-bank { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .inv-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .inv-parties { grid-template-columns: minmax(0, 1fr); }
    .inv-bank { grid-template-columns: minmax(0, 1fr); }
    .inv-title { text-align: left; }
}

/* gradient CTA card */
.card--gradient { background: linear-gradient(135deg, #032E75, #0054CE 55%, #7C3AED); color:#fff; border:0; }
.card--gradient h3, .card--gradient p { color:#fff; }
.gradient-title { font-size:22px; font-weight:800; }
.gradient-sub { color: rgba(255,255,255,.8); margin:8px 0 14px; font-size:13.8px; }
.marquee { overflow:hidden; white-space:nowrap; border-top:1px solid rgba(255,255,255,.2); border-bottom:1px solid rgba(255,255,255,.2); padding:8px 0; margin-bottom:16px; opacity:.85; }
.marquee__track { display:inline-flex; animation: marquee 14s linear infinite; font-size:12px; font-weight:800; letter-spacing:2px; }
.gradient-actions { display:flex; gap:10px; flex-wrap:wrap; }

/* ripple */
.btn-ripple { position:relative; overflow:hidden; }
.btn-ripple::after { content:""; position:absolute; width:12px; height:12px; border-radius:50%; background: rgba(255,255,255,.55);
    transform: scale(0); opacity:0; pointer-events:none; }
.btn-ripple:active::after { animation: ripple .6s ease-out; }

/* ---------- keyframes ---------- */
@keyframes gradientPan { 0%,100%{background-position:0% 50%} 50%{background-position:100% 50%} }
@keyframes float { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(24px,-24px) scale(1.08)} }
@keyframes floatY { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-12px)} }
@keyframes drawLine { to { stroke-dashoffset: 0; } }
@keyframes fadeIn { to { opacity:1; } }
@keyframes dotPulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.45)} }
@keyframes shimmer { 0%{background-position:-200% 0} 100%{background-position:200% 0} }
@keyframes popIn { 0%{transform:scale(.9)} 60%{transform:scale(1.05)} 100%{transform:scale(1)} }
@keyframes pulseRing { 0%{transform:scale(.6); opacity:.8} 100%{transform:scale(1.5); opacity:0} }
@keyframes wave { 0%,100%{transform:rotate(0)} 25%{transform:rotate(18deg)} 50%{transform:rotate(-8deg)} 75%{transform:rotate(14deg)} }
@keyframes bounceSoft { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-5px)} }
@keyframes fillBar { from{width:0} to{width:var(--w,50%)} }
@keyframes slideIn { from{opacity:0; transform:translateX(-14px)} to{opacity:1; transform:none} }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes ripple { 0%{transform:scale(0); opacity:.7} 100%{transform:scale(28); opacity:0} }
@keyframes liveBlink { 0%,100%{opacity:1} 50%{opacity:.55} }

/* ---------- responsive ---------- */
@media (max-width: 1400px) { .stat-grid--saas { grid-template-columns: repeat(3,1fr); } }
@media (max-width: 1100px) { .saas-hero__content { grid-template-columns: 1fr; } .saas-hero__right { min-height:220px; } }
@media (max-width: 640px) {
    .stat-grid--saas { grid-template-columns: 1fr 1fr; }
    .saas-hero { padding:24px 18px; }
    .saas-float-a { top:-8px; } .saas-float-b { bottom:-8px; }
    .pay-grid { grid-template-columns:1fr; }
    .quick-actions { grid-template-columns:1fr; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration:.01ms !important; transition-duration:.01ms !important; }
    [data-reveal] { opacity:1; transform:none; filter:none; }
}

/* ============================================================
   Dashboard advanced pack — tooltip, illustrations, tilt
   ============================================================ */
.chart--advanced { position: relative; }
.chart-tip {
    position: absolute;
    z-index: 5;
    transform: translate(-50%, -100%);
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 8px 12px;
    background: #032E75;
    color: #fff;
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(3, 46, 117, .35);
    font-size: 12px;
    line-height: 1.35;
    white-space: nowrap;
    pointer-events: none;
    animation: tipIn .18s ease both;
}
.chart-tip b { font-size: 12.5px; }
.chart-tip span { color: #9CC2FF; font-weight: 600; }
.chart-tip::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -5px;
    width: 10px;
    height: 10px;
    background: inherit;
    transform: translateX(-50%) rotate(45deg);
}
.chart-tip[hidden] { display: none; }
@keyframes tipIn {
    from { opacity: 0; transform: translate(-50%, -92%); }
    to { opacity: 1; transform: translate(-50%, -100%); }
}

/* empty-state SVG illustrations */
.empty-illus { animation: floatY 5s ease-in-out infinite; }
.illus-bubble { animation: dotPulse 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.chart-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }

/* smooth tilt return on cards */
.kpi[data-tilt], .card--saas[data-tilt], .saas-float-card[data-tilt] { transition: transform .35s ease, box-shadow .35s ease; }

/* ============================================================
   Lead analytics — source donut + conversion funnel
   ============================================================ */
.src-wrap {
    display: flex;
    align-items: center;
    gap: 22px;
}
.src-donut { flex: none; }
.src-seg {
    animation: donutGrow 1s cubic-bezier(.16,1,.3,1) both;
    stroke-dashoffset: var(--off);
}
@keyframes donutGrow {
    from { stroke-dasharray: 0 var(--circ); }
    to { stroke-dasharray: var(--len) calc(var(--circ) - var(--len)); }
}
.src-legend {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 18px;
    min-width: 0;
}
.src-item { display: flex; align-items: flex-start; gap: 9px; min-width: 0; }
.src-item .legend__dot { width: 11px; height: 11px; margin-top: 3px; }
.src-item strong { display: block; font-size: 13.5px; color: var(--text-primary); }
.src-item small { display: block; font-size: 12px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }

.conv-funnel { display: flex; flex-direction: column; gap: 13px; }
.conv-row {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr) 46px;
    gap: 12px;
    align-items: center;
}
.conv-row > span { font-size: 12.8px; color: var(--text-secondary); text-align: right; }
a.conv-row {
    text-decoration: none;
    color: inherit;
    border-radius: 10px;
    padding: 6px 8px;
    margin: -6px -8px;
    transition: background .2s ease, transform .2s ease;
}
a.conv-row:hover { background: #F6F9FE; }
a.conv-row:hover .conv-fill { filter: brightness(1.07); }
.conv-pct {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.conv-foot {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 12.8px;
    color: var(--text-secondary);
}
.conv-foot b {
    padding: 2px 10px;
    border-radius: 999px;
    background: #E2F5E9;
    color: #15803D;
    font-size: 12px;
}

/* ============================================================
   Conversion rate card — ring gauge + chips + win/loss bar
   ============================================================ */
.convrate-card {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 26px 28px;
    margin-bottom: 22px;
}
.convrate-ring { flex: none; }
.convrate-ring .ring-fg {
    stroke-dasharray: var(--c);
    stroke-dashoffset: var(--c);
    animation: ringFill 1.5s .25s cubic-bezier(.16,1,.3,1) forwards;
}
@keyframes ringFill {
    to { stroke-dashoffset: var(--off); }
}
.convrate-info { flex: 1 1 auto; min-width: 0; }
.convrate-info h3 { font-size: 17px; font-weight: 800; }
.convrate-sub { margin-top: 4px; font-size: 13px; color: var(--text-secondary); }
.convrate-sub b { color: #15803D; }
.convrate-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    border-radius: 999px;
    background: #F6F9FE;
    border: 1px solid var(--border-soft);
    font-size: 12.3px;
    color: var(--text-muted);
    transition: transform .2s ease, box-shadow .2s ease;
}
.chip:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.chip b { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.winloss {
    display: flex;
    height: 12px;
    margin-top: 16px;
    border-radius: 999px;
    overflow: hidden;
    background: #F1F5F9;
}
.winloss span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--c);
    animation: funnelFill 1.3s .3s cubic-bezier(.16,1,.3,1) both;
}
.winloss span + span { animation-delay: .45s; }
.convrate-legend {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 11.8px;
    color: var(--text-secondary);
}
.convrate-side {
    flex: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

@media (max-width: 767px) {
    .convrate-card { flex-direction: column; text-align: center; }
    .convrate-chips { justify-content: center; }
    .convrate-side { flex-direction: row; }
}
@media (prefers-reduced-motion: reduce) {
    .convrate-ring .ring-fg { animation: none; stroke-dashoffset: var(--off); }
    .winloss span { animation: none; width: var(--w); }
}

/* compact card — small size variant */
.card--compact { max-width: 560px; }
.card--compact .card__head { padding: 13px 16px; }
.card--compact .card__head h3 { font-size: 14px; }
.card--compact .card__body { padding: 14px 16px; }
.card--compact .chart svg { max-width: 190px; margin: 0 auto; }
.card--compact .legend { gap: 8px 12px; margin-top: 10px; justify-content: center; }
.card--compact .legend__item { font-size: 11.8px; }

/* ============================================================
   Card header SVG icon chips + hero icons/illustration
   ============================================================ */
.card-ico {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    flex: none;
    background: var(--primary-soft);
    color: var(--primary);
}
.card-ico svg { width: 18px; height: 18px; }
.card-ico.t-teal { background: #DFF5F2; color: #0D9488; }
.card-ico.t-blue { background: #E4EDFD; color: #0054CE; }
.card-ico.t-green { background: #E2F5E9; color: #16A34A; }
.card-ico.t-gold { background: #FDF0D3; color: #B45309; }
.card-ico.t-orange { background: #FDEFD9; color: #C26A0A; }
.card-ico.t-red { background: #FDE8E8; color: #E5484D; }
.card-ico.t-purple { background: #EDE9FE; color: #7C3AED; }
.card-ico.t-navy { background: #DFE7F5; color: #032E75; }

.cell-ellipsis {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* profile page hero — static SaaS */
.profile-hero {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.profile-hero h3 {
    font-size: 19px;
}

.profile-hero .muted {
    color: var(--text-secondary);
    font-size: 13.5px;
    margin-top: 2px;
}

.profile-hero__badges {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.profile-hero .btn {
    margin-left: auto;
}

@media (max-width: 640px) {
    .profile-hero .btn {
        margin-left: 0;
        width: 100%;
    }
}

/* roles page — static SaaS */
.role-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}

.role-card {
    padding: 20px;
    background: linear-gradient(180deg, #FFFFFF 0%, #F7F9FC 100%);
    transition: none;
    animation: none;
}

.role-card:hover {
    transform: none;
}

.role-card *,
.role-card *::before,
.role-card *::after {
    animation: none !important;
    transition: none !important;
}

.role-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--role-grad, linear-gradient(90deg, #0054CE, #0188FC));
}

.role-card--admin {
    --role-grad: linear-gradient(90deg, #E5484D, #FF7A45);
    box-shadow: 0 2px 6px rgba(229, 72, 77, .10), 0 14px 34px rgba(229, 72, 77, .12);
}

.role-card--co_admin {
    --role-grad: linear-gradient(90deg, #C81E1E, #F9A825);
    box-shadow: 0 2px 6px rgba(200, 30, 30, .10), 0 14px 34px rgba(200, 30, 30, .12);
}

.role-card--manager {
    --role-grad: linear-gradient(90deg, #FE8713, #F9A825);
    box-shadow: 0 2px 6px rgba(254, 135, 19, .10), 0 14px 34px rgba(254, 135, 19, .12);
}

.role-card--sales {
    --role-grad: linear-gradient(90deg, #FE8713, #FF7A45);
    box-shadow: 0 2px 6px rgba(254, 135, 19, .10), 0 14px 34px rgba(254, 135, 19, .12);
}

.role-card--accounts {
    --role-grad: linear-gradient(90deg, #16A34A, #4ADE80);
    box-shadow: 0 2px 6px rgba(22, 163, 74, .10), 0 14px 34px rgba(22, 163, 74, .12);
}

.role-card--hr {
    --role-grad: linear-gradient(90deg, #0054CE, #7C3AED);
    box-shadow: 0 2px 6px rgba(0, 84, 206, .10), 0 14px 34px rgba(0, 84, 206, .12);
}

.role-card--user {
    --role-grad: linear-gradient(90deg, #0054CE, #0188FC);
    box-shadow: 0 2px 6px rgba(0, 84, 206, .10), 0 14px 34px rgba(0, 84, 206, .12);
}

.role-card--admin .card-ico {
    background: linear-gradient(135deg, #FDE8E8, #FACACA);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 4px 10px rgba(229, 72, 77, .18);
}

.role-card--co_admin .card-ico {
    background: linear-gradient(135deg, #FDE8E8, #FBD9A8);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 4px 10px rgba(200, 30, 30, .18);
}

.role-card--manager .card-ico {
    background: linear-gradient(135deg, #FDEFD9, #FBD9A8);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 4px 10px rgba(254, 135, 19, .18);
}

.role-card--sales .card-ico {
    background: linear-gradient(135deg, #FDEFD9, #FBD9A8);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 4px 10px rgba(254, 135, 19, .18);
}

.role-card--accounts .card-ico {
    background: linear-gradient(135deg, #E2F5E9, #BBF7D0);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 4px 10px rgba(22, 163, 74, .18);
}

.role-card--hr .card-ico {
    background: linear-gradient(135deg, #E4EDFD, #DDD6FE);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 4px 10px rgba(0, 84, 206, .18);
}

.role-card--user .card-ico {
    background: linear-gradient(135deg, #E4EDFD, #C9DBFA);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 4px 10px rgba(0, 84, 206, .18);
}

.role-card--admin .role-card__count {
    background: linear-gradient(90deg, #C81E1E, #FF7A45);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.role-card--co_admin .role-card__count {
    background: linear-gradient(90deg, #C81E1E, #C26A0A);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.role-card--manager .role-card__count {
    background: linear-gradient(90deg, #C26A0A, #F9A825);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.role-card--sales .role-card__count {
    background: linear-gradient(90deg, #C26A0A, #FF7A45);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.role-card--accounts .role-card__count {
    background: linear-gradient(90deg, #15803D, #22C55E);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.role-card--hr .role-card__count {
    background: linear-gradient(90deg, #032E75, #7C3AED);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.role-card--user .role-card__count {
    background: linear-gradient(90deg, #032E75, #0188FC);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.role-card__top {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.role-card__top .muted {
    font-size: 12.8px;
    color: var(--text-secondary);
    margin-top: 6px;
}

.role-card__count {
    font-size: 32px;
    font-weight: 800;
    margin-top: 12px;
    font-variant-numeric: tabular-nums;
}

.role-card__count small {
    font-size: 12.5px;
    font-weight: 600;
    margin-left: 6px;
    background: none;
    -webkit-background-clip: border-box;
    background-clip: border-box;
    -webkit-text-fill-color: var(--text-secondary);
    color: var(--text-secondary);
}

.role-perms {
    list-style: none;
    margin: 12px 0 16px;
    padding: 14px 0 0;
    border-top: 1px dashed var(--border);
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.role-perms li {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13.2px;
}

.role-perms li.is-no {
    color: var(--text-secondary);
}

.perm-ico {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    flex: none;
}

.perm-ico.is-yes {
    background: #E2F5E9;
    color: #16A34A;
}

.perm-ico.is-no {
    background: #EEF1F6;
    color: #9AA5B5;
}

@media (max-width: 1100px) {
    .role-grid { grid-template-columns: minmax(0, 1fr); }
}

/* static cards — no hover lift animation */
.stat-card--static:hover,
.card--static:hover {
    transform: none;
    box-shadow: var(--shadow);
}

.stat-card--static::before,
.card--static::before {
    display: none;
}
.convrate-info h3 { display: flex; align-items: center; gap: 10px; }

/* hero slide icons + deco illustration */
.hero-ico {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .25);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    vertical-align: -5px;
}
.hero-ico svg { width: 14px; height: 14px; }
.hero-deco {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    height: 58px;
    opacity: .5;
    pointer-events: none;
    animation: floatY 7s ease-in-out infinite;
}
@media (max-width: 900px) {
    .hero-deco { display: none; }
}

/* ============================================================
   Clients clean SaaS page head (static, no animation)
   ============================================================ */
.page-head--clients {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 16px 20px;
}
.page-title-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.page-title-wrap h2 { font-size: 20px; }
.page-title-wrap p { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

/* ============================================================
   Modal popup (Add Client) — overlay, dialog, field icons
   ============================================================ */
body.modal-open { overflow: hidden; }
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 6vh 16px 16px;
    background: rgba(3, 46, 117, .5);
    backdrop-filter: blur(4px);
    overflow-y: auto;
    animation: overlayIn .22s ease both;
}
.modal-overlay[hidden] { display: none; }
@keyframes overlayIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.modal-dialog {
    width: 100%;
    max-width: 640px;
    background: var(--surface);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: modalIn .32s cubic-bezier(.16,1,.3,1) both;
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(26px) scale(.97); }
    to { opacity: 1; transform: none; }
}
.modal-head {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 18px 20px;
    background: linear-gradient(120deg, #021F52, #0054CE);
    color: #fff;
}
.modal-head h3 { color: #fff; font-size: 16.5px; }
.modal-head p { font-size: 12.5px; color: rgba(255, 255, 255, .75); margin-top: 1px; }
.modal-head .card-ico { background: rgba(255, 255, 255, .16); color: #fff; }
.modal-x { margin-left: auto; background: rgba(255, 255, 255, .14); border-color: transparent; color: #fff; }
.modal-x:hover { background: rgba(255, 255, 255, .28); color: #fff; border-color: transparent; }
.modal-body { padding: 20px; }
.modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px 18px;
    border-top: 1px solid var(--border);
    background: var(--bg);
}
.input-wrap { position: relative; display: block; }
.input-wrap > svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 17px;
    height: 17px;
    color: var(--text-secondary);
    opacity: .7;
    pointer-events: none;
}
.input-wrap .input { padding-left: 38px; }
.input-wrap:focus-within > svg { color: var(--primary-blue); opacity: 1; }

@media (max-width: 640px) {
    .modal-overlay { padding: 4vh 10px 10px; }
    .modal-body { padding: 16px 14px; }
}
@media (prefers-reduced-motion: reduce) {
    .modal-overlay, .modal-dialog { animation: none; }
}

/* view detail popup grid */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.detail-grid > div {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 13px;
    min-width: 0;
}
.detail-grid span {
    display: block;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 2px;
}
.detail-grid strong { font-size: 13.5px; overflow-wrap: anywhere; }
@media (max-width: 480px) {
    .detail-grid { grid-template-columns: minmax(0, 1fr); }
}

/* status filter pills */
.status-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}
.status-pills a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
    background: #F2F5FA;
    border: 1px solid transparent;
    transition: all .2s ease;
}
.status-pills a:hover { color: var(--primary); background: var(--primary-soft); }
.status-pills a.is-active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 10px rgba(0, 62, 155, .2);
}

/* interactive source donut */
.src-seg { transition: opacity .25s ease; cursor: pointer; }
.src-item {
    cursor: pointer;
    border-radius: 10px;
    padding: 6px;
    margin: -6px;
    transition: background .2s ease, opacity .25s ease;
}
.src-item:hover, .src-item:focus-visible { background: #F6F9FE; outline: none; }
.src-item.is-dim { opacity: .4; }
.conv-track {
    height: 30px;
    background: #F3F5F9;
    border-radius: 8px;
    overflow: hidden;
}
.conv-fill {
    display: flex;
    align-items: center;
    height: 100%;
    min-width: 0;
    width: var(--w);
    background: var(--c);
    border-radius: 8px;
    animation: funnelFill 1.2s cubic-bezier(.16,1,.3,1) both;
}
.conv-fill b {
    padding: 0 12px;
    color: #fff;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}
@keyframes funnelFill {
    from { width: 0; }
    to { width: var(--w); }
}

@media (max-width: 640px) {
    .src-wrap { flex-direction: column; }
    .src-legend { width: 100%; }
    .conv-row { grid-template-columns: 88px minmax(0, 1fr) 40px; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
    .src-seg, .conv-fill { animation: none; }
    .src-seg { stroke-dasharray: var(--len) calc(var(--circ) - var(--len)); }
    .conv-fill { width: var(--w); }
}

/* ============================================================
   Slim hero strip — 900 x 70 single row (SaaS)
   ============================================================ */
.saas-hero__inline { display: none; }
.saas-hero--slim {
    max-width: 900px;
    height: 70px;
    min-height: 70px;
    margin: 0 auto 22px;
    padding: 0 20px;
    border-radius: 16px;
    display: flex;
    align-items: center;
}
.saas-hero--slim .saas-hero__content {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    height: 100%;
}
/* auto-slider */
.hero-side {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: none;
    align-items: flex-start;
    justify-content: center;
}
.hero-dots { display: flex; gap: 6px; padding-left: 2px; }
.hero-dots button {
    width: 14px;
    height: 5px;
    border-radius: 99px;
    background: rgba(255, 255, 255, .35);
    transition: width .3s ease, background .3s ease;
}
.hero-dots button:hover { background: rgba(255, 255, 255, .65); }
.hero-dots button.is-active { width: 26px; background: #fff; }
.hero-viewport {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
}
.hero-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    gap: 14px;
    opacity: 0;
    transform: translateX(30px);
    transition: opacity .55s ease, transform .55s cubic-bezier(.16,1,.3,1);
    pointer-events: none;
}
.hero-slide.is-active { opacity: 1; transform: none; pointer-events: auto; }
.hero-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: rgba(255, 255, 255, .18);
}
.hero-progress span { display: block; height: 100%; width: 0; background: #fff; }
.saas-hero--slim .saas-hero__title {
    margin: 0;
    font-size: 19px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 0 1 auto;
}
.saas-hero--slim .saas-pill { flex: none; padding: 5px 12px; font-size: 11.5px; }
.saas-hero--slim .saas-hero__inline {
    display: flex;
    align-items: center;
    flex: none;
    font-size: 12.5px;
    color: rgba(255, 255, 255, .82);
    white-space: nowrap;
}
.saas-hero--slim .saas-hero__actions { margin: 0 0 0 auto; flex: none; }
.saas-hero--slim .saas-hero__actions .btn { height: 32px; padding: 0 13px; font-size: 12.5px; }
.saas-hero--slim .saas-hero__sub,
.saas-hero--slim .saas-hero__meta,
.saas-hero--slim .saas-hero__right { display: none; }

@media (max-width: 860px) {
    .saas-hero--slim .saas-hero__inline { display: none; }
}
@media (max-width: 640px) {
    .saas-hero--slim {
        height: auto;
        padding: 12px 16px;
    }
    .saas-hero--slim .saas-hero__content { flex-wrap: wrap; gap: 10px; }
    .saas-hero--slim .hero-viewport { flex: 1 1 100%; height: 92px; }
    .saas-hero--slim .hero-slide { flex-wrap: wrap; gap: 8px; align-content: center; }
    .saas-hero--slim .saas-hero__title { font-size: 17px; }
    .saas-hero--slim .saas-hero__actions { margin: 0; }
    .saas-hero--slim .saas-pill [data-clock] { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .hero-slide { transition: none; }
}

@media (prefers-reduced-motion: reduce) {
    .chart-tip { animation: none; }
    .empty-illus, .illus-bubble { animation: none; }
}

/* ============================================================
   Dashboard KPI cards (Total Leads / Hot / Visits / Bookings /
   Sales / Pending) — matches reference design
   ============================================================ */
.dash-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}
.kpi {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px 20px 18px;
    box-shadow: var(--shadow);
    transition: transform .25s ease, box-shadow .25s ease;
    animation: kpiIn .55s cubic-bezier(.16,1,.3,1) backwards;
}
.kpi:nth-child(2) { animation-delay: .06s; }
.kpi:nth-child(3) { animation-delay: .12s; }
.kpi:nth-child(4) { animation-delay: .18s; }
.kpi:nth-child(5) { animation-delay: .24s; }
.kpi:nth-child(6) { animation-delay: .30s; }
.kpi:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
a.kpi { display: block; color: inherit; text-decoration: none; }
a.kpi:hover { color: inherit; }

/* ---------- gradient stat cards (reference image style, static, no animation) ---------- */
.gstat {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border-radius: 16px;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(3, 46, 117, .18);
}

a.gstat:hover { color: #fff; filter: brightness(1.06); }

.gstat--blue   { background: linear-gradient(135deg, #1D4ED8, #3B82F6); }
.gstat--green  { background: linear-gradient(135deg, #16A34A, #22C55E); }
.gstat--purple { background: linear-gradient(135deg, #6D28D9, #8B5CF6); }
.gstat--orange { background: linear-gradient(135deg, #EA580C, #FB923C); }
.gstat--amber  { background: linear-gradient(135deg, #D97706, #FBBF24); }
.gstat--rose   { background: linear-gradient(135deg, #E11D48, #FB7185); }

.gstat-ico {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .94);
    box-shadow: inset 0 -2px 5px rgba(0, 0, 0, .10);
    flex: none;
}

.gstat--blue .gstat-ico   { color: #1D4ED8; }
.gstat--green .gstat-ico  { color: #16A34A; }
.gstat--purple .gstat-ico { color: #6D28D9; }
.gstat--orange .gstat-ico { color: #EA580C; }
.gstat--amber .gstat-ico  { color: #B45309; }
.gstat--rose .gstat-ico   { color: #E11D48; }

.gstat-txt {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.gstat-label {
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .85);
}

.gstat-num {
    font-size: 27px;
    font-weight: 800;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.gstat-sub {
    font-size: 11.5px;
    color: rgba(255, 255, 255, .88);
    white-space: nowrap;
}

.gstat-sub .up { color: #D9FBE8; font-weight: 800; }
.gstat-sub .down { color: #FED7D7; font-weight: 800; }
.kpi-top { display: flex; align-items: center; gap: 12px; }
.kpi-ico {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 13px;
    flex: none;
}
.kpi--teal .kpi-ico { background: #DFF5F2; color: #0D9488; }
.kpi--red .kpi-ico { background: #FDE8E8; color: #E5484D; }
.kpi--blue .kpi-ico { background: #E4EDFD; color: #0054CE; }
.kpi--green .kpi-ico { background: #E2F5E9; color: #16A34A; }
.kpi--gold .kpi-ico { background: #FDF0D3; color: #B45309; }
.kpi--orange .kpi-ico { background: #FDEFD9; color: #C26A0A; }
.kpi-label { font-size: 13.5px; font-weight: 500; color: #64748B; }
.kpi-num {
    margin: 12px 0 9px;
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -.5px;
    color: #0F172A;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}
.kpi--gold .kpi-num { color: #9A6B0F; }
.kpi--orange .kpi-num { color: #EA580C; }
.kpi-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3.5px 11px;
    border-radius: 999px;
    background: #E2F5E9;
    color: #15803D;
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
}
.kpi-pill--warn { background: #FDE8E8; color: #D92D20; }
.kpi-bars {
    display: flex;
    align-items: flex-end;
    gap: 5px;
    height: 46px;
    margin-top: 13px;
    padding: 9px 10px;
    border-radius: 10px;
}
.kpi-bars span { flex: 1 1 0; border-radius: 4px; animation: barGrow .7s cubic-bezier(.16,1,.3,1) both; }
.kpi-bars span:nth-child(2) { animation-delay: .05s; }
.kpi-bars span:nth-child(3) { animation-delay: .10s; }
.kpi-bars span:nth-child(4) { animation-delay: .15s; }
.kpi-bars span:nth-child(5) { animation-delay: .20s; }
.kpi-bars span:nth-child(6) { animation-delay: .25s; }
.kpi-bars span:nth-child(7) { animation-delay: .30s; }
.kpi-bars span:nth-child(8) { animation-delay: .35s; }
.kpi--teal .kpi-bars { background: #E4F6F3; }
.kpi--teal .kpi-bars span { background: #14B8A6; }
.kpi--teal .kpi-bars span:nth-child(n+6) { background: #0D9488; }
.kpi--red .kpi-bars { background: #FDEBEB; }
.kpi--red .kpi-bars span { background: #F87171; }
.kpi--red .kpi-bars span:nth-child(n+6) { background: #DC2626; }
.kpi--blue .kpi-bars { background: #EAF1FD; }
.kpi--blue .kpi-bars span { background: #7AA5F5; }
.kpi--blue .kpi-bars span:nth-child(n+5) { background: #0054CE; }
.kpi--green .kpi-bars { background: #E7F6EC; }
.kpi--green .kpi-bars span { background: #4ADE80; }
.kpi--green .kpi-bars span:nth-child(n+5) { background: #16A34A; }
.kpi--gold .kpi-bars { background: #FBF0D9; }
.kpi--gold .kpi-bars span { background: #D9A441; }
.kpi--gold .kpi-bars span:nth-child(n+5) { background: #92600A; }
.kpi--orange .kpi-bars { background: #FDF0D9; }
.kpi--orange .kpi-bars span { background: #FDBA74; }
.kpi--orange .kpi-bars span:nth-child(n+5) { background: #EA580C; }

@keyframes kpiIn {
    from { opacity: 0; transform: translateY(18px) scale(.98); }
    to { opacity: 1; transform: none; }
}
@keyframes barGrow {
    from { transform: scaleY(.2); opacity: 0; }
    to { transform: scaleY(1); opacity: 1; }
}
.kpi-bars span { transform-origin: bottom; }

@media (max-width: 1100px) {
    .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .dash-kpis { grid-template-columns: minmax(0, 1fr); }
    .kpi-num { font-size: 28px; }
}

/* ============================================================
   LEADS PAGE — Advanced Styles
   ============================================================ */
.page-head--leads h2 {
    background: linear-gradient(90deg, var(--text-primary), var(--primary-blue));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-grid--leads {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1100px) {
    .stat-grid--leads { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .stat-grid--leads { grid-template-columns: minmax(0, 1fr); }
}

/* ============================================================
   CLIENTS PAGE — Advanced Styles
   ============================================================ */
.page-head--clients h2 {
    background: linear-gradient(90deg, var(--text-primary), var(--primary-blue));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.saas-hero--clients {
    background: linear-gradient(120deg, #021F52 0%, #032E75 35%, #0054CE 70%, #7C3AED 110%);
}

.stat-grid--clients {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.kpi--cl-blue .stat-card__icon { background: #E4EDFD; color: #0054CE; }
.kpi--cl-green .stat-card__icon { background: #E2F5E9; color: #16A34A; }
.kpi--cl-orange .stat-card__icon { background: #FDEFD9; color: #C26A0A; }
.kpi--cl-purple .stat-card__icon { background: #EDE9FE; color: #7C3AED; }

.empty-check {
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    animation: drawLine 1s 1s cubic-bezier(.4, 0, .2, 1) forwards;
}

@media (max-width: 1100px) {
    .stat-grid--clients { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .stat-grid--clients { grid-template-columns: minmax(0, 1fr); }
}



/* ============================================================
   COMPANIES PAGE — Advanced Styles
   ============================================================ */
.saas-hero--companies {
    background: linear-gradient(120deg, #021F52 0%, #032E75 32%, #0054CE 66%, #0D9488 108%);
}

.stat-grid--companies {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.kpi--co-blue .stat-card__icon   { background: #E4EDFD; color: #0054CE; }
.kpi--co-green .stat-card__icon  { background: #E2F5E9; color: #16A34A; }
.kpi--co-orange .stat-card__icon { background: #FDEFD9; color: #C26A0A; }
.kpi--co-purple .stat-card__icon { background: #EDE9FE; color: #7C3AED; }

.stat-card--saas .stat-card__info { display: flex; flex-direction: column; }

/* ---------- hero extras ---------- */
.saas-hero--companies .saas-hero__right { min-height: 292px; }
.saas-hero--companies .saas-float-a { right: -10px; top: -22px; }
.saas-hero--companies .saas-float-b { left: -16px; bottom: -26px; }
.saas-hero--companies .saas-float-foot { justify-content: flex-end; }
.saas-float-ico {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    flex: none;
    background: var(--primary-soft);
    color: var(--primary);
}
.saas-float-ico.t-blue   { background: #E4EDFD; color: #0054CE; }
.saas-float-ico.t-green  { background: #E2F5E9; color: #16A34A; }
.saas-float-ico.t-purple { background: #EDE9FE; color: #7C3AED; }
.saas-float-ico.t-orange { background: #FDEFD9; color: #C26A0A; }
.saas-float-ico.t-teal   { background: #DFF5F2; color: #0D9488; }
.saas-float-ico.t-gold   { background: #FDF0D3; color: #B45309; }
.saas-float-foot .up { display: inline-flex; align-items: center; gap: 5px; }

.co-hero-bar {
    transform-box: fill-box;
    transform-origin: bottom;
    animation: barGrow .8s cubic-bezier(.16, 1, .3, 1) both;
}
.co-hero-val { opacity: 0; animation: fadeIn .5s both; }
.co-hero-blank {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 128px;
    border: 2px dashed var(--border);
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 12.5px;
    font-weight: 600;
}

/* ---------- layout ---------- */
.grid-2--companies { grid-template-columns: minmax(0, 2.05fr) minmax(0, 1fr); align-items: start; }
.co-main { min-width: 0; }
.co-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.co-side__empty { font-size: 13px; color: var(--text-secondary); }

.co-head-title { display: flex; align-items: center; gap: 11px; min-width: 0; }
.co-head-title h3 { display: flex; align-items: center; gap: 10px; }
.co-head-tools { display: flex; align-items: center; gap: 10px; flex: none; }

/* ---------- toolbar + search ---------- */
.co-toolbar { position: relative; }
.co-search { position: relative; flex: 1 1 240px; min-width: 210px; }
.co-search .input { padding-left: 38px; }
.co-search__ico {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    color: var(--text-secondary);
    pointer-events: none;
}

/* ---------- view toggle ---------- */
.co-toggle {
    display: inline-flex;
    padding: 3px;
    gap: 2px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
}
.co-toggle__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 11px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 12.6px;
    font-weight: 700;
    transition: .18s ease;
}
.co-toggle__btn:hover { color: var(--primary-blue); background: #fff; }
.co-toggle__btn.is-active {
    background: var(--primary-blue);
    color: #fff;
    box-shadow: 0 4px 10px rgba(0, 84, 206, .28);
}

/* ---------- company mark ---------- */
.co-mark {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    flex: none;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .4px;
    background: var(--primary-soft);
    color: var(--primary);
}
.co-mark.t-blue   { background: #E4EDFD; color: #0054CE; }
.co-mark.t-green  { background: #E2F5E9; color: #16A34A; }
.co-mark.t-purple { background: #EDE9FE; color: #7C3AED; }
.co-mark.t-orange { background: #FDEFD9; color: #C26A0A; }
.co-mark.t-teal   { background: #DFF5F2; color: #0D9488; }
.co-mark.t-gold   { background: #FDF0D3; color: #B45309; }

.co-cell > span { min-width: 0; }
.co-cell strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.co-cell small { display: flex; align-items: center; gap: 5px; }
.co-cell small svg { flex: none; color: var(--text-secondary); }

/* ---------- clients count + bar ---------- */
.co-table th, .co-table td { padding-left: 14px; padding-right: 14px; }
.co-table th:first-child, .co-table td:first-child { padding-left: 18px; }
.co-table th:last-child, .co-table td:last-child { padding-right: 18px; }
.co-when { white-space: nowrap; }

.co-clients { display: flex; align-items: center; gap: 10px; min-width: 118px; }
.co-clients b { font-size: 14px; font-variant-numeric: tabular-nums; min-width: 16px; text-align: right; }
.co-bar {
    flex: 1 1 auto;
    height: 8px;
    border-radius: 999px;
    background: #EEF1F6;
    overflow: hidden;
}
.co-bar span {
    display: block;
    height: 100%;
    width: var(--w, 0%);
    border-radius: 999px;
    background: linear-gradient(90deg, #0054CE, #0188FC);
    animation: fillBar 1.3s cubic-bezier(.16, 1, .3, 1) both;
}

/* ---------- pipeline mix ---------- */
.co-mix {
    display: flex;
    height: 9px;
    min-width: 118px;
    border-radius: 999px;
    overflow: hidden;
    background: #EEF1F6;
}
.co-mix--sm { height: 7px; min-width: 104px; }
.co-mix > span {
    display: block;
    height: 100%;
    width: var(--w, 0%);
    animation: fillBar 1.2s cubic-bezier(.16, 1, .3, 1) both;
}
.co-mix > .is-active  { background: linear-gradient(90deg, #157F3D, #34C77B); }
.co-mix > .is-lead    { background: linear-gradient(90deg, #C75B09, #FE8713); }
.co-mix > .is-dormant { background: #CBD5E1; }

.co-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }

.co-city { display: inline-flex; align-items: center; gap: 5px; color: var(--text-secondary); font-size: 13px; }
.co-city svg { color: var(--blue-bright); flex: none; }

/* ---------- card (grid) layout ---------- */
.co-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(276px, 1fr));
    gap: 16px;
    padding: 18px;
}
.co-card {
    display: flex;
    flex-direction: column;
    gap: 13px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: linear-gradient(180deg, #fff, #F8FAFD);
    transition: transform .3s cubic-bezier(.16, 1, .3, 1), box-shadow .3s, border-color .3s;
}
.co-card:hover { transform: translateY(-5px); box-shadow: 0 16px 40px rgba(3, 46, 117, .14); border-color: #C9DBFA; }
.co-card__top { display: flex; align-items: center; gap: 11px; min-width: 0; }
.co-card__id { min-width: 0; flex: 1 1 auto; }
.co-card__id h4 {
    font-size: 14.5px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.co-card__id small {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12.2px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.co-card__id small svg { flex: none; color: var(--blue-bright); }

.co-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-secondary); }
.co-legend__i { display: inline-flex; align-items: center; gap: 6px; }
.co-legend__i i { width: 8px; height: 8px; border-radius: 3px; flex: none; }
.co-legend__i i.is-active  { background: #22C55E; }
.co-legend__i i.is-lead    { background: #FE8713; }
.co-legend__i i.is-dormant { background: #CBD5E1; }

.co-members { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.co-members li { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text-primary); }
.co-members .avatar { width: 26px; height: 26px; font-size: 10.5px; }
.co-members__more { color: var(--text-secondary); font-size: 12.3px; padding-left: 35px; }

.co-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}
.co-card__when { display: inline-flex; align-items: center; gap: 6px; font-size: 12.3px; color: var(--text-secondary); }
.co-card__when svg { flex: none; }

/* ---------- insights column ---------- */
.co-rank {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "name count" "bar bar";
    gap: 6px 10px;
    align-items: center;
    font-size: 12.8px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    padding: 6px 8px;
    margin: -6px -8px;
    transition: background .2s ease;
}
.co-rank:hover { background: #F6F9FE; color: inherit; }
.co-rank__name {
    grid-area: name;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.co-rank__no {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    flex: none;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
    font-style: normal;
}
.co-rank b { grid-area: count; color: var(--primary-blue); font-variant-numeric: tabular-nums; }
.co-rank .progress { grid-area: bar; }

.co-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.co-chips .chip svg { color: var(--blue-bright); flex: none; }

.co-mini-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.co-mini {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: linear-gradient(180deg, #fff, #F7F9FC);
}
.co-mini span { display: inline-flex; align-items: center; gap: 6px; font-size: 11.4px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--text-secondary); }
.co-mini strong { font-size: 21px; font-weight: 800; font-variant-numeric: tabular-nums; }

.co-feed { text-decoration: none; color: inherit; border-radius: 10px; padding: 8px; margin: -8px; transition: background .2s ease; }
.co-feed:hover { background: #F6F9FE; color: inherit; }
.co-feed .feed__dot { width: 30px; height: 30px; }
.co-feed .feed__body p { font-size: 13.4px; font-weight: 600; }
.co-feed .feed__body time { font-size: 12px; color: var(--text-secondary); }
.co-qa { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.co-qa .qa { flex-direction: column; gap: 6px; font-size: 12.3px; padding: 12px 8px; }

.co-hint { display: flex; align-items: flex-start; gap: 8px; }
.co-hint svg { flex: none; margin-top: 2px; color: var(--accent-orange); }
/* ---------- responsive ---------- */
@media (max-width: 1280px) {
    .grid-2--companies { grid-template-columns: minmax(0, 1fr); }
}
.page-head--activities h2 {
    background: linear-gradient(90deg, var(--text-primary), var(--primary-blue));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-grid--activities {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.stat-grid--quotations {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.kpi--act-blue .stat-card__icon { background: #E4EDFD; color: #0054CE; }
.kpi--act-green .stat-card__icon { background: #E2F5E9; color: #16A34A; }
.kpi--act-orange .stat-card__icon { background: #FDEFD9; color: #C26A0A; }
.kpi--act-purple .stat-card__icon { background: #EDE9FE; color: #7C3AED; }
.kpi--act-teal .stat-card__icon { background: #DFF5F2; color: #0D9488; }

.act-feed {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.act-item {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.act-item:last-child {
    border-bottom: 0;
}

.act-dot {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    flex: none;
}

.act-dot.t-blue { background: #E4EDFD; color: #0054CE; }
.act-dot.t-green { background: #E2F5E9; color: #16A34A; }
.act-dot.t-orange { background: #FDEFD9; color: #C26A0A; }
.act-dot.t-purple { background: #EDE9FE; color: #7C3AED; }
.act-dot.t-red { background: #FFEAE4; color: #DC2626; }
.act-dot.t-teal { background: #DFF5F2; color: #0D9488; }

.act-body {
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 16px;
    align-items: start;
}

.act-main strong {
    display: block;
    font-size: 13.5px;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.act-main p {
    font-size: 13.8px;
    color: var(--text-primary);
    margin: 0;
}

.act-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: none;
    flex: none;
    font-size: 12px;
    color: var(--text-secondary);
}

.act-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.act-verified {
    color: #157F3D;
    background: #E6F6EC;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 600;
}

.act-unverified {
    color: #94A3B8;
    background: #F1F5F9;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 600;
}

@media (max-width: 1400px) {
    .stat-grid--activities { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .stat-grid--quotations { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
    .stat-grid--companies { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat-grid--activities { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat-grid--quotations { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.page-head--quotation-create h2 {
    background: linear-gradient(90deg, var(--text-primary), var(--primary-blue));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.quotation-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.qf-section {
    overflow: visible;
}

/* quotation form cards stay static — no hover lift animation */
.qf-section.card--saas:hover {
    transform: none;
    box-shadow: var(--shadow);
}

.qf-section.card--saas::before {
    display: none;
}

.qf-head-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1 1 240px;
}

.qf-section .card__head {
    flex-wrap: wrap;
    row-gap: 10px;
}

/* quotation create stepper — static SaaS, no animation */
.qf-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 0 0 18px;
    padding: 0;
    list-style: none;
}

.qf-steps li {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 13px 15px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.qf-steps li.is-active {
    border-color: var(--blue-bright);
}

.qf-step__num {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #EEF1F6;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 800;
    flex: none;
}

.qf-steps li.is-active .qf-step__num {
    background: var(--primary-blue);
    color: #fff;
}

.qf-step__txt strong {
    display: block;
    font-size: 13.5px;
    color: var(--text-primary);
}

.qf-step__txt small {
    display: block;
    font-size: 11.8px;
    color: var(--text-secondary);
}

.qf-step {
    margin-left: auto;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-secondary);
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
    flex: none;
}

@media (max-width: 1100px) {
    .qf-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .qf-steps { grid-template-columns: minmax(0, 1fr); }
}

.qf-autocomplete {
    position: relative;
}

.qf-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.qf-search-wrap svg {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

.qf-search-wrap .input {
    padding-left: 38px;
}

.qf-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    max-height: 280px;
    overflow-y: auto;
}

.qf-result {
    padding: 11px 15px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background .12s;
}

.qf-result:last-child {
    border-bottom: 0;
}

.qf-result:hover {
    background: var(--bg);
}

.qf-result strong {
    display: block;
    font-size: 13.8px;
}

.qf-result small {
    display: block;
    font-size: 12.3px;
    color: var(--text-secondary);
}

.qf-no-results {
    padding: 14px 15px;
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
}

.qf-details {
    margin-top: 14px;
    padding: 14px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.qf-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.qf-detail-item span {
    display: block;
    font-size: 11.5px;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.qf-detail-item strong {
    font-size: 13.5px;
}

.qf-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.qf-grid .qf-full {
    grid-column: 1 / -1;
}

.qf-items-body {
    padding: 0;
    overflow-x: auto;
}

.qf-items-table th {
    padding: 8px 8px;
    font-size: 10.5px;
}

.qf-items-table td {
    padding: 6px 8px;
}

.qf-items-table .input,
.qf-items-table .select {
    padding: 6px 8px;
    font-size: 12.5px;
    min-width: 0;
}

.qf-item-desc {
    font-size: 12px !important;
}

.qf-line-amt {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

.qf-remove-item {
    opacity: .6;
}

.qf-remove-item:hover {
    opacity: 1;
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.qf-summary-card {
    background: linear-gradient(135deg, #F7F9FC, #EDF2FA);
    border-color: #D6E4FA;
}

.qf-totals {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 340px;
    margin-left: auto;
}

.qf-total-row {
    display: flex;
    justify-content: space-between;
    font-size: 13.5px;
}

.qf-total-row span {
    color: var(--text-secondary);
}

.qf-grand {
    margin-top: 6px;
    padding-top: 10px;
    border-top: 2px solid var(--primary-blue);
    font-size: 16px;
}

.qf-grand span,
.qf-grand strong {
    color: var(--text-primary);
}

.qf-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 0 0;
    border-top: 1px solid var(--border);
    position: sticky;
    bottom: 16px;
    background: var(--bg);
    padding: 14px 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

@media (max-width: 1100px) {
    .qf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .stat-grid--activities { grid-template-columns: minmax(0, 1fr); }
    .stat-grid--quotations { grid-template-columns: minmax(0, 1fr); }
    .act-body { flex-direction: column; }
    .act-meta { flex-wrap: wrap; }
    .qf-grid { grid-template-columns: minmax(0, 1fr); }
    .qf-actions { flex-wrap: wrap; }
    .qf-actions .btn { flex: 1 1 45%; }
    .qf-totals { max-width: 100%; }
}

@media (max-width: 640px) {
    .qf-items-table { min-width: 600px; }
}

@media (max-width: 640px) {
    .qf-items-body { overflow-x: auto; }
    .qf-items-table { min-width: 600px; }
}
@media (max-width: 860px) {
    .co-head-tools { width: 100%; justify-content: space-between; }
}
@media (max-width: 640px) {
    .stat-grid--companies { grid-template-columns: minmax(0, 1fr); }
    .co-main .card__head { flex-wrap: wrap; }
    .co-grid { grid-template-columns: minmax(0, 1fr); padding: 14px; }
    .co-mini-grid { grid-template-columns: minmax(0, 1fr); }
    .co-cell strong { max-width: 150px; }
}
@media (prefers-reduced-motion: reduce) {
    .co-hero-bar, .co-hero-val, .co-mix > span, .co-bar span { animation: none; }
    .co-hero-val { opacity: 1; }
    .co-mix > span, .co-bar span { width: var(--w, 0%); }
}

/* ============================================================
   FOLLOW-UPS PAGE — chips, urgency, queue, modal (no motion)
   ============================================================ */
.stat-grid--followups { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.kpi--fu-red    .stat-card__icon { background: #FDE8E8; color: #E5484D; }
.kpi--fu-orange .stat-card__icon { background: #FDEFD9; color: #C26A0A; }
.kpi--fu-blue   .stat-card__icon { background: #E4EDFD; color: #0054CE; }
.kpi--fu-purple .stat-card__icon { background: #EDE9FE; color: #7C3AED; }

/* ---------- layout ---------- */
.grid-2--followups { grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr); align-items: start; }
.fu-main { min-width: 0; }
.fu-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.fu-head-title { display: flex; align-items: center; gap: 11px; min-width: 0; }
.fu-head-title h3 { display: flex; align-items: center; gap: 9px; }
.fu-head-tools { display: flex; align-items: center; gap: 10px; flex: none; }

.fu-side__empty {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}
.fu-side__empty svg { color: #16A34A; flex: none; }

/* ---------- filter chips ---------- */
.fu-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 15px 18px 0; }

.fu-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 13px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 12.8px;
    font-weight: 700;
}
.fu-chip svg { flex: none; opacity: .85; }
.fu-chip b {
    min-width: 21px;
    padding: 1px 7px;
    border-radius: 999px;
    background: #EEF1F6;
    color: var(--text-secondary);
    font-size: 11.4px;
    font-weight: 800;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.fu-chip:hover {
    border-color: var(--blue-bright);
    color: var(--primary-blue);
    background: var(--bg);
}
.fu-chip.is-active {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: #fff;
    box-shadow: 0 7px 16px rgba(0, 84, 206, .30);
}
.fu-chip.is-active svg { opacity: 1; }
.fu-chip.is-active b { background: rgba(255, 255, 255, .22); color: #fff; }

.fu-chip.is-overdue b { background: #FFEAE4; color: #D92D20; }
.fu-chip.is-today   b { background: #FFF2E1; color: #C75B09; }
.fu-chip.is-week    b { background: #E2F3FE; color: #0369A1; }
.fu-chip.is-new     b { background: #EDE9FE; color: #7C3AED; }
.fu-chip.is-overdue.is-active b,
.fu-chip.is-today.is-active b,
.fu-chip.is-week.is-active b,
.fu-chip.is-new.is-active b { background: rgba(255, 255, 255, .22); color: #fff; }

/* ---------- toolbar search ---------- */
.fu-toolbar { padding-top: 16px; }
.fu-search { position: relative; flex: 1 1 240px; min-width: 200px; }
.fu-search .input { padding-left: 38px; }
.fu-search__ico {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    color: var(--text-secondary);
    pointer-events: none;
}

/* ---------- table cells ---------- */
.fu-table th, .fu-table td { padding-left: 14px; padding-right: 14px; }
.fu-table th:first-child, .fu-table td:first-child { padding-left: 18px; }
.fu-table th:last-child, .fu-table td:last-child { padding-right: 18px; }

/* ---------- table density (no motion) ---------- */
.fu-table .cell-user strong,
.fu-table .cell-user small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fu-table .cell-user small { max-width: 132px; }
.fu-table .icon-btn-sm { width: 29px; height: 29px; }
.fu-table .row-actions { gap: 5px; }
.fu-table tbody tr:hover { background: rgba(1, 136, 252, .035); transform: none; }

.fu-wait { display: flex; flex-direction: column; gap: 5px; min-width: 104px; }
.fu-wait__top { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--text-primary); }
.fu-wait__top svg { color: var(--text-secondary); flex: none; }

.fu-aging {
    display: block;
    height: 6px;
    border-radius: 999px;
    background: #EEF1F6;
    overflow: hidden;
}
.fu-aging span {
    display: block;
    height: 100%;
    width: var(--w, 0%);
    border-radius: 999px;
    background: linear-gradient(90deg, #0054CE, #0188FC);
}
.fu-aging.is-warn span { background: linear-gradient(90deg, #FE8713, #F9A825); }
.fu-aging.is-late span { background: linear-gradient(90deg, #FE3D06, #FF7A45); }

.fu-due { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 120px; }
.fu-due__main {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13.4px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}
.fu-due__main svg { flex: none; color: var(--blue-bright); }
.fu-due__main.is-overdue { color: var(--accent-red); }
.fu-due__main.is-overdue svg { color: var(--accent-red); }
.fu-due__main.is-today { color: #C75B09; }
.fu-due__main.is-today svg { color: #C75B09; }

.fu-pri {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 10.6px;
    font-weight: 800;
    letter-spacing: .4px;
    text-transform: uppercase;
}
.fu-pri i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.fu-pri--urgent { background: #FFEAE4; color: #D92D20; }
.fu-pri--high   { background: #FFF2E1; color: #C75B09; }
.fu-pri--normal { background: #E2F3FE; color: #0369A1; }
.fu-pri--low    { background: #EEF1F6; color: #64748B; }
.fu-pri--first  { background: #EDE9FE; color: #7C3AED; }

.fu-note {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 190px;
    font-size: 11.8px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.fu-note svg { flex: none; color: var(--blue-bright); }

/* ---------- attention queue ---------- */
.fu-queue { display: flex; flex-direction: column; gap: 10px; }
.fu-queue__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: linear-gradient(180deg, #fff, #F8FAFD);
}
.fu-queue__item:hover {
    border-color: #C9DBFA;
    background: #F6F9FE;
}
.fu-queue__id { flex: 1 1 auto; min-width: 0; }
.fu-queue__id strong {
    display: block;
    font-size: 13.4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.fu-queue__id small {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11.8px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.fu-queue__id small svg { flex: none; color: var(--blue-bright); }
.fu-queue__item .icon-btn-sm { width: 30px; height: 30px; flex: none; }

.fu-late {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 999px;
    background: #FFEAE4;
    color: #D92D20;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
    flex: none;
}
.fu-late svg { flex: none; }

.fu-hint { display: flex; align-items: flex-start; gap: 8px; }
.fu-hint svg { flex: none; margin-top: 2px; color: var(--accent-orange); }

/* ---------- health ranking ---------- */
.fu-rank {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "name count pct" "bar bar bar";
    gap: 6px 10px;
    align-items: center;
    padding: 7px 8px;
    margin: -7px -8px;
    border-radius: 10px;
    color: inherit;
    text-decoration: none;
    font-size: 12.8px;
}
.fu-rank:hover { background: #F6F9FE; color: inherit; }
.fu-rank__name {
    grid-area: name;
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 700;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.fu-rank b { grid-area: count; color: var(--primary-blue); font-variant-numeric: tabular-nums; }
.fu-rank .progress { grid-area: bar; }
.fu-rank .progress span { width: var(--w, 0%); animation: none; }
.fu-rank__pct {
    grid-area: pct;
    font-style: normal;
    color: var(--text-secondary);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.fu-mini-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.fu-mini {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: linear-gradient(180deg, #fff, #F7F9FC);
}
.fu-mini span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.4px;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--text-secondary);
}
.fu-mini strong { font-size: 21px; font-weight: 800; font-variant-numeric: tabular-nums; }

.fu-qa { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 16px; }
.fu-qa .qa { flex-direction: column; gap: 6px; font-size: 12.3px; padding: 12px 8px; }
.fu-qa .qa:hover { transform: none; }

/* ---------- modal ---------- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 85;
    display: grid;
    place-items: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
}
.modal.is-open { opacity: 1; visibility: visible; }

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 46, 117, .55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.modal__panel {
    position: relative;
    width: 100%;
    max-width: 580px;
    max-height: 92vh;
    overflow: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 30px 80px rgba(3, 46, 117, .35);
}

.modal__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 17px 20px;
    border-bottom: 1px solid var(--border);
}
.modal__head > div { flex: 1 1 auto; min-width: 0; }
.modal__head h3 { font-size: 16px; font-weight: 800; letter-spacing: -.2px; }
.modal__head small { display: block; font-size: 12.5px; color: var(--text-secondary); font-weight: 400; }

.modal__body { padding: 20px; }
.modal__body .field { margin-bottom: 0; }

.modal__foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid var(--border);
    border-radius: 0 0 18px 18px;
    background: var(--bg);
}

/* ---------- responsive ---------- */
@media (max-width: 1600px) {
    .fu-hide-md { display: none !important; }
}
@media (max-width: 1280px) {
    .grid-2--followups { grid-template-columns: minmax(0, 1fr); }
    .fu-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
}
@media (max-width: 1100px) {
    .stat-grid--followups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .stat-grid--followups { grid-template-columns: minmax(0, 1fr); }
    .fu-hide-sm { display: none !important; }
    .fu-chips { padding: 13px 14px 0; }
    .fu-search { flex: 1 1 100%; }
    .fu-head-tools { width: 100%; }
    .fu-head-tools .btn { width: 100%; }
    .fu-main .card__head { flex-wrap: wrap; }
    .modal { padding: 12px; }
    .modal__panel { border-radius: 16px; }
    .fu-queue__item .fu-late { display: none; }
    .fu-qa { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
    .fu-table .progress span, .fu-rank .progress span { animation: none; width: var(--w, 0%); }
}

/* ============================================================
   QUOTATION MODULE — list toolbar, create form, view, print
   ============================================================ */

.qf-listbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}

.qf-list-search {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1 1 260px;
    max-width: 420px;
}

.qf-list-search svg {
    position: absolute;
    left: 13px;
    color: var(--text-secondary);
    pointer-events: none;
}

.qf-list-search .input { padding-left: 38px; }

.form-errors {
    margin: 0 0 16px;
    padding: 14px 18px;
    border: 1px solid #F6C1C1;
    background: #FDF1F1;
    border-radius: var(--radius);
    color: #A62B2B;
    font-size: 13.5px;
}

.form-errors strong { display: block; margin-bottom: 6px; }
.form-errors ul { margin: 0; padding-left: 18px; }
.form-errors li { margin-bottom: 3px; }

.qf-details__bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.qf-details__tax {
    font-size: 12.2px;
    font-weight: 700;
    color: var(--primary-blue);
    background: rgba(1, 136, 252, .1);
    border: 1px solid rgba(1, 136, 252, .25);
    padding: 4px 10px;
    border-radius: 999px;
}

.qf-details__bar .btn { margin-left: auto; }

.qf-detail-item strong { word-break: break-word; }

.qf-result__company {
    display: inline-block;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--primary-blue);
    background: rgba(1, 136, 252, .1);
    border-radius: 6px;
    padding: 1px 6px;
    margin-left: 4px;
    vertical-align: middle;
}

.qf-no-results a { color: var(--primary-blue); font-weight: 700; }

.qf-item-search { position: relative; }

.qf-item-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    min-width: 240px;
    z-index: 130;
}

.qf-row-invalid { background: rgba(220, 53, 69, .06); }
.qf-row-invalid .input { border-color: var(--accent-red); }

.qf-cell-actions { text-align: center; vertical-align: middle; }

.qf-items-table { min-width: 920px; }

/* Quotation items (create form): on desktop the service autocomplete
   dropdown must paint outside the scroll wrapper AND the card — both
   clip it by default (.table-wrap overflow + .card--saas overflow),
   which hid the suggestion list while searching. Below 1200px the
   previous scroll behaviour is kept so the 920px table never spills. */
@media (min-width: 1200px) {
    .card--saas.qf-items-card { overflow: visible; }
    .qf-items-wrap.table-wrap { overflow: visible; }
}

/* Quotation items: tighter numeric cells so GST % / Disc % values
   (e.g. "18") are never visually clipped to "1…". */
.qf-items-table td .input { padding-left: 8px; padding-right: 8px; }

.qv-head { align-items: center; gap: 12px; flex-wrap: wrap; }
.qv-head .badge { align-self: center; }

.qv-doc { display: grid; gap: 16px; }

.qv-doc .card__body { overflow-x: auto; }

.qv-items-table { min-width: 900px; }

.qv-notes { display: grid; gap: 16px; }
.qv-notes h4 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.qv-notes p { font-size: 14px; line-height: 1.65; white-space: pre-wrap; }

@media (max-width: 1100px) {
    .qf-listbar { flex-direction: column; align-items: stretch; }
    .qf-list-search { max-width: none; }
}

/* --- mobile: quotation items become stacked cards --- */
@media (max-width: 760px) {
    .qf-items-body { overflow-x: visible; padding: 10px; }
    .qf-items-table { min-width: 0; width: 100%; display: block; }
    .qf-items-table thead { display: none; }
    .qf-items-table tbody { display: block; }
    .qf-items-table tr {
        display: block;
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        background: var(--surface);
        padding: 8px 10px;
        margin-bottom: 10px;
        box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
    }
    .qf-items-table td {
        display: flex;
        align-items: center;
        gap: 10px;
        border: 0;
        border-bottom: 1px dashed var(--border);
        padding: 7px 0;
        text-align: left !important;
    }
    .qf-items-table tr td:last-child { border-bottom: 0; }
    .qf-items-table td::before {
        content: attr(data-label);
        flex: 0 0 92px;
        font-size: 10.5px;
        font-weight: 800;
        letter-spacing: .04em;
        text-transform: uppercase;
        color: var(--text-secondary);
    }
    .qf-items-table td.qf-cell-actions {
        justify-content: flex-end;
        border-bottom: 0;
    }
    .qf-items-table td.qf-cell-actions::before { display: none; }
    .qf-items-table .input { flex: 1 1 auto; min-width: 0; }
    .qf-line-amt { font-weight: 800; }
    .qf-actions { position: static; }
    .qf-actions .btn { flex: 1 1 100%; }
    .qv-items-table tr { display: block; }
}

/* --- print --- */
@media print {
    .sidebar,
    .topbar,
    .app-footer,
    .app__overlay,
    .page-head__actions,
    .qf-listbar,
    .status-pills,
    .toast,
    .no-print { display: none !important; }

    .app { display: block; min-height: 0; }
    .app__main { margin: 0 !important; max-width: none !important; }
    .content { padding: 0 !important; }

    .card,
    .card--saas {
        border: 1px solid #D9DEE7 !important;
        box-shadow: none !important;
        break-inside: avoid;
        margin-bottom: 14px !important;
    }

    .qv-doc { display: block; }
    body { background: #fff !important; }
    .qv-items-table { min-width: 0; width: 100%; }
}

/* ============================================================
   PRODUCTS PAGE — catalogue, form and detail styles
   ============================================================ */
.stat-grid--products { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.kpi--p-blue .stat-card__icon   { background: #E4EDFD; color: #0054CE; }
.kpi--p-green .stat-card__icon  { background: #E2F5E9; color: #16A34A; }
.kpi--p-orange .stat-card__icon { background: #FDEFD9; color: #C26A0A; }
.kpi--p-purple .stat-card__icon { background: #EDE9FE; color: #7C3AED; }

@media (max-width: 1100px) {
    .stat-grid--products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .stat-grid--products { grid-template-columns: minmax(0, 1fr); }
}

/* --- product form sections --- */
.pf-section {
    padding-bottom: 22px;
    margin-bottom: 22px;
    border-bottom: 1px dashed var(--border);
}
.pf-section:last-of-type { border-bottom: 0; margin-bottom: 0; }
.pf-section__title {
    margin: 0 0 14px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.pf-preview {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
    padding: 14px;
    border: 1px solid #E1E9FA;
    border-radius: var(--radius-sm);
    background: linear-gradient(120deg, #F6F9FF 0%, #F4F7FF 100%);
}
.pf-preview__item { display: flex; flex-direction: column; gap: 4px; }
.pf-preview__item span {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--text-secondary);
}
.pf-preview__item strong { font-size: 16px; font-weight: 800; color: var(--text-primary); }
.pf-preview__item strong[data-tone="neg"] { color: var(--accent-red); }

@media (max-width: 760px) {
    .pf-preview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.pf-notes { margin-top: 20px; }
.pf-notes h4 {
    margin-bottom: 6px;
    font-size: 12px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--text-secondary);
}
.pf-notes p { margin: 0; font-size: 14px; line-height: 1.65; white-space: pre-wrap; }

/* --- product table cells --- */
.prod-cell { display: flex; flex-direction: column; gap: 3px; }
.prod-cell strong { font-weight: 700; color: var(--text-primary); }
.prod-cell small,
.prod-price small { font-size: 11.5px; color: var(--text-secondary); }
.prod-price { display: flex; flex-direction: column; gap: 3px; }
.prod-price strong { font-weight: 800; }
.prod-stock { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.prod-stock strong { font-weight: 800; }

/* --- mobile: product rows become stacked cards --- */
@media (max-width: 900px) {
    .prod-table { display: block; width: 100%; min-width: 0; }
    .prod-table thead { display: none; }
    .prod-table tbody { display: block; }
    .prod-table tr {
        display: block;
        margin-bottom: 10px;
        padding: 8px 10px;
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        background: var(--surface);
        box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
    }
    .prod-table td {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 7px 0;
        border: 0;
        border-bottom: 1px dashed var(--border);
        text-align: left !important;
    }
    .prod-table tr td:last-child { border-bottom: 0; }
    .prod-table td::before {
        content: attr(data-label);
        flex: 0 0 96px;
        font-size: 10.5px;
        font-weight: 800;
        letter-spacing: .04em;
        text-transform: uppercase;
        color: var(--text-secondary);
    }
    .prod-table td:first-child,
    .prod-table td[data-label="Actions"] { display: block; }
    .prod-table td:first-child::before,
    .prod-table td[data-label="Actions"]::before { display: none; }
    .prod-table td[data-label="Actions"] { padding-top: 9px; }
    .prod-table .row-actions { justify-content: flex-end; }
}

/* ============================================================
   ADVANCED TOPBAR — search, Quick Add, WhatsApp, theme, notif
   ============================================================ */
.topbar--adv { gap: 12px; }
.tb-btn { display: grid; border-radius: 10px; }
.topbar__left { flex: 1; min-width: 0; }
.topbar__right { flex: none; gap: 8px; }

.tb-search { position: relative; display: flex; align-items: center; flex: 1; max-width: 480px; margin-left: 8px; }
.tb-search__ico { position: absolute; left: 13px; color: var(--text-secondary); display: grid; place-items: center; pointer-events: none; }
.tb-search__input { width: 100%; padding: 10px 86px 10px 38px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); color: var(--text-primary); font-size: 13.8px; outline: none; transition: .15s; }
.tb-search__input:focus { background: var(--surface); border-color: var(--blue-bright); box-shadow: 0 0 0 3px rgba(1,136,252,.16); }
.tb-search__kbd { position: absolute; right: 10px; font-size: 10.5px; font-weight: 800; letter-spacing: .5px; color: var(--text-secondary); background: var(--surface); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; padding: 2px 7px; pointer-events: none; }
.tb-search__drop { position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; z-index: 80; max-height: 420px; overflow-y: auto; }
.tb-search__drop[hidden] { display: none; }
.tb-search__hint { padding: 13px 15px; font-size: 12.8px; color: var(--text-secondary); }
.tb-search__group-label { padding: 9px 15px 4px; font-size: 10.5px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--text-secondary); }
.tb-search__item { display: flex; align-items: center; gap: 10px; padding: 9px 15px; color: var(--text-primary); }
.tb-search__item:hover { background: var(--bg); }
.tb-search__item strong { display: block; font-size: 13.5px; }
.tb-search__item small { display: block; font-size: 12px; color: var(--text-secondary); }
.tb-search__tag { margin-left: auto; font-size: 10.5px; font-weight: 800; padding: 2px 9px; border-radius: 999px; background: #EEF1F6; color: var(--text-secondary); flex: none; }

.btn-quickadd { display: inline-flex; align-items: center; gap: 7px; padding: 9px 18px; border: 0; border-radius: 12px; background: #0F766E; color: #fff; font-size: 14px; font-weight: 700; cursor: pointer; box-shadow: 0 6px 14px rgba(15,118,110,.32); transition: .15s; white-space: nowrap; }
.btn-quickadd:hover { background: #0D655F; transform: translateY(-1px); }
.tb-qa { position: relative; }
.tb-drop { min-width: 240px; }
.tb-drop__label { margin: 0; padding: 8px 11px 4px; font-size: 10.5px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--text-secondary); }

.tb-wa { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: #25D366; color: #fff; box-shadow: 0 6px 14px rgba(37,211,102,.35); transition: .15s; flex: none; }
.tb-wa:hover { filter: brightness(1.06); color: #fff; transform: translateY(-1px); }

.tb-theme .ico-moon { display: none; }
[data-theme="dark"] .tb-theme .ico-sun { display: none; }
[data-theme="dark"] .tb-theme .ico-moon { display: block; }

.tb-notif { position: relative; }
.tb-notif__badge { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: #FE3D06; color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--surface); }
.tb-notif__panel { min-width: 340px; max-width: 360px; padding: 0; overflow: hidden; }
.tb-notif__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 15px; border-bottom: 1px solid var(--border); }
.tb-notif__head strong { display: block; font-size: 14px; }
.tb-notif__head small { display: block; font-size: 12px; color: var(--text-secondary); }
.tb-notif__head a { font-size: 12.5px; font-weight: 700; }
.tb-notif__list { max-height: 340px; overflow-y: auto; padding: 7px; }
.tb-notif__item { display: flex; align-items: center; gap: 11px; padding: 10px 11px; border-radius: 10px; color: var(--text-primary); }
.tb-notif__item:hover { background: var(--bg); }
.tb-notif__ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; flex: none; }
.tb-notif__ico.is-red { background: #FFEAE4; color: #DC2626; }
.tb-notif__ico.is-orange { background: #FFF2E1; color: #C75B09; }
.tb-notif__ico.is-blue { background: #E4EDFD; color: #0054CE; }
.tb-notif__ico.is-navy { background: #DFE7F5; color: #032E75; }
.tb-notif__body { flex: 1; min-width: 0; }
.tb-notif__body strong { display: block; font-size: 13.3px; }
.tb-notif__body small { display: block; font-size: 12px; color: var(--text-secondary); }
.tb-notif__time { font-size: 11px; color: var(--text-secondary); flex: none; }
.tb-notif__empty { text-align: center; padding: 26px 16px; color: var(--text-secondary); }
.tb-notif__empty strong { display: block; color: var(--text-primary); margin: 8px 0 3px; }
.tb-notif__empty p { font-size: 12.8px; }
.tb-notif__empty-ico { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--bg); color: var(--text-secondary); }
.tb-notif__foot { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); }
.tb-notif__foot a { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px; border-radius: 9px; background: var(--bg); font-size: 12.5px; font-weight: 700; color: var(--text-primary); }
.tb-notif__foot a:hover { color: var(--primary-blue); }

.tb-search-mobile { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); position: relative; }
.tb-search-mobile[hidden] { display: none; }
.tb-search-mobile input { flex: 1; padding: 10px 12px 10px 38px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text-primary); font-size: 14px; outline: none; }
.tb-search-mobile .tb-search__ico { left: 28px; }
.tb-only-mobile { display: none !important; }

/* ---------- dark mode ---------- */
[data-theme="dark"] { --bg: #0B1526; --surface: #111F36; --text-primary: #E6EDF7; --text-secondary: #93A1B8; --border: #22334F; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.3); --shadow-lg: 0 10px 34px rgba(0,0,0,.5); }
[data-theme="dark"] .sidebar { background: #0A1122; }
[data-theme="dark"] .input, [data-theme="dark"] .select, [data-theme="dark"] .textarea, [data-theme="dark"] .tb-search__input { background: #0B1526; border-color: #22334F; color: #E6EDF7; }
[data-theme="dark"] .table th { background: #0B1526; }
[data-theme="dark"] .table tbody tr:hover { background: rgba(1,136,252,.1); }
[data-theme="dark"] .card--gradient, [data-theme="dark"] .saas-hero { box-shadow: 0 20px 60px rgba(0,0,0,.5); }
[data-theme="dark"] .badge--muted { background: #22334F; color: #B9C6DA; }
[data-theme="dark"] .btn--ghost, [data-theme="dark"] .icon-btn, [data-theme="dark"] .tb-btn { background: #111F36; border-color: #22334F; color: #E6EDF7; }
[data-theme="dark"] .qa, [data-theme="dark"] .pay-tile, [data-theme="dark"] .co-card { background: #111F36; }
[data-theme="dark"] img, [data-theme="dark"] .chart svg { filter: none; }

@media (max-width: 1100px) { .tb-search { display: none; } .tb-only-mobile { display: grid !important; } }
@media (max-width: 640px) {
  .topbar--adv { padding: 0 12px; }
  .btn-quickadd span { display: none; }
  .btn-quickadd { padding: 9px 11px; }
  .topbar__title { font-size: 14.5px; max-width: 110px; }
  .tb-notif__panel { position: fixed !important; left: 12px; right: 12px; min-width: 0; max-width: none; }
}

/* ============================================================
   DASHBOARD — static advanced SaaS, NO animations
   ============================================================ */
.dash-focus { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.focus-tile { display: flex; align-items: center; gap: 12px; padding: 15px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); color: var(--text-primary); }
.focus-tile:hover { color: var(--text-primary); border-color: #C9DBFA; }
.focus-ico { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; flex: none; }
.focus-tile.is-red .focus-ico { background: #FFEAE4; color: #DC2626; }
.focus-tile.is-orange .focus-ico { background: #FFF2E1; color: #C75B09; }
.focus-tile.is-blue .focus-ico { background: #E4EDFD; color: #0054CE; }
.focus-tile.is-green .focus-ico { background: #E2F5E9; color: #16A34A; }
.focus-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.focus-txt strong { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.focus-txt small { font-size: 12px; color: var(--text-secondary); }
.focus-go { font-size: 12.5px; font-weight: 700; color: var(--primary-blue); flex: none; }

.fin-chart--static .fin-bar__col > span { min-height: 6px; }
.pay-tile--static:hover { transform: none; }
.quick-actions--static .qa:hover { transform: none; }
.conv-fill--static b { padding: 0 12px; color: #fff; font-size: 13px; font-variant-numeric: tabular-nums; }
.winloss--static span { display: block; height: 100%; }
.src-item--static { cursor: default; }
.table--static tbody tr:hover { background: rgba(1, 136, 252, .035); transform: none; }
.dash-mini-head { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--border); font-size: 12.5px; font-weight: 700; color: var(--text-secondary); }
.dash-mini-head a { font-size: 12.5px; }
.dash-mini-list { display: flex; flex-direction: column; margin-top: 8px; }
.dash-mini-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 8px; border-radius: 10px; color: var(--text-primary); }
.dash-mini-row:hover { background: #F6F9FE; }
.dash-mini-row strong { display: block; font-size: 13.3px; }
.dash-mini-row small { display: block; font-size: 12px; color: var(--text-secondary); }
.dash-mini-row b { font-variant-numeric: tabular-nums; }

/* kill every animation + transition inside dashboard cards */
.dash-kpis .gstat, .dash-focus .focus-tile, .convrate-card, .card--static,
.card--static *, .dash-kpis *, .dash-focus * { animation: none !important; transition: none !important; }
.card--static:hover { transform: none !important; box-shadow: var(--shadow) !important; }
.convrate-card::before, .card--static::before { display: none !important; }
.convrate-ring .ring-fg { animation: none !important; }
.src-seg { animation: none !important; }
.conv-fill, .winloss span, .progress span, .co-bar span, .co-mix > span,
.kpi-bars span, .fin-bar__col > span { animation: none !important; }

@media (max-width: 1100px) { .dash-focus { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .dash-focus { grid-template-columns: minmax(0, 1fr); }
  .quick-actions--static { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ============================================================
   LETTERHEAD A4 — bill / invoice on Vivaan Nexa letterhead
   ============================================================ */
.lh-wrap { padding: 18px; background: #E8EDF4; }
.lh-sheet {
    position: relative;
    max-width: 820px;
    margin: 0 auto;
    background-color: #fff;
    background-repeat: no-repeat;
    background-position: top center;
    /* first-page sizing (not 100% 100%): the sheet grows with content, so a
       stretched backdrop would drag the header rule down into the content */
    background-size: 100% auto;
    min-height: 1220px;
    padding: 23% 5.5% 6%;
    border-radius: 4px;
    box-shadow: var(--shadow-lg);
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}
/* company header already printed on the letterhead — hide the duplicate */
.lh-sheet .inv-brand-block { display: none; }
.lh-sheet .inv-head { border-bottom: 2px solid var(--primary-blue); padding-bottom: 10px; margin-bottom: 12px; }
.lh-sheet .inv-title h2 { font-size: 22px; }
.lh-sheet .inv-meta { font-size: 12px; }
.lh-sheet .table { font-size: 12.5px; }
.lh-sheet .table th, .lh-sheet .table td { padding: 8px 10px; }

@media print {
    @page { size: A4; margin: 0; }
    .lh-wrap { padding: 0; background: #fff; border: 0; box-shadow: none; }
    .lh-sheet {
        max-width: none;
        width: 210mm;
        min-height: 296mm;
        aspect-ratio: auto;
        margin: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        background-size: 210mm 297mm;
        padding: 55mm 12mm 14mm;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
/* ============================================================
   DEDICATED A4 PRINT DOCUMENT (billing/print.php)
   Fixed per-page letterhead layer + measured safe zones:
   artwork 1024x1536px, header ink ends ~16%, footer ink
   starts ~92%  =>  top 50mm, bottom 25mm safe zones.
   ============================================================ */
.pdoc { background: #525659; }

.pdoc-screenbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: #fff;
    border-bottom: 1px solid var(--border);
}

.pdoc-screenbar__meta {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-right: auto;
}

.pdoc-screenbar__hint {
    font-size: 12px;
    color: var(--text-secondary);
}

.pdoc-sheet {
    position: relative;
    width: min(210mm, 100%);
    margin: 20px auto;
    background: #fff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .35);
    /* always at least one full A4 sheet: footer art lands at paper bottom
       and the backdrop below can never overflow past the sheet */
    min-height: 296.5mm;
}

.pdoc-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    /* first-page sizing, capped: header rule always sits ~48.8mm from sheet
       top so the 55mm content padding clears it at ANY content height;
       continuation pages stay clean (no repeated header to overlap) */
    height: 100%;
    max-height: 297mm;
    z-index: 0;
    pointer-events: none;
    background-repeat: no-repeat;
    background-size: 100% 297mm;
    background-position: top center;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.pdoc-content {
    position: relative;
    z-index: 1;
    /* Safe content area inside the letterhead artwork (1241x1754px, measured):
       header rule line sits at ~48.8mm; footer bars start ~11.2mm from bottom.
       55mm top = rule + ~23px breathing room before BILL;
       14mm bottom = footer bars + clearance. Normal flow only. */
    padding: 55mm 12mm 14mm;
    font-size: 12.5px;
    max-width: 100%;
    overflow-wrap: break-word;
}

.pdoc-dochead {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-blue);
    margin-bottom: 12px;
}

.pdoc-kicker { font-size: 11px; color: var(--text-secondary); margin-bottom: 2px; }
.pdoc-dochead h1 { font-size: 26px; font-weight: 800; letter-spacing: 1px; color: var(--primary); }
.pdoc-no { font-size: 14px; font-weight: 700; margin: 2px 0 6px; }
.pdoc-dateright { text-align: right; }
.pdoc-dateright span {
    display: block;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--text-secondary);
}
.pdoc-dateright strong { font-size: 14px; }

.pdoc-desc { overflow-wrap: break-word; word-break: normal; min-width: 0; }

/* long invoice values must wrap inside their cells, never overflow.
   Whole words move to the next line; mid-word splits are not allowed. */
.inv-meta > div { min-width: 0; }
.inv-meta strong { overflow-wrap: break-word; word-break: normal; }
.inv-parties > div { min-width: 0; }
.inv-parties p, .inv-parties strong { overflow-wrap: break-word; word-break: normal; }
.pdoc-kicker, .pdoc-no { overflow-wrap: break-word; word-break: normal; }
.inv-words strong { overflow-wrap: break-word; word-break: normal; }

/* fixed layout keeps % column widths stable in browser and PDF alike */
.inv-table { table-layout: fixed; width: 100%; max-width: 100%; }
.inv-table th { white-space: normal; overflow-wrap: break-word; word-break: normal; }
.inv-table td { overflow-wrap: break-word; word-break: normal; min-width: 0; vertical-align: top; }
.inv-summary > div { min-width: 0; }

/* A4-capped sheet: screen table density matches print density (WYSIWYG).
   Narrow 4px side padding lets short-uppercase values (Project, Nos) and
   10-char ₹ amounts sit on one line inside their % columns. */
.pdoc-sheet .table { font-size: 10.5px; line-height: 1.25; }
.pdoc-sheet .table th, .pdoc-sheet .table td { padding: 3px 4px; }
.pdoc-sheet .table th { font-size: 9px; }

.pdoc-tablewrap { overflow-x: visible; }

.pdoc-signoff {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 14px;
    margin-top: 26px;
}

.pdoc-sign { text-align: right; }
.pdoc-sign span {
    display: block;
    width: 180px;
    border-bottom: 1px solid var(--text-secondary);
    margin-bottom: 4px;
    min-height: 34px;
}
.pdoc-sign small { font-size: 11px; color: var(--text-secondary); }

/* Grand Total prominence in existing VIVAAN NEXA brand blue.
   Balance Due keeps the plain bordered style; only the Grand Total
   row carries the .qf-grand--total modifier (see billing templates). */
.pdoc-sheet .qf-grand--total,
.lh-sheet .qf-grand--total {
    background: var(--primary);
    border: 0;
    border-radius: 6px;
    padding: 8px 12px;
    margin-top: 8px;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}
.pdoc-sheet .qf-grand--total span,
.pdoc-sheet .qf-grand--total strong,
.lh-sheet .qf-grand--total span,
.lh-sheet .qf-grand--total strong { color: #fff; }
.pdoc-sheet .qf-grand--total,
.lh-sheet .qf-grand--total { gap: 12px; }

@media print {
    /* A4 with zero page margins (browser dialog "Margins: None" honours this).
       Safe zones live in .pdoc-content padding (normal flow), so the layout
       is immune to margin-box anchoring quirks of fixed print elements.
       The stationery covers page 1 exactly; continuation pages stay clean
       white with the repeated table header — nothing can overlap content. */
    @page { size: A4 portrait; margin: 0; }

    .pdoc { background: #fff; }
    .pdoc-screenbar { display: none !important; }
    .pdoc-sheet { width: auto; margin: 0; box-shadow: none; }
    /* backdrop + min-height are inherited from screen rules (first-page
       stationery, sheet always >= one A4 sheet): nothing to override here
       except keeping the fragmenting sheet shadow-free */

    /* safe zones in-flow: header rule (48.8mm) + ~23px gap, footer clearance */
    .pdoc-content { padding: 55mm 12mm 14mm; font-size: 11.5px; line-height: 1.45; }

    /* compact but readable density so normal invoices fit one A4 page */
    .pdoc-dochead { margin-bottom: 5px; padding-bottom: 5px; }
    .pdoc-dochead h1 { font-size: 20px; }
    .pdoc-no { font-size: 12.5px; }
    .pdoc-dateright strong { font-size: 13px; }
    /* A4 print keeps the desktop multi-column grids: screen breakpoints
       treat the 210mm page as a narrow viewport and would stack them */
    .pdoc-sheet .inv-meta { grid-template-columns: repeat(6, minmax(0, 1fr)); padding: 5px 10px; margin: 10px 0 8px; gap: 12px; }
    .pdoc-sheet .inv-meta strong { font-size: 11px; }
    .pdoc-sheet .inv-meta span { font-size: 9.5px; }
    .pdoc-sheet .inv-parties { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 12px 0 8px; gap: 16px; }
    .pdoc-sheet .inv-parties > div { padding: 5px 10px; }
    .pdoc-sheet .inv-parties p { font-size: 11px; }
    .pdoc-sheet .inv-parties strong { font-size: 12.5px; }
    .pdoc-sheet .inv-summary { grid-template-columns: minmax(0, 1fr) 300px; margin-top: 6px; gap: 12px; }
    .pdoc-sheet .inv-words { padding: 6px 10px; font-size: 11.5px; }
    .pdoc-sheet .inv-words p { margin-top: 4px; }
    .pdoc-sheet .qf-totals { gap: 2px; }
    .pdoc-sheet .qf-total-row { font-size: 11px; }
    .pdoc-sheet .qf-grand { font-size: 13.5px; margin-top: 4px; padding-top: 6px; }
    .pdoc-sheet .qf-grand--total { padding: 5px 10px; }
    .pdoc-sheet .inv-bank { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 8px; padding: 7px 10px; }
    .pdoc-sheet .inv-bank p { font-size: 11.5px; }
    .pdoc-signoff { margin-top: 10px; }
    .pdoc-sheet .pdoc-sign span { min-height: 22px; }

    /* atomic blocks never split across pages */
    .pdoc-keep { page-break-inside: avoid; break-inside: avoid; }

    /* the summary grid itself may flow across pages, but each column
       (words/terms block, totals block) stays intact — no stranded
       half-totals and no forced blank page before the totals */
    .pdoc-sheet .inv-summary.pdoc-keep { page-break-inside: auto; break-inside: auto; }
    .pdoc-sheet .inv-words,
    .pdoc-sheet .qf-totals { page-break-inside: avoid; break-inside: avoid; }

    /* long item tables continue with a repeated header */
    .pdoc-sheet thead { display: table-header-group; }
    .pdoc-sheet tr { page-break-inside: avoid; }
    .pdoc-sheet .table-wrap, .pdoc-tablewrap { overflow: visible; }
}

/* ============================================================
   QUOTATION DOCUMENT (quotations/print.php) — same A4 letterhead
   system as billing: pdoc sheet/backdrop/safe zones are reused.
   Only the brand table header + acceptance grid are quotation-specific.
   ============================================================ */
.qdoc-table thead th {
    background: var(--primary);
    color: #fff;
    border-bottom: 2px solid var(--accent-orange);
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}
.qdoc-table tbody tr:nth-child(even) td { background: #F2F7FF; }
.qdoc-table tbody tr:hover { background: rgba(1, 136, 252, .05); }
.qdoc-table .qdoc-svc strong { display: block; font-size: 11px; }

/* dual acceptance signatures: VIVAAN NEXA (left) + client (right) */
.qdoc-accept {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    margin-top: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
}
.qdoc-accept > div { min-width: 0; }
.qdoc-accept h4 {
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.qdoc-accept .qdoc-signline {
    display: block;
    border-bottom: 1px solid var(--text-secondary);
    min-height: 30px;
    margin: 14px 0 4px;
}
.qdoc-accept small { font-size: 11px; color: var(--text-secondary); }
.qdoc-accept p { font-size: 12px; margin-top: 2px; overflow-wrap: break-word; word-break: normal; }
.qdoc-terms { margin-top: 12px; }
.qdoc-terms h4 {
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.qdoc-terms ol { margin: 0; padding-left: 18px; font-size: 12px; }
.qdoc-terms li { margin-top: 3px; overflow-wrap: break-word; word-break: normal; }

@media print {
    /* quotation keeps the desktop grids on A4 (same narrow-viewport issue) */
    .pdoc-sheet .qdoc-accept { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    /* compact acceptance + terms so standard quotations hold one A4 page */
    .pdoc-sheet .qdoc-accept { margin-top: 10px; padding: 8px 10px; }
    .pdoc-sheet .qdoc-accept h4 { margin-bottom: 6px; }
    .pdoc-sheet .qdoc-accept .qdoc-signline { min-height: 22px; margin: 10px 0 3px; }
    .pdoc-sheet .qdoc-terms { margin-top: 10px; }
    .pdoc-sheet .qdoc-terms li { margin-top: 2px; }
    .pdoc-sheet .qdoc-table thead th {
        background: var(--primary) !important;
        color: #fff !important;
    }
    .pdoc-sheet .qdoc-table tbody tr:nth-child(even) td { background: #F2F7FF !important; }
    .pdoc-sheet .qdoc-table tbody tr:hover { background: transparent !important; }
    .pdoc-sheet .qdoc-accept,
    .pdoc-sheet .qdoc-terms { page-break-inside: avoid; break-inside: avoid; }
}

.ac-wrap { position: relative; }
.ac-drop { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 120; max-height: 260px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; }
.ac-drop[hidden] { display: none; }
.ac-item { display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; border-radius: 9px; background: transparent; cursor: pointer; color: var(--text-primary); }
.ac-item:hover, .ac-item.is-active { background: var(--bg); }
.ac-item strong { display: block; font-size: 13.5px; }
.ac-item small { display: block; font-size: 12px; color: var(--text-secondary); }
.ac-empty { padding: 10px 12px; font-size: 12.8px; color: var(--text-secondary); }
.fu-inline { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px dashed var(--border); }
.fu-inline__row { display: flex; gap: 8px; flex-wrap: wrap; }
.fu-inline__row .input, .fu-inline__row .select { flex: 1 1 120px; min-width: 0; }
.fu-done-btns { display: flex; gap: 4px; flex: none; align-self: center; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.check-item { display: flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); font-size: 13px; cursor: pointer; }
.check-item:hover { border-color: var(--blue-bright); }
.check-item input { width: 15px; height: 15px; accent-color: var(--primary-blue); }


/* ============================================================
   VIVAAN NEXA � Master sidebar: collapsible groups + collapse
   ============================================================ */
:root { --sidebar-collapsed-w: 76px; }

/* Group toggle header */
.sidebar__label--toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    margin: 14px 10px 8px;
    padding: 0 2px;
    border: 0;
    background: none;
    cursor: pointer;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: #5B6B82;
    font-family: inherit;
}
.sidebar__label--toggle::after { display: none; }
.sidebar__label--toggle svg { flex: none; opacity: .7; transition: transform .2s ease; }
.sidebar__label--toggle:hover { color: rgba(255, 255, 255, .8); }
.nav-group.is-collapsed .sidebar__label--toggle svg { transform: rotate(-90deg); }
.nav-group__items { display: flex; flex-direction: column; }
.nav-group.is-collapsed .nav-group__items { display: none; }

/* Collapse button in brand row */
.sidebar__collapse-btn {
    margin-left: auto;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, .16);
    background: rgba(255, 255, 255, .10);
    color: #fff;
    cursor: pointer;
    flex: none;
}
.sidebar__collapse-btn:hover { background: rgba(255, 255, 255, .20); }

/* Desktop icon-only collapsed mode */
@media (min-width: 901px) {
    body.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed-w); }
    body.sidebar-collapsed .app__main { margin-left: var(--sidebar-collapsed-w); }
    body.sidebar-collapsed .sidebar__brand { padding: 16px 0 14px; justify-content: center; }
    body.sidebar-collapsed .sidebar__brand-text { display: none; }
    body.sidebar-collapsed .sidebar__collapse-btn { margin-left: 0; }
    body.sidebar-collapsed .sidebar__collapse-btn svg { transform: rotate(180deg); }
    body.sidebar-collapsed .sidebar__nav { padding: 12px 10px 10px; }
    body.sidebar-collapsed .sidebar__label,
    body.sidebar-collapsed .sidebar__label--toggle { display: none; }
    body.sidebar-collapsed .nav-group__items { gap: 2px; }
    body.sidebar-collapsed .nav-group.is-collapsed .nav-group__items { display: flex; }
    body.sidebar-collapsed .nav-item { justify-content: center; padding: 10px 0; }
    body.sidebar-collapsed .nav-item__text { display: none; }
    body.sidebar-collapsed .nav-item.is-active::before { left: -10px; }
    body.sidebar-collapsed .sidebar__foot { flex-direction: column; align-items: center; gap: 2px; padding: 12px 0; }
}

/* Mobile: collapse control hidden, off-canvas behaviour kept */
@media (max-width: 900px) {
    .sidebar__collapse-btn { display: none; }
    .sidebar__label--toggle { color: rgba(255, 255, 255, .55); }
}

/* ============================================================
   Leads — advanced filter bar (SaaS)
   ============================================================ */
.flt-card { overflow: hidden; }
.toolbar--adv {
    display: block;
    padding: 20px 22px 16px;
    background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFF 100%);
    border-bottom: 1px solid var(--border);
}
.flt-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.flt-title { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 800; color: var(--text-primary); }
.flt-title-ico {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: linear-gradient(135deg, #0054CE, #0188FC);
    color: #fff;
}
.flt-count {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--primary-blue);
    background: #E4EDFD;
    border: 1px solid #C9DBFA;
    padding: 3px 10px;
    border-radius: 999px;
}
.flt-clear { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--accent-red); }
.flt-clear:hover { text-decoration: underline; }
.flt-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr;
    gap: 12px;
}
.flt-grid .field { margin: 0; min-width: 0; }
.input--adv, .select--adv {
    border-radius: 12px;
    border: 1px solid #E2E8F0;
    background: #FFFFFF;
    box-shadow: 0 1px 2px rgba(3, 46, 117, .05);
    padding: 11px 13px;
    font-size: 13.8px;
    min-height: 44px;
}
.input--adv:hover, .select--adv:hover { border-color: #C9DBFA; }
.input-wrap--adv .input--adv { padding-left: 40px; }
.input-wrap--adv > svg { left: 13px; color: #64748B; }
.flt-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.flt-dates { display: inline-flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.flt-dates[hidden] { display: none; }
.flt-dates .input--adv { width: auto; min-width: 170px; }
.flt-actions { display: flex; gap: 10px; align-items: center; margin-left: auto; }
.btn--adv { border-radius: 11px; padding: 10px 20px; font-weight: 700; min-height: 44px; display: inline-flex; align-items: center; }
.btn--primary.btn--adv { background: linear-gradient(135deg, #0054CE, #0188FC); box-shadow: 0 8px 18px rgba(0, 84, 206, .30); border: 0; }
.btn--primary.btn--adv:hover { filter: brightness(1.06); color: #fff; }
.status-pills--adv { padding: 14px 22px; background: #fff; gap: 10px; }
.status-pills--adv a { padding: 8px 18px; font-size: 13px; background: #F1F5F9; border: 1px solid #E2E8F0; }
.status-pills--adv a.is-active { background: #0A2540; border-color: #0A2540; color: #fff; box-shadow: 0 6px 14px rgba(10, 37, 64, .30); }
@media (max-width: 1100px) { .flt-grid { grid-template-columns: 1fr 1fr 1fr; } }
@media (max-width: 760px) { .flt-grid { grid-template-columns: 1fr 1fr; } .toolbar--adv { padding: 16px; } }
@media (max-width: 520px) { .flt-grid { grid-template-columns: 1fr; } .flt-actions { width: 100%; } .flt-actions .btn--adv { flex: 1; justify-content: center; } }

/* ============================================================
   Leads — advanced table (SaaS)
   ============================================================ */
.bulk-bar--adv { background: linear-gradient(180deg, #F8FAFF, #FFFFFF); border-bottom: 1px solid var(--border); padding: 12px 18px; gap: 10px; }
.select--sm { max-width: 190px; padding: 9px 34px 9px 12px; font-size: 13.4px; }
.table-wrap--adv { border-radius: 0 0 16px 16px; }
.table--adv { min-width: 1120px; }
.table--adv thead th {
    background: #F8FAFC;
    color: #64748B;
    font-size: 11px;
    letter-spacing: 1px;
    padding: 13px 16px;
    border-bottom: 1px solid #E2E8F0;
    position: sticky;
    top: 0;
    z-index: 2;
}
.table--adv thead th.num, .table--adv td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table--adv tbody td { padding: 14px 16px; border-bottom: 1px solid #EEF2F7; vertical-align: middle; }
.lead-row { transition: background .14s ease, box-shadow .14s ease; }
.lead-row:hover { background: #F6F9FF; box-shadow: inset 3px 0 0 #0188FC; }
.cell-check { width: 40px; }
.cell-check input[type="checkbox"], .bulk-id { width: 16px; height: 16px; accent-color: #0054CE; cursor: pointer; }
.cell-user--adv { gap: 12px; }
.avatar--lead { background: linear-gradient(135deg, #0054CE, #0188FC); box-shadow: 0 4px 10px rgba(0, 84, 206, .30); }
.avatar--xs { width: 26px; height: 26px; font-size: 10px; background: linear-gradient(135deg, #0A2540, #334155); color: #fff; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; flex: none; }
.cell-user__meta { display: flex; flex-direction: column; min-width: 0; }
.cell-user__name { font-weight: 700; font-size: 14px; color: #0A2540; }
.cell-user__name:hover { color: #0054CE; text-decoration: underline; }
.cell-user__sub { font-size: 12px; color: #64748B; letter-spacing: 0; }
.cell-company { font-weight: 600; font-size: 13.8px; color: #0F172A; }
.cell-meta { display: inline-flex; align-items: center; gap: 8px; font-size: 13.4px; color: #0F172A; min-width: 0; }
.cell-meta > svg { flex: none; color: #94A3B8; }
.cell-meta.is-muted { color: #64748B; }
.cell-meta.is-empty { color: #94A3B8; }
.cell-value { font-weight: 800; color: #0A2540; }
.cell-owner { display: inline-flex; align-items: center; gap: 8px; font-size: 13.2px; color: #334155; font-weight: 600; }
.cell-empty { color: #CBD5E1; }
.cell-fu { font-size: 12.8px; font-weight: 600; color: #334155; }
.cell-fu > svg { color: #0188FC; }
.cell-fu.is-late { color: #B42C05; }
.cell-fu.is-late > svg { color: #DC2626; }
.row-actions-head { text-align: right; }
.row-actions--adv { opacity: 1; justify-content: flex-end; transition: opacity .15s ease; }
.lead-row:hover .row-actions--adv { opacity: 1; }
.row-actions--adv .icon-btn-sm { border-radius: 10px; }
.row-actions--adv .icon-btn-sm:hover { transform: translateY(-1px); box-shadow: 0 6px 12px rgba(0, 84, 206, .18); }

/* ---------- leads table column alignment (like clients screenshot) ---------- */
.leads-table { min-width: 1240px; }
.leads-table thead th { text-align: left; vertical-align: middle; white-space: nowrap; }
.leads-table thead th:nth-child(1) { width: 44px; }
.leads-table thead th:nth-child(2) { min-width: 210px; }
.leads-table thead th:nth-child(3) { min-width: 130px; }
.leads-table thead th:nth-child(4) { min-width: 130px; }
.leads-table thead th:nth-child(5) { min-width: 110px; }
.leads-table thead th:nth-child(6) { min-width: 90px; }
.leads-table thead th:nth-child(7) { min-width: 110px; }
.leads-table thead th:nth-child(8) { min-width: 120px; }
.leads-table thead th:nth-child(9) { min-width: 140px; }
.leads-table thead th:nth-child(10) { min-width: 110px; }
.leads-table thead th:nth-child(11) { min-width: 176px; text-align: right; }
.leads-table tbody td { text-align: left; vertical-align: middle; }
.leads-table tbody td.num { text-align: right; }
.leads-table tbody td:last-child { text-align: right; }
.leads-table .badge { vertical-align: middle; }
.leads-table .cell-user__sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }

/* ============================================================
   Lead form — popup-dialog page style (full advanced)
   ============================================================ */
.popup-page { margin: -26px -30px -34px; padding: 30px 22px 40px; background: linear-gradient(180deg, rgba(10,37,64,.72), rgba(10,37,64,.60)); min-height: calc(100vh - var(--topbar-h)); }
.popup-dialog { max-width: 980px; margin: 0 auto; background: var(--surface); border-radius: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.45); overflow: hidden; border: 1px solid rgba(255,255,255,.25); }
.popup-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 20px 24px; background: linear-gradient(135deg, #0A2540 0%, #083D8B 60%, #0054CE 100%); color: #fff; position: sticky; top: 0; z-index: 5; }
.popup-head .page-title-wrap h2 { color: #fff; }
.popup-head .page-title-wrap p { color: rgba(255,255,255,.75); }
.popup-head .modal-x { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.25); color: #fff; }
.popup-head .modal-x:hover { background: rgba(255,255,255,.28); color: #fff; border-color: rgba(255,255,255,.4); }
.popup-body { padding: 24px 24px 26px; background: var(--bg); }
.popup-body .qf-section { margin-bottom: 18px; }
.popup-body .qf-step { display: inline-flex; align-items: center; padding: 5px 13px; border-radius: 999px; font-size: 11.5px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: #0054CE; background: #E4EDFD; border: 1px solid #C9DBFA; }
.qf-actions--popup { position: sticky; bottom: 0; z-index: 4; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 -8px 24px rgba(3,46,117,.10); margin-top: 4px; }
@media (max-width: 640px) { .popup-page { margin: -18px -14px -24px; padding: 16px 10px 26px; } .popup-body { padding: 16px 14px 18px; } .popup-head { padding: 16px; } }

/* ============================================================
   Leads — table / cards view toggle + lead cards
   ============================================================ */
.lead-view-bar { flex-wrap: wrap; }
.lead-view-spacer { flex: 1 1 auto; }
.lead-toggle { flex: none; }
.lead-toggle__btn, .co-toggle__btn { text-decoration: none; }
.lead-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    padding: 18px;
    background: #F8FAFC;
}
.lead-card {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 1px 2px rgba(3, 46, 117, .05);
    transition: box-shadow .16s ease, transform .16s ease;
}
.lead-card:hover { box-shadow: 0 10px 24px rgba(0, 84, 206, .14); transform: translateY(-2px); }
.lead-card__top { display: flex; align-items: flex-start; gap: 10px; }
.lead-card__top .bulk-id { width: 16px; height: 16px; accent-color: #0054CE; margin-top: 10px; cursor: pointer; }
.lead-card__head { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lead-card__name { font-weight: 800; font-size: 14.5px; color: #0A2540; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-card__name:hover { color: #0054CE; text-decoration: underline; }
.lead-card__no { font-size: 12px; color: #64748B; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-card__value { font-weight: 800; color: #0A2540; font-size: 14px; white-space: nowrap; }
.lead-card__badges { display: flex; flex-wrap: wrap; gap: 6px; }
.lead-card__meta { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; font-size: 12.6px; color: #334155; }
.lead-card__meta span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-card__meta svg { flex: none; color: #94A3B8; }
.lead-card__foot { display: flex; align-items: center; gap: 8px; border-top: 1px solid #EEF2F7; padding-top: 10px; margin-top: 2px; }
.lead-card__foot .btn--sm { padding: 7px 12px; font-size: 12.5px; }
@media (max-width: 1200px) { .lead-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .lead-cards { grid-template-columns: minmax(0, 1fr); } .lead-card__meta { grid-template-columns: 1fr; } }

/* ============================================================
   Universal Table / Cards toggle (all list pages, via table-cards.js)
   ============================================================ */
.tc-bar { display: flex; align-items: center; gap: 10px; padding: 12px 18px; background: linear-gradient(180deg, #F8FAFF, #FFFFFF); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tc-count { font-size: 13px; }
.tc-spacer { flex: 1 1 auto; }
.tc-toggle { flex: none; }
.tc-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 18px; background: #F8FAFC; }
.tc-cards[hidden] { display: none; }
.tc-card { background: #fff; border: 1px solid #E2E8F0; border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 1px 2px rgba(3, 46, 117, .05); transition: box-shadow .16s ease, transform .16s ease; min-width: 0; }
.tc-card:hover { box-shadow: 0 10px 24px rgba(0, 84, 206, .14); transform: translateY(-2px); }
.tc-card__top { display: flex; align-items: flex-start; gap: 10px; }
.tc-check { width: 16px; height: 16px; accent-color: #0054CE; margin-top: 4px; cursor: pointer; flex: none; }
.tc-card__head { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tc-card__title { font-weight: 800; font-size: 14.5px; color: #0A2540; overflow: hidden; text-overflow: ellipsis; }
.tc-card__title a { color: inherit; }
.tc-card__title a:hover { color: #0054CE; text-decoration: underline; }
.tc-card__sub { font-size: 11px; color: #94A3B8; text-transform: uppercase; letter-spacing: .6px; font-weight: 700; }
.tc-card__meta { display: flex; flex-direction: column; gap: 6px; }
.tc-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 12.8px; padding: 5px 0; border-top: 1px dashed #EEF2F7; }
.tc-meta__k { flex: none; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #94A3B8; }
.tc-meta__v { text-align: right; color: #0F172A; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tc-card__foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border-top: 1px solid #EEF2F7; padding-top: 10px; margin-top: 2px; }
@media (max-width: 1200px) { .tc-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .tc-cards { grid-template-columns: minmax(0, 1fr); } }

/* ============================================================
   India State / UT selector (searchable combobox).
   Enhances select[data-india-state]; reuses CRM tokens only.
   ============================================================ */
.is-wrap { position: relative; min-width: 0; }
.is-native { display: none !important; }
.is-combo { position: relative; display: flex; align-items: center; min-width: 0; }
.is-combo .is-input { width: 100%; min-width: 0; padding-right: 52px; text-overflow: ellipsis; }
.is-chev { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--text-secondary); pointer-events: auto; cursor: pointer; display: inline-flex; line-height: 0; }
.is-clear { position: absolute; right: 30px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--text-secondary); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 999px; padding: 0; }
.is-clear:hover { background: #EDF1F7; color: var(--text-primary); }
.is-clear[hidden] { display: none; }
.is-drop { position: absolute; z-index: 60; top: calc(100% + 4px); left: 0; right: 0; min-width: 0; max-height: 248px; overflow-y: auto; overflow-x: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 6px; }
.is-drop[hidden] { display: none; }
.is-group { font-size: 10.5px; font-weight: 800; letter-spacing: .07em; color: var(--text-secondary); padding: 8px 10px 4px; }
.is-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; border: 0; background: transparent; text-align: left; font: inherit; font-size: 13.5px; color: var(--text-primary); border-radius: 7px; padding: 8px 10px; cursor: pointer; white-space: normal; overflow-wrap: anywhere; }
.is-opt small { flex: none; font-size: 11px; font-weight: 700; color: var(--text-secondary); background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; }
.is-opt:hover, .is-opt.is-active { background: #EEF4FF; }
.is-opt.is-selected { font-weight: 700; }
.is-empty { font-size: 13px; color: var(--text-secondary); padding: 10px; }
@media (max-width: 720px) { .is-drop { max-height: 220px; } }

/* ============================================================
   Quotation item autocomplete (service-selector.js).
   Roomy scrollable list (5-7 visible) + keyboard highlight.
   Dropdown is fixed-positioned by JS, so no overflow changes here.
   ============================================================ */
.qf-dropdown { max-height: 320px; }
.qf-result.is-active { background: #E8F1FE; }
@media (max-width: 640px) { .qf-dropdown { max-height: 240px; } }

/* ============================================================
   Notification sound settings (settings/profile.php).
   ============================================================ */
.snd-row { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-weight: 600; }
.snd-row input[type="checkbox"] { width: 17px; height: 17px; accent-color: #0054CE; margin-top: 2px; flex: none; cursor: pointer; }
.snd-row small { display: block; color: var(--text-secondary); font-weight: 400; }

/* ============================================================
   Hidden developer / vendor maintenance control entry
   (sidebar footer — rendered only for authorized accounts).
   ============================================================ */
.sidebar__devctl {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    flex: none;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .05);
    color: rgba(203, 213, 225, .55);
    opacity: .5;
    transition: opacity .15s ease, background .15s ease, color .15s ease;
}
.sidebar__devctl:hover, .sidebar__devctl:focus-visible {
    opacity: 1;
    color: #38BDF8;
    background: rgba(56, 189, 248, .14);
    border-color: rgba(56, 189, 248, .4);
    text-decoration: none;
    outline: none;
}
