/* Legacy class names → the Wensity kit's tokens.
   The 279 views were written against their own class names; this maps them onto the one kit so
   the whole product reads from Wensity while each page is migrated onto its components.
   Loaded BEFORE the kit, so Wensity's own utilities win where both apply. */
/* =====================================================================================
   Arc bridge — the dashboard shell and every shared widget, restyled on Arc tokens.

   Why a bridge: the app has 279 server-rendered views with ~4,000 class names already in
   them. Rewriting all of them in one pass would be a rewrite, not a simplification. This
   sheet instead maps the classes that every page actually shares — the shell, the page
   header, cards, tables, forms, buttons, pills, tabs, modals — onto Arc's tokens, and it is
   loaded LAST so Arc wins on exactly those families. Views then migrate to arc-* names
   module by module, and each legacy sheet is deleted when its selectors are provably unused.

   Rules kept here: tokens only (no raw colours), one radius scale, no inline values.
   ===================================================================================== */

/* ---------------------------------------------------------------- app shell: sidebar */
.dashboard-sidebar, .sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    color: var(--foreground);
}
.dashboard-sidebar .sidebar-scroll-area { scrollbar-width: thin; }
.dashboard-sidebar .brand {gap: 10px;padding: 16px 18px;margin: 0 8px 8px;border-radius: var(--radius-panel);color: var(--foreground);}
.dashboard-sidebar .brand:hover { background: var(--surface-muted); }
.ax-brand-main { font-weight: 750; letter-spacing: -.01em; }
.ax-brand-suffix { color: var(--text-muted); font-weight: 600; }
.ax-brand-dot {width: 6px;height: 6px;border-radius: 999px;background: var(--accent);margin-left: 4px;}
.sidebar-nav-section { padding: 6px 10px 12px; }
.ax-nav-label, .sidebar-nav-heading {
    font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: var(--text-muted); padding: 12px 10px 6px;
}
.nav-group { margin-bottom: 2px; }
.nav-item, .staff-dash-main-link, .client-dash-main-link {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: var(--radius-control);
    color: var(--text-secondary); text-decoration: none; font-size: .9rem; font-weight: 550;
    transition: background var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard);
}
.nav-item:hover, .staff-dash-main-link:hover, .client-dash-main-link:hover { background: var(--surface-muted); color: var(--foreground); }
.nav-item.active, .staff-dash-main-link.active, .client-dash-main-link.active,
.nav-group.sidebar-nav-has-active > .nav-item:not(.active) { background: var(--accent-subtle); color: var(--accent-strong); font-weight: 650; }
.nav-item svg, .sub-item svg, .sub-item-icon svg { width: 18px; height: 18px; flex: none; }
.nav-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chevron { margin-left: auto; opacity: .5; }
.submenu {padding: 2px 0 6px 30px;}
.submenu.show, .submenu--always-open { display: block; }
.sub-item {display: flex;align-items: center;gap: 9px;padding: 7px 10px;border-radius: calc(var(--radius-control) * .8);color: var(--text-muted);font-size: .85rem;}
.sub-item:hover { background: var(--surface-muted); color: var(--foreground); }
.sub-item.active { color: var(--accent-strong); font-weight: 650; background: var(--accent-subtle); }
.sidebar-bottom { border-top: 1px solid var(--border-subtle); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.sidebar-upgrade-btn {gap: 8px;height: var(--control-height-md);background: var(--accent);color: var(--accent-foreground);font-size: .88rem;font-weight: 650;border: 0;}
.sidebar-upgrade-btn:hover { background: var(--accent-strong); }
.sidebar-upgrade-btn svg { width: 16px; height: 16px; }
@media (max-width: 1024px) {
    .ax-drawer-close {top: 14px;right: 14px;width: 34px;height: 34px;background: var(--surface-muted);border: 1px solid var(--border);color: var(--text-secondary);}
    .ax-drawer-close svg { width: 16px; height: 16px; }
}

/* ---------------------------------------------------------------- app shell: header */
.dashboard-header {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    height: 60px; padding: 0 16px;
    background: color-mix(in oklab, var(--surface) 88%, transparent);
    backdrop-filter: saturate(1.2) blur(8px);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 40;
}
.header-left, .header-right-actions { display: flex; align-items: center; gap: 8px; }
.header-icon-btn {width: 36px;height: 36px;border-radius: var(--radius-control);border: 1px solid transparent;color: var(--text-secondary);}
.header-icon-btn:hover { background: var(--surface-muted); color: var(--foreground); border-color: var(--border); }
.header-icon-btn svg { width: 18px; height: 18px; }
.header-search {gap: 8px;min-width: 280px;height: var(--control-height-md);padding: 0 12px;background: var(--surface-muted);border: 1px solid var(--border);border-radius: var(--radius-control);}
.header-search input { border: 0; background: transparent; color: var(--foreground); font: inherit; font-size: .88rem; width: 100%; outline: none; }
.ax-search-kbd {font-size: .72rem;font-weight: 650;border: 1px solid var(--border);border-radius: calc(var(--radius-control) * .5);padding: 2px 6px;background: var(--surface);}
.header-search-dropdown, .mobile-header-more-menu, .notif-panel, [id$="Panel"] {
    background: var(--surface-raised); border: 1px solid var(--border);
    border-radius: var(--radius-panel); box-shadow: var(--shadow-floating);
}
.header-collapsed-brand, .header-mobile-brand { color: var(--foreground); font-weight: 700; text-decoration: none; }
.permission-header-open {height: var(--control-height-sm);padding: 0 12px;border-radius: var(--radius-pill);background: var(--surface-muted);border: 1px solid var(--border);color: var(--text-secondary);font-size: .8rem;}
.permission-header-open:hover { color: var(--foreground); border-color: var(--border-strong); }
.mobile-header-more-menu__item {display: block;padding: 10px 14px;border: 0;color: var(--foreground);font: inherit;font-size: .88rem;}
.mobile-header-more-menu__item:hover { background: var(--surface-muted); }

/* ---------------------------------------------------------------- page furniture */
.page-title, h1.page-title, .section-title {
    font-family: var(--font-display); color: var(--foreground); font-weight: 700; letter-spacing: -.01em;
}
.page-title {font-size: 1.6rem;margin: 0 0 4px;}
.section-title { font-size: 1.05rem; margin: 0 0 10px; }
.comm-page-shell__inner { padding: 22px; max-width: 1400px; margin: 0 auto; }

/* ---------------------------------------------------------------- buttons */
.btn, .cw-button, button.btn { 
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: var(--control-height-md); padding: 0 16px;
    border-radius: var(--radius-control); border: 1px solid var(--border);
    background: var(--surface); color: var(--foreground);
    font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; text-decoration: none;
    transition: background var(--duration-fast) var(--ease-standard), border-color var(--duration-fast) var(--ease-standard);
}
.btn:hover, .cw-button:hover { background: var(--surface-muted); border-color: var(--border-strong); }
.btn-primary, .cw-button-primary, .cw-button--primary, .primary, button.primary {
    background: var(--accent); border-color: var(--accent); color: var(--accent-foreground);
}
.btn-primary:hover, .cw-button-primary:hover, .primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-danger, .cw-button-danger, .danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-outline, .outline { background: transparent; border-color: var(--border-strong); color: var(--foreground); }
.btn-ghost, .drv-btn-ghost, .btn-link {
    background: transparent; border-color: transparent; color: var(--text-secondary);
}
.btn-ghost:hover, .drv-btn-ghost:hover, .btn-link:hover { background: var(--surface-muted); color: var(--foreground); }
.btn:disabled, .cw-button:disabled, .btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------------------------------------------------------------- surfaces */
.card, .dash-card, .stat-card, .opt-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-panel); box-shadow: var(--shadow-resting);
}
.card { padding: 18px; }
.opt-card { display: flex; gap: 12px; padding: 14px 16px; cursor: pointer; }
.opt-card:hover, .opt-card.active { border-color: var(--accent); background: var(--accent-subtle); }
.opt-label, .modal-label, .wiz-label, .lm-form-label, .field-label {
    font-size: .84rem; font-weight: 600; color: var(--foreground);
}
.opt-desc, .wiz-divider, .lm-meta-label { font-size: .8rem; color: var(--text-muted); }

/* ---------------------------------------------------------------- forms */
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="search"], input[type="tel"], input[type="date"], input[type="time"], input[type="url"], select, textarea,
.field-input, .modal-input, .lm-form-input, .wiz-field input, .wiz-field select, .wiz-field textarea, .form-input {
    width: 100%; box-sizing: border-box; min-height: var(--control-height-md);
    padding: 8px 14px; background: var(--surface); color: var(--foreground);
    border: 1px solid var(--border); border-radius: var(--radius-control);
    font: inherit; font-size: .89rem;
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
input:focus, select:focus, textarea:focus, .field-input:focus, .modal-input:focus {
    outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent);
}
textarea, .wiz-field textarea { min-height: 110px; resize: vertical; }
.field-hint, .err { font-size: .78rem; color: var(--text-muted); }
.err, .error { color: var(--danger); }
.radio-row {align-items: center;gap: 9px;padding: 10px 12px;border-radius: var(--radius-control);border: 1px solid var(--border);}
.radio-row:hover { background: var(--surface-muted); }

/* ---------------------------------------------------------------- tables */
table:not(.arc-table) { width: 100%; border-collapse: collapse; font-size: .87rem; color: var(--foreground); }
table:not(.arc-table) th {
    text-align: left; padding: 11px 14px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    color: var(--text-muted); background: var(--surface-muted); border-bottom: 1px solid var(--border);
}
table:not(.arc-table) td { padding: 12px 14px; border-bottom: 1px solid var(--border-subtle); }
table:not(.arc-table) tbody tr:hover { background: var(--surface-muted); }
.ga-td-num, .lm-meta-value, .bex-num { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- pills, chips, badges */
.pill, .pill-item, .badge, .chip, .uh-filter, .lp-tab, .sp-option {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 6px 12px; border-radius: var(--radius-pill);
    background: var(--surface-muted); border: 1px solid var(--border-subtle);
    color: var(--text-secondary); font-size: .82rem; font-weight: 600; text-decoration: none; cursor: pointer;
}
.pill:hover, .pill-item:hover, .uh-filter:hover, .lp-tab:hover { color: var(--foreground); border-color: var(--border); }
.pill.active, .pill-item.active, .uh-filter.active, .lp-tab.active, .is-active {
    background: var(--accent-subtle); border-color: transparent; color: var(--accent-strong);
}
.pill-body { font-size: .88rem; }
.pill-item .pill-body { font-weight: 600; }

/* ---------------------------------------------------------------- modals & overlays */
.modal-overlay, .uh-modal-overlay, .arc-overlay {
    /* NO `display` here on purpose. An overlay is closed until a page's own script
       shows it (inline style.display='flex', or a `.open`/`.active` rule the module
       sheet defines). The kit used to force `display: flex`, and because this sheet
       loads AFTER dashboard-modules.css it overrode that sheet's `display: none` —
       so every modal on a page painted OPEN on load (calendar's add/view/assign dialogs
       were the visible symptom). Geometry/colour stay; visibility is the page's to own. */
    position: fixed; inset: 0; z-index: 2000; align-items: center; justify-content: center; padding: 20px;
    background: color-mix(in oklab, var(--foreground) 45%, transparent);
}
.modal-content, .uh-modal, .arc-dialog {
    width: 100%; max-width: 520px; max-height: 88vh; overflow: auto;
    background: var(--surface-raised); color: var(--foreground);
    border: 1px solid var(--border); border-radius: var(--radius-panel); box-shadow: var(--shadow-floating);
    padding: 22px;
}

/* ---------------------------------------------------------------- feedback */
.alert, .alert-box, .arc-alert {
    display: flex; gap: 10px; padding: 12px 16px; border-radius: var(--radius-panel);
    background: var(--surface-muted); border: 1px solid var(--border); color: var(--foreground); font-size: .87rem;
}
.alert-danger, .alert-error { background: color-mix(in oklab, var(--danger) 12%, transparent); border-color: transparent; color: var(--danger); }
.alert-success { background: color-mix(in oklab, var(--success) 14%, transparent); border-color: transparent; color: var(--success); }
.alert-warning { background: color-mix(in oklab, var(--warning) 16%, transparent); border-color: transparent; color: var(--warning); }

/* ---------------------------------------------------------------- scrollbars, focus, motion */
* { scrollbar-color: var(--border-strong) transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .001ms; transition-duration: .001ms; } }

/* =====================================================================================
   Marketing side — same tokens, same components. The marketing pages carried their own
   button/card/pill vocabulary (btn/primary/outline/eyebrow/cap/container-xl…); they now
   resolve to Arc too, so a change in the kit changes the whole product at once.
   ===================================================================================== */
.marketing-site, body.marketing, .marketing-page { background: var(--background); color: var(--foreground); font-family: var(--font-body); }
.container, .container-xl, .wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; box-sizing: border-box; }
.eyebrow, .cap {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: var(--accent-strong); background: var(--accent-subtle);
    padding: 5px 12px; border-radius: var(--radius-pill);
}
.cap {background: transparent;color: var(--text-muted);padding: 0;}
.marketing-site h1, .pageHero h1 { font-family: var(--font-display); font-size: clamp(2rem, 4vw, 3rem); line-height: 1.1; letter-spacing: -.02em; margin: 0 0 14px; color: var(--foreground); }
.marketing-site h2 { font-family: var(--font-display); font-size: clamp(1.5rem, 2.4vw, 2.1rem); line-height: 1.2; letter-spacing: -.015em; margin: 0 0 12px; }
.marketing-site h3 { font-size: 1.15rem; font-weight: 650; margin: 0 0 8px; }
.marketing-site p, .lead { color: var(--text-secondary); font-size: 1.02rem; line-height: 1.65; }
.lead {font-size: 1.1rem;}
.pageHero { padding: 72px 0 40px; text-align: center; }
.actions {gap: 12px;}
.pageHero .actions { justify-content: center; }
.crumb { font-size: .84rem; color: var(--text-muted); margin-bottom: 10px; }
.crumb a { color: var(--text-secondary); text-decoration: none; }
.crumb a:hover { color: var(--accent-strong); }
.marketing-site .card, .cards .card, .article, .task {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-surface);
    box-shadow: var(--shadow-resting); padding: 24px;
}
.cards {grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));gap: 20px;}
.two {grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));gap: 28px;}
.imgFrame, .routeImage { border-radius: var(--radius-surface); overflow: hidden; border: 1px solid var(--border); background: var(--surface-muted); }
.imgFrame img, .routeImage img { display: block; width: 100%; height: auto; }
.task { display: grid; grid-template-columns: 34px 1fr; gap: 14px; align-items: start; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; }
.logo, .ecosystemMark { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--foreground); text-decoration: none; }
.logo img, .ecosystemMark img, .ecosystemSlot img { height: 26px; width: auto; filter: none; }
.ecosystemSlot { display: inline-flex; align-items: center; justify-content: center; padding: 12px 16px; border-radius: var(--radius-panel); background: var(--surface-muted); border: 1px solid var(--border-subtle); }
.ecosystemCounter { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--accent-strong); }
.marketing-site footer { border-top: 1px solid var(--border); margin-top: 64px; padding: 40px 0; background: var(--surface-muted); color: var(--text-secondary); }
.marketing-site footer a { color: var(--text-secondary); text-decoration: none; }
.marketing-site footer a:hover { color: var(--accent-strong); }
.marketing-site .btn-primary, .marketing-site .primary { background: var(--accent); border-color: var(--accent); color: var(--accent-foreground); }
.marketing-site .btn-outline, .marketing-site .outline { background: transparent; border-color: var(--border-strong); color: var(--foreground); }
.reveal { opacity: 1; transform: none; }
/* brand marks: local files, never a CDN */
.brand-mark { height: 24px; width: auto; display: inline-block; }

/* ---- icons: one sprite, no icon font ---- */
.wensity-i, .arc-i { width: 1em; height: 1em; display: inline-block; flex: none; vertical-align: -.125em; }
.wensity-i-lg, .arc-i-lg { width: 1.25em; height: 1.25em; }

/* ---- auth pages (they share style.css, but the controls come from Arc now) ---- */
.auth-card, .auth-container, .login-card, .register-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-surface);
    box-shadow: var(--shadow-resting); padding: 32px;
}
.auth-card h1, .auth-card h2 { font-family: var(--font-display); color: var(--foreground); }
.auth-card p, .auth-sub { color: var(--text-secondary); }
.auth-toggle-password { color: var(--text-muted); background: transparent; border: 0; cursor: pointer; }
.auth-toggle-password:hover { color: var(--foreground); }

/* ---- proposal (the live marketing site) — its own vocabulary, Arc's look ---- */
.pv, body[data-nav] { background: var(--background); color: var(--foreground); font-family: var(--font-body); }
.hero, .editorialHero, .pageHero { padding: 72px 0 40px; }
.hero h1, .editorialHero h1 { font-family: var(--font-display); font-size: clamp(2.1rem, 4.4vw, 3.2rem); line-height: 1.08; letter-spacing: -.02em; margin: 0 0 14px; }
.hero p, .editorialHero p { color: var(--text-secondary); font-size: 1.06rem; line-height: 1.65; }
.tile, .planCard, .homePlan, .proofSide, .card, .docbody, .legalProse, .ecosystemContent {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-surface);
    box-shadow: var(--shadow-resting); padding: 22px;
}
.homePlan.is-featured, .planCard.is-featured { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-subtle); }
.homePricingHint, .cap, .docnav, .foot { color: var(--text-muted); font-size: .86rem; }
.menu, nav.menu { display: flex; align-items: center; gap: 6px; }
.menu a { padding: 7px 12px; border-radius: var(--radius-pill); color: var(--text-secondary); text-decoration: none; font-size: .88rem; font-weight: 550; }
.menu a:hover { background: var(--surface-muted); color: var(--foreground); }
.menu a.active { background: var(--accent-subtle); color: var(--accent-strong); }
.links a, .docnav a { color: var(--text-secondary); text-decoration: none; }
.links a:hover, .docnav a:hover { color: var(--accent-strong); }
.foot { border-top: 1px solid var(--border); margin-top: 56px; padding: 32px 0; background: var(--surface-muted); }
.field { display: flex; flex-direction: column; gap: 6px; }
.newsletterForm {gap: 10px;}
.orbitToken, .ecosystemRing { border-radius: var(--radius-pill); }
.orbitToken { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; background: var(--surface-muted); border: 1px solid var(--border-subtle); font-size: .84rem; color: var(--text-secondary); }
.ecosystemRing { display: grid; place-items: center; padding: 10px; background: var(--surface-muted); border: 1px solid var(--border-subtle); }
.eyebrow, .cap.eyebrow { color: var(--accent-strong); }
