/* ============================================================
   OPENQR — Design system
   ============================================================ */

@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f5f6fb;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #f0f2f9;
  --surface-3: #e8ebf5;
  --text: #14162e;
  --text-soft: #3b3f63;
  --muted: #666e93;
  --border: #e3e6f0;
  --border-strong: #d2d7e8;
  --primary: #6d4aff;
  --primary-2: #3b82f6;
  --primary-soft: rgba(109, 74, 255, 0.12);
  --grad: linear-gradient(135deg, #7c5cff 0%, #3b82f6 100%);
  --grad-text: linear-gradient(90deg, #7c5cff, #3b82f6);
  --success: #16a34a;
  --warning: #d97706;
  --danger: #e11d48;
  --info: #2563eb;
  --shadow-sm: 0 2px 8px rgba(20, 22, 60, 0.06);
  --shadow: 0 12px 32px rgba(20, 22, 60, 0.09);
  --shadow-lg: 0 26px 60px rgba(20, 22, 60, 0.14);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --header-h: 68px;
  --maxw: 1180px;
  --ring: 0 0 0 3px rgba(109, 74, 255, 0.35);
}

html[data-theme='dark'] {
  --bg: #0a0d1c;
  --bg-elev: #10142c;
  --surface: #131735;
  --surface-2: #1a1f42;
  --surface-3: #232a55;
  --text: #eef1ff;
  --text-soft: #c3c8e8;
  --muted: #9299c4;
  --border: #272e57;
  --border-strong: #364070;
  --primary: #8b6cff;
  --primary-2: #4f8dff;
  --primary-soft: rgba(139, 108, 255, 0.18);
  --grad: linear-gradient(135deg, #8b6cff 0%, #4f8dff 100%);
  --grad-text: linear-gradient(90deg, #a58cff, #5f9bff);
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #fb7185;
  --info: #60a5fa;
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 30px 70px rgba(0, 0, 0, 0.6);
  --ring: 0 0 0 3px rgba(139, 108, 255, 0.45);
}

@media (prefers-color-scheme: dark) {
  html[data-theme='system'] {
    --bg: #0a0d1c;
    --bg-elev: #10142c;
    --surface: #131735;
    --surface-2: #1a1f42;
    --surface-3: #232a55;
    --text: #eef1ff;
    --text-soft: #c3c8e8;
    --muted: #9299c4;
    --border: #272e57;
    --border-strong: #364070;
    --primary: #8b6cff;
    --primary-2: #4f8dff;
    --primary-soft: rgba(139, 108, 255, 0.18);
    --grad: linear-gradient(135deg, #8b6cff 0%, #4f8dff 100%);
    --grad-text: linear-gradient(90deg, #a58cff, #5f9bff);
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #fb7185;
    --info: #60a5fa;
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
    --shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 30px 70px rgba(0, 0, 0, 0.6);
    --ring: 0 0 0 3px rgba(139, 108, 255, 0.45);
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15.5px;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

h1, h2, h3, h4, h5 { line-height: 1.2; margin: 0 0 0.5em; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1rem; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 8px; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.grad-text { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.grad { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.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; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; } .gap-3 { gap: 1.5rem; }
.hidden { display: none !important; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: 0.62rem 1.15rem; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 0.94rem; cursor: pointer; text-decoration: none;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease, color .2s ease;
  white-space: nowrap; line-height: 1.2;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 22px rgba(109, 74, 255, 0.35); }
.btn-primary:hover { box-shadow: 0 12px 28px rgba(109, 74, 255, 0.5); color: #fff; }
.btn-secondary { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-3); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-outline { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.82rem; }
.btn-lg { padding: 0.85rem 1.7rem; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer; font-weight: 700;
  transition: background .2s, border-color .2s;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--border-strong); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(160%) blur(14px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 1rem; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 800; color: var(--text); font-size: 1.15rem; }
.brand:hover { text-decoration: none; }
.brand-logo { height: 32px; width: auto; }
.brand-mark {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px;
  background: var(--grad); color: #fff; font-weight: 800; font-size: 0.9rem; letter-spacing: -0.03em;
  box-shadow: 0 6px 16px rgba(109, 74, 255, 0.4);
}
.brand-name { letter-spacing: -0.02em; }
.main-nav { display: flex; align-items: center; gap: .3rem; margin-left: 1rem; }
.nav-link { color: var(--text-soft); padding: .45rem .75rem; border-radius: 9px; font-weight: 500; }
.nav-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-link.is-active { color: var(--primary); background: var(--primary-soft); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.user-btn { gap: .5rem; }
.avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--grad); color: #fff; font-weight: 700; font-size: .85rem; }
.nav-toggle { display: none; flex-direction: column; gap: 4px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: .2s; }

/* ---------- Dropdown ---------- */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 190px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow); opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s; z-index: 60;
}
.dropdown-menu--right { left: auto; right: 0; }
.dropdown.is-open .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-item {
  display: block; width: 100%; text-align: left; padding: .55rem .75rem; border-radius: 9px;
  background: none; border: 0; color: var(--text); font-size: .92rem; cursor: pointer; font-weight: 500;
}
.dropdown-item:hover { background: var(--surface-2); text-decoration: none; }
.dropdown-item.is-active { color: var(--primary); background: var(--primary-soft); }
form .dropdown-item { font-family: inherit; }

/* ---------- Flash / alerts ---------- */
.flash-stack { position: fixed; top: calc(var(--header-h) + 12px); left: 0; right: 0; z-index: 100; display: flex; flex-direction: column; gap: .5rem; pointer-events: none; }
.alert {
  pointer-events: auto; display: flex; align-items: center; gap: 1rem; justify-content: space-between;
  padding: .85rem 1.1rem; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); box-shadow: var(--shadow); font-size: .92rem;
  animation: slideDown .3s ease;
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
.alert--success { border-color: color-mix(in srgb, var(--success) 45%, var(--border)); }
.alert--error { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.alert--warning { border-color: color-mix(in srgb, var(--warning) 45%, var(--border)); }
.alert--info { border-color: color-mix(in srgb, var(--info) 45%, var(--border)); }
.alert-close { background: none; border: 0; font-size: 1.3rem; line-height: 1; cursor: pointer; color: var(--muted); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(48px, 8vw, 96px) 0 clamp(40px, 6vw, 72px); }
.hero::before {
  content: ''; position: absolute; inset: -30% -10% auto -10%; height: 640px;
  background: radial-gradient(60% 60% at 50% 0%, rgba(124, 92, 255, 0.22), transparent 70%);
  pointer-events: none;
}
.hero-grid { position: relative; display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(30px, 5vw, 64px); align-items: center; }
.badge {
  display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .85rem; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary); font-size: .82rem; font-weight: 600; margin-bottom: 1.2rem;
}
.hero h1 { margin-bottom: 1rem; }
.hero-lead { font-size: clamp(1rem, 1.6vw, 1.18rem); color: var(--muted); max-width: 560px; margin-bottom: 1.6rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 2rem; margin-top: 2.4rem; }
.stat-num { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; }
.stat-lbl { color: var(--muted); font-size: .85rem; }

/* ---------- Cards / surfaces ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: clamp(18px, 2.4vw, 28px); box-shadow: var(--shadow-sm);
}
.card-elev { box-shadow: var(--shadow); }
.section { padding: clamp(48px, 7vw, 88px) 0; }
.section-head { max-width: 640px; margin: 0 auto 2.6rem; text-align: center; }
.section-head p { color: var(--muted); }

/* ---------- Generator ---------- */
.generator { position: relative; }
.generator-grid { display: grid; grid-template-columns: 1fr 380px; gap: 1.5rem; align-items: start; }
.type-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.2rem; }
.type-tab {
  display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .8rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-soft);
  cursor: pointer; font-size: .85rem; font-weight: 600;
}
.type-tab:hover { border-color: var(--border-strong); }
.type-tab.is-active { background: var(--primary-soft); border-color: transparent; color: var(--primary); }
.type-panel { display: none; }
.type-panel.is-active { display: block; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.preview-card { position: sticky; top: calc(var(--header-h) + 20px); text-align: center; }
.qr-frame {
  display: inline-grid; place-items: center; padding: 18px; border-radius: 18px;
  background: #fff; box-shadow: var(--shadow); margin: 0 auto 1rem; min-height: 240px; min-width: 240px;
  border: 1px solid var(--border);
}
.qr-frame img { width: 240px; height: 240px; }
.qr-actions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }

/* ---------- Features ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.feature {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.6rem; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.feature-icon {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px;
  background: var(--primary-soft); color: var(--primary); font-size: 1.3rem; margin-bottom: 1rem;
}
.feature h3 { font-size: 1.08rem; margin-bottom: .35rem; }
.feature p { color: var(--muted); font-size: .92rem; margin: 0; }

/* ---------- Pricing ---------- */
.pricing-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; align-items: stretch; }
.plan {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 1.8rem 1.5rem; box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s;
}
.plan:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.plan--popular { border-color: transparent; box-shadow: 0 0 0 2px var(--primary), var(--shadow-lg); }
.plan-ribbon {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  background: var(--grad); color: #fff; padding: .3rem .9rem; border-radius: 999px;
  font-size: .74rem; font-weight: 700; white-space: nowrap; letter-spacing: .02em;
}
.plan-name { font-size: 1.15rem; font-weight: 700; margin-bottom: .2rem; }
.plan-desc { color: var(--muted); font-size: .86rem; min-height: 2.4em; }
.plan-price { display: flex; align-items: baseline; gap: .3rem; margin: 1rem 0 .2rem; }
.plan-price .amount { font-size: 2.1rem; font-weight: 800; letter-spacing: -0.03em; }
.plan-price .period { color: var(--muted); font-size: .9rem; }
.plan-features { list-style: none; padding: 0; margin: 1.2rem 0 1.6rem; display: flex; flex-direction: column; gap: .6rem; flex: 1; }
.plan-features li { display: flex; gap: .6rem; align-items: flex-start; font-size: .9rem; color: var(--text-soft); }
.plan-features li::before { content: '✓'; color: var(--success); font-weight: 800; flex: 0 0 auto; }
.plan-features li.is-off { color: var(--muted); opacity: .6; }
.plan-features li.is-off::before { content: '×'; color: var(--muted); }
.plan .btn { width: 100%; }

.compare-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.compare-table th, .compare-table td { padding: .85rem 1rem; border-bottom: 1px solid var(--border); text-align: center; }
.compare-table th:first-child, .compare-table td:first-child { text-align: left; font-weight: 500; }
.compare-table thead th { font-weight: 700; }
.compare-table tbody tr:hover { background: var(--surface-2); }
.compare-table .yes { color: var(--success); font-weight: 700; }
.compare-table .no { color: var(--muted); }

/* ---------- FAQ ---------- */
.faq-list { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: .75rem; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.faq-q {
  width: 100%; text-align: left; background: none; border: 0; padding: 1.1rem 1.3rem;
  font-size: 1rem; font-weight: 600; color: var(--text); cursor: pointer; display: flex; justify-content: space-between; gap: 1rem; align-items: center;
}
.faq-q::after { content: '+'; font-size: 1.4rem; color: var(--muted); transition: transform .2s; }
.faq-item.is-open .faq-q::after { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.faq-a-inner { padding: 0 1.3rem 1.2rem; color: var(--muted); }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 1.1rem; }
.label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: .4rem; color: var(--text-soft); }
.input, .select, .textarea {
  width: 100%; padding: .7rem .9rem; border-radius: 11px; border: 1px solid var(--border);
  background: var(--bg-elev); color: var(--text); font-size: .95rem; font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: var(--ring); outline: none; }
.textarea { min-height: 110px; resize: vertical; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 2.2rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-hint { font-size: .8rem; color: var(--muted); margin-top: .3rem; }
.checkbox { display: flex; align-items: center; gap: .55rem; font-size: .9rem; color: var(--text-soft); cursor: pointer; }
.checkbox input { width: 17px; height: 17px; accent-color: var(--primary); }
.color-input { display: flex; gap: .5rem; align-items: center; }
.color-input input[type=color] { width: 46px; height: 42px; padding: 3px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-elev); cursor: pointer; }
.field-error { color: var(--danger); font-size: .82rem; margin-top: .3rem; }

/* Auth pages */
.auth-wrap { min-height: calc(100vh - var(--header-h)); display: grid; place-items: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card h1 { font-size: 1.7rem; margin-bottom: .3rem; }
.auth-alt { text-align: center; margin-top: 1.2rem; font-size: .9rem; color: var(--muted); }

/* ---------- Dashboard layout ---------- */
.app-shell { display: grid; grid-template-columns: 252px 1fr; gap: 1.5rem; padding: 1.8rem 0 4rem; }
.sidebar { position: sticky; top: calc(var(--header-h) + 20px); align-self: start; }
.side-nav { display: flex; flex-direction: column; gap: .2rem; }
.side-nav a {
  display: flex; align-items: center; gap: .7rem; padding: .68rem .9rem; border-radius: 11px;
  color: var(--text-soft); font-weight: 500; font-size: .93rem;
}
.side-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.side-nav a.is-active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.side-section { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 1rem .9rem .3rem; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head h1 { font-size: 1.6rem; margin: 0; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.6rem; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; }
.stat-card .k { color: var(--muted); font-size: .82rem; }
.stat-card .v { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.02em; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th, table.data td { padding: .8rem 1rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data th { font-weight: 600; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2); position: sticky; top: 0; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: var(--surface-2); }

.badge-pill { display: inline-flex; align-items: center; padding: .2rem .6rem; border-radius: 999px; font-size: .74rem; font-weight: 600; }
.badge-pill.green { background: rgba(22, 163, 74, .14); color: var(--success); }
.badge-pill.red { background: rgba(225, 29, 72, .14); color: var(--danger); }
.badge-pill.amber { background: rgba(217, 119, 6, .16); color: var(--warning); }
.badge-pill.blue { background: rgba(37, 99, 235, .14); color: var(--info); }
.badge-pill.gray { background: var(--surface-3); color: var(--muted); }
.badge-pill.purple { background: var(--primary-soft); color: var(--primary); }

/* ---------- QR list cards ---------- */
.qr-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.qr-item { display: flex; gap: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.qr-item-thumb { flex: 0 0 84px; width: 84px; height: 84px; border-radius: 12px; background: #fff; padding: 5px; border: 1px solid var(--border); }
.qr-item-body { min-width: 0; flex: 1; }
.qr-item-body h3 { font-size: 1rem; margin: 0 0 .25rem; }
.qr-item-meta { display: flex; flex-wrap: wrap; gap: .5rem; font-size: .78rem; color: var(--muted); margin-bottom: .5rem; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy-row { display: flex; gap: .4rem; align-items: center; }
.copy-row input { font-size: .82rem; padding: .4rem .6rem; }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(6, 8, 20, .6); backdrop-filter: blur(3px); display: none; place-items: center; z-index: 200; padding: 20px; }
.modal-backdrop.is-open { display: grid; }
.modal { width: 100%; max-width: 560px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); max-height: 90vh; overflow-y: auto; }
.modal-head { padding: 1.2rem 1.5rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: 1.5rem; }
.modal-foot { padding: 1rem 1.5rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: .6rem; }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: .35rem; justify-content: center; margin-top: 1.5rem; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 38px; height: 38px; display: grid; place-items: center; padding: 0 .6rem;
  border: 1px solid var(--border); border-radius: 10px; color: var(--text-soft); font-size: .9rem; background: var(--surface);
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.pagination .is-active { background: var(--grad); color: #fff; border-color: transparent; }

/* ---------- Progress / usage ---------- */
.usage-bar { height: 9px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.usage-bar > span { display: block; height: 100%; background: var(--grad); border-radius: 999px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-elev); margin-top: 3rem; padding-top: 3rem; }
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem; padding-bottom: 2rem; }
.footer-brand p { font-size: .88rem; margin-top: .6rem; max-width: 260px; }
.footer-col h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: .8rem; }
.footer-col a { display: block; color: var(--text-soft); font-size: .9rem; padding: .25rem 0; }
.footer-bottom { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1.2rem 0; border-top: 1px solid var(--border); font-size: .82rem; color: var(--muted); }

/* ---------- Legal / prose ---------- */
.prose { max-width: 780px; margin: 0 auto; }
.prose h2 { margin-top: 2rem; }
.prose a { text-decoration: underline; }

/* ---------- Expired / error page ---------- */
.center-page { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 40px 20px; }
.center-page .big { font-size: 4rem; font-weight: 800; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--border); margin-bottom: 1.4rem; overflow-x: auto; }
.tab { padding: .6rem 1rem; border: 0; background: none; color: var(--muted); font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab.is-active { color: var(--primary); border-bottom-color: var(--primary); }

/* ---------- Misc ---------- */
.divider { height: 1px; background: var(--border); margin: 1.5rem 0; border: 0; }
.kbd { font-family: ui-monospace, monospace; background: var(--surface-2); padding: .1rem .4rem; border-radius: 6px; font-size: .85em; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.chart { width: 100%; height: 220px; }
.spinner { width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.admin-badge { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .pricing-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .generator-grid { grid-template-columns: 1fr; }
  .preview-card { position: static; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .nav-toggle { display: flex; }
  .main-nav {
    position: absolute; top: var(--header-h); left: 0; right: 0; flex-direction: column; align-items: stretch;
    background: var(--surface); border-bottom: 1px solid var(--border); padding: .8rem; margin: 0; gap: .2rem;
    display: none; box-shadow: var(--shadow);
  }
  .main-nav.is-open { display: flex; }
  .header-actions .btn-ghost { display: none; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .side-nav { flex-direction: row; overflow-x: auto; padding-bottom: .4rem; }
  .side-nav a { white-space: nowrap; }
  .side-section { display: none; }
  .hero-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .feature-grid, .pricing-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .hero-stats { gap: 1.2rem; }
  .user-name { display: none; }
  .compare-table { font-size: .82rem; }
  .compare-table th, .compare-table td { padding: .6rem .5rem; }
}
