/* Simple AMS - design tokens + marketing/app styles. Plain CSS, no build step. */
:root {
    /* Official Orion / GDS palette (iwoca): Denim navy + Coral primary, London
       cool-grey surfaces, GDS validation greens/amber. Exact hex from the GDS. */
    --c-bg: #0c2340;             /* Denim 15 - hero base */
    --c-bg-soft: #102f56;        /* Denim 20 */
    --c-bg-deep: #08172b;        /* Denim 10 */
    --c-surface: #ffffff;
    --c-surface-2: #f4f7fa;      /* London 97 */
    --c-border: #dde8ee;         /* London 90 */
    --c-text: #0c2340;           /* Denim 15 */
    --c-muted: #5f6c82;          /* desaturated denim-grey for secondary text */
    /* Primary action color = brand coral (kept over GDS Coral 65 by choice). */
    --c-primary: #ff6a5a;        /* brand coral */
    --c-primary-600: #ee5343;    /* darker coral - hover/active */
    --c-primary-050: #fff0ed;    /* light coral tint */
    --c-navy: #0c2340;           /* Denim 15 - deep accent in brand gradients */
    --c-accent: #00b278;         /* GDS Success 35 */
    --c-accent-050: #e0f6ee;
    --c-coral: #ff6a5a;          /* brand accent */
    --c-coral-600: #ee5343;
    --c-coral-050: #fff0ed;
    --c-warn: #ffbf00;           /* GDS Amber */
    --c-warn-050: #fff6e6;
    --c-danger: #af0d04;         /* GDS Error (Coral 35) */
    --c-danger-050: #fbeae9;
    --radius: 16px;
    --radius-sm: 11px;
    --shadow-sm: 0 1px 2px rgba(12, 18, 38, .05), 0 1px 3px rgba(12, 18, 38, .06);
    --shadow-md: 0 10px 30px -10px rgba(12, 18, 38, .18);
    --shadow-lg: 0 24px 60px -12px rgba(12, 18, 38, .24);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    --maxw: 1140px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font);
    color: var(--c-text);
    background: var(--c-surface);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--c-primary); text-decoration: none; }
a:hover { color: var(--c-primary-600); }
img { max-width: 100%; height: auto; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .5em; font-weight: 800; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
h3 { font-size: 1.2rem; font-weight: 700; }
.lead { font-size: 1.18rem; color: var(--c-muted); }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; color: var(--c-coral-600); }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; gap: .5rem;
    font-weight: 600; font-size: .98rem; border: 1px solid transparent;
    padding: .72rem 1.25rem; border-radius: var(--radius-sm); cursor: pointer;
    transition: transform .08s ease, box-shadow .15s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
/* Coral is the primary action color (iwoca-style) across app + marketing. */
.btn-primary { background: var(--c-coral); color: #fff; box-shadow: 0 10px 24px -12px rgba(255,106,90,.95); }
.btn-primary:hover { background: var(--c-coral-600); color: #fff; box-shadow: var(--shadow-md); }
/* Override Bootstrap's blue button states (hover/active/focus ring) with coral. */
.btn-primary, .btn-coral {
    --bs-btn-bg: var(--c-coral); --bs-btn-border-color: var(--c-coral);
    --bs-btn-hover-bg: var(--c-coral-600); --bs-btn-hover-border-color: var(--c-coral-600);
    --bs-btn-active-bg: var(--c-coral-600); --bs-btn-active-border-color: var(--c-coral-600);
    --bs-btn-disabled-bg: var(--c-coral); --bs-btn-disabled-border-color: var(--c-coral); --bs-btn-disabled-color: #fff;
    --bs-btn-color: #fff; --bs-btn-hover-color: #fff; --bs-btn-active-color: #fff;
    --bs-btn-focus-shadow-rgb: 255, 106, 90;
}
.btn-primary:disabled, .btn-coral:disabled, .btn-primary.disabled, .btn-coral.disabled { background: var(--c-coral); border-color: var(--c-coral); color: #fff; }
.btn-primary:active, .btn-primary:focus, .btn-primary:focus-visible,
.btn-coral:active, .btn-coral:focus, .btn-coral:focus-visible {
    background: var(--c-coral-600); border-color: var(--c-coral-600); color: #fff;
}
.btn-ghost { --bs-btn-focus-shadow-rgb: 255, 106, 90; }
.btn-ghost { background: transparent; color: var(--c-text); border-color: var(--c-border); }
.btn-ghost:hover { background: var(--c-surface-2); color: var(--c-text); }
.btn-lg { padding: .9rem 1.6rem; font-size: 1.05rem; }
/* Coral CTA - iwoca-style brand accent for primary marketing actions */
.btn-coral { background: var(--c-coral); color: #fff; box-shadow: 0 10px 24px -12px rgba(255,106,90,.95); }
.btn-coral:hover { background: var(--c-coral-600); color: #fff; box-shadow: var(--shadow-md); }

/* Navbar */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.85); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--c-border); }
/* EN/BG language switcher - compact globe dropdown in the top-bar controls. */
.lang-switch { position: relative; }
.lang-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--c-muted); cursor: pointer; transition: color .15s ease, background .15s ease; }
.lang-btn:hover { color: var(--c-primary); background: var(--c-surface-2, rgba(0,0,0,.04)); }
.lang-btn .fa-globe { font-size: 1.05rem; }
.lang-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 156px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 11px; box-shadow: var(--shadow-md); padding: 5px; z-index: 60; }
.lang-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 7px; color: var(--c-text); font-size: .82rem; }
.lang-item .lang-code { font-weight: 700; }
.lang-item small { color: var(--c-muted); font-weight: 500; }
.lang-item:hover { background: var(--c-surface-2); }
.lang-item.is-active { color: var(--c-primary); }
.lang-item .fa-check { margin-left: auto; color: var(--c-primary); font-size: .72rem; }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.15rem; color: var(--c-text); letter-spacing: -.02em; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--c-coral), var(--c-navy)); display: grid; place-items: center; color: #fff; font-weight: 800; box-shadow: 0 6px 16px -6px rgba(255,106,90,.55); }
/* SimpleAMS wordmark (TradeSimple-style: bold first word + regular suffix) */
.brand-word { letter-spacing: -.02em; white-space: nowrap; }
.brand-word .brand-strong { font-weight: 800; }
.brand-word .brand-soft { font-weight: 400; }
.nav-left { display: flex; align-items: center; gap: 2.2rem; min-width: 0; }
.nav-links { display: flex; align-items: center; gap: 1.6rem; }
.nav-links a { color: var(--c-muted); font-weight: 500; }
.nav-links a:hover { color: var(--c-text); }
.nav-cta { display: flex; align-items: center; gap: .6rem; }
.nav-login { color: var(--c-muted); font-weight: 500; padding: 0 .4rem; }
.nav-login:hover { color: var(--c-text); }
/* Mobile hamburger + dropdown menu (shown only <=920px) */
.nav-burger { display: none; width: 40px; height: 40px; align-items: center; justify-content: center; border: 1px solid var(--c-border); background: var(--c-surface); color: var(--c-text); border-radius: 9px; font-size: 1.05rem; cursor: pointer; flex-shrink: 0; }
.nav-burger:hover { background: var(--c-surface-2); }
.nav-mobile { border-top: 1px solid var(--c-border); background: var(--c-surface); }
.nav-mobile .container { display: flex; flex-direction: column; gap: 2px; padding-top: 10px; padding-bottom: 16px; }
.nav-mobile a:not(.btn) { color: var(--c-text); font-weight: 600; padding: 11px 6px; border-radius: 8px; }
.nav-mobile a:not(.btn):hover { color: var(--c-primary); background: var(--c-surface-2); }
.nav-mobile .nav-mobile-login { color: var(--c-muted); }
.nav-mobile .btn-block { margin-top: 8px; }
@media (min-width: 921px) { .nav-mobile { display: none !important; } }

/* Hero - frosted navy gradient (decorative blobs removed) */
.hero { position: relative; padding: 112px 0 92px; overflow: hidden; color: #fff;
    background: linear-gradient(120deg, var(--c-bg-soft), var(--c-bg) 60%, var(--c-bg-deep)); }
.hero .container { position: relative; z-index: 1; }
.hero .eyebrow { color: #ff9277; }
.hero h1 { color: #fff; }
.hero h1 span { background: linear-gradient(110deg, #ff9277, var(--c-coral)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { max-width: 560px; color: #b9c2db; }
.hero-actions { display: flex; gap: .8rem; margin-top: 1.8rem; flex-wrap: wrap; }
.hero .btn-primary { box-shadow: 0 12px 30px -10px rgba(255,106,90,.85); }
.hero .btn-ghost { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.2); backdrop-filter: blur(8px); }
.hero .btn-ghost:hover { background: rgba(255,255,255,.16); color: #fff; }
.hero-trust { margin-top: 1.8rem; color: #9aa6c4; font-size: .92rem; display: flex; gap: 1.4rem; flex-wrap: wrap; }
.hero-trust b { color: #fff; }

/* Sections */
.section { padding: 72px 0; }
.section-alt { background: var(--c-surface-2); }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 48px; }

/* Feature grid */
.grid { display: grid; gap: 22px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm); transition: transform .15s ease, box-shadow .15s ease; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card .ico { width: 46px; height: 46px; border-radius: 12px; background: var(--c-primary-050); color: var(--c-primary); display: grid; place-items: center; font-size: 1.2rem; margin-bottom: 14px; }
.card p { color: var(--c-muted); margin: .35rem 0 0; }
/* Orion multi-color icon chips on the marketing feature grid */
.grid-4 .card:nth-child(4n+2) .ico { background: var(--c-coral-050); color: var(--c-coral-600); }
.grid-4 .card:nth-child(4n+3) .ico { background: var(--c-accent-050); color: var(--c-accent); }
.grid-4 .card:nth-child(4n+4) .ico { background: var(--c-warn-050); color: var(--c-warn); }

/* App dashboard - frosted navy hero */
.dash-hero { position: relative; overflow: hidden; border-radius: 24px; padding: 30px 32px; margin-bottom: 28px;
    background: linear-gradient(120deg, var(--c-bg-soft), var(--c-bg)); color: #fff; box-shadow: var(--shadow-md); }
.dash-hero h1 { position: relative; font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; margin: 0; color: #fff; }
.dash-hero p { position: relative; color: #b9c2db; margin-top: 6px; }
.dash-hero .frost { position: relative; display: inline-flex; flex-wrap: wrap; gap: 22px; margin-top: 20px; background: rgba(255,255,255,.08); backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,.14); border-radius: 16px; padding: 14px 22px; }
.dash-hero .frost .k { font-size: 1.4rem; font-weight: 800; }
.dash-hero .frost .l { font-size: .78rem; color: #b9c2db; }

/* Stat cards with colored chips + trend line */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 28px; }
.stat-card { position: relative; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); transition: transform .15s ease, box-shadow .15s ease; text-decoration: none; color: inherit; display: block; }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); color: inherit; }
.stat-card .ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.15rem; margin-bottom: 16px; background: var(--c-primary-050); color: var(--c-primary); }
.stat-card .ico.c { background: var(--c-coral-050); color: var(--c-coral-600); }
.stat-card .ico.g { background: var(--c-accent-050); color: var(--c-accent); }
.stat-card .ico.a { background: var(--c-warn-050); color: var(--c-warn); }
.stat-card .n { position: absolute; top: 22px; right: 22px; height: 46px; display: flex; align-items: center; font-size: 2rem; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.stat-card .l { color: var(--c-muted); font-size: .92rem; margin-top: 2px; }
.stat-card .trend { font-size: .78rem; font-weight: 600; margin-top: 8px; color: var(--c-muted); }
.stat-card .trend.up { color: var(--c-accent); }
.stat-card .trend.down { color: var(--c-coral-600); }

/* Table avatar */
.av { display: inline-flex; align-items: center; gap: 9px; }
.av .a { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, var(--c-coral), var(--c-navy)); color: #fff; display: grid; place-items: center; font-size: .72rem; font-weight: 700; flex-shrink: 0; }

@media (max-width: 900px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .dash-hero .frost { gap: 16px; padding: 12px 16px; }
}

/* Pricing */
.pricing { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; align-items: stretch; }
.plan { flex: 0 1 340px; max-width: 360px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 30px; display: flex; flex-direction: column; }
.plan.popular { border-color: var(--c-coral); box-shadow: 0 0 0 3px var(--c-coral-050), var(--shadow-md); position: relative; }
.plan .badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--c-coral); color: #fff; font-size: .72rem; font-weight: 700; padding: .3rem .7rem; border-radius: 999px; letter-spacing: .04em; }
.plan .price { font-size: 2.4rem; font-weight: 800; letter-spacing: -.03em; margin: .2rem 0; }
.plan .price small { font-size: .95rem; color: var(--c-muted); font-weight: 500; }
.plan ul { list-style: none; padding: 0; margin: 18px 0 24px; flex: 1; }
.plan li { padding: .42rem 0; color: var(--c-muted); display: flex; gap: .5rem; align-items: flex-start; }
.plan li::before { content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900; color: var(--c-accent); font-size: .85rem; margin-top: .2rem; }

/* Comparison table */
.compare-wrap { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.compare { width: 100%; border-collapse: collapse; font-size: .98rem; }
.compare th, .compare td { padding: 15px 20px; text-align: left; border-bottom: 1px solid var(--c-border); }
.compare thead th { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--c-muted); background: var(--c-surface-2); }
.compare tbody tr:last-child td { border-bottom: none; }
.compare td:first-child { font-weight: 600; }
.compare .col-us { text-align: center; background: var(--c-primary-050); font-weight: 600; }
.compare thead .col-us { color: var(--c-primary); background: var(--c-coral-050); }
.compare .col-them { text-align: center; color: var(--c-muted); }
.compare .c-yes { color: var(--c-accent); font-size: 1.05rem; }
.compare .c-no { color: var(--c-danger); font-size: 1.05rem; }
.compare-foot { text-align: center; color: var(--c-muted); font-size: .8rem; margin-top: 14px; }

/* Footer */
.footer { background: var(--c-bg); color: #aeb6c7; padding: 56px 0 30px; }
.footer a { color: #c8cfdd; }
.footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.footer h4 { color: #fff; font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; margin: 0 0 14px; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { padding: .3rem 0; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); margin-top: 40px; padding-top: 22px; font-size: .85rem; color: #7f8aa0; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* Auth pages */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 40px 20px; background:
    radial-gradient(800px 400px at 50% -10%, rgba(255,106,90,.12), transparent 60%), var(--c-surface-2); }
.auth-card { width: 100%; max-width: 420px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 34px; }
.auth-card h1 { font-size: 1.5rem; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.field input, .field select {
    width: 100%; padding: .72rem .85rem; border: 1px solid var(--c-border); border-radius: var(--radius-sm);
    font-size: 1rem; font-family: inherit; color: var(--c-text); background: var(--c-surface); transition: border .15s ease, box-shadow .15s ease;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-050); }
.field .err { color: var(--c-danger); font-size: .85rem; margin-top: 5px; }
.btn-block { width: 100%; justify-content: center; }

/* App shell (tenant) */
.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; transition: grid-template-columns .18s ease; }
.nav-overlay { display: none; }   /* off-canvas backdrop, only active on mobile */
.sidebar { background: linear-gradient(180deg, var(--c-bg), var(--c-bg-deep)); color: #c8cfdd; padding: 14px 12px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 30; }
.sidebar .brand { color: #fff; margin: 6px 8px 18px; flex-shrink: 0; white-space: nowrap; overflow: hidden; }
.sidebar-nav { flex: 1; overflow-y: auto; overflow-x: hidden; margin: 0 -4px; padding: 0 4px; }
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 3px; }

/* Links (shared by top links + section links) */
.sidebar-link { display: flex; align-items: center; gap: .7rem; padding: .58rem .8rem; border-radius: var(--radius-sm); color: #aeb6c7; font-weight: 500; margin-bottom: 2px; font-size: .92rem; position: relative; }
.sidebar-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-link.active { background: rgba(255,255,255,.10); color: #fff; box-shadow: none; }
.sidebar-link.active .sidebar-icon { color: var(--c-coral); }
.sidebar-link.active::before { content: ''; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--c-coral); }
.sidebar-icon { width: 20px; text-align: center; flex-shrink: 0; }

/* Accordion groups */
.sidebar-group { margin: 1px 0; position: relative; }
.sidebar-section-header { display: flex; align-items: center; gap: .7rem; width: 100%; padding: .58rem .8rem; background: none; border: none; cursor: pointer; color: #8b94a7; font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; border-radius: var(--radius-sm); font-family: inherit; }
.sidebar-section-header:hover { color: #fff; background: rgba(255,255,255,.04); }
.sidebar-section-header .sidebar-label { flex: 1; text-align: left; }
.sidebar-arrow { font-size: .62rem; opacity: .5; transition: transform .2s ease; }
.sidebar-group.open > .sidebar-section-header .sidebar-arrow { transform: rotate(90deg); }
.sidebar-group.open > .sidebar-section-header { color: #fff; }
.sidebar-section-links { max-height: 0; overflow: hidden; transition: max-height .3s cubic-bezier(.4,0,.2,1); }
.sidebar-group.open > .sidebar-section-links { max-height: 520px; }
.sidebar-section-links .sidebar-link { padding-left: 2.4rem; font-size: .88rem; }

/* Footer / compact toggle */
.sidebar-footer { flex-shrink: 0; padding-top: 8px; margin-top: 6px; border-top: 1px solid rgba(255,255,255,.07); }
.sidebar-compact-toggle { display: flex; align-items: center; gap: .7rem; width: 100%; padding: .55rem .8rem; background: none; border: none; cursor: pointer; color: #8b94a7; font-weight: 500; font-size: .85rem; border-radius: var(--radius-sm); font-family: inherit; }
.sidebar-compact-toggle:hover { color: #fff; background: rgba(255,255,255,.06); }

/* ── Compact mode (icons only + flyout from the right) ── */
.app.compact { grid-template-columns: 66px 1fr; }
/* Let the absolutely-positioned flyouts escape; avoids a stray horizontal scrollbar. */
.app.compact .sidebar-nav { overflow: visible; }
.app.compact .sidebar-label,
.app.compact .sidebar-arrow { display: none; }
.app.compact .sidebar-link,
.app.compact .sidebar-section-header,
.app.compact .sidebar-compact-toggle { justify-content: center; padding-left: 0; padding-right: 0; }
.app.compact .sidebar-icon { margin: 0; font-size: 1rem; }
.app.compact .sidebar-compact-toggle .sidebar-icon { transform: rotate(180deg); }
.app.compact .brand { text-align: center; margin-left: 0; margin-right: 0; }

/* Tooltip for top links + group headers in compact mode */
.app.compact .sidebar-nav > .sidebar-link::after,
.app.compact .sidebar-section-header::after { content: attr(data-tooltip); position: absolute; left: 60px; top: 50%; transform: translateY(-50%); background: #1e273f; color: #fff; padding: 6px 12px; border-radius: var(--radius-sm); font-size: .8rem; font-weight: 500; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .12s ease; z-index: 60; letter-spacing: normal; text-transform: none; box-shadow: var(--shadow-md); }
.app.compact .sidebar-nav > .sidebar-link:hover::after { opacity: 1; }
.app.compact .sidebar-group:hover > .sidebar-section-header::after { opacity: 0; }
.app.compact .sidebar-section-header:hover::after { opacity: 1; }

/* Flyout submenu on hover */
.app.compact .sidebar-section-links { max-height: none !important; position: absolute; left: 60px; top: 0; width: 210px; background: #1e273f; border-radius: var(--radius); padding: 8px; box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden; transition: opacity .12s ease, visibility .12s ease; z-index: 60; }
.app.compact .sidebar-group:hover > .sidebar-section-links { opacity: 1; visibility: visible; }
.app.compact .sidebar-section-links::before { content: attr(data-section-label); display: block; padding: 4px 12px 8px; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: rgba(255,255,255,.4); border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 4px; }
.app.compact .sidebar-section-links .sidebar-link { padding-left: .8rem; justify-content: flex-start; }
/* Flyout items must keep their labels even though the rail itself is icons-only. */
.app.compact .sidebar-section-links .sidebar-label { display: inline; }

.app-main { background: var(--c-surface-2); min-width: 0; }
.app-top { height: 60px; background: var(--c-surface); border-bottom: 1px solid var(--c-border); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; }
.app-content { padding: 28px 24px; }

/* Top-bar icon button (hamburger / theme toggle) */
.top-icon-btn { width: 38px; height: 38px; display: none; place-items: center; border: 1px solid var(--c-border); background: var(--c-surface); color: var(--c-text); border-radius: var(--radius-sm); cursor: pointer; font-size: 1rem; flex-shrink: 0; }
.top-icon-btn:hover { background: var(--c-surface-2); }
.theme-toggle { display: inline-grid; }
/* Theme toggle is icon-only: no border/background box, just a hover tint. */
.top-icon-btn.theme-toggle { border: 0; background: transparent; color: var(--c-muted); }
.top-icon-btn.theme-toggle:hover { background: transparent; color: var(--c-text); }
.theme-toggle .fa-sun { display: none; }
[data-theme="dark"] .theme-toggle .fa-moon { display: none; }
[data-theme="dark"] .theme-toggle .fa-sun { display: inline; }
.nav-hamburger { display: none; }

/* Account menu (company button + dropdown) in the tenant top bar */
.acct-menu { position: relative; }
.acct-menu form { margin: 0; }
.acct-trigger { display: inline-flex; align-items: center; gap: 8px; max-width: 240px; height: 38px; padding: 0 10px; border: 1px solid var(--c-border); background: var(--c-surface); color: var(--c-text); border-radius: var(--radius-sm); cursor: pointer; font-family: inherit; font-size: .9rem; font-weight: 600; }
.acct-trigger:hover { background: var(--c-surface-2); }
.acct-trigger > .fa-building { color: var(--c-muted); flex-shrink: 0; }
.acct-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-caret { font-size: .6rem; color: var(--c-muted); flex-shrink: 0; }
.acct-dropdown { position: absolute; right: 0; top: calc(100% + 8px); min-width: 232px; max-width: 280px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 6px; z-index: 60; }
.acct-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--c-border); margin-bottom: 6px; display: flex; flex-direction: column; gap: 1px; }
.acct-head strong { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-head small { color: var(--c-muted); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px; color: var(--c-text); font-size: .9rem; font-weight: 500; text-align: left; background: none; border: 0; cursor: pointer; font-family: inherit; text-decoration: none; }
.acct-item:hover { background: var(--c-surface-2); color: var(--c-text); }
.acct-item i { width: 16px; text-align: center; color: var(--c-muted); flex-shrink: 0; }
.acct-item.danger:hover { color: var(--c-danger); }
.acct-item.danger:hover i { color: var(--c-danger); }
.acct-sep { height: 1px; background: var(--c-border); margin: 6px 0; }
@media (max-width: 600px) { .acct-name { display: none; } .acct-trigger { padding: 0 9px; } }

/* App content blocks (tenant) */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 1.5rem; margin: 0; }
.alert-flash { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #e7f9f3; color: #0c9b76; border: 1px solid #b8ecdd; padding: 11px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; font-weight: 500; }
.alert-close { background: none; border: 0; color: inherit; opacity: .6; cursor: pointer; font-size: 1.25rem; line-height: 1; padding: 0 2px; transition: opacity .12s ease; }
.alert-close:hover { opacity: 1; }

.panel { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.data-table th, .data-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--c-border); }
.data-table thead th { font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--c-muted); background: var(--c-surface-2); font-weight: 700; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--c-surface-2); }
.data-table a.row-link { font-weight: 600; color: var(--c-text); }
.data-table a.row-link:hover { color: var(--c-primary); }
.data-table .muted { color: var(--c-muted); }
.table-actions { display: flex; gap: 8px; justify-content: flex-end; }
.icon-btn { width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 8px; border: 1px solid var(--c-border); color: var(--c-muted); background: var(--c-surface); cursor: pointer; }
.icon-btn:hover { color: var(--c-text); background: var(--c-surface-2); }
.icon-btn.danger:hover { color: var(--c-danger); border-color: var(--c-danger); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--c-muted); }
.empty-state .ico { width: 56px; height: 56px; border-radius: 14px; background: var(--c-primary-050); color: var(--c-primary); display: grid; place-items: center; font-size: 1.4rem; margin: 0 auto 16px; }

/* Filters bar */
.filters { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.filters input, .filters select { padding: .55rem .75rem; border: 1px solid var(--c-border); border-radius: var(--radius-sm); font-family: inherit; font-size: .94rem; color: var(--c-text); background: var(--c-surface); }
.filters input:focus, .filters select:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-050); }

/* Forms */
.form-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 26px; max-width: 760px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; margin-top: 22px; }
textarea.field-input { min-height: 90px; resize: vertical; }
.field-input { width: 100%; padding: .68rem .8rem; border: 1px solid var(--c-border); border-radius: var(--radius-sm); font-size: 1rem; font-family: inherit; color: var(--c-text); background: var(--c-surface); }
.field-input:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-050); }

/* Detail view */
.detail-grid { display: grid; grid-template-columns: 1fr 320px; gap: 22px; align-items: stretch; }
.dl { display: grid; grid-template-columns: 180px 1fr; gap: 0; }
.dl dt { padding: 11px 0; color: var(--c-muted); border-bottom: 1px solid var(--c-border); }
.dl dd { padding: 11px 0; margin: 0; font-weight: 500; border-bottom: 1px solid var(--c-border); }
.qr-card { text-align: center; }
.qr-card img, .qr-card svg { width: 180px; height: 180px; }

@media (max-width: 720px) {
    .form-grid { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .dl { grid-template-columns: 130px 1fr; }
}

.badge-pill { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .6rem; border-radius: 999px; font-size: .76rem; font-weight: 600; white-space: nowrap; }
.badge-success { background: #e7f9f3; color: #0c9b76; }
.badge-warn { background: #fff5e0; color: #b07d0a; }
.badge-muted { background: #eef1f6; color: var(--c-muted); }
.badge-danger { background: #fdecef; color: var(--c-danger); }

@media (max-width: 920px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3, .pricing { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .nav-links { display: none; }
    .nav-login { display: none; }
    .nav-cta-desktop { display: none; }   /* moved into the burger menu */
    .nav-burger { display: inline-flex; }

    /* Off-canvas sidebar */
    .app { grid-template-columns: 1fr; }
    .app .sidebar { position: fixed; top: 0; left: 0; z-index: 80; width: 250px; height: 100vh; transform: translateX(-100%); transition: transform .25s cubic-bezier(.4,0,.2,1); }
    .app.nav-open .sidebar { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .app.compact .sidebar { width: 250px; }   /* ignore compact on mobile */
    .app.compact { grid-template-columns: 1fr; }
    .nav-overlay { display: block; position: fixed; inset: 0; background: rgba(7,13,32,.5); backdrop-filter: blur(2px); z-index: 70; opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s ease; }
    .app.nav-open .nav-overlay { opacity: 1; visibility: visible; }
    .nav-hamburger { display: inline-grid !important; }
    .sidebar-footer { display: none; }   /* compact toggle pointless on mobile */
}

/* ─────────── Dark mode ─────────── */
[data-theme="dark"] {
    --c-surface: #131c34;
    --c-surface-2: #0c1428;
    --c-border: #25324d;
    --c-text: #e7ebf4;
    --c-muted: #97a2bb;
    --c-primary-050: #38201d;
    --c-accent-050: #10322a;
    --c-coral-050: #38201d;
    --c-warn-050: #322713;
    --c-danger-050: #371e26;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4), 0 1px 3px rgba(0,0,0,.4);
    --shadow-md: 0 10px 30px -10px rgba(0,0,0,.6);
    --shadow-lg: 0 24px 60px -12px rgba(0,0,0,.7);
}
[data-theme="dark"] body { background: var(--c-surface); }
[data-theme="dark"] .nav { background: rgba(12,20,40,.85); border-bottom-color: var(--c-border); }
[data-theme="dark"] .btn-ghost { color: var(--c-text); }
[data-theme="dark"] .field input:focus, [data-theme="dark"] .field select:focus,
[data-theme="dark"] .field-input:focus, [data-theme="dark"] .filters input:focus, [data-theme="dark"] .filters select:focus { box-shadow: 0 0 0 3px rgba(255,106,90,.35); }
[data-theme="dark"] .alert-flash { background: #11302a; color: #5fe0b8; border-color: #1d5546; }
[data-theme="dark"] .badge-success { background: #11302a; color: #4fd6ac; }
[data-theme="dark"] .badge-warn { background: #322713; color: #f3c265; }
[data-theme="dark"] .badge-muted { background: #1d2740; color: var(--c-muted); }
[data-theme="dark"] .badge-danger { background: #371e26; color: #f48ca0; }
[data-theme="dark"] .compare thead .col-us { background: #38201d; }
/* Bootstrap FAQ accordion in dark */
[data-theme="dark"] .accordion { --bs-accordion-bg: var(--c-surface); --bs-accordion-color: var(--c-text); --bs-accordion-border-color: var(--c-border); --bs-accordion-btn-color: var(--c-text); --bs-accordion-btn-bg: var(--c-surface); --bs-accordion-active-bg: var(--c-primary-050); --bs-accordion-active-color: var(--c-text); --bs-accordion-btn-focus-box-shadow: 0 0 0 3px rgba(255,106,90,.35); }
[data-theme="dark"] .accordion-button::after { filter: invert(1) brightness(1.6); }

/* ─────────── AI assistant chat ─────────── */
[x-cloak] { display: none !important; }
.ai-chat { display: flex; flex-direction: column; height: calc(100vh - 160px); min-height: 460px; }
.ai-chat-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--c-border); font-weight: 700; gap: 12px; flex-wrap: wrap; }
.ai-allow { display: inline-flex; align-items: center; gap: 7px; font-size: .85rem; font-weight: 600; color: var(--c-muted); cursor: pointer; }
.ai-allow input { width: auto; }
.ai-messages { flex: 1; overflow-y: auto; padding: 22px 18px; display: flex; flex-direction: column; gap: 16px; }
.ai-msg { display: flex; gap: 12px; align-items: flex-start; max-width: 760px; }
.ai-msg.user { flex-direction: row-reverse; margin-left: auto; }
.ai-avatar { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: .68rem; font-weight: 800; flex-shrink: 0; color: #fff; }
.ai-msg.assistant .ai-avatar { background: linear-gradient(135deg, var(--c-coral), var(--c-navy)); }
.ai-msg.user .ai-avatar { background: var(--c-surface-2); color: var(--c-muted); border: 1px solid var(--c-border); }
.ai-bubble { padding: 11px 15px; border-radius: 14px; line-height: 1.55; font-size: .95rem; }
.ai-msg.assistant .ai-bubble { background: var(--c-surface-2); border: 1px solid var(--c-border); border-top-left-radius: 4px; }
.ai-msg.user .ai-bubble { background: var(--c-primary); color: #fff; border-top-right-radius: 4px; }
.ai-bubble code { background: rgba(125,135,160,.18); padding: .1rem .35rem; border-radius: 5px; font-size: .88em; }
.ai-bubble.ai-error { background: var(--c-danger-050); border-color: var(--c-danger); color: var(--c-danger); }
.ai-empty { margin: auto; text-align: center; color: var(--c-muted); max-width: 520px; }
.ai-empty-ico { width: 58px; height: 58px; border-radius: 16px; margin: 0 auto 14px; display: grid; place-items: center; font-size: 1.5rem; background: var(--c-primary-050); color: var(--c-primary); }
.ai-suggestions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }
.ai-chip { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 999px; padding: .5rem .9rem; font-size: .85rem; color: var(--c-text); cursor: pointer; font-family: inherit; transition: border .15s ease, color .15s ease; }
.ai-chip:hover { border-color: var(--c-primary); color: var(--c-primary); }
.ai-input { display: flex; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--c-border); }
.ai-input input { flex: 1; padding: .7rem .9rem; border: 1px solid var(--c-border); border-radius: var(--radius-sm); font-family: inherit; font-size: .95rem; color: var(--c-text); background: var(--c-surface); }
.ai-input input:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-050); }
.ai-dots { display: inline-flex; gap: 4px; }
.ai-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--c-muted); opacity: .4; animation: ai-blink 1.2s infinite; }
.ai-dots span:nth-child(2) { animation-delay: .2s; }
.ai-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes ai-blink { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }

/* Notification settings rows */
.notif-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 2px; border-top: 1px solid var(--c-border); cursor: pointer; }
.notif-row input { width: auto; margin-top: 3px; flex-shrink: 0; }
.notif-row span { display: flex; flex-direction: column; gap: 2px; }
.notif-row small { color: var(--c-muted); font-size: .85rem; }

/* Floating bulk-action bar (modern pill, doesn't push layout) */
.bulk-bar { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 70;
    display: flex; align-items: center; gap: 12px; flex-wrap: nowrap; justify-content: center;
    background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 16px;
    padding: 10px 12px; box-shadow: var(--shadow-lg); max-width: calc(100vw - 40px); }
.bulk-count { font-size: .9rem; font-weight: 600; white-space: nowrap; padding-left: 6px; }
.bulk-count b { color: var(--c-coral-600); font-weight: 800; }
.bulk-divider { width: 1px; align-self: stretch; background: var(--c-border); }
.bulk-form { display: flex; gap: 8px; align-items: center; flex-wrap: nowrap; }
.bulk-bar .field-input { padding: .45rem .6rem; font-size: .9rem; width: auto; }
.bulk-bar .btn-primary { padding: .45rem 1rem; }
.bulk-icon { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 10px;
    border: 1px solid var(--c-border); background: var(--c-surface); color: var(--c-muted); cursor: pointer; }
.bulk-icon:hover { color: var(--c-text); background: var(--c-surface-2); }
.bulk-close:hover { color: var(--c-danger); border-color: var(--c-danger); }
/* entrance animation */
.bulk-enter { transition: opacity .18s ease, transform .18s ease; }
.bulk-enter-start { opacity: 0; transform: translateX(-50%) translateY(12px); }
.bulk-enter-end { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (max-width: 720px) { .bulk-bar { left: 12px; right: 12px; transform: none; bottom: 12px; flex-wrap: wrap; } .bulk-form { flex-wrap: wrap; } .bulk-enter-start { transform: translateY(12px); } .bulk-enter-end { transform: translateY(0); } }

/* Sidebar brand logo (company-uploaded) + version footer */
.brand-logo { max-height: 32px; max-width: 160px; object-fit: contain; display: block; }
.app.compact .brand-logo { max-height: 28px; max-width: 44px; }
.sidebar-version { font-size: .72rem; color: #67708a; padding: 8px 6px 2px; text-align: center; line-height: 1.3; }
.sidebar-version span { display: inline-block; opacity: .8; }

/* Logo upload preview (neutral, not navy) */
.logo-preview { width: 120px; height: 48px; border: 1px solid var(--c-border); border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--c-surface-2); overflow: hidden; flex-shrink: 0; }
.logo-preview img { max-height: 38px; max-width: 108px; object-fit: contain; }
.logo-preview span { color: var(--c-muted); font-size: .8rem; }

/* Mobile: wide tables scroll horizontally instead of cramming; trim the top bar */
@media (max-width: 700px) {
    .panel { overflow-x: auto; }
    .data-table, .compare { min-width: 560px; }
    /* Let the comparison table scroll instead of being clipped by overflow:hidden */
    .compare-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
@media (max-width: 600px) {
    .app-top { padding: 0 12px; gap: 8px; }
    .app-top .badge-pill { display: none; }   /* company is shown in the sidebar brand */
    .app-content { padding: 20px 14px; }
    .page-head h1 { font-size: 1.25rem; }
}

/* Custom (non-native) select dropdown */
/* Anti-FOUC: when JS is on, hide native selects until ui-select.js enhances them so
   the OS dropdown never flashes. <select> with display:none (enhanced) is unaffected;
   if the script fails to load the .js class is removed (see layout head) and natives show. */
html.js select:not([data-enhanced]):not([multiple]):not([data-no-enhance]) { visibility: hidden; }
.ui-select { position: relative; }
.ui-select-trigger { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: .68rem .8rem; border: 1px solid var(--c-border); border-radius: var(--radius-sm); background: var(--c-surface); color: var(--c-text); font-size: 1rem; font-family: inherit; cursor: pointer; text-align: left; transition: border-color .12s ease, box-shadow .12s ease; }
.ui-select-trigger:hover { border-color: var(--c-muted); }
.ui-select-trigger:focus-visible { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-050); }
.ui-select-caret { font-size: .7rem; color: var(--c-muted); transition: transform .15s ease; flex-shrink: 0; }
.ui-select-caret.open { transform: rotate(180deg); }
.ui-select-menu { position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; right: 0; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 6px; max-height: 280px; overflow-y: auto; }
.ui-select-option { display: block; width: 100%; text-align: left; padding: .55rem .7rem; border: none; background: none; border-radius: 8px; cursor: pointer; font-size: .95rem; color: var(--c-text); font-family: inherit; }
.ui-select-option:hover { background: var(--c-surface-2); }
.ui-select-option.selected { background: var(--c-primary-050); color: var(--c-primary); font-weight: 600; }

/* Reusable styled tooltip: add class "tip" + data-tip="..." (shows below, on hover/focus) */
.tip { position: relative; }
.tip::after { content: attr(data-tip); position: absolute; top: calc(100% + 9px); left: 50%; transform: translateX(-50%) translateY(4px); background: var(--c-bg-soft); color: #fff; padding: 8px 12px; border-radius: 10px; font-size: .78rem; font-weight: 500; line-height: 1.45; width: max-content; max-width: 230px; white-space: normal; text-align: center; box-shadow: var(--shadow-md); opacity: 0; visibility: hidden; transition: opacity .15s ease, transform .15s ease, visibility .15s ease; z-index: 90; pointer-events: none; }
.tip::before { content: ''; position: absolute; top: calc(100% + 3px); left: 50%; transform: translateX(-50%); border: 6px solid transparent; border-bottom-color: var(--c-bg-soft); opacity: 0; visibility: hidden; transition: opacity .15s ease; z-index: 90; pointer-events: none; }
.tip:hover::after, .tip:focus-visible::after, .tip:focus-within::after { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.tip:hover::before, .tip:focus-visible::before, .tip:focus-within::before { opacity: 1; visibility: visible; }

/* ============================================================
   Platform back-office (/bss) + shared bits
   ============================================================ */
.btn-danger { background: var(--c-danger); color: #fff; border-color: var(--c-danger); }
.btn-danger:hover { filter: brightness(.95); color: #fff; }

.kv-table { width: 100%; border-collapse: collapse; }
.kv-table th, .kv-table td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--c-border); font-size: .92rem; vertical-align: top; }
.kv-table tr:last-child th, .kv-table tr:last-child td { border-bottom: 0; }
.kv-table th { color: var(--c-muted); font-weight: 600; width: 42%; }

.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--c-border); }
.panel-head h2 { font-size: 1.02rem; margin: 0; }
.panel > .kv-table, .panel > .data-table { margin: 0; }
.panel > .empty-state { padding: 40px 20px; }

.bss-shell { min-height: 100vh; background: var(--c-surface-2); }
.bss-top { display: flex; align-items: center; gap: 26px; padding: 0 22px; height: 62px; background: var(--c-navy); color: #fff; position: sticky; top: 0; z-index: 30; }
.bss-brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; white-space: nowrap; }
.bss-brand small { font-weight: 700; opacity: .6; font-size: .7rem; letter-spacing: .12em; }
.bss-nav { display: flex; gap: 4px; margin-right: auto; }
.bss-nav a { color: rgba(255,255,255,.72); text-decoration: none; font-weight: 600; font-size: .92rem; padding: .5rem .85rem; border-radius: 10px; }
.bss-nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.bss-nav a.active { color: #fff; background: rgba(255,255,255,.14); }
.bss-top-right { display: flex; align-items: center; gap: 14px; }
.bss-who { font-size: .86rem; opacity: .8; white-space: nowrap; }
.bss-top .btn-ghost { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.18); color: #fff; }
.bss-top .btn-ghost:hover { background: rgba(255,255,255,.18); color: #fff; }

.bss-main { max-width: 1080px; margin: 0 auto; padding: 28px 22px 60px; }
.bss-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.bss-head h1 { margin: 0; font-size: 1.5rem; }
.bss-count { color: var(--c-muted); font-weight: 600; font-size: 1rem; }
.bss-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.bss-back { color: var(--c-muted); text-decoration: none; font-size: .86rem; font-weight: 600; }
.bss-back:hover { color: var(--c-primary); }
.bss-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.bss-plan-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-bottom: 1px solid var(--c-border); }
.bss-plan-row:last-child { border-bottom: 0; }

/* Impersonation banner (shown inside the tenant app during support sessions) */
.impersonate-bar { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; background: var(--c-warn-050, #fff7e6); border: 1px solid var(--c-warn, #f0a020); color: #7a5200; padding: 9px 16px; border-radius: 12px; margin-bottom: 16px; font-size: .9rem; font-weight: 600; }
.impersonate-bar form { margin: 0; }
.impersonate-bar .btn { padding: .35rem .7rem; }

@media (max-width: 760px) {
    .bss-cols { grid-template-columns: 1fr; }
    .bss-top { gap: 14px; padding: 0 14px; }
    .bss-who { display: none; }
    .bss-nav a { padding: .5rem .6rem; }
}

/* /bss team - inline password change popover (static block, no clipping) */
.bss-pw { position: relative; }
.bss-pw > summary { list-style: none; cursor: pointer; }
.bss-pw > summary::-webkit-details-marker { display: none; }
.bss-pop { margin-top: 10px; padding: 14px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-sm); box-shadow: var(--shadow-md); width: 230px; }
.bss-pop-label { display: block; font-size: .82rem; color: var(--c-muted); font-weight: 600; margin-bottom: 6px; }
.bss-pop .field-input { margin-bottom: 8px; }
.icon-btn.danger { color: var(--c-danger); }

/* /bss team - "Add operator" button reveals a popover form (no JS, <details>) */
.bss-add { position: relative; }
.bss-add > summary { list-style: none; cursor: pointer; }
.bss-add > summary::-webkit-details-marker { display: none; }
.bss-add[open] > summary { background: var(--c-coral-600); }
.bss-add-panel { position: absolute; top: calc(100% + 10px); right: 0; z-index: 40; width: min(360px, calc(100vw - 40px)); padding: 18px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
@media (max-width: 760px) {
    .bss-add { position: static; }
    .bss-add-panel { left: 16px; right: 16px; width: auto; }
}

/* AI chat history sidebar */
.ai-layout { display: grid; grid-template-columns: 248px 1fr; gap: 16px; align-items: start; }
.ai-history { display: flex; flex-direction: column; max-height: 74vh; padding: 0; }
.ai-history-head { padding: 12px; }
.ai-history-body { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.ai-history-toggle { display: none; }
.ai-history-list { flex: 1; overflow-y: auto; padding: 0 8px 8px; min-height: 40px; }
.ai-history-empty { color: var(--c-muted); font-size: .84rem; text-align: center; padding: 14px 8px; }
.ai-history-item { display: flex; align-items: stretch; border-radius: 10px; }
.ai-history-item:hover { background: var(--c-surface-2); }
.ai-history-item.active { background: var(--c-primary-050); }
.ai-history-open { flex: 1; text-align: left; background: none; border: none; cursor: pointer; padding: 8px 10px; min-width: 0; font-family: inherit; }
.ai-history-title { display: block; font-size: .86rem; font-weight: 600; color: var(--c-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-history-when { display: block; font-size: .73rem; color: var(--c-muted); margin-top: 1px; }
.ai-history-del { background: none; border: none; color: var(--c-muted); cursor: pointer; padding: 0 10px; opacity: 0; transition: opacity .12s ease; }
.ai-history-item:hover .ai-history-del, .ai-history-item.active .ai-history-del { opacity: 1; }
.ai-history-del:hover { color: var(--c-danger); }
.ai-history-foot { padding: 10px 12px 12px; }
@media (max-width: 820px) {
    .ai-layout { grid-template-columns: 1fr; }
    .ai-history { max-height: none; }
    /* Collapse the history into a toggle on mobile - chat gets the screen. */
    .ai-history-toggle { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; margin-top: 8px; background: var(--c-surface-2); border: 1px solid var(--c-border); border-radius: var(--radius-sm); padding: .6rem .8rem; font-weight: 600; font-size: .9rem; color: var(--c-text); cursor: pointer; font-family: inherit; }
    .ai-history-caret { color: var(--c-muted); transition: transform .2s ease; }
    .ai-history.open .ai-history-caret { transform: rotate(180deg); }
    .ai-history-body { max-height: 0; overflow: hidden; transition: max-height .25s ease; }
    .ai-history.open .ai-history-body { max-height: 60vh; overflow-y: auto; }
    .ai-history-del { opacity: 1; }   /* no hover on touch */
}

/* "Powered by Simple AMS" footer under the tenant login card */
.auth-powered { text-align: center; margin: 18px 0 0; color: var(--c-muted); font-size: .8rem; letter-spacing: .01em; }
.auth-powered a { color: var(--c-muted); font-weight: 700; text-decoration: none; border-bottom: 1px solid transparent; transition: color .15s ease, border-color .15s ease; }
.auth-powered a:hover { color: var(--c-primary); border-bottom-color: var(--c-primary); }

/* Reusable styled confirm/modal dialog (replaces native confirm) */
[x-cloak] { display: none !important; }
.modal-backdrop { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 20px; background: rgba(12,18,38,.45); backdrop-filter: blur(2px); }
.modal-card { width: 100%; max-width: 380px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 26px; text-align: center; }
.modal-icon { width: 52px; height: 52px; border-radius: 14px; margin: 0 auto 14px; display: grid; place-items: center; font-size: 1.3rem; background: var(--c-danger-050); color: var(--c-danger); }
.modal-msg { margin: 0 0 20px; color: var(--c-text); font-size: .98rem; line-height: 1.5; }
.modal-actions { display: flex; gap: 10px; justify-content: center; }
.modal-actions .btn { min-width: 120px; justify-content: center; }

/* Tenant login - centered header + brand */
.auth-head { text-align: center; margin-bottom: 24px; }
.auth-brand { margin-bottom: 16px; }
.auth-brand img { max-height: 48px; max-width: 220px; object-fit: contain; }
.auth-brand-mark { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: linear-gradient(135deg, var(--c-coral), var(--c-navy)); color: #fff; font-weight: 800; font-size: 1.5rem; box-shadow: 0 10px 24px -8px rgba(255,106,90,.6); }
.auth-head h1 { font-size: 1.55rem; margin: 0 0 4px; }
.auth-sub { color: var(--c-muted); font-size: .94rem; margin: 0; }
/* "Powered by" now sits inside the card, under the form, with a subtle divider */
.auth-powered { text-align: center; margin: 22px 0 0; padding-top: 16px; border-top: 1px solid var(--c-border); color: var(--c-muted); font-size: .78rem; letter-spacing: .02em; }
.auth-powered a { color: var(--c-muted); font-weight: 700; text-decoration: none; border-bottom: 1px solid transparent; transition: color .15s ease, border-color .15s ease; }
.auth-powered a:hover { color: var(--c-primary); border-bottom-color: var(--c-primary); }

/* Centered narrow page container (settings-style pages) */
.page-narrow { max-width: 760px; margin: 0 auto; }

/* AI assistant - grouped starter prompts */
.ai-prompts { max-width: 600px; margin: 20px auto 0; display: flex; flex-direction: column; gap: 16px; }
.ai-prompt-group { text-align: left; }
.ai-prompt-title { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--c-muted); margin-bottom: 8px; display: flex; align-items: center; gap: 7px; }
.ai-prompt-title i { color: var(--c-primary); }
.ai-prompts .ai-suggestions { margin-top: 0; justify-content: flex-start; }

/* ── Legal pages ───────────────────────────────────────────── */
.container-narrow { max-width: 800px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 24px); }
.legal-wrap { padding: clamp(40px, 6vw, 72px) 0 96px; }
.legal-eyebrow { font-size: .82rem; color: var(--c-muted); margin: 0 0 8px; }
.legal-eyebrow a { color: var(--c-primary); text-decoration: none; }
.legal-title { font-size: clamp(28px, 4vw, 40px); font-weight: 800; letter-spacing: -.02em; color: var(--c-text); margin: 0 0 6px; }
.legal-updated { font-size: .9rem; color: var(--c-muted); margin: 0 0 36px; }
.legal-content { color: var(--c-text); }
.legal-content h2 { font-size: 1.4rem; font-weight: 700; letter-spacing: -.01em; margin: 40px 0 14px; }
.legal-content h3 { font-size: 1.08rem; font-weight: 600; margin: 26px 0 10px; }
.legal-content p, .legal-content li { font-size: 1rem; line-height: 1.8; color: var(--c-text); }
.legal-content p { margin: 0 0 16px; }
.legal-content ul, .legal-content ol { padding-left: 24px; margin: 0 0 16px; }
.legal-content li { margin-bottom: 6px; }
.legal-content a { color: var(--c-primary); text-decoration: underline; text-underline-offset: 2px; }
.legal-content strong { font-weight: 600; }
.legal-foot-links { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--c-border); }
.legal-foot-links a { font-size: .9rem; color: var(--c-muted); text-decoration: none; }
.legal-foot-links a.active, .legal-foot-links a:hover { color: var(--c-primary); }

/* ── Cookie consent ────────────────────────────────────────── */
.cookie-banner { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 1080; max-width: 640px; margin: 0 auto;
    background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.28); padding: 16px; }
.cookie-banner-text { margin: 0 0 12px; font-size: .9rem; line-height: 1.55; color: var(--c-text); }
.cookie-banner-text a { color: var(--c-primary); }
.cookie-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cookie-actions-end { justify-content: flex-end; margin-top: 22px; }
.cookie-modal-overlay { position: fixed; inset: 0; z-index: 1090; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; padding: 16px; }
.cookie-modal { width: 100%; max-width: 520px; max-height: 86vh; overflow-y: auto; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 16px; padding: 24px; box-shadow: 0 24px 64px rgba(0,0,0,.4); }
.cookie-modal-title { margin: 0 0 6px; font-size: 1.25rem; font-weight: 700; color: var(--c-text); }
.cookie-modal-sub { margin: 0 0 14px; font-size: .9rem; color: var(--c-muted); line-height: 1.55; }
.cookie-modal-sub a { color: var(--c-primary); }
.cookie-cat { display: flex; align-items: flex-start; gap: 16px; padding: 14px 0; border-top: 1px solid var(--c-border); }
.cookie-cat-info { flex: 1; }
.cookie-cat-title { font-size: .95rem; font-weight: 600; color: var(--c-text); margin-bottom: 4px; }
.cookie-cat-desc { margin: 0; font-size: .82rem; color: var(--c-muted); line-height: 1.5; }
.cookie-switch { flex: 0 0 auto; width: 44px; height: 24px; border-radius: 999px; background: var(--c-surface-2); border: 1px solid var(--c-border); cursor: pointer; padding: 0; position: relative; }
.cookie-switch > span { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--c-muted); transition: left .16s ease, background .16s ease; }
.cookie-switch.is-on { background: var(--c-primary); border-color: var(--c-primary); }
.cookie-switch.is-on > span { left: 22px; background: #fff; }
.cookie-switch.is-locked { opacity: .65; cursor: not-allowed; }

/* ── BSS legal editor ──────────────────────────────────────── */
.bss-page-head { margin-bottom: 1.25rem; }
.bss-page-head h1 { font-size: 1.4rem; margin: 0 0 .25rem; }
.panel-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 1rem; }
.form-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: .75rem; }
.form-grid-2 label, form .panel > label { display: block; font-size: .85rem; font-weight: 600; color: var(--c-text); margin-bottom: .75rem; }
.form-grid-2 label .field-input, form .panel > label .field-input { margin-top: .3rem; font-weight: 400; }
.check-row { display: flex; align-items: center; gap: .55rem; font-size: .9rem; }
.check-row input { width: auto; }
textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; line-height: 1.5; width: 100%; }
.legal-editor-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: .5rem; font-size: .85rem; }
.legal-editor-meta a { color: var(--c-primary); text-decoration: none; }
.bss-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 1rem; border-bottom: 1px solid var(--c-border); }
.bss-tab { background: none; border: none; border-bottom: 2px solid transparent; padding: .5rem .8rem; font-size: .9rem; font-weight: 600; color: var(--c-muted); cursor: pointer; }
.bss-tab.active { color: var(--c-primary); border-bottom-color: var(--c-primary); }
.btn-sm { padding: .4rem .8rem; font-size: .85rem; }
.alert-error { background: var(--c-danger-050); color: var(--c-danger); }
@media (max-width: 640px) { .form-grid-2 { grid-template-columns: 1fr; } }

/* ── BSS email templates ───────────────────────────────────── */
.email-admin { display: grid; gap: 16px; align-items: start; grid-template-columns: 210px minmax(0,1.3fr) minmax(0,1fr); grid-template-areas: "list editor preview"; }
.email-admin > .email-list { grid-area: list; }
.email-admin > .email-editor { grid-area: editor; }
.email-admin > .email-preview { grid-area: preview; }
.email-list { padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.email-list-group { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--c-muted); padding: 8px 8px 4px; }
.email-list-item { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 9px 12px; border-radius: 8px; text-decoration: none; color: var(--c-text); border: 1px solid transparent; }
.email-list-item span { font-size: .88rem; font-weight: 600; line-height: 1.3; }
.email-list-item:hover { background: var(--c-surface-2); }
.email-list-item.active { background: var(--c-primary-050); border-color: var(--c-primary); color: var(--c-primary); }
.email-list-item small { font-size: .64rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.email-list-item small.on { color: var(--c-accent); }
.email-list-item small.off { color: var(--c-warn); }
.email-new { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--c-border); }
.email-editor-head { margin-bottom: 1rem; }
.email-editor-head .muted { font-size: .85rem; margin: .35rem 0; }
.email-key { font-size: .72rem; color: var(--c-muted); background: var(--c-surface-2); padding: 1px 6px; border-radius: 4px; }
.email-vars { font-size: .8rem; color: var(--c-muted); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.email-vars code { background: var(--c-surface-2); padding: 2px 7px; border-radius: 5px; font-size: .76rem; }
.email-field { display: block; font-size: .85rem; font-weight: 600; color: var(--c-text); margin-bottom: .75rem; }
.email-field .field-input { margin-top: .3rem; font-weight: 400; }
.email-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin: 1rem 0; padding-top: 1rem; border-top: 1px solid var(--c-border); }
.email-actions form { margin: 0; }
.email-send-block { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--c-border); }
.email-send-block h3 { font-size: .9rem; margin: 0 0 .25rem; }
.email-send-block .muted { font-size: .8rem; margin: 0 0 .5rem; }
.email-preview { position: sticky; top: 14px; }
.email-preview-head { font-size: .95rem; font-weight: 700; }
.email-preview-subject { font-size: .82rem; color: var(--c-text); background: var(--c-surface-2); padding: 6px 8px; border-radius: 6px; margin: 8px 0; }
.email-preview-frame { width: 100%; height: 640px; background: #fff; border: 1px solid var(--c-border); border-radius: 8px; }
@media (max-width: 1280px) { .email-admin { grid-template-columns: 210px minmax(0,1fr); grid-template-areas: "list editor" "list preview"; } .email-preview { position: static; } }
@media (max-width: 820px) { .email-admin { grid-template-columns: 1fr; grid-template-areas: "list" "editor" "preview"; } }

/* ── BSS health ────────────────────────────────────────────── */
.health-banner { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-radius: 12px; font-weight: 700; margin-bottom: 1.25rem; }
.health-banner.ok { background: var(--c-primary-050); color: var(--c-primary); }
.health-banner.bad { background: var(--c-danger-050); color: var(--c-danger); }
.health-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.health-card { border: 1px solid var(--c-border); border-radius: 12px; padding: 14px 16px; background: var(--c-surface); }
.health-card-top { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.health-card.ok .health-card-top i { color: var(--c-primary); }
.health-card.bad { border-color: var(--c-danger); }
.health-card.bad .health-card-top i { color: var(--c-danger); }
.health-card-detail { font-size: .82rem; color: var(--c-muted); margin-top: 6px; word-break: break-word; }
.health-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.health-stat { border: 1px solid var(--c-border); border-radius: 12px; padding: 14px 16px; background: var(--c-surface); display: flex; flex-direction: column; gap: 4px; }
.health-stat .num { font-size: 1.6rem; font-weight: 800; color: var(--c-text); line-height: 1; }
.health-stat .lbl { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--c-muted); }
.health-table { width: 100%; border-collapse: collapse; }
.health-table th { text-align: left; font-size: .85rem; color: var(--c-muted); font-weight: 600; padding: 8px 0; width: 180px; vertical-align: top; }
.health-table td { font-size: .9rem; color: var(--c-text); padding: 8px 0; }

/* ── Modern FAQ (iwoca-style 2-col accordion) ──────────────── */
.faq-modern { position: relative; max-width: 1060px; margin: 0 auto; padding: clamp(28px, 4vw, 52px) clamp(20px, 4vw, 56px); background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 28px; overflow: hidden; }
.faq-bg-shape { position: absolute; top: -120px; right: -120px; width: 360px; height: 360px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, var(--c-coral-050), transparent 70%); pointer-events: none; z-index: 0; }
.faq-modern .section-head, .faq-modern .faq-grid { position: relative; z-index: 1; }
.faq-modern .section-head { text-align: center; margin-bottom: clamp(24px, 3vw, 40px); }
.faq-intro { max-width: 620px; margin: .75rem auto 0; color: var(--c-muted); font-size: .98rem; line-height: 1.6; }
.faq-intro a { color: var(--c-primary); }
.faq-grid { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: start; max-width: 760px; margin: 0 auto; }
.faq-card { background: var(--c-surface-2); border: 1px solid var(--c-border); border-radius: 16px; transition: border-color .2s ease, background .2s ease, box-shadow .2s ease; }
.faq-card.open { border-color: var(--c-primary); background: var(--c-surface); box-shadow: var(--shadow-md); }
.faq-q { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; background: none; border: 0; cursor: pointer; text-align: left; color: var(--c-text); }
.faq-q-text { font-size: 1.02rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.4; }
.faq-icon { position: relative; width: 24px; height: 24px; flex: 0 0 auto; }
.faq-icon::before, .faq-icon::after { content: ''; position: absolute; top: 50%; left: 50%; width: 13px; height: 2px; border-radius: 2px; background: var(--c-primary); transform: translate(-50%, -50%); transition: transform .3s ease; }
.faq-icon::after { transform: translate(-50%, -50%) rotate(90deg); }
.faq-card.open .faq-icon::before { transform: translate(-50%, -50%) rotate(45deg); }
.faq-card.open .faq-icon::after { transform: translate(-50%, -50%) rotate(-45deg); }
.faq-a { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .32s ease; }
.faq-card.open .faq-a { grid-template-rows: 1fr; }
.faq-a-inner { overflow: hidden; }
.faq-a-inner p { margin: 0; padding: 0 20px 20px; color: var(--c-muted); font-size: .96rem; line-height: 1.7; }
@media (max-width: 760px) { .faq-grid { grid-template-columns: 1fr; } .faq-modern { border-radius: 20px; } }

/* ── BSS legal language switch ─────────────────────────────── */
/* (old EN|BG pill switcher styles removed - replaced by the globe dropdown above) */

/* ── BSS billing (Stripe) ──────────────────────────────────── */
.bill-plan { display: flex; align-items: flex-end; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--c-border); }
.bill-plan-name { flex: 0 0 110px; font-weight: 700; color: var(--c-text); padding-bottom: .6rem; }
.bill-step { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--c-border); border-radius: 12px; background: var(--c-surface-2); margin-top: 12px; }
.bill-step-num { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 999px; background: var(--c-primary-050); color: var(--c-primary); font-size: .82rem; font-weight: 800; display: flex; align-items: center; justify-content: center; align-self: flex-start; }
.bill-step-body { flex: 1; min-width: 0; }
.bill-step-title { font-weight: 600; color: var(--c-text); margin-bottom: 3px; }
.bill-step-body .muted { margin: 0; font-size: .82rem; line-height: 1.5; }
.bill-step .btn { flex: 0 0 auto; white-space: nowrap; }
.bill-ids { margin-top: 1rem; }
.bill-ids summary { cursor: pointer; font-size: .85rem; }
.bill-ids code { font-size: .76rem; background: var(--c-surface-2); padding: 1px 5px; border-radius: 4px; word-break: break-all; }
.bill-id-table th { width: 120px; vertical-align: top; }
.bill-id-table tr + tr th, .bill-id-table tr + tr td { border-top: 1px solid var(--c-border); }
.bill-id-row { display: flex; gap: .55rem; align-items: baseline; padding: 2px 0; }
.bill-id-row .muted { flex: 0 0 56px; font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; }
.bill-id-row code { flex: 1 1 auto; }
@media (max-width: 640px) { .bill-plan { flex-direction: column; align-items: stretch; gap: 4px; } .bill-plan-name { padding-bottom: 0; } .bill-step { flex-wrap: wrap; } }

/* ── App footer (bss / tenant content) ─────────────────────── */
.app-footer { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--c-border); font-size: .82rem; color: var(--c-muted); text-align: center; }
.app-footer a { color: var(--c-muted); text-decoration: underline; }
.app-footer a:hover { color: var(--c-primary); }

/* ── BSS platform settings (module toggles) ────────────────── */
.module-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 6px 0; }
.module-title { font-weight: 700; color: var(--c-text); margin-bottom: 3px; }
.module-title i { color: var(--c-primary); }
.module-row .muted { margin: 0; font-size: .85rem; max-width: 560px; }
.switch { position: relative; display: inline-block; flex: 0 0 auto; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track { display: block; width: 48px; height: 26px; border-radius: 999px; background: var(--c-surface-2); border: 1px solid var(--c-border); transition: background .18s ease, border-color .18s ease; }
.switch-thumb { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--c-muted); transition: left .18s ease, background .18s ease; }
.switch input:checked + .switch-track { background: var(--c-primary); border-color: var(--c-primary); }
.switch input:checked + .switch-track .switch-thumb { left: 25px; background: #fff; }

/* ── Padded card variant of .panel (forms/content, not tables) ── */
/* overflow:visible so dropdowns (ui-select menus) aren't clipped by the card. */
.panel.pad { padding: 22px; overflow: visible; }
.email-editor.panel { padding: 20px; }
.email-preview.panel { padding: 18px; }
@media (max-width: 600px) { .panel.pad { padding: 16px; } }

/* ── Hero decorative shapes (our own Orion-style composition) ── */
.hero-decor { position: absolute; top: -30px; right: -30px; width: min(44%, 480px); pointer-events: none; z-index: 0; }
.hero-decor svg { width: 100%; height: auto; display: block; }
@media (max-width: 860px) { .hero-decor { width: 60%; opacity: .55; } }
@media (max-width: 600px) { .hero-decor { display: none; } }

/* Tighten marketing section spacing + type on phones (less dead space) */
@media (max-width: 600px) {
    .hero { padding: 80px 0 56px; }
    .hero-actions .btn { flex: 1 1 auto; justify-content: center; }
    .section { padding: 52px 0; }
    .section-head { margin-bottom: 32px; }
    .lead { font-size: 1.05rem; }
}

/* ── Hero 2-col + device mockup preview ────────────────────── */
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; }
.hero-copy { min-width: 0; }
.hero-preview { min-width: 0; }
.preview-band { padding-top: 40px; padding-bottom: 36px; }
.preview-band .section-head { margin-bottom: 22px; }
/* Internals are sized in cqw (1% of the .device-mock width) so the whole
   mock scales proportionally at any width - including phones - instead of
   overflowing fixed px. Design basis: 951px-wide frame. */
.device-mock { position: relative; width: 100%; max-width: 1080px; aspect-ratio: 951 / 588; margin: 0 auto; container-type: inline-size; }
.dm-frame { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; }
/* Slight outward bleed so the screen content tucks under the bezel (.dm-frame,
   higher z-index) instead of leaving a hairline of page background at the edges. */
.dm-laptop { position: absolute; left: 22.0%; top: 5.35%; width: 69.65%; height: 70.95%; z-index: 1; overflow: hidden; background: #fff; }
.dm-phone { position: absolute; left: 6.94%; top: 29.59%; width: 17.56%; height: 61.73%; z-index: 2; overflow: hidden; background: #fff; border-radius: 14px; }
.dm-app { position: absolute; inset: 0; display: flex; background: #fff; color: #0c2340; font-family: Inter, -apple-system, sans-serif; }
/* laptop sidebar */
.dm-side { flex: 0 0 6.52cqw; background: #0c2340; display: flex; flex-direction: column; align-items: center; gap: 1.58cqw; padding: 1.26cqw 0; }
.dm-logo { width: 2.52cqw; height: 2.52cqw; border-radius: 7px; background: #ff6a5a; color: #fff; font-weight: 800; font-size: 1.26cqw; display: grid; place-items: center; }
.dm-side i { font-size: 1.37cqw; color: rgba(255,255,255,.45); }
.dm-side i.on { color: #ff6a5a; }
.dm-side .dm-spacer { margin-top: auto; }
/* laptop main */
.dm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dm-top { display: flex; align-items: center; gap: 0.84cqw; padding: 1.16cqw 1.47cqw; border-bottom: 1px solid #eef1f6; font-size: 1.37cqw; font-weight: 800; letter-spacing: -.01em; }
.dm-grow { flex: 1; }
.dm-pill { background: #ff6a5a; color: #fff; font-size: 1.05cqw; font-weight: 700; padding: 0.42cqw 1.05cqw; border-radius: 7px; }
.dm-pill.ghost { background: #f4f7fa; color: #5f6c82; }
.dm-view { position: relative; flex: 1; }
.dm-body { position: absolute; inset: 0; padding: 1.37cqw 1.47cqw; display: flex; flex-direction: column; gap: 1.16cqw; overflow: hidden; }
.dm-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.95cqw; }
.dm-stat { background: #f4f7fa; border-radius: 10px; padding: 1.05cqw 1.16cqw; }
.dm-stat.alt { background: #fff0ed; }
.dm-stat .n { font-size: 2cqw; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.dm-stat .l { font-size: 0.95cqw; color: #5f6c82; text-transform: uppercase; letter-spacing: .04em; margin-top: 0.42cqw; }
.dm-card { border: 1px solid #eef1f6; border-radius: 11px; padding: 1.16cqw 1.26cqw; }
.dm-card-h { font-size: 0.95cqw; font-weight: 700; color: #9aa3b5; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 0.95cqw; }
.dm-bars { display: flex; align-items: flex-end; gap: 0.74cqw; height: 9.67cqw; }
.dm-bars span { flex: 1; background: #cfe0f2; border-radius: 3px 3px 0 0; }
.dm-bars span.c { background: #ff6a5a; }
.dm-rows { display: flex; flex-direction: column; gap: 0.53cqw; }
.dm-row { display: flex; align-items: center; gap: 0.84cqw; font-size: 1.16cqw; padding: 0.74cqw 0.95cqw; background: #fff; border: 1px solid #eef1f6; border-radius: 8px; }
.dm-row.head { background: transparent; border: none; color: #9aa3b5; font-size: 0.89cqw; font-weight: 700; letter-spacing: .04em; padding: 0.11cqw 0.95cqw; }
.dm-tag { font-weight: 700; color: #0c2340; flex: 0 0 6.1cqw; }
.dm-nm { flex: 1; color: #39435c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-st { flex: 0 0 auto; font-size: 0.95cqw; font-weight: 700; padding: 0.21cqw 0.84cqw; border-radius: 999px; }
.dm-st.g { background: #e0f6ee; color: #00875a; }
.dm-st.b { background: #e8f0fb; color: #246ac1; }
.dm-st.a { background: #fff3d6; color: #9a6a00; }
/* phone */
.dm-papp { display: flex; flex-direction: column; gap: 0.74cqw; padding: 1.16cqw 0.95cqw; height: 100%; font-family: Inter, sans-serif; }
.dm-ptop { display: flex; align-items: center; justify-content: space-between; font-size: 1.26cqw; font-weight: 800; color: #0c2340; }
.dm-ptop i { color: #ff6a5a; font-size: 1.16cqw; }
.dm-psearch { background: #f4f7fa; border-radius: 7px; height: 1.89cqw; }
.dm-pcard { background: #f4f7fa; border-radius: 9px; padding: 0.84cqw 0.95cqw; display: flex; flex-direction: column; gap: 0.32cqw; }
.dm-pcard .r { display: flex; align-items: center; justify-content: space-between; }
.dm-pcard .dm-tag { font-size: 1.05cqw; flex: 0 0 auto; }
.dm-pcard .dm-nm { font-size: 0.95cqw; }
.dm-pcard .dm-st { font-size: 0.84cqw; }
.dm-ptab { margin-top: auto; display: flex; justify-content: space-around; padding: 0.84cqw 0 0.42cqw; border-top: 1px solid #eef1f6; }
.dm-ptab i { font-size: 1.26cqw; color: #c2cad8; }
.dm-ptab i.on { color: #ff6a5a; }
@media (max-width: 920px) {
    .hero-grid { grid-template-columns: 1fr; gap: 28px; }
    .device-mock { margin: 0 auto; max-width: 620px; }
}
