:root {
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --paper: #f4f7fb;
  --card: #ffffff;
  --brand: #1d4ed8;
  --brand-2: #2563eb;
  --brand-soft: #dbeafe;
  --ok: #047857;
  --ok-soft: #d1fae5;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --danger: #b91c1c;
  --danger-soft: #fee2e2;
  --side: #0b1220;
  --side-2: #111827;
  --radius: 16px;
  --shadow: 0 12px 40px rgba(15, 23, 42, .08);
  --font: "Plus Jakarta Sans", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
.muted { color: var(--muted); }
.admin-body { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.side {
  background: linear-gradient(180deg, var(--side), var(--side-2));
  color: #e5e7eb;
  padding: 1.1rem .85rem 2rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}
.side-brand {
  display: flex;
  gap: .75rem;
  align-items: center;
  text-decoration: none;
  padding: .4rem .5rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.side-brand img { width: auto; max-width: 176px; height: 46px; object-fit: contain; background: transparent; filter: brightness(0) invert(1); }
.side-label {
  margin: 1.1rem .6rem .35rem;
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #64748b;
}
.side-nav a {
  display: block;
  text-decoration: none;
  padding: .58rem .75rem;
  border-radius: 10px;
  color: #cbd5e1;
  font-weight: 600;
  font-size: .92rem;
}
.side-nav a:hover, .side-nav a.is-active { background: rgba(37,99,235,.22); color: #fff; }
.admin-main { min-width: 0; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 1.5rem;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.topbar h1 { margin: 0; font-size: 1.35rem; }
.topbar .muted { margin: .2rem 0 0; font-size: .9rem; }
.topbar-right { display: flex; gap: .7rem; align-items: center; }
.who { color: var(--muted); font-weight: 600; }
.page { padding: 1.3rem 1.5rem 3rem; }
.page table a { color: var(--brand); font-weight: 700; text-decoration: none; }
.card h3 { margin: 0 0 .85rem; font-size: 1.08rem; }
.stat small { display: block; margin-top: .25rem; }
.stack { display: grid; gap: 1rem; }
.kpi-row { display: grid; gap: .55rem; }
.kpi-row p { margin: 0; display: flex; justify-content: space-between; gap: 1rem; }
.bar { height: 8px; border-radius: 99px; background: #e2e8f0; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand); }
.flash { padding: .85rem 1rem; border-radius: 12px; margin-bottom: 1rem; font-weight: 600; }
.flash-ok { background: var(--ok-soft); color: var(--ok); }
.flash-error { background: var(--danger-soft); color: var(--danger); }
.flash-info { background: var(--brand-soft); color: var(--brand); }
.grid { display: grid; gap: 1rem; align-items: start; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.15rem;
}
.stat b { display: block; font-size: 1.55rem; margin-top: .25rem; }
.stat span { color: var(--muted); font-weight: 600; }
.btn, button.btn, input.btn {
  appearance: none;
  border: 0;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-weight: 700;
  padding: .72rem 1rem;
  border-radius: 12px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  cursor: pointer;
}
.btn:hover { background: var(--brand-2); }
.btn-ghost { background: #eef2ff; color: var(--brand); }
.btn-ok { background: var(--ok); }
.btn-danger { background: var(--danger); }
.btn-warn { background: var(--warn); }
.btn-lg { min-height: 56px; font-size: 1.05rem; padding: .9rem 1.3rem; }
.row-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.row-actions form { display: inline-flex; margin: 0; align-items: center; gap: .4rem; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .7rem .7rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.table-wrap { overflow: auto; }
.table-wrap table { min-width: 640px; }
td .btn, td .row-actions .btn, .thumb-list .btn {
  padding: .35rem .65rem;
  font-size: .8rem;
  border-radius: 8px;
  min-height: 0;
}
td form { display: inline-flex; margin: 0; }
.actions-col { white-space: nowrap; width: 1%; }
.badge { display: inline-block; padding: .2rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-off { background: #e2e8f0; color: #475569; }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.form { display: grid; gap: .85rem; align-content: start; }
.form > .btn, .form > button.btn { width: auto; min-width: 148px; justify-self: start; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; }
label span, .lbl { display: block; font-weight: 700; margin-bottom: .4rem; font-size: .88rem; color: #334155; }
input:not([type]),
input[type=text],
input[type=password],
input[type=email],
input[type=number],
input[type=date],
input[type=tel],
input[type=search],
input[type=url],
input[type=color],
select,
textarea {
  width: 100%;
  border: 1px solid #d7deea;
  border-radius: 14px;
  padding: .78rem .95rem;
  font: inherit;
  color: var(--ink);
  background: #f8fafc;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, .04);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
  outline: none;
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .9rem center;
  padding-right: 2.5rem;
}
input:hover, select:hover, textarea:hover { border-color: #b6c3d6; }
input:focus, select:focus, textarea:focus {
  background: #fff;
  border-color: #60a5fa;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}
input::placeholder, textarea::placeholder { color: #94a3b8; }
input[type=file] {
  width: 100%;
  border: 1px dashed #c5d0e0;
  border-radius: 14px;
  padding: .7rem .85rem;
  background: #f8fafc;
  font: inherit;
  color: #475569;
}
input[type=file]:hover { border-color: #93c5fd; background: #eff6ff; }
input[type=checkbox], input[type=radio] {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
  flex: none;
}
label:has(> input[type=checkbox]),
label:has(> input[type=radio]) {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-weight: 700;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.help { color: var(--muted); font-size: .85rem; margin-top: .3rem; }
.search { display: flex; gap: .6rem; align-items: stretch; flex-wrap: wrap; margin-bottom: 1rem; }
.search input[type=text], .search input:not([type=hidden]) { max-width: 340px; }
.search select { width: auto; min-width: 200px; max-width: 280px; }
.filters { display: flex; gap: .65rem; flex-wrap: wrap; align-items: end; margin-bottom: 1rem; }
.filters label { margin: 0; font-weight: 700; font-size: .85rem; color: var(--muted); display: grid; gap: .3rem; }
.filters input, .filters select, .row-actions input:not([type=hidden]):not([type=checkbox]),
.row-actions input[type=text], .row-actions input[type=date] {
  width: auto;
  min-width: 150px;
}
code { background: #f1f5f9; padding: .15rem .4rem; border-radius: 6px; font-size: .82rem; word-break: break-all; }
.color-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; margin: .8rem 0 1.1rem; }
.color-admin .mini { border: 1px solid var(--line); border-radius: 14px; padding: .6rem; background: #f8fafc; }
.color-admin img { width: 100%; height: 96px; object-fit: cover; border-radius: 10px; margin-bottom: .4rem; }
.thumb-list > div { background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; padding: .5rem; }
.side-nav a { padding: .5rem .75rem; font-size: .88rem; }
.side-label { margin: .85rem .6rem .25rem; }
.side { scrollbar-width: thin; scrollbar-color: #334155 transparent; }
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 10% 10%, rgba(37,99,235,.18), transparent 30%),
    radial-gradient(circle at 90% 0%, rgba(14,165,233,.16), transparent 28%),
    #0b1220;
  padding: 1.5rem;
}
.login-card {
  width: min(460px, 100%);
  background: #fff;
  border-radius: 24px;
  padding: 2rem 1.6rem;
  box-shadow: 0 30px 80px rgba(0,0,0,.25);
}
.login-card img { width: auto; max-width: 220px; height: 72px; object-fit: contain; background: transparent; margin: 0 auto .8rem; }
.login-card h1 { margin: 0 0 .3rem; }
.hint {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  padding: .8rem;
  color: #475569;
  font-size: .9rem;
}
.mode-page { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: #0b1220; color: #fff; }
.mode-page .brand-mark { filter: brightness(0) invert(1); }
.mode-wrap { width: min(980px, 100%); }
.mode-wrap h1 { font-size: clamp(2rem, 5vw, 3.4rem); margin: .4rem 0 1.4rem; }
.mode-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1rem; }
.mode-card {
  background: #111827;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 22px;
  padding: 1.4rem;
  text-decoration: none;
  color: #fff;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.mode-card:hover { border-color: #60a5fa; transform: translateY(-3px); transition: .2s ease; }
.mode-card strong { font-size: 1.3rem; display: block; margin-bottom: .4rem; }
.kiosk-body { background: #eef2f7; }
.kiosk-bar, .shop-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .85rem 1.2rem;
  background: #0b1220;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 5;
}
.kiosk-brand { display: flex; gap: .7rem; align-items: center; text-decoration: none; }
.kiosk-bar .kiosk-brand img { filter: brightness(0) invert(1); }
.kiosk-brand img { width: auto; height: 42px; object-fit: contain; background: transparent; }
.kiosk-brand small { display: block; color: #93c5fd; font-size: .75rem; }
.kiosk-actions, .shop-nav { display: flex; gap: .7rem; align-items: center; }
.kiosk-cart {
  background: #2563eb;
  color: #fff;
  text-decoration: none;
  padding: .7rem 1rem;
  border-radius: 999px;
  font-weight: 800;
}
.kiosk-cart b { background: #fff; color: #1d4ed8; border-radius: 999px; padding: .05rem .45rem; margin-left: .25rem; }
.kiosk-page, .shop-page { padding: 1.2rem; max-width: 1280px; margin: 0 auto; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.tile {
  background: #fff;
  border-radius: 22px;
  min-height: 150px;
  padding: 1.2rem;
  text-decoration: none;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border: 1px solid var(--line);
  font-weight: 800;
  font-size: 1.15rem;
}
.tile:hover { border-color: #93c5fd; }
.crumbs { display: flex; gap: .45rem; flex-wrap: wrap; margin-bottom: 1rem; }
.crumbs a { color: var(--brand); font-weight: 700; text-decoration: none; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.p-card {
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  text-decoration: none;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.p-card img { width: 100%; height: 210px; object-fit: cover; background: #e2e8f0; }
.p-card > div { padding: .85rem 1rem 1rem; }
.p-card h3 { margin: 0 0 .3rem; font-size: 1rem; }
.p-card .price { color: var(--brand); font-weight: 800; font-size: 1.1rem; }
.detail { display: grid; grid-template-columns: 1.1fr .9fr; gap: 1.2rem; }
.gallery { background: #fff; border-radius: 22px; overflow: hidden; border: 1px solid var(--line); }
.gallery-main { width: 100%; height: 460px; object-fit: cover; background: #e2e8f0; }
.thumbs { display: flex; gap: .5rem; padding: .8rem; }
.thumbs img { width: 74px; height: 74px; object-fit: cover; border-radius: 12px; cursor: pointer; border: 2px solid transparent; }
.thumbs img.is-on { border-color: var(--brand); }
.receipt {
  width: min(420px, 100%);
  margin: 0 auto;
  background: #fff;
  border-radius: 8px;
  padding: 1.4rem 1.2rem;
  box-shadow: var(--shadow);
}
.receipt-brand { text-align: center; }
.receipt-brand img { width: auto; max-width: 180px; height: 56px; object-fit: contain; margin: 0 auto .5rem; }
.brand-mark { width: auto; max-width: 240px; height: 72px; object-fit: contain; background: transparent; margin-bottom: 1rem; }
.receipt h2 { margin: 0; text-align: center; }
.receipt hr { border: 0; border-top: 1px dashed #94a3b8; margin: 1rem 0; }
.receipt .big { font-size: 1.6rem; text-align: center; font-weight: 800; }
.thumb-list { display: flex; gap: .6rem; flex-wrap: wrap; }
.thumb-list img { width: 86px; height: 86px; object-fit: cover; border-radius: 10px; }
.shop-foot { text-align: center; padding: 2rem 1rem; color: var(--muted); margin-top: auto; }
.empty { padding: 2rem; text-align: center; color: var(--muted); }
.page-toolbar { display: flex; justify-content: flex-end; gap: .6rem; margin-bottom: 1rem; }
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(15, 23, 42, .5);
  padding: 1.2rem;
  align-items: center;
  justify-content: center;
}
.modal.is-open { display: flex; }
.modal-card {
  width: min(520px, 100%);
  max-height: min(88vh, 780px);
  overflow: auto;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 28px 80px rgba(15, 23, 42, .3);
  padding: 1.2rem 1.3rem 1.35rem;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.modal-head h3 { margin: 0; font-size: 1.15rem; }
.modal-x {
  border: 0;
  background: #f1f5f9;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  flex: none;
}
.modal-x:hover { background: #e2e8f0; }
.modal-actions { display: flex; gap: .55rem; justify-content: flex-end; margin-top: .2rem; }
.modal .form > .btn, .modal .form > button.btn { justify-self: unset; min-width: 0; }
body.modal-on { overflow: hidden; }
.low { color: var(--danger); font-weight: 800; }
@media (max-width: 980px) {
  .admin-body { grid-template-columns: 1fr; }
  .side { height: auto; position: relative; }
  .grid-4, .grid-3, .form-grid, .detail, .mode-grid, .shop-split { grid-template-columns: 1fr; }
  .shop-line { grid-template-columns: 64px 1fr; }
  .shop-line strong, .shop-line .shop-qty { grid-column: 2; }
}
.shop-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f6f7fb;
}
.shop-page {
  flex: 1 0 auto;
  width: min(1200px, 100%);
  max-width: 1200px;
}
.shop-top { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 8; }
.shop-top-inner { max-width: 1200px; margin: 0 auto; padding: .8rem 1.1rem; display: flex; gap: 1rem; align-items: center; }
.shop-search { flex: 1; display: flex; gap: .5rem; }
.shop-search input { background: #f1f5f9; }
.shop-cats { max-width: 1200px; margin: 0 auto; padding: .15rem 1.1rem .7rem; display: flex; gap: 1.1rem; flex-wrap: wrap; }
.shop-cats a { text-decoration: none; color: #64748b; font-weight: 700; font-size: .9rem; padding-bottom: .35rem; border-bottom: 2px solid transparent; }
.shop-cats a:hover, .shop-cats a.is-on { color: var(--ink); border-bottom-color: var(--brand); }
.shop-toolbar { display: flex; justify-content: space-between; align-items: end; gap: 1rem; flex-wrap: wrap; margin: .2rem 0 1.2rem; }
.shop-toolbar h1 { margin: 0; font-size: 1.55rem; }
.shop-toolbar .muted { margin: .25rem 0 0; }
.shop-filter { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.shop-filter select { width: auto; min-width: 150px; }
.p-card { transition: transform .15s ease, box-shadow .15s ease; }
.p-card:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(15,23,42,.12); }
.p-card h3 { font-weight: 650; }
.shop-buy h1 { margin: 0 0 .35rem; font-size: 1.7rem; }
.shop-buy .price { margin: 0 0 1rem; }
.shop-buy-row { display: grid; grid-template-columns: 110px 1fr; gap: .7rem; align-items: end; }
.shop-buy-row .btn { width: 100%; }
.swatch-dot { display: block; width: 100%; height: 48px; border-radius: 10px; }
.shop-split { display: grid; grid-template-columns: 1.5fr .8fr; gap: 1rem; align-items: start; }
.shop-cart-list h1, .shop-sum h2, .shop-done h1 { margin: 0 0 1rem; }
.shop-line { display: grid; grid-template-columns: 72px 1fr auto auto; gap: 1rem; align-items: center; padding: .85rem 0; border-bottom: 1px solid var(--line); }
.shop-line:last-child { border-bottom: 0; }
.shop-line img { width: 72px; height: 72px; object-fit: cover; border-radius: 12px; background: #f1f5f9; }
.shop-line b { display: block; }
.shop-qty { display: flex; gap: .4rem; align-items: center; }
.shop-qty input { width: 72px; min-width: 72px; }
.shop-sum p { display: flex; justify-content: space-between; gap: 1rem; margin: 0 0 .7rem; }
.shop-sum .btn { width: 100%; margin-top: .45rem; }
.shop-done { max-width: 520px; }
.crumbs span { color: var(--muted); }
.color-dots { display: flex; gap: .35rem; margin-top: .45rem; }
.color-dots i { width: 14px; height: 14px; border-radius: 50%; display: block; border: 1px solid #cbd5e1; }
.swatches { display: flex; gap: .7rem; flex-wrap: wrap; margin: .8rem 0; }
.swatch { border: 2px solid #e2e8f0; border-radius: 14px; padding: .35rem; background: #fff; cursor: pointer; width: 86px; text-align: center; }
.swatch.is-on { border-color: var(--brand); }
.swatch img { width: 100%; height: 64px; object-fit: cover; border-radius: 10px; }
.swatch small { display: block; font-weight: 700; margin-top: .25rem; }
.shop-foot-pro {
  background: #0b1220;
  color: #cbd5e1;
  padding: 1.35rem 1.2rem;
  text-align: left;
  margin-top: auto;
  width: 100%;
  flex-shrink: 0;
}
.shop-foot-pro .brand-mark { height: 40px; margin: 0; filter: brightness(0) invert(1); }
.shop-foot-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  align-items: center;
}
.shop-foot-pro p { margin: .35rem 0 0; line-height: 1.55; }
.shop-foot-pro b { display: block; margin-bottom: .2rem; color: #fff; }
.provider-pick { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.provider-pick label:has(> input[type=radio]) {
  position: relative;
  display: grid;
  gap: .15rem;
  margin: 0;
  padding: .9rem 1rem;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
}
.provider-pick label.is-on { border-color: var(--brand); background: var(--brand-soft); }
.provider-pick input[type=radio] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.provider-pick b { font-size: 1rem; }
.provider-pick span { display: block; color: var(--muted); font-weight: 600; font-size: .85rem; margin: 0; }
.tile.tile-photo { padding: 0; overflow: hidden; min-height: 220px; }
.tile.tile-photo img { width: 100%; height: 158px; object-fit: cover; }
.tile.tile-photo span { padding: .8rem 1rem 1rem; display: block; }
@media (max-width: 860px) {
  .shop-top-inner { flex-wrap: wrap; }
  .shop-foot-grid { grid-template-columns: 1fr; }
}
@media print {
  .kiosk-bar, .side, .topbar, .btn, .row-actions, .no-print { display: none !important; }
  .receipt { box-shadow: none; }
  body { background: #fff; }
}
