:root {
    color-scheme: dark;

    /* ============================================================
       NEXORA DARK UI — design tokens
       Near-black layered surfaces, electric-indigo accent,
       Inter type scale, 4px spacing rhythm. See DESIGN_SYSTEM.md.
       ============================================================ */

    /* ---- Surfaces: near-black neutrals, layered by elevation ---- */
    --bg-canvas: #08090d;
    --bg-1: #0b0d13;
    --bg-2: #0f121a;
    --bg-3: #141827;
    --bg-4: #191e30;
    --surface: rgba(19, 22, 33, 0.72);
    --surface-strong: rgba(20, 24, 36, 0.94);
    --surface-soft: rgba(255, 255, 255, 0.03);
    --surface-hover: rgba(255, 255, 255, 0.05);

    /* ---- Borders ---- */
    --line: rgba(255, 255, 255, 0.09);
    --line-soft: rgba(255, 255, 255, 0.06);
    --line-strong: rgba(255, 255, 255, 0.16);

    /* ---- Accent: electric indigo/blue (not flat purple) ---- */
    --accent: #505bff;
    --accent-2: #7c8aff;
    --accent-dim: #3d46cc;
    --accent-soft: rgba(80, 91, 255, 0.14);
    --accent-soft-strong: rgba(80, 91, 255, 0.24);
    --accent-line: rgba(80, 91, 255, 0.42);
    --accent-text: #c3caff;

    /* ---- Text ---- */
    --text: #f4f5f9;
    --text-2: #ced2e6;
    --muted: #99a0ba;
    --muted-2: #737b98;

    /* ---- Semantic ---- */
    --success: #2fbd85;
    --success-soft: rgba(47, 189, 133, 0.14);
    --warning: #e3a73c;
    --warning-soft: rgba(227, 167, 60, 0.14);
    --danger: #f0616b;
    --danger-soft: rgba(240, 97, 107, 0.14);
    --info: #4fa3ff;
    --info-soft: rgba(79, 163, 255, 0.14);

    /* ---- Elevation ---- */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 14px 34px rgba(2, 4, 10, 0.4);
    --shadow-lg: 0 28px 70px rgba(2, 4, 10, 0.48);
    --shadow-xl: 0 44px 110px rgba(2, 4, 10, 0.55);
    --shadow-glow: 0 0 0 1px var(--accent-line), 0 14px 32px rgba(80, 91, 255, 0.26);

    /* ---- Radius scale ---- */
    --radius-xs: 8px;
    --radius-sm: 11px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 22px;
    --radius-full: 999px;

    /* ---- Spacing scale (4px rhythm) ---- */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-7: 32px;
    --space-8: 40px;
    --space-9: 48px;
    --space-10: 64px;
    --space-11: 80px;
    --space-12: 96px;

    /* ---- Type scale (Inter) ---- */
    --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --fs-2xs: 11px;
    --fs-xs: 12.5px;
    --fs-sm: 13.5px;
    --fs-base: 15.5px;
    --fs-md: 17px;
    --fs-lg: 19px;
    --fs-xl: 22px;
    --fs-2xl: 27px;
    --fs-3xl: 33px;
    --fs-4xl: 41px;
    --fs-5xl: 53px;
    --fs-6xl: 64px;

    /* ---- Legacy aliases (kept so existing rules resolve unchanged) ---- */
    --bg: var(--bg-canvas);
    --primary: var(--accent);
    --primary-2: var(--accent-2);
    --shadow: var(--shadow-lg);
    --radius: var(--radius-xl);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--text);
    font-family: var(--font-sans);
    font-size: var(--fs-base);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background:
        radial-gradient(ellipse 900px 480px at 12% -8%, rgba(80, 91, 255, 0.13), transparent 60%),
        radial-gradient(ellipse 700px 460px at 96% 4%, rgba(79, 163, 255, 0.08), transparent 58%),
        linear-gradient(180deg, #0a0c12 0%, #08090d 45%, #08090d 100%);
    min-height: 100vh;
}
/* Faint engineered backdrop: a hairline grid fading into the canvas, plus two soft accent blooms. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 64px 64px;
    -webkit-mask-image: radial-gradient(ellipse 1100px 620px at 50% 0%, #000 0%, transparent 72%);
    mask-image: radial-gradient(ellipse 1100px 620px at 50% 0%, #000 0%, transparent 72%);
}
body::after {
    content: "";
    position: fixed;
    width: 480px;
    height: 480px;
    top: -200px;
    right: -140px;
    border-radius: 999px;
    background: rgba(80, 91, 255, 0.14);
    filter: blur(110px);
    pointer-events: none;
    z-index: 0;
}

a { color: var(--text-2); text-decoration: none; }
a:hover { text-decoration: none; color: #fff; }

hr {
    border: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
    margin: 22px 0;
}

.app-shell {
    min-height: 100vh;
    display: flex;
    position: relative;
    z-index: 1;
}

.sidebar {
    width: 280px;
    min-width: 280px;
    background: rgba(8, 9, 13, 0.7);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-right: 1px solid var(--line-soft);
    padding: var(--space-6) var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-top { display: flex; flex-direction: column; gap: 18px; }
.eyebrow,
.brand-meta,
.stat-label,
.pricing-overline,
.landing-kicker {
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: var(--fs-2xs);
    color: var(--muted);
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: var(--fs-2xl);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-top: 6px;
}
.brand::before {
    content: "";
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12) inset, 0 4px 12px rgba(80, 91, 255, 0.35);
}
.big { font-size: 18px; }
.plan-description {
    line-height: 1.5;
    font-size: var(--fs-sm);
    margin: 0;
}
.muted,
.helper-text,
.small-muted,
.user-box span,
.plan-description,
.plan-price-row small,
.ticket-meta,
.ticket-table small,
.note-box,
.card-muted { color: var(--muted); }

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

.subscription-chip,
.guest-card,
.card,
.ticket-preview,
.legal-note,
.landing-card,
.stat-card,
.plan-card,
.note-box,
.customer-box {
    background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
    border: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
}

/* Recessed/inset variant for panels nested inside another card (no competing shadow). */
.card-muted {
    background: var(--bg-1);
    border: 1px solid var(--line-soft);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.subscription-chip,
.card,
.ticket-preview,
.legal-note,
.landing-card,
.stat-card,
.plan-card,
.note-box,
.card-muted,
.customer-box,
.guest-card {
    border-radius: var(--radius-lg);
}

.subscription-chip {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.subscription-chip strong { font-size: 15px; }
.subscription-chip.is-active { border-color: rgba(47, 189, 133, 0.35); box-shadow: 0 18px 42px rgba(4, 12, 27, 0.34); }
.subscription-chip.is-inactive { border-color: rgba(227, 167, 60, 0.35); }

/* Sidebar footer: account identity + language switcher. Styled as a plain
   strip pinned to the bottom of the sidebar (top border, no card chrome)
   so it reads as part of the sidebar frame instead of a floating box. */
.user-box {
    margin-top: auto;
    padding-top: var(--space-4);
    border-top: 1px solid var(--line-soft);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.user-box strong {
    display: block;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-box span {
    display: block;
    font-size: var(--fs-2xs);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-account {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.sidebar-account-avatar {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--accent-text);
    background: linear-gradient(135deg, var(--accent-soft-strong), var(--accent-soft));
    border: 1px solid var(--accent-line);
}
.sidebar-account-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
}
.nav a {
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    padding: 10px 13px;
    color: var(--text-2);
    font-weight: 500;
    font-size: var(--fs-sm);
    transition: border-color .16s ease, background .16s ease, color .16s ease;
}
.nav a:hover {
    color: var(--text);
    background: var(--surface-soft);
}
.nav a.is-current {
    color: var(--text);
    border-color: var(--accent-line);
    background: linear-gradient(180deg, var(--accent-soft-strong), var(--accent-soft));
}

.locale-form { width: 100%; }
.locale-select {
    width: 100%;
    padding: 6px 10px;
    font-size: var(--fs-2xs);
    font-weight: 500;
    border-radius: var(--radius-xs);
    border: 1px solid var(--line);
    background: var(--surface-soft);
    color: var(--muted);
    box-shadow: none;
    cursor: pointer;
    transition: border-color .16s ease, color .16s ease, background .16s ease;
}
.locale-select:hover {
    border-color: var(--line-strong);
    color: var(--text-2);
}
.locale-select:focus {
    border-color: var(--accent-line);
    box-shadow: 0 0 0 3px var(--accent-soft);
    background: var(--bg-2);
    color: var(--text);
}

.main-content {
    flex: 1;
    padding: 28px;
    min-width: 0;
}

.main-content--guest {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}
.main-content--top {
    align-items: flex-start;
    padding-top: 0;
}

.content-frame {
    width: min(1360px, 100%);
    margin: 0 auto;
}

.guest-card {
    width: min(500px, 100%);
    padding: var(--space-9);
}
.guest-card-wide { width: min(880px, 100%); }
.guest-card h1 {
    font-size: var(--fs-3xl);
    line-height: 1.16;
    letter-spacing: -0.03em;
    margin-bottom: 10px;
}
.guest-card > .muted {
    margin-bottom: var(--space-7);
    line-height: 1.6;
    font-size: var(--fs-sm);
}
.guest-card .helper-text {
    margin: var(--space-6) 0 0;
    text-align: center;
    font-size: var(--fs-sm);
    color: var(--muted);
}
.guest-card .helper-text a { color: var(--text); font-weight: 600; }
.guest-card .helper-text a:hover { color: var(--accent-2); }

.auth-eyebrow {
    display: inline-flex;
    width: fit-content;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    color: var(--accent-text);
    background: var(--accent-soft);
    border: 1px solid var(--accent-line);
    text-transform: uppercase;
    letter-spacing: .1em;
    font-size: var(--fs-2xs);
    font-weight: 700;
    margin-bottom: var(--space-4);
}

.form-section {
    border: 0;
    padding: 0 0 6px;
    margin: 0 0 6px;
    min-width: 0;
    display: grid;
    gap: var(--space-4);
}
.form-section + .form-section {
    padding-top: var(--space-6);
    border-top: 1px solid var(--line-soft);
}
.form-section legend {
    padding: 0 0 2px;
    font-size: var(--fs-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--muted);
}

.guest-card .checkbox-row { padding-top: 0; }

.main-content--guest .guest-card {
    position: relative;
    overflow: hidden;
}
.main-content--guest .guest-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-line), transparent);
}

/* ---------- Public header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(8, 9, 13, 0.78);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line-soft);
}
.site-header-inner {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: 14px var(--space-6);
}
.site-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: var(--fs-md);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}
.site-logo::before {
    content: "";
    width: 20px;
    height: 20px;
    border-radius: 6px;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12) inset, 0 4px 14px rgba(80, 91, 255, 0.4);
}
.site-logo:hover { color: var(--text); }
.site-nav {
    display: flex;
    align-items: center;
    gap: var(--space-6);
}
.site-nav a:not(.btn) {
    color: var(--text-2);
    font-weight: 500;
    font-size: var(--fs-sm);
    transition: color .15s ease;
}
.site-nav a:not(.btn):hover,
.site-nav a:not(.btn).is-current { color: #fff; }

/* ---------- Public footer ---------- */
.site-footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--line-soft);
    margin-top: 8px;
}
.site-footer-inner {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: var(--space-9) var(--space-6) var(--space-6);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-6);
    flex-wrap: wrap;
}
.site-footer-brand { max-width: 400px; display: flex; flex-direction: column; gap: 10px; }
.site-footer-brand .site-logo { font-size: var(--fs-md); }
.site-footer-brand .muted { margin: 0; line-height: 1.6; font-size: var(--fs-sm); }
.site-footer-links { display: flex; gap: var(--space-6); flex-wrap: wrap; }
.site-footer-links a { color: var(--text-2); font-weight: 500; font-size: var(--fs-sm); }
.site-footer-links a:hover { color: #fff; }
.site-footer-bottom {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: var(--space-5) var(--space-6) var(--space-8);
    border-top: 1px solid var(--line-soft);
    color: var(--muted-2);
    font-size: var(--fs-xs);
}

/* ---------- Landing / hero ---------- */
.landing { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 0; }

.hero-section {
    width: 100%;
    max-width: 780px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--space-11) 0 var(--space-7);
    position: relative;
    z-index: 1;
}
.landing-kicker {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: var(--radius-full);
    color: var(--accent-text);
    background: var(--accent-soft);
    border: 1px solid var(--accent-line);
    margin-bottom: var(--space-6);
}
.landing-kicker::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--accent-2);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.hero-section h1 {
    font-size: clamp(36px, 4.6vw, var(--fs-6xl));
    line-height: 1.08;
    letter-spacing: -0.045em;
    max-width: 17ch;
    margin-bottom: var(--space-4);
    background: linear-gradient(180deg, #ffffff 18%, #b9c0e0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}
.landing-audience {
    font-size: var(--fs-sm);
    max-width: 58ch;
    color: var(--muted);
    margin-bottom: 4px;
}
.landing-lead {
    font-size: var(--fs-md);
    line-height: 1.55;
    max-width: 54ch;
    margin-bottom: var(--space-6);
    color: var(--text-2);
}
.highlight-pill,
.pill,
.badge,
.plan-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--line);
    background: var(--surface-soft);
    color: var(--text-2);
    font-size: var(--fs-xs);
    font-weight: 600;
}
.highlight-pill::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--accent-2);
    flex-shrink: 0;
}
.header-actions,
.filter-actions,
.section-title-row,
.plan-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.landing-actions { justify-content: center; margin-bottom: var(--space-5); gap: 12px; }
.landing-note {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    border: 1px solid var(--line-soft);
    line-height: 1.55;
    max-width: 54ch;
    color: var(--muted);
    font-size: var(--fs-xs);
}

.trust-strip {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: var(--space-6) 0 var(--space-11);
    position: relative;
    z-index: 1;
}

.pricing-section {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 8px 0 var(--space-11);
    position: relative;
    z-index: 1;
}
.pricing-header {
    text-align: center;
    max-width: 620px;
    margin: 0 auto var(--space-9);
}
.pricing-header h2 {
    font-size: clamp(28px, 3.4vw, var(--fs-4xl));
    letter-spacing: -0.04em;
    line-height: 1.18;
    margin: var(--space-3) 0 var(--space-3);
}
.pricing-overline { color: var(--accent-text); font-weight: 700; }
.pricing-header .muted { margin: 0; font-size: var(--fs-base); }


.final-cta {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
    padding: var(--space-6) 0 var(--space-12);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
    position: relative;
    z-index: 1;
}
.final-cta h2 {
    font-size: clamp(26px, 3vw, var(--fs-3xl));
    letter-spacing: -0.04em;
    margin: 0;
}
.final-cta .muted { max-width: 52ch; margin: 0 0 4px; }

.plans-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-5);
    align-items: stretch;
}
.full-grid,
.four-up {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: var(--space-5);
}
.three-up {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: var(--space-5);
}
.landing-plan-card,
.plan-card {
    padding: var(--space-6) var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    height: 100%;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    transition: transform .2s cubic-bezier(.2,.8,.2,1), border-color .2s ease, box-shadow .2s ease;
}
.landing-plan-card::before,
.plan-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}
.landing-plan-card:hover,
.plan-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent-line);
    box-shadow: var(--shadow-xl);
}
.card:hover,
.stat-card:hover,
.guest-card:hover {
    border-color: var(--line-strong);
}
.plan-card-top strong { font-weight: 700; }
.landing-plan-card.is-featured {
    border-color: var(--accent-line);
    background: linear-gradient(180deg, var(--bg-4), var(--bg-2));
    box-shadow: 0 0 0 1px var(--accent-line), var(--shadow-xl);
}
.landing-plan-card.is-featured::before {
    background: linear-gradient(90deg, transparent, var(--accent-2), transparent);
    height: 2px;
}
.landing-plan-card.is-featured:hover {
    transform: translateY(-5px);
}
.plan-ribbon {
    position: absolute;
    top: var(--space-5);
    right: var(--space-5);
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    box-shadow: 0 8px 20px rgba(80, 91, 255, .4);
    white-space: nowrap;
    z-index: 2;
}
.plan-card-top {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.landing-plan-card.is-featured .plan-card-top { padding-right: 96px; }
.plan-card.is-featured .plan-top { margin-top: 32px; }
.plan-card-top strong {
    font-size: var(--fs-xl);
    letter-spacing: -0.02em;
    font-weight: 700;
}
.plan-price { font-size: var(--fs-3xl); font-weight: 700; letter-spacing: -0.03em; }
.plan-price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--line-soft);
}
.plan-list {
    margin: 2px 0 0;
    padding-left: 0;
    list-style: none;
    color: var(--text-2);
    display: grid;
    gap: 10px;
    line-height: 1.5;
    font-size: var(--fs-sm);
    flex: 1;
}
.plan-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.plan-list li::before {
    content: "";
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin-top: 2px;
    border-radius: 5px;
    background: var(--accent-soft);
    border: 1px solid var(--accent-line);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.5 8.5L6.5 11.5L12.5 4.5' stroke='%237c8aff' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 10px;
}
.current-plan-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.current-plan-box strong,
.current-plan-box span {
    padding: 10px 13px;
    border-radius: 999px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--line);
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: var(--space-6);
}
.page-header h1 {
    margin: 0 0 8px;
    font-size: clamp(28px, 3vw, var(--fs-4xl));
    line-height: 1.12;
    letter-spacing: -0.035em;
}
.page-header p { margin-bottom: 0; max-width: 70ch; color: var(--muted); }
.top-gap { margin-top: 18px; }

h1, h2, h3, p { margin-top: 0; }
h2 {
    font-size: var(--fs-xl);
    line-height: 1.25;
    letter-spacing: -0.02em;
    margin-bottom: 14px;
}

.form-stack,
.filters-grid,
.grid { display: grid; gap: var(--space-4); }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.one-column { grid-template-columns: 1fr; }
.filters-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.two-panel-card { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); }

.card,
.ticket-preview,
.legal-note,
.note-box,
.customer-box,
.card-muted,
.stat-card {
    padding: var(--space-6);
    margin: 0;
}
.card p,
.note-box p,
.customer-box p,
.legal-note p,
.card-muted p { margin: 0 0 10px; }
.card p:last-child,
.note-box p:last-child,
.customer-box p:last-child,
.legal-note p:last-child,
.card-muted p:last-child { margin-bottom: 0; }

/* Table wrapped for horizontal scroll on small viewports (alias of .table-wrapper). */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--line-soft);
    background: var(--surface-soft);
}

h3 {
    font-size: var(--fs-md);
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0 0 4px;
}

/* Chat bubbles: support threads (customer + admin panel share this markup). */
.chat-scroll {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    max-height: 500px;
    overflow-y: auto;
    padding-right: 2px;
}
.chat-message {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    background: var(--bg-1);
    border: 1px solid var(--line-soft);
    border-left: 2px solid var(--line-strong);
}
.chat-message.is-user { border-left-color: var(--accent); }
.chat-message.is-assistant { border-left-color: var(--info); }
.chat-message.is-admin { border-left-color: var(--success); }
.chat-message-meta {
    font-size: var(--fs-2xs);
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted-2);
    margin-bottom: 6px;
}
.chat-message-body { font-size: var(--fs-sm); line-height: 1.55; color: var(--text-2); }

label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: var(--fs-sm);
    color: var(--text-2);
    font-weight: 600;
}
input, select, button, textarea { font: inherit; }
input, select, textarea {
    width: 100%;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-strong);
    background: var(--bg-1);
    color: var(--text);
    padding: 12px 14px;
    font-size: var(--fs-base);
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
input::placeholder,
textarea::placeholder { color: var(--muted-2); }
input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
    background: var(--bg-2);
}
textarea { min-height: 120px; resize: vertical; }

.btn {
    appearance: none;
    border: 1px solid var(--line-strong);
    background: var(--surface-soft);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 11px 18px;
    min-height: 44px;
    cursor: pointer;
    font-weight: 600;
    font-size: var(--fs-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform .16s cubic-bezier(.2,.8,.2,1), border-color .16s ease, background .16s ease, box-shadow .16s ease, filter .16s ease;
}
.btn:hover {
    transform: translateY(-1px);
    background: var(--surface-hover);
    border-color: var(--line-strong);
}
.btn:active { transform: translateY(0); }
.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px var(--accent-soft-strong);
    border-color: var(--accent);
}
.btn-primary {
    background: linear-gradient(180deg, var(--accent-2), var(--accent));
    border-color: rgba(255, 255, 255, 0.14);
    color: #fff;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.16) inset, 0 10px 24px rgba(80, 91, 255, 0.32);
}
.btn-primary:hover {
    filter: brightness(1.08);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 14px 32px rgba(80, 91, 255, 0.42);
}
.btn-danger {
    background: var(--danger-soft);
    border-color: rgba(240, 97, 107, 0.34);
    color: #ffb9bd;
}
.btn-danger:hover { background: rgba(240, 97, 107, 0.2); }
.btn-ghost {
    background: transparent;
    border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--line-strong); background: var(--surface-soft); }
.btn-subtle { background: transparent; border-color: transparent; }
.btn-lg { min-width: 168px; min-height: 50px; padding: 13px 22px; font-size: var(--fs-base); }
.btn-sm { min-height: 38px; padding: 8px 14px; font-size: var(--fs-xs); }
.btn-full { width: 100%; }

.alert,
.banner {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-4);
    border: 1px solid transparent;
    backdrop-filter: blur(12px);
    font-size: var(--fs-sm);
}
.alert-success,
.banner-ok { background: var(--success-soft); border-color: rgba(47, 189, 133, 0.34); color: #b7ecd6; }
.alert-error { background: var(--danger-soft); border-color: rgba(240, 97, 107, 0.34); color: #ffcdd0; }
.banner-warn { background: var(--warning-soft); border-color: rgba(227, 167, 60, 0.32); color: #f6dba6; }
.banner-info { background: var(--info-soft); border-color: rgba(79, 163, 255, 0.3); color: #bfdcff; }
.banner a { color: #fff; font-weight: 700; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}
.compact-grid { margin-top: 18px; }
.stat-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.stat-card strong {
    font-size: clamp(28px, 3vw, 38px);
    letter-spacing: -0.04em;
}
.stat-label { color: var(--accent-text); }
.stat-card small { color: var(--muted); }

.sale-line {
    display: grid;
    gap: var(--space-3);
    /* 6 tracks: artículo, producto de stock, otro artículo, cantidad, precio, quitar */
    grid-template-columns: 1.3fr 1.3fr 1.1fr 0.7fr 0.9fr auto;
    align-items: end;
    padding: var(--space-4) 0;
    border-bottom: 1px solid var(--line-soft);
}
.sale-line:last-child { border-bottom: 0; }
.sale-line .btn-danger { flex-shrink: 0; }

.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--line-soft);
    background: var(--surface-soft);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

thead th {
    font-size: var(--fs-2xs);
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--muted);
    background: var(--surface-soft);
    font-weight: 600;
}
th, td {
    padding: 14px var(--space-4);
    border-bottom: 1px solid var(--line-soft);
    text-align: left;
    vertical-align: top;
    font-size: var(--fs-sm);
}
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: var(--surface-soft); }
tbody tr:last-child td { border-bottom: 0; }
.empty-state {
    text-align: center;
    color: var(--muted);
    padding: 30px 16px;
}

.ticket-preview {
    max-width: 840px;
    margin: 0 auto;
}
.ticket-header.centered,
.centered { text-align: center; }
.ticket-meta {
    display: grid;
    gap: 6px;
    line-height: 1.6;
}
.ticket-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 0;
}
.ticket-table th,
.ticket-table td {
    padding: 11px 8px;
    border-bottom: 1px dashed rgba(255,255,255,0.14);
}
.ticket-totals {
    display: grid;
    gap: 8px;
}
.ticket-totals div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.ticket-totals strong { font-size: 18px; }

.inline-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    margin-bottom: 18px;
}
.pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.pill {
    background: rgba(255,255,255,0.045);
}
.pill-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.pill-row-meta { color: var(--muted); font-size: var(--fs-xs); }
.pill-row form { margin: 0; }
.button-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.button-row form { margin: 0; }
.badge {
    background: var(--accent-soft);
    border-color: var(--accent-line);
    color: var(--accent-text);
}

code {
    display: inline-block;
    max-width: 520px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 6px 10px;
    border-radius: var(--radius-xs);
    background: var(--bg-1);
    border: 1px solid var(--line);
    color: var(--text-2);
    font-size: var(--fs-xs);
}

.header-actions form,
.pill-list form { margin: 0; }
td .btn + .btn,
td .btn + a { margin-left: 8px; }

@media (max-width: 1200px) {
    .full-grid,
    .four-up,
    .three-up,
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
    .app-shell { display: block; }
    .sidebar {
        width: 100%;
        min-width: 0;
        height: auto;
        position: static;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
    .main-content { padding: 20px; }
    .content-frame { width: 100%; }
    .two-columns,
    .three-columns,
    .filters-grid,
    .sale-line,
    .plans-grid,
    .four-up,
    .full-grid,
    .three-up,
    .two-panel-card { grid-template-columns: 1fr; }
    .hero-section { padding: 32px 0 24px; }
    .trust-strip { padding: 18px 0 36px; }
    .pricing-section { padding: 8px 0 36px; }
    .final-cta { padding: 8px 0 44px; }
}

@media (max-width: 640px) {
    .main-content,
    .main-content--guest { padding: 16px; }
    .main-content--top { padding-top: 0; }
    .guest-card,
    .card,
    .ticket-preview,
    .stat-card,
    .plan-card,
    .note-box,
    .card-muted,
    .customer-box,
    .legal-note { padding: 20px; }
    .stats-grid { grid-template-columns: 1fr; }
    .page-header { align-items: stretch; }
    .inline-form { grid-template-columns: 1fr; }
    .btn,
    .btn-lg { width: 100%; }
    .header-actions,
    .filter-actions,
    .landing-actions { width: 100%; }
    .header-actions > *,
    .filter-actions > *,
    .landing-actions > * { flex: 1; }
    table { min-width: 620px; }

    /* Public header: stack logo above nav, nav wraps and centers */
    .site-header-inner {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        padding: 12px 20px;
    }
    .site-nav {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        row-gap: 8px;
        column-gap: 16px;
    }
    .site-nav .btn { width: auto; }
    .site-nav a:not(.btn) { font-size: 13.5px; }
    .site-nav .btn-sm { padding: 8px 14px; font-size: 13.5px; min-height: 38px; }

    /* Public footer: center everything */
    .site-footer-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 18px;
        padding: 28px 20px 18px;
    }
    .site-footer-brand { align-items: center; }
    .site-footer-links { justify-content: center; }
    .site-footer-bottom { text-align: center; padding: 16px 20px 28px; }

    .hero-section { padding: 28px 0 20px; }
    .landing-note { font-size: 13px; }
    .pricing-header { margin-bottom: 24px; }
    .plan-ribbon { top: 16px; right: 16px; font-size: 9.5px; padding: 5px 10px; }
}


.status-badge{display:inline-flex;align-items:center;gap:.4rem;padding:.38rem .7rem;border-radius:var(--radius-full);font-size:var(--fs-xs);font-weight:700;border:1px solid var(--line);background:var(--surface-soft)}
.status-queued{background:var(--warning-soft);color:#f2c579;border-color:rgba(227,167,60,.3)}
.status-sent,.status-accepted,.status-accepted_with_errors{background:var(--success-soft);color:#7fe0b6;border-color:rgba(47,189,133,.3)}
.status-rejected{background:var(--danger-soft);color:#f7a1a8;border-color:rgba(240,97,107,.3)}
.hash-code{font-size:var(--fs-xs);color:var(--text-2)}
.hash-block{display:block;max-width:100%;padding:.75rem;border-radius:var(--radius-sm);background:var(--bg-1);border:1px solid var(--line-soft);color:var(--text-2);font-size:var(--fs-xs);word-break:break-all;line-height:1.5}
.ticket-meta-verifactu{display:grid;grid-template-columns:220px 1fr;gap:1.25rem;align-items:start}
.ticket-qr-block{text-align:center}
.ticket-qr-image{width:180px;height:180px;border-radius:var(--radius-md);background:#fff;padding:.75rem;display:block;margin:.35rem auto .75rem}
.checkbox-row{display:flex;align-items:center;gap:.75rem;padding-top:1.9rem}
.checkbox-row input{width:18px;height:18px;accent-color:var(--accent);}
.checkbox-row-flush{padding-top:0;}

.cookie-consent {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    padding: 18px;
    display: flex;
    justify-content: center;
    transform: translateY(120%);
    opacity: 0;
    transition: transform .32s ease, opacity .32s ease;
    pointer-events: none;
}
.cookie-consent.is-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}
.cookie-consent[hidden] { display: none; }
.cookie-consent-inner {
    width: min(720px, 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: var(--space-5) var(--space-6);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, var(--bg-4), var(--bg-2));
    border: 1px solid var(--line-strong);
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(16px);
}
.cookie-consent-text strong { display: block; margin-bottom: 4px; font-size: var(--fs-base); }
.cookie-consent-text p { margin: 0; color: var(--muted); font-size: var(--fs-xs); line-height: 1.6; }
.cookie-consent-text a { color: var(--text); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.cookie-consent-actions { display: flex; gap: 10px; flex-shrink: 0; }

@media (max-width: 640px) {
    .cookie-consent { padding: 12px; }
    .cookie-consent-inner { flex-direction: column; align-items: stretch; text-align: left; padding: 18px; }
    .cookie-consent-actions .btn { flex: 1; }
}
@media (max-width: 800px){.ticket-meta-verifactu{grid-template-columns:1fr}.ticket-qr-image{margin-left:0;margin-right:0}}
