:root {
    --bg: #070b17;
    --bg-2: #0c1224;
    --surface: rgba(15, 22, 41, 0.82);
    --surface-strong: rgba(17, 25, 47, 0.92);
    --surface-soft: rgba(255,255,255,0.035);
    --line: rgba(154, 169, 255, 0.14);
    --line-strong: rgba(154, 169, 255, 0.24);
    --text: #f5f7ff;
    --muted: #9eabc9;
    --muted-2: #7f8cae;
    --primary: #7c5cff;
    --primary-2: #5f6fff;
    --success: #27b27d;
    --warning: #e0a640;
    --danger: #e25b66;
    --info: #57a4ff;
    --shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
    --radius: 22px;
    --radius-sm: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(124, 92, 255, 0.18), transparent 28%),
        radial-gradient(circle at 90% 15%, rgba(95, 111, 255, 0.16), transparent 22%),
        linear-gradient(180deg, #0a1020 0%, #050812 100%);
    min-height: 100vh;
}
body::before,
body::after {
    content: "";
    position: fixed;
    inset: auto;
    border-radius: 999px;
    filter: blur(90px);
    pointer-events: none;
    z-index: 0;
}
body::before {
    width: 420px;
    height: 420px;
    background: rgba(124, 92, 255, 0.16);
    top: -140px;
    right: -80px;
}
body::after {
    width: 360px;
    height: 360px;
    background: rgba(67, 154, 255, 0.1);
    bottom: -160px;
    left: -120px;
}

a { color: #c8d4ff; 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: 294px;
    min-width: 294px;
    background: rgba(6, 11, 23, 0.62);
    backdrop-filter: blur(18px);
    border-right: 1px solid var(--line);
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    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: .14em;
    font-size: 11px;
}
.brand {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-top: 6px;
}
.big { font-size: 18px; }
.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,
.user-box,
.nav a,
.locale-form select,
.guest-card,
.card,
.ticket-preview,
.legal-note,
.landing-card,
.stat-card,
.plan-card,
.note-box,
.card-muted,
.customer-box {
    background: linear-gradient(180deg, rgba(20, 29, 52, 0.94), rgba(11, 17, 33, 0.92));
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

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

.subscription-chip,
.user-box {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.subscription-chip strong,
.user-box strong { font-size: 15px; }
.subscription-chip.is-active { border-color: rgba(39, 178, 125, 0.35); box-shadow: 0 18px 42px rgba(4, 12, 27, 0.34); }
.subscription-chip.is-inactive { border-color: rgba(224, 166, 64, 0.35); }

.nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}
.nav a {
    border-radius: 16px;
    padding: 13px 14px;
    color: var(--text);
    font-weight: 600;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.nav a:hover,
.nav a.is-current {
    transform: translateX(3px);
    border-color: rgba(124, 92, 255, 0.38);
    background: linear-gradient(180deg, rgba(124, 92, 255, 0.16), rgba(95, 111, 255, 0.08));
}

.locale-form select {
    width: 100%;
    box-shadow: none;
}

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

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

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

.guest-card {
    width: min(560px, 92vw);
    padding: 30px;
}
.guest-card-wide { width: min(980px, 94vw); }

.main-content--guest .guest-card {
    position: relative;
    overflow: hidden;
}
.main-content--guest .guest-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-2), #85c2ff);
}

.landing { width: 100%; display: flex; justify-content: center; }
.landing-card {
    width: min(1240px, 96vw);
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(390px, .92fr);
    gap: 28px;
    padding: 32px;
    position: relative;
    overflow: hidden;
}
.landing-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top left, rgba(124, 92, 255, 0.14), transparent 36%);
    pointer-events: none;
}
.landing-copy,
.landing-side { position: relative; z-index: 1; }
.landing-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-right: 10px;
}
.landing-kicker {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    padding: 9px 14px;
    border-radius: 999px;
    color: #ddd8ff;
    background: rgba(124, 92, 255, 0.12);
    border: 1px solid rgba(124, 92, 255, 0.28);
    margin-bottom: 18px;
}
.landing-copy h1 {
    font-size: clamp(42px, 5vw, 68px);
    line-height: 1.02;
    letter-spacing: -0.05em;
    max-width: 11ch;
    margin-bottom: 18px;
}
.landing-lead {
    font-size: 18px;
    line-height: 1.7;
    max-width: 60ch;
    margin-bottom: 24px;
    color: #ccd5fb;
}
.landing-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 28px;
}
.highlight-pill,
.pill,
.badge,
.plan-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 13px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.04);
    color: #edf1ff;
    font-size: 13px;
    font-weight: 600;
}
.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: flex-start; }
.landing-note {
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255,255,255,0.035);
    border: 1px solid rgba(255,255,255,0.06);
    line-height: 1.7;
    max-width: 62ch;
    color: #9eacd6;
}

.landing-side { display: flex; flex-direction: column; gap: 16px; }
.pricing-header { padding: 4px 4px 0; }
.pricing-header h2 {
    font-size: 30px;
    letter-spacing: -0.04em;
    margin: 8px 0 10px;
}
.pricing-overline { color: #c6bbff; }

.plans-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}
.full-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 18px;
}
.landing-plan-card,
.plan-card {
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 100%;
    position: relative;
    overflow: hidden;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.landing-plan-card::before,
.plan-card::before {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
}
.landing-plan-card:hover,
.plan-card:hover,
.card:hover,
.stat-card:hover,
.guest-card:hover {
    transform: translateY(-2px);
    border-color: rgba(124, 92, 255, 0.28);
}
.landing-plan-card.is-featured {
    border-color: rgba(124, 92, 255, 0.42);
    background: linear-gradient(180deg, rgba(44, 35, 83, 0.97), rgba(17, 17, 36, 0.92));
}
.plan-card-top {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.plan-card-top strong {
    font-size: 28px;
    letter-spacing: -0.03em;
}
.plan-price { font-size: 38px; font-weight: 800; letter-spacing: -0.04em; }
.plan-price-row { display: flex; flex-direction: column; gap: 6px; }
.plan-list {
    margin: 2px 0 0;
    padding-left: 18px;
    color: var(--muted);
    display: grid;
    gap: 8px;
    line-height: 1.55;
}
.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: 24px;
}
.page-header h1 {
    margin: 0 0 8px;
    font-size: clamp(30px, 3vw, 42px);
    line-height: 1.08;
    letter-spacing: -0.04em;
}
.page-header p { margin-bottom: 0; max-width: 70ch; }
.top-gap { margin-top: 18px; }

h1, h2, h3, p { margin-top: 0; }
h2 {
    font-size: 22px;
    line-height: 1.2;
    letter-spacing: -0.03em;
    margin-bottom: 14px;
}

.form-stack,
.filters-grid,
.grid { display: grid; gap: 16px; }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.filters-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.two-panel-card { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.card,
.ticket-preview,
.legal-note,
.note-box,
.customer-box,
.card-muted,
.stat-card {
    padding: 24px;
}
.card p:last-child,
.note-box p:last-child,
.customer-box p:last-child { margin-bottom: 0; }

label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
    color: #dfe6ff;
    font-weight: 600;
}
input, select, button, textarea { font: inherit; }
input, select, textarea {
    width: 100%;
    border-radius: 16px;
    border: 1px solid rgba(154, 169, 255, 0.18);
    background: rgba(6, 11, 23, 0.64);
    color: var(--text);
    padding: 13px 15px;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
input::placeholder,
textarea::placeholder { color: #7f8ba9; }
input:focus,
select:focus,
textarea:focus {
    border-color: rgba(124, 92, 255, 0.56);
    box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.14);
    background: rgba(8, 13, 28, 0.88);
}
textarea { min-height: 120px; resize: vertical; }

.btn {
    appearance: none;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.045);
    color: var(--text);
    border-radius: 16px;
    padding: 12px 16px;
    min-height: 48px;
    cursor: pointer;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.btn:hover {
    transform: translateY(-1px);
    background: rgba(255,255,255,0.065);
    border-color: var(--line-strong);
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    border-color: transparent;
    box-shadow: 0 14px 34px rgba(63, 68, 170, 0.28);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #8870ff, #7483ff);
}
.btn-danger {
    background: rgba(226, 91, 102, 0.12);
    border-color: rgba(226, 91, 102, 0.34);
}
.btn-ghost {
    background: rgba(255,255,255,0.04);
}
.btn-subtle { background: transparent; }
.btn-lg { min-width: 170px; min-height: 52px; padding: 14px 20px; }
.btn-full { width: 100%; }

.alert,
.banner {
    padding: 15px 18px;
    border-radius: 18px;
    margin-bottom: 18px;
    border: 1px solid transparent;
    backdrop-filter: blur(12px);
}
.alert-success,
.banner-ok { background: rgba(39, 178, 125, 0.12); border-color: rgba(39, 178, 125, 0.34); }
.alert-error { background: rgba(226, 91, 102, 0.12); border-color: rgba(226, 91, 102, 0.34); }
.banner-warn { background: rgba(224, 166, 64, 0.12); border-color: rgba(224, 166, 64, 0.32); }
.banner-info { background: rgba(87, 164, 255, 0.12); border-color: rgba(87, 164, 255, 0.3); }
.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: #c3cef5; }
.stat-card small { color: var(--muted); }

.sale-line {
    display: grid;
    gap: 14px;
    grid-template-columns: 2fr 2fr 1fr 1.2fr auto;
    align-items: end;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sale-line:last-child { border-bottom: 0; }

.table-wrapper {
    overflow-x: auto;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.02);
}

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

thead th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: #b1bee9;
    background: rgba(255,255,255,0.02);
}
th, td {
    padding: 15px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    text-align: left;
    vertical-align: top;
}
tbody tr:hover { background: rgba(255,255,255,0.025); }
.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);
}
.badge {
    background: rgba(124, 92, 255, 0.12);
    border-color: rgba(124, 92, 255, 0.26);
}

code {
    display: inline-block;
    max-width: 520px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 7px 10px;
    border-radius: 12px;
    background: rgba(6, 11, 23, 0.72);
    border: 1px solid rgba(154, 169, 255, 0.14);
    color: #d5e3ff;
}

.header-actions form,
.pill-list form { margin: 0; }

@media (max-width: 1200px) {
    .full-grid,
    .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%; }
    .landing-card,
    .two-columns,
    .three-columns,
    .filters-grid,
    .sale-line,
    .plans-grid,
    .two-panel-card { grid-template-columns: 1fr; }
    .landing-copy h1 { max-width: none; }
}

@media (max-width: 640px) {
    .main-content,
    .main-content--guest { padding: 16px; }
    .guest-card,
    .card,
    .ticket-preview,
    .landing-card,
    .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; }
    .landing-copy h1 { font-size: 38px; }
    table { min-width: 620px; }
}


.status-badge{display:inline-flex;align-items:center;gap:.4rem;padding:.38rem .7rem;border-radius:999px;font-size:.82rem;font-weight:700;border:1px solid rgba(255,255,255,.08);background:rgba(255,255,255,.04)}
.status-queued{background:rgba(245,158,11,.12);color:#f7c56a;border-color:rgba(245,158,11,.25)}
.status-sent,.status-accepted,.status-accepted_with_errors{background:rgba(34,197,94,.12);color:#86efac;border-color:rgba(34,197,94,.25)}
.status-rejected{background:rgba(239,68,68,.12);color:#fca5a5;border-color:rgba(239,68,68,.25)}
.hash-code{font-size:.82rem;color:#cbd5e1}
.hash-block{display:block;max-width:100%;padding:.75rem;border-radius:16px;background:#0b1120;color:#dbeafe;font-size:.8rem;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:18px;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}
@media (max-width: 800px){.ticket-meta-verifactu{grid-template-columns:1fr}.ticket-qr-image{margin-left:0;margin-right:0}}
