:root {
  --orange: #f08a3c;
  --orange-600: #e0782a;
  --orange-50: #fff4ea;
  --orange-100: #ffe6d1;
  --bg: #fffaf6;
  --surface: #ffffff;
  --text: #2b2420;
  --muted: #8a7e76;
  --line: #f0e6de;
  --ok: #3f9d6b;
  --ok-50: #eaf6ef;
  --danger: #d65745;
  --danger-50: #fdeeec;
  --blue: #5b8def;
  --blue-50: #edf3fe;
  --gray-50: #f3f0ee;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(80, 50, 20, .04), 0 6px 24px rgba(80, 50, 20, .06);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--orange-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 26px; }
h2 { font-size: 17px; }
h3 { font-size: 16px; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.block { display: block; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 10px;
  padding: 9px 16px; font: inherit; font-weight: 600; font-size: 14px;
  cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s;
  white-space: nowrap; text-decoration: none !important;
}
.btn-primary { background: var(--orange); color: #fff; box-shadow: 0 4px 14px rgba(240, 138, 60, .28); }
.btn-primary:hover { background: var(--orange-600); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--orange-100); background: var(--orange-50); }
.btn-danger { background: var(--danger-50); color: var(--danger); }
.btn-danger:hover { background: #fbdcd7; }
.btn-lg { padding: 12px 22px; font-size: 15px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.pill { display: inline-block; background: var(--orange-50); color: var(--orange-600); font-weight: 600; font-size: 12px; padding: 4px 10px; border-radius: 999px; margin-bottom: 14px; }

.logo { display: inline-flex; align-items: center; gap: 8px; font-size: 19px; color: var(--text); font-weight: 500; }
.logo b { font-weight: 700; color: var(--orange); }
.brand:hover { text-decoration: none; }

/* Site */
.topbar { position: sticky; top: 0; z-index: 10; background: rgba(255, 250, 246, .85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.topnav { display: flex; align-items: center; gap: 18px; }
.topnav > a:not(.btn) { color: var(--text); font-weight: 500; font-size: 14px; }

.hero { padding: 72px 0 56px; background: radial-gradient(900px 400px at 85% 0%, var(--orange-50), transparent 70%); }
.hero-in { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero h1 { font-size: 44px; font-weight: 700; }
.accent { color: var(--orange); }
.lead { font-size: 17px; color: #5b514a; max-width: 540px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 26px 0 14px; }

.hero-card { padding: 18px; }
.mock-head { display: flex; align-items: center; gap: 6px; margin-bottom: 18px; }
.mock-head span { width: 10px; height: 10px; border-radius: 50%; background: var(--orange-100); }
.mock-head em { margin-left: auto; font-style: normal; font-size: 12px; color: var(--muted); }
.mock-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mock-stats div { background: var(--orange-50); border-radius: 10px; padding: 12px; }
.mock-stats small { display: block; color: var(--muted); font-size: 12px; }
.mock-stats b { font-size: 20px; }
.mock-bars { display: flex; align-items: flex-end; gap: 10px; height: 140px; margin-top: 18px; padding: 0 4px; }
.mock-bars i { flex: 1; background: linear-gradient(var(--orange), #f6b27c); border-radius: 8px 8px 3px 3px; }

.section { padding: 64px 0; }
.section-soft { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-title { text-align: center; font-size: 28px; margin-bottom: 32px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.feature p { color: var(--muted); font-size: 14px; margin: 0; }
.ficon { width: 42px; height: 42px; display: grid; place-items: center; font-size: 20px; background: var(--orange-50); border-radius: 12px; margin-bottom: 14px; }

.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 340px)); gap: 20px; justify-content: center; }
.plan { position: relative; }
.plan-hot { border-color: var(--orange-100); box-shadow: 0 10px 40px rgba(240, 138, 60, .15); }
.price { font-size: 30px; font-weight: 700; margin: 4px 0 14px; }
.price small { font-size: 13px; color: var(--muted); font-weight: 400; }
.plan ul { list-style: none; padding: 0; margin: 0 0 22px; }
.plan li { padding: 6px 0 6px 24px; position: relative; font-size: 14px; }
.plan li::before { content: '✓'; position: absolute; left: 0; color: var(--orange); font-weight: 700; }
.footer { padding: 28px 0; color: var(--muted); font-size: 13px; text-align: center; }

/* Auth */
.auth { background: radial-gradient(700px 360px at 50% -10%, var(--orange-50), transparent 70%), var(--bg); }
.auth-wrap { max-width: 440px; margin: 0 auto; padding: 48px 20px; }
.auth-brand { display: block; text-align: center; margin-bottom: 22px; }
.auth-card { padding: 30px; }
.auth-card h1 { font-size: 24px; margin-bottom: 4px; }

/* Forms */
.form { display: grid; gap: 16px; margin: 20px 0; }
.form label { display: grid; gap: 6px; align-content: start; font-size: 13px; font-weight: 600; color: #4a403a; }
.form small { font-weight: 400; }
input, select, textarea {
  width: 100%; font: inherit; font-size: 14px; color: var(--text);
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(240, 138, 60, .15); }
textarea { resize: vertical; }
.slug-input { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: #fff; overflow: hidden; }
.slug-input:focus-within { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(240, 138, 60, .15); }
.slug-input input { border: 0; box-shadow: none !important; }
.slug-input span { padding: 0 12px; color: var(--muted); font-weight: 500; background: var(--orange-50); align-self: stretch; display: flex; align-items: center; }
.err { color: var(--danger); font-weight: 500; font-size: 12px; }
.alert { background: var(--danger-50); color: var(--danger); border-radius: 10px; padding: 10px 14px; font-size: 14px; margin-bottom: 14px; }
.alert-ok { background: var(--ok-50); color: var(--ok); }

/* App */
.app-layout { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: 22px 16px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; }
.shop-chip { background: var(--orange-50); border-radius: 12px; padding: 10px 12px; }
.shop-chip b { display: block; font-size: 14px; }
.shop-chip small { color: var(--orange-600); font-size: 12px; word-break: break-all; }
.sidebar nav { display: grid; gap: 4px; }
.sidebar nav a { color: #4a403a; padding: 9px 12px; border-radius: 10px; font-weight: 500; font-size: 14px; }
.sidebar nav a:hover { background: var(--gray-50); text-decoration: none; }
.sidebar nav a.on { background: var(--orange); color: #fff; }
.sidebar-foot { margin-top: auto; display: grid; gap: 10px; }
.me b { display: block; font-size: 14px; }
.me small { color: var(--muted); font-size: 12px; word-break: break-all; }
.sidebar-foot form { margin: 0; }

.app-main { padding: 30px 34px; max-width: 1180px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 2px 0 2px; }
.page-head p { margin: 0; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.stat small { color: var(--muted); display: block; font-size: 13px; }
.stat b { font-size: 26px; font-weight: 700; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 18px 20px; }
.stat-hero { background: linear-gradient(135deg, var(--orange), #f6a868); color: #fff; border-color: transparent; }
.stat-hero small, .stat-hero .small { color: rgba(255, 255, 255, .88); }
.delta { font-size: 12px; font-weight: 600; }
.stat-hero .delta { color: #fff; }
.delta.down { opacity: .85; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.bar-row { display: grid; grid-template-columns: 112px 1fr 40px; gap: 12px; align-items: center; margin: 12px 0; font-size: 14px; }
.bar-row b { text-align: right; }
.bar { height: 10px; background: var(--gray-50); border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; }

.recent { list-style: none; margin: 0; padding: 0; }
.recent li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.recent li:last-child { border-bottom: 0; }
.recent a { color: var(--text); display: grid; }
.recent small { color: var(--muted); font-size: 12px; }

.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.tag.st-lead, .bar i.st-lead { background: var(--orange-50); color: var(--orange-600); }
.bar i.st-lead { background: var(--orange); }
.tag.st-contacted { background: var(--blue-50); color: var(--blue); }
.bar i.st-contacted { background: var(--blue); }
.tag.st-won { background: var(--ok-50); color: var(--ok); }
.bar i.st-won { background: var(--ok); }
.tag.st-lost { background: var(--gray-50); color: var(--muted); }
.bar i.st-lost { background: #c9beb6; }

.filters { display: flex; gap: 10px; padding: 14px; margin-bottom: 16px; }
.filters input { flex: 1; }
.filters select { width: 200px; }
.table-card { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 14px 18px; border-bottom: 1px solid var(--line); background: #fffcfa; }
.table td { padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fffaf6; }
.num { text-align: right; white-space: nowrap; }
.actions { text-align: right; }
.empty { text-align: center; padding: 40px 20px; }

.form-card { max-width: 760px; }
.form-grid { grid-template-columns: 1fr 1fr; margin: 0; }
.span2 { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; }
.danger-zone { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 18px; }

@media (max-width: 960px) {
  .hero-in, .grid2 { grid-template-columns: 1fr; }
  .grid4, .stats { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 34px; }
}
@media (max-width: 720px) {
  .topnav > a:not(.btn) { display: none; }
  .topnav { gap: 8px; }
  .topnav .btn { padding: 7px 12px; font-size: 13px; }
  .app-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px 16px; gap: 10px; }
  .sidebar .shop-chip, .sidebar-foot .me, .sidebar-foot a { display: none; }
  .sidebar nav { display: flex; order: 3; width: 100%; }
  .sidebar-foot { margin: 0 0 0 auto; }
  .app-main { padding: 20px 16px; }
  .plans, .form-grid { grid-template-columns: 1fr; }
  .filters { flex-wrap: wrap; }
  .filters select { width: 100%; }
}
@media (max-width: 480px) {
  .grid4, .stats { grid-template-columns: 1fr; }
  .hero { padding: 44px 0 36px; }
  .hero h1 { font-size: 28px; }
  .topnav .btn-ghost { display: none; }
}

/* ===== Cửa hàng ===== */
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-main { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; margin-bottom: 16px; }
.grid2 { margin-bottom: 16px; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.card-head h2 { margin: 0; }
.pad { padding: 18px; }
.pad-h { padding: 18px 18px 4px; }
.mt { margin-top: 18px; }
.big { font-size: 24px; font-weight: 700; margin: 0; }
.strike { text-decoration: line-through; }
.text-ok { color: var(--ok); }
.text-danger { color: var(--danger); }
.empty-sm { color: var(--muted); padding: 22px 0; text-align: center; font-size: 14px; }
.stack { display: grid; gap: 16px; align-content: start; }
.split { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.split-wide { grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); }
.split .form-card { max-width: none; }

/* Sidebar có icon */
.sidebar nav a { display: flex; align-items: center; gap: 10px; }
.sidebar nav a svg { flex: none; opacity: .8; }
.sidebar nav a.on svg { opacity: 1; }

/* Thiết lập ban đầu */
.setup { margin-bottom: 18px; background: linear-gradient(120deg, #fff, var(--orange-50)); }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.checklist li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.checklist li.done { color: var(--muted); text-decoration: line-through; }
.check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--orange-100); display: grid; place-items: center; font-size: 12px; color: #fff; flex: none; }
.done .check { background: var(--ok); border-color: var(--ok); }

/* Biểu đồ */
.chart { display: flex; align-items: flex-end; gap: 6px; height: calc(var(--h) + 36px); padding-top: 18px; }
.chart-col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.chart-col i { width: 100%; max-width: 38px; background: linear-gradient(var(--orange), #f7bb8a); border-radius: 7px 7px 3px 3px; transition: opacity .15s; }
.chart-col:hover i { opacity: .8; }
.chart-col small { font-size: 11px; color: var(--muted); height: 14px; white-space: nowrap; }
.chart-val { font-size: 10px; color: var(--muted); white-space: nowrap; opacity: 0; transition: opacity .15s; }
.chart-col:hover .chart-val { opacity: 1; }
.hours { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; margin-top: 10px; }
.hours i { height: 34px; background: var(--orange); border-radius: 4px; }
.hours-label { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 6px; }
.bar i.st-pay-cash { background: var(--orange); }
.bar i.st-pay-transfer { background: var(--blue); }
.bar i.st-pay-card { background: var(--ok); }

.rank { list-style: none; padding: 0; margin: 0; }
.rank li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.rank li:last-child { border-bottom: 0; }
.rank-n { width: 24px; height: 24px; border-radius: 8px; background: var(--orange-50); color: var(--orange-600); font-weight: 700; font-size: 12px; display: grid; place-items: center; flex: none; }
.rank-name { flex: 1; min-width: 0; }

/* Chip lọc */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { border: 1px solid var(--line); background: #fff; color: #4a403a; border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.chip:hover { border-color: var(--orange-100); background: var(--orange-50); text-decoration: none; }
.chip.on { background: var(--orange); border-color: var(--orange); color: #fff; }
.chip b { background: var(--danger); color: #fff; border-radius: 999px; padding: 0 6px; font-size: 11px; margin-left: 4px; }

/* Bảng */
.row-link { cursor: pointer; }
.row-muted td { opacity: .55; }
.prod-cell { display: flex; align-items: center; gap: 12px; }
.avatar { width: 38px; height: 38px; border-radius: 10px; background: var(--orange-50); color: var(--orange-600); font-weight: 700; display: grid; place-items: center; flex: none; }
.tag.stock-ok { background: var(--ok-50); color: var(--ok); }
.tag.stock-low { background: #fff4dc; color: #b7791f; }
.tag.stock-out { background: var(--danger-50); color: var(--danger); }
.totals { border-top: 1px solid var(--line); padding: 14px 18px; display: grid; gap: 6px; max-width: 380px; margin-left: auto; font-size: 14px; }
.totals div { display: flex; justify-content: space-between; gap: 20px; }
.totals .grand { font-size: 17px; padding: 6px 0; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); }
.totals .grand b { color: var(--orange-600); }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 10px; }
.mini-stats div { background: var(--orange-50); border-radius: 10px; padding: 10px 12px; }
.mini-stats small { display: block; color: var(--muted); font-size: 12px; }

/* Form phụ */
.input-btn { display: flex; gap: 8px; }
.input-btn input { flex: 1; }
.check-row { display: flex !important; align-items: center; gap: 10px; font-weight: 500 !important; }
.check-row input { width: 18px; height: 18px; accent-color: var(--orange); flex: none; }
.form-grid.nested { margin: 0; padding: 14px; background: var(--orange-50); border-radius: 12px; }
.form-grid.nested[hidden] { display: none; }
.stock-big { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 4px; }
.stock-big b { font-size: 34px; }
.stock-form { gap: 12px; }
.seg { display: inline-flex; background: var(--gray-50); border-radius: 10px; padding: 3px; gap: 2px; width: 100%; }
.seg label { flex: 1; margin: 0; display: block !important; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; padding: 8px 6px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg input:checked + span { background: #fff; color: var(--orange-600); box-shadow: 0 1px 4px rgba(80, 50, 20, .1); }
.seg input:focus-visible + span { outline: 2px solid var(--orange); }
.moves li { font-size: 14px; }

/* ===== Màn hình bán hàng ===== */
.app-wide .app-main { max-width: none; padding: 18px 20px; }
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 18px; height: calc(100vh - 36px); }
.pos-left { display: flex; flex-direction: column; min-height: 0; }
.pos-search .chips { margin: 12px 0 0; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
.search-box { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; box-shadow: var(--shadow); }
.search-box:focus-within { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(240, 138, 60, .15); }
.search-box svg { color: var(--muted); flex: none; }
.search-box input { border: 0; box-shadow: none !important; padding: 13px 0; font-size: 15px; }
.pos-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; align-content: start; padding: 14px 2px 20px; }
.pcard { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; font: inherit; cursor: pointer; transition: transform .08s, border-color .15s, box-shadow .15s; }
.pcard:hover { border-color: var(--orange-100); box-shadow: var(--shadow); }
.pcard:active { transform: scale(.97); }
.pcard.incart { border-color: var(--orange); background: var(--orange-50); }
.pcard.out { opacity: .5; }
.pcard-av { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-weight: 700; color: hsl(var(--h) 55% 38%); background: hsl(var(--h) 80% 94%); flex: none; margin-bottom: 4px; }
.pcard-name { font-weight: 600; font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.pcard-price { color: var(--orange-600); font-weight: 700; }
.pcard-stock { font-size: 12px; color: var(--muted); }
.pcard-qty { position: absolute; top: 8px; right: 8px; background: var(--orange); color: #fff; font-weight: 700; font-size: 12px; min-width: 24px; height: 24px; border-radius: 12px; display: grid; place-items: center; padding: 0 6px; }
.pos-empty { grid-column: 1 / -1; text-align: center; padding: 50px 20px; }
.pos-more { grid-column: 1 / -1; text-align: center; }

.pos-right { display: flex; flex-direction: column; padding: 0; min-height: 0; overflow: hidden; }
.pos-cust { padding: 14px; border-bottom: 1px solid var(--line); }
.cust-search { position: relative; }
.cust-chip { display: flex; align-items: center; gap: 10px; background: var(--orange-50); border-radius: 12px; padding: 8px 10px; }
.cust-chip .pcard-av { width: 34px; height: 34px; margin: 0; }
.cust-chip > span:nth-child(2) { flex: 1; min-width: 0; font-size: 14px; }
.dropdown { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(80, 50, 20, .14); z-index: 20; max-height: 360px; overflow-y: auto; }
.dropdown > button { display: grid; width: 100%; text-align: left; border: 0; background: none; padding: 10px 14px; font: inherit; font-size: 14px; cursor: pointer; border-bottom: 1px solid var(--line); }
.dropdown > button:hover { background: var(--orange-50); }
.dropdown small { color: var(--muted); font-size: 12px; }
.quick-cust { display: grid; gap: 8px; padding: 12px 14px; background: #fffcfa; }
.icon-btn { border: 0; background: none; color: var(--muted); font-size: 20px; line-height: 1; width: 28px; height: 28px; border-radius: 8px; cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--danger-50); color: var(--danger); }

.cart { flex: 1; overflow-y: auto; padding: 6px 14px; }
.cart-empty { text-align: center; padding: 40px 10px; color: var(--muted); }
.cart-empty-ic { font-size: 34px; opacity: .6; }
.cart-empty p { margin: 6px 0 2px; color: var(--text); font-weight: 600; }
.cart-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'info del' 'step total'; gap: 6px 10px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: center; }
.cart-line.flash { animation: flash .6s; }
@keyframes flash { from { background: var(--orange-50); } to { background: transparent; } }
.cl-info { grid-area: info; min-width: 0; display: grid; font-size: 14px; }
.cl-info small { font-size: 12px; }
.cart-line .icon-btn { grid-area: del; }
.cl-total { grid-area: total; text-align: right; }
.stepper { grid-area: step; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; width: max-content; }
.stepper button { border: 0; background: var(--gray-50); width: 32px; height: 32px; font-size: 16px; cursor: pointer; color: var(--text); }
.stepper button:hover { background: var(--orange-100); }
.stepper input { width: 52px; border: 0; border-radius: 0; text-align: center; padding: 4px; box-shadow: none !important; font-weight: 600; }

.pos-pay { border-top: 1px solid var(--line); padding: 14px; display: grid; gap: 9px; background: #fffcfa; }
.pay-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; }
.pay-row input { width: 150px; text-align: right; padding: 7px 10px; }
.pay-total { font-size: 18px; padding: 6px 0; border-top: 1px dashed var(--line); }
.pay-total b { color: var(--orange-600); font-size: 22px; }
.pay-row.change b { color: var(--ok); font-size: 16px; }
.disc { display: flex; }
.disc input { width: 110px; border-radius: 10px 0 0 10px; }
.disc-t { border: 1px solid var(--line); border-left: 0; background: var(--gray-50); border-radius: 0 10px 10px 0; width: 38px; font: inherit; font-weight: 700; cursor: pointer; }
.seg-sm span { padding: 7px 4px; }
.quick-cash { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.quick-cash button { border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 7px 2px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.quick-cash button:hover { border-color: var(--orange); color: var(--orange-600); }
.pay-note summary { font-size: 13px; color: var(--muted); cursor: pointer; }
.pay-note input { margin-top: 6px; }
.btn-pay { padding: 15px; font-size: 16px; justify-content: space-between; }
.btn-pay small, .modal-actions small { font-size: 11px; opacity: .75; background: rgba(255, 255, 255, .22); border-radius: 5px; padding: 1px 6px; }
.btn-pay:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn-link { border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; padding: 2px; }
.btn-link:hover { color: var(--danger); }

.modal { position: fixed; inset: 0; background: rgba(43, 36, 32, .35); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal[hidden] { display: none; }
.modal-box { width: 100%; max-width: 400px; text-align: center; padding: 30px; }
.done-ic { width: 58px; height: 58px; border-radius: 50%; background: var(--ok-50); color: var(--ok); font-size: 30px; font-weight: 700; display: grid; place-items: center; margin: 0 auto 12px; }
.done-change { background: var(--orange-50); border-radius: 12px; padding: 12px; margin: 10px 0 16px; }
.done-change small { display: block; color: var(--muted); }
.done-change b { font-size: 28px; color: var(--orange-600); }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0 12px; }
.modal-actions .btn-ghost small { background: var(--gray-50); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--text); color: #fff; padding: 11px 18px; border-radius: 12px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60; max-width: calc(100vw - 32px); box-shadow: 0 10px 30px rgba(0, 0, 0, .2); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-err { background: var(--danger); }

/* ===== Hoá đơn in ===== */
.receipt-page { background: #f3f0ee; }
.receipt-bar { display: flex; gap: 10px; justify-content: center; padding: 16px; }
.receipt { width: 300px; margin: 0 auto 30px; background: #fff; padding: 18px 16px; font-family: 'Be Vietnam Pro', sans-serif; font-size: 12px; line-height: 1.45; color: #000; box-shadow: var(--shadow); }
.r-center { text-align: center; }
.r-shop { font-size: 15px; }
.r-title { text-align: center; font-weight: 700; font-size: 13px; margin: 10px 0 6px; letter-spacing: .04em; }
.r-meta { display: flex; justify-content: space-between; border-bottom: 1px dashed #000; padding-bottom: 6px; margin-bottom: 6px; }
.r-items { width: 100%; border-collapse: collapse; margin: 6px 0; border-bottom: 1px dashed #000; }
.r-items td { padding: 1px 0; }
.r-sub td { padding-bottom: 5px; }
.r-num { text-align: right; }
.r-line { display: flex; justify-content: space-between; padding: 1px 0; }
.r-total { font-weight: 700; font-size: 14px; border-top: 1px dashed #000; border-bottom: 1px dashed #000; padding: 5px 0; margin: 4px 0; }
.r-void { font-weight: 700; margin: 6px 0; }
.r-note { margin-top: 10px; font-style: italic; }
.r-foot { margin-top: 8px; font-size: 10px; color: #666; }
@media print {
  @page { size: 80mm auto; margin: 0; }
  .no-print { display: none !important; }
  .receipt-page { background: #fff; }
  .receipt { width: 100%; box-shadow: none; margin: 0; padding: 4mm; }
}

@media (max-width: 1100px) {
  .pos { grid-template-columns: minmax(0, 1fr) 340px; }
  .grid-main, .split, .split-wide { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .grid3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .grid3, .mini-stats { grid-template-columns: 1fr; }
  .sidebar nav { overflow-x: auto; flex-wrap: nowrap; }
  .sidebar nav a { flex: none; }
  .pos { grid-template-columns: 1fr; height: auto; }
  .pos-grid { grid-template-columns: repeat(2, 1fr); max-height: 55vh; }
  .pos-right { position: sticky; bottom: 0; max-height: 80vh; }
  .app-wide .app-main { padding: 12px; }
  .table { min-width: 640px; }
}

input::placeholder, textarea::placeholder { color: #bdb2aa; }
.moves a { display: inline; color: var(--orange-600); }

/* Liên kết UliWork */
fieldset.fs { border: 0; padding: 0; margin: 0; min-width: 0; display: contents; }
fieldset.fs[disabled] input, fieldset.fs[disabled] select, fieldset.fs[disabled] textarea { background: var(--gray-50); color: #6f655e; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 6px 0 14px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.uliwork-btn { gap: 10px; }
