/* ==========================================================================
   qb code — design system
   Plain CSS. No Tailwind, no build step.
   ========================================================================== */

@font-face {
    font-family: "Google Sans";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/GoogleSans-VariableFont.ttf") format("truetype-variations");
}

:root {
    --primary: #0f172a;
    --secondary: #334155;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-soft: #eff6ff;
    --bg: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --muted: #64748b;
    --muted-soft: #94a3b8;
    --success: #16a34a;
    --success-soft: #f0fdf4;
    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --warning: #d97706;
    --warning-soft: #fffbeb;

    --radius-xs: 6px;
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;

    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-sm: 0 4px 14px -6px rgba(15, 23, 42, 0.12);
    --shadow: 0 16px 40px -20px rgba(15, 23, 42, 0.22);
    --shadow-lg: 0 32px 70px -30px rgba(15, 23, 42, 0.3);

    --font-sans: "Google Sans", "Product Sans", Inter, Roboto, ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

    --header-height: 72px;
    --sidebar-width: 264px;
    --content-max: 1240px;
}

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

[hidden] {
    display: none !important;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--primary);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.app-body,
.auth-body {
    min-height: 100vh;
}

img,
svg,
canvas {
    display: block;
    max-width: 100%;
}

h1,
h2,
h3,
h4,
p {
    margin: 0;
}

h1,
h2,
h3,
h4 {
    color: var(--primary);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: var(--accent-hover);
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
}

:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.35);
    outline-offset: 2px;
    border-radius: var(--radius-xs);
}

::selection {
    background: rgba(37, 99, 235, 0.18);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.skip-link {
    position: absolute;
    top: -60px;
    left: 16px;
    z-index: 100;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: #fff;
    transition: top 0.15s ease;
}

.skip-link:focus {
    top: 12px;
    color: #fff;
}

.container {
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-wide {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 28px;
}

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

.text-small {
    font-size: 0.875rem;
}

.mono {
    font-family: var(--font-mono);
}

.break-all {
    word-break: break-all;
}

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

.stack-sm {
    display: grid;
    gap: 8px;
}

.inline-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.w-full { width: 100%; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--primary);
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

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

.btn:active {
    transform: translateY(0);
}

.btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 8px 20px -12px rgba(37, 99, 235, 0.9);
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: #fff;
}

.btn-dark {
    background: var(--primary);
    color: #fff;
}

.btn-dark:hover {
    background: #1e293b;
    color: #fff;
}

.btn-outline {
    background: var(--surface);
    border-color: var(--border);
    color: var(--secondary);
    box-shadow: var(--shadow-xs);
}

.btn-outline:hover {
    border-color: var(--border-strong);
    color: var(--primary);
    background: #f8fafc;
}

.btn-ghost {
    color: var(--secondary);
}

.btn-ghost:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #b91c1c;
    color: #fff;
}

.btn-danger-ghost {
    color: var(--danger);
    background: transparent;
}

.btn-danger-ghost:hover {
    background: var(--danger-soft);
    color: #b91c1c;
}

.btn-sm {
    min-height: 36px;
    padding: 7px 12px;
    font-size: 0.8125rem;
    border-radius: 8px;
}

.btn-lg {
    min-height: 52px;
    padding: 14px 24px;
    font-size: 1rem;
    border-radius: 12px;
}

.btn-block {
    width: 100%;
}

.btn:disabled,
.btn[aria-disabled="true"] {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

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

.field + .field {
    margin-top: 16px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-grid .field + .field {
    margin-top: 0;
}

.label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
}

.label .optional {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--muted);
}

.input,
.select,
.textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--primary);
    font-size: 0.9375rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.input::placeholder,
.textarea::placeholder {
    color: var(--muted-soft);
}

.input:hover,
.select:hover,
.textarea:hover {
    border-color: var(--border-strong);
}

.input:focus,
.select:focus,
.textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.input[aria-invalid="true"],
.select[aria-invalid="true"],
.textarea[aria-invalid="true"] {
    border-color: var(--danger);
}

.textarea {
    min-height: 104px;
    resize: vertical;
    line-height: 1.55;
}

.select {
    appearance: none;
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.hint {
    font-size: 0.8125rem;
    color: var(--muted);
}

.field-error {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 0.8125rem;
    color: var(--danger);
}

.field-error::before {
    content: "!";
    display: inline-grid;
    place-items: center;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 2px;
    border-radius: 50%;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.checkbox-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 3px;
    accent-color: var(--accent);
    flex-shrink: 0;
}

.checkbox-row label {
    font-size: 0.875rem;
    color: var(--secondary);
}

.range-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.range-row input[type="range"] {
    flex: 1;
    accent-color: var(--accent);
}

.range-number {
    width: 86px;
    min-height: 40px;
    padding: 6px 10px;
    text-align: right;
}

.color-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-row input[type="color"] {
    width: 46px;
    height: 44px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    cursor: pointer;
}

.color-row .input {
    flex: 1;
    font-family: var(--font-mono);
    text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Alerts, badges, misc
   -------------------------------------------------------------------------- */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 0.9rem;
    line-height: 1.5;
}

.alert svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-success {
    background: var(--success-soft);
    border-color: #bbf7d0;
    color: #166534;
}

.alert-danger {
    background: var(--danger-soft);
    border-color: #fecaca;
    color: #991b1b;
}

.alert-info {
    background: var(--accent-soft);
    border-color: #bfdbfe;
    color: #1e40af;
}

.alert-warning {
    background: var(--warning-soft);
    border-color: #fde68a;
    color: #92400e;
}

.alert-list {
    display: grid;
    gap: 8px;
    padding-left: 18px;
    margin: 0;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: #1d4ed8;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}

.badge-neutral {
    background: #f1f5f9;
    color: var(--secondary);
}

.badge-success {
    background: var(--success-soft);
    color: #15803d;
}

.badge-warning {
    background: var(--warning-soft);
    color: #b45309;
}

.divider {
    height: 1px;
    border: 0;
    background: var(--border);
    margin: 20px 0;
}

/* --------------------------------------------------------------------------
   Public site header & footer
   -------------------------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    background: rgba(248, 250, 252, 0.86);
    backdrop-filter: blur(12px);
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    height: var(--header-height);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.brand:hover {
    color: var(--primary);
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--primary), #1e3a8a);
    color: #fff;
    box-shadow: 0 8px 18px -10px rgba(15, 23, 42, 0.8);
}

.brand-mark img {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: contain;
}

.brand-text {
    display: grid;
    line-height: 1.1;
}

.brand-text strong {
    font-size: 0.9375rem;
}

.brand-text span {
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.site-nav a {
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.site-nav a:hover {
    background: #eef2f7;
    color: var(--primary);
}

.site-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.site-footer {
    border-top: 2px solid var(--accent);
    background: var(--surface);
    padding: 36px 0 0;
}

.site-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.site-footer p {
    color: var(--muted);
    font-size: 0.8125rem;
}

.copyright {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8125rem;
}

.copyright-text {
    font-family: "Google Sans", "Product Sans", Inter, Roboto, sans-serif;
    font-optical-sizing: auto;
    font-weight: 500;
    font-style: normal;
    font-variation-settings: "GRAD" 0;
}

.copyright-mark {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
    stroke-width: 2;
}

.footer-bottom-bar {
    margin-top: 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    background: var(--primary);
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px 24px;
    flex-wrap: wrap;
    padding-block: 16px;
}

.footer-bottom .copyright {
    color: rgba(248, 250, 252, 0.9);
    font-weight: 500;
}

.footer-privacy {
    color: #cbd5e1;
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: rgba(203, 213, 225, 0.7);
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

.footer-privacy:hover,
.footer-privacy:focus-visible {
    color: #ffffff;
    text-decoration-color: #ffffff;
}

.footer-links {
    display: flex;
    gap: 18px;
    font-size: 0.8125rem;
}

.footer-links a {
    color: var(--secondary);
}

/* --------------------------------------------------------------------------
   Legal pages
   -------------------------------------------------------------------------- */

.legal-card {
    max-width: 860px;
    margin: 0 auto;
}

.legal-body {
    display: grid;
    gap: 26px;
}

.legal-section h2 {
    margin-bottom: 8px;
    font-size: 1.0625rem;
    letter-spacing: -0.01em;
}

.legal-section p,
.legal-section li {
    color: var(--secondary);
    font-size: 0.9375rem;
    line-height: 1.7;
}

.legal-section ul {
    display: grid;
    gap: 8px;
    margin: 8px 0 0;
    padding-left: 20px;
}

.legal-back {
    margin-top: 20px;
    text-align: center;
    font-size: 0.875rem;
}

.legal-back a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.legal-back a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Landing page
   -------------------------------------------------------------------------- */

.hero {
    position: relative;
    overflow: hidden;
    padding: 84px 0 72px;
}

.hero::before {
    content: "";
    position: absolute;
    top: -260px;
    right: -160px;
    width: 640px;
    height: 640px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.14), transparent 65%);
    pointer-events: none;
}

.hero::after {
    content: "";
    position: absolute;
    bottom: -320px;
    left: -200px;
    width: 620px;
    height: 620px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(15, 23, 42, 0.07), transparent 65%);
    pointer-events: none;
}

.hero-grid {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
    align-items: center;
    gap: 56px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 8px;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    background: var(--accent-soft);
    color: #1d4ed8;
    font-size: 0.8125rem;
    font-weight: 600;
}

.eyebrow-dot {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
}

.eyebrow-dot svg {
    width: 12px;
    height: 12px;
}

.hero h1 {
    margin-top: 20px;
    font-size: clamp(2.35rem, 5vw, 3.6rem);
    line-height: 1.06;
    letter-spacing: -0.035em;
}

.hero h1 .gradient-text {
    background: linear-gradient(100deg, #2563eb, #0f172a 78%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-lead {
    max-width: 560px;
    margin-top: 18px;
    color: var(--muted);
    font-size: 1.0625rem;
}

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

.hero-points {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-top: 26px;
    padding: 0;
    list-style: none;
    color: var(--secondary);
    font-size: 0.875rem;
}

.hero-points li {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.hero-points svg {
    width: 16px;
    height: 16px;
    color: var(--success);
}

.hero-visual {
    position: relative;
}

.mock-window {
    position: relative;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.mock-window-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
}

.mock-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #e2e8f0;
}

.mock-dot:nth-child(1) { background: #fca5a5; }
.mock-dot:nth-child(2) { background: #fcd34d; }
.mock-dot:nth-child(3) { background: #86efac; }

.mock-window-title {
    margin-left: 8px;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 500;
}

.mock-window-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 20px;
    background: linear-gradient(180deg, #fff, #f8fafc);
}

.mock-form {
    display: grid;
    align-content: start;
    gap: 10px;
}

.mock-label {
    width: 44%;
    height: 8px;
    border-radius: 999px;
    background: #e2e8f0;
}

.mock-input {
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}

.mock-input.short {
    width: 70%;
}

.mock-button {
    height: 34px;
    border-radius: 8px;
    background: var(--accent);
    opacity: 0.9;
}

.mock-qr {
    display: grid;
    place-items: center;
    padding: 14px;
    border: 1px dashed var(--border-strong);
    border-radius: 12px;
    background:
        radial-gradient(#cbd5e1 1px, transparent 1px) 0 0 / 12px 12px,
        #fff;
}

.mock-qr canvas,
.mock-qr img,
.mock-qr svg {
    width: 148px;
    height: 148px;
    border-radius: 6px;
    background: #fff;
    padding: 8px;
    box-shadow: var(--shadow-sm);
}

.floating-card {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow);
    font-size: 0.8125rem;
    font-weight: 600;
}

.floating-card svg {
    width: 18px;
    height: 18px;
    color: var(--accent);
}

.floating-card.top {
    top: -22px;
    right: -18px;
}

.floating-card.bottom {
    bottom: -18px;
    left: -22px;
}

.section {
    padding: 84px 0;
}

.section-tight {
    padding: 64px 0;
}

.section-alt {
    background: var(--surface);
    border-block: 1px solid var(--border);
}

.section-head {
    max-width: 660px;
    margin: 0 auto 44px;
    text-align: center;
}

.section-kicker {
    display: inline-block;
    margin-bottom: 12px;
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.section-title {
    font-size: clamp(1.7rem, 3.4vw, 2.35rem);
    letter-spacing: -0.03em;
}

.section-lead {
    margin-top: 14px;
    color: var(--muted);
    font-size: 1rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.feature-card {
    padding: 26px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.feature-card:hover {
    transform: translateY(-3px);
    border-color: #dbe3ee;
    box-shadow: var(--shadow);
}

.feature-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-bottom: 16px;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent);
}

.feature-icon svg {
    width: 22px;
    height: 22px;
}

.feature-card h3 {
    font-size: 1.0625rem;
}

.feature-card p {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.9rem;
}

.tool-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.tool-card {
    position: relative;
    overflow: hidden;
    padding: 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}

.tool-card::after {
    content: "";
    position: absolute;
    top: -90px;
    right: -90px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.1), transparent 70%);
}

.tool-card h3 {
    margin-top: 18px;
    font-size: 1.35rem;
}

.tool-card p {
    margin-top: 10px;
    color: var(--muted);
}

.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
    padding: 0;
    list-style: none;
}

.chip {
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #f8fafc;
    color: var(--secondary);
    font-size: 0.75rem;
    font-weight: 600;
}

.tool-card .btn {
    margin-top: 24px;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    counter-reset: step;
}

.step-card {
    position: relative;
    padding: 28px 26px 26px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
}

.step-number {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    margin-bottom: 16px;
    border-radius: 11px;
    background: var(--primary);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 700;
}

.step-card h3 {
    font-size: 1rem;
}

.step-card p {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.9rem;
}

.cta-band {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1.4fr auto;
    align-items: center;
    gap: 32px;
    padding: 48px;
    border-radius: var(--radius-xl);
    background: linear-gradient(120deg, #0f172a, #1e3a8a);
    color: #e2e8f0;
    box-shadow: var(--shadow-lg);
}

.cta-band::after {
    content: "";
    position: absolute;
    right: -80px;
    bottom: -140px;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    border: 60px solid rgba(255, 255, 255, 0.05);
}

.cta-band h2 {
    color: #fff;
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    letter-spacing: -0.03em;
}

.cta-band p {
    margin-top: 10px;
    color: #cbd5e1;
    max-width: 540px;
}

.cta-band .btn {
    position: relative;
    z-index: 1;
}

/* --------------------------------------------------------------------------
   Auth pages
   -------------------------------------------------------------------------- */

.auth-body {
    background: #eef2f7;
}

.auth-page {
    position: relative;
    isolation: isolate;
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 38px 20px 30px;
    overflow: hidden;
    background:
        radial-gradient(circle at 12% 8%, rgba(37, 99, 235, 0.14), transparent 30%),
        radial-gradient(circle at 88% 88%, rgba(22, 163, 74, 0.1), transparent 28%),
        linear-gradient(155deg, #f8fafc 0%, #eef2ff 52%, #f8fafc 100%);
}

.auth-page::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: radial-gradient(rgba(100, 116, 139, 0.18) 1px, transparent 1px);
    background-size: 22px 22px;
    mask-image: radial-gradient(circle at center, #000 20%, transparent 78%);
    -webkit-mask-image: radial-gradient(circle at center, #000 20%, transparent 78%);
}

.auth-page::after {
    content: "";
    position: absolute;
    z-index: -1;
    top: -300px;
    right: -180px;
    width: 520px;
    height: 520px;
    border: 1px solid rgba(37, 99, 235, 0.12);
    border-radius: 50%;
    box-shadow: 0 0 0 70px rgba(37, 99, 235, 0.035), 0 0 0 140px rgba(37, 99, 235, 0.02);
}

.auth-main {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 100%;
}

.auth-shell {
    display: grid;
    place-items: center;
    width: 100%;
    max-width: 420px;
}

.auth-brand {
    justify-content: center;
    margin-bottom: 22px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 30px 30px 26px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: var(--radius-xl);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 30px 70px -34px rgba(15, 23, 42, 0.38), 0 2px 8px rgba(15, 23, 42, 0.04);
    backdrop-filter: blur(8px);
}

.auth-card h1 {
    font-size: 1.75rem;
    letter-spacing: -0.03em;
    text-align: center;
}

.auth-card > p {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.9375rem;
    text-align: center;
}

.auth-form {
    margin-top: 24px;
}

.auth-footer {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.875rem;
    text-align: center;
}

.auth-footer a {
    font-weight: 600;
}

.input-with-icon {
    position: relative;
}

.input-with-icon > .input {
    padding-left: 44px;
}

.input-icon {
    position: absolute;
    top: 50%;
    left: 14px;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    color: var(--muted-soft);
    pointer-events: none;
}

.password-field {
    position: relative;
}

.password-field .input {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
}

.password-toggle:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.password-toggle svg {
    width: 18px;
    height: 18px;
}

/* --------------------------------------------------------------------------
   App shell
   -------------------------------------------------------------------------- */

.app-shell {
    display: flex;
    min-height: 100vh;
    background: var(--bg);
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
    padding: 20px 14px 16px;
    overflow-y: auto;
    background: #0b1220;
    color: #94a3b8;
    transition: transform 0.22s ease;
}

.sidebar .brand {
    padding: 4px 8px 20px;
    color: #fff;
}

.sidebar .brand-text span {
    color: #94a3b8;
}

.sidebar-nav {
    display: grid;
    gap: 4px;
}

.nav-group-label {
    margin: 18px 10px 6px;
    color: #64748b;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: 9px;
    color: #94a3b8;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.85;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #f1f5f9;
}

.nav-link.is-active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 8px 18px -12px rgba(37, 99, 235, 0.9);
}

.nav-link.is-active svg {
    opacity: 1;
}

.sidebar-foot {
    margin-top: auto;
    padding-top: 18px;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
}

.avatar {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
}

.sidebar-user-meta {
    min-width: 0;
    flex: 1;
}

.sidebar-user-meta strong {
    display: block;
    overflow: hidden;
    color: #f1f5f9;
    font-size: 0.8125rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-meta span {
    display: block;
    overflow: hidden;
    color: #64748b;
    font-size: 0.6875rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-logout {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #94a3b8;
}

.sidebar-logout:hover {
    background: rgba(220, 38, 38, 0.16);
    color: #fca5a5;
}

.sidebar-logout svg {
    width: 17px;
    height: 17px;
}

.app-main {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    margin-left: var(--sidebar-width);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 16px;
    height: 70px;
    padding: 0 28px;
    border-bottom: 1px solid var(--border);
    background: rgba(248, 250, 252, 0.9);
    backdrop-filter: blur(10px);
}

.topbar-title {
    display: grid;
    min-width: 0;
    line-height: 1.25;
}

.topbar-title strong {
    overflow: hidden;
    font-size: 0.9375rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-title span {
    color: var(--muted);
    font-size: 0.75rem;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.sidebar-toggle {
    display: none;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--secondary);
}

.sidebar-toggle svg {
    width: 20px;
    height: 20px;
}

.sidebar-overlay {
    display: none;
}

.app-content {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 28px;
}

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 1.65rem;
    letter-spacing: -0.03em;
}

.page-header p {
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.9rem;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    color: var(--muted);
    font-size: 0.8125rem;
}

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

.breadcrumb a:hover {
    color: var(--accent);
}

.breadcrumb svg {
    width: 14px;
    height: 14px;
}

/* --------------------------------------------------------------------------
   Cards, stats, dashboard
   -------------------------------------------------------------------------- */

.card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px;
    border-bottom: 1px solid var(--border);
}

.card-header h2,
.card-header h3 {
    font-size: 1rem;
    letter-spacing: -0.01em;
}

.card-header p {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.8125rem;
}

.card-body {
    padding: 22px;
}

.card-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--border);
    background: #fbfcfe;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}

.stat-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border-radius: 13px;
    background: var(--accent-soft);
    color: var(--accent);
}

.stat-icon.dark {
    background: #f1f5f9;
    color: var(--primary);
}

.stat-icon.green {
    background: var(--success-soft);
    color: var(--success);
}

.stat-icon svg {
    width: 22px;
    height: 22px;
}

.stat-meta {
    min-width: 0;
}

.stat-value {
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.stat-label {
    color: var(--muted);
    font-size: 0.8125rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr);
    gap: 22px;
    align-items: start;
}

.quick-actions {
    display: grid;
    gap: 12px;
}

.quick-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--primary);
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.quick-card:hover {
    transform: translateY(-2px);
    border-color: #bfdbfe;
    box-shadow: var(--shadow-sm);
    color: var(--primary);
}

.quick-card .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 11px;
}

.quick-card strong {
    display: block;
    font-size: 0.9rem;
}

.quick-card-meta {
    min-width: 0;
    flex: 1;
}

.quick-card-meta strong {
    display: block;
    font-size: 0.9rem;
}

.quick-card-meta span {
    display: block;
    color: var(--muted);
    font-size: 0.75rem;
}

.quick-card .chevron {
    width: 18px;
    height: 18px;
    margin-left: auto;
    color: var(--muted-soft);
}

.activity-list {
    display: grid;
    gap: 2px;
    padding: 8px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 10px;
    color: var(--primary);
}

.activity-item:hover {
    background: #f8fafc;
    color: var(--primary);
}

.activity-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 9px;
    background: var(--accent-soft);
    color: var(--accent);
}

.activity-icon.barcode {
    background: #f1f5f9;
    color: var(--secondary);
}

.activity-icon svg {
    width: 17px;
    height: 17px;
}

.activity-text {
    min-width: 0;
    flex: 1;
}

.activity-text strong {
    display: block;
    overflow: hidden;
    font-size: 0.875rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-text span {
    display: block;
    color: var(--muted);
    font-size: 0.75rem;
}

.activity-time {
    flex-shrink: 0;
    color: var(--muted-soft);
    font-size: 0.75rem;
}

.activity-item > .icon:last-child {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--muted-soft);
}

/* --------------------------------------------------------------------------
   Generator pages
   -------------------------------------------------------------------------- */

.generator-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
    gap: 22px;
    align-items: start;
}

.preview-column {
    position: sticky;
    top: 94px;
    display: grid;
    gap: 16px;
}

.type-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.type-option {
    position: relative;
    display: block;
    cursor: pointer;
}

.type-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.type-option-body {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 100%;
    padding: 10px 11px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--secondary);
    font-size: 0.8125rem;
    font-weight: 600;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.type-option-body svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    opacity: 0.8;
}

.type-option:hover .type-option-body {
    border-color: var(--border-strong);
}

.type-option input:checked + .type-option-body {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-hover);
}

.type-option input:focus-visible + .type-option-body {
    outline: 3px solid rgba(37, 99, 235, 0.35);
    outline-offset: 2px;
}

.type-panel[hidden] {
    display: none;
}

.type-panel {
    margin-top: 18px;
}

.type-panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    color: var(--secondary);
    font-size: 0.8125rem;
    font-weight: 600;
}

.type-panel-title svg {
    width: 16px;
    height: 16px;
    color: var(--accent);
}

.design-panel {
    border-top: 1px solid var(--border);
    margin-top: 22px;
    padding-top: 18px;
}

.design-panel summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    cursor: pointer;
    list-style: none;
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 600;
}

.design-panel summary::-webkit-details-marker {
    display: none;
}

.design-panel summary svg {
    width: 18px;
    height: 18px;
    color: var(--muted);
    transition: transform 0.18s ease;
}

.design-panel[open] summary svg {
    transform: rotate(180deg);
}

.design-panel-body {
    display: grid;
    gap: 16px;
    padding-top: 16px;
}

.preview-stage {
    display: grid;
    place-items: center;
    min-height: 292px;
    padding: 26px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background-color: #f1f5f9;
    background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
    background-size: 16px 16px;
}

.preview-canvas {
    display: grid;
    place-items: center;
    width: 100%;
}

.preview-canvas canvas,
.preview-canvas svg,
.preview-canvas img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.preview-canvas canvas {
    width: min(100%, 320px);
}

.preview-canvas svg {
    background: #fff;
}

.barcode-preview svg {
    width: 100%;
    max-height: 190px;
}

.preview-placeholder {
    display: grid;
    place-items: center;
    gap: 10px;
    width: 100%;
    min-height: 220px;
    padding: 24px;
    border: 1.5px dashed var(--border-strong);
    border-radius: 12px;
    color: var(--muted);
    text-align: center;
    font-size: 0.8125rem;
}

.preview-placeholder svg {
    width: 34px;
    height: 34px;
    color: var(--muted-soft);
}

.preview-status {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    min-height: 20px;
    margin-top: 12px;
    font-size: 0.8125rem;
    color: var(--muted);
}

.preview-status.is-error {
    color: var(--danger);
}

.preview-status svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

.preview-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f8fafc;
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.5;
}

.preview-note svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    margin-top: 2px;
}

.save-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.save-row .btn-primary {
    flex: 1;
}

/* --------------------------------------------------------------------------
   Saved item detail page
   -------------------------------------------------------------------------- */

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 22px;
    align-items: start;
}

.detail-preview {
    display: grid;
    place-items: center;
    min-height: 340px;
    padding: 28px;
    border-radius: var(--radius-lg);
    background-color: #f1f5f9;
    background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
    background-size: 16px 16px;
}

.detail-preview svg,
.detail-preview canvas,
.detail-preview img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    background: #fff;
    box-shadow: var(--shadow);
}

.detail-preview.barcode-preview svg {
    box-shadow: none;
}

.detail-list {
    display: grid;
    gap: 0;
}

.detail-row {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 16px;
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

.detail-row:last-child {
    border-bottom: 0;
}

.detail-row dt {
    color: var(--muted);
}

.detail-row dd {
    margin: 0;
    color: var(--primary);
    font-weight: 500;
}

.payload-box {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f8fafc;
    color: var(--secondary);
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-all;
}

/* --------------------------------------------------------------------------
   History
   -------------------------------------------------------------------------- */

.history-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.history-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.history-card:hover {
    transform: translateY(-2px);
    border-color: #dbe3ee;
    box-shadow: var(--shadow-sm);
}

.history-thumb {
    display: grid;
    place-items: center;
    height: 158px;
    padding: 18px;
    border-bottom: 1px solid var(--border);
    background-color: #f8fafc;
    background-image: radial-gradient(#dbe3ee 1px, transparent 1px);
    background-size: 14px 14px;
}

.history-thumb canvas,
.history-thumb svg,
.history-thumb img {
    max-width: 100%;
    max-height: 120px;
    height: auto;
    border-radius: 6px;
    background: #fff;
    box-shadow: var(--shadow-xs);
}

.history-thumb.barcode-thumb svg {
    width: 100%;
    max-height: 96px;
}

.history-thumb .thumb-placeholder {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    color: var(--muted-soft);
}

.history-thumb .thumb-placeholder svg {
    width: 34px;
    height: 34px;
}

.history-body {
    display: grid;
    gap: 8px;
    flex: 1;
    padding: 16px 18px;
}

.history-title {
    overflow: hidden;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--muted);
    font-size: 0.75rem;
}

.history-snippet {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: 1.5;
    word-break: break-all;
}

.history-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 11px 14px;
    border-top: 1px solid var(--border);
    background: #fbfcfe;
}

.history-actions .btn {
    min-height: 32px;
    padding: 5px 10px;
}

.empty-state {
    display: grid;
    place-items: center;
    gap: 10px;
    padding: 56px 24px;
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    background: var(--surface);
    text-align: center;
}

.empty-icon {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: var(--accent-soft);
    color: var(--accent);
}

.empty-icon svg {
    width: 26px;
    height: 26px;
}

.empty-state h3 {
    font-size: 1.0625rem;
}

.empty-state p {
    max-width: 400px;
    color: var(--muted);
    font-size: 0.875rem;
}

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.pagination-info {
    color: var(--muted);
    font-size: 0.8125rem;
}

.pagination-links {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--secondary);
    font-size: 0.8125rem;
    font-weight: 600;
}

.page-link:hover {
    border-color: var(--border-strong);
    background: #f8fafc;
    color: var(--primary);
}

.page-link.is-active {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.page-link.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.page-ellipsis {
    padding: 0 4px;
    color: var(--muted);
    font-size: 0.8125rem;
}

/* --------------------------------------------------------------------------
   Dialog & misc
   -------------------------------------------------------------------------- */

dialog.confirm-dialog {
    width: calc(100% - 32px);
    max-width: 420px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
}

dialog.confirm-dialog::backdrop {
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}

.confirm-body {
    padding: 26px;
    text-align: center;
}

.confirm-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--danger-soft);
    color: var(--danger);
}

.confirm-icon svg {
    width: 24px;
    height: 24px;
}

.confirm-body h2 {
    font-size: 1.1rem;
}

.confirm-body p {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.875rem;
}

.confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 22px;
}

.toast-region {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 90;
    display: grid;
    gap: 8px;
    width: min(380px, calc(100% - 36px));
}

.flash-alert {
    animation: slide-in 0.22s ease;
}

.flash-alert.is-hiding {
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

@keyframes slide-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* --------------------------------------------------------------------------
   Advanced QR styling controls
   -------------------------------------------------------------------------- */

.design-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border, #E2E8F0);
}

.design-section-title {
    margin: 0 0 14px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #0F172A;
}

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

.style-option {
    position: relative;
    display: block;
    cursor: pointer;
}

.style-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.style-option span {
    display: block;
    padding: 10px 12px;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    background: #FFFFFF;
    font-size: 0.82rem;
    font-weight: 600;
    color: #475569;
    text-align: center;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.style-option:hover span {
    border-color: #93C5FD;
}

.style-option input:checked + span {
    border-color: #2563EB;
    background: #EFF6FF;
    color: #1D4ED8;
}

.style-option input:focus-visible + span {
    outline: 2px solid #2563EB;
    outline-offset: 2px;
}

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

.upload-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 14px;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    background: #F8FAFC;
}

.image-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 96px;
    border: 1px dashed #CBD5E1;
    border-radius: 10px;
    background-color: #FFFFFF;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    color: #94A3B8;
}

.image-preview.has-image {
    border-style: solid;
    border-color: #16A34A;
}

.file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.upload-status {
    margin: 0;
    font-size: 0.74rem;
    color: #64748B;
    line-height: 1.45;
}

.upload-status.is-error {
    color: #DC2626;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1080px) {
    .hero-grid {
        gap: 40px;
    }

    .floating-card.top {
        right: -8px;
    }

    .floating-card.bottom {
        left: -8px;
    }

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

    .generator-grid,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .preview-column {
        position: static;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .site-nav {
        display: none;
    }

    .auth-page {
        padding: 28px 16px;
    }

    .app-main {
        margin-left: 0;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        z-index: 55;
        display: block;
        background: rgba(15, 23, 42, 0.5);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s ease, visibility 0.2s ease;
    }

    .sidebar-overlay.is-visible {
        opacity: 1;
        visibility: visible;
    }

    .sidebar-toggle {
        display: grid;
    }

    .topbar {
        padding: 0 18px;
    }

    .app-content {
        padding: 22px 18px 40px;
    }

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

    .cta-band {
        grid-template-columns: 1fr;
        padding: 36px;
    }
}

@media (max-width: 720px) {
    .hero {
        padding: 56px 0 48px;
    }

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

    .hero-visual {
        order: -1;
    }

    .floating-card {
        display: none;
    }

    .section {
        padding: 60px 0;
    }

    .feature-grid,
    .steps-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-grid .field + .field {
        margin-top: 16px;
    }

    .history-grid {
        grid-template-columns: 1fr;
    }

    .history-thumb {
        height: 180px;
    }

    .detail-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

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

    .footer-bottom {
        align-items: flex-start;
    }

    .footer-privacy {
        margin-left: auto;
    }

    .type-selector {
        grid-template-columns: repeat(2, 1fr);
    }

    .upload-grid,
    .style-selector {
        grid-template-columns: 1fr;
    }

    .mock-window-body {
        grid-template-columns: 1fr;
    }

    .mock-qr {
        display: none;
    }

    .page-header {
        align-items: flex-start;
    }
}

@media (max-width: 520px) {
    .container,
    .container-wide {
        padding: 0 16px;
    }

    .topbar {
        height: auto;
        min-height: 64px;
        padding: 10px 14px;
        gap: 12px;
    }

    .topbar-actions {
        display: none;
    }

    .topbar-title span {
        display: none;
    }

    .site-actions .btn-ghost {
        display: none;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .btn-group {
        grid-template-columns: 1fr;
    }

    .save-row {
        flex-direction: column;
        align-items: stretch;
    }

    .save-row .btn {
        width: 100%;
    }

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

    .cta-band {
        padding: 28px;
    }

    .app-content {
        padding: 18px 14px 36px;
    }

    .card-body,
    .card-header {
        padding: 18px;
    }

    .auth-card {
        padding: 24px 20px 22px;
    }
}
