/* =====================================================================
   Addison design system (v2.1) — layered on Bootstrap 5.3
   Loaded by every page: marketing, client portal, admin, installer.
   ===================================================================== */
:root {
    --ad-primary: #4f46e5;
    --ad-primary-600: #4338ca;
    --ad-primary-50: #eef2ff;
    --ad-accent: #06b6d4;
    --ad-ink: #0f172a;
    --ad-ink-2: #334155;
    --ad-muted: #64748b;
    --ad-line: #e2e8f0;
    --ad-bg: #f5f7fb;
    --ad-card: #ffffff;
    --ad-radius: 14px;
    --ad-shadow: 0 1px 2px rgba(15,23,42,.05), 0 8px 24px -8px rgba(15,23,42,.10);
    --ad-shadow-lg: 0 2px 4px rgba(15,23,42,.06), 0 24px 48px -16px rgba(15,23,42,.22);
    --ad-grad: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #06b6d4 120%);
    --ad-grad-dark: linear-gradient(135deg, #0f172a 0%, #1e1b4b 60%, #312e81 100%);

    --bs-primary: #4f46e5;
    --bs-primary-rgb: 79, 70, 229;
    --bs-link-color: #4f46e5;
    --bs-link-color-rgb: 79, 70, 229;
    --bs-link-hover-color: #4338ca;
    --bs-link-hover-color-rgb: 67, 56, 202;
    --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --bs-body-color: #1e293b;
    --bs-border-color: #e2e8f0;
    --bs-border-radius: .6rem;
    --bs-border-radius-lg: var(--ad-radius);
}

/* ---------- base ---------- */
body { background: var(--ad-bg); -webkit-font-smoothing: antialiased; letter-spacing: -.003em; }
body.bg-light { background: var(--ad-bg) !important; }
h1, h2, h3, h4, h5, h6 { color: var(--ad-ink); font-weight: 700; letter-spacing: -.02em; }
a { text-decoration: none; }
a:hover { text-decoration: underline; }
.text-muted { color: var(--ad-muted) !important; }
.bg-light:not(body) { background: #f1f4f9 !important; }
::selection { background: #c7d2fe; }

/* page heading used by every portal page: <h1 class="h4 mb-4"> */
.container > h1.h4, .container-fluid > h1.h4 {
    font-size: 1.65rem; font-weight: 800; margin-top: .25rem;
    display: flex; align-items: center; gap: .6rem;
}
.container > h1.h4::before {
    content: ""; width: 6px; height: 1.6rem; border-radius: 6px; background: var(--ad-grad); flex: 0 0 6px;
}

/* ---------- buttons ---------- */
.btn { font-weight: 600; border-radius: .65rem; padding: .5rem 1rem; transition: transform .08s ease, box-shadow .15s ease, background-color .15s; }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: .3rem .7rem; border-radius: .5rem; }
.btn-lg { padding: .8rem 1.6rem; border-radius: .8rem; }
.btn-primary {
    --bs-btn-bg: var(--ad-primary); --bs-btn-border-color: var(--ad-primary);
    --bs-btn-hover-bg: var(--ad-primary-600); --bs-btn-hover-border-color: var(--ad-primary-600);
    --bs-btn-active-bg: #3730a3; --bs-btn-active-border-color: #3730a3;
    --bs-btn-disabled-bg: var(--ad-primary); --bs-btn-disabled-border-color: var(--ad-primary);
    box-shadow: 0 1px 2px rgba(79,70,229,.3), 0 6px 14px -6px rgba(79,70,229,.55);
}
.btn-outline-primary { --bs-btn-color: var(--ad-primary); --bs-btn-border-color: #c7d2fe; --bs-btn-hover-bg: var(--ad-primary); --bs-btn-hover-border-color: var(--ad-primary); }
.btn-outline-secondary { --bs-btn-color: var(--ad-ink-2); --bs-btn-border-color: var(--ad-line); --bs-btn-hover-bg: #f1f5f9; --bs-btn-hover-color: var(--ad-ink); --bs-btn-hover-border-color: #cbd5e1; }
.btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: #fff; --bs-btn-color: var(--ad-primary-600); box-shadow: 0 8px 24px -8px rgba(0,0,0,.35); }
.btn-gradient { color: #fff; border: 0; background: var(--ad-grad); box-shadow: 0 10px 24px -10px rgba(79,70,229,.8); }
.btn-gradient:hover { color: #fff; filter: brightness(1.06); }

/* ---------- forms ---------- */
.form-label { font-weight: 600; font-size: .85rem; color: var(--ad-ink-2); margin-bottom: .35rem; }
.form-control, .form-select { border-color: #d5dde8; padding: .6rem .85rem; border-radius: .65rem; background-color: #fff; }
.form-control:focus, .form-select:focus { border-color: #818cf8; box-shadow: 0 0 0 .25rem rgba(99,102,241,.18); }
.form-text { color: var(--ad-muted); }
.form-check-input:checked { background-color: var(--ad-primary); border-color: var(--ad-primary); }
.form-switch .form-check-input { width: 2.4em; height: 1.3em; }
.input-icon { position: relative; }
.input-icon > .bi { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: #94a3b8; pointer-events: none; }
.input-icon > .form-control { padding-left: 2.5rem; }

/* ---------- cards ---------- */
.card { border: 1px solid var(--ad-line); border-radius: var(--ad-radius); background: var(--ad-card); box-shadow: var(--ad-shadow); overflow: hidden; }
.card.shadow-sm, .card.shadow { box-shadow: var(--ad-shadow) !important; }
.card-header { background: #fff; border-bottom: 1px solid var(--ad-line); font-weight: 700; color: var(--ad-ink); padding: .9rem 1.15rem; }
.card-body { padding: 1.25rem; }
.card-footer { background: #f8fafc; border-top: 1px solid var(--ad-line); }

/* stat tiles */
.stat-tile { position: relative; }
.stat-tile .card-body { display: flex; gap: .9rem; align-items: flex-start; }
.stat-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.25rem; flex: 0 0 44px; }
.stat-icon.i-indigo { background: #eef2ff; color: #4f46e5; }
.stat-icon.i-cyan   { background: #ecfeff; color: #0891b2; }
.stat-icon.i-amber  { background: #fffbeb; color: #d97706; }
.stat-icon.i-rose   { background: #fff1f2; color: #e11d48; }
.stat-icon.i-green  { background: #ecfdf5; color: #059669; }
.stat-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; color: var(--ad-muted); }
.stat-value { font-size: 1.85rem; font-weight: 800; line-height: 1.15; color: var(--ad-ink); font-variant-numeric: tabular-nums; }
.stat-sub { font-size: .8rem; color: var(--ad-muted); }

.progress { background: #e8ecf5; border-radius: 99px; }
.progress-bar { border-radius: 99px; }
.progress-bar.bg-primary { background: var(--ad-grad) !important; }

/* ---------- tables ---------- */
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > thead > tr > th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ad-muted); font-weight: 700; background: #f8fafc; border-bottom: 1px solid var(--ad-line); padding: .7rem 1rem; white-space: nowrap; }
.table > tbody > tr > td { padding: .75rem 1rem; vertical-align: middle; border-color: #eef2f7; }
.table-hover > tbody > tr:hover > * { --bs-table-hover-bg: #f8faff; }
.table-sm > :not(caption) > * > * { padding: .7rem 1rem; }

/* ---------- badges & alerts ---------- */
.badge { font-weight: 600; border-radius: 99px; padding: .4em .75em; letter-spacing: .01em; }
.badge.bg-secondary { background: #e2e8f0 !important; color: #334155; }
.badge.bg-success   { background: #d1fae5 !important; color: #047857; }
.badge.bg-danger    { background: #ffe4e6 !important; color: #be123c; }
.badge.bg-warning   { background: #fef3c7 !important; color: #b45309; }
.badge.bg-info      { background: #cffafe !important; color: #0e7490; }
.badge.bg-primary   { background: #e0e7ff !important; color: #3730a3; }
.badge.text-dark    { color: #334155 !important; }
.alert { border: 1px solid transparent; border-left-width: 4px; border-radius: 12px; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.alert-info    { background: #ecfeff; border-color: #a5f3fc; border-left-color: #06b6d4; color: #155e75; }
.alert-success { background: #ecfdf5; border-color: #a7f3d0; border-left-color: #10b981; color: #065f46; }
.alert-warning { background: #fffbeb; border-color: #fde68a; border-left-color: #f59e0b; color: #92400e; }
.alert-danger  { background: #fff1f2; border-color: #fecdd3; border-left-color: #f43f5e; color: #9f1239; }

.nav-tabs { border-bottom: 1px solid var(--ad-line); }
.nav-tabs .nav-link { border: 0; color: var(--ad-muted); font-weight: 600; border-bottom: 2px solid transparent; }
.nav-tabs .nav-link.active { color: var(--ad-primary); border-bottom-color: var(--ad-primary); background: transparent; }
.pagination { --bs-pagination-active-bg: var(--ad-primary); --bs-pagination-active-border-color: var(--ad-primary); --bs-pagination-color: var(--ad-primary); }
.modal-content { border: 0; border-radius: 16px; box-shadow: var(--ad-shadow-lg); }

/* ---------- app navbar (admin + client portal) ---------- */
.app-nav {
    background: var(--ad-grad-dark);
    padding: .55rem 0;
    box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 8px 24px -12px rgba(15,23,42,.6);
    z-index: 1030;
}
.app-nav .navbar-brand { display: flex; align-items: center; gap: .6rem; color: #fff; font-weight: 800; letter-spacing: -.02em; font-size: 1.1rem; }
.brand-mark { display: inline-grid; place-items: center; line-height: 0; border-radius: 10px; box-shadow: 0 6px 16px -4px rgba(79,70,229,.55); flex: 0 0 auto; }
.brand-mark .brand-svg { display: block; border-radius: 22%; }
.brand-sub { font-size: .65rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; color: #a5b4fc; background: rgba(165,180,252,.14); padding: .2rem .5rem; border-radius: 99px; }
.app-nav .nav-link { color: #cbd5e1; font-weight: 500; font-size: .92rem; padding: .5rem .8rem !important; border-radius: .6rem; display: flex; align-items: center; gap: .4rem; }
.app-nav .nav-link:hover, .app-nav .nav-link:focus { color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
.app-nav .nav-link.active, .app-nav .show > .nav-link { color: #fff; background: rgba(255,255,255,.14); }
.app-nav .nav-link .bi { opacity: .85; }
.app-nav .navbar-toggler { border-color: rgba(255,255,255,.25); }
.app-nav .navbar-toggler-icon { filter: invert(1); }
.user-chip { display: flex; align-items: center; gap: .55rem; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--ad-grad); color: #fff; font-weight: 700; font-size: .8rem; }
.user-chip .who { line-height: 1.1; text-align: left; }
.user-chip .who small { display: block; color: #94a3b8; font-size: .7rem; }

/* dropdown menus (all navbars) */
.dropdown-menu {
    border: 1px solid var(--ad-line); border-radius: 14px; padding: .5rem;
    box-shadow: var(--ad-shadow-lg); min-width: 15rem; margin-top: .5rem !important;
    animation: ad-pop .14s ease-out;
}
@keyframes ad-pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
.dropdown-item { border-radius: 9px; padding: .55rem .75rem; display: flex; align-items: center; gap: .7rem; font-weight: 500; color: var(--ad-ink-2); }
.dropdown-item .bi { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--ad-primary-50); color: var(--ad-primary); font-size: .95rem; flex: 0 0 30px; }
.dropdown-item small { display: block; color: var(--ad-muted); font-weight: 400; font-size: .74rem; line-height: 1.2; }
.dropdown-item:hover, .dropdown-item:focus { background: #f1f5ff; color: var(--ad-ink); text-decoration: none; }
.dropdown-item.active, .dropdown-item:active { background: var(--ad-primary-50); color: var(--ad-primary-600); }
.dropdown-item.text-danger .bi { background: #fff1f2; color: #e11d48; }
.dropdown-header { text-transform: uppercase; letter-spacing: .08em; font-size: .68rem; font-weight: 700; color: var(--ad-muted); padding: .4rem .75rem; }
.dropdown-divider { margin: .4rem 0; border-color: var(--ad-line); }
@media (min-width: 992px) { .app-nav .dropdown:hover > .dropdown-menu:not(.dropdown-menu-end) { display: block; } .app-nav .dropdown-menu { margin-top: 0 !important; } .app-nav .dropdown:hover > .nav-link { color: #fff; background: rgba(255,255,255,.1); } }
@media (max-width: 991.98px) { .app-nav .dropdown-menu { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.08); box-shadow: none; } .app-nav .dropdown-item { color: #e2e8f0; } .app-nav .dropdown-item small { color: #94a3b8; } .app-nav .dropdown-item:hover { background: rgba(255,255,255,.08); color: #fff; } .app-nav .dropdown-header { color: #94a3b8; } }

/* ---------- auth screens ---------- */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: #fff; }
.auth-hero { background: var(--ad-grad-dark); color: #e2e8f0; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-hero::before, .auth-hero::after { content: ""; position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; }
.auth-hero::before { width: 380px; height: 380px; background: #4f46e5; top: -120px; right: -100px; }
.auth-hero::after { width: 320px; height: 320px; background: #06b6d4; bottom: -120px; left: -80px; opacity: .35; }
.auth-hero > * { position: relative; z-index: 1; }
.auth-hero h2 { color: #fff; font-size: 2rem; font-weight: 800; }
.auth-hero .brand { display: flex; align-items: center; gap: .65rem; color: #fff; font-weight: 800; font-size: 1.2rem; }
.auth-points { list-style: none; padding: 0; margin: 1.75rem 0 0; display: grid; gap: 1rem; }
.auth-points li { display: flex; gap: .85rem; align-items: flex-start; }
.auth-points .bi { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.1); color: #a5f3fc; flex: 0 0 36px; }
.auth-points b { color: #fff; display: block; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; background: #fff; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 1.75rem; font-weight: 800; margin-bottom: .25rem; }
.auth-simple { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; background: var(--ad-grad-dark); }
.auth-simple .card { max-width: 440px; width: 100%; box-shadow: var(--ad-shadow-lg); }
@media (max-width: 899px) { .auth-shell { grid-template-columns: 1fr; } .auth-hero { display: none; } .auth-panel { min-height: 100vh; background: var(--ad-bg); } }

/* ---------- marketing site ---------- */
.site-nav { background: rgba(255,255,255,.86); backdrop-filter: blur(12px); border-bottom: 1px solid var(--ad-line); }
.site-nav .navbar-brand { display: flex; align-items: center; gap: .55rem; font-weight: 800; color: var(--ad-ink); letter-spacing: -.02em; }
.site-nav .nav-link { color: var(--ad-ink-2); font-weight: 500; }
.site-nav .nav-link:hover { color: var(--ad-primary); text-decoration: none; }
.hero { background: var(--ad-grad-dark) !important; position: relative; overflow: hidden; color: #e2e8f0; }
.hero::before { content: ""; position: absolute; inset: -20% -10% auto auto; width: 620px; height: 620px; background: radial-gradient(circle, rgba(99,102,241,.55), transparent 65%); }
.hero::after { content: ""; position: absolute; inset: auto auto -30% -10%; width: 520px; height: 520px; background: radial-gradient(circle, rgba(6,182,212,.35), transparent 65%); }
.hero .container { position: relative; z-index: 1; }
.hero h1 { color: #fff; font-weight: 800; letter-spacing: -.035em; }
.hero .lead { color: #cbd5e1; }
.hero .eyebrow { display: inline-flex; gap: .4rem; align-items: center; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); color: #e0e7ff; padding: .3rem .8rem; border-radius: 99px; font-size: .8rem; font-weight: 600; margin-bottom: 1.25rem; }
.phone-mock { width: 300px; max-width: 100%; margin: 0 auto; background: #fff; border-radius: 34px; padding: 14px; box-shadow: 0 40px 80px -20px rgba(0,0,0,.6); border: 6px solid #1e293b; color: var(--ad-ink); text-align: left; }
.phone-mock .bar { text-align: center; font-size: .72rem; color: var(--ad-muted); padding: .35rem 0 .7rem; border-bottom: 1px solid var(--ad-line); margin-bottom: .8rem; }
.bubble { padding: .6rem .85rem; border-radius: 18px; font-size: .86rem; margin-bottom: .5rem; max-width: 88%; }
.bubble.in { background: #eef2f7; border-bottom-left-radius: 5px; }
.bubble.out { background: var(--ad-grad); color: #fff; margin-left: auto; border-bottom-right-radius: 5px; }
.missed { display: flex; align-items: center; gap: .5rem; color: #e11d48; background: #fff1f2; padding: .5rem .7rem; border-radius: 12px; font-size: .8rem; font-weight: 600; margin-bottom: .7rem; }
.section-eyebrow { color: var(--ad-primary); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; font-size: .78rem; }
.feature-card { height: 100%; background: #fff; border: 1px solid var(--ad-line); border-radius: 18px; padding: 1.6rem; box-shadow: var(--ad-shadow); transition: transform .18s ease, box-shadow .18s ease, border-color .18s; }
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--ad-shadow-lg); border-color: #c7d2fe; }
.feature-icon { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; font-size: 1.5rem; margin-bottom: 1rem; background: var(--ad-primary-50); color: var(--ad-primary); }
.step-num { font-size: .75rem; font-weight: 800; color: var(--ad-primary); background: var(--ad-primary-50); border-radius: 99px; padding: .2rem .6rem; display: inline-block; margin-bottom: .6rem; }
.sms-bubble { background: var(--ad-grad) !important; color: #fff; border-radius: 1.25rem 1.25rem 1.25rem .3rem !important; box-shadow: var(--ad-shadow); }
.price-card { border: 2px solid #c7d2fe; border-radius: 22px; box-shadow: var(--ad-shadow-lg) !important; position: relative; }
.price-card::before { content: "Most popular"; position: absolute; top: 0; left: 50%; transform: translate(-50%, -50%); background: var(--ad-grad); color: #fff; font-size: .72rem; font-weight: 700; padding: .3rem .8rem; border-radius: 99px; letter-spacing: .04em; }
.price-figure { font-size: 3.4rem !important; font-weight: 800; letter-spacing: -.04em; color: var(--ad-ink); }
.check-list { list-style: none; padding: 0; }
.check-list li { display: flex; gap: .6rem; align-items: center; margin-bottom: .7rem; }
.check-list .bi { color: #10b981; font-size: 1.1rem; }
details.faq { background: #fff; border: 1px solid var(--ad-line) !important; border-radius: 14px !important; box-shadow: var(--ad-shadow); }
details.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-size: 1.05rem !important; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "\F282"; font-family: "bootstrap-icons"; color: var(--ad-primary); transition: transform .2s; }
details.faq[open] summary::after { transform: rotate(180deg); }
.site-footer { background: #0f172a; color: #94a3b8; }
.site-footer a { color: #cbd5e1; }
.legal-page h1, .legal-page h2 { color: var(--ad-ink); }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }


/* ---------- password show/hide toggle (password-toggle.js) ---------- */
.pw-wrap { position: relative; }
.has-pw-toggle > .form-control[type="password"],
.has-pw-toggle > .form-control[data-pw-toggle] { padding-right: 2.75rem; }
.pw-toggle {
    position: absolute; right: .35rem; top: 50%; transform: translateY(-50%);
    display: inline-flex; align-items: center; justify-content: center;
    width: 2.1rem; height: 2.1rem; padding: 0; border: 0; border-radius: 8px;
    background: transparent; color: #64748b; cursor: pointer; line-height: 1;
}
.pw-toggle:hover { color: var(--ad-ink, #0f172a); background: rgba(100,116,139,.12); }
.pw-toggle:focus-visible { outline: 2px solid #6366f1; outline-offset: 1px; }
.pw-toggle .bi { position: static; transform: none; pointer-events: none; font-size: 1.05rem; color: inherit; }

/* ---------- horizontally scrollable tables (v2.3.4) ---------- */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; max-width: 100%; }
.table-responsive::-webkit-scrollbar { height: 8px; }
.table-responsive::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }
.table-responsive > .table { min-width: 640px; }
.table-responsive > .table td, .table-responsive > .table th { white-space: nowrap; }
.table-responsive > .table td.text-wrap, .table-responsive > .table td .text-wrap { white-space: normal; min-width: 14rem; }
