
:root {
  --brand: #f58123;
  --brand-strong: #e06a10;
  --brand-soft: #fff1e3;
  --brand-mid: #f5c089;
  --ink: #4e1a05;
  --ink-2: #6b3214;
  --muted: #8a5a3c;
  --line: #ead6c3;
  --line-2: #f3e6d7;
  --bg: #f6efe6;
  --surface: #ffffff;
  --sidebar: #4e1a05;
  --sidebar-2: #3a1203;
  --good: #1b7a4a;
  --good-bg: #e6f6ec;
  --warn: #c45c12;
  --warn-bg: #fff1e0;
  --bad: #b42318;
  --bad-bg: #fde8e6;
  --info: #1d4e89;
  --info-bg: #e8f0fa;
  --shadow: 0 1px 2px rgba(78, 26, 5, 0.06), 0 8px 24px rgba(78, 26, 5, 0.05);
  --radius: 8px;
  --sidebar-w: 248px;
  --topbar-h: 56px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
h1, h2, h3, h4 { color: var(--ink); }

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  background: var(--sidebar);
  color: #f8eadc;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 16px 16px;
  border-bottom: 1px solid rgba(245, 129, 35, 0.22);
}
.mark {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 8px;
  background: var(--brand);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.06em;
  box-shadow: inset 0 -2px 0 rgba(78, 26, 5, 0.18);
}
.brand-text { display: grid; line-height: 1.1; }
.brand-text strong {
  font-size: 13px;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: #fff;
}
.brand-text em {
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand);
  font-weight: 600;
  margin-top: 3px;
}

.nav-section {
  padding: 14px 12px 4px;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #c9a48a;
  font-weight: 600;
}
.nav { display: grid; gap: 2px; padding: 0 10px 8px; }
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  color: #f0d8c4;
  font-size: 13.5px;
  font-weight: 500;
  border-left: 3px solid transparent;
}
.nav a svg { width: 16px; height: 16px; flex: 0 0 16px; opacity: 0.85; }
.nav a:hover { background: rgba(245, 129, 35, 0.12); color: #fff; }
.nav a.active {
  background: rgba(245, 129, 35, 0.2);
  color: #fff;
  border-left-color: var(--brand);
}
.nav a.active svg { opacity: 1; color: var(--brand); }

.sidebar-foot {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid rgba(245, 129, 35, 0.18);
}
.user-card {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}
.user-card .meta { min-width: 0; }
.user-card b { display: block; font-size: 13px; color: #fff; }
.user-card span { display: block; font-size: 11px; color: #d7b59a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.switch-role {
  display: block;
  margin-top: 8px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand);
  padding: 8px;
  border: 1px solid rgba(245, 129, 35, 0.35);
  border-radius: 6px;
}
.switch-role:hover { background: rgba(245, 129, 35, 0.12); color: #fff; }

/* ---------- Workspace / topbar ---------- */
.workspace { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.search {
  flex: 1;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 13px;
}
.search kbd {
  margin-left: auto;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--muted);
}
.top-meta { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
}
.chip .live {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 3px rgba(27, 122, 74, 0.15);
}
.chip.env { background: var(--brand-soft); border-color: #f3c89a; color: var(--ink); font-weight: 600; }
.bell {
  width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  display: grid; place-items: center;
  position: relative;
  color: var(--ink);
}
.bell i {
  position: absolute; top: 4px; right: 4px;
  min-width: 14px; height: 14px; padding: 0 3px;
  border-radius: 999px; background: var(--brand); color: #fff;
  font-size: 9px; font-style: normal; font-weight: 700;
  display: grid; place-items: center;
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--ink); color: #fff;
  display: grid; place-items: center;
  font-weight: 700; font-size: 12px;
  letter-spacing: 0.02em;
}

/* ---------- Page ---------- */
.page { padding: 22px 24px 40px; }
.crumb {
  display: flex; gap: 8px; align-items: center;
  font-size: 12px; color: var(--muted); margin-bottom: 8px;
}
.crumb a:hover { color: var(--brand-strong); }
.crumb span { color: var(--ink); font-weight: 600; }
.pagehead {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; margin-bottom: 18px;
}
.pagehead h1 { margin: 0; font-size: 24px; letter-spacing: -0.02em; font-weight: 700; }
.pagehead p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; max-width: 640px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--brand); color: #fff; border: 1px solid var(--brand);
  padding: 8px 12px; border-radius: 6px; font-size: 13px; font-weight: 600;
  cursor: pointer;
}
.btn:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
.btn.alt {
  background: #fff; color: var(--ink); border-color: var(--line);
}
.btn.alt:hover { border-color: var(--brand); color: var(--brand-strong); background: var(--brand-soft); }
.btn.ghost { background: transparent; color: var(--ink-2); border-color: transparent; }
.btn.danger { background: var(--bad); border-color: var(--bad); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.card h2, .card h3 { margin: 0; }
.card h2 { font-size: 15px; }
.card h3 { font-size: 14px; }

.kpi-row, .grid4, .grid3, .grid2 { display: grid; gap: 12px; }
.kpi-row, .grid4 { grid-template-columns: repeat(4, 1fr); }
.grid3 { grid-template-columns: repeat(3, 1fr); }
.grid2 { grid-template-columns: 1.2fr 0.8fr; }
.split { display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 12px; }
.section { margin-top: 14px; }
.sectionhead {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; margin-bottom: 10px;
}
.sectionhead h2 { font-size: 15px; margin: 0; }

.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px 13px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.kpi::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--brand);
}
.kpi .label {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}
.kpi .value {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 22px; font-weight: 600; margin-top: 6px; letter-spacing: -0.03em;
}
.kpi .delta { font-size: 12px; margin-top: 4px; font-weight: 600; }
.good { color: var(--good); }
.warn { color: var(--warn); }
.bad { color: var(--bad); }
.small { font-size: 12px; color: var(--muted); }
.metric {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 24px; font-weight: 600; margin-top: 6px; letter-spacing: -0.03em;
}

.toolbar {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.field {
  background: #fff; border: 1px solid var(--line); border-radius: 6px;
  padding: 7px 10px; font-size: 13px; color: var(--ink); min-width: 180px;
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
th {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; background: #fbf6f0;
}
tr:hover td { background: #fffaf4; }
.mono { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 12px; }

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 650; background: var(--line-2); color: var(--ink-2);
}
.tag::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor;
}
.tag.green { background: var(--good-bg); color: var(--good); }
.tag.orange { background: var(--warn-bg); color: var(--warn); }
.tag.red { background: var(--bad-bg); color: var(--bad); }
.tag.blue { background: var(--info-bg); color: var(--info); }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tab {
  padding: 6px 10px; border: 1px solid transparent; border-radius: 6px;
  background: transparent; font-size: 12.5px; font-weight: 600; color: var(--muted);
}
.tab.active { background: var(--brand-soft); color: var(--ink); border-color: #f3c89a; }

.bar { height: 8px; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }

.chart { height: 170px; display: flex; align-items: flex-end; gap: 8px; padding: 8px 2px 22px; }
.chart span {
  flex: 1; background: linear-gradient(180deg, var(--brand) 0%, #f3b06a 100%);
  border-radius: 4px 4px 0 0; min-height: 12px; position: relative; opacity: 0.92;
}
.chart span i {
  position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%);
  font-style: normal; font-size: 10px; color: var(--muted);
}

.hero {
  background: linear-gradient(135deg, #4e1a05 0%, #6b3214 58%, #c45c12 130%);
  color: #fff; border-radius: var(--radius); padding: 20px 22px;
  box-shadow: var(--shadow);
}
.hero h2 { font-size: 20px; margin: 0 0 4px; color: #fff; }
.hero p { margin: 0; color: #f3d7be; font-size: 13.5px; }
.kpis { display: flex; gap: 28px; margin-top: 16px; flex-wrap: wrap; }
.kpis div b { display: block; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 18px; margin-top: 2px; color: #fff; }

.mutedbox {
  background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px;
}
.timeline { display: grid; gap: 12px; }
.event { display: grid; grid-template-columns: 12px 1fr; gap: 10px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); margin-top: 5px; box-shadow: 0 0 0 3px var(--brand-soft); }
.flow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.flow .node {
  background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 13px;
}
.flow .arrow { color: var(--brand); font-weight: 700; }

.receipt {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  background: #fff; border: 1px dashed var(--muted); padding: 16px; border-radius: 8px; font-size: 12px;
  color: var(--ink);
}
.product {
  height: 88px; border-radius: 8px;
  background: linear-gradient(160deg, #fff1e3, #f3e6d7);
  display: grid; place-items: center; font-size: 32px; border: 1px solid var(--line);
}
.notice {
  border-left: 3px solid var(--brand);
  background: #fff; padding: 12px 14px; border-radius: 8px;
  border-top: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.modulecards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.modulecard {
  background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 12px;
}
.modulecard b { display: block; margin-bottom: 2px; font-size: 13px; }
.modulecard.denied { opacity: 0.5; background: var(--bg); }
.permission {
  font-size: 11px; margin-top: 8px; display: inline-flex; padding: 3px 8px; border-radius: 999px;
  background: var(--line-2); font-weight: 650;
}
.permission.full { background: var(--good-bg); color: var(--good); }
.permission.read { background: var(--info-bg); color: var(--info); }
.permission.none { background: var(--bad-bg); color: var(--bad); }

.work-item {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 13px;
}
.work-item:last-child { border-bottom: 0; }

.portal {
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(245, 129, 35, 0.18), transparent 50%),
    linear-gradient(180deg, #4e1a05 0%, #2c0e02 40%, #f6efe6 40.1%);
  padding: 36px 28px 60px;
}
.portal-head { max-width: 1120px; margin: 0 auto 28px; color: #fff; }
.portal-head .eyebrow {
  font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--brand); font-weight: 700;
}
.portal-head h1 { margin: 8px 0 6px; font-size: 34px; letter-spacing: -0.03em; color: #fff; }
.portal-head p { max-width: 640px; color: #f0d8c4; margin: 0; }
.rolegrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: 1120px; margin: 0 auto; }
.rolecard {
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px;
  box-shadow: var(--shadow); display: block; min-height: 180px;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.rolecard:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(78, 26, 5, 0.12); border-color: var(--brand); }
.roleicon {
  width: 38px; height: 38px; border-radius: 8px;
  background: var(--brand-soft); color: var(--brand-strong);
  display: grid; place-items: center; font-weight: 700;
  border: 1px solid #f3c89a;
}
.rolecard h2 { font-size: 16px; margin: 12px 0 6px; }
.rolecard p { margin: 0; color: var(--muted); font-size: 13px; }
.rolecard .go { margin-top: 14px; font-weight: 700; color: var(--brand-strong); font-size: 13px; }

.matrix td.good { font-weight: 700; }
.pos-pay .btn { width: 100%; }

@media (max-width: 1100px) {
  .kpi-row, .grid4, .modulecards { grid-template-columns: repeat(2, 1fr); }
  .grid2, .split { grid-template-columns: 1fr; }
  .rolegrid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
    min-height: 0;
    overflow: visible;
  }
  .nav-section { display: none; }
  .nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px 10px 10px;
  }
  .nav a { padding: 6px 8px; font-size: 12px; }
  .nav a svg { display: none; }
  .sidebar-foot { margin-top: 0; }
  .grid3, .kpi-row, .grid4, .modulecards, .rolegrid { grid-template-columns: 1fr; }
  .app .search, .topbar .search { display: none; }
  .top-meta .chip:not(.env) { display: none; }
  .page { padding: 16px; }
  .pagehead { flex-direction: column; }
  .card:has(thead) { overflow-x: auto; }
  table:has(thead) { min-width: 640px; }
}

/* Compatibility aliases for leftover markup */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.side { background: var(--sidebar); color: #f8eadc; padding: 18px 12px; position: sticky; top: 0; height: 100vh; }
.logo { width: 36px; height: 36px; border-radius: 8px; background: var(--brand); display: grid; place-items: center; font-weight: 700; color: #fff; }
.main { padding: 22px 24px; }
.top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.title h1 { font-size: 24px; margin: 0; }
.title p { margin: 4px 0 0; color: var(--muted); }
.topright { display: flex; gap: 8px; align-items: center; }
.pill { background: #fff; border: 1px solid var(--line); padding: 6px 10px; border-radius: 999px; font-size: 12px; }
.sidefoot { position: absolute; bottom: 14px; left: 12px; right: 12px; padding: 10px; border: 1px solid rgba(245, 129, 35, 0.25); border-radius: 8px; color: #f0d8c4; font-size: 12px; }

/* ---------- Public store ---------- */
.store-body {
  background:
    radial-gradient(900px 420px at 100% -10%, rgba(245,129,35,.16), transparent 50%),
    var(--bg);
}
.store-nav {
  position: sticky; top: 0; z-index: 30;
  background: rgba(78, 26, 5, .94);
  backdrop-filter: blur(14px);
  color: #fff;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 24px;
}
.store-nav .brand { padding: 0; border: 0; }
.store-nav .search {
  background: rgba(255,255,255,.1); border-color: rgba(245,129,35,.4);
  color: #f8eadc; max-width: 340px; flex: 1;
}
.store-nav .search input {
  flex: 1; border: 0; background: transparent; color: #fff; outline: none; min-width: 0;
}
.store-nav .search input::placeholder { color: #d7b59a; }
.branch-select {
  appearance: none;
  background: rgba(255,255,255,.1);
  color: #fff;
  border: 1px solid rgba(245,129,35,.5);
  border-radius: 999px;
  padding: 8px 34px 8px 14px;
  font-weight: 600; font-size: 13px;
  background-image: linear-gradient(45deg, transparent 50%, #f58123 50%), linear-gradient(135deg, #f58123 50%, transparent 50%);
  background-position: calc(100% - 16px) 54%, calc(100% - 11px) 54%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  max-width: 240px;
  cursor: pointer;
}
.branch-select option { color: #4e1a05; }
.branch-select.light {
  background-color: #fff;
  color: var(--ink);
  border-color: var(--line);
  max-width: none;
  min-width: 220px;
}
.store-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.store-links a, .store-links button {
  color: #f8eadc; font-size: 13px; font-weight: 600; background: none; border: 0; cursor: pointer;
  padding: 7px 10px; border-radius: 8px;
}
.store-links a:hover, .store-links button:hover { background: rgba(245,129,35,.2); color: #fff; }
.staff-link { opacity: .7; }
.cart-link { position: relative; }
.cart-badge {
  position: absolute; top: 2px; right: 2px;
  background: var(--brand); color: #fff; border-radius: 999px;
  font-size: 10px; font-weight: 700; min-width: 16px; height: 16px;
  display: grid; place-items: center; padding: 0 4px;
}
.cart-badge[hidden] { display: none; }
.store-hero {
  position: relative;
  min-height: 280px;
  display: grid; align-items: end;
  background:
    linear-gradient(90deg, rgba(78,26,5,.88) 8%, rgba(78,26,5,.35) 70%, rgba(78,26,5,.2)),
    url("products/hero.jpg") center/cover no-repeat;
  color: #fff;
  padding: 48px 24px 40px;
}
.store-hero-copy { max-width: 1120px; margin: 0 auto; width: 100%; }
.store-hero .eyebrow {
  color: #f58123; font-weight: 700; letter-spacing: .18em; font-size: 11px; text-transform: uppercase;
}
.store-hero h1 { color: #fff; font-size: clamp(28px, 5vw, 46px); margin: 10px 0 10px; letter-spacing: -0.04em; line-height: 1.08; max-width: 16ch; }
.store-hero p { margin: 0; color: #f3d7be; max-width: 520px; font-size: 16px; }
.hero-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.hero-pills span {
  background: rgba(255,255,255,.12); border: 1px solid rgba(245,129,35,.35);
  padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600;
}
.store-wrap { max-width: 1120px; margin: 0 auto; padding: 22px 24px 80px; }
.branch-panel {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 18px; margin: -36px 0 22px; box-shadow: 0 18px 40px rgba(78,26,5,.1);
  position: relative; z-index: 2;
}
.branch-panel-head {
  display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; flex-wrap: wrap;
  margin-bottom: 14px;
}
.branch-panel-head h2 { margin: 2px 0 4px; font-size: 22px; }
.branch-panel-actions { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.loc-kicker { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--brand-strong); font-weight: 700; }
.branch-rail {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.branch-card {
  text-align: left; background: #fbf6f0; border: 1px solid var(--line);
  border-radius: 12px; padding: 12px; cursor: pointer; display: grid; gap: 2px;
  color: var(--ink); transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.branch-card:hover { transform: translateY(-2px); border-color: var(--brand); }
.branch-card.active {
  background: var(--brand-soft); border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(245,129,35,.15);
}
.branch-city { font-size: 11px; color: var(--muted); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.catalog-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.product-grid.is-swap .pcard { animation: card-in .35s ease both; }
@keyframes card-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.pcard {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
}
.pcard:hover { transform: translateY(-6px); box-shadow: 0 16px 36px rgba(78,26,5,.12); }
.pphoto {
  height: 180px; background-size: cover; background-position: center;
  position: relative;
}
.pcat {
  position: absolute; left: 12px; top: 12px;
  background: rgba(78,26,5,.82); color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 8px; border-radius: 999px;
}
.pbody { padding: 14px 14px 16px; display: grid; gap: 6px; }
.pcard h3 { font-size: 16px; margin: 0; line-height: 1.25; }
.pcard .price { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 16px; color: var(--ink); }
.pcard .stock-line { min-height: 44px; }
.pcard .btn { width: 100%; margin-top: 4px; border-radius: 10px; padding: 10px 12px; }
.store-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.store-tab {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer;
}
.store-tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.empty-card, .confirm-card {
  background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: var(--shadow);
}
.modal-back {
  position: fixed; inset: 0; background: rgba(78,26,5,.5); z-index: 50;
  display: grid; place-items: center; padding: 20px;
}
.modal-back[hidden] { display: none; }
.modal {
  background: #fff; border-radius: 16px; padding: 22px; width: min(520px, 100%);
  box-shadow: 0 20px 50px rgba(78,26,5,.25);
}
.city-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.city-grid button { text-align: left; }
.store-toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #4e1a05; color: #fff; padding: 11px 18px; border-radius: 999px;
  font-size: 13px; font-weight: 600; opacity: 0; pointer-events: none; z-index: 80;
  transition: .2s ease; box-shadow: 0 10px 30px rgba(78,26,5,.25);
}
.store-toast[data-show="1"] { opacity: 1; transform: translateX(-50%) translateY(0); }
.qty { width: 72px; min-width: 72px; }
@media (max-width: 1100px) {
  .branch-rail { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .product-grid, .city-grid, .branch-rail { grid-template-columns: 1fr; }
  .store-nav { flex-wrap: wrap; }
  .store-nav .search, .store-nav .branch-select { max-width: none; width: 100%; display: flex; }
  .branch-panel { margin-top: 16px; }
  .branch-rail { display: flex; overflow: auto; gap: 10px; padding-bottom: 6px; }
  .branch-card { min-width: 200px; }
}
.yes { color: var(--good); font-weight: 700; }
.view { color: var(--info); font-weight: 700; }
.no { color: var(--bad); font-weight: 700; }

/* Shared enterprise interface */
button, .btn { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
[hidden], .nav a[hidden] { display: none !important; }
.workspace { min-width: 0; }
.sidebar { background: var(--sidebar); color: #f0d8c4; }
.sidebar .brand { padding: 26px 22px; }
.nav { padding-left: 12px; padding-right: 12px; }
.nav a { border-radius: 8px; margin-bottom: 4px; min-height: 42px; }
.nav a.active { background: rgba(245, 129, 35, 0.2); color: #fff; border-color: var(--brand); }
.nav-section { color: #c9a48a; letter-spacing: .12em; margin-top: 18px; }
.topbar { min-height: 72px; background: #ffffffed; backdrop-filter: blur(12px); }
.search input { border: 0; outline: 0; background: transparent; color: inherit; width: 100%; min-width: 0; }
.page { max-width: 1680px; margin: auto; padding: 30px 32px 56px; }
.pagehead { margin: 20px 0 28px; }
.pagehead h1 { font-size: clamp(25px, 3vw, 32px); letter-spacing: -.035em; }
.pagehead p { line-height: 1.7; }
.card, .kpi { border-radius: 12px; box-shadow: var(--shadow); }
.kpi { padding: 22px; border-top: 3px solid var(--brand); }
.kpi .label { text-transform: none; color: var(--muted); font-size: 13px; letter-spacing: 0; }
.kpi .value { letter-spacing: -.045em; margin: 10px 0; }
.btn { min-height: 40px; border-radius: 8px; background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.alt, .btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn:hover { filter: brightness(.96); }
.table-scroll { overflow-x: auto; max-width: 100%; }
th { background: #fbf6f0; color: var(--muted); padding: 13px 16px; }
td { padding: 16px; }
tbody tr:hover { background: #fffaf4; }
.tag { border-radius: 5px; }
.mobile-menu { display: none; }
.portal { background: radial-gradient(ellipse at 85% 0%, rgba(245, 129, 35, 0.2), var(--sidebar) 60%); min-height: 100vh; padding-top: 64px; }
.portal-head h1 { font-size: 46px; }
.portal-head p { color: #f0d8c4; line-height: 1.8; }
.rolecard { padding: 26px; border-color: var(--line); }
.rolecard .go { color: var(--brand-strong); margin-top: 24px; }
.store-body { background: var(--bg); }
.store-nav { background: var(--sidebar); padding-top: 16px; padding-bottom: 16px; }
.store-hero { background: linear-gradient(90deg, rgba(78, 26, 5, 0.9) 0%, rgba(78, 26, 5, 0.6) 45%, rgba(78, 26, 5, 0.2) 100%), url('products/hero.jpg') center/cover; min-height: 350px; padding: 54px 24px; }
.store-hero h1 { max-width: 620px; font-size: clamp(34px, 4.6vw, 58px); }
.store-hero p { color: #f0d8c4; line-height: 1.7; }
.store-wrap { max-width: 1320px; }
.branch-panel { padding: 24px; border-radius: 14px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.branch-panel-head { align-items: center; gap: 20px; }
.branch-panel-head .small { line-height: 1.8; }
.location-status { font-size: 13px; color: var(--muted); background: var(--line-2); border-radius: 7px; padding: 12px 14px; margin: 18px 0; }
.branch-rail { padding-bottom: 8px; }
.branch-card { border-color: var(--line); border-radius: 10px; min-height: 112px; text-align: left; }
.branch-card.active { background: var(--brand-soft); border-color: var(--brand); color: var(--ink); }
.loc-kicker { color: var(--brand-strong); }
.pcard { border-radius: 12px; border-color: var(--line); }
.pcard:hover { transform: translateY(-3px); }
.pbody { padding: 20px; gap: 10px; }
.pcard .price { font-size: 20px; font-weight: 600; }
.store-tab { min-height: 40px; border-color: var(--line); }
@media (max-width: 1100px) { .top-meta .chip:not(.env) { display: none; } }
@media (max-width: 860px) {
  .mobile-menu { display: inline-flex; }
  .sidebar { display: none; }
  .sidebar.is-open { display: flex; }
  .page { padding: 20px 16px 40px; }
  .topbar { padding: 12px 16px; }
  .pagehead { flex-direction: column; }
  .store-nav { flex-wrap: wrap; gap: 12px; }
  .store-nav .search { order: 4; max-width: none; flex-basis: 100%; }
  .store-hero { min-height: 300px; padding: 36px 20px; }
  .branch-panel-head { flex-direction: column; align-items: stretch; }
  .branch-panel { padding: 18px; }
}
@media (max-width: 560px) {
  .kpi-row, .grid4, .modulecards, .rolegrid, .product-grid { grid-template-columns: 1fr; }
  .top-meta .env { display: none; }
  .store-wrap { padding: 18px 14px 48px; }
  .store-nav > .branch-select { width: 100%; order: 3; }
  .store-links { gap: 0; }
  .branch-panel-actions > * { flex: 1 1 auto; }
  .sectionhead { flex-wrap: wrap; gap: 12px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* POS Scanner Styles */
.scanner-box { display:flex; align-items:center; gap:12px; background: var(--brand-soft); border: 1px solid var(--brand); padding:12px; margin-bottom:16px; position:relative; }
.scanner-box input { border:0; background:transparent; width:100%; font-family: "IBM Plex Mono", monospace; font-size:14px; color: var(--ink); outline:none; }
.scanner-box input::placeholder { color: var(--muted); }
.scan-result { position:absolute; right:12px; left:12px; top:0; bottom:0; display:flex; align-items:center; justify-content:space-between; pointer-events:none; opacity:0; transition: opacity .2s ease; background: var(--brand-soft); }
.scan-result.visible { opacity:1; }
.scan-result .prod-name { font-weight:600; font-size:12px; }
.scan-result .prod-price { font-family: "IBM Plex Mono", monospace; font-weight:700; color: var(--brand-strong); }
.scan-result .btn-add { background: var(--brand); color:#fff; border:0; border-radius:0; padding:4px 8px; font-size:10px; cursor:pointer; pointer-events:auto; }
