/* Vape CRM — dark smoke theme. No build step: this file is served as-is. */
:root {
  --bg: #0B0C10; --panel: rgba(20, 22, 29, .7); --panel-solid: #14161D; --sidebar: rgba(17, 18, 24, .82);
  --line: #232634; --line-2: #2E3245; --field: #0B0C10;
  --text: #ECEDF3; --text-2: #C4C7D4; --muted: #9A9FB2; --faint: #8A8FA3;
  --accent: #C8F750; --accent-ink: #0B0C10; --accent-soft: rgba(200, 247, 80, .12);
  --violet: #9D7BFF; --violet-soft: #231D3D; --violet-text: #C9B8FF;
  --cyan: #5CE1E6; --cyan-soft: #13292B; --cyan-text: #9FF0F3;
  --orange: #FF9F5A; --orange-soft: #2E1F14; --orange-text: #FFB784;
  --red-soft: #3A1A1E; --red-text: #FF9AA6; --green-soft: #26301A; --green-text: #C8F750;
  --radius: 18px; --font: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Space Grotesk", Inter, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--display); margin: 0; }
h1 { font-size: 28px; } h2 { font-size: 18px; } h3 { font-size: 15px; }
img { max-width: 100%; }

/* ---------- smoke background ---------- */
.smoke { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; contain: strict; }
/* Big soft colour glows: a radial gradient instead of filter: blur() — looks the same, costs almost nothing. */
.smoke .blob { position: absolute; border-radius: 50%; will-change: transform; animation: drift 40s ease-in-out infinite alternate; }
.smoke .b1 { width: 1000px; height: 800px; top: -330px; left: 8%; opacity: .34; background: radial-gradient(closest-side, var(--blob1, var(--violet)), transparent); }
.smoke .b3 { width: 860px; height: 860px; bottom: -360px; left: -260px; opacity: .22; background: radial-gradient(closest-side, var(--blob2, var(--cyan)), transparent); animation-duration: 54s; animation-delay: -20s; }
/* Rising smoke (public/js/smoke.js) — drawn small, stretched by CSS. */
.smoke canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .9; }
@keyframes drift { 0% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(140px, 90px, 0) scale(1.15); } 100% { transform: translate3d(-90px, 170px, 0) scale(.94); } }
.smoke-paused .smoke .blob { animation-play-state: paused; }

/* ---------- app shell ---------- */
.app { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-wrap: wrap; }
.sidebar { flex: 1 1 240px; max-width: 262px; min-width: 220px; background: var(--sidebar); 
  border-right: 1px solid #1F2230; padding: 22px 14px; display: flex; flex-direction: column; gap: 2px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 20px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); display: flex;
  align-items: center; justify-content: center; font-family: var(--display); font-weight: 700; overflow: hidden; flex-shrink: 0; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand-mark.has-logo { background: transparent; }
.brand-mark.has-logo img { object-fit: contain; }
.brand-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.2; word-break: break-word; }
.brand b { display: block; font-family: var(--display); font-size: 16px; }
.brand small { display: block; font-size: 12px; color: var(--muted); }
.nav-sec { font-size: 11px; font-weight: 600; letter-spacing: 1.2px; color: var(--faint); padding: 14px 12px 6px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--text-2); font-size: 14px; }
.nav a:hover { background: rgba(255, 255, 255, .04); text-decoration: none; }
.nav a.active { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.nav svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-foot { margin-top: auto; padding-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.powered { font-size: 11px; color: var(--faint); text-align: center; }
.main { flex: 999 1 560px; min-width: 0; padding: 26px 30px 48px; display: flex; flex-direction: column; gap: 22px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.page-head .sub { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- building blocks ---------- */
.card { background: var(--panel);  border: 1px solid var(--line); border-radius: 22px; padding: 22px;
  display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(var(--min, 300px), 100%), 1fr)); }
.grid-2 { --min: 340px; } .grid-3 { --min: 260px; } .grid-4 { --min: 200px; }
.split { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-start; }
.split > .wide { flex: 999 1 520px; min-width: 0; }
.split > .side { flex: 1 1 320px; max-width: 440px; min-width: 0; }
.kpi { background: var(--panel);  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
  display: flex; flex-direction: column; gap: 6px; }
.kpi .label { font-size: 13px; color: var(--muted); }
.kpi .value { font-family: var(--display); font-size: 25px; font-weight: 700; }
.kpi .hint { font-size: 12px; color: var(--muted); }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12px; }
.t-accent { color: var(--accent); } .t-violet { color: var(--violet-text); } .t-orange { color: var(--orange-text); }
.t-red { color: var(--red-text); } .t-cyan { color: var(--cyan-text); } .right { text-align: right; } .nowrap { white-space: nowrap; }
.row { display: flex; align-items: center; gap: 10px; } .row.between { justify-content: space-between; } .wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.big { font-family: var(--display); font-size: 30px; font-weight: 700; }
.divider { border-top: 1px dashed var(--line-2); }

/* ---------- buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px;
  border: 1px solid #3A3F55; background: transparent; color: var(--text); font: 600 14px var(--font); cursor: pointer; text-decoration: none; }
.btn:hover { text-decoration: none; border-color: #555B78; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.btn-primary:hover { filter: brightness(1.06); border-color: var(--accent); }
.btn-violet { background: var(--violet); color: #0B0C10; border-color: var(--violet); font-weight: 700; }
.btn-orange { background: var(--orange); color: #0B0C10; border-color: var(--orange); font-weight: 700; }
.btn-danger { border-color: #6B2A33; color: var(--red-text); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 12px; border-radius: 9px; }
.btn-block { width: 100%; min-height: 52px; font-family: var(--display); font-size: 15px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--field); color: var(--text); font: 500 14px var(--font); }
textarea.input { padding: 10px 12px; min-height: 80px; resize: vertical; }
.input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.input[readonly] { background: #191B24; color: var(--muted); }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font-size: 14px; color: var(--text); }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.error { font-size: 12px; color: var(--red-text); }
details.drawer > summary { list-style: none; cursor: pointer; }
details.drawer > summary::-webkit-details-marker { display: none; }
details.drawer[open] > summary { margin-bottom: 14px; }

/* chips / segmented choices */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 99px; border: 1px solid var(--line-2);
  color: var(--text-2); font-weight: 600; font-size: 13px; }
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip input:checked + span { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 4px; }
.search-box { display: flex; align-items: center; gap: 8px; background: var(--panel-solid); border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; min-height: 48px; }
.search-box:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.search-box .input { border: 0; background: transparent; outline: none; padding: 0; }
.chip.violet input:checked + span { background: var(--violet-soft); border-color: var(--violet); color: #E4DAFF; }

/* ---------- tables, badges ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { padding: 10px 8px; font-size: 12px; font-weight: 600; color: var(--muted); text-align: left; text-transform: uppercase; letter-spacing: .3px; white-space: nowrap; }
.table td { padding: 12px 8px; border-top: 1px solid #1F2230; vertical-align: middle; }
.table tr:hover td { background: rgba(255, 255, 255, .02); }
.badge { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.b-ok { background: var(--green-soft); color: var(--green-text); }
.b-warn { background: #3A2614; color: var(--orange-text); }
.b-bad { background: var(--red-soft); color: var(--red-text); }
.b-info { background: var(--cyan-soft); color: var(--cyan-text); }
.b-violet { background: var(--violet-soft); color: var(--violet-text); }
.b-gray { background: #1E2029; color: var(--text-2); }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700;
  font-size: 13px; background: var(--violet-soft); color: var(--violet-text); flex-shrink: 0; }
.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.bar.warn > i { background: var(--orange); }
.chart { height: 200px; display: flex; align-items: flex-end; gap: 4px; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.chart .col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; }
.chart .s { background: var(--accent); border-radius: 0 0 2px 2px; } .chart .r { background: var(--violet); border-radius: 4px 4px 0 0; }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.pagination { display: flex; gap: 6px; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 36px; min-height: 36px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; border: 1px solid var(--line-2); color: var(--text-2); font-size: 13px; }
.pagination .active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* ---------- flash ---------- */
.flash { padding: 12px 16px; border-radius: 14px; font-size: 14px; border: 1px solid; }
.flash-ok { background: var(--green-soft); border-color: #3F5220; color: #D7F58C; }
.flash-error { background: var(--red-soft); border-color: #6B2A33; color: #FFC2CA; }
.flash-info { background: #1A1730; border-color: #3A2F70; color: #D9CCFF; }

/* ---------- POS ---------- */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 12px; }
.product-tile { text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 12px; color: var(--text);
  display: flex; flex-direction: column; gap: 8px; cursor: pointer; font-family: var(--font); }
.product-tile:hover { border-color: var(--accent); }
.product-tile .pic { height: 72px; border-radius: 10px; background: var(--green-soft); display: flex; align-items: center; justify-content: center; color: var(--accent); }
.product-tile .price { font-family: var(--display); font-weight: 700; font-size: 16px; color: var(--accent); }
.cart-line { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; }
.qty { display: flex; align-items: center; gap: 4px; background: var(--field); border-radius: 10px; padding: 2px; }
.qty button { width: 32px; height: 32px; border: 0; border-radius: 8px; background: #191B24; color: var(--text); font-size: 16px; cursor: pointer; }
.qty input { width: 46px; text-align: center; background: transparent; border: 0; color: var(--text); font-weight: 600; }

/* ---------- auth pages ---------- */
.auth { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 64px; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 440px; background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: 28px; padding: 32px;
  display: flex; flex-direction: column; gap: 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
.url-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line-2); font-size: 13px; color: var(--text-2); }

/* ---------- receipt (80mm) ---------- */
.receipt { width: 302px; background: #FAFAF7; color: #151515; padding: 18px 16px 24px; font: 12px/1.5 "Courier New", ui-monospace, monospace; }
.receipt .c { text-align: center; } .receipt .b { font-weight: 700; }
.receipt .ln { display: flex; justify-content: space-between; gap: 8px; }
.receipt hr { border: 0; border-top: 1px dashed #777; margin: 8px 0; }
.receipt img { max-height: 64px; max-width: 70%; object-fit: contain; display: block; margin: 0 auto 8px; }
@media print {
  @page { size: 80mm auto; margin: 0; }
  body { background: #fff; } .no-print { display: none !important; }
  .receipt { width: 80mm; padding: 4mm; }
}

/* ---------- landing ---------- */
.landing { position: relative; z-index: 1; max-width: 1120px; margin: 0 auto; padding: 32px 20px 80px; display: flex; flex-direction: column; gap: 56px; }
.landing .hero { display: flex; flex-direction: column; gap: 18px; max-width: 760px; padding-top: 40px; }
.landing .hero h1 { font-size: clamp(36px, 6vw, 60px); line-height: 1.05; }

@media (max-width: 720px) {
  .main { padding: 20px 16px 40px; }
  .sidebar { max-width: none; flex-basis: 100%; padding: 14px 12px 8px; border-right: 0; border-bottom: 1px solid #1F2230; position: sticky; top: 0; z-index: 5; }
  .brand { padding-bottom: 10px; }
  .nav { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
  .nav-sec { display: none; }
  .nav a { white-space: nowrap; flex-shrink: 0; }
  .sidebar-foot { position: absolute; top: 14px; right: 12px; padding: 0; }
  .sidebar-foot .avatar, .sidebar-foot .row > div, .powered { display: none; }
  h1 { font-size: 24px; }
  .split > .side { max-width: none; }
}

.profit-box { gap: 4px; padding: 14px; border-radius: 16px; background: color-mix(in srgb, var(--accent) 12%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.profit-box > span:first-child { color: var(--accent); font-weight: 600; }

/* ---------- scrollbars ---------- */
html { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--accent) 55%, var(--line-2)) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--accent) 40%, var(--line-2)); border-radius: 99px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }
::-webkit-scrollbar-corner { background: transparent; }
.nav::-webkit-scrollbar { height: 4px; }

/* ---------- branding page ---------- */
.theme-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.theme-card { position: relative; display: flex; flex-direction: column; gap: 6px; cursor: pointer; font-size: 13px; }
.theme-card input { position: absolute; opacity: 0; }
.theme-swatch { height: 64px; border-radius: 14px; border: 2px solid var(--line-2); position: relative; overflow: hidden; }
.theme-swatch i { position: absolute; left: 10px; bottom: 10px; width: 46%; height: 18px; border-radius: 6px; border: 1px solid; }
.theme-card input:checked + .theme-swatch { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.theme-card input:focus-visible + .theme-swatch { outline: 2px solid var(--accent); outline-offset: 2px; }
.preview-sidebar .pv-active { padding: 10px 12px; border-radius: 10px; background: var(--pv-accent); color: var(--pv-ink); font-weight: 600; }
.preview-sidebar .pv-item { padding: 0 12px; color: var(--text-2); }
#brandPreview .brand-mark { background: var(--pv-accent); color: var(--pv-ink); }

/* ---------- print (reports, bills, lists) ---------- */
.print-head { display: none; }
@media print {
  @page { size: A4; margin: 12mm; }
  :root { --text: #111318; --text-2: #2B2F3A; --muted: #555B6B; --faint: #6B7080; --line: #DADDE5; --line-2: #C9CDD8;
    --panel: #FFFFFF; --panel-solid: #FFFFFF; --field: #FFFFFF; --green-soft: #F1F7E6; --red-soft: #FDECEE; --violet-soft: #F1ECFF; --cyan-soft: #E7F7F8; }
  html, body { background: #fff !important; color: #111318; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .smoke, .sidebar, .flash, .no-print, .page-head .actions, .page-head form, .pagination, details.drawer, form .btn, .btn, .chips, .search-box { display: none !important; }
  .app { display: block; }
  .main { padding: 0; gap: 14px; }
  .print-head { display: flex !important; align-items: center; gap: 14px; padding-bottom: 12px; margin-bottom: 4px; border-bottom: 3px solid var(--accent-print); }
  .print-logo img { height: 54px; max-width: 120px; object-fit: contain; display: block; }
  .print-logo i { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-style: normal; font-weight: 700;
    background: var(--accent); color: var(--accent-ink); font-family: var(--display); }
  .print-shop { flex: 1; display: flex; flex-direction: column; } .print-shop b { font: 700 20px var(--display); } .print-shop span, .print-meta span { font-size: 11px; color: #555B6B; }
  .print-meta { display: flex; flex-direction: column; align-items: flex-end; } .print-meta b { font: 700 15px var(--display); color: var(--accent-print); }
  .page-head .sub { display: none; }
  h1 { font-size: 20px; color: #111318; } h2 { font-size: 15px; color: #111318; }
  .card, .kpi { background: #fff !important; backdrop-filter: none !important; border: 1px solid #DADDE5 !important; box-shadow: none !important; border-radius: 12px; padding: 14px; break-inside: avoid; }
  .kpi .value, .big { color: #111318; }
  .t-accent { color: var(--accent-print) !important; } .t-violet { color: #5B3FD1 !important; } .t-orange { color: #B4530F !important; }
  .t-red { color: #B42318 !important; } .t-cyan { color: #0E7490 !important; }
  .profit-box { background: color-mix(in srgb, var(--accent) 18%, #fff) !important; border-color: var(--accent-print) !important; }
  .profit-box > span:first-child { color: var(--accent-print) !important; }
  .table th { color: #555B6B; border-bottom: 2px solid var(--accent-print); } .table td { border-top: 1px solid #E5E7EE; color: #111318; }
  .table tr:hover td { background: none; }
  .bar { background: #EEF0F4; } .bar > i { background: var(--accent-print) !important; }
  .badge { border: 1px solid currentColor; background: transparent !important; }
  a { color: inherit; text-decoration: none; }
  .split { display: block; } .split > * { max-width: none !important; margin-bottom: 14px; }
  .receipt img { filter: grayscale(1) contrast(1.2); }
}

/* ---------- small screens ---------- */
@media (max-width: 720px) {
  .page-head .input, .actions .input, .search-box { max-width: 100%; }
  .page-head form.actions, .page-head .actions { width: 100%; }
  .page-head form.actions .input, .page-head form.row .input { flex: 1 1 140px; width: auto !important; }
  .card-head .row { flex-wrap: wrap; max-width: 100%; }
  .card-head .row .input, .card-head .input { flex: 1 1 150px; width: auto !important; min-width: 0; }
  .card { padding: 16px; border-radius: 18px; }
  .kpi .value { font-size: 21px; }
  .big { font-size: 24px; }
  .auth { gap: 28px; padding: 24px 16px; }
  .auth-card { padding: 22px; }
}
