:root {
    --ax-background: #0e0e11;
    --ax-surface-low: #131316;
    --ax-surface: #19191d;
    --ax-surface-high: #1f1f23;
    --ax-surface-highest: #25252a;
    --ax-surface-bright: #2c2c30;
    --ax-outline: rgba(72, 71, 75, 0.55);
    --ax-outline-soft: rgba(72, 71, 75, 0.28);
    --ax-text: #f0edf1;
    --ax-text-muted: #acaaae;
    --ax-primary: #ff8d8c;
    --ax-primary-dim: #f47878;
    --ax-secondary: #fb7e9e;
    --ax-tertiary: #cda4ff;
    --ax-success: #82e2b1;
    --ax-danger: #ff8fa4;
    --ax-shadow: 0 18px 44px rgba(0, 0, 0, 0.32);
    --ax-radius-lg: 24px;
    --ax-radius-md: 18px;
    --ax-radius-sm: 12px;
    --ax-grid: linear-gradient(rgba(186, 158, 255, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(186, 158, 255, 0.05) 1px, transparent 1px);
}

*, *::before, *::after {
    box-sizing: border-box;
}

body.marketing-page,
body.auth-page,
body.app-page,
body.legal-page {
    overflow-x: hidden;
    background: var(--ax-background) !important;
    background-image: none !important;
    color: var(--ax-text);
    font-family: 'Manrope', sans-serif;
    min-height: 100vh;
    position: relative;
    isolation: isolate;
    animation: none;
}

body.marketing-page::before,
body.auth-page::before,
body.app-page::before,
body.legal-page::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: var(--ax-grid);
    background-size: 40px 40px;
    background-position: 0 0;
    background-repeat: repeat;
    pointer-events: none;
    z-index: -1;
}

body.marketing-page,
body.auth-page,
body.legal-page {
    overflow-x: hidden;
}

.site-shell,
.app-shell-page {
    min-height: 100vh;
    overflow-x: hidden;
    max-width: 100vw;
}

.hidden {
    display: none !important;
}

.container-fluid {
    max-width: 1240px;
    padding-left: 24px;
    padding-right: 24px;
}

.hero-glow {
    position: relative;
    isolation: isolate;
    overflow: visible;
}

.hero-glow > * {
    position: relative;
    z-index: 1;
}

.hero-glow::before {
    content: '';
    position: absolute;
    inset: -6% 0 12% 0;
    background:
        radial-gradient(circle at 18% 24%, rgba(248, 122, 123, 0.06), transparent 26%),
        radial-gradient(circle at 72% 18%, rgba(132, 85, 239, 0.08), transparent 30%),
        linear-gradient(180deg, rgba(25, 25, 29, 0.08), rgba(14, 14, 17, 0));
    filter: blur(12px);
    pointer-events: none;
    z-index: -1;
}

.site-header,
.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(14, 14, 17, 0.82);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.marketing-nav,
.app-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 80px;
}

.marketing-nav__links,
.marketing-nav__actions,
.app-topbar__actions,
.app-topbar__brand {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.marketing-nav__actions,
.app-topbar__actions {
    margin-left: auto;
}

.brand-link {
    color: var(--ax-text);
    text-decoration: none;
    font-weight: 800;
    letter-spacing: -0.04em;
    font-size: 1.15rem;
}

.marketing-nav a,
.app-topbar a,
.nav-link-button {
    color: var(--ax-text-muted);
    text-decoration: none;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.marketing-nav a.button,
.app-topbar a.button {
    color: inherit;
}

.marketing-nav a:hover,
.app-topbar a:hover,
.nav-link-button:hover {
    color: var(--ax-text);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0.78rem 1.2rem;
    border-radius: 14px;
    border: 1px solid transparent;
    text-decoration: none;
    font-weight: 700;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    background: linear-gradient(135deg, var(--ax-primary), var(--ax-secondary));
    color: #17070c;
    box-shadow: 0 8px 18px rgba(248, 122, 123, 0.12);
}

.button-primary:hover {
    box-shadow: 0 10px 22px rgba(248, 122, 123, 0.16);
}

.button-secondary {
    background: rgba(37, 37, 42, 0.86);
    color: var(--ax-text);
    border-color: rgba(255, 255, 255, 0.08);
}

.marketing-nav__actions .nav-link-button,
.app-topbar__actions .nav-link-button {
    color: rgba(240, 237, 241, 0.96);
    font-weight: 600;
}

.marketing-nav__actions .nav-link-button:hover,
.app-topbar__actions .nav-link-button:hover {
    color: #ffffff;
}

.button-small {
    padding: 0.62rem 0.95rem;
    font-size: 0.9rem;
}

.button-large {
    padding: 0.95rem 1.35rem;
}

.button-icon {
    width: 44px;
    height: 44px;
    padding: 0;
}

.eyebrow-chip,
.app-topbar__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-radius: 8px;
    padding: 0.35rem 0.8rem;
    color: var(--ax-primary);
    background: rgba(248, 122, 123, 0.08);
    border: 1px solid rgba(248, 122, 123, 0.12);
}

.eyebrow-chip--muted {
    color: var(--ax-text-muted);
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.marketing-main,
.auth-main,
.legal-main {
    position: relative;
    z-index: 1;
}

.marketing-main {
    padding-top: 48px;
}

.auth-main {
    padding-top: 32px;
}

.hero-section,
.feature-section,
.validation-section,
.cta-section,
.auth-layout,
.legal-main {
    padding-top: 56px;
    padding-bottom: 56px;
}

.hero-grid,
.validation-card-grid,
.auth-layout,
.account-panel-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px;
}

.hero-grid {
    align-items: center;
    min-height: 640px;
}

.hero-copy {
    max-width: 34rem;
}

.hero-copy h1,
.auth-aside h1,
.cta-panel h2,
.app-main-panel__hero h1,
.legal-article h1,
.validation-copy h2,
.section-heading h2 {
    margin: 0;
    letter-spacing: -0.05em;
    line-height: 0.96;
}

.hero-copy h1,
.auth-aside h1 {
    font-size: clamp(3.2rem, 8vw, 5.8rem);
    margin-top: 18px;
    max-width: 10ch;
}

.hero-copy h1 span,
.auth-aside h1 span {
    color: var(--ax-primary);
}

.hero-copy p,
.auth-aside p,
.validation-copy p,
.cta-panel p,
.app-main-panel__hero p,
.section-heading p,
.section-subcopy,
.legal-lead,
.legal-article p,
.legal-article li,
.auth-help-text {
    color: var(--ax-text-muted);
    line-height: 1.7;
}

.hero-copy p,
.validation-copy p,
.cta-lead {
    max-width: 34rem;
}

.hero-actions,
.auth-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 28px;
}

.hero-actions--center {
    justify-content: center;
}

.hero-trust-row,
.cta-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 24px;
    color: var(--ax-text-muted);
    font-size: 0.92rem;
}

.hero-preview-card,
.terminal-card,
.feature-card,
.cta-panel,
.auth-card,
.sidebar-card,
.workspace-card,
.legal-article,
.account-form-card,
.api-key-create-card {
    position: relative;
    background: rgba(25, 25, 29, 0.92);
    border: 1px solid rgba(72, 71, 75, 0.14);
    border-radius: var(--ax-radius-lg);
    box-shadow: var(--ax-shadow);
}

.hero-preview-card,
.terminal-card,
.feature-card,
.cta-panel,
.legal-article,
.validation-panel {
    overflow: visible;
}

.hero-preview-card,
.terminal-card,
.cta-panel,
.auth-card,
.sidebar-card,
.workspace-card,
.legal-article,
.account-form-card,
.api-key-create-card {
    padding: 28px;
}

.hero-preview-card {
    background: rgba(25, 25, 29, 0.96);
}

.window-chrome {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 18px;
}

.window-chrome span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
}

.window-chrome span:nth-child(1) {
    background: rgba(255, 141, 140, 0.55);
}

.window-chrome span:nth-child(2) {
    background: rgba(255, 208, 164, 0.55);
}

.window-chrome span:nth-child(3) {
    background: rgba(130, 226, 177, 0.55);
}

.window-chrome small {
    margin-left: 8px;
    color: var(--ax-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.window-chrome {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.hero-code-block,
.terminal-output {
    margin: 0;
    font-size: 0.96rem;
    line-height: 1.75;
    color: #f5f1f7;
    white-space: pre-wrap;
}

.section-heading {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 28px;
}

.feature-grid,
.account-stats-grid,
.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.feature-card {
    padding: 26px;
    background: rgba(19, 19, 22, 0.82);
    border-color: transparent;
    box-shadow: none;
    transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    background: rgba(25, 25, 29, 0.94);
    border-color: rgba(255, 141, 140, 0.14);
}

.feature-card h3,
.workspace-card h2,
.account-form-card h3,
.sidebar-card h3,
.legal-article h2 {
    margin-top: 0;
    color: var(--ax-text);
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    font-size: 1.2rem;
}

.feature-icon--primary {
    background: rgba(255, 141, 140, 0.14);
    color: var(--ax-primary);
}

.feature-icon--secondary {
    background: rgba(251, 126, 158, 0.12);
    color: var(--ax-secondary);
}

.feature-icon--tertiary {
    background: rgba(205, 164, 255, 0.12);
    color: var(--ax-tertiary);
}

.feature-icon--neutral {
    background: rgba(255, 255, 255, 0.06);
    color: var(--ax-text);
}

.marketing-check-list {
    list-style: none;
    padding: 0;
    margin: 24px 0 0;
    display: grid;
    gap: 14px;
}

.marketing-check-list li {
    position: relative;
    padding-left: 24px;
}

.marketing-check-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.55rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ax-primary);
    box-shadow: 0 0 14px rgba(255, 141, 140, 0.55);
}

.site-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    padding: 36px 0;
    background: rgba(0, 0, 0, 0.72);
}

.site-footer__inner,
.site-footer__links,
.auth-bullets,
.manager-list,
.app-action-cluster {
    display: flex;
    gap: 16px;
}

.site-footer__inner {
    align-items: center;
    justify-content: space-between;
}

.site-footer__links {
    flex-wrap: wrap;
}

.site-footer p,
.site-footer a {
    color: var(--ax-text-muted);
}

.auth-shell .marketing-nav {
    min-height: 88px;
}

.auth-aside,
.auth-card {
    position: relative;
    z-index: 1;
}

.auth-bullets {
    flex-direction: column;
    margin-top: 26px;
}

.auth-card--wide {
    padding: 34px;
}

.auth-card {
    background: rgba(25, 25, 29, 0.94);
}

.auth-card__header h2 {
    margin: 14px 0 10px;
}

.auth-form-grid,
.auth-form-grid--compact {
    display: grid;
    gap: 14px;
}

.auth-form-grid {
    margin-top: 22px;
}

.field-label {
    font-size: 0.82rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ax-text-muted);
}

.field-label--tight {
    margin-bottom: 4px;
}

.auth-input,
.app-page .form-control,
.app-page .form-select {
    background: rgba(31, 31, 35, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--ax-text);
    border-radius: 14px;
    padding: 0.9rem 1rem;
}

.auth-input:focus,
.app-page .form-control:focus,
.app-page .form-select:focus {
    background: rgba(37, 37, 42, 0.98);
    border-color: rgba(255, 141, 140, 0.45);
    box-shadow: 0 0 0 0.25rem rgba(255, 141, 140, 0.12);
    color: var(--ax-text);
}

.auth-input::placeholder,
.app-page .form-control::placeholder {
    color: rgba(172, 170, 174, 0.7);
}

.auth-inline-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.auth-inline-row--switch {
    margin-top: 4px;
    margin-bottom: 4px;
}

.auth-switch-wrap .form-check-input,
.app-page .form-check-input {
    background-color: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.12);
}

.auth-switch-wrap .form-check-input:checked,
.app-page .form-check-input:checked {
    background-color: var(--ax-primary);
    border-color: var(--ax-primary);
}

.auth-captcha-wrap {
    margin-top: 6px;
}

.app-page .authlix-toast,
.auth-page .authlix-toast {
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(25, 25, 29, 0.92);
    color: var(--ax-text);
    backdrop-filter: blur(18px);
}

.app-page .authlix-toast .toast-header,
.auth-page .authlix-toast .toast-header {
    background: rgba(37, 37, 42, 0.96);
    color: var(--ax-text);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.app-shell-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 28px;
    max-width: 1480px;
    margin: 0 auto;
    padding: 28px 24px 56px;
}

.app-sidebar-panel,
.app-main-panel,
.workspace-views,
.workspace-view,
.project-list-shell {
    display: grid;
    gap: 20px;
}

.app-sidebar-panel {
    align-content: start;
}

.app-main-panel {
    align-content: start;
    gap: 24px;
}

.app-command-deck {
    display: grid;
    gap: 22px;
}

.app-main-panel__hero {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    padding: 12px 0 4px;
}

.app-main-panel__hero h1 {
    font-size: clamp(2.2rem, 4vw, 3.75rem);
    max-width: 13ch;
}

.app-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.75fr);
    gap: 20px;
}

.app-hero-card {
    position: relative;
    padding: 28px;
    border-radius: 28px;
    overflow: visible;
}

.app-hero-card--primary {
    background: linear-gradient(135deg, rgba(29, 18, 21, 0.94), rgba(26, 23, 34, 0.96));
    border: 1px solid rgba(255, 141, 140, 0.12);
    box-shadow: var(--ax-shadow);
}

.app-hero-card--primary::before {
    content: '';
    position: absolute;
    inset: -10% auto auto -6%;
    width: 18rem;
    height: 18rem;
    background: radial-gradient(circle, rgba(248, 122, 123, 0.16), transparent 68%);
    pointer-events: none;
}

.app-hero-card--secondary {
    background: rgba(19, 19, 22, 0.92);
    border: 1px solid rgba(72, 71, 75, 0.16);
    box-shadow: var(--ax-shadow);
}

.app-hero-card__header,
.command-feed__item,
.project-list-item__header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
}

.app-status-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--ax-primary), var(--ax-secondary));
    box-shadow: 0 0 20px rgba(248, 122, 123, 0.45);
    flex: 0 0 auto;
    margin-top: 6px;
}

.app-action-cluster--hero {
    margin-top: 22px;
}

.command-feed {
    display: grid;
    gap: 14px;
    margin-top: 12px;
}

.command-feed__item {
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(31, 31, 35, 0.76);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.command-feed__label,
.sidebar-card__eyebrow,
.project-list-item__meta {
    color: var(--ax-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.72rem;
}

.section-kicker {
    display: inline-block;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.78rem;
    color: var(--ax-text-muted);
}

.section-row {
    display: flex;
    align-items: start;
    gap: 18px;
}

.section-row--compact {
    gap: 12px;
}

.section-row--top {
    align-items: start;
}

.section-row--spread {
    justify-content: space-between;
}

.view-switcher {
    display: inline-flex;
    gap: 8px;
    padding: 8px;
    border-radius: 16px;
    background: rgba(19, 19, 22, 0.88);
    border: 1px solid rgba(72, 71, 75, 0.16);
}

.view-switcher__button {
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--ax-text-muted);
    font-weight: 700;
    padding: 0.7rem 1rem;
}

.view-switcher__button.is-active {
    background: rgba(255, 141, 140, 0.14);
    color: var(--ax-text);
}

.sidebar-card--accent h2,
.sidebar-card--accent p {
    max-width: 220px;
}

.sidebar-card--workspace {
    min-height: 250px;
    overflow: visible;
    background: linear-gradient(180deg, rgba(25, 25, 29, 0.94), rgba(19, 19, 22, 0.98));
}

.sidebar-card--workspace h2 {
    margin-top: 10px;
    font-size: 1.9rem;
    max-width: 10ch;
}

.sidebar-card__orb {
    position: absolute;
    right: -42px;
    bottom: -42px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(205, 164, 255, 0.18), transparent 68%);
    pointer-events: none;
}

.sidebar-card--stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    display: grid;
    gap: 12px;
}

.app-metric-strip {
    background: rgba(19, 19, 22, 0.9);
}

.app-metric-tile {
    padding: 12px 10px;
    border-radius: 16px;
    background: rgba(31, 31, 35, 0.84);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.sidebar-card--stats small,
.account-stat-card small,
.summary-tile small {
    display: block;
    color: var(--ax-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.72rem;
}

.sidebar-card--stats strong,
.account-stat-card strong,
.summary-tile strong {
    display: block;
    font-size: 1.25rem;
    margin-top: 8px;
}

.project-list-shell {
    list-style: none;
    padding: 0;
    margin: 0;
}

.project-list-item {
    display: block;
    padding: 1rem 1.05rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    background: rgba(16, 16, 19, 0.84);
    color: var(--ax-text);
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.project-list-item:hover,
.project-list-item.active {
    transform: translateY(-1px);
    border-color: rgba(255, 141, 140, 0.24);
    background: rgba(37, 37, 42, 0.96);
}

.project-list-item small,
.project-list-item span:last-child {
    color: var(--ax-text-muted);
}

.project-list-item strong {
    font-size: 0.98rem;
}

.project-list-item__id {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--ax-text-muted);
    font-size: 0.78rem;
}

.project-list-item--placeholder {
    cursor: default;
    color: var(--ax-text-muted);
}

.workspace-empty-state,
.empty-state {
    padding: 28px;
    border-radius: var(--ax-radius-md);
    border: 1px dashed rgba(255, 255, 255, 0.12);
    background: rgba(31, 31, 35, 0.46);
    color: var(--ax-text-muted);
}

.summary-grid {
    margin-top: 10px;
}

.summary-grid--overview {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.summary-tile,
.account-stat-card {
    padding: 18px;
    border-radius: 16px;
    background: rgba(31, 31, 35, 0.86);
}

.summary-tile {
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.summary-tile--hero {
    background: linear-gradient(180deg, rgba(31, 23, 28, 0.94), rgba(24, 24, 28, 0.96));
    border-color: rgba(255, 141, 140, 0.14);
}

.manager-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.badge-soft,
.manager-chip,
.metadata-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--ax-text);
    font-size: 0.85rem;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.manager-chip--muted {
    color: var(--ax-text-muted);
}

.manager-chip__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    margin-left: 4px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 143, 164, 0.15);
    color: var(--ax-danger);
    font-size: 0.72rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.manager-chip__remove:hover {
    background: rgba(255, 143, 164, 0.32);
}

.manager-chip {
    background: rgba(31, 31, 35, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0.5rem 0.8rem;
}

.manager-chip__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background: rgba(255, 141, 140, 0.14);
    color: var(--ax-primary);
    font-weight: 800;
}

.license-key-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 141, 140, 0.12);
    border: 1px solid rgba(255, 141, 140, 0.22);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
}

.workspace-card .table,
.workspace-card .table td,
.workspace-card .table th {
    color: var(--ax-text);
}

.workspace-card .table {
    --bs-table-bg: transparent;
    margin-bottom: 0;
}

.workspace-card .table thead th {
    color: var(--ax-text-muted);
    border-bottom-color: rgba(255, 255, 255, 0.08);
    text-transform: uppercase;
    font-size: 0.74rem;
    letter-spacing: 0.12em;
}

.workspace-card .table tbody td {
    border-color: rgba(255, 255, 255, 0.06);
}

.dashboard-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.32rem 0.62rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.dashboard-status-badge.is-active {
    background: rgba(130, 226, 177, 0.12);
    color: var(--ax-success);
}

.dashboard-status-badge.is-disabled {
    background: rgba(255, 143, 164, 0.14);
    color: var(--ax-danger);
}

.status-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-radius: 16px;
    margin-bottom: 18px;
}

.status-banner--success {
    background: rgba(130, 226, 177, 0.12);
    border: 1px solid rgba(130, 226, 177, 0.2);
}

.status-banner code {
    color: var(--ax-text);
}

.api-key-card {
    padding: 18px;
    border-radius: 18px;
    background: rgba(31, 31, 35, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.api-key-card + .api-key-card {
    margin-top: 14px;
}

.api-key-card__header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 18px;
}

.api-key-card__meta,
.legal-article section + section,
.auth-form-grid > div + div {
    margin-top: 10px;
}

.account-panel-grid {
    margin-top: 20px;
}

.account-stat-card,
.account-form-card {
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.workspace-grid {
    display: grid;
    gap: 20px;
}

.workspace-grid--projects {
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
}

.workspace-card--span-2,
.workspace-card--licenses,
.workspace-card--api,
.workspace-card--account {
    grid-column: 1 / -1;
}

.metadata-template-shell {
    display: grid;
    gap: 12px;
}

.template-field--rich {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(31, 31, 35, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.template-field__meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.legal-main {
    padding-bottom: 72px;
}

.legal-article {
    max-width: 880px;
    margin: 42px auto 0;
}

.legal-article h1 {
    font-size: clamp(2.4rem, 5vw, 4rem);
    margin: 14px 0 10px;
}

.legal-article h2 {
    font-size: 1.32rem;
    margin-bottom: 10px;
}

.app-page .glass-panel,
.app-page .modal-content {
    background: rgba(25, 25, 29, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--ax-text);
    border-radius: 24px;
    box-shadow: var(--ax-shadow);
}

.app-page .modal-header,
.app-page .modal-footer {
    border-color: rgba(255, 255, 255, 0.06);
}

.app-page .btn-close {
    filter: invert(1) brightness(0.85);
}

.app-page .btn-primary,
.app-page .btn-secondary,
.app-page .btn-outline-secondary,
.app-page .btn-outline-primary,
.app-page .btn-danger {
    border-radius: 12px;
}

.app-page .btn-primary {
    background: linear-gradient(135deg, var(--ax-primary), var(--ax-secondary));
    border: 0;
    color: #2f0a13;
}

.app-page .btn-secondary,
.app-page .btn-outline-secondary,
.app-page .btn-outline-primary {
    background: rgba(37, 37, 42, 0.92);
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--ax-text);
}

.app-page .btn-danger {
    background: rgba(255, 111, 136, 0.16);
    border-color: rgba(255, 111, 136, 0.22);
    color: #ffd3dd;
}

.app-page .form-label,
.app-page .text-muted,
.app-page .form-text,
.app-page small,
.app-page code,
.app-page .table thead th {
    color: var(--ax-text-muted) !important;
}

.app-page .usage-panel {
    background: rgba(31, 31, 35, 0.86);
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 16px;
}

.app-page .usage-panel .metric-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.app-page .usage-panel .metric-row + .metric-row {
    margin-top: 8px;
}

.app-page .metadata-row,
.app-page .schema-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.app-page .metadata-row + .metadata-row,
.app-page .schema-row + .schema-row,
.template-field + .template-field {
    margin-top: 12px;
}

.app-page .metadata-label-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-page .metadata-label {
    min-width: 140px;
    color: var(--ax-text);
    font-weight: 600;
}

.app-page .metadata-badge {
    font-size: 0.72rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
}

.app-page .metadata-badge.editable {
    background: rgba(130, 226, 177, 0.12);
    color: var(--ax-success);
}

.app-page .metadata-badge.locked {
    background: rgba(255, 143, 164, 0.14);
    color: var(--ax-danger);
}

.validation-panel {
    padding: 2rem;
    border-radius: 32px;
    background: rgba(19, 19, 22, 0.92);
    border: 1px solid rgba(72, 71, 75, 0.14);
}

.validation-card-grid {
    align-items: center;
}

.cta-panel--editorial {
    background: transparent;
    border: 0;
    box-shadow: none;
    text-align: center;
    padding-top: 4rem;
    padding-bottom: 4rem;
}

.cta-panel--editorial h2 {
    font-size: clamp(2.8rem, 7vw, 4.6rem);
}

.cta-panel--editorial .cta-lead {
    margin-left: auto;
    margin-right: auto;
}

.cta-form-shell {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem;
    margin-top: 2rem;
    border-radius: 1.35rem;
    background: rgba(31, 31, 35, 0.94);
    border: 1px solid rgba(72, 71, 75, 0.14);
}

.cta-input {
    min-width: 18rem;
    background: transparent;
    color: var(--ax-text);
    border: 0;
    outline: 0;
    padding: 0.95rem 1.05rem;
}

.cta-input::placeholder {
    color: rgba(172, 170, 174, 0.72);
}

.cta-submit {
    min-width: 12rem;
}

@media (max-width: 1080px) {
    .hero-grid,
    .validation-card-grid,
    .auth-layout,
    .app-shell-layout,
    .account-panel-grid,
    .feature-grid,
    .account-stats-grid,
    .summary-grid,
    .app-hero-grid,
    .workspace-grid--projects,
    .summary-grid--overview {
        grid-template-columns: 1fr;
    }

    .app-main-panel__hero,
    .section-row--spread,
    .api-key-card__header,
    .auth-inline-row,
    .site-footer__inner,
    .template-field--rich {
        flex-direction: column;
        align-items: flex-start;
    }

    .view-switcher {
        flex-wrap: wrap;
        overflow-x: auto;
    }

    .hero-grid {
        min-height: auto;
    }

}

@media (max-width: 960px) {
    .marketing-nav__links {
        display: none;
    }

    .marketing-nav,
    .app-topbar {
        gap: 16px;
        min-height: auto;
        padding-top: 16px;
        padding-bottom: 16px;
    }

    .hero-actions,
    .auth-actions,
    .app-action-cluster {
        width: 100%;
    }

    .hero-actions .button,
    .auth-actions .button,
    .app-action-cluster .button,
    .status-banner .button {
        width: 100%;
    }

    .site-footer__inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .app-action-cluster--hero,
    .project-header__actions {
        width: 100%;
    }

    .cta-form-shell {
        display: flex;
        width: min(100%, 36rem);
        margin-left: auto;
        margin-right: auto;
    }

    .cta-input,
    .cta-submit {
        width: 100%;
    }
}

@media (max-width: 720px) {
    .container-fluid {
        padding-left: 16px;
        padding-right: 16px;
    }

    .hero-copy h1,
    .auth-aside h1 {
        font-size: 3rem;
        max-width: none;
    }

    .hero-preview-card,
    .terminal-card,
    .cta-panel,
    .auth-card,
    .sidebar-card,
    .workspace-card,
    .legal-article,
    .account-form-card,
    .api-key-create-card {
        padding: 22px;
    }

    .validation-panel {
        padding: 1.25rem;
        border-radius: 24px;
    }

    .marketing-nav__links {
        display: none;
    }
}

/* ── Topbar responsive fix ─────────────────────── */
@media (max-width: 720px) {

    .cta-form-shell {
        flex-direction: column;
        width: 100%;
    }

    .cta-input {
        min-width: 0;
        width: 100%;
    }

    .hero-actions,
    .auth-actions,
    .app-action-cluster {
        width: 100%;
    }

    .hero-actions .button,
    .auth-actions .button,
    .app-action-cluster .button,
    .status-banner .button {
        width: 100%;
    }
}

.app-page .app-shell-layout {
    grid-template-columns: 248px minmax(0, 1fr);
    gap: 28px;
    max-width: 1440px;
}

.app-page .app-sidebar-panel--classic {
    position: sticky;
    top: 108px;
    align-self: start;
    gap: 28px;
    padding-right: 28px;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.app-page .app-sidebar-panel__top h2 {
    margin: 0;
    font-size: 1.9rem;
    letter-spacing: -0.04em;
}

.app-page .app-sidebar-panel__top p {
    margin: 10px 0 0;
}

.app-page .app-side-menu {
    display: grid;
    gap: 8px;
}

.app-page .app-side-menu__item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 0.8rem 0.95rem;
    border: 1px solid transparent;
    border-radius: 14px;
    background: transparent;
    color: var(--ax-text-muted);
    font-weight: 700;
    text-align: left;
}

.app-page .app-side-menu__item:hover {
    color: var(--ax-text);
    background: rgba(255, 255, 255, 0.03);
}

.app-page .app-side-menu__item.is-active {
    color: var(--ax-text);
    background: rgba(255, 141, 140, 0.1);
    border-color: rgba(255, 141, 140, 0.2);
}

.app-page .app-sidebar-stats {
    display: grid;
    gap: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.app-page .app-sidebar-stats__item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 0.9rem 0;
}

.app-page .app-sidebar-stats__item + .app-sidebar-stats__item {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.app-page .app-sidebar-projects h3,
.app-page .workspace-section h2,
.app-page .app-main-header h1 {
    letter-spacing: -0.04em;
}

.app-page .app-main-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.app-page .app-main-header h1 {
    margin: 0;
    font-size: clamp(2.2rem, 4vw, 3.4rem);
}

.app-page .app-action-cluster--header {
    justify-content: flex-end;
}

.app-page .workspace-views {
    gap: 28px;
}

.app-page .workspace-section {
    padding: 6px 0 26px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.app-page .workspace-section:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.app-page .workspace-section__header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.app-page .workspace-section__body {
    min-width: 0;
}

.app-page .workspace-split-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
}

.app-page .summary-grid--overview {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.app-page .summary-tile,
.app-page .account-stat-card,
.app-page .account-form-card,
.app-page .api-key-create-card,
.app-page .api-key-card,
.app-page .template-field--rich {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: none;
}

.app-page .summary-tile--hero {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 141, 140, 0.18);
}

.app-page .project-list-item {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.06);
    border-radius: 12px;
}

.app-page .project-list-item:hover,
.app-page .project-list-item.active {
    background: rgba(255, 255, 255, 0.03);
}

.app-page .manager-chip {
    background: rgba(255, 255, 255, 0.03);
}

.app-page .metadata-template-shell {
    gap: 10px;
}

.app-page .status-banner,
.app-page .workspace-empty-state,
.app-page .empty-state {
    box-shadow: none;
}

/* ── Topbar padding ────────────────────────────── */
.app-page .app-topbar {
    padding: 0 28px;
}

.app-topbar__account-btn {
    font-size: 1.2rem;
    padding: 0;
    border: 0;
    background: none;
    line-height: 1;
}

/* ── Sidebar nav label ─────────────────────────── */
.app-side-menu__label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ax-text-muted);
    padding: 0 0.95rem;
    margin-bottom: 2px;
}

.app-sidebar-heading {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.button-icon--sm {
    width: 32px;
    height: 32px;
    font-size: 0.82rem;
}

/* ── License table contrast fix ────────────────── */
.app-page .table,
.app-page .table td,
.app-page .table th {
    color: var(--ax-text);
}

.app-page .table {
    --bs-table-bg: transparent;
    margin-bottom: 0;
}

.app-page .table thead th {
    color: var(--ax-text-muted);
    border-bottom-color: rgba(255, 255, 255, 0.08);
    text-transform: uppercase;
    font-size: 0.74rem;
    letter-spacing: 0.12em;
}

.app-page .table tbody td {
    border-color: rgba(255, 255, 255, 0.06);
    vertical-align: middle;
}

/* ── API Keys compact layout ──────────────────── */
.api-key-create-card--compact {
    padding: 16px 18px;
}

.api-key-create-row {
    display: flex;
    align-items: end;
    gap: 16px;
    flex-wrap: wrap;
}

.api-key-create-field {
    flex: 1;
    min-width: 160px;
}

.api-key-create-field .field-label {
    margin-bottom: 6px;
}

.app-page .api-key-card {
    padding: 14px 16px;
    border-radius: 14px;
}

.app-page .api-key-card + .api-key-card {
    margin-top: 8px;
}

/* ── Account form fields grouping ─────────────── */
.account-form-fields {
    display: grid;
    gap: 10px;
    margin: 14px 0 16px;
}

.app-page .account-form-card {
    padding: 22px;
    display: flex;
    flex-direction: column;
}

.app-page .account-form-card h3 {
    margin-bottom: 4px;
}

.app-page .account-form-card .section-subcopy {
    margin: 0 0 4px;
}

.app-page .account-form-card .button {
    align-self: flex-start;
}

.app-page .account-stat-card {
    padding: 14px 16px;
}

/* ── Account stats tighter ────────────────────── */
.app-page .account-stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

@media (max-width: 780px) {
    .app-page .app-shell-layout,
    .app-page .workspace-split-grid,
    .app-page .summary-grid--overview,
    .app-page .account-stats-grid {
        grid-template-columns: 1fr;
    }

    .app-page .app-sidebar-panel--classic {
        position: static;
        padding-right: 0;
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        padding-bottom: 24px;
    }

    .app-page .app-main-header,
    .app-page .workspace-section__header {
        flex-direction: column;
        align-items: flex-start;
    }

    .api-key-create-row {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 720px) {
    .app-page .app-side-menu {
        display: flex;
        gap: 0;
        background: rgba(255, 255, 255, 0.04);
        border-radius: 12px;
        padding: 3px;
    }

    .app-page .app-side-menu__label {
        display: none;
    }

    .app-page .app-side-menu__item {
        flex: 1 1 0;
        justify-content: center;
        padding: 0.55rem 0.4rem;
        font-size: 0.75rem;
        border-radius: 10px;
        gap: 6px;
    }

    .app-page .app-side-menu__item .bi {
        font-size: 0.85rem;
    }

    .app-page .app-side-menu__item span {
        font-size: 0.72rem;
    }

    .app-page .app-sidebar-stats__item {
        padding: 0.8rem 0;
    }

    .app-page .account-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ── Sidebar project list scroll cap ─────────── */
.app-page .app-sidebar-projects .project-list-shell {
    max-height: 280px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

.app-page .app-sidebar-projects .project-list-shell::-webkit-scrollbar {
    width: 4px;
}

.app-page .app-sidebar-projects .project-list-shell::-webkit-scrollbar-track {
    background: transparent;
}

.app-page .app-sidebar-projects .project-list-shell::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
}

/* ── Glass/blur on main app cards ─────────────── */
.app-page .summary-tile,
.app-page .account-stat-card {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(25, 25, 29, 0.72);
}

.app-page .account-form-card {
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    background: rgba(25, 25, 29, 0.78);
}

.app-page .api-key-card,
.app-page .api-key-create-card {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(25, 25, 29, 0.72);
}

.app-page .project-list-item {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(20, 20, 24, 0.72);
}

.app-page .project-list-item:hover,
.app-page .project-list-item.active {
    background: rgba(37, 37, 42, 0.88);
}

.app-page .app-sidebar-panel--classic {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* ── Responsive: topbar stays single row ──────── */
@media (min-width: 721px) and (max-width: 960px) {
    .app-page .app-topbar {
        flex-direction: row;
        align-items: center;
    }

    .app-page .app-topbar__actions {
        margin-left: auto;
        flex-wrap: nowrap;
    }

    .app-page .app-shell-layout {
        gap: 20px;
    }
}

/* ── Responsive: mobile shell ─────────────────── */
@media (max-width: 720px) {
    .app-page .app-topbar {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        padding: 12px 16px;
    }

    .app-page .app-topbar__brand {
        flex: 1 1 auto;
    }

    .app-page .app-topbar__actions {
        flex-wrap: nowrap;
        gap: 10px;
        margin-left: auto;
    }

    .app-page .app-shell-layout {
        padding: 16px 16px 40px;
        gap: 20px;
        width: 100%;
        box-sizing: border-box;
    }

    .app-page .app-sidebar-panel,
    .app-page .app-main-panel,
    .app-page .workspace-views,
    .app-page .workspace-view,
    .app-page .workspace-section,
    .app-page .workspace-section__body,
    .app-page .workspace-split-grid,
    .app-page .app-main-header,
    .app-page .app-action-cluster {
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }

    .app-page .app-main-header h1 {
        font-size: 1.9rem;
    }

    .app-page .app-action-cluster--header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .app-page .app-action-cluster--header .button {
        flex: 1 1 0;
        min-width: 0;
        text-align: center;
        justify-content: center;
        padding-left: 0.6rem;
        padding-right: 0.6rem;
        font-size: 0.82rem;
    }

    .app-page .summary-grid--overview {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ═══════════════════════════════════════════════════
   PROJECT PICKER DROPDOWN
═══════════════════════════════════════════════════ */
.app-project-picker {
    display: grid;
    gap: 10px;
}

.app-project-picker__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.app-project-select {
    position: relative;
}

.app-project-select__trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 0.72rem 0.95rem;
    background: rgba(25, 25, 29, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    color: var(--ax-text);
    font-weight: 700;
    font-size: 0.92rem;
    text-align: left;
    cursor: pointer;
    backdrop-filter: blur(12px);
    transition: border-color 0.2s, background 0.2s;
}

.app-project-select__trigger:hover,
.app-project-select.is-open .app-project-select__trigger {
    border-color: rgba(255, 141, 140, 0.35);
    background: rgba(37, 37, 42, 0.92);
}

.app-project-select__chevron {
    font-size: 0.75rem;
    color: var(--ax-text-muted);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.app-project-select.is-open .app-project-select__chevron {
    transform: rotate(180deg);
}

.app-project-select__dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 200;
    list-style: none;
    padding: 6px;
    margin: 0;
    background: rgba(22, 22, 26, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(20px);
    max-height: 260px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.app-project-select.is-open .app-project-select__dropdown {
    display: block;
}

.app-project-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s;
    list-style: none;
}

.app-project-option:hover,
.app-project-option.is-selected {
    background: rgba(255, 141, 140, 0.1);
}

.app-project-option.is-selected .app-project-option__name {
    color: var(--ax-primary);
}

.app-project-option__name {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--ax-text);
}

.app-project-option__id {
    font-size: 0.72rem;
    color: var(--ax-text-muted);
    background: rgba(255, 255, 255, 0.06);
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    flex-shrink: 0;
}

.app-project-option--placeholder {
    color: var(--ax-text-muted);
    cursor: default;
    font-size: 0.85rem;
}

/* ═══════════════════════════════════════════════════
   SIDEBAR NAV
═══════════════════════════════════════════════════ */
.app-page .app-side-menu {
    gap: 4px;
}

/* ═══════════════════════════════════════════════════
   TOPBAR — always single row
═══════════════════════════════════════════════════ */
.app-page .app-topbar {
    flex-direction: row !important;
    align-items: center !important;
    min-height: 64px;
}

.app-page .app-topbar__actions {
    margin-left: auto;
    flex-wrap: nowrap;
    gap: 12px;
}

/* ═══════════════════════════════════════════════════
   ACTION CLUSTER — no wrap on desktop
═══════════════════════════════════════════════════ */
.app-page .app-action-cluster--header {
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: nowrap;
}

/* ═══════════════════════════════════════════════════
   SCHEMA ROW — wider grid layout
═══════════════════════════════════════════════════ */
.app-page .schema-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto auto auto;
    align-items: center;
    gap: 10px;
}

.app-page .schema-row .form-control {
    min-width: 0;
    width: 100%;
}

.app-page .schema-row .form-check {
    white-space: nowrap;
    margin: 0;
}

/* ═══════════════════════════════════════════════════
   LICENSES — contrast + Manage button
═══════════════════════════════════════════════════ */
.app-page .table td,
.app-page .table th {
    color: var(--ax-text) !important;
}

.app-page .license-key-chip {
    color: var(--ax-primary) !important;
    font-size: 0.78rem;
}

.app-page .text-muted {
    color: var(--ax-text-muted) !important;
}

.app-page .btn-outline-secondary {
    color: var(--ax-text) !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
    background: rgba(37, 37, 42, 0.72) !important;
    font-size: 0.82rem;
    padding: 0.3rem 0.75rem;
}

.app-page .btn-outline-secondary:hover {
    background: rgba(55, 55, 62, 0.92) !important;
    color: var(--ax-text) !important;
}

@media (max-width: 780px) {
    .app-page .schema-row {
        grid-template-columns: 1fr 1fr;
    }

    /* ── Licenses table: card layout on mobile ─── */
    .app-page .licenses-table thead {
        display: none;
    }

    .app-page .licenses-table tbody tr {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 6px 12px;
        padding: 14px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .app-page .licenses-table tbody td {
        display: block;
        padding: 0;
        border: none;
    }

    .app-page .licenses-table tbody td.licenses-table__key {
        grid-column: 1 / -1;
        margin-bottom: 4px;
    }

    .app-page .licenses-table .license-key-chip {
        font-size: 0.72rem;
        word-break: break-all;
    }

    .app-page .licenses-table tbody td:last-child {
        grid-column: 1 / -1;
        margin-top: 6px;
    }

    .app-page .licenses-table tbody td:last-child .btn {
        width: 100%;
    }

    /* Metadata pills wrap */
    .app-page .licenses-table tbody td:nth-child(4) {
        grid-column: 1 / -1;
    }

    .app-page .licenses-table tbody td:nth-child(4) .metadata-pill {
        display: inline-block;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* ── Project picker overflow fix ─── */
    .app-project-select__trigger {
        min-width: 0;
    }

    .app-project-select__trigger span:first-child {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        min-width: 0;
    }
}

/* ═══════════════════════════════════════════════════
   HAMBURGER MENU — mobile only
═══════════════════════════════════════════════════ */
.app-topbar__hamburger,
.marketing-nav__hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: none;
    color: var(--ax-text);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.app-mobile-menu,
.marketing-mobile-menu {
    display: none;
}

@media (max-width: 600px) {
    .app-topbar__actions,
    .marketing-nav__actions {
        display: none !important;
    }

    .app-page .app-topbar,
    .marketing-nav {
        flex-wrap: nowrap !important;
        gap: 12px;
    }

    .app-topbar__hamburger,
    .marketing-nav__hamburger {
        display: flex;
        margin-left: auto;
    }

    .app-mobile-menu,
    .marketing-mobile-menu {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 2000;
        visibility: hidden;
        pointer-events: none;
    }

    .app-mobile-menu.is-open,
    .marketing-mobile-menu.is-open {
        visibility: visible;
        pointer-events: auto;
    }

    .app-mobile-menu__backdrop {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        opacity: 0;
        transition: opacity 0.25s ease;
    }

    .app-mobile-menu.is-open .app-mobile-menu__backdrop,
    .marketing-mobile-menu.is-open .app-mobile-menu__backdrop {
        opacity: 1;
    }

    .app-mobile-menu__panel {
        position: absolute;
        top: 0;
        right: 0;
        width: min(280px, 80vw);
        height: 100%;
        background: rgba(18, 18, 22, 0.97);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        border-left: 1px solid rgba(255, 255, 255, 0.06);
        display: flex;
        flex-direction: column;
        padding: 20px;
        transform: translateX(100%);
        transition: transform 0.25s ease;
    }

    .app-mobile-menu.is-open .app-mobile-menu__panel,
    .marketing-mobile-menu.is-open .app-mobile-menu__panel {
        transform: translateX(0);
    }

    .app-mobile-menu__header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 24px;
    }

    .app-mobile-menu__close {
        padding: 0;
        border: 0;
        background: none;
        color: var(--ax-text-muted);
        font-size: 1.2rem;
        cursor: pointer;
    }

    .app-mobile-menu__close:hover {
        color: var(--ax-text);
    }

    .app-mobile-menu__links {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .app-mobile-menu__links a,
    .app-mobile-menu__links button {
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
        padding: 0.75rem 0.85rem;
        border-radius: 12px;
        border: none;
        background: transparent;
        color: var(--ax-text-muted);
        font-size: 0.92rem;
        font-weight: 600;
        text-decoration: none;
        text-align: left;
        cursor: pointer;
        transition: background 0.15s, color 0.15s;
    }

    .app-mobile-menu__links a:hover,
    .app-mobile-menu__links button:hover {
        background: rgba(255, 255, 255, 0.05);
        color: var(--ax-text);
    }
}

/* Webhook events multi-select grid */
.webhook-events-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.webhook-event-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 0.375rem;
    background: var(--ax-surface-high);
    color: var(--ax-text-muted);
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    user-select: none;
}

.webhook-event-chip:hover {
    background: var(--ax-surface-highest);
    color: var(--ax-text);
}

.webhook-event-chip input[type="checkbox"] {
    accent-color: var(--ax-primary);
    width: 14px;
    height: 14px;
    margin: 0;
    cursor: pointer;
}

.webhook-event-chip:has(input:checked) {
    background: rgba(255, 141, 140, 0.12);
    color: var(--ax-primary);
}

/* Quota policy grid (project overview) */
.quota-policy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}
.quota-policy-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.quota-policy-field .form-control {
    background: var(--ax-surface-low);
    border: 1px solid var(--ax-outline-soft);
    color: var(--ax-text);
    border-radius: 0.375rem;
}

/* Quota inline grid (license edit modal) */
.quota-inline-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.quota-inline-grid .form-control-sm {
    background: var(--ax-surface-low);
    border: 1px solid var(--ax-outline-soft);
    color: var(--ax-text);
    border-radius: 0.375rem;
    font-size: 0.85rem;
}

/* Quota overview table enhancements */
.quota-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}
.quota-bar-track {
    flex: 1;
    height: 6px;
    background: var(--ax-surface-high);
    border-radius: 3px;
    overflow: hidden;
}
.quota-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}
.quota-bar-fill--ok { background: var(--ax-success); }
.quota-bar-fill--warn { background: #f0c040; }
.quota-bar-fill--danger { background: var(--ax-danger); }

/* Device list */
.device-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--ax-surface-low);
    border-radius: 0.375rem;
    margin-bottom: 8px;
}
.device-card__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.device-card__hwid {
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--ax-text);
}
.device-card__meta {
    font-size: 0.75rem;
    color: var(--ax-text-muted);
}

/* Clickable quota row */
.quota-row-clickable {
    cursor: pointer;
    transition: background 0.15s ease;
}
.quota-row-clickable:hover {
    background: var(--ax-surface-high);
}

/* ============================================================
   Smart Search
   ============================================================ */
.smart-search {
    position: relative;
    margin-bottom: 20px;
}
.smart-search__input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.smart-search__field {
    flex: 1;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 44px;
    padding: 6px 12px 6px 40px;
    background: var(--ax-surface-low);
    border-radius: var(--ax-radius-sm);
    border: 1px solid transparent;
    transition: border-color 0.15s, box-shadow 0.15s;
    cursor: text;
    position: relative;
}
.smart-search__field:focus-within {
    border-color: rgba(255, 141, 140, 0.35);
    box-shadow: 0 0 0 3px rgba(255, 141, 140, 0.08);
}
.smart-search__icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ax-text-muted);
    font-size: 0.85rem;
    pointer-events: none;
}
.smart-search__input {
    flex: 1;
    min-width: 120px;
    border: none;
    background: transparent;
    color: var(--ax-text);
    font-size: 0.88rem;
    font-family: 'Manrope', sans-serif;
    outline: none;
    padding: 4px 0;
}
.smart-search__input::placeholder {
    color: var(--ax-text-muted);
    opacity: 0.7;
}
.smart-search__clear {
    padding: 6px 10px;
    opacity: 0.6;
}
.smart-search__clear:hover { opacity: 1; }

/* Search pills (active filters shown in the input bar) */
.smart-search__pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px 3px 10px;
    border-radius: 0.375rem;
    background: rgba(255, 141, 140, 0.1);
    color: var(--ax-primary);
    font-size: 0.76rem;
    font-weight: 600;
    white-space: nowrap;
    animation: pillIn 0.15s ease;
}
@keyframes pillIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}
.smart-search__pill-label {
    color: var(--ax-text-muted);
    font-weight: 500;
    margin-right: 2px;
}
.smart-search__pill-remove {
    background: none;
    border: none;
    color: var(--ax-primary);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0 2px;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.15s;
}
.smart-search__pill-remove:hover { opacity: 1; }

/* Command palette dropdown */
.smart-search__palette {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 80;
    background: var(--ax-surface);
    border: 1px solid var(--ax-outline-soft);
    border-radius: var(--ax-radius-sm);
    box-shadow: 0 12px 40px rgba(0,0,0,0.4);
    max-height: 380px;
    overflow-y: auto;
    padding: 8px 0;
}
.smart-search__palette::-webkit-scrollbar {
    width: 6px;
}
.smart-search__palette::-webkit-scrollbar-thumb {
    background: var(--ax-surface-highest);
    border-radius: 3px;
}

/* Palette sections & items */
.sp-section {
    padding: 0 8px;
}
.sp-section + .sp-section {
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid var(--ax-outline-soft);
}
.sp-section__title {
    font-size: 0.68rem;
    color: var(--ax-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 700;
    padding: 4px 10px;
}
.sp-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background 0.1s;
    font-size: 0.84rem;
    color: var(--ax-text);
}
.sp-item:hover, .sp-item--focused {
    background: var(--ax-surface-high);
}
.sp-item__icon {
    width: 24px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--ax-text-muted);
    flex-shrink: 0;
}
.sp-item__text {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.sp-item__label {
    font-weight: 600;
}
.sp-item__hint {
    font-size: 0.72rem;
    color: var(--ax-text-muted);
    margin-top: 1px;
}
.sp-item__shortcut {
    font-size: 0.68rem;
    color: var(--ax-text-muted);
    background: var(--ax-surface-high);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Manrope', monospace;
    white-space: nowrap;
}

/* Operator sub-options (inline row) */
.sp-operators {
    display: flex;
    gap: 4px;
    padding: 4px 12px 4px 46px;
}
.sp-op-btn {
    padding: 4px 12px;
    border-radius: 0.375rem;
    background: var(--ax-surface-high);
    color: var(--ax-text);
    border: 1px solid transparent;
    font-size: 0.78rem;
    cursor: pointer;
    font-weight: 600;
    font-family: 'Manrope', monospace;
    transition: all 0.1s;
}
.sp-op-btn:hover {
    background: rgba(255, 141, 140, 0.12);
    color: var(--ax-primary);
    border-color: rgba(255, 141, 140, 0.25);
}

/* Value input row (shown after selecting a filter + operator) */
.sp-value-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px 8px 46px;
}
.sp-value-input {
    flex: 1;
    background: var(--ax-surface-high);
    border: 1px solid var(--ax-outline-soft);
    border-radius: 0.375rem;
    padding: 6px 10px;
    color: var(--ax-text);
    font-size: 0.84rem;
    font-family: 'Manrope', sans-serif;
    outline: none;
}
.sp-value-input:focus {
    border-color: rgba(255, 141, 140, 0.35);
}
.sp-value-input::placeholder {
    color: var(--ax-text-muted);
    opacity: 0.6;
}
.sp-option-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px 12px 6px 46px;
}
.sp-option-chip {
    padding: 4px 14px;
    border-radius: 0.375rem;
    background: var(--ax-surface-high);
    color: var(--ax-text);
    border: 1px solid transparent;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.1s;
}
.sp-option-chip:hover {
    background: rgba(255, 141, 140, 0.12);
    color: var(--ax-primary);
    border-color: rgba(255, 141, 140, 0.25);
}

/* ============================================================
   Bulk Action Bar
   ============================================================ */
.bulk-action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 16px;
    background: rgba(255, 141, 140, 0.06);
    border-radius: 0.375rem;
    border: 1px solid rgba(255, 141, 140, 0.15);
    flex-wrap: wrap;
}
.bulk-action-bar__info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
    color: var(--ax-text);
}
.bulk-action-bar__info input[type="checkbox"] {
    accent-color: var(--ax-primary);
    width: 15px;
    height: 15px;
}
.bulk-action-bar__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.bulk-field {
    display: flex;
    align-items: center;
    gap: 6px;
}
.bulk-field .field-label--tight {
    font-size: 0.72rem;
    white-space: nowrap;
}
.bulk-input {
    width: 90px !important;
    padding: 4px 8px !important;
    font-size: 0.82rem !important;
    background: var(--ax-surface) !important;
    border: 1px solid var(--ax-outline-soft) !important;
    color: var(--ax-text) !important;
    border-radius: 0.375rem !important;
}

/* Quota checkbox column */
.quota-checkbox-cell {
    width: 36px;
    text-align: center;
}
.quota-checkbox-cell input[type="checkbox"] {
    accent-color: var(--ax-primary);
    width: 15px;
    height: 15px;
    cursor: pointer;
}

/* Audit details overflow */
.audit-details-cell {
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.audit-details-cell:hover {
    white-space: normal;
    word-break: break-word;
}

/* Ghost button */
.button-ghost {
    background: none;
    border: 1px solid var(--ax-outline-soft);
    color: var(--ax-text-muted);
}
.button-ghost:hover {
    background: var(--ax-surface-high);
    color: var(--ax-text);
}
