/* PrintFlow — light theme */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f5;
  --hover: #e9ecef;
  --text: #16181d;
  --text-2: #5f6368;
  --muted: #8a9099;
  --border: #e3e5e8;
  --primary: #7c3aed;
  --primary-hover: #6d28d9;
  --primary-light: rgba(124, 58, 237, .09);
  --success: #0f9d58;
  --success-light: rgba(15, 157, 88, .1);
  --warning: #b7791f;
  --warning-light: rgba(234, 179, 8, .14);
  --danger: #d93025;
  --danger-light: rgba(217, 48, 37, .09);
  --info: #1a73e8;
  --info-light: rgba(26, 115, 232, .09);
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
  --shadow-lg: 0 10px 30px rgba(16,24,40,.08);
  --radius: 10px;
  --radius-lg: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); line-height: 1.55; font-size: 15px; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; color: var(--text); }
h1 { font-size: 1.9rem; } h2 { font-size: 1.4rem; } h3 { font-size: 1.1rem; } h4 { font-size: 1rem; }
p { margin-bottom: .75rem; }
img { max-width: 100%; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
main.container { flex: 1; padding-top: 24px; padding-bottom: 40px; }

/* ---- Top bar ---- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.topbar .container { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: 12px; }
.brand { font-weight: 800; font-size: 1.15rem; color: var(--text); display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.brand i { color: var(--primary); }
.brand:hover { text-decoration: none; }
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a, .nav button.linklike { color: var(--text-2); padding: 8px 12px; border-radius: 8px; font-size: .9rem; font-weight: 500; display: inline-flex; gap: 6px; align-items: center; }
.nav a:hover, .nav button.linklike:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active { color: var(--primary); background: var(--primary-light); }
.nav .cta { background: var(--primary); color: #fff; }
.nav .cta:hover { background: var(--primary-hover); color: #fff; }
.nav-toggle { display: none; background: none; border: 1px solid var(--border); color: var(--text); padding: 8px 10px; border-radius: 8px; }
button.linklike { background: none; border: none; cursor: pointer; font: inherit; }
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .nav { display: none; position: absolute; top: 60px; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--border); flex-direction: column; align-items: stretch; padding: 8px 16px 16px; }
  .nav.open { display: flex; }
}

/* ---- Sub navigation (shop / admin) ---- */
.subnav { background: var(--surface); border-bottom: 1px solid var(--border); overflow-x: auto; }
.subnav .container { display: flex; gap: 2px; }
.subnav a { padding: 12px 14px; color: var(--text-2); font-size: .88rem; font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; }
.subnav a:hover { color: var(--text); text-decoration: none; }
.subnav a.active { color: var(--primary); border-bottom-color: var(--primary); }
.subnav .shop-pill { margin-left: auto; align-self: center; font-size: .8rem; color: var(--muted); white-space: nowrap; padding-left: 12px; }

/* ---- Cards & layout ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 20px; box-shadow: var(--shadow); }
.card > h2:first-child, .card > h3:first-child { margin-bottom: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 1.6rem; }
.page-head p { color: var(--text-2); margin: 4px 0 0; }
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.col-3 { grid-column: span 3; } .col-4 { grid-column: span 4; } .col-5 { grid-column: span 5; } .col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; } .col-8 { grid-column: span 8; } .col-9 { grid-column: span 9; } .col-12 { grid-column: span 12; }
@media (max-width: 900px) { .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9 { grid-column: span 12; } }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 960px) { .split { grid-template-columns: 1fr; } }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack > * + * { margin-top: 10px; }
.spacer { flex: 1; }
.muted, .small { color: var(--text-2); font-size: .88rem; }
.tiny { font-size: .78rem; color: var(--muted); }
.text-right { text-align: right; } .text-center { text-align: center; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 16px; }
.hidden { display: none !important; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }

/* ---- Buttons ---- */
.btn, button[type=submit], button.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 9px; border: 1px solid transparent; background: var(--primary); color: #fff; font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; transition: background .15s, box-shadow .15s; text-decoration: none; line-height: 1.2; }
.btn:hover, button[type=submit]:hover { background: var(--primary-hover); text-decoration: none; color: #fff; }
.btn:disabled, button:disabled { opacity: .55; cursor: not-allowed; }
.btn-secondary, button.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover, button.btn-secondary:hover { background: var(--surface-2); color: var(--text); }
.btn-success, button.btn-success { background: var(--success); } .btn-success:hover { background: #0b8043; }
.btn-danger, button.btn-danger { background: var(--danger); } .btn-danger:hover { background: #b3261e; }
.btn-ghost, button.btn-ghost { background: transparent; color: var(--text-2); border-color: transparent; }
.btn-ghost:hover, button.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm, button.btn-sm { padding: 6px 12px; font-size: .82rem; border-radius: 7px; }
.btn-lg { padding: 14px 24px; font-size: 1rem; }
.btn-block { width: 100%; }

/* ---- Forms ---- */
label { display: block; font-size: .85rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
label .opt { font-weight: 400; color: var(--muted); }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=url], input[type=search], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text); font: inherit; font-size: .93rem; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
textarea { resize: vertical; min-height: 80px; }
input[type=color] { width: 100%; height: 42px; padding: 3px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); }
input[type=file] { width: 100%; padding: 10px; border: 1px dashed var(--border); border-radius: 9px; background: var(--surface-2); font-size: .88rem; }
.field { margin-bottom: 14px; }
.hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.check { display: flex; align-items: flex-start; gap: 8px; font-weight: 500; font-size: .9rem; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--primary); flex-shrink: 0; }
.inline-form { display: inline; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; }
.choice span { display: block; padding: 12px; border: 1.5px solid var(--border); border-radius: 10px; cursor: pointer; font-size: .9rem; background: var(--surface); height: 100%; }
.choice span small { display: block; color: var(--muted); font-weight: 400; margin-top: 2px; }
.choice input:checked + span { border-color: var(--primary); background: var(--primary-light); }
.choice input:focus-visible + span { box-shadow: 0 0 0 3px var(--primary-light); }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { background: var(--surface-2); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--text-2); white-space: nowrap; }
.table tbody tr:hover { background: #fafafb; }
.table td.num, .table th.num { text-align: right; white-space: nowrap; }
.table .strong { font-weight: 600; }
.table input, .table select { padding: 7px 9px; font-size: .85rem; }

/* ---- Badges & alerts ---- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 600; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-info { background: var(--info-light); color: var(--info); }
.badge-secondary { background: var(--surface-2); color: var(--text-2); }
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; border: 1px solid transparent; }
.alert.success { background: var(--success-light); color: #0b6b3a; border-color: rgba(15,157,88,.2); }
.alert.error { background: var(--danger-light); color: #a1231a; border-color: rgba(217,48,37,.2); }
.alert.info { background: var(--info-light); color: #174ea6; border-color: rgba(26,115,232,.2); }
.alert.warning { background: var(--warning-light); color: #7a5213; border-color: rgba(234,179,8,.3); }

/* ---- Stats ---- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow); }
.stat .label { font-size: .8rem; color: var(--text-2); font-weight: 500; display: flex; gap: 6px; align-items: center; }
.stat .value { font-size: 1.55rem; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat a { color: inherit; }
.stat.warn .value { color: var(--warning); } .stat.bad .value { color: var(--danger); } .stat.good .value { color: var(--success); }

/* ---- Hero / home ---- */
.hero { text-align: center; padding: 56px 16px 40px; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: -.02em; max-width: 820px; margin: 0 auto 14px; }
.hero p { color: var(--text-2); font-size: 1.08rem; max-width: 640px; margin: 0 auto 26px; }
.hero .row { justify-content: center; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.feature i { font-size: 1.3rem; color: var(--primary); background: var(--primary-light); width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.feature h4 { margin-bottom: 4px; }
.feature p { color: var(--text-2); font-size: .9rem; margin: 0; }

/* ---- Shop cards ---- */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.shop-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; display: flex; flex-direction: column; gap: 10px; transition: box-shadow .15s, transform .15s; color: var(--text); }
.shop-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); text-decoration: none; }
.shop-logo { width: 52px; height: 52px; border-radius: 12px; background: var(--primary-light); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.3rem; overflow: hidden; flex-shrink: 0; }
.shop-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.shop-hero { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.shop-hero .shop-logo { width: 76px; height: 76px; font-size: 1.8rem; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.product-card { border: 1px solid var(--border); border-radius: 12px; padding: 16px; background: var(--surface); display: flex; flex-direction: column; gap: 6px; }
.product-card .price { font-weight: 700; color: var(--primary); }

/* ---- Order progress tracker ---- */
.tracker { display: flex; justify-content: space-between; position: relative; margin: 10px 0 6px; counter-reset: step; }
.tracker::before { content: ''; position: absolute; top: 15px; left: 6%; right: 6%; height: 3px; background: var(--border); z-index: 0; }
.tracker .fill { position: absolute; top: 15px; left: 6%; height: 3px; background: var(--success); z-index: 0; transition: width .3s; }
.tracker .step { position: relative; z-index: 1; flex: 1; text-align: center; font-size: .75rem; color: var(--muted); }
.tracker .dot { width: 32px; height: 32px; border-radius: 50%; background: var(--surface); border: 3px solid var(--border); margin: 0 auto 6px; display: flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; color: var(--muted); }
.tracker .step.done .dot { background: var(--success); border-color: var(--success); color: #fff; }
.tracker .step.current .dot { border-color: var(--primary); color: var(--primary); box-shadow: 0 0 0 4px var(--primary-light); }
.tracker .step.done, .tracker .step.current { color: var(--text); font-weight: 600; }
@media (max-width: 600px) { .tracker .step span { display: none; } .tracker .step.current span { display: block; position: absolute; width: 120px; left: 50%; transform: translateX(-50%); } }

/* ---- Timeline ---- */
.timeline { list-style: none; position: relative; padding-left: 22px; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.timeline li { position: relative; padding: 0 0 14px; font-size: .88rem; }
.timeline li::before { content: ''; position: absolute; left: -21px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--primary); }
.timeline .when { color: var(--muted); font-size: .76rem; }
.timeline li.private::before { border-color: var(--muted); }

/* ---- Chat ---- */
.chat { display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; padding: 4px; margin-bottom: 12px; }
.msg { max-width: 85%; padding: 10px 14px; border-radius: 14px; font-size: .9rem; background: var(--surface-2); white-space: pre-wrap; word-wrap: break-word; }
.msg.mine { align-self: flex-end; background: var(--primary-light); }
.msg .meta { font-size: .72rem; color: var(--muted); margin-bottom: 2px; white-space: normal; }

/* ---- Files / dropzone ---- */
.dropzone { border: 2px dashed var(--border); border-radius: 14px; padding: 26px 16px; text-align: center; background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.drag { border-color: var(--primary); background: var(--primary-light); }
.dropzone i { font-size: 2rem; color: var(--primary); margin-bottom: 8px; }
.dropzone input[type=file] { display: none; }
.file-list { list-style: none; margin-top: 10px; }
.file-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px; margin-bottom: 6px; background: var(--surface); font-size: .86rem; }
.file-list .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; width: 120px; }
.progress > div { height: 100%; width: 0; background: var(--primary); transition: width .2s; }
.file-row { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.file-row:last-child { border-bottom: 0; }
.file-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 800; flex-shrink: 0; text-transform: uppercase; }

/* ---- Price box ---- */
.pricebox { position: sticky; top: 84px; }
.price-lines { list-style: none; font-size: .9rem; }
.price-lines li { display: flex; justify-content: space-between; padding: 5px 0; color: var(--text-2); }
.price-lines li.total { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 10px; font-size: 1.2rem; font-weight: 800; color: var(--text); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: .9rem; }
.kv dt { color: var(--text-2); } .kv dd { font-weight: 500; word-break: break-word; }
@media (max-width: 520px) { .kv { grid-template-columns: 1fr; } .kv dt { margin-top: 6px; } }

/* ---- Auth ---- */
.auth-wrap { max-width: 440px; margin: 20px auto; }
.auth-wrap.wide { max-width: 640px; }
.auth-wrap .card { padding: 28px; }
.auth-wrap h1 { font-size: 1.5rem; margin-bottom: 6px; }
.auth-wrap .sub { color: var(--text-2); margin-bottom: 20px; }

/* ---- Empty ---- */
.empty { text-align: center; padding: 40px 16px; color: var(--text-2); }
.empty i { font-size: 2.4rem; color: var(--muted); margin-bottom: 10px; }
.empty h3 { margin-bottom: 6px; }

/* ---- Footer ---- */
footer.site { border-top: 1px solid var(--border); background: var(--surface); padding: 20px 0; font-size: .85rem; color: var(--text-2); }
footer.site .container { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
footer.site a { color: var(--text-2); margin-left: 14px; }

/* ---- Tabs ---- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs a { padding: 6px 12px; border-radius: 99px; font-size: .82rem; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); }
.tabs a.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.tabs a:hover { text-decoration: none; }
.tabs .count { opacity: .75; margin-left: 4px; }

/* ---- Bars chart ---- */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding-top: 10px; }
.bars .bar { flex: 1; background: var(--primary-light); border-radius: 6px 6px 0 0; position: relative; min-height: 3px; }
.bars .bar span { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-size: .68rem; color: var(--muted); white-space: nowrap; }
.bars .bar b { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: .68rem; color: var(--text-2); font-weight: 600; }

.qr-box { display: inline-block; padding: 10px; background: #fff; border: 1px solid var(--border); border-radius: 12px; }
.checklist { list-style: none; }
.checklist li { padding: 6px 0; display: flex; gap: 10px; align-items: center; font-size: .92rem; }
.checklist .fa-circle-check { color: var(--success); } .checklist .fa-circle { color: var(--border); }
details.box { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: var(--surface); margin-bottom: 10px; }
details.box summary { cursor: pointer; font-weight: 600; }
details.box[open] summary { margin-bottom: 12px; }
@media print { .topbar, .subnav, footer.site, .no-print { display: none !important; } body { background: #fff; } .card { box-shadow: none; } }
