:root {
    --ink: #132126;
    --ink-2: #27444b;
    --muted: #687b82;
    --line: #d8e3e6;
    --line-strong: #b8c9ce;
    --surface: #ffffff;
    --surface-soft: #f7faf9;
    --surface-tint: #eef6f4;
    --nav: #101f24;
    --nav-2: #18333a;
    --accent: #d9f75f;
    --accent-2: #47c6a5;
    --sky: #3f7df6;
    --coral: #e46f56;
    --gold: #b98413;
    --green: #158765;
    --red: #b42318;
    --shadow-sm: 0 8px 24px rgba(19, 33, 38, 0.07);
    --shadow-md: 0 18px 50px rgba(19, 33, 38, 0.11);
    --shadow-lg: 0 32px 90px rgba(19, 33, 38, 0.16);
}

* {
    box-sizing: border-box;
}

html,
body {
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    background:
        linear-gradient(135deg, rgba(217, 247, 95, 0.11), transparent 28rem),
        linear-gradient(315deg, rgba(63, 125, 246, 0.08), transparent 24rem),
        #f3f7f6;
    margin: 0;
}

::selection {
    background: rgba(217, 247, 95, 0.72);
    color: var(--ink);
}

a {
    color: var(--sky);
}

h1,
h2,
h3 {
    color: var(--ink);
    letter-spacing: 0;
}

h2 {
    font-size: 1.05rem;
    font-weight: 820;
    margin: 0 0 10px;
}

p,
li {
    line-height: 1.62;
}

.hero {
    align-items: stretch;
    display: grid;
    gap: 28px;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.84fr);
    min-height: calc(100vh - 132px);
    padding: 22px 0 38px;
}

.hero > div:first-child {
    align-self: center;
}

.hero h1 {
    color: #101f24;
    font-size: clamp(2.6rem, 6vw, 5.8rem);
    font-weight: 880;
    letter-spacing: 0;
    line-height: 0.94;
    margin: 16px 0 24px;
    max-width: 920px;
}

.hero p {
    color: var(--muted);
    font-size: 1.12rem;
    line-height: 1.75;
    max-width: 700px;
}

.hero-actions,
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.stat-strip {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 28px;
    max-width: 720px;
}

.stat-strip div {
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(184, 201, 206, 0.78);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    padding: 13px 14px;
}

.stat-strip strong {
    color: #102329;
    display: block;
    font-size: 1.05rem;
    font-weight: 900;
}

.stat-strip span {
    color: var(--muted);
    display: block;
    font-size: 0.8rem;
    margin-top: 3px;
}

.button,
button.button {
    align-items: center;
    background: #14282e;
    border: 1px solid #14282e;
    border-radius: 8px;
    box-shadow: 0 12px 24px rgba(20, 40, 46, 0.16);
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    font-weight: 780;
    gap: 8px;
    justify-content: center;
    min-height: 42px;
    padding: 10px 15px;
    text-decoration: none;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
}

.button:hover,
button.button:hover {
    background: #1b3941;
    border-color: #1b3941;
    box-shadow: 0 18px 36px rgba(20, 40, 46, 0.2);
    color: #ffffff;
    transform: translateY(-1px);
}

.button.secondary {
    background: rgba(255, 255, 255, 0.88);
    border-color: var(--line);
    box-shadow: var(--shadow-sm);
    color: var(--ink);
}

.button.secondary:hover {
    background: #ffffff;
    border-color: var(--line-strong);
    color: var(--ink);
}

.button.ghost {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    color: var(--ink);
}

.button.ghost:hover {
    background: rgba(255, 255, 255, 0.65);
    color: var(--ink);
}

.section-title {
    align-items: end;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    margin: 0 0 20px;
}

.section-title h1,
.section-title h2 {
    color: #101f24;
    font-size: clamp(1.55rem, 2.6vw, 2.35rem);
    font-weight: 860;
    line-height: 1.08;
    margin: 0;
}

.section-title p {
    color: var(--muted);
    margin: 7px 0 0;
    max-width: 760px;
}

.panel {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.93));
    border: 1px solid rgba(184, 201, 206, 0.82);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    padding: 20px;
    position: relative;
}

.feature-grid .panel {
    min-height: 170px;
}

.feature-grid .panel h2 {
    font-size: 1.14rem;
}

.panel::before,
.metric::before {
    background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--sky));
    border-radius: 8px 8px 0 0;
    content: "";
    height: 3px;
    left: -1px;
    opacity: 0.78;
    position: absolute;
    right: -1px;
    top: -1px;
}

.grid {
    display: grid;
    gap: 16px;
}

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

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

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

.metric {
    background:
        linear-gradient(180deg, #ffffff, #f8fbfb);
    border: 1px solid rgba(184, 201, 206, 0.8);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    min-height: 118px;
    overflow: hidden;
    padding: 18px;
    position: relative;
}

.metric strong {
    color: #102329;
    display: block;
    font-size: 2rem;
    font-weight: 860;
    line-height: 1.05;
}

.metric span {
    color: var(--muted);
    display: block;
    font-size: 0.86rem;
    font-weight: 680;
    margin-top: 7px;
}

.metric-link {
    color: inherit;
    display: block;
    text-decoration: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.metric-link:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-md);
    color: inherit;
    transform: translateY(-2px);
}

.command-center {
    align-items: center;
    background:
        linear-gradient(135deg, #102329, #173f43 58%, #20515c);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    color: #ffffff;
    display: grid;
    gap: 20px;
    grid-template-columns: minmax(0, 1fr) auto;
    margin-bottom: 16px;
    overflow: hidden;
    padding: 22px;
    position: relative;
}

.command-center::after {
    background: linear-gradient(90deg, rgba(217, 247, 95, 0.2), rgba(71, 198, 165, 0.16), rgba(63, 125, 246, 0.16));
    bottom: 0;
    content: "";
    height: 4px;
    left: 0;
    position: absolute;
    right: 0;
}

.command-center h2 {
    color: #ffffff;
    font-size: clamp(1.35rem, 2.2vw, 2rem);
    margin: 12px 0 6px;
}

.command-center p {
    color: #c6d8dc;
    margin: 0;
    max-width: 760px;
}

.command-score {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    min-width: 138px;
    padding: 16px;
    text-align: center;
}

.command-score strong {
    color: var(--accent);
    display: block;
    font-size: 2.3rem;
    font-weight: 900;
    line-height: 1;
}

.command-score span {
    color: #d8e5e8;
    display: block;
    font-size: 0.82rem;
    font-weight: 760;
    margin-top: 7px;
}

.table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.table th,
.table td {
    border-bottom: 1px solid var(--line);
    padding: 13px 11px;
    text-align: left;
    vertical-align: top;
}

.table th {
    background: #f6faf9;
    color: #61777e;
    font-size: 0.76rem;
    font-weight: 820;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.table tbody tr {
    transition: background 160ms ease;
}

.table tbody tr:hover {
    background: #f8fbfb;
}

.pill {
    align-items: center;
    background: #eaf2f2;
    border: 1px solid rgba(184, 201, 206, 0.72);
    border-radius: 999px;
    color: var(--ink-2);
    display: inline-flex;
    font-size: 0.76rem;
    font-weight: 820;
    min-height: 28px;
    padding: 5px 10px;
}

.pill.hot {
    background: #fff0ed;
    border-color: #ffd0c7;
    color: var(--red);
}

.pill.warm {
    background: #fff7df;
    border-color: #f2d58c;
    color: #7a5300;
}

.pill.good {
    background: #e6fbf1;
    border-color: #a6e5cc;
    color: var(--green);
}

.form-grid {
    display: grid;
    gap: 15px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
    display: grid;
    gap: 7px;
}

.field.full {
    grid-column: 1 / -1;
}

label {
    color: var(--ink-2);
    font-size: 0.81rem;
    font-weight: 780;
}

input,
select,
textarea {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #c8d8dd;
    border-radius: 8px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
    color: var(--ink);
    font: inherit;
    min-height: 44px;
    outline: none;
    padding: 10px 12px;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
    width: 100%;
}

input:focus,
select:focus,
textarea:focus {
    background: #ffffff;
    border-color: var(--sky);
    box-shadow: 0 0 0 4px rgba(63, 125, 246, 0.11);
}

textarea {
    min-height: 118px;
    resize: vertical;
}

pre.output {
    background:
        linear-gradient(180deg, #10242a, #0b1a1f);
    border: 1px solid #24454d;
    border-radius: 8px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    color: #e8f6f8;
    font-size: 0.84rem;
    line-height: 1.58;
    max-height: 460px;
    overflow: auto;
    padding: 16px;
    white-space: pre-wrap;
}

.chat-shell {
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(0, 1fr) 340px;
}

.chat-log {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(247, 251, 250, 0.97));
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 540px;
    overflow: auto;
    padding: 18px;
}

.message {
    border: 1px solid transparent;
    border-radius: 8px;
    box-shadow: 0 5px 14px rgba(19, 33, 38, 0.07);
    max-width: min(80%, 720px);
    padding: 12px 14px;
}

.message.user {
    align-self: flex-end;
    background: #eaf1ff;
    border-color: #ceddff;
}

.message.agent {
    align-self: flex-start;
    background: #ffffff;
    border-color: var(--line);
}

.signal-map {
    align-self: stretch;
    background:
        linear-gradient(90deg, rgba(19, 33, 38, 0.08) 1px, transparent 1px),
        linear-gradient(rgba(19, 33, 38, 0.06) 1px, transparent 1px),
        linear-gradient(145deg, #ffffff, #f1f8f5);
    background-size: 34px 34px, 34px 34px, auto;
    border: 1px solid rgba(184, 201, 206, 0.9);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    min-height: 540px;
    overflow: hidden;
    position: relative;
}

.auth-shell {
    align-items: start;
    margin: 18px auto 0;
    max-width: 1120px;
}

.auth-shell h1 {
    color: #101f24;
    font-size: clamp(2.2rem, 4vw, 4rem);
    font-weight: 880;
    line-height: 0.98;
    margin: 16px 0;
    max-width: 620px;
}

.auth-shell > div:first-child {
    padding: 18px 0;
}

.signal-map::before {
    background: linear-gradient(90deg, rgba(217, 247, 95, 0.24), rgba(71, 198, 165, 0.18), rgba(63, 125, 246, 0.15));
    content: "";
    height: 88px;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
}

.signal-card {
    background: rgba(255, 255, 255, 0.93);
    border: 1px solid rgba(184, 201, 206, 0.86);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    left: 38px;
    padding: 20px;
    position: absolute;
    top: 42px;
    width: calc(100% - 76px);
}

.signal-card h2 {
    color: #102329;
    font-size: 1.18rem;
    font-weight: 850;
    margin: 0 0 12px;
}

.signal-row {
    align-items: center;
    border-top: 1px solid var(--line);
    display: flex;
    gap: 13px;
    padding: 14px 0;
}

.signal-row:first-of-type {
    border-top: 0;
}

.dot {
    background: var(--accent);
    border: 4px solid #eef8c5;
    border-radius: 999px;
    box-shadow: 0 0 0 5px rgba(217, 247, 95, 0.2);
    flex: 0 0 auto;
    height: 18px;
    width: 18px;
}

.muted {
    color: var(--muted);
}

.notice-panel {
    margin-bottom: 16px;
}

.notice-panel p {
    margin: 12px 0 0;
}

.billing-hero {
    align-items: center;
    background: linear-gradient(135deg, #102329, #173f43 58%, #20515c);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    color: #ffffff;
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 1fr) auto;
    margin-bottom: 16px;
    overflow: hidden;
    padding: 22px;
    position: relative;
}

.billing-hero h2 {
    color: #ffffff;
    font-size: clamp(1.45rem, 2.6vw, 2.35rem);
    margin: 12px 0 8px;
}

.billing-hero p {
    color: #c6d8dc;
    margin: 0;
}

.billing-total {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    min-width: 170px;
    padding: 16px;
    text-align: center;
}

.billing-total strong {
    color: var(--accent);
    display: block;
    font-size: 2.25rem;
    font-weight: 900;
}

.billing-total span {
    color: #d8e5e8;
    font-size: 0.84rem;
    font-weight: 760;
}

.usage-metric small {
    color: var(--muted);
    display: block;
    font-size: 0.78rem;
    margin-top: 8px;
}

.usage-track {
    background: #e8f0f1;
    border-radius: 999px;
    height: 8px;
    margin-top: 15px;
    overflow: hidden;
}

.usage-track span {
    background: linear-gradient(90deg, var(--accent-2), var(--sky));
    display: block;
    height: 100%;
    margin: 0;
}

.billing-plans {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-top: 16px;
}

.plan-card {
    background: linear-gradient(180deg, #ffffff, #f8fbfb);
    border: 1px solid rgba(184, 201, 206, 0.82);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 100%;
    padding: 18px;
    position: relative;
}

.plan-card.current {
    border-color: rgba(71, 198, 165, 0.86);
    box-shadow: var(--shadow-md);
}

.plan-heading {
    align-items: start;
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.plan-heading h2 {
    margin: 0 0 4px;
}

.plan-heading p,
.plan-price span {
    color: var(--muted);
    margin: 0;
}

.plan-price strong {
    color: #102329;
    font-size: 2rem;
    font-weight: 900;
}

.plan-limits {
    display: grid;
    gap: 7px;
}

.plan-limits span {
    background: #f0f6f6;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink-2);
    font-size: 0.78rem;
    font-weight: 760;
    padding: 7px 9px;
}

.plan-card ul {
    color: var(--muted);
    margin: 0;
    padding-left: 18px;
}

.plan-card form {
    margin-top: auto;
}

.plan-card button {
    width: 100%;
}

.plan-card button:disabled {
    cursor: not-allowed;
    opacity: 0.62;
    transform: none;
}

@media (max-width: 1100px) {
    .hero,
    .chat-shell,
    .grid.two,
    .grid.three,
    .grid.four,
    .billing-plans {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: auto;
    }

    .command-center {
        grid-template-columns: 1fr;
    }

    .billing-hero {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .section-title {
        align-items: start;
        flex-direction: column;
    }

    .hero h1 {
        font-size: 2.55rem;
    }

    .message {
        max-width: 94%;
    }

    .stat-strip {
        grid-template-columns: 1fr;
    }
}

/* ============================================================================
   v2 production-hardening additions
   - Notification bell, notification list
   - Severity pills (info / success / warning / critical)
   - Plan & status pills, super-admin metrics, danger button, cancel panel
   ============================================================================ */

.top-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.notification-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: #f4f7f8;
    color: #12343b;
    text-decoration: none;
    font-size: 18px;
    transition: background-color 0.15s ease;
}

.notification-bell:hover {
    background: #e2ecf0;
}

.notification-bell.has-unread {
    background: #fff3e0;
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #d24d3e;
    color: white;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    padding: 3px 6px;
    border-radius: 999px;
    min-width: 18px;
    text-align: center;
}

.nav-section {
    margin: 16px 14px 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.55);
}

/* Notification list */
.notification-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification {
    border: 1px solid #e3eaec;
    border-radius: 10px;
    padding: 14px 16px;
    background: white;
    transition: border-color 0.15s ease;
}

.notification.unread {
    border-left: 4px solid #12343b;
    background: #f8fbfc;
}

.notification.read {
    opacity: 0.85;
}

.notification.severity-warning {
    border-left-color: #c97a18;
}

.notification.severity-critical {
    border-left-color: #d24d3e;
}

.notification.severity-success {
    border-left-color: #2f8a3d;
}

.notification-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    margin-bottom: 6px;
}

.notification h3 {
    margin: 4px 0 6px;
    font-size: 16px;
}

.notification p {
    margin: 0;
    color: #2c4046;
}

.link-button {
    border: 0;
    background: none;
    color: #12343b;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    font: inherit;
}

/* Severity pills */
.pill.severity-info,
.severity-info {
    background: #e0ecf2;
    color: #12343b;
}

.pill.severity-success,
.severity-success {
    background: #dcefdf;
    color: #1f5b29;
}

.pill.severity-warning,
.severity-warning {
    background: #fce6c9;
    color: #8a4f0e;
}

.pill.severity-critical,
.severity-critical {
    background: #fadcd8;
    color: #8a2818;
}

/* Plan pills */
.pill.plan-free       { background: #e3eaec; color: #4a5b60; }
.pill.plan-starter    { background: #d2e6ea; color: #12343b; }
.pill.plan-professional { background: #c2e0c9; color: #1c5c2a; }
.pill.plan-agency     { background: #d6cef0; color: #3a2674; }
.pill.plan-enterprise { background: #f3d18a; color: #6a440b; }

/* Status pills */
.pill.status-active    { background: #dcefdf; color: #1f5b29; }
.pill.status-trial     { background: #e0ecf2; color: #12343b; }
.pill.status-pastdue   { background: #fce6c9; color: #8a4f0e; }
.pill.status-cancelled { background: #fadcd8; color: #8a2818; }
.pill.status-suspended { background: #f0d8d4; color: #6a2114; }

/* Super-admin metrics */
.metrics-grid .metric {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.metric-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6a7d83;
}

.metric-value {
    font-size: 28px;
    font-weight: 700;
    color: #12343b;
}

/* Danger button */
.button.danger {
    background: #c2412e;
    color: white;
    border: 0;
}

.button.danger:hover {
    background: #a33523;
}

.button.danger:disabled {
    background: #d9a8a0;
    color: white;
    cursor: not-allowed;
}

/* Inline form spacing for super-admin compose forms */
.panel label {
    display: block;
    margin: 12px 0 4px;
    font-size: 13px;
    font-weight: 600;
    color: #2c4046;
}

.panel label input[type="text"],
.panel label input[type="datetime-local"],
.panel label input:not([type]),
.panel label select,
.panel label textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid #cbd8dc;
    border-radius: 8px;
    font: inherit;
    background: white;
    color: #1a2e34;
}

.panel label textarea {
    resize: vertical;
    min-height: 90px;
}

.checkbox-row {
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-weight: 500 !important;
}

.checkbox-row input {
    width: auto !important;
    margin: 0 !important;
}

/* Cancel-subscription panel */
.cancel-panel {
    margin-top: 16px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    align-items: center;
    border-left: 4px solid #c97a18;
}

.cancel-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

@media (max-width: 768px) {
    .cancel-panel {
        grid-template-columns: 1fr;
    }

    .metrics-grid {
        grid-template-columns: 1fr 1fr !important;
    }
}

@media (max-width: 480px) {
    .metrics-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================================================
   v3 — Modern admin UI: hero banners, stat cards, user grid, tab nav, auth
   ============================================================================ */

/* Empty layout (auth pages) */
.empty-layout {
    min-height: 100vh;
    background: linear-gradient(135deg, #f6f5ff 0%, #eef4ff 50%, #e9f8f3 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-page {
    width: 100%;
    max-width: 460px;
}

.auth-card {
    background: white;
    border-radius: 16px;
    padding: 40px 36px 28px;
    box-shadow: 0 20px 50px -12px rgba(20, 30, 60, 0.18), 0 0 0 1px rgba(20, 30, 60, 0.04);
}

.auth-brand {
    text-align: center;
    margin-bottom: 28px;
}

.brand-mark-large {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
    color: white;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.05em;
    box-shadow: 0 8px 18px -8px rgba(91, 79, 217, 0.6);
}

.auth-brand h1 { margin: 0 0 6px; font-size: 24px; }
.auth-brand p { margin: 0; }

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form .field { display: flex; flex-direction: column; gap: 6px; }
.auth-form label { font-size: 13px; font-weight: 600; color: #2c4046; display: flex; flex-direction: column; gap: 2px; }
.auth-form input {
    padding: 11px 13px;
    border: 1px solid #d2dadd;
    border-radius: 10px;
    font: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.auth-form input:focus {
    outline: none;
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(91, 79, 217, 0.15);
}

.field-mfa input { letter-spacing: 0.4em; font-size: 18px; text-align: center; font-family: ui-monospace, "SF Mono", monospace; }

.muted-small {
    font-size: 11px;
    color: #6a7d83;
    font-weight: 400;
    text-transform: none;
}

.button-block { width: 100%; padding: 12px 20px; font-weight: 600; font-size: 15px; }

.button-primary {
    background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
    color: white;
    border: 0;
    cursor: pointer;
    border-radius: 10px;
    transition: transform 0.05s ease, box-shadow 0.15s ease;
    box-shadow: 0 4px 12px -4px rgba(91, 79, 217, 0.5);
}
.button-primary:hover {
    box-shadow: 0 8px 20px -6px rgba(91, 79, 217, 0.6);
    transform: translateY(-1px);
}
.button-primary:active { transform: translateY(0); }

.auth-footer { margin-top: 20px; text-align: center; font-size: 14px; }
.auth-footer a { color: #0284c7; font-weight: 600; text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }

.auth-help { margin-top: 22px; padding-top: 18px; border-top: 1px solid #ecf0f2; }
.auth-help summary { cursor: pointer; color: #6a7d83; font-size: 13px; }
.demo-accounts { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: #2c4046; }
.demo-accounts strong { display: inline-block; min-width: 100px; color: #0284c7; }

.auth-alert {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.5;
}
.auth-alert span { font-size: 18px; line-height: 1; }
.auth-alert-error { background: #fdecea; color: #8a2818; border: 1px solid #f5c6c0; }
.auth-alert-warning { background: #fff3e0; color: #8a4f0e; border: 1px solid #f5d6a0; }
.auth-alert-success { background: #e6f4ea; color: #1f5b29; border: 1px solid #b9dec1; }

/* ====== Admin hero (Practice Admin style) ====== */
.admin-hero {
    background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
    color: white;
    border-radius: 16px;
    padding: 28px 32px;
    margin-bottom: 18px;
    box-shadow: 0 12px 28px -10px rgba(91, 79, 217, 0.45);
}
.admin-hero h1 { margin: 0 0 6px; color: white; font-size: 22px; }
.admin-hero p { margin: 0; color: rgba(255, 255, 255, 0.88); }
.admin-hero-body { display: flex; align-items: center; gap: 20px; }
.admin-hero-icon { font-size: 30px; }

/* ====== Stat cards ====== */
.stat-strip { gap: 14px; }
.stat-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    border-radius: 14px;
    border: 1px solid #ecf0f2;
    background: white;
    transition: transform 0.1s ease, box-shadow 0.15s ease;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px -10px rgba(20, 30, 60, 0.15);
}
.stat-text { display: flex; flex-direction: column; gap: 4px; }
.stat-card .metric-label { font-size: 11px; }
.stat-card .metric-value { font-size: 28px; }

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}
.stat-icon-purple { background: #e0f2fe; color: #0284c7; }
.stat-icon-orange { background: #fff1d8; color: #c97a18; }
.stat-icon-teal { background: #d4f3eb; color: #0d8b73; }
.stat-icon-green { background: #d6f0d3; color: #2f8a3d; }
.stat-icon-blue { background: #d8e9fb; color: #2168cf; }
.stat-icon-red { background: #fadcd8; color: #c2412e; }

/* ====== Invite panel ====== */
.invite-panel header { margin-bottom: 16px; }
.invite-panel h2 { margin: 0 0 4px; }

.invite-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.invite-field { display: flex; flex-direction: column; gap: 6px; }
.invite-field label { font-size: 11px; font-weight: 700; color: #6a7d83; text-transform: uppercase; letter-spacing: 0.06em; }

.invite-input {
    display: flex;
    border: 1px solid #d2dadd;
    border-radius: 10px;
    overflow: hidden;
}
.invite-input input {
    flex: 1;
    border: 0;
    padding: 10px 12px;
    font-family: ui-monospace, "SF Mono", monospace;
    font-size: 13px;
    background: #f8fafb;
    color: #1a2e34;
}
.invite-input input:focus { outline: none; }
.invite-input button {
    border: 0;
    border-left: 1px solid #d2dadd;
    background: white;
    padding: 0 16px;
    cursor: pointer;
    font-weight: 600;
    color: #2c4046;
    transition: background-color 0.1s ease;
}
.invite-input button:hover { background: #f0f4f5; }

/* ====== User toolbar / search / filters ====== */
.user-toolbar {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.search-input {
    flex: 1;
    min-width: 220px;
    position: relative;
    display: flex;
    align-items: center;
}
.search-input .search-icon {
    position: absolute;
    left: 12px;
    color: #6a7d83;
    pointer-events: none;
}
.search-input input {
    width: 100%;
    padding: 10px 12px 10px 34px;
    border: 1px solid #d2dadd;
    border-radius: 10px;
    font: inherit;
}
.search-input input:focus {
    outline: none;
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(91, 79, 217, 0.15);
}

.filter-tabs {
    display: flex;
    gap: 4px;
    background: #f4f7f8;
    padding: 4px;
    border-radius: 10px;
    flex-wrap: wrap;
}
.filter-tab {
    border: 0;
    background: transparent;
    padding: 7px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #2c4046;
    transition: background-color 0.1s ease, color 0.1s ease;
}
.filter-tab:hover { color: #12343b; }
.filter-tab.active { background: white; color: #0284c7; box-shadow: 0 2px 4px -2px rgba(20, 30, 60, 0.1); }

.toolbar-actions { display: flex; gap: 8px; }

/* ====== User cards grid ====== */
.user-grid {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
}

.user-card {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: transform 0.1s ease, box-shadow 0.15s ease;
}
.user-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -10px rgba(20, 30, 60, 0.12);
}

.user-card-head { display: flex; gap: 14px; align-items: flex-start; }
.user-card-name { flex: 1; min-width: 0; }
.user-card-name h3 {
    margin: 0 0 2px;
    font-size: 16px;
    color: #12343b;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.user-card-name p { margin: 0 0 8px; font-size: 13px; }
.user-card-pills { display: flex; gap: 6px; flex-wrap: wrap; }

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: white;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.avatar-large { width: 48px; height: 48px; font-size: 16px; }

.avatar-purple { background: linear-gradient(135deg, #475569 0%, #64748b 100%); }
.avatar-teal { background: linear-gradient(135deg, #0e7490 0%, #22d3ee 100%); }
.avatar-orange { background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%); }
.avatar-pink { background: linear-gradient(135deg, #0c4a6e 0%, #0ea5e9 100%); }
.avatar-blue { background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%); }
.avatar-green { background: linear-gradient(135deg, #047857 0%, #10b981 100%); }
.avatar-indigo { background: linear-gradient(135deg, #0c4a6e 0%, #0ea5e9 100%); }

.role-pill { font-size: 11px; padding: 3px 10px; }
.role-pill.role-owneradmin, .role-pill.role-superadmin { background: #fff1d8; color: #8a4f0e; }
.role-pill.role-manager { background: #d4f3eb; color: #0d8b73; }
.role-pill.role-employee, .role-pill.role-marketingteammember, .role-pill.role-salesrep { background: #e0f2fe; color: #0284c7; }
.role-pill.role-agencyadmin { background: #dbeafe; color: #0c4a6e; }
.role-pill.role-readonlyuser { background: #e3eaec; color: #4a5b60; }

.status-pill { font-size: 11px; padding: 3px 10px; }
.status-active { background: #d6f0d3; color: #1f5b29; }
.status-pending { background: #fff3e0; color: #8a4f0e; }
.status-rejected { background: #fadcd8; color: #8a2818; }
.status-suspended { background: #f0d8d4; color: #6a2114; }

.you-pill { background: #e0f2fe !important; color: #0284c7 !important; font-weight: 600; padding: 2px 8px; }
.you-marker { font-style: italic; }

.pill-soft { background: #f0f4f5; color: #2c4046; font-weight: 500; }

.user-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 12px;
    border-top: 1px solid #ecf0f2;
}

.button-link-icon {
    border: 0;
    background: none;
    color: #2c4046;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    font: inherit;
    font-size: 12px;
    font-weight: 500;
    transition: background-color 0.1s ease, color 0.1s ease;
}
.button-link-icon:hover { background: #f0f4f5; color: #12343b; }
.button-link-danger { color: #c2412e; }
.button-link-danger:hover { background: #fdecea; color: #8a2818; }
.button-link-success { color: #2f8a3d; }
.button-link-success:hover { background: #e6f4ea; color: #1f5b29; }

.button-link {
    color: #0284c7;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}
.button-link:hover { text-decoration: underline; }

/* ====== Modal ====== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(20, 30, 60, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
}
.modal-card {
    background: white;
    border-radius: 16px;
    padding: 28px 32px;
    max-width: 560px;
    width: 100%;
    box-shadow: 0 30px 60px -16px rgba(20, 30, 60, 0.35);
}
.modal-card h2 { margin-top: 0; }
.modal-actions { margin-top: 20px; display: flex; gap: 8px; justify-content: flex-end; }

/* ====== Super Admin tabs ====== */
.super-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid #ecf0f2;
    margin-bottom: 18px;
    overflow-x: auto;
}
.super-tab {
    padding: 12px 18px;
    border-bottom: 2px solid transparent;
    color: #4a5b60;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.1s ease, border-color 0.1s ease;
    white-space: nowrap;
}
.super-tab:hover { color: #12343b; }
.super-tab.active {
    color: #0284c7;
    border-bottom-color: #0284c7;
}

.grid.five-cols {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

@media (max-width: 1180px) {
    .grid.five-cols { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
    .grid.five-cols { grid-template-columns: 1fr; }
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.panel-head h2 { margin: 0; }

/* MRR strip */
.mrr-strip, .activity-strip {
    display: flex;
    gap: 24px;
    padding: 8px 4px;
    flex-wrap: wrap;
}
.mrr-cell, .activity-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 18px;
    background: #f8fafb;
    border-radius: 10px;
    min-width: 120px;
}
.mrr-cell strong, .activity-cell strong { font-size: 18px; color: #12343b; }

/* Cleaner table */
.table-clean { width: 100%; border-collapse: collapse; }
.table-clean th {
    text-align: left;
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6a7d83;
    border-bottom: 1px solid #ecf0f2;
    background: #f8fafb;
}
.table-clean td {
    padding: 12px 14px;
    border-bottom: 1px solid #f0f4f5;
    vertical-align: middle;
    font-size: 13px;
}
.table-clean tbody tr:hover { background: #fafcfd; }
.action-cell { display: flex; gap: 4px; flex-wrap: wrap; }
.inline-select {
    padding: 5px 8px;
    border: 1px solid #d2dadd;
    border-radius: 6px;
    font: inherit;
    font-size: 12px;
}

.notice-error { border-left: 4px solid #c2412e; background: #fdecea; }

.empty-state { text-align: center; padding: 40px; }

/* Responsive */
@media (max-width: 768px) {
    .invite-fields { grid-template-columns: 1fr; }
    .user-toolbar { flex-direction: column; align-items: stretch; }
    .filter-tabs { overflow-x: auto; }
    .toolbar-actions { justify-content: stretch; }
    .toolbar-actions .button { flex: 1; }
    .admin-hero { padding: 22px; }
    .admin-hero-body { flex-direction: column; align-items: flex-start; gap: 12px; }
}

/* ============================================================================
   v4 — AI-style slick aesthetic
   - Animated gradient orbs on auth shell
   - Split-screen login layout
   - Refined billing hero & plan cards
   - Integration status cards
   - Better typography and motion
   ============================================================================ */

:root {
    /* Primary action color — deep AI blue (was violet/purple) */
    --as-violet: #0284c7;       /* sky-600 — primary blue */
    --as-violet-dark: #075985;  /* sky-800 — primary dark */
    --as-violet-light: #38bdf8; /* sky-400 — primary light */
    /* Accent — cyan, used for highlights and gradients */
    --as-cyan: #06b6d4;         /* cyan-500 */
    /* Secondary accent — kept for any remaining usage but desaturated */
    --as-pink: #14b8a6;         /* repurposed to teal so anything still using it harmonizes */
    --as-bg: #f6f8fb;
    --as-surface: #ffffff;
    --as-border: #e5e9f0;
    --as-text: #0f172a;
    --as-text-soft: #475569;
    --as-text-muted: #64748b;
}

/* ====== Auth split-screen shell ====== */
.auth-shell {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    background: #0a0a16;
    color: white;
}

.auth-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
}

.auth-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.55;
    animation: orbDrift 22s ease-in-out infinite;
}

.auth-orb-1 {
    top: -10%;
    left: -8%;
    width: 480px;
    height: 480px;
    background: radial-gradient(circle, #0284c7 0%, #075985 60%, transparent 100%);
}

.auth-orb-2 {
    top: 38%;
    right: -10%;
    width: 520px;
    height: 520px;
    background: radial-gradient(circle, #14b8a6 0%, #0d9488 60%, transparent 100%);
    animation-delay: -7s;
    animation-duration: 28s;
}

.auth-orb-3 {
    bottom: -12%;
    left: 30%;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, #06b6d4 0%, #0e7490 60%, transparent 100%);
    animation-delay: -14s;
    animation-duration: 26s;
    opacity: 0.4;
}

@keyframes orbDrift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25%      { transform: translate(40px, -30px) scale(1.05); }
    50%      { transform: translate(-30px, 40px) scale(0.95); }
    75%      { transform: translate(20px, 20px) scale(1.02); }
}

.auth-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

.auth-split {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
}

.auth-marketing {
    padding: 56px 64px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: white;
}
.auth-logo .brand-mark-large {
    width: 40px;
    height: 40px;
    font-size: 16px;
    border-radius: 10px;
}
.auth-logo-text {
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.01em;
}

.auth-tag {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(2, 132, 199, 0.15);
    color: #a99bff;
    border: 1px solid rgba(2, 132, 199, 0.35);
    margin-bottom: 24px;
}

.auth-pitch h2 {
    font-size: 38px;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 0 0 18px;
    background: linear-gradient(135deg, #fff 0%, #c5bfff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.auth-pitch p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    line-height: 1.6;
    margin: 0 0 32px;
    max-width: 460px;
}

.auth-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-width: 460px;
}
.auth-features li {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}
.auth-feature-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.2), rgba(20, 184, 166, 0.2));
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a99bff;
    font-size: 16px;
}
.auth-features strong {
    display: block;
    color: white;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}
.auth-features span {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    line-height: 1.5;
}

.auth-fineprint {
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
    margin: 0;
}

.auth-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 56px 64px;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 20px;
    padding: 40px 36px;
    color: var(--as-text);
    box-shadow:
        0 30px 80px -20px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.08);
}

.auth-card-head {
    text-align: center;
    margin-bottom: 28px;
}
.auth-card-head h1 {
    font-size: 26px;
    margin: 0 0 6px;
    letter-spacing: -0.01em;
}
.auth-card-head p {
    margin: 0;
    color: var(--as-text-muted);
    font-size: 14px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-field-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.auth-field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--as-text);
}

.auth-field-help {
    font-size: 12px;
    color: var(--as-violet);
    text-decoration: none;
    font-weight: 500;
}
.auth-field-help:hover { text-decoration: underline; }

.auth-field input,
.auth-field textarea {
    padding: 12px 14px;
    border: 1px solid var(--as-border);
    border-radius: 10px;
    font: inherit;
    font-size: 14px;
    background: var(--as-surface);
    color: var(--as-text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.auth-field input:focus,
.auth-field textarea:focus {
    outline: none;
    border-color: var(--as-violet);
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.12);
}

.auth-field-mfa {
    padding: 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.06) 0%, rgba(20, 184, 166, 0.04) 100%);
    border: 1px solid rgba(2, 132, 199, 0.18);
    animation: mfaSlide 0.35s ease-out;
}
@keyframes mfaSlide {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.auth-field-mfa input {
    text-align: center;
    letter-spacing: 0.5em;
    font-family: ui-monospace, "SF Mono", monospace;
    font-size: 18px;
    font-weight: 600;
}
.auth-hint {
    font-size: 12px;
    color: var(--as-text-muted);
    margin-top: 4px;
}

.auth-submit {
    margin-top: 8px;
    padding: 13px 20px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--as-violet) 0%, var(--as-violet-dark) 100%);
    color: white;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: transform 0.1s ease, box-shadow 0.2s ease;
    box-shadow:
        0 4px 14px rgba(2, 132, 199, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.15) inset;
}
.auth-submit:hover {
    transform: translateY(-1px);
    box-shadow:
        0 8px 24px rgba(2, 132, 199, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}
.auth-submit:active { transform: translateY(0); }

.auth-submit-arrow {
    transition: transform 0.2s ease;
}
.auth-submit:hover .auth-submit-arrow { transform: translateX(2px); }

.auth-card-foot {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--as-border);
    font-size: 13px;
    color: var(--as-text-muted);
}
.auth-card-foot a {
    color: var(--as-violet);
    font-weight: 600;
    text-decoration: none;
    margin-left: 4px;
}
.auth-card-foot a:hover { text-decoration: underline; }

.auth-legal {
    margin-top: 24px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
}
.auth-legal a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
}
.auth-legal a:hover { color: white; text-decoration: underline; }

@media (max-width: 960px) {
    .auth-split { grid-template-columns: 1fr; }
    .auth-marketing { display: none; }
    .auth-main { padding: 40px 24px; border-left: 0; }
}

/* ====== Billing hero — slick AI-style ====== */
.billing-hero-card {
    background: linear-gradient(135deg, #0b1e3b 0%, #0c2d52 50%, #0c4a6e 100%);
    color: white;
    border-radius: 20px;
    padding: 28px 32px;
    margin-bottom: 22px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 16px 40px -16px rgba(67, 56, 202, 0.5);
}
.billing-hero-card::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -10%;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.4) 0%, transparent 70%);
    pointer-events: none;
}
.billing-hero-card::after {
    content: '';
    position: absolute;
    bottom: -50%;
    left: -10%;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(20, 184, 166, 0.3) 0%, transparent 70%);
    pointer-events: none;
}

.billing-hero-top {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}
.billing-hero-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.billing-hero-top .button-link { color: rgba(255, 255, 255, 0.8); }
.billing-hero-top .button-link:hover { color: white; }

.billing-hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    align-items: end;
}
.billing-hero-headline h1 {
    font-size: 32px;
    margin: 0 0 6px;
    color: white;
    letter-spacing: -0.01em;
}
.billing-hero-headline p {
    margin: 0 0 6px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 15px;
}
.billing-hero-headline .muted-small { color: rgba(255, 255, 255, 0.65); }

.billing-hero-amount {
    display: flex;
    align-items: baseline;
    gap: 4px;
    color: white;
}
.billing-amount-currency { font-size: 18px; font-weight: 600; opacity: 0.85; }
.billing-amount-number { font-size: 48px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.billing-amount-period { font-size: 14px; color: rgba(255, 255, 255, 0.7); margin-left: 2px; }

.pill-large { font-size: 12px; padding: 5px 12px; }
.billing-hero-card .pill-large {
    background: rgba(255, 255, 255, 0.12);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.18);
}
.billing-hero-card .pill.status-active { background: rgba(34, 197, 94, 0.25); border-color: rgba(34, 197, 94, 0.5); }
.billing-hero-card .pill.status-trial { background: rgba(59, 130, 246, 0.25); border-color: rgba(59, 130, 246, 0.5); }

/* ====== Usage cards ====== */
.usage-section { margin-top: 22px; margin-bottom: 22px; }
.usage-card {
    background: white;
    border: 1px solid var(--as-border);
    border-radius: 14px;
    padding: 18px 20px;
    transition: transform 0.1s ease, box-shadow 0.15s ease;
}
.usage-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -12px rgba(15, 23, 42, 0.1);
}
.usage-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.usage-pct {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 999px;
    background: #e0f2f1;
    color: #0d8b73;
}
.usage-pct.usage-warn { background: #fff3e0; color: #c97a18; }
.usage-pct.usage-hot  { background: #fdecea; color: #c2412e; }
.usage-amount {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 12px;
}
.usage-amount strong { font-size: 24px; font-weight: 700; color: var(--as-text); letter-spacing: -0.01em; }

.usage-track {
    height: 6px;
    background: #f0f4f5;
    border-radius: 999px;
    overflow: hidden;
}
.usage-track span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--as-cyan) 0%, var(--as-violet) 100%);
    border-radius: 999px;
    transition: width 0.6s ease;
}
.usage-track .usage-bar-warn { background: linear-gradient(90deg, #f59e0b 0%, #ef4444 100%); }
.usage-track .usage-bar-hot  { background: linear-gradient(90deg, #ef4444 0%, #b91c1c 100%); }

/* ====== Plan cards v2 ====== */
.plans-section { margin-top: 22px; }
.plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.plan-card-v2 {
    position: relative;
    background: white;
    border: 1px solid var(--as-border);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.15s ease;
}
.plan-card-v2:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 32px -16px rgba(15, 23, 42, 0.15);
}
.plan-card-v2.current {
    border-color: var(--as-cyan);
    background: linear-gradient(135deg, white 0%, #f0fdfa 100%);
}
.plan-card-v2.recommended {
    border-color: var(--as-violet);
    background: linear-gradient(135deg, white 0%, #f0f9ff 100%);
    box-shadow:
        0 16px 36px -16px rgba(2, 132, 199, 0.3),
        0 0 0 1px rgba(2, 132, 199, 0.18);
    transform: translateY(-3px);
}
.plan-card-v2.recommended:hover { transform: translateY(-5px); }

.plan-ribbon {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--as-violet) 0%, var(--as-pink) 100%);
    color: white;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 14px;
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.4);
}

.plan-card-head h3 { margin: 0 0 2px; font-size: 18px; }

.plan-price-block {
    display: flex;
    align-items: baseline;
    gap: 4px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--as-border);
}
.plan-currency { font-size: 16px; color: var(--as-text-soft); font-weight: 600; }
.plan-price-num { font-size: 36px; font-weight: 700; letter-spacing: -0.02em; color: var(--as-text); }
.plan-price-period { font-size: 13px; color: var(--as-text-muted); margin-left: 2px; }

.plan-spec, .plan-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: var(--as-text-soft);
}
.plan-features { padding-top: 10px; border-top: 1px dashed var(--as-border); }
.plan-spec li, .plan-features li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.5;
}
.plan-check {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--as-cyan) 0%, var(--as-violet) 100%);
    color: white;
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.plan-cta { margin-top: auto; padding-top: 8px; }

.button-secondary {
    background: white;
    color: var(--as-text);
    border: 1px solid var(--as-border);
    cursor: pointer;
    border-radius: 10px;
    padding: 12px 18px;
    font-weight: 600;
    transition: background-color 0.1s ease, border-color 0.1s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.button-secondary:hover { background: #f8fafc; border-color: #cbd5e1; }

.button-ghost {
    background: transparent;
    color: var(--as-text-soft);
    border: 1px dashed var(--as-border);
    border-radius: 10px;
    padding: 12px 18px;
    font-weight: 500;
    text-align: center;
    cursor: not-allowed;
}

.button-danger {
    background: #ef4444;
    color: white;
    border: 0;
    border-radius: 10px;
    padding: 11px 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.1s ease;
}
.button-danger:hover { background: #dc2626; }

.notice-success { border-left: 4px solid #16a34a; background: #f0fdf4; }
.notice-info    { border-left: 4px solid var(--as-violet); background: #f0f9ff; }

.auth-alert-info { background: #eff6ff; color: #1e3a8a; border: 1px solid #bfdbfe; }

/* ====== Integration cards ====== */
.integrations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.integration-card {
    background: white;
    border: 1px solid var(--as-border);
    border-radius: 14px;
    padding: 18px 20px;
    transition: transform 0.1s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.integration-card:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -14px rgba(15, 23, 42, 0.12); }
.integration-card.connected { border-color: rgba(16, 185, 129, 0.3); background: linear-gradient(135deg, white 0%, #f0fdf4 100%); }

.integration-head {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}
.integration-head h3 { margin: 0; font-size: 15px; }
.integration-head .muted-small { display: block; }

.integration-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    font-weight: 700;
}
.integration-icon-purple { background: linear-gradient(135deg, #0284c7 0%, #075985 100%); }
.integration-icon-blue   { background: linear-gradient(135deg, #635bff 0%, #0c4a6e 100%); }
.integration-icon-red    { background: linear-gradient(135deg, #ea4335 0%, #c5221f 100%); }
.integration-icon-orange { background: linear-gradient(135deg, #f22f46 0%, #cf1034 100%); }

.integration-status {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f1f5f9;
    color: var(--as-text-muted);
    white-space: nowrap;
}
.integration-status.connected { background: #dcfce7; color: #166534; }

.integration-card code {
    background: #f1f5f9;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: var(--as-text);
}

/* ====== Refined buttons (consistent across the app) ====== */
.button-primary {
    background: linear-gradient(135deg, var(--as-violet) 0%, var(--as-violet-dark) 100%);
    color: white;
    border: 0;
    border-radius: 10px;
    padding: 11px 18px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
    transition: transform 0.1s ease, box-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.button-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(2, 132, 199, 0.45);
}
.button-primary:disabled {
    background: #cbd5e1;
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* ====== Refined hero & stat cards (existing pages) ====== */
.admin-hero {
    background: linear-gradient(135deg, #0b1e3b 0%, #0c4a6e 50%, #0284c7 100%);
    box-shadow: 0 16px 40px -16px rgba(67, 56, 202, 0.5);
    position: relative;
    overflow: hidden;
}
.admin-hero::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -5%;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(20, 184, 166, 0.25) 0%, transparent 70%);
    pointer-events: none;
}
.admin-hero-body { position: relative; z-index: 1; }

/* Refresh existing brand mark */
.brand-mark-large {
    background: linear-gradient(135deg, var(--as-violet) 0%, var(--as-violet-dark) 100%);
    box-shadow:
        0 8px 18px -8px rgba(2, 132, 199, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}


/* Override old auth-shell styles that bleed into the new login */
.auth-shell .auth-pitch h2 {
    color: transparent;
    font-size: 38px;
    line-height: 1.15;
    font-weight: 700;
    margin: 0 0 18px;
}
.auth-shell .auth-card-head h1 {
    color: var(--as-text);
    font-size: 26px;
    line-height: 1.2;
    font-weight: 700;
    margin: 0 0 6px;
    max-width: none;
}

/* ============================================================================
   v5 — Accessibility, mobile CTA bar, sticky header, WCAG 2.2 AA
   ============================================================================ */

/* Skip link — visible only when focused */
.skip-link {
    position: absolute;
    top: -100px;
    left: 12px;
    z-index: 10000;
    padding: 10px 18px;
    background: var(--as-violet);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: top 0.15s ease;
}
.skip-link:focus,
.skip-link:focus-visible {
    top: 12px;
    outline: 3px solid #fff;
    outline-offset: 2px;
}

/* Make the top-row genuinely sticky on the main app */
main > .top-row {
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--as-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    gap: 16px;
}

main > .top-row > .top-row-brand strong {
    font-size: 16px;
    color: var(--as-text);
}
main > .top-row > .top-row-brand span {
    display: block;
    font-size: 12px;
    color: var(--as-text-muted);
}

.top-actions-link {
    color: var(--as-text-soft);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background-color 0.1s ease, color 0.1s ease;
}
.top-actions-link:hover { background: #f1f5f9; color: var(--as-text); }

/* Make article content focusable but not visibly focused */
#main-content:focus { outline: none; }

/* ============================================================================
   Sticky mobile CTA bar (only on phones)
   ============================================================================ */
.mobile-cta-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 80;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--as-border);
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom)) 12px;
    align-items: stretch;
    justify-content: space-around;
    box-shadow: 0 -4px 16px -8px rgba(15, 23, 42, 0.1);
}
.mobile-cta-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 10px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--as-text-soft);
    font-size: 11px;
    font-weight: 500;
    flex: 1;
    min-width: 0;
}
.mobile-cta-item span:first-child {
    font-size: 18px;
    line-height: 1;
}
.mobile-cta-item:hover { color: var(--as-text); }
.mobile-cta-item.mobile-cta-primary {
    background: linear-gradient(135deg, var(--as-violet), var(--as-violet-dark));
    color: white;
    margin: 0 4px;
    padding: 8px 14px;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.4);
}
.mobile-cta-item.mobile-cta-primary:hover { color: white; }

@media (max-width: 768px) {
    .mobile-cta-bar { display: flex; }
    /* Add padding so content isn't hidden behind the bar */
    main > .content { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
}

/* Hide mobile CTA bar on auth pages */
.empty-layout ~ .mobile-cta-bar,
body:has(.auth-shell) .mobile-cta-bar { display: none; }

/* ============================================================================
   Accessibility widget
   ============================================================================ */
.a11y-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 90;
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--as-violet) 0%, var(--as-violet-dark) 100%);
    color: white;
    font-size: 26px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(2, 132, 199, 0.45);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.a11y-toggle:hover {
    transform: scale(1.06);
    box-shadow: 0 12px 32px rgba(2, 132, 199, 0.55);
}
.a11y-toggle:focus-visible {
    outline: 3px solid #ffe17e;
    outline-offset: 2px;
}

/* When mobile CTA bar is showing, push the a11y button up so it doesn't overlap */
@media (max-width: 768px) {
    .a11y-toggle {
        bottom: calc(80px + env(safe-area-inset-bottom));
    }
}

.a11y-backdrop {
    position: fixed;
    inset: 0;
    z-index: 95;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(2px);
    animation: a11yFade 0.15s ease-out;
}
@keyframes a11yFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.a11y-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 96;
    width: min(380px, 100vw);
    background: white;
    box-shadow: -16px 0 40px -12px rgba(15, 23, 42, 0.25);
    overflow-y: auto;
    animation: a11ySlide 0.25s ease-out;
}
@keyframes a11ySlide {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.a11y-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 22px;
    border-bottom: 1px solid var(--as-border);
    position: sticky;
    top: 0;
    background: white;
}
.a11y-head h2 { margin: 0; font-size: 18px; }
.a11y-close {
    border: 0;
    background: none;
    font-size: 26px;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--as-text-muted);
    line-height: 1;
}
.a11y-close:hover { background: #f1f5f9; color: var(--as-text); }

.a11y-body {
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.a11y-group {
    border: 0;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.a11y-group legend {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--as-text-muted);
    padding: 0;
    margin-bottom: 4px;
}

.a11y-segmented {
    display: flex;
    gap: 4px;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 12px;
}
.a11y-seg {
    flex: 1;
    border: 0;
    background: transparent;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: var(--as-text-soft);
    transition: background-color 0.1s ease, color 0.1s ease;
}
.a11y-seg:nth-child(1) { font-size: 13px; }
.a11y-seg:nth-child(2) { font-size: 15px; }
.a11y-seg:nth-child(3) { font-size: 17px; }
.a11y-seg:nth-child(4) { font-size: 19px; }
.a11y-seg.active { background: white; color: var(--as-violet); box-shadow: 0 2px 6px -2px rgba(15, 23, 42, 0.12); }

.a11y-toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f8fafc;
    cursor: pointer;
    transition: background-color 0.1s ease;
}
.a11y-toggle-row:hover { background: #f1f5f9; }
.a11y-toggle-row span { font-size: 14px; }
.a11y-toggle-row input[type="checkbox"] {
    width: 20px; height: 20px;
    accent-color: var(--as-violet);
}

.a11y-reset {
    border: 1px solid var(--as-border);
    background: white;
    border-radius: 10px;
    padding: 10px 16px;
    font-weight: 600;
    color: var(--as-text);
    cursor: pointer;
    transition: background-color 0.1s ease;
}
.a11y-reset:hover { background: #f8fafc; }

.a11y-note {
    font-size: 12px;
    color: var(--as-text-muted);
    line-height: 1.6;
    margin: 0;
}
.a11y-note kbd {
    background: #f1f5f9;
    border: 1px solid var(--as-border);
    border-radius: 4px;
    padding: 1px 5px;
    font-family: ui-monospace, monospace;
    font-size: 11px;
}

/* ============================================================================
   Accessibility CSS variables — applied via classes on <html>
   ============================================================================ */
html.as-text-small  { font-size: 14px; }
html.as-text-default { font-size: 16px; }
html.as-text-large  { font-size: 18px; }
html.as-text-xlarge { font-size: 20px; }

html.as-high-contrast {
    --as-text: #000000;
    --as-text-soft: #1a1a1a;
    --as-text-muted: #2c2c2c;
    --as-border: #1a1a1a;
    --as-bg: #ffffff;
    --as-surface: #ffffff;
}
html.as-high-contrast body,
html.as-high-contrast .panel,
html.as-high-contrast .stat-card,
html.as-high-contrast .user-card,
html.as-high-contrast .integration-card,
html.as-high-contrast .plan-card-v2,
html.as-high-contrast .usage-card {
    background: white !important;
    border: 2px solid black !important;
    color: black !important;
}
html.as-high-contrast .button-primary,
html.as-high-contrast .auth-submit {
    background: black !important;
    color: white !important;
    border: 2px solid black !important;
    box-shadow: none !important;
}
html.as-high-contrast a { color: #0000ee !important; text-decoration: underline !important; }
html.as-high-contrast a:visited { color: #551a8b !important; }

html.as-readable-font * {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif !important;
    letter-spacing: 0.02em !important;
    line-height: 1.7 !important;
    word-spacing: 0.05em !important;
}

html.as-underline-links a:not(.button):not(.button-primary):not(.button-secondary):not(.auth-submit):not(.skip-link):not(.mobile-cta-item):not(.a11y-toggle) {
    text-decoration: underline !important;
    text-underline-offset: 2px;
}

html.as-pause-animations *,
html.as-pause-animations *::before,
html.as-pause-animations *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
}

html.as-highlight-focus *:focus-visible {
    outline: 3px solid #ffe17e !important;
    outline-offset: 3px !important;
    border-radius: 4px;
}

/* Honor system reduced-motion automatically */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* ============================================================================
   WCAG focus indicators on all interactive elements
   ============================================================================ */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid #ffe17e;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Hover-target minimum size (WCAG 2.2 - 2.5.8 Target Size, AA at 24px) */
button, a.button, .button, .filter-tab, .a11y-seg, .super-tab {
    min-height: 36px;
}

/* Mobile-first: ensure layout collapses gracefully */
@media (max-width: 600px) {
    main > .top-row {
        padding: 12px 16px;
    }
    main > .content {
        padding: 16px;
    }
    .billing-hero-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .billing-amount-number { font-size: 36px; }
}


/* ============================================================================
   v6 — AI assistant chat widget, Stripe config banner, contact form
   ============================================================================ */

/* ====== Floating AI assistant ====== */
.signal-chat-toggle {
    position: fixed;
    bottom: 88px; /* sits above the a11y button */
    right: 20px;
    z-index: 88;
    width: 58px;
    height: 58px;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 50%, #22d3ee 100%);
    color: white;
    font-size: 26px;
    font-weight: 700;
    cursor: pointer;
    box-shadow:
        0 10px 28px rgba(14, 165, 233, 0.42),
        0 0 0 1px rgba(255, 255, 255, 0.12) inset;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: 200% 200%;
    animation: signalPulse 4s ease-in-out infinite;
}
.signal-chat-toggle:hover {
    transform: scale(1.08) rotate(8deg);
    box-shadow: 0 14px 36px rgba(14, 165, 233, 0.55);
}
.signal-chat-toggle:focus-visible {
    outline: 3px solid #ffe17e;
    outline-offset: 3px;
}

@keyframes signalPulse {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

@media (max-width: 768px) {
    .signal-chat-toggle {
        bottom: calc(146px + env(safe-area-inset-bottom));
    }
}

.signal-chat-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 89;
    width: min(420px, calc(100vw - 40px));
    height: min(640px, calc(100vh - 100px));
    background: white;
    border-radius: 18px;
    box-shadow:
        0 24px 60px -16px rgba(15, 23, 42, 0.35),
        0 0 0 1px rgba(15, 23, 42, 0.04);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: signalSlideUp 0.25s ease-out;
}

@keyframes signalSlideUp {
    from { opacity: 0; transform: translateY(16px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 768px) {
    .signal-chat-panel {
        bottom: calc(80px + env(safe-area-inset-bottom));
        right: 12px;
        left: 12px;
        width: auto;
        height: min(560px, calc(100vh - 180px));
    }
}

.signal-chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    background: linear-gradient(135deg, #0b1e3b 0%, #0c4a6e 100%);
    color: white;
}
.signal-chat-head-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.signal-chat-head-brand strong {
    display: block;
    font-size: 14px;
    color: white;
}
.signal-chat-head-brand .muted-small {
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
}
.signal-chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0ea5e9, #06b6d4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18);
}
.signal-chat-close {
    background: rgba(255, 255, 255, 0.1);
    border: 0;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}
.signal-chat-close:hover { background: rgba(255, 255, 255, 0.18); }

.signal-chat-log {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background:
        linear-gradient(180deg, #f8fbff 0%, white 100%);
}

.signal-chat-greeting p {
    margin: 0 0 12px;
    color: var(--as-text-soft);
    font-size: 14px;
}

.signal-chat-suggestions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.signal-chip {
    text-align: left;
    background: white;
    border: 1px solid var(--as-border);
    border-radius: 12px;
    padding: 10px 14px;
    font: inherit;
    font-size: 13px;
    color: var(--as-text);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}
.signal-chip:hover {
    border-color: #0ea5e9;
    background: linear-gradient(90deg, rgba(14, 165, 233, 0.04), white);
    transform: translateY(-1px);
}

.signal-msg {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}
.signal-msg-user { justify-content: flex-end; }

.signal-msg-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0ea5e9, #06b6d4);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.signal-msg-bubble {
    max-width: 78%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
}
.signal-msg-bubble p { margin: 0; }
.signal-msg-bubble p + p { margin-top: 6px; }

.signal-msg-user .signal-msg-bubble {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: white;
    border-bottom-right-radius: 4px;
}
.signal-msg-assistant .signal-msg-bubble {
    background: white;
    color: var(--as-text);
    border: 1px solid var(--as-border);
    border-bottom-left-radius: 4px;
}

.signal-typing {
    display: inline-flex;
    gap: 4px;
    padding: 14px 16px;
}
.signal-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #0ea5e9;
    animation: signalTyping 1.2s infinite;
}
.signal-typing span:nth-child(2) { animation-delay: 0.2s; }
.signal-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes signalTyping {
    0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-3px); }
}

.signal-chat-input {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--as-border);
    background: white;
}
.signal-chat-input input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--as-border);
    border-radius: 999px;
    font: inherit;
    font-size: 14px;
}
.signal-chat-input input:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}
.signal-chat-send {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    color: white;
    cursor: pointer;
    font-size: 18px;
    transition: transform 0.1s ease;
    flex-shrink: 0;
}
.signal-chat-send:hover:not(:disabled) { transform: scale(1.05); }
.signal-chat-send:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
}

.signal-chat-foot {
    padding: 8px 14px 10px;
    background: white;
    border-top: 1px solid var(--as-border);
    text-align: center;
}

/* ====== Stripe config banner ====== */
.notice-stripe {
    border-left: 4px solid #635bff;
    background: linear-gradient(90deg, rgba(99, 91, 255, 0.04), white);
}
.notice-stripe h3 { margin: 0 0 6px; font-size: 16px; }
.stripe-status-list {
    list-style: none;
    margin: 12px 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.stripe-status-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    background: #f8fafc;
    font-size: 13px;
}
.stripe-status-list li.ok { background: #f0fdf4; color: #166534; }
.stripe-status-list li.missing { background: #fef2f2; color: #991b1b; }
.stripe-status-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 11px;
    flex-shrink: 0;
}
.stripe-status-list li.ok .stripe-status-mark { background: #22c55e; color: white; }
.stripe-status-list li.missing .stripe-status-mark { background: #ef4444; color: white; }
.stripe-status-list code {
    background: rgba(0, 0, 0, 0.06);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 12px;
}

/* ====== Contact / demo request form ====== */
.auth-card-wide { max-width: 560px; }

.auth-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 520px) {
    .auth-grid-2 { grid-template-columns: 1fr; }
}

.auth-field select,
.auth-field textarea {
    padding: 12px 14px;
    border: 1px solid var(--as-border);
    border-radius: 10px;
    font: inherit;
    font-size: 14px;
    background: white;
    color: var(--as-text);
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.auth-field select:focus,
.auth-field textarea:focus {
    outline: none;
    border-color: var(--as-violet);
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.12);
}
.auth-field textarea { resize: vertical; min-height: 90px; }

/* Honeypot — hidden from users, visible to bots */
.hp {
    position: absolute;
    left: -10000px;
    top: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ============================================================================
   v7 — Form validation indicators, invite modal, lead capture
   ============================================================================ */

/* Required-field marker — used inside <label> after the field name */
.required-mark {
    color: #dc2626;
    font-weight: 700;
    margin-left: 2px;
    user-select: none;
}

/* Inline field-level validation message */
.field-error {
    display: block;
    margin-top: 4px;
    color: #b91c1c;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
}

/* Invite modal — narrower than full modals, with a tighter form */
.invite-modal {
    max-width: 460px;
}

.invite-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 12px;
}

.invite-form .auth-field input,
.invite-form .auth-field select {
    padding: 11px 14px;
    border: 1px solid var(--as-border);
    border-radius: 10px;
    font: inherit;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
    background: white;
    color: var(--as-text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.invite-form .auth-field input:focus,
.invite-form .auth-field select:focus {
    outline: none;
    border-color: var(--as-violet);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

/* Lead form panel */
.lead-form-panel {
    margin-bottom: 18px;
}

/* Native HTML5 validation pseudoclass — show a soft red border on invalid required fields */
.field input:invalid:not(:placeholder-shown),
.auth-field input:invalid:not(:placeholder-shown),
.auth-field textarea:invalid:not(:placeholder-shown),
.auth-field select:invalid {
    border-color: #fca5a5;
    box-shadow: 0 0 0 3px rgba(252, 165, 165, 0.15);
}

/* Style hint text under a field */
.field input + .auth-hint,
.field select + .auth-hint,
.field textarea + .auth-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--as-text-muted);
}

/* Make sure ValidationMessage rendering stands out without being noisy */
.validation-message {
    display: block;
    color: #b91c1c;
    font-size: 12px;
    margin-top: 4px;
}
