/* PresuFactura — estilos base */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --accent: #7c3aed;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #dc2626;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 72px;
    --radius: 10px;
    --radius-lg: 16px;
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.12);
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--gray-900);
    background: var(--gray-50);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Guest layout */
.guest-body {
    min-height: 100vh;
    background: linear-gradient(180deg, #eff6ff 0%, var(--gray-50) 40%);
}
.guest-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}
.guest-header { margin-bottom: 2rem; }
.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

/* Brand logo */
.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: inherit;
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
    transition: opacity var(--transition);
}
.brand-logo:hover { opacity: 0.88; text-decoration: none; }
.brand-logo__icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    transition: transform var(--transition);
}
.brand-logo:hover .brand-logo__icon { transform: scale(1.05); }
.brand-logo--sidebar { color: #fff; }
.brand-logo--sidebar .brand-logo__text { color: #fff; }
.brand-logo--light .brand-logo__text { color: #fff; }
.brand-logo--default .brand-logo__text { color: var(--gray-900); }
.brand-logo--default:hover .brand-logo__text { color: var(--primary); }
.guest-main { width: 100%; max-width: 420px; }
.guest-main-wide { max-width: 720px; }
.guest-body.guest-body-top .guest-container {
    justify-content: flex-start;
    padding-top: 2rem;
}
.guest-footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--gray-500);
    max-width: 480px;
}

/* Auth card */
.auth-card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    border: 1px solid var(--gray-200);
    transition: box-shadow var(--transition), transform var(--transition);
}
.auth-card:hover { box-shadow: var(--shadow-lg); }
.auth-card--center { text-align: center; }
.auth-card h1 {
    margin: 0 0 1.5rem;
    font-size: 1.5rem;
}
.auth-switch {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--gray-500);
}
.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0 1.35rem;
    color: var(--gray-500);
    font-size: 0.85rem;
}
.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}
.auth-divider span { flex-shrink: 0; }
.btn-google {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    background: #fff;
    color: var(--gray-900);
    border: 1px solid var(--gray-300);
    box-shadow: var(--shadow);
    font-weight: 600;
}
.btn-google:hover {
    background: var(--gray-50);
    text-decoration: none;
    color: var(--gray-900);
    border-color: var(--gray-500);
    transform: translateY(-1px);
}
.btn-google__icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 500;
    font-size: 0.9rem;
}
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.form-hint { font-size: 0.85rem; color: var(--gray-500); margin-top: 0.25rem; display: block; }
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}
.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}
.form-check label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 400;
    cursor: pointer;
}
.form-error {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: var(--danger);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    font-family: inherit;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition);
}
.btn:active { transform: scale(0.98); }
.btn:disabled,
.btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    pointer-events: none;
    box-shadow: none;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #3b82f6 0%, var(--primary) 100%);
    text-decoration: none;
    color: #fff;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
    transform: translateY(-1px);
}
.btn-secondary {
    background: #fff;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
    box-shadow: var(--shadow);
}
.btn-secondary:hover {
    background: var(--gray-50);
    text-decoration: none;
    border-color: var(--gray-500);
    transform: translateY(-1px);
}
.btn-block { width: 100%; }
.btn-link {
    background: none;
    border: none;
    color: var(--gray-500);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0;
}
.btn-link:hover { color: var(--danger); }
.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-danger:hover { background: #b91c1c; color: #fff; text-decoration: none; }
.btn-success {
    background: var(--success);
    color: #fff;
}
.btn-success:hover { background: #15803d; color: #fff; text-decoration: none; }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.85rem; }
.btn-danger-link { color: var(--danger); }
.btn-danger-link:hover { color: #991b1b; }

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}
.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.alert-info {
    background: #eff6ff;
    color: #1e3a8a;
    border: 1px solid #bfdbfe;
}
.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* Panel layout */
.panel-body { min-height: 100vh; }
.panel-layout {
    display: flex;
    min-height: 100vh;
    align-items: flex-start;
}

.sidebar {
    position: sticky;
    top: 0;
    align-self: flex-start;
    width: var(--sidebar-width);
    height: 100vh;
    height: 100dvh;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border-right: 1px solid rgba(255,255,255,0.06);
    overflow: hidden;
    transition: width 0.2s ease;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 1.25rem 1rem 1.25rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}
.sidebar-brand a {
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
    min-width: 0;
}
.menu-fold {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 8px;
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255,255,255,0.12);
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
}
.menu-fold:hover { background: rgba(255,255,255,0.2); color: #fff; }
.menu-fold__icon {
    width: 16px;
    height: 16px;
    display: block;
    pointer-events: none;
    transition: transform 0.2s ease;
}
html.sidebar-collapsed .menu-fold__icon { transform: rotate(180deg); }
.sidebar-nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    padding: 1rem 0;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem 1.5rem;
    color: rgba(255,255,255,0.72);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    white-space: nowrap;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.nav-link__icon {
    width: 18px;
    height: 18px;
    opacity: 0.75;
    flex-shrink: 0;
}
.nav-link:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
    text-decoration: none;
}
.nav-link.active {
    background: rgba(37, 99, 235, 0.18);
    color: #fff;
    border-left-color: #60a5fa;
}
.nav-link.active .nav-link__icon { opacity: 1; }
.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.85rem;
    margin-top: auto;
    flex-shrink: 0;
}
.user-name {
    display: block;
    margin-bottom: 0.5rem;
    color: rgba(255,255,255,0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-logout {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255,255,255,0.72);
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    font: inherit;
}
.sidebar-logout:hover { color: #fff; text-decoration: none; }
.sidebar-footer .btn-link:hover { color: #fff; }

html.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed-width); }
html.sidebar-collapsed .sidebar-brand {
    flex-direction: column;
    padding: 1rem 0.5rem;
}
html.sidebar-collapsed .brand-logo__text,
html.sidebar-collapsed .nav-link__label,
html.sidebar-collapsed .user-name { display: none; }
html.sidebar-collapsed .nav-link {
    justify-content: center;
    padding: 0.75rem 0.5rem;
    border-left: none;
    border-right: 3px solid transparent;
}
html.sidebar-collapsed .nav-link.active {
    border-right-color: #60a5fa;
    border-left-color: transparent;
}
html.sidebar-collapsed .sidebar-footer {
    padding: 1rem 0.5rem;
    display: flex;
    justify-content: center;
}
html.sidebar-collapsed .sidebar-logout { justify-content: center; width: 100%; }

.panel-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.panel-header {
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--gray-200);
    padding: 1.25rem 2rem;
    position: sticky;
    top: 0;
    z-index: 10;
}
.panel-header h1 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    overflow-wrap: anywhere;
}
.panel-main {
    flex: 1;
    padding: 2rem;
}
.panel-footer {
    padding: 1rem 2rem;
    font-size: 0.75rem;
    color: var(--gray-500);
    border-top: 1px solid var(--gray-200);
    text-align: center;
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.35rem 1.25rem;
    border: 1px solid var(--gray-200);
    position: relative;
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--gray-200);
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}
.stat-card--pending::before { background: var(--primary); }
.stat-card--danger::before { background: var(--danger); }
.stat-card--success::before { background: var(--success); }
.stat-card--docs::before { background: var(--accent); }
.stat-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-icon svg { width: 20px; height: 20px; }
.stat-icon--pending { background: var(--primary-light); color: var(--primary); }
.stat-icon--danger { background: #fee2e2; color: var(--danger); }
.stat-icon--success { background: #dcfce7; color: var(--success); }
.stat-icon--docs { background: #ede9fe; color: var(--accent); }
.stat-label {
    display: block;
    font-size: 0.82rem;
    color: var(--gray-500);
    margin-bottom: 0.25rem;
    font-weight: 500;
}
.stat-value {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -0.02em;
}
.stat-success { color: var(--success); }
.stat-danger { color: var(--danger); }
.section-title { margin: 0 0 1rem; font-size: 1.1rem; }

/* Empty state */
.empty-state {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 3.5rem 2rem;
    text-align: center;
    border: 1px dashed var(--gray-300);
}
.empty-state__icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light), #ede9fe);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    animation: float 3s ease-in-out infinite;
}
.empty-state__icon svg { width: 32px; height: 32px; }
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
.empty-state h2 {
    margin: 0 0 0.5rem;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.empty-state p {
    margin: 0 0 0.5rem;
    color: var(--gray-500);
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}
.empty-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}
.text-muted { color: var(--gray-500); font-size: 0.9rem; }

/* Settings */
.settings-preview {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    max-width: 560px;
}
.settings-list {
    margin-top: 1.5rem;
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 0.75rem 1rem;
}
.settings-list dt {
    font-weight: 500;
    color: var(--gray-500);
    font-size: 0.9rem;
}
.settings-list dd {
    margin: 0;
}

/* Page layout */
.page-toolbar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.page-toolbar .btn { white-space: nowrap; }
.card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    border: 1px solid var(--gray-200);
    margin-bottom: 1.25rem;
    transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }
.data-table tbody tr {
    transition: background var(--transition);
}
.data-table tbody tr:hover { background: var(--gray-50); }
.data-table tbody tr[data-href] { cursor: pointer; }
.card-narrow { max-width: 560px; }
.inline-form { display: inline; }

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}
.data-table th {
    text-align: left;
    padding: 0.65rem 0.75rem;
    border-bottom: 2px solid var(--gray-200);
    font-size: 0.85rem;
    color: var(--gray-500);
}
.data-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--gray-100);
}
.data-table .text-right { text-align: right; }
.text-center { text-align: center; }
.table-actions {
    text-align: right;
    white-space: nowrap;
}
.table-actions a,
.table-actions form { margin-left: 0.75rem; }

/* Badges */
.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: capitalize;
}
.badge-draft { background: var(--gray-100); color: var(--gray-700); }
.badge-sent { background: #dbeafe; color: #1e40af; }
.badge-paid { background: #dcfce7; color: #166534; }
.badge-expired { background: #fee2e2; color: #991b1b; }
.badge-cancelled { background: #f3f4f6; color: #6b7280; text-decoration: line-through; }
.badge-accepted { background: #dbeafe; color: #1e40af; }
.badge-pending,
.badge-payment_pending { background: #fef3c7; color: #92400e; }
.badge-rejected { background: #fee2e2; color: #991b1b; }
.badge-cert-valid { background: #dcfce7; color: #166534; }
.badge-cert-expired { background: #fee2e2; color: #991b1b; }
.badge-cert-expiring { background: #ffedd5; color: #c2410c; }
.badge-cert-missing { background: var(--gray-100); color: var(--gray-700); }
.badge-env-preprod { background: #fef3c7; color: #92400e; }
.badge-env-prod { background: #dcfce7; color: #166534; }

.public-link-box { margin-bottom: 1rem; }
.public-link-box .public-link-row {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}
.public-link-input {
    flex: 1;
    min-width: 200px;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.85rem;
    background: var(--gray-50);
}
.public-quote-page { justify-content: flex-start; padding-top: 2rem; }
.public-quote-main { max-width: 720px; }
.public-quote-card { max-width: none; }
.proforma-tag,
.fiscal-tag {
    display: inline-block;
    background: #fef3c7;
    color: #92400e;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-bottom: 1rem;
}
.fiscal-tag {
    background: #dcfce7;
    color: #166534;
}
.verifactu-qr {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin: 1.25rem 0 0;
    padding: 1rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background: var(--gray-50);
}
.verifactu-qr img {
    width: 128px;
    height: 128px;
    flex-shrink: 0;
    background: #fff;
}
.verifactu-qr strong { display: block; margin-bottom: 0.25rem; }
.verifactu-qr p { margin: 0 0 0.35rem; color: var(--gray-700); font-size: 0.9rem; }
.accept-form { margin-top: 1.5rem; }

/* Landing */
.landing-body { background: #fff; overflow-x: clip; }
.landing-header {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid transparent;
    padding: 0.85rem clamp(1.25rem, 5vw, 2rem);
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.landing-header.is-scrolled {
    border-bottom-color: var(--gray-200);
    box-shadow: 0 4px 20px rgba(15,23,42,0.06);
}
.landing-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}
.landing-nav {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    flex-wrap: wrap;
}
.landing-nav > a:not(.btn) {
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius);
    color: var(--gray-700);
    font-weight: 500;
    font-size: 0.92rem;
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
}
.landing-nav > a:not(.btn):hover {
    background: var(--gray-100);
    text-decoration: none;
    color: var(--gray-900);
}
.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    padding: 0.45rem 0.65rem;
    cursor: pointer;
    color: var(--gray-700);
    font-size: 1.25rem;
    line-height: 1;
}
.landing-hero {
    position: relative;
    text-align: left;
    padding: 3.5rem clamp(1.25rem, 5vw, 2rem) 3rem;
    overflow: hidden;
    background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 45%, #fff 100%);
}
.hero-inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 2.25rem 2.75rem;
    align-items: center;
    max-width: 1120px;
    margin: 0 auto;
}
.hero-copy { min-width: 0; }
.landing-hero h1 {
    font-size: clamp(1.85rem, 4vw, 2.85rem);
    max-width: none;
    margin: 0 0 1rem;
    line-height: 1.1;
    text-wrap: balance;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--gray-900);
}
.hero-bg-orbs {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}
.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.5;
    animation: orb-drift 12s ease-in-out infinite alternate;
}
.hero-orb--1 {
    width: 420px; height: 420px;
    background: #93c5fd;
    top: -120px; left: -80px;
}
.hero-orb--2 {
    width: 360px; height: 360px;
    background: #c4b5fd;
    top: -40px; right: -100px;
    animation-delay: -4s;
}
.hero-orb--3 {
    width: 280px; height: 280px;
    background: #bfdbfe;
    bottom: -80px; left: 40%;
    animation-delay: -8s;
}
@keyframes orb-drift {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(20px, 15px) scale(1.08); }
}
.landing-hero > *:not(.hero-bg-orbs) { position: relative; z-index: 1; }
.hero-sub {
    font-size: 1.08rem;
    color: var(--gray-500);
    margin: 0 0 1.5rem;
    max-width: 36rem;
    line-height: 1.65;
}
.hero-note {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin: 1.1rem 0 0;
    max-width: 480px;
}
.hero-actions { display: flex; gap: 1rem; justify-content: flex-start; flex-wrap: wrap; }
.btn-lg { padding: 0.9rem 1.85rem; font-size: 1.05rem; border-radius: 12px; }
.trust-strip {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.5rem 1.25rem;
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(37,99,235,0.12);
    max-width: 640px;
    margin-left: 0;
    margin-right: 0;
}
.trust-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray-700);
}
.trust-item svg { width: 16px; height: 16px; color: var(--success); flex-shrink: 0; }
.landing-features, .landing-pricing {
    padding: 4rem clamp(1.25rem, 5vw, 2rem);
    max-width: 960px;
    margin: 0 auto;
}
.landing-features h2, .landing-pricing h2 {
    text-align: center;
    margin-bottom: 0.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}
.feature-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.75rem 1.5rem;
    text-align: left;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}
.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-light), #ede9fe);
    color: var(--primary);
}
.feature-icon svg { width: 24px; height: 24px; }
.feature-card h3 { margin: 0 0 0.5rem; font-size: 1.05rem; font-weight: 700; }
.feature-card p { margin: 0; color: var(--gray-500); font-size: 0.92rem; line-height: 1.6; }
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    max-width: 680px;
    margin: 0 auto;
}
.pricing-grid--single {
    max-width: 420px;
}
.pricing-card {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    background: #fff;
    transition: transform var(--transition), box-shadow var(--transition);
}
.pricing-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.pricing-pro {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary), var(--shadow-lg);
    position: relative;
    background: linear-gradient(180deg, #eff6ff 0%, #fff 40%);
}
.pricing-pro:hover { transform: translateY(-6px) scale(1.01); }
.pricing-card h3 { margin: 0 0 0.5rem; }
.pricing-card .price {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 1.5rem;
}
.pricing-card .price span { font-size: 1rem; font-weight: 400; color: var(--gray-500); }
.pricing-card ul {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
    text-align: left;
    font-size: 0.9rem;
}
.pricing-card li { padding: 0.35rem 0; color: var(--gray-700); }
.pricing-card li::before { content: "✓ "; color: var(--success); }
.landing-footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--gray-200);
    font-size: 0.85rem;
    color: var(--gray-500);
}
.landing-footer p { margin: 0.25rem 0; }

.hero-shots { min-width: 0; }
.hero-demo-caption {
    margin: 0.75rem 0 0;
    font-size: 0.88rem;
    color: var(--gray-500);
    line-height: 1.45;
}
.hero-shots-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #fff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-lg);
}
.hero-shots-frame img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    opacity: 0;
    transition: opacity 0.45s ease;
}
.hero-shots-frame img.is-active { opacity: 1; }
.hero-shots-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.75rem;
}
.hero-shots-tabs button {
    border: 1px solid var(--gray-200);
    background: #fff;
    color: var(--gray-700);
    border-radius: 999px;
    padding: 0.35rem 0.8rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}
.hero-shots-tabs button.is-active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}
.hero-demo-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: rgba(15, 23, 42, 0.12);
    z-index: 2;
}
.hero-demo-progress span {
    display: block;
    height: 100%;
    width: 0;
    background: #2563eb;
}
.hero-shots-frame.is-playing .hero-demo-progress span {
    animation: mock-progress linear forwards;
}
@keyframes mock-progress {
    from { width: 0; }
    to { width: 100%; }
}
.shot-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    text-align: left;
}
.shot-grid figure { margin: 0; }
.shot-grid img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow);
    background: #fff;
    display: block;
}
.shot-grid figcaption {
    margin-top: 0.5rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--gray-700);
}
.hero-badge {
    display: inline-block;
    background: linear-gradient(135deg, #dbeafe, #ede9fe);
    color: var(--primary-dark);
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.4rem 0.95rem;
    border-radius: 999px;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(37,99,235,0.15);
    animation: badge-pulse 3s ease-in-out infinite;
}
@keyframes badge-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(37,99,235,0); }
    50% { box-shadow: 0 0 0 6px rgba(37,99,235,0.08); }
}
.section-sub {
    text-align: center;
    color: var(--gray-500);
    max-width: 560px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}
.landing-features h2,
.landing-pricing h2,
.landing-faq h2,
.faq-section-inner h2 {
    text-align: center;
    margin-bottom: 0.75rem;
}
.landing-screenshots {
    padding: 4rem clamp(1.25rem, 5vw, 2rem) 5rem;
    background: linear-gradient(180deg, var(--gray-50) 0%, #fff 100%);
}
.screenshots-inner { max-width: 960px; margin: 0 auto; text-align: center; }
.screenshots-inner h2 { margin-bottom: 0.5rem; font-weight: 800; letter-spacing: -0.02em; }
.screenshot-mock {
    display: flex;
    flex-wrap: wrap;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    text-align: left;
    margin-top: 0;
    border: 1px solid var(--gray-200);
    transition: box-shadow var(--transition);
}
.screenshot-mock:hover { box-shadow: 0 28px 60px rgba(15,23,42,0.15); }
.mock-sidebar {
    width: 200px;
    background: linear-gradient(180deg, #0f172a, #1e293b);
    color: #fff;
    padding: 1.25rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex-shrink: 0;
}
.mock-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    padding: 0 0.5rem;
    color: #fff;
    font-size: 0.9rem;
}
.mock-brand img { width: 24px; height: 24px; }
.mock-nav {
    font-size: 0.82rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    color: #94a3b8;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    width: 100%;
    transition: background var(--transition), color var(--transition);
}
.mock-nav:hover { background: rgba(255,255,255,0.06); color: #e2e8f0; }
.mock-nav.active { background: rgba(37,99,235,0.35); color: #fff; }
.mock-main { flex: 1; padding: 1.35rem; min-width: 0; background: var(--gray-50); }
.mock-panel-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-500);
    margin-bottom: 1rem;
}
.mock-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; margin-bottom: 1.25rem; }
.mock-stat {
    background: #fff;
    border-radius: 10px;
    padding: 0.85rem;
    border: 1px solid var(--gray-200);
    transition: transform var(--transition);
}
.mock-stat:hover { transform: scale(1.02); }
.mock-stat span { display: block; font-size: 0.68rem; color: var(--gray-500); font-weight: 500; }
.mock-stat strong { font-size: 1.05rem; font-weight: 800; letter-spacing: -0.02em; }
.mock-stat.danger strong { color: var(--danger); }
.mock-stat.success strong { color: var(--success); }
.mock-table { border: 1px solid var(--gray-200); border-radius: 10px; overflow: hidden; font-size: 0.8rem; background: #fff; }
.mock-row {
    display: grid;
    grid-template-columns: 1.2fr 1fr 0.8fr 0.6fr;
    gap: 0.5rem;
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--gray-100);
    align-items: center;
    transition: background var(--transition);
}
.mock-row:not(.head):hover { background: var(--gray-50); }
.mock-row.head { background: var(--gray-50); font-weight: 600; color: var(--gray-500); font-size: 0.72rem; }
.mock-row:last-child { border-bottom: none; }
.screenshot-mock .badge-sent,
.screenshot-mock .badge-accepted,
.screenshot-mock .badge-paid { font-size: 0.68rem; padding: 0.2rem 0.5rem; border-radius: 999px; font-weight: 600; }
.screenshot-mock .badge-sent { background: #dbeafe; color: #1d4ed8; }
.screenshot-mock .badge-accepted { background: #dcfce7; color: #166534; }
.screenshot-mock .badge-paid { background: #f3f4f6; color: #374151; }
.pricing-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.landing-faq { padding: 3rem clamp(1.25rem, 5vw, 2rem); max-width: 720px; margin: 0 auto; }
.faq-section-inner h2 { text-align: center; margin-bottom: 2rem; }
.faq-list { display: flex; flex-direction: column; gap: 0.75rem; }
.faq-item {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 0 1.15rem;
    background: #fff;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.faq-item[open] {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
}
.faq-item summary {
    cursor: pointer;
    font-weight: 600;
    padding: 1.1rem 0;
    list-style: none;
    transition: color var(--transition);
}
.faq-item summary:hover { color: var(--primary); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: "+";
    float: right;
    color: var(--primary);
    font-weight: 700;
    font-size: 1.2rem;
    transition: transform var(--transition);
}
.faq-item[open] summary::after { content: "−"; transform: rotate(180deg); }
.faq-item p { margin: 0 0 1rem; color: var(--gray-700); font-size: 0.95rem; line-height: 1.6; }
.faq-more { text-align: center; margin-top: 1.5rem; }
.landing-cta {
    text-align: center;
    padding: 5rem clamp(1.25rem, 5vw, 2rem);
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
}
.landing-cta::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 50%, rgba(255,255,255,0.12), transparent 50%);
    pointer-events: none;
}
.landing-cta > * { position: relative; z-index: 1; }
.landing-cta h2 { margin-bottom: 0.5rem; color: #fff; font-weight: 800; }
.landing-cta p { color: #dbeafe; margin: 0 auto 1.5rem; max-width: 480px; }
.landing-cta .btn-primary {
    background: #fff;
    color: var(--primary-dark);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.landing-cta .btn-primary:hover {
    background: #f8fafc;
    color: var(--primary-dark);
    transform: translateY(-2px);
}
.help-page { max-width: 720px; margin: 0 auto; padding: 3rem 2rem; }
.help-intro { text-align: center; margin-bottom: 2rem; }
.help-intro h1 { margin-bottom: 0.5rem; }
.help-intro .section-sub { margin-bottom: 0; }
.help-contact { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--gray-200); text-align: center; }
.help-contact h2 { font-size: 1.15rem; }

/* Line items form */
.line-items-section { margin: 1.5rem 0; }
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.section-header h2 { margin: 0; font-size: 1.1rem; }
.line-items-table { width: 100%; border-collapse: collapse; }
.line-items-table th {
    text-align: left;
    padding: 0.5rem;
    font-size: 0.8rem;
    color: var(--gray-500);
    border-bottom: 1px solid var(--gray-200);
}
.line-items-table td { padding: 0.35rem 0.25rem; vertical-align: middle; }
.line-items-table input {
    width: 100%;
    padding: 0.45rem 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 0.9rem;
}
.line-items-table .col-qty { width: 70px; }
.line-items-table .col-price { width: 90px; }
.line-items-table .col-vat { width: 70px; }
.line-items-table .col-total { width: 90px; }
.totals-box {
    max-width: 280px;
    margin-left: auto;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius);
}
.totals-row {
    display: flex;
    justify-content: space-between;
    padding: 0.35rem 0;
}
.totals-grand {
    border-top: 2px solid var(--gray-300);
    margin-top: 0.35rem;
    padding-top: 0.5rem;
    font-weight: 700;
    font-size: 1.1rem;
}
.invoice-meta {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.invoice-notes { margin-top: 1rem; color: var(--gray-700); }

/* Form layout */
.form-section-title { font-size: 1.1rem; margin: 1.5rem 0 1rem; padding-top: 0.5rem; border-top: 1px solid var(--gray-200); }
.form-section-title:first-child { border-top: none; margin-top: 0; }
.form-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 140px; }
.form-row-4 .form-group { min-width: 100px; }
.logo-preview { margin-bottom: 0.5rem; }
.settings-plan-box { margin: 1.5rem 0; padding: 1rem; background: var(--gray-50); border-radius: var(--radius); display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.settings-export-box { margin-top: 1.5rem; }
.settings-export-box .form-section-title { border-top: none; margin-top: 0; }
.settings-export-box p { color: var(--gray-700); margin-bottom: 0.75rem; }
.settings-cli {
    display: block;
    margin: 0.75rem 0;
    padding: 0.85rem 1rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.82rem;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre;
}
.danger-zone {
    margin-top: 1.5rem;
    border: 1px solid #fecaca;
    background: #fef2f2;
}
.danger-zone .form-section-title { border-top: none; color: var(--danger); margin-top: 0; }
.danger-zone p { color: var(--gray-700); margin-bottom: 0.75rem; }
.landing-flash { max-width: 960px; margin: 1rem auto 0; padding: 0 2rem; }
.subscription-actions { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 0.75rem; }
.public-quote-card {
    max-width: none;
    border-radius: var(--radius-lg);
}
.public-doc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.public-doc-header h1 { margin: 0 0 0.35rem; }
.public-issuer {
    color: var(--gray-900);
    font-weight: 800;
    font-size: 1.15rem;
}
.public-doc-total {
    background: linear-gradient(135deg, var(--primary-light), #ede9fe);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    text-align: center;
    margin: 1.5rem 0;
}
.public-doc-total span { display: block; font-size: 0.82rem; color: var(--gray-500); font-weight: 600; }
.public-doc-total strong { font-size: 2rem; font-weight: 800; color: var(--primary-dark); letter-spacing: -0.02em; }
.iban-box {
    margin: 1.5rem 0;
    padding: 1.15rem 1.25rem;
    background: linear-gradient(135deg, var(--gray-50), #eff6ff);
    border-radius: var(--radius-lg);
    font-family: ui-monospace, monospace;
    border: 1px dashed var(--primary-light);
    font-size: 0.95rem;
}

/* Scroll reveal */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* Onboarding */
.onboarding-card {
    max-width: 520px;
    margin: 0 auto;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    border: 1px solid var(--gray-200);
}
.onboarding-steps { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.onboarding-steps .step {
    font-size: 0.78rem;
    padding: 0.4rem 0.85rem;
    background: var(--gray-100);
    border-radius: 999px;
    color: var(--gray-500);
    font-weight: 600;
    transition: background var(--transition), color var(--transition);
}
.onboarding-steps .step.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}
.onboarding-steps .step.done { background: var(--success); color: #fff; }
.onboarding-details { margin: 1rem 0; }
.onboarding-details summary { cursor: pointer; color: var(--primary); margin-bottom: 0.75rem; }

/* Legal */
.legal-page { max-width: 680px; margin: 0 auto; text-align: left; }
.legal-page h1 { margin-bottom: 0.5rem; text-align: center; }
.legal-page > p:first-of-type { text-align: center; color: var(--gray-500); }
.legal-page h2 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; }
.legal-page p, .legal-page li { margin-bottom: 0.75rem; color: var(--gray-700); line-height: 1.65; }
.landing-pricing-page { padding: 4rem 2rem; text-align: center; max-width: 960px; margin: 0 auto; }
.landing-pricing-page h1 { margin-bottom: 0.5rem; }
.landing-pricing-page .hero-sub { margin-bottom: 2.5rem; }

.bug-report-btn {
    position: fixed;
    right: 1.1rem;
    bottom: 1.1rem;
    z-index: 900;
    background: #fff;
    color: var(--gray-800);
    border: 1px solid var(--gray-300);
    box-shadow: var(--shadow-lg);
    border-radius: 999px;
    padding: 0.55rem 0.95rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}
.bug-report-btn:hover { background: var(--gray-50); color: var(--gray-900); }
#bug-report-modal[hidden] { display: none !important; }
#bug-report-modal textarea { min-height: 8rem; }
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; padding: 1rem;
    animation: fade-in 0.2s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 440px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
    animation: slide-up 0.25s ease;
}
@keyframes slide-up {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-card__icon {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 1rem;
    color: #d97706;
}
.modal-card__icon svg { width: 28px; height: 28px; }
.modal-card h2 { margin-bottom: 0.75rem; font-weight: 800; }
.modal-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; justify-content: flex-end; flex-wrap: wrap; }

/* Cookie banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    background: #fff;
    border-top: 1px solid var(--gray-200);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
    padding: 1rem 1.25rem;
}
.cookie-banner[hidden] { display: none !important; }
.cookie-banner-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.cookie-banner p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--gray-700);
    line-height: 1.5;
    flex: 1;
    min-width: 220px;
}
.cookie-banner-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 960px) {
    .hero-inner { grid-template-columns: 1fr; gap: 1.75rem; }
}
@media (max-width: 768px) {
    .nav-toggle { display: block; }
    .landing-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0; right: 0;
        background: #fff;
        border-bottom: 1px solid var(--gray-200);
        padding: 1rem;
        flex-direction: column;
        align-items: stretch;
        box-shadow: var(--shadow-md);
    }
    .landing-nav.is-open { display: flex; }
    .landing-nav .btn { width: 100%; text-align: center; }
    .landing-header { position: relative; padding: 0.85rem 1rem; }
    .landing-header-inner { position: relative; flex-wrap: wrap; }
    .panel-layout { flex-direction: column; align-items: stretch; }
    .menu-fold { display: none !important; }
    html.sidebar-collapsed .sidebar,
    .sidebar {
        position: relative;
        top: auto;
        align-self: auto;
        width: 100%;
        height: auto;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        overflow: visible;
    }
    html.sidebar-collapsed .sidebar-brand,
    .sidebar-brand { border-bottom: none; padding: 1rem; flex-direction: row; }
    html.sidebar-collapsed .brand-logo__text,
    html.sidebar-collapsed .nav-link__label { display: inline; }
    .sidebar-nav {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        padding: 0 0.5rem;
        width: 100%;
        order: 3;
        border-top: 1px solid rgba(255,255,255,0.1);
    }
    html.sidebar-collapsed .nav-link,
    .nav-link {
        justify-content: flex-start;
        padding: 0.65rem 0.9rem;
        min-height: 44px;
        flex: 0 0 auto;
        border-left: none;
        border-right: none;
        border-bottom: 2px solid transparent;
    }
    html.sidebar-collapsed .nav-link.active,
    .nav-link.active { border-bottom-color: var(--primary); border-left: none; border-right: none; }
    html.sidebar-collapsed .sidebar-footer,
    .sidebar-footer {
        margin-left: auto;
        border-top: none;
        padding: 0.75rem 1rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    html.sidebar-collapsed .user-name,
    .user-name { display: none; }
    html.sidebar-collapsed .sidebar-logout { width: auto; }
    .panel-main { padding: 1rem; }
    .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
    .help-page,
    .landing-pricing-page { padding: 2rem 1.15rem; }
    .landing-hero { padding: 2.25rem 1.25rem 2rem; }
    .hero-inner { grid-template-columns: 1fr; gap: 1.75rem; }
    .landing-hero h1 { font-size: 1.85rem; }
    .hero-actions { justify-content: flex-start; }
    .shot-grid { grid-template-columns: 1fr; }
    .landing-cta { padding: 3.5rem 1.25rem; }
    .mock-stats { grid-template-columns: repeat(2, 1fr); }
    .mock-row { grid-template-columns: 1fr 1fr; font-size: 0.75rem; }
    .mock-row span:nth-child(3), .mock-row span:nth-child(4) { display: none; }
    .mock-row.head { display: none; }
    .screenshot-mock { flex-direction: column; }
    .mock-sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; }
}

/* Tablas y fichas apiladas: incluye móvil en horizontal (>768px) */
@media (max-width: 992px) {
    .panel-header { padding: 1rem 1.25rem; }
    .panel-main { padding: 1rem; }
    .panel-footer { padding: 1rem; }
    .panel-content { min-width: 0; max-width: 100%; }

    .card {
        padding: 1rem;
        max-width: 100%;
    }
    .auth-card { padding: 1.25rem; max-width: 100%; }
    .guest-container { padding: 1rem; }

    .invoice-meta {
        flex-direction: column;
        gap: 1rem;
    }
    .invoice-meta > div { min-width: 0; word-break: break-word; }

    .public-link-input { min-width: 0; width: 100%; }
    .public-link-row { flex-direction: column; align-items: stretch; }
    .public-link-row .btn { width: 100%; text-align: center; }

    .public-doc-total { padding: 1rem; margin: 1rem 0; }
    .public-doc-total strong { font-size: 1.5rem; word-break: break-word; }

    .data-table.data-table-list,
    .data-table.data-table-lines {
        display: block;
        width: 100%;
        max-width: 100%;
    }

    .data-table-list thead { display: none; }
    .data-table-list tbody { display: block; }
    .data-table-list tbody tr {
        display: block;
        border: 1px solid var(--gray-200);
        border-radius: var(--radius);
        margin-bottom: 0.75rem;
        padding: 0.75rem 1rem;
    }
    .data-table-list tbody tr:last-child { margin-bottom: 0; }
    .data-table-list tbody td {
        display: grid;
        grid-template-columns: minmax(5rem, 38%) minmax(0, 1fr);
        gap: 0.35rem 0.75rem;
        align-items: start;
        padding: 0.4rem 0;
        border-bottom: none;
        text-align: right !important;
        min-width: 0;
        word-break: break-word;
        overflow-wrap: anywhere;
    }
    .data-table-list tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.78rem;
        color: var(--gray-500);
        text-align: left;
    }
    .data-table-list tbody td.table-actions {
        display: flex;
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-top: 0.5rem;
        padding-top: 0.65rem;
        border-top: 1px solid var(--gray-100);
        white-space: normal;
    }
    .data-table-list tbody td.table-actions::before { display: none; }
    .data-table-list tbody td.table-actions a,
    .data-table-list tbody td.table-actions form { margin-left: 0; }

    .data-table-lines thead { display: none; }
    .data-table-lines tbody { display: block; }
    .data-table-lines tbody tr {
        display: block;
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--gray-100);
    }
    .data-table-lines tbody tr:last-child { border-bottom: none; }
    .data-table-lines tbody td {
        display: grid;
        grid-template-columns: minmax(5rem, 38%) minmax(0, 1fr);
        gap: 0.35rem 0.75rem;
        align-items: start;
        padding: 0.25rem 0;
        border-bottom: none;
        text-align: right !important;
        min-width: 0;
        word-break: break-word;
        overflow-wrap: anywhere;
    }
    .data-table-lines tbody td:first-child {
        display: block;
        font-weight: 600;
        margin-bottom: 0.25rem;
        text-align: left !important;
    }
    .data-table-lines tbody td:first-child::before { display: none; }
    .data-table-lines tbody td:not(:first-child)::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.78rem;
        color: var(--gray-500);
        text-align: left;
    }
    .data-table-lines tfoot {
        display: block;
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        border-top: 2px solid var(--gray-200);
    }
    .data-table-lines tfoot tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.75rem;
        align-items: center;
        padding: 0.35rem 0;
    }
    .data-table-lines tfoot td {
        display: block;
        padding: 0;
        border: none;
        min-width: 0;
    }
    .data-table-lines tfoot td[colspan] { text-align: left !important; }
    .data-table-lines tfoot td:not([colspan]) { text-align: right !important; white-space: nowrap; }

    .line-items-table { display: block; }
    .line-items-table thead { display: none; }
    .line-items-table tbody { display: block; }
    .line-items-table tbody tr {
        display: block;
        border: 1px solid var(--gray-200);
        border-radius: var(--radius);
        margin-bottom: 0.75rem;
        padding: 0.75rem;
    }
    .line-items-table tbody tr:last-child { margin-bottom: 0; }
    .line-items-table tbody td {
        display: block;
        padding: 0.35rem 0;
    }
    .line-items-table tbody td::before {
        content: attr(data-label);
        display: block;
        font-weight: 600;
        font-size: 0.78rem;
        color: var(--gray-500);
        margin-bottom: 0.25rem;
    }
    .line-items-table tbody td:last-child::before { display: none; }
    .line-items-table tbody td:last-child {
        text-align: right;
        padding-top: 0.5rem;
    }
    .line-items-table .col-qty,
    .line-items-table .col-price,
    .line-items-table .col-vat,
    .line-items-table .col-total { width: auto; }
    .line-items-table input { max-width: 100%; }
    .totals-box { max-width: none; margin-left: 0; }
}

.landing-flow {
    max-width: 1040px;
    margin: 0 auto;
    padding: 4rem clamp(1.25rem, 5vw, 2rem) 2rem;
    text-align: center;
}
.flow-track {
    list-style: none;
    margin: 2rem 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    text-align: left;
}
.flow-step {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.6rem 1.4rem;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.flow-step:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}
.flow-num {
    display: block;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    color: var(--primary);
    margin-bottom: 0.75rem;
}
.flow-step h3 { margin: 0 0 0.5rem; }
.flow-step p { margin: 0; color: var(--gray-500); font-size: 0.95rem; line-height: 1.6; }

.panel-main .stat-card,
.panel-main > .card,
.panel-main > .empty-state {
    animation: panel-enter 0.45s ease both;
}
.panel-main .stat-card:nth-child(2) { animation-delay: 0.05s; }
.panel-main .stat-card:nth-child(3) { animation-delay: 0.1s; }
.panel-main .stat-card:nth-child(4) { animation-delay: 0.15s; }
@keyframes panel-enter {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; transition: none; }
    .hero-orb, .panel-main .stat-card, .panel-main > .card, .panel-main > .empty-state {
        animation: none !important;
    }
    .feature-card:hover, .flow-step:hover, .pricing-card:hover, .stat-card:hover {
        transform: none;
    }
}

.guide-page { max-width: 720px; margin: 0 auto; padding: 3rem 2rem; }
.guide-kicker { font-size: 0.85rem; margin-bottom: 0.5rem; }
.guide-lead { font-size: 1.1rem; color: var(--gray-700); line-height: 1.6; margin-bottom: 2rem; }
.guide-page h2 { font-size: 1.2rem; margin: 1.75rem 0 0.75rem; }
.guide-page p { color: var(--gray-700); line-height: 1.65; margin-bottom: 0.85rem; }
.guide-cta { margin: 2.5rem 0; padding: 1.5rem; background: var(--gray-50); border-radius: var(--radius); text-align: center; }
.guide-related { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--gray-200); }
.guide-related ul { padding-left: 1.1rem; }
.guide-list { list-style: none; padding: 0; margin: 0 0 2rem; display: flex; flex-direction: column; gap: 1rem; }
.guide-list a { display: block; padding: 1rem 1.15rem; border: 1px solid var(--gray-200); border-radius: var(--radius); text-decoration: none; color: inherit; }
.guide-list a:hover { border-color: var(--primary); }
.guide-list span { display: block; margin-top: 0.35rem; color: var(--gray-600); font-size: 0.95rem; }
.feedback-prompt { margin-top: 1.5rem; max-width: 640px; }
.empty-actions form { display: inline-block; margin: 0; }

.admin-chart {
    display: flex;
    align-items: flex-end;
    gap: 0.35rem;
    height: 132px;
    margin-top: 1rem;
}
.admin-chart__col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    height: 100%;
}
.admin-chart__stack {
    width: 100%;
    max-width: 22px;
    display: flex;
    flex-direction: column-reverse;
    border-radius: 4px 4px 0 0;
    overflow: hidden;
    min-height: 4px;
    background: var(--gray-100);
}
.admin-chart__bar { display: block; width: 100%; min-height: 2px; }
.admin-chart__bar--human { background: var(--primary); }
.admin-chart__bar--bot { background: var(--gray-300); }
.admin-chart__label { font-size: 0.68rem; color: var(--gray-500); }
.admin-funnel-row {
    display: grid;
    grid-template-columns: minmax(8rem, 11rem) 1fr 3rem;
    gap: 0.65rem;
    align-items: center;
    margin-bottom: 0.55rem;
    font-size: 0.9rem;
}
.admin-funnel-row__label { color: var(--gray-700); }
.admin-funnel-row__track {
    height: 10px;
    background: var(--gray-100);
    border-radius: 99px;
    overflow: hidden;
}
.admin-funnel-row__bar {
    display: block;
    height: 100%;
    background: var(--primary);
    border-radius: 99px;
}
.admin-funnel-row__n { text-align: right; font-weight: 600; }
.table-wrap { overflow-x: auto; }

@media (max-width: 768px) {
    .guide-page { padding: 2rem 1.15rem; }
    .admin-funnel-row { grid-template-columns: 1fr 3rem; }
    .admin-funnel-row__track { grid-column: 1 / -1; order: 3; }
}
