/* QRForge styles — neutral palette + indigo accent */
:root {
    --bg: #f7f7f8;
    --surface: #ffffff;
    --border: #e5e5e8;
    --text: #1a1a1f;
    --muted: #6b7280;
    --accent: #4f46e5;
    --accent-hover: #4338ca;
    --danger: #dc2626;
    --success-bg: #e7f6ec;
    --success-fg: #0f5132;
    --error-bg: #fbeaea;
    --error-fg: #842029;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

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

h1 { font-size: 26px; }
h2 { font-size: 19px; margin-bottom: 14px; }
h3 { font-size: 15px; margin-bottom: 10px; }

/* --- Buttons --- */
.btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, transform .1s;
}
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 13px 24px; font-size: 16px; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn-ghost { background: transparent; color: var(--accent); border: 1.5px solid var(--border); }
.btn-ghost:hover { background: #f0f0ff; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b91c1c; }
.linklike { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 14px; }
.linklike:hover { color: var(--text); }
.inline { display: inline; }

/* --- Top bar --- */
.topbar, .hero-bar { background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar-inner, .hero-bar .container { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.hero-bar .container { display: flex; }
.brand { font-size: 19px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 6px; }
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--accent); }
.topnav { display: flex; align-items: center; gap: 18px; }
.topnav a { color: var(--text); font-size: 14px; font-weight: 500; }
.usermenu { display: flex; align-items: center; gap: 12px; padding-left: 12px; border-left: 1px solid var(--border); }
.user-name { font-size: 14px; color: var(--muted); }

.main { padding: 32px 20px 60px; }

/* --- Alerts --- */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; font-size: 14px; }
.alert-success { background: var(--success-bg); color: var(--success-fg); }
.alert-error { background: var(--error-bg); color: var(--error-fg); }

/* --- Page head --- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 4px 0; }
.back-link { font-size: 13px; color: var(--muted); }
.head-actions { display: flex; gap: 10px; align-items: center; }

/* --- Cards --- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-bottom: 20px; }

/* --- Forms --- */
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #374151; }
.field .req { color: var(--danger); }
.field input, .field select, .field textarea {
    width: 100%; padding: 10px 12px; border: 1.5px solid var(--border);
    border-radius: 8px; font-size: 15px; font-family: inherit; background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field input[type="color"] { height: 44px; padding: 4px; cursor: pointer; }
.field small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.field .err { display: block; color: var(--danger); font-size: 12px; margin-top: 4px; font-style: normal; }
.field input:disabled { background: #f3f4f6; color: var(--muted); }

.form-grid { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
.form-side { position: sticky; top: 20px; }

.menu-item { display: grid; grid-template-columns: 1fr 90px 1fr; gap: 8px; margin-bottom: 8px; }
.menu-item .compact { padding: 8px 10px; font-size: 14px; }

/* --- Auth --- */
.auth-wrap { min-height: calc(100vh - 60px); display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 36px; width: 100%; max-width: 400px; box-shadow: var(--shadow); }
.auth-title { font-size: 22px; margin-bottom: 4px; }
.auth-sub { color: var(--muted); font-size: 14px; margin-bottom: 24px; }
.auth-alt { text-align: center; margin-top: 18px; font-size: 14px; color: var(--muted); }

/* --- Dashboard grid --- */
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.qr-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s; color: var(--text); }
.qr-card:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,.1); text-decoration: none; }
.qr-thumb { display: flex; align-items: center; justify-content: center; background: #fafafa; padding: 18px; min-height: 150px; }
.qr-thumb canvas, .qr-thumb img { display: block; max-width: 100%; height: auto; }
.qr-meta { padding: 14px 16px; }
.qr-meta h3 { margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qr-stats { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 13px; }

.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 5px; background: #eef2ff; color: var(--accent); letter-spacing: .04em; }

/* --- Empty state --- */
.empty { text-align: center; padding: 60px 20px; }
.empty-icon { font-size: 56px; color: #d1d5db; }
.empty h2 { margin: 12px 0 6px; }
.empty p { color: var(--muted); margin-bottom: 20px; }

/* --- QR detail --- */
.detail-grid { display: grid; grid-template-columns: 360px 1fr; gap: 24px; align-items: start; margin-bottom: 12px; }
.qr-display { text-align: center; }
.qr-big { display: flex; justify-content: center; padding: 10px; }
.qr-preview-box { display: flex; justify-content: center; padding: 10px; min-height: 180px; align-items: center; }
.download-row { display: flex; gap: 10px; justify-content: center; margin: 18px 0; }
.scan-url label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; text-align: left; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; padding: 8px 10px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 13px; background: #f9fafb; }
.dest { word-break: break-all; margin-bottom: 8px; }
.small { font-size: 12px; }
.muted { color: var(--muted); }

.section-title { margin: 28px 0 16px; }
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-align: center; box-shadow: var(--shadow); }
.stat-num { font-size: 30px; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 13px; color: var(--muted); margin-top: 4px; }

.minichart { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding-top: 10px; }
.minichart .bar { flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; }
.minichart .bar:hover { opacity: 1; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }

/* --- Landing --- */
.landing { background: var(--surface); }
.hero { padding: 70px 0; background: linear-gradient(180deg, #fff 0%, var(--bg) 100%); }
.hero-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; }
.hero h1 { font-size: 42px; line-height: 1.15; margin-bottom: 16px; }
.lead { font-size: 18px; color: var(--muted); margin-bottom: 28px; }
.hero-cta { display: flex; gap: 14px; }
.hero-art { display: flex; justify-content: center; }
.qr-float { font-size: 180px; color: var(--accent); opacity: .15; }
.features { padding: 60px 20px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.feature-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.feature-icon { font-size: 28px; margin-bottom: 10px; }
.feature-card h3 { font-size: 16px; }
.feature-card p { color: var(--muted); font-size: 14px; }

/* --- Public scan pages --- */
.public-scan { background: var(--bg); }
.scan-page { min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; }
.scan-card { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: 28px; max-width: 480px; width: 100%; }
.scan-card h1 { text-align: center; margin-bottom: 20px; }
.menu-list { list-style: none; }
.menu-row { padding: 14px 0; border-bottom: 1px solid var(--border); }
.menu-row-head { display: flex; justify-content: space-between; align-items: baseline; }
.menu-name { font-weight: 600; }
.menu-price { color: var(--accent); font-weight: 700; }
.menu-desc { color: var(--muted); font-size: 14px; margin-top: 4px; }
.scan-text { font-size: 16px; white-space: pre-wrap; }
.wifi-detail { margin: 16px 0; }
.wifi-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); }

/* --- Footer --- */
.footer { border-top: 1px solid var(--border); padding: 24px 0; color: var(--muted); font-size: 13px; text-align: center; background: var(--surface); }

/* --- Responsive --- */
@media (max-width: 820px) {
    .form-grid, .detail-grid, .hero-grid { grid-template-columns: 1fr; }
    .form-side { position: static; }
    .feature-grid { grid-template-columns: 1fr 1fr; }
    .stats-row { grid-template-columns: 1fr 1fr; }
    .hero h1 { font-size: 32px; }
}
@media (max-width: 520px) {
    .feature-grid { grid-template-columns: 1fr; }
    .menu-item { grid-template-columns: 1fr; }
}
