:root {
    --bg: #0f172a;
    --bg-soft: #111827;
    --surface: #ffffff;
    --surface-muted: #f8fafc;
    --line: #e2e8f0;
    --text: #0f172a;
    --muted: #64748b;
    --accent: #0f766e;
    --accent-soft: #ccfbf1;
    --danger: #b91c1c;
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    --sidebar-width: 260px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: "Segoe UI", system-ui, sans-serif;
    color: var(--text);
    background: var(--surface-muted);
}

a { color: var(--accent); }

.brand { display: flex; flex-direction: column; gap: 2px; }
.brand-logo-link {
    display: block;
    text-decoration: none;
    line-height: 0;
}
.brand-logo {
    display: block;
    width: auto;
    max-width: 100%;
    height: 36px;
    object-fit: contain;
    object-position: left center;
}
.brand-product {
    margin-top: 0.35rem;
    font-size: 0.78rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    color: #99f6e4;
}
.brand-kicker {
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    font-weight: 700;
    color: #99f6e4;
}
.brand-title { font-size: 1.1rem; font-weight: 650; color: #fff; }
.brand-workspace {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.62);
}

.admin-body { min-height: 100vh; }
.admin-app { min-height: 100vh; }
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 30;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #0f172a, #111827);
    color: #e2e8f0;
    padding: 1.4rem 1rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.22s ease;
}
.sidebar .brand { padding: 0 0.6rem 1.4rem; border-bottom: 1px solid rgba(255,255,255,0.08); flex-shrink: 0; }
.nav {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-top: 1rem;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 0.15rem;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.8rem;
    border-radius: 10px;
    color: #cbd5e1;
    text-decoration: none;
}
.nav-icon {
    width: 1.05rem;
    height: 1.05rem;
    flex-shrink: 0;
    opacity: 0.82;
    color: currentColor;
}
.nav-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}
.nav-item.active .nav-icon,
.nav-item:hover .nav-icon,
.nav-group.has-active > summary .nav-icon {
    opacity: 1;
}
.nav-group-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}
.nav-item.active, .nav-item:hover { background: rgba(15, 118, 110, 0.22); color: #fff; }
.nav-item.is-disabled {
    opacity: 0.42;
    cursor: not-allowed;
    pointer-events: none;
}
.nav-group {
    margin: 0.1rem 0;
}
.nav-group > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.62rem 0.8rem;
    border-radius: 10px;
    color: rgba(226, 232, 240, 0.62);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    user-select: none;
}
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::after {
    content: "";
    width: 0.4rem;
    height: 0.4rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    transition: transform 0.15s ease;
    flex-shrink: 0;
    opacity: 0.8;
}
.nav-group[open] > summary::after {
    transform: rotate(45deg);
}
.nav-group > summary:hover,
.nav-group[open] > summary {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}
.nav-group.has-active > summary {
    color: #99f6e4;
}
.nav-group-items {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    padding: 0.15rem 0 0.4rem 0.35rem;
}

.admin-main {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    min-width: 0;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.22s ease;
}
.admin-app.nav-collapsed .sidebar {
    transform: translateX(-105%);
}
.admin-app.nav-collapsed .admin-main {
    margin-left: 0;
}
.topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.4rem;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 12;
}
.topbar-title { font-weight: 650; flex: 1; }
.topbar-user { display: flex; align-items: center; gap: 0.8rem; }
.current-user { color: var(--muted); font-size: 0.92rem; }
.menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 8px;
    padding: 0.35rem 0.55rem;
    cursor: pointer;
    font-size: 1.05rem;
    line-height: 1;
    flex-shrink: 0;
}
.menu-toggle:hover { background: var(--surface-muted); }
.content { padding: 1.4rem; }
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1.3rem 1.4rem;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}
.eyebrow {
    margin: 0;
    letter-spacing: 0.14em;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
}
.panel h1, .panel h2 { margin: 0.2rem 0 0.4rem; }
.lede, .muted { color: var(--muted); }
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin: 1rem 0 0;
}
.status-grid dt { color: var(--muted); font-size: 0.82rem; }
.status-grid dd { margin: 0.2rem 0 0; font-weight: 650; }
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.8rem;
    margin: 1.1rem 0 0;
}
.stat-card {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    text-decoration: none;
    color: inherit;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.85rem 0.95rem;
}
a.stat-card:hover { border-color: var(--accent); }
.stat-value { font-size: 1.5rem; font-weight: 750; line-height: 1.1; }
.stat-label { color: var(--muted); font-size: 0.82rem; }
.dashboard-notices {
    display: grid;
    gap: 0.65rem;
    margin: 0.9rem 0 0;
}
.dashboard-notice {
    margin: 0;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--line);
    background: var(--surface-muted);
    border-radius: 10px;
    font-size: 0.9rem;
}
.dashboard-notice p { margin: 0; }
.dashboard-notice-title {
    margin: 0 0 0.25rem !important;
    font-weight: 700;
}
.dashboard-notice--danger {
    border-color: #fecaca;
    background: #fef2f2;
    color: #7f1d1d;
}
.dashboard-notice--danger a { color: #991b1b; font-weight: 650; }
.dashboard-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: start;
    margin-bottom: 1rem;
}
.dashboard-split > .panel { margin-bottom: 0; }
@media (max-width: 1100px) {
    .dashboard-split { grid-template-columns: 1fr; }
}
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.85rem 1rem;
    margin: 0.85rem 0 0;
}
.detail-grid > div { min-width: 0; }
.detail-grid dt {
    margin: 0;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.detail-grid dd {
    margin: 0.22rem 0 0;
    font-weight: 650;
    word-break: break-word;
}
.card-kicker {
    margin: 0 0 0.4rem;
    color: var(--muted);
    font-size: 0.9rem;
}
.panel > h2 + .card-kicker { margin-top: -0.1rem; }
.panel h3 {
    margin: 1rem 0 0.5rem;
    font-size: 0.95rem;
}
.action-group {
    margin-top: 1.1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}
.action-group h3 { margin-top: 0; }
.usage-meter {
    height: 6px;
    background: var(--line);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 0.45rem;
}
.usage-meter > span {
    display: block;
    height: 100%;
    background: var(--accent);
}
.usage-meter.is-warn > span { background: #d97706; }
.usage-meter.is-danger > span { background: var(--danger); }
.tenant-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    margin-top: 0.55rem;
}
.tenant-status {
    display: inline-block;
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
    font-size: 0.78rem;
    font-weight: 700;
    background: #e2e8f0;
}
.tenant-status--active { background: #dcfce7; }
.tenant-status--suspended { background: #fef9c3; }
.tenant-status--disabled,
.tenant-status--cancelled { background: #fee2e2; }
.tenant-status--trialing { background: #e0f2fe; }
.tenant-status--pastdue { background: #ffedd5; }
.warning-list {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0 0;
    display: grid;
    gap: 0.5rem;
}
.warning-list li {
    margin: 0;
    padding: 0.7rem 0.85rem;
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #7f1d1d;
    border-radius: 10px;
}
.health-banner {
    margin: 0.75rem 0 0;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    font-weight: 650;
}
.health-banner p { margin: 0.3rem 0 0; font-weight: 500; }
.health-banner--ok { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.health-banner--warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.health-banner--alert { background: #fef2f2; border: 1px solid #fecaca; color: #7f1d1d; }
.health-subsection { margin-top: 1.25rem; }
.health-subsection h3 { margin: 0 0 0.3rem; font-size: 0.95rem; }
.health-setup {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.65rem;
}
.health-issue-list {
    display: grid;
    gap: 0.5rem;
    margin: 0.7rem 0 0;
    padding: 0;
    list-style: none;
}
.health-issue {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin: 0;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #7f1d1d;
}
.health-issue span { font-weight: 600; }
.health-issue strong {
    font-size: 1.35rem;
    font-variant-numeric: tabular-nums;
}
.health-issue--busy {
    border-color: #fde68a;
    background: #fffbeb;
    color: #92400e;
}
.health-footnote {
    margin: 1rem 0 0;
    color: var(--muted);
    font-size: 0.88rem;
}
.currency-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.88rem;
    background: var(--surface-muted);
}
.currency-chip.is-ready { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.currency-chip.is-missing { background: #fef2f2; border-color: #fecaca; color: #7f1d1d; }

.readiness-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
    margin: 1rem 0 0;
}
.readiness-kpi {
    border-radius: 14px;
    padding: 1rem 1.1rem;
    border: 1px solid var(--line);
    font-weight: 650;
}
.readiness-kpi span { font-size: 0.88rem; }
.readiness-kpi strong {
    display: block;
    font-size: 2rem;
    line-height: 1.1;
    margin-top: 0.35rem;
}
.readiness-kpi.is-ok { background: #ecfdf5; border-color: #6ee7b7; color: #065f46; }
.readiness-kpi.is-warn { background: #fffbeb; border-color: #fcd34d; color: #92400e; }
.readiness-kpi.is-nok { background: #fef2f2; border-color: #fca5a5; color: #991b1b; }
.readiness-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.75rem;
    margin: 0.85rem 0 0;
}
.readiness-card {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 0.95rem 1rem 1rem;
    background: #fff;
    border-left: 5px solid #94a3b8;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-width: 0;
}
.readiness-card.is-ok { border-left-color: #059669; background: #f0fdf4; }
.readiness-card.is-warn { border-left-color: #d97706; background: #fffbeb; }
.readiness-card.is-nok { border-left-color: #dc2626; background: #fef2f2; }
.readiness-card.is-off { border-left-color: #94a3b8; background: #f8fafc; }
.readiness-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.6rem;
}
.readiness-card h3 { margin: 0; font-size: 1rem; }
.readiness-card p { margin: 0; color: var(--muted); font-size: 0.88rem; word-break: break-word; }
.tone {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    width: fit-content;
    border-radius: 999px;
    padding: 0.18rem 0.6rem;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}
.tone-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}
.tone-ok { background: #dcfce7; color: #166534; }
.tone-warn { background: #fef3c7; color: #b45309; }
.tone-nok { background: #fee2e2; color: #b91c1c; }
.tone-off { background: #e2e8f0; color: #475569; }
.check-inline {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.45rem;
    font-size: 0.9rem;
    max-width: 36rem;
    line-height: 1.4;
    padding: 0.35rem 0;
}
.panel form.filter-bar .check-inline {
    align-self: end;
    padding-bottom: 0.7rem;
}
.provider-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.check-list { display: grid; gap: 0.5rem; margin: 0.7rem 0 1.1rem; }
.check-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.75rem;
    align-items: start;
    padding: 0.8rem 0.95rem;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
}
.check-row.is-ok { background: #f0fdf4; border-color: #bbf7d0; }
.check-row.is-warn { background: #fffbeb; border-color: #fde68a; }
.check-row.is-nok { background: #fef2f2; border-color: #fecaca; }
.check-row.is-off { background: #f8fafc; }
.check-row strong { display: block; font-size: 0.92rem; }
.check-row p { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.86rem; word-break: break-word; }
@media (max-width: 720px) {
    .readiness-kpis { grid-template-columns: 1fr; }
    .check-row { grid-template-columns: 1fr; }
}

.btn {
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 0.7rem 1rem;
    font: inherit;
    font-weight: 650;
    line-height: 1.25;
    cursor: pointer;
}
a.btn { text-decoration: none; }
.btn svg {
    width: 1.05rem;
    height: 1.05rem;
    flex-shrink: 0;
}
.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    width: 100%;
}
.btn-ghost {
    background: #fff;
    color: var(--text);
    border-color: var(--line);
}

.auth-body {
    position: relative;
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr;
    place-items: center;
    background: #07111f;
    overflow: hidden;
    font-family: "Outfit", "Segoe UI", system-ui, sans-serif;
}
.auth-atmosphere {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 80% 55% at 20% 15%, rgba(20, 184, 166, 0.28), transparent 55%),
        radial-gradient(ellipse 70% 50% at 85% 80%, rgba(15, 118, 110, 0.22), transparent 50%),
        linear-gradient(160deg, #07111f 0%, #0f172a 45%, #0b3b3a 100%);
}
.auth-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.55;
}
.auth-orb--a {
    width: 28rem;
    height: 28rem;
    top: -8rem;
    right: -6rem;
    background: rgba(45, 212, 191, 0.35);
    animation: auth-orb-drift 14s ease-in-out infinite alternate;
}
.auth-orb--b {
    width: 22rem;
    height: 22rem;
    bottom: -6rem;
    left: -4rem;
    background: rgba(15, 118, 110, 0.4);
    animation: auth-orb-drift 18s ease-in-out infinite alternate-reverse;
}
.auth-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.07) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
}
.auth-radar {
    position: absolute;
    width: min(42rem, 90vw);
    height: min(42rem, 90vw);
    top: 50%;
    left: 18%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1px solid rgba(94, 234, 212, 0.12);
    box-shadow:
        inset 0 0 0 1px rgba(94, 234, 212, 0.06),
        0 0 0 4.5rem rgba(94, 234, 212, 0.03),
        0 0 0 9rem rgba(94, 234, 212, 0.02);
    animation: auth-radar-pulse 8s ease-in-out infinite;
}
.auth-shell {
    position: relative;
    z-index: 1;
    width: min(920px, calc(100% - 2rem));
    margin: 0 auto 2.5rem;
    animation: auth-rise 0.7s ease-out both;
}
.auth-shell > .auth-card {
    width: min(420px, 100%);
    margin-inline: auto;
}
.auth-topbar {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
}
.auth-marketing-link {
    color: rgba(226, 232, 240, 0.82);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
}
.auth-marketing-link:hover,
.auth-marketing-link:focus-visible {
    color: #99f6e4;
    text-decoration: underline;
}
.auth-marketing-link-spacer {
    flex: 1 1 auto;
}
.auth-topbar .language-switcher-icon {
    color: rgba(226, 232, 240, 0.7);
}
.auth-topbar .language-switcher-btn {
    background: rgba(15, 23, 42, 0.45);
    border-color: rgba(148, 163, 184, 0.28);
    color: #e2e8f0;
}
.auth-topbar .language-switcher-btn.is-active {
    background: rgba(20, 184, 166, 0.22);
    color: #99f6e4;
    border-color: rgba(94, 234, 212, 0.35);
}
.auth-card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 1.35rem;
    padding: 1.75rem 1.6rem;
    box-shadow:
        0 24px 60px rgba(2, 12, 27, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
}
.auth-brand .brand-kicker { color: var(--accent); }
.auth-brand .brand-title { color: var(--text); margin-bottom: 1rem; }
.auth-card form { display: flex; flex-direction: column; gap: 0.95rem; }
.auth-card label { display: flex; flex-direction: column; gap: 0.4rem; font-weight: 600; font-size: 0.92rem; color: #0f172a; }
.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="text"] {
    border: 1px solid #dbe3ef;
    border-radius: 0.85rem;
    padding: 0.8rem 0.9rem;
    font: inherit;
    background: #f8fafc;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.auth-card input[type="email"]:focus,
.auth-card input[type="password"]:focus,
.auth-card input[type="text"]:focus {
    outline: none;
    border-color: #14b8a6;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.18);
}
.remember { flex-direction: row !important; align-items: center; font-weight: 500 !important; color: #475569 !important; }
.form-errors, .field-error { color: var(--danger); font-size: 0.88rem; }

.login-stage {
    display: grid;
    grid-template-columns: 1.15fr 0.95fr;
    gap: 1.75rem;
    align-items: stretch;
}
.login-brand {
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #f8fafc;
    padding: 0.5rem 0.75rem 0.5rem 0.25rem;
}
.login-brand-logo {
    display: block;
    width: min(280px, 100%);
    height: auto;
    margin: 0 0 1rem;
}
.login-brand-kicker {
    margin: 0 0 0.65rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #99f6e4;
}
.login-brand-title {
    margin: 0;
    font-size: clamp(2.4rem, 4.5vw, 3.2rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 0.98;
}
.login-brand-lead {
    margin: 1.1rem 0 0;
    max-width: 22rem;
    font-size: 1.05rem;
    line-height: 1.55;
    color: rgba(226, 232, 240, 0.82);
    font-weight: 500;
}
.login-brand-flow {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 1.75rem 0 0;
}
.login-brand-flow span {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: rgba(153, 246, 228, 0.35);
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.12);
}
.login-brand-flow span:first-child {
    background: #5eead4;
    box-shadow: 0 0 0 5px rgba(94, 234, 212, 0.22);
}
.login-brand-flow span:nth-child(2) {
    background: #2dd4bf;
}
.login-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100%;
}
.login-card-title {
    margin: 0 0 0.45rem;
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #0f172a;
}
.login-card-hint {
    margin: 0 0 1.1rem;
    font-size: 0.92rem;
    line-height: 1.45;
}
.login-recovery {
    margin: 0;
    padding: 0.15rem 0 0;
}
.login-recovery summary {
    cursor: pointer;
    list-style: none;
    font-size: 0.88rem;
    font-weight: 650;
    color: #64748b;
}
.login-recovery summary::-webkit-details-marker { display: none; }
.login-recovery[open] summary { margin-bottom: 0.55rem; }
.login-back {
    margin: 1rem 0 0;
    text-align: center;
    font-size: 0.9rem;
}
.login-back a { color: #0f766e; font-weight: 650; }
.login-submit {
    margin-top: 0.35rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #14b8a6, #0f766e);
    border-color: transparent;
    padding: 0.85rem 1rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.login-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(15, 118, 110, 0.35);
}

@keyframes auth-orb-drift {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(-3%, 4%) scale(1.08); }
}
@keyframes auth-radar-pulse {
    0%, 100% { opacity: 0.55; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.9; transform: translate(-50%, -50%) scale(1.04); }
}
@keyframes auth-rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 860px) {
    .login-stage {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    .login-brand {
        padding: 0.25rem 0.15rem;
        text-align: left;
    }
    .login-brand-title {
        font-size: clamp(2.2rem, 10vw, 2.8rem);
    }
    .auth-radar { left: 50%; opacity: 0.45; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-orb--a,
    .auth-orb--b,
    .auth-radar,
    .auth-shell {
        animation: none;
    }
}
.nav-backdrop { display: none; }

@media (max-width: 860px) {
    .admin-main { margin-left: 0; }
    .sidebar { transform: translateX(-105%); }
    .admin-app.nav-open .sidebar { transform: none; }
    .admin-app.nav-collapsed .sidebar { transform: translateX(-105%); }
    .nav-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.45);
        z-index: 25;
    }
    .admin-app.nav-open + .nav-backdrop { display: block; }
}

.panel-header { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.panel-header .btn-primary { width: auto; flex-shrink: 0; }
.panel-kicker { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.92rem; }
.btn-inline { width: auto; display: inline-flex; text-decoration: none; align-items: center; gap: 0.4rem; align-self: flex-start; }
.filter-chip-groups {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin: 1rem 0 0.35rem;
}
.filter-chip-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.filter-chip-group > span {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.filter-chip {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 0.38rem 0.8rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
}
.filter-chip:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}
.filter-chip.is-active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.filter-bar, .form-grid, .action-row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.action-row .btn {
    width: auto;
    flex-shrink: 0;
}
.panel form.filter-bar,
.panel form.dashboard-filters {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: end;
    gap: 0.7rem 1rem;
    margin: 1rem 0 0;
}
.panel form.dashboard-filters .btn-inline {
    align-self: end;
}
.filter-field {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    min-width: 0;
}
.filter-field span {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}
.filter-field--search { flex: 1 1 220px; }
.filter-field--search input { width: 100%; }
.filter-field select { min-width: 11rem; }
.filter-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding-bottom: 0.05rem;
}
.filter-bar input:not([type="checkbox"]):not([type="hidden"]),
.filter-bar select,
.panel input:not([type="checkbox"]):not([type="hidden"]),
.panel textarea,
.panel select {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.55rem 0.7rem;
    font: inherit;
    background: #fff;
}
.legal-editor {
    min-height: 22rem;
    width: 100%;
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    line-height: 1.45;
}
.panel input[type="checkbox"],
.filter-bar input[type="checkbox"] {
    appearance: auto;
    width: 1.15rem;
    height: 1.15rem;
    min-width: 1.15rem;
    padding: 0;
    margin: 0.2rem 0.45rem 0 0;
    border: 1px solid var(--line);
    border-radius: 4px;
    accent-color: var(--accent);
    cursor: pointer;
    background: #fff;
    flex-shrink: 0;
}
.confirm-check {
    align-items: flex-start !important;
    flex-wrap: wrap;
    max-width: 46rem;
    line-height: 1.45;
}
.confirm-check .field-error {
    flex: 1 0 100%;
    margin: 0.15rem 0 0 1.6rem;
    font-weight: 600;
}
.confirm-check--error input[type="checkbox"] {
    outline: 2px solid var(--danger);
    outline-offset: 2px;
}
.panel form { display: flex; flex-direction: column; gap: 0.8rem; }
.panel label { display: flex; flex-direction: column; gap: 0.3rem; font-weight: 600; }
.field-hint {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--muted);
    line-height: 1.4;
}
.password-field {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.45rem;
    align-items: center;
}
.password-field input {
    min-width: 0;
}
.password-toggle {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--muted);
    border-radius: 10px;
    padding: 0.55rem 0.75rem;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 650;
    cursor: pointer;
    white-space: nowrap;
}
.password-toggle[aria-pressed="true"] {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: transparent;
}
.form-section {
    margin: 0;
    padding: 1rem 1.05rem 1.15rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-muted);
    display: grid;
    gap: 0.85rem;
}
.form-section h2 {
    margin: 0;
    font-size: 0.95rem;
}
.rule-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: 0.85rem 1rem;
}
.howto-card {
    margin: 0;
    padding: 0.95rem 1.05rem;
    border: 1px solid #a7f3d0;
    background: #ecfdf5;
    border-radius: 12px;
    color: #065f46;
}
.howto-card h2 { margin: 0; font-size: 0.95rem; }
.howto-card ol {
    margin: 0.5rem 0 0;
    padding-left: 1.2rem;
    font-size: 0.9rem;
    font-weight: 500;
}
.howto-card li { margin: 0.2rem 0; }
.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
    margin-top: 0.25rem;
}
.panel label.check-inline {
    flex-direction: row;
    align-items: center;
    font-weight: 500;
}
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { text-align: left; padding: 0.7rem 0.55rem; border-bottom: 1px solid var(--line); font-size: 0.92rem; vertical-align: top; }
.data-table th { color: var(--muted); font-size: 0.75rem; letter-spacing: 0.04em; text-transform: uppercase; }
.data-table tbody tr:hover { background: var(--surface-muted); }
.data-table .muted { color: var(--muted); }
.company-cell { display: flex; flex-direction: column; gap: 0.15rem; }
.company-cell a { font-weight: 650; text-decoration: none; }
.company-cell a:hover { text-decoration: underline; }
.pager { display: flex; gap: 1rem; align-items: center; margin-top: 1rem; color: var(--muted); }
.plain-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.provenance-item {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--line);
}
.provenance-list .provenance-item:last-child { border-bottom: 0; padding-bottom: 0; }
.provenance-title { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: baseline; }
.external-link { font-weight: 650; text-decoration: none; }
.external-link:hover { text-decoration: underline; }
.inline-form { display: inline; }
.panel form.inline-form {
    display: inline;
    flex-direction: unset;
    gap: unset;
}
.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    align-items: center;
}
td.row-actions {
    flex-wrap: nowrap;
    white-space: nowrap;
}
.link-button {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    color: var(--accent);
    cursor: pointer;
    text-decoration: none;
}
.link-button:hover { text-decoration: underline; }
.link-button--danger { color: var(--danger); }
.prewrap { white-space: pre-wrap; }
.empty-state { text-align: center; }
.lead-status { display: inline-block; border-radius: 999px; padding: 0.15rem 0.6rem; font-size: 0.78rem; font-weight: 700; background: #e2e8f0; }
.lead-status--new { background: #e0f2fe; }
.lead-status--enriched { background: #f1f5f9; }
.lead-status--qualified { background: #dcfce7; }
.lead-status--contacted { background: #fef9c3; }
.lead-status--interested { background: #ffedd5; }
.lead-status--demoscheduled { background: #ede9fe; }
.lead-status--customer { background: #ccfbf1; }
.lead-status--rejected { background: #fee2e2; }
.lead-status--suppressed { background: #e2e8f0; color: #64748b; }
.crawl-status-label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}
.status-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: var(--accent);
    animation: crawl-pulse 1s ease-in-out infinite;
}
.crawl-progress {
    height: 8px;
    background: var(--line);
    border-radius: 999px;
    overflow: hidden;
    margin: 0.9rem 0 0.45rem;
}
.crawl-progress.is-hidden { display: none; }
.crawl-progress-bar {
    height: 100%;
    width: 0;
    background: var(--accent);
    transition: width 0.25s ease;
}
.crawl-progress.is-indeterminate .crawl-progress-bar {
    width: 32%;
    animation: crawl-indeterminate 1.2s ease-in-out infinite;
}
.crawl-hint { min-height: 1.2em; }
@keyframes crawl-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}
@keyframes crawl-indeterminate {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(320%); }
}
.run-status { display: inline-block; border-radius: 999px; padding: 0.15rem 0.6rem; font-size: 0.78rem; font-weight: 700; background: #e2e8f0; }
.run-status--queued { background: #e0f2fe; }
.run-status--running { background: #fef9c3; }
.run-status--completed { background: #dcfce7; }
.run-status--partiallycompleted { background: #ffedd5; }
.run-status--failed { background: #fee2e2; }
.run-status--cancelled { background: #e2e8f0; color: #64748b; }
.run-status--authenticating { background: #fef9c3; }
.run-status--authenticated { background: #dcfce7; }
.run-status--needsreauthentication { background: #ffedd5; }
.confidence-badge { display: inline-block; border-radius: 999px; padding: 0.15rem 0.6rem; font-size: 0.78rem; font-weight: 700; }
.confidence-badge--high { background: #fee2e2; color: #991b1b; }
.confidence-badge--medium { background: #ffedd5; color: #9a3412; }
.confidence-badge--low { background: #e2e8f0; color: #475569; }
.signal-list { margin: 0.4rem 0 0.8rem; padding-left: 1.1rem; }
.duplicate-warning {
    margin: 0.7rem 0 0;
    padding: 0.65rem 0.8rem;
    border: 1px solid #fcd34d;
    background: #fffbeb;
    border-radius: 10px;
    font-weight: 650;
}
.score-level { display: inline-block; border-radius: 999px; padding: 0.15rem 0.6rem; font-size: 0.78rem; font-weight: 700; }
.score-level--high { background: #dcfce7; color: #166534; }
.score-level--medium { background: #fef9c3; color: #854d0e; }
.score-level--low { background: #ffedd5; color: #9a3412; }
.score-level--unqualified { background: #e2e8f0; color: #475569; }
.qualification-matches { margin: 0.4rem 0 0.8rem; padding-left: 1.1rem; }
.qualification-matches li { display: flex; gap: 0.55rem; flex-wrap: wrap; }
.product-fit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 0.9rem;
}
.product-fit-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.9rem 1rem;
    background: var(--surface-muted);
}
.product-fit-card h3 { margin: 0 0 0.35rem; }
.product-fit-score { font-size: 1.35rem; font-weight: 700; margin: 0.2rem 0; }
.ai-status { display: inline-block; margin-left: 0.35rem; font-size: 0.75rem; font-weight: 650; }
.ai-status--completed { color: #166534; }
.ai-status--pending { color: #854d0e; }
.ai-status--stale { color: #9a3412; }
.ai-status--failed { color: #b91c1c; }
.ai-status--disabled { color: #64748b; }
.ai-status--notanalyzed { color: #64748b; }
.ai-pill { display: inline-block; margin-left: 0.35rem; border-radius: 999px; padding: 0.05rem 0.4rem; font-size: 0.68rem; font-weight: 700; background: #e0e7ff; color: #3730a3; }
.panel form.review-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.9rem;
}
.review-actions .review-note {
    flex: none;
    min-width: 0;
    max-width: 36rem;
}
.review-actions .row-actions {
    flex-wrap: wrap;
    white-space: normal;
}
.task-overdue { background: #fff7ed; }
.overdue-pill {
    display: inline-block;
    margin-left: 0.35rem;
    border-radius: 999px;
    padding: 0.05rem 0.45rem;
    font-size: 0.72rem;
    font-weight: 700;
    background: #ffedd5;
    color: #9a3412;
}
.crm-timeline li {
    padding-bottom: 0.7rem;
    border-bottom: 1px solid var(--line);
}
.crm-timeline li:last-child { border-bottom: 0; padding-bottom: 0; }

.lead-jump-nav {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0 0 1rem;
    padding: 0.55rem 0.65rem;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    border: 1px solid var(--line);
    border-radius: 12px;
    backdrop-filter: blur(8px);
}
.lead-jump-nav a {
    text-decoration: none;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 650;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
}
.lead-jump-nav a:hover {
    color: var(--ink);
    background: var(--surface-muted);
}
#overview, #crm, #product-fit, #contacts, #addresses, #website-enrichment, #provenance, #qualification-preview {
    scroll-margin-top: 4rem;
}

.crm-tabs { margin-top: 0.4rem; }
.crm-tab-input { position: absolute; opacity: 0; pointer-events: none; }
.crm-tab-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0 0 0.9rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--line);
}
.crm-tab-label {
    cursor: pointer;
    font-weight: 650;
    font-size: 0.86rem;
    color: var(--muted);
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    border: 1px solid transparent;
}
.crm-tab-label:hover { color: var(--ink); background: var(--surface-muted); }
.crm-tab-panel { display: none; }
.crm-tab-panel h3 { margin: 0 0 0.55rem; font-size: 0.95rem; }

.crm-tabs:has(input.crm-tab-input:nth-of-type(1):checked) .crm-tab-panel--overview,
.crm-tabs:has(input.crm-tab-input:nth-of-type(2):checked) .crm-tab-panel--opportunities,
.crm-tabs:has(input.crm-tab-input:nth-of-type(3):checked) .crm-tab-panel--tasks,
.crm-tabs:has(input.crm-tab-input:nth-of-type(4):checked) .crm-tab-panel--timeline,
.crm-tabs:has(input.crm-tab-input:nth-of-type(5):checked) .crm-tab-panel--notes {
    display: block;
}

.crm-tabs:has(input.crm-tab-input:nth-of-type(1):checked) .crm-tab-nav label:nth-child(1),
.crm-tabs:has(input.crm-tab-input:nth-of-type(2):checked) .crm-tab-nav label:nth-child(2),
.crm-tabs:has(input.crm-tab-input:nth-of-type(3):checked) .crm-tab-nav label:nth-child(3),
.crm-tabs:has(input.crm-tab-input:nth-of-type(4):checked) .crm-tab-nav label:nth-child(4),
.crm-tabs:has(input.crm-tab-input:nth-of-type(5):checked) .crm-tab-nav label:nth-child(5) {
    color: var(--ink);
    background: var(--surface-muted);
    border-color: var(--line);
}

.crm-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 1rem;
}
.crm-summary-line { margin: 0.2rem 0; }
.crm-scroll-list {
    max-height: 22rem;
    overflow: auto;
    padding-right: 0.25rem;
}
.crm-collapse {
    margin: 0.7rem 0 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.55rem 0.75rem;
    background: var(--surface-muted);
}
.crm-collapse > summary {
    cursor: pointer;
    font-weight: 650;
    list-style: none;
}
.crm-collapse > summary::-webkit-details-marker { display: none; }
.crm-collapse[open] > summary { margin-bottom: 0.55rem; }
.crm-add-note { margin-bottom: 0.8rem; }
.product-fit-card .row-actions { margin-top: 0.55rem; }

/* Sales pipeline board (Iteration 9.3) — drag & drop Kanban */
.pipeline-board {
    display: grid;
    grid-template-columns: repeat(var(--pipeline-cols, 4), minmax(0, 1fr));
    gap: 0.5rem;
    width: 100%;
    overflow-x: hidden;
    align-items: stretch;
}
.pipeline-board-empty {
    margin: 0.5rem 0 1rem;
}
.pipeline-column {
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 13.5rem);
}
.pipeline-column-terminal {
    border-style: dashed;
    opacity: 0.95;
}
.pipeline-column-header {
    padding: 0.65rem 0.7rem 0.5rem;
    border-bottom: 1px solid var(--line);
    background: var(--surface-muted);
    border-radius: 12px 12px 0 0;
}
.pipeline-column-header h2 {
    margin: 0 0 0.2rem;
    font-size: 0.88rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pipeline-column-header .muted { margin: 0.1rem 0; font-size: 0.75rem; }
.pipeline-column-totals {
    list-style: none;
    margin: 0.25rem 0 0;
    padding: 0;
    font-size: 0.74rem;
    color: var(--muted);
    overflow-wrap: anywhere;
}
.pipeline-view-all {
    display: inline-block;
    margin-top: 0.3rem;
    font-size: 0.76rem;
}
.pipeline-column-cards {
    padding: 0.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-height: 4.5rem;
}
.pipeline-empty {
    margin: 0.4rem 0.15rem;
    font-size: 0.82rem;
}
.pipeline-card {
    position: relative;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.55rem 0.6rem;
    background: var(--surface);
    user-select: none;
}
.pipeline-card-draggable {
    padding-left: 1.35rem;
    cursor: grab;
}
.pipeline-card-draggable:active {
    cursor: grabbing;
}
.pipeline-card-handle {
    position: absolute;
    left: 0.2rem;
    top: 0.5rem;
    width: 0.85rem;
    height: 1.1rem;
    color: var(--muted);
    pointer-events: none;
}
.pipeline-card-handle svg {
    display: block;
    width: 100%;
    height: 100%;
}
.pipeline-card h3 {
    margin: 0 0 0.15rem;
    font-size: 0.84rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
}
.pipeline-card .muted { margin: 0 0 0.35rem; font-size: 0.75rem; overflow-wrap: anywhere; }
.pipeline-card-meta {
    display: grid;
    gap: 0.15rem;
    margin: 0;
}
.pipeline-card-meta div {
    display: grid;
    grid-template-columns: minmax(3.1rem, 34%) 1fr;
    gap: 0.25rem;
    font-size: 0.72rem;
}
.pipeline-card-meta dt {
    margin: 0;
    color: var(--muted);
    font-weight: 600;
}
.pipeline-card-meta dd { margin: 0; overflow-wrap: anywhere; min-width: 0; }
.pipeline-product-chip {
    display: inline-block;
    max-width: 100%;
    padding: 0.05rem 0.35rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface-muted);
    font-size: 0.7rem;
    overflow-wrap: anywhere;
}
.pipeline-card-actions {
    margin: 0.4rem 0 0;
}
.pipeline-card-actions .btn {
    width: 100%;
    justify-content: center;
    padding: 0.4rem 0.45rem;
    font-size: 0.78rem;
}
.pipeline-card-overdue {
    border-color: #c9852d;
    box-shadow: inset 3px 0 0 #c9852d;
}
.pipeline-overdue-text {
    color: #9a5b00;
    font-weight: 600;
}
.pipeline-card-pending {
    opacity: 0.55;
    pointer-events: none;
}
.pipeline-card-ghost {
    opacity: 0.35;
}
.pipeline-card-chosen {
    box-shadow: 0 0 0 2px var(--accent, #2f6fed);
}
@media (max-width: 800px) {
    .pipeline-board {
        display: flex;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
    }
    .pipeline-column {
        flex: 0 0 min(16rem, 82vw);
        min-width: min(16rem, 82vw);
        max-height: none;
    }
}
.pipeline-toast {
    position: sticky;
    top: 0.75rem;
    z-index: 20;
    margin: 0 0 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    background: var(--surface-muted);
    border: 1px solid var(--line);
}
.pipeline-toast-error {
    border-color: #b42318;
    color: #7a1c14;
}
.pipeline-dialog {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0;
    max-width: 26rem;
    width: calc(100% - 2rem);
}
.pipeline-dialog::backdrop {
    background: rgba(20, 24, 33, 0.45);
}
.pipeline-dialog-form {
    display: grid;
    gap: 0.75rem;
    padding: 1rem 1.1rem 1.1rem;
}
.pipeline-dialog-form h2 {
    margin: 0;
    font-size: 1.05rem;
}
.pipeline-dialog-form label {
    display: grid;
    gap: 0.35rem;
}
.pipeline-dialog-form textarea,
.pipeline-dialog-form select {
    width: 100%;
}
@media (max-width: 720px) {
    .pipeline-column {
        flex-basis: 15.5rem;
        min-width: 15.5rem;
        max-height: calc(100vh - 11rem);
    }
}
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.nav-section {
    margin: 1rem 0.8rem 0.35rem;
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    font-weight: 700;
    color: rgba(226, 232, 240, 0.45);
    text-transform: uppercase;
}

.workspace-list {
    list-style: none;
    margin: 1.2rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.65rem;
}
.workspace-choice {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    text-align: left;
}
.workspace-choice-name { font-weight: 650; }
.workspace-choice-meta { font-size: 0.85rem; opacity: 0.85; }

.workspace-switcher {
    position: relative;
}
.workspace-switcher > summary {
    list-style: none;
    cursor: pointer;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.35rem 0.7rem;
    background: var(--surface-muted);
    font-size: 0.88rem;
    font-weight: 600;
}
.workspace-switcher > summary::-webkit-details-marker { display: none; }
.workspace-switcher-role,
.workspace-switcher-static .workspace-switcher-role {
    margin-left: 0.35rem;
    color: var(--muted);
    font-weight: 500;
}
.workspace-switcher-static {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
}
.workspace-switcher-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 0.35rem);
    min-width: 220px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 0.35rem;
    z-index: 40;
    display: grid;
    gap: 0.2rem;
}
.workspace-switcher-item {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    border: 0;
    background: transparent;
    border-radius: 8px;
    padding: 0.55rem 0.65rem;
    cursor: pointer;
    text-align: left;
}
.workspace-switcher-item:hover,
.workspace-switcher-item.is-active {
    background: var(--accent-soft);
}
.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: end;
}
.status-banner {
    background: var(--accent-soft);
    color: var(--accent);
    padding: 0.7rem 0.9rem;
    border-radius: 10px;
}
.status-banner.is-error {
    background: #fef2f2;
    color: var(--danger);
}
.panel > .form-section { margin-top: 1.15rem; }
.panel > .action-row { margin-top: 1.15rem; }

.language-switcher {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}
.language-switcher-icon {
    display: inline-flex;
    width: 1.05rem;
    height: 1.05rem;
    margin-right: 0.15rem;
    color: var(--muted);
}
.language-switcher-icon svg { width: 100%; height: 100%; }
.language-switcher-form { display: inline; }
.language-switcher-btn {
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 8px;
    padding: 0.28rem 0.55rem;
    font-size: 0.8rem;
    cursor: pointer;
}
.language-switcher-btn.is-active {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 650;
    border-color: transparent;
}
.topbar-user { flex-wrap: wrap; }
.dashboard-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: end;
    margin: 1rem 0 0;
}
.dashboard-filters label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.82rem;
    color: var(--muted);
}
.dashboard-filters input,
.dashboard-filters select {
    min-width: 9rem;
}
.dashboard-kpis {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.report-hub {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
}
.stat-value--multi {
    font-size: 1.05rem;
    font-weight: 700;
    word-break: break-word;
}
.stat-delta {
    font-size: 0.78rem;
    color: var(--accent);
    font-weight: 650;
}
.dashboard-empty {
    margin: 1rem 0 0;
    padding: 0.85rem 1rem;
    background: var(--accent-soft);
    border-radius: 12px;
}
.dashboard-funnel {
    display: grid;
    gap: 0.45rem;
    margin: 0.8rem 0 0;
    padding: 0;
    list-style: none;
}
.dashboard-funnel li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.55rem 0.75rem;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: 10px;
}
.dashboard-chart {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0.35rem 0 0.5rem;
}
.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    margin: 0.45rem 0 0;
    padding: 0;
    list-style: none;
    font-size: 0.82rem;
    color: var(--text);
}
.chart-legend li { display: inline-flex; align-items: center; gap: 0.4rem; }
.chart-swatch {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 3px;
    flex-shrink: 0;
}
.chart-details { margin: 0.4rem 0 0; }
.chart-details summary {
    cursor: pointer;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 650;
}
@media (max-width: 900px) {
    .dashboard-kpis { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
    .dashboard-filters { flex-direction: column; align-items: stretch; }
}
.help-context {
    max-width: min(22rem, 100%);
    min-width: 0;
    flex: 0 1 22rem;
    white-space: normal;
}
.help-context-summary {
    cursor: pointer;
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: var(--accent);
    white-space: nowrap;
}
.help-context-summary::-webkit-details-marker { display: none; }
.help-context-body {
    margin-top: 0.5rem;
    padding: 0.75rem 0.9rem;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 0.9rem;
    white-space: normal;
    overflow-wrap: break-word;
}
.help-context-body p { margin: 0 0 0.5rem; }
.help-search { margin: 1rem 0; flex-wrap: wrap; }
.help-topic-list { display: grid; gap: 0.75rem; }
.help-topic-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.9rem 1rem;
    background: var(--surface);
}
.help-article .help-steps { padding-left: 1.2rem; }
.help-important {
    background: var(--accent-soft);
    padding: 0.75rem 1rem;
    border-radius: 10px;
}
.onboarding-card { border: 1px solid var(--accent); }
.onboarding-steps {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
    display: grid;
    gap: 0.75rem;
}
.onboarding-step {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 0.85rem 1rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-muted);
    flex-wrap: wrap;
}
.onboarding-step.is-done { border-color: var(--accent); }
.onboarding-step.is-optional { border-style: dashed; }
.onboarding-step-title { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin: 0; }
.onboarding-state { font-weight: 700; }
.quick-actions-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.role-help { margin: 0 0 1rem; padding: 0.85rem 1rem; background: var(--surface-muted); border-radius: 12px; }
.role-help p { margin: 0.25rem 0; }
.platform-workspace-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.2rem;
    background: #0f3d38;
    color: #f4fffc;
    border-bottom: 3px solid var(--accent);
    flex-wrap: wrap;
}
.platform-workspace-banner strong { display: block; font-size: 1.05rem; }
.platform-workspace-banner p { margin: 0.2rem 0 0; }
.platform-workspace-banner .muted { color: #c5e8e0; }
.platform-workspace-banner .btn-primary {
    background: #fff;
    color: #0f3d38;
}
.platform-workspace-crumb {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    font-size: 0.85rem;
}
.platform-workspace-crumb a { color: #d7fff4; }
.platform-workspace-badge {
    font-size: 0.82rem;
    font-weight: 650;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: var(--accent-soft);
}
.account-menu { position: relative; }
.account-menu-summary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    list-style: none;
    font-size: 0.85rem;
    max-width: 16rem;
}
.account-menu-summary::-webkit-details-marker { display: none; }
.account-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid rgba(15, 118, 110, 0.18);
}
.account-avatar svg { width: 1.05rem; height: 1.05rem; }
.account-menu-email {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
}
.account-menu-identity {
    margin: 0.15rem 0.6rem 0.45rem;
    font-size: 0.75rem;
    color: var(--muted);
    word-break: break-all;
}
.account-menu-panel {
    position: absolute;
    right: 0;
    top: 2.6rem;
    min-width: 16rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.4rem;
    z-index: 20;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.account-menu-item, .account-menu-panel form button {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    text-align: left;
    background: none;
    border: 0;
    padding: 0.5rem 0.6rem;
    border-radius: 8px;
    color: inherit;
    text-decoration: none;
    font: inherit;
    cursor: pointer;
}
.account-menu-icon {
    display: inline-flex;
    width: 1.1rem;
    height: 1.1rem;
    flex-shrink: 0;
    color: var(--muted);
}
.account-menu-icon svg { width: 100%; height: 100%; display: block; }
.account-menu-item:hover, .account-menu-panel form button:hover { background: var(--surface-muted); }
.account-menu-item.is-active { background: var(--accent-soft); color: var(--accent); }
.account-menu-item.is-active .account-menu-icon { color: var(--accent); }
.account-menu-signout { color: var(--danger); }
.account-menu-signout .account-menu-icon { color: var(--danger); }
.account-menu-sep {
    height: 1px;
    background: var(--line);
    margin: 0.35rem 0.45rem;
}
.account-menu-heading { margin: 0.4rem 0.6rem 0.2rem; font-size: 0.75rem; color: var(--muted); }
.detail-link {
    margin-left: 0.45rem;
    font-weight: 650;
    white-space: nowrap;
}
.form-subsection {
    margin: 1rem 0 0.35rem;
    font-size: 0.95rem;
}
#mfa, #password { scroll-margin-top: 5rem; }
@media (max-width: 860px) {
    .account-menu-email { display: none; }
}
.mfa-qr {
    width: 12.5rem;
    max-width: 100%;
    padding: 0.75rem;
    margin: 0.75rem 0 0.4rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
}
.mfa-qr svg { display: block; width: 100%; height: auto; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
.empty-state .btn { margin-right: 0.4rem; margin-top: 0.5rem; }
.table-wrap { overflow-x: auto; }
@media (max-width: 900px) {
    .onboarding-step { flex-direction: column; align-items: stretch; }
    .help-topic-card { padding: 0.8rem; }
}

.global-search-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-width: 12rem;
    max-width: 22rem;
    flex: 1;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 8px;
    padding: 0.4rem 0.7rem;
    cursor: pointer;
    color: var(--muted);
    font: inherit;
}
.global-search-trigger-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.global-search-kbd {
    font-size: 0.75rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0.1rem 0.35rem;
    color: var(--muted);
}
.global-search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 80;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 10vh 1rem 1rem;
}
.global-search-overlay[hidden] { display: none; }
.global-search-dialog {
    width: min(40rem, 100%);
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--line);
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
    padding: 0.9rem;
}
.global-search-header { display: flex; gap: 0.6rem; align-items: center; }
.global-search-input {
    flex: 1;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.55rem 0.7rem;
    font: inherit;
}
.global-search-results { margin-top: 0.8rem; max-height: min(60vh, 28rem); overflow: auto; }
.global-search-group { margin: 0 0 0.8rem; }
.global-search-group-title {
    margin: 0 0 0.35rem;
    font-size: 0.78rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--muted);
}
.global-search-hit {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 0.5rem 0.55rem;
    border-radius: 8px;
    cursor: pointer;
    color: inherit;
    font: inherit;
    text-decoration: none;
}
.global-search-hit[aria-selected="true"],
.global-search-hit:hover { background: rgba(15, 23, 42, 0.06); }
.global-search-hit-title { font-weight: 650; }
.global-search-hit-sub { color: var(--muted); font-size: 0.88rem; }
.global-search-empty { margin: 0.8rem 0 0; }
.global-search-hint { margin: 0.5rem 0 0; font-size: 0.85rem; }
.panel label.check-inline {
    flex-direction: row;
    align-items: center;
    gap: 0.55rem;
    font-weight: 500;
}
.panel label.check-inline input[type="checkbox"] {
    width: 1.05rem;
    height: 1.05rem;
    margin: 0;
}
.wizard-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
}
.wizard-step {
    font-size: 0.82rem;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.28rem 0.7rem;
}
.wizard-step.is-active {
    color: inherit;
    border-color: #94a3b8;
    background: var(--surface-muted);
    font-weight: 650;
}
.form-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.9rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.form-card legend {
    font-weight: 700;
    padding: 0 0.35rem;
}
.pricing-disclaimer {
    font-size: 0.95rem;
    line-height: 1.45;
    color: inherit;
    max-width: 48rem;
    margin-top: 1rem;
}
.pricing-features {
    margin: 0.5rem 0 0;
    padding-left: 1.1rem;
    font-size: 0.9rem;
    line-height: 1.4;
}
.data-table-wrap { overflow-x: auto; }
.table-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; }
@media (max-width: 860px) {
    .global-search-trigger { min-width: 0; max-width: none; }
    .global-search-kbd { display: none; }
    .global-search-overlay { padding-top: 1.2rem; align-items: stretch; }
    .global-search-dialog { width: 100%; border-radius: 10px; }
}

