:root {
  color-scheme: light;
  --bg: #f5f4f0;
  --surface: #ffffff;
  --surface-2: #f8f7f3;
  --surface-3: #eeece5;
  --text: #171612;
  --muted: #77736a;
  --border: #e6e3db;
  --gold: #c6a345;
  --gold-2: #efcf6d;
  --gold-soft: #fbf5df;
  --black: #12110f;
  --green: #218763;
  --green-soft: #e7f6ef;
  --red: #cc4b4b;
  --red-soft: #fdeeee;
  --blue: #4263c7;
  --blue-soft: #edf1ff;
  --shadow: 0 12px 35px rgba(24, 22, 16, 0.07);
  --sidebar-w: 248px;
  --radius: 18px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f0f0e;
  --surface: #191917;
  --surface-2: #20201d;
  --surface-3: #292823;
  --text: #f4f1e8;
  --muted: #a9a59b;
  --border: #302f2a;
  --gold-soft: #302a19;
  --green-soft: #172c25;
  --red-soft: #321f1f;
  --blue-soft: #20263b;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  width: var(--sidebar-w);
  flex-direction: column;
  overflow-y: auto;
  background: var(--black);
  color: #f8f4e8;
  border-right: 1px solid rgba(255,255,255,.06);
}
.brand { display: flex; align-items: center; gap: 12px; min-height: 82px; padding: 13px 18px; }
.brand-mark { display: grid; width: 48px; height: 48px; place-items: center; overflow: hidden; border-radius: 14px; background: #050505; border: 1px solid rgba(239,207,109,.35); }
.brand-mark img { width: 47px; height: 40px; object-fit: contain; }
.brand-copy { display: flex; flex-direction: column; }
.brand-copy strong { color: var(--gold-2); font-size: 19px; letter-spacing: .3px; }
.brand-copy small { margin-top: 3px; color: #aaa79e; font-size: 11px; text-transform: uppercase; letter-spacing: 1.4px; }
.branch-card { margin: 0 13px 10px; padding: 11px; display: grid; grid-template-columns: 32px 1fr 26px; gap: 9px; align-items: center; background: #1e1d1a; border: 1px solid #2e2c27; border-radius: 14px; }
.branch-icon { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 10px; color: #15120a; background: linear-gradient(135deg,var(--gold-2),var(--gold)); font-size: 11px; font-weight: 900; }
.branch-card small, .branch-card strong { display: block; }
.branch-card small { color: #8e8b84; font-size: 10px; margin-bottom: 3px; }
.branch-card strong { font-size: 12px; }
.side-nav { padding: 0 12px 22px; }
.nav-label { margin: 18px 10px 7px; color: #6f6c64; font-size: 10px; font-weight: 800; letter-spacing: 1.4px; }
.nav-item { position: relative; display: flex; min-height: 43px; align-items: center; gap: 12px; padding: 0 12px; border-radius: 11px; color: #a9a69e; font-size: 13px; font-weight: 600; transition: .2s ease; }
.nav-item > span { width: 20px; color: #817e77; text-align: center; font-size: 17px; }
.nav-item:hover { background: #1c1b18; color: #eee9da; }
.nav-item.active { background: linear-gradient(90deg, rgba(198,163,69,.22), rgba(198,163,69,.08)); color: #f3d87e; }
.nav-item.active::before { position: absolute; left: -12px; width: 3px; height: 24px; border-radius: 0 4px 4px 0; background: var(--gold-2); content: ""; }
.nav-item.active > span { color: var(--gold-2); }
.nav-badge { margin-left: auto; min-width: 20px; padding: 3px 6px; border-radius: 20px; background: #36291a; color: #ffbe62; text-align: center; font-size: 10px; }
.sidebar-footer { margin-top: auto; padding: 8px 12px 16px; }
.support-card { margin-top: 8px; padding: 14px; border-radius: 14px; background: linear-gradient(145deg,#2b2518,#1c1a16); border: 1px solid rgba(239,207,109,.16); }
.support-card span { display: block; color: #a9a69e; font-size: 11px; }
.support-card a { display: block; margin-top: 7px; color: var(--gold-2); font-size: 12px; font-weight: 800; }
.sidebar-scrim { display: none; }
.main-frame { min-height: 100vh; margin-left: var(--sidebar-w); }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; min-height: 82px; align-items: center; justify-content: space-between; padding: 12px 28px; background: color-mix(in srgb, var(--bg) 92%, transparent); border-bottom: 1px solid var(--border); backdrop-filter: blur(16px); }
.topbar-left, .topbar-actions { display: flex; align-items: center; gap: 12px; }
.page-title-wrap h1 { margin: 0; font-size: 22px; line-height: 1.2; letter-spacing: -.5px; }
.page-title-wrap p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.icon-button { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); box-shadow: none; }
.icon-button:hover { border-color: var(--gold); color: var(--gold); }
.icon-button.compact { width: 26px; height: 26px; background: transparent; color: #bbb7ac; border-color: transparent; }
.menu-button { display: none; }
.global-search { display: flex; width: min(290px, 22vw); height: 42px; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--muted); }
.global-search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 12px; }
kbd { padding: 3px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); color: var(--muted); font-size: 9px; }
.sync-pill { display: flex; height: 36px; align-items: center; gap: 7px; padding: 0 11px; border: 1px solid #cce7db; border-radius: 10px; background: var(--green-soft); color: var(--green); font-size: 11px; font-weight: 800; }
.sync-pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(33,135,99,.12); }
.sync-pill.syncing i { animation: pulse 1s infinite; }
.notification-button { position: relative; }
.notification-button b { position: absolute; top: -4px; right: -4px; display: grid; min-width: 17px; height: 17px; padding: 0 4px; place-items: center; border: 2px solid var(--bg); border-radius: 10px; background: var(--red); color: white; font-size: 8px; }
.role-switcher { position: relative; }
.role-switcher > button { display: flex; align-items: center; gap: 9px; min-width: 158px; padding: 3px 8px 3px 3px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); color: var(--text); }
.avatar { display: grid; width: 35px; height: 35px; place-items: center; border-radius: 11px; background: var(--black); color: var(--gold-2); font-size: 10px; font-weight: 900; }
.avatar.cashier { background: #4f5d83; color: #fff; }
.profile-copy { min-width: 84px; flex: 1; text-align: left; }
.profile-copy strong, .profile-copy small { display: block; }
.profile-copy strong { font-size: 11px; }
.profile-copy small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.role-menu { position: absolute; top: 48px; right: 0; display: none; width: 220px; padding: 7px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.role-menu.open { display: block; }
.role-menu button { display: flex; width: 100%; align-items: center; gap: 9px; padding: 8px; border: 0; border-radius: 10px; background: transparent; color: var(--text); text-align: left; }
.role-menu button:hover { background: var(--surface-2); }
.role-menu button > span:last-child strong, .role-menu button > span:last-child small { display: block; }
.role-menu button small { margin-top: 2px; color: var(--muted); font-size: 10px; }

.content { padding: 24px 28px 90px; outline: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-head h2 { margin: 0 0 6px; font-size: 21px; letter-spacing: -.5px; }
.page-head p { margin: 0; color: var(--muted); font-size: 12px; }
.page-actions { display: flex; align-items: center; gap: 9px; }
.btn { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font-size: 12px; font-weight: 800; transition: .18s ease; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(0,0,0,.06); }
.btn-primary { border-color: var(--black); background: var(--black); color: var(--gold-2); }
.btn-gold { border-color: #bb993e; background: linear-gradient(135deg,var(--gold-2),var(--gold)); color: #17130a; }
.btn-danger { border-color: #efcdcd; background: var(--red-soft); color: var(--red); }
.btn-small { min-height: 34px; padding: 0 11px; border-radius: 9px; font-size: 10px; }
.btn-block { width: 100%; }
.stats-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 15px; margin-bottom: 18px; }
.stat-card { position: relative; min-height: 138px; overflow: hidden; padding: 19px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: 0 4px 15px rgba(20,20,16,.025); }
.stat-card::after { position: absolute; right: -28px; bottom: -45px; width: 105px; height: 105px; border-radius: 50%; background: var(--gold-soft); content: ""; }
.stat-card-top { display: flex; align-items: center; justify-content: space-between; }
.stat-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px; background: var(--gold-soft); color: #a47e22; font-size: 18px; }
.trend { padding: 5px 7px; border-radius: 8px; background: var(--green-soft); color: var(--green); font-size: 9px; font-weight: 900; }
.trend.down { background: var(--red-soft); color: var(--red); }
.stat-card > small { display: block; margin-top: 14px; color: var(--muted); font-size: 10px; font-weight: 700; }
.stat-card strong { position: relative; z-index: 1; display: block; margin-top: 5px; font-size: 23px; letter-spacing: -.8px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(310px,.8fr); gap: 18px; margin-bottom: 18px; }
.card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: 0 4px 18px rgba(15,15,12,.025); }
.card-head { display: flex; min-height: 67px; align-items: center; justify-content: space-between; gap: 15px; padding: 15px 18px; border-bottom: 1px solid var(--border); }
.card-head h3 { margin: 0; font-size: 14px; }
.card-head p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.card-body { padding: 18px; }
.select, .input, .textarea { width: 100%; min-height: 42px; padding: 0 12px; border: 1px solid var(--border); border-radius: 11px; outline: 0; background: var(--surface); color: var(--text); font-size: 12px; }
.select:focus, .input:focus, .textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(198,163,69,.12); }
.textarea { min-height: 90px; padding-top: 11px; resize: vertical; }
.mini-select { min-height: 33px; width: auto; padding: 0 30px 0 9px; border-radius: 9px; font-size: 10px; }
.sales-chart { height: 240px; position: relative; display: flex; align-items: flex-end; padding: 18px 8px 26px 40px; }
.chart-grid { position: absolute; inset: 10px 8px 30px 40px; display: grid; grid-template-rows: repeat(4,1fr); }
.chart-grid i { border-top: 1px dashed var(--border); }
.bars { position: relative; z-index: 2; display: flex; width: 100%; height: 100%; align-items: flex-end; justify-content: space-around; gap: 9px; }
.bar-wrap { display: flex; height: 100%; flex: 1; flex-direction: column; justify-content: flex-end; align-items: center; gap: 7px; }
.bar { width: min(24px,55%); border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg,var(--gold-2),var(--gold)); min-height: 10px; transition: .3s; }
.bar:hover { filter: brightness(1.07); transform: scaleX(1.08); }
.bar-wrap small { color: var(--muted); font-size: 9px; }
.chart-legend { display: flex; gap: 14px; color: var(--muted); font-size: 9px; }
.chart-legend span::before { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 3px; background: var(--gold); content:""; }
.goal-wrap { display: grid; place-items: center; padding: 8px 0 14px; }
.goal-ring { position: relative; display: grid; width: 155px; height: 155px; place-items: center; border-radius: 50%; background: conic-gradient(var(--gold) 0 72%,var(--surface-3) 72% 100%); }
.goal-ring::before { position: absolute; width: 117px; height: 117px; border-radius: 50%; background: var(--surface); content:""; }
.goal-ring div { position: relative; text-align: center; }
.goal-ring strong, .goal-ring small { display: block; }
.goal-ring strong { font-size: 29px; }
.goal-ring small { color: var(--muted); font-size: 10px; }
.goal-values { display: grid; width: 100%; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.goal-values div { padding: 12px; border-radius: 12px; background: var(--surface-2); text-align: center; }
.goal-values small, .goal-values strong { display: block; }
.goal-values small { color: var(--muted); font-size: 9px; }
.goal-values strong { margin-top: 4px; font-size: 12px; }
.split-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 11px; }
th { padding: 11px 13px; color: var(--muted); background: var(--surface-2); text-align: left; font-size: 9px; letter-spacing: .4px; text-transform: uppercase; white-space: nowrap; }
td { padding: 13px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb,var(--gold-soft) 42%,transparent); }
.product-cell { display: flex; align-items: center; gap: 10px; }
.product-thumb { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border-radius: 11px; background: linear-gradient(145deg,#efe4be,#cfaa4f); color: #493b16; font-size: 18px; }
.product-cell strong, .product-cell small { display: block; }
.product-cell strong { max-width: 170px; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
.product-cell small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.status { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 20px; background: var(--green-soft); color: var(--green); font-size: 9px; font-weight: 800; }
.status::before { width: 5px; height: 5px; border-radius: 50%; background: currentColor; content:""; }
.status.warning { background: #fff4df; color: #b47017; }
[data-theme="dark"] .status.warning { background: #352819; }
.status.danger { background: var(--red-soft); color: var(--red); }
.status.info { background: var(--blue-soft); color: var(--blue); }
.activity-list { display: grid; gap: 14px; }
.activity { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; }
.activity-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; background: var(--surface-2); color: var(--gold); }
.activity p { margin: 0; font-size: 10px; line-height: 1.4; }
.activity p strong { font-size: 11px; }
.activity time { color: var(--muted); font-size: 9px; }
.quick-actions { display: grid; grid-template-columns: repeat(4,1fr); gap: 9px; }
.quick-actions button { min-height: 82px; padding: 11px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-2); color: var(--text); }
.quick-actions button:hover { border-color: var(--gold); background: var(--gold-soft); }
.quick-actions span, .quick-actions strong { display: block; }
.quick-actions span { margin-bottom: 8px; color: var(--gold); font-size: 20px; }
.quick-actions strong { font-size: 10px; }

.toolbar { display: flex; align-items: center; gap: 9px; margin-bottom: 16px; }
.toolbar .search-input { position: relative; flex: 1; max-width: 420px; }
.search-input span { position: absolute; left: 12px; top: 11px; color: var(--muted); }
.search-input .input { padding-left: 34px; }
.filter-chip { min-height: 36px; padding: 0 13px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); color: var(--muted); font-size: 10px; font-weight: 800; }
.filter-chip.active { border-color: var(--gold); background: var(--gold-soft); color: #94701c; }
.pos-layout { display: grid; grid-template-columns: minmax(0,1fr) 350px; gap: 18px; align-items: start; }
.pos-products { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; }
.pos-product { position: relative; overflow: hidden; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); text-align: left; transition: .18s ease; }
.pos-product:hover { transform: translateY(-2px); border-color: #d7bd72; box-shadow: var(--shadow); }
.pos-product:disabled { cursor: not-allowed; opacity: .58; }
.pos-product .visual { position: relative; display: grid; height: 122px; place-items: center; overflow: hidden; background: linear-gradient(145deg,#f4edd9,#d4b865); color: #5e4d22; font-size: 46px; }
.pos-product:nth-child(3n+2) .visual { background: linear-gradient(145deg,#efe7e0,#bca895); }
.pos-product:nth-child(3n+3) .visual { background: linear-gradient(145deg,#e5ede4,#99ae91); }
.product-sku { position: absolute; top: 9px; left: 9px; padding: 4px 7px; border-radius: 7px; background: rgba(20,18,13,.76); color: #fff; font-size: 8px; }
.stock-tag { position: absolute; right: 9px; top: 9px; padding: 4px 7px; border-radius: 7px; background: rgba(255,255,255,.85); color: #333; font-size: 8px; font-weight: 800; }
.pos-product .info { padding: 12px; }
.pos-product .info small { color: var(--muted); font-size: 9px; }
.pos-product .info h3 { margin: 5px 0 8px; min-height: 30px; font-size: 12px; line-height: 1.35; }
.pos-product .info strong { color: #9c7621; font-size: 12px; }
.cart-card { position: sticky; top: 100px; overflow: hidden; }
.cart-number { color: var(--muted); font-size: 10px; }
.cart-items { display: grid; gap: 10px; min-height: 100px; max-height: 310px; overflow-y: auto; padding: 14px 16px; }
.cart-empty { display: grid; min-height: 180px; place-items: center; color: var(--muted); text-align: center; }
.cart-empty span { display: block; margin-bottom: 7px; font-size: 30px; }
.cart-empty p { margin: 0; font-size: 11px; }
.cart-item { display: grid; grid-template-columns: 36px 1fr auto; gap: 9px; align-items: center; }
.cart-item .product-thumb { width: 36px; height: 36px; }
.cart-item h4 { margin: 0 0 4px; font-size: 10px; }
.cart-item p { margin: 0; color: var(--muted); font-size: 9px; }
.qty { display: flex; align-items: center; gap: 6px; }
.qty button { display: grid; width: 24px; height: 24px; place-items: center; border: 1px solid var(--border); border-radius: 7px; background: var(--surface-2); color: var(--text); }
.qty span { min-width: 17px; text-align: center; font-size: 10px; font-weight: 800; }
.cart-controls { display: grid; gap: 9px; padding: 14px 16px 0; border-top: 1px solid var(--border); }
.field-label { display: grid; gap: 6px; color: var(--muted); font-size: 9px; font-weight: 800; }
.cart-summary { display: grid; gap: 8px; padding: 14px 16px 17px; }
.summary-row { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 10px; }
.summary-row strong { color: var(--text); }
.summary-row.total { margin-top: 3px; padding-top: 12px; border-top: 1px dashed var(--border); color: var(--text); font-size: 13px; font-weight: 800; }
.summary-row.total strong { font-size: 17px; }
.cart-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 9px; margin-top: 4px; }
.number-cell { font-variant-numeric: tabular-nums; font-weight: 750; }
.muted { color: var(--muted); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-gold { color: #a27a1e; }
.action-row { display: flex; gap: 6px; }
.action-icon { display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--muted); }
.action-icon:hover { border-color: var(--gold); color: var(--gold); }
.inventory-summary { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 16px; }
.mini-card { display: flex; align-items: center; gap: 11px; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.mini-card span { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 10px; background: var(--gold-soft); color: #a27a1e; }
.mini-card small, .mini-card strong { display: block; }
.mini-card small { color: var(--muted); font-size: 9px; }
.mini-card strong { margin-top: 3px; font-size: 14px; }
.progress { width: 100%; height: 6px; overflow: hidden; border-radius: 10px; background: var(--surface-3); }
.progress i { display: block; height: 100%; border-radius: inherit; background: var(--gold); }
.progress.danger i { background: var(--red); }
.report-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.report-card { padding: 18px; }
.report-card h3 { margin: 0 0 4px; font-size: 13px; }
.report-card > p { margin: 0 0 18px; color: var(--muted); font-size: 10px; }
.donut-wrap { display: flex; align-items: center; gap: 25px; }
.donut { display: grid; width: 135px; height: 135px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: conic-gradient(var(--gold) 0 48%,#6d7d5d 48% 70%,#9b7c67 70% 85%,#d7c795 85% 100%); }
.donut::before { width: 80px; height: 80px; border-radius: 50%; background: var(--surface); content:""; }
.legend-list { display: grid; flex: 1; gap: 10px; }
.legend-item { display: grid; grid-template-columns: 8px 1fr auto; gap: 8px; align-items: center; font-size: 9px; }
.legend-item i { width: 8px; height: 8px; border-radius: 3px; }
.settings-layout { display: grid; grid-template-columns: 220px minmax(0,1fr); gap: 18px; align-items: start; }
.settings-nav { padding: 8px; }
.settings-nav button { display: flex; width: 100%; min-height: 40px; align-items: center; gap: 9px; padding: 0 11px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); text-align: left; font-size: 11px; font-weight: 700; }
.settings-nav button.active { background: var(--gold-soft); color: #9b741b; }
.settings-panel { padding: 20px; }
.settings-panel h3 { margin: 0 0 5px; font-size: 16px; }
.settings-panel > p { margin: 0 0 22px; color: var(--muted); font-size: 10px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.logo-upload { display: flex; align-items: center; gap: 15px; padding: 14px; border: 1px dashed var(--border); border-radius: 14px; background: var(--surface-2); }
.logo-upload img { width: 80px; height: 62px; object-fit: contain; border-radius: 10px; background: #050505; }
.logo-upload p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.toggle-row { display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: 20px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.toggle-row:last-child { border-bottom: 0; }
.toggle-row strong, .toggle-row small { display: block; }
.toggle-row strong { font-size: 11px; }
.toggle-row small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.switch { position: relative; width: 42px; height: 24px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 20px; background: var(--surface-3); transition: .2s; }
.switch span::before { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: white; box-shadow: 0 2px 6px rgba(0,0,0,.18); content:""; transition: .2s; }
.switch input:checked + span { background: var(--gold); }
.switch input:checked + span::before { transform: translateX(18px); }
.empty-state { display: grid; min-height: 300px; place-items: center; padding: 35px; color: var(--muted); text-align: center; }
.empty-state span { display: block; margin-bottom: 10px; color: var(--gold); font-size: 40px; }
.empty-state h3 { margin: 0 0 7px; color: var(--text); font-size: 15px; }
.empty-state p { max-width: 360px; margin: 0; font-size: 11px; line-height: 1.6; }
.contact-strip { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.contact-strip a { display: inline-flex; min-height: 36px; align-items: center; gap: 7px; padding: 0 11px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--muted); font-size: 10px; }
.mobile-nav { display: none; }

.modal-layer { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; padding: 18px; background: rgba(8,8,7,.6); backdrop-filter: blur(5px); }
.modal-layer.open { display: grid; }
.modal { width: min(560px,100%); max-height: min(720px,90vh); overflow-y: auto; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); box-shadow: 0 24px 80px rgba(0,0,0,.3); }
.modal-head { display: flex; min-height: 65px; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 15px; }
.modal-body { padding: 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 14px 18px; border-top: 1px solid var(--border); }
.payment-methods { display: grid; grid-template-columns: repeat(2,1fr); gap: 9px; margin: 15px 0; }
.payment-method { display: flex; min-height: 68px; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-2); color: var(--text); text-align: left; }
.payment-method.active { border-color: var(--gold); background: var(--gold-soft); box-shadow: 0 0 0 2px rgba(198,163,69,.09); }
.payment-method span { display: grid; width: 35px; height: 35px; place-items: center; border-radius: 10px; background: var(--surface); color: var(--gold); font-size: 17px; }
.payment-method strong, .payment-method small { display: block; }
.payment-method strong { font-size: 10px; }
.payment-method small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.payment-total { padding: 16px; border-radius: 14px; background: var(--black); color: #fff; text-align: center; }
.payment-total small, .payment-total strong { display: block; }
.payment-total small { color: #aaa69d; font-size: 9px; }
.payment-total strong { margin-top: 5px; color: var(--gold-2); font-size: 25px; }
.qris-placeholder { display: none; padding: 13px; border: 1px dashed var(--gold); border-radius: 12px; background: var(--gold-soft); color: var(--muted); text-align: center; font-size: 9px; line-height: 1.5; }
.qris-placeholder.show { display: block; }
.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 120; display: grid; gap: 9px; }
.toast { display: grid; min-width: 290px; max-width: 390px; grid-template-columns: 30px 1fr; gap: 10px; padding: 13px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow); animation: toast-in .25s ease; }
.toast > span { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; background: var(--green-soft); color: var(--green); }
.toast strong, .toast small { display: block; }
.toast strong { font-size: 10px; }
.toast small { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.hidden, [hidden] { display: none !important; }
@keyframes pulse { 50% { opacity: .3; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .pos-products { grid-template-columns: repeat(2,1fr); }
  .global-search { display: none; }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-102%); transition: transform .25s ease; box-shadow: 24px 0 60px rgba(0,0,0,.22); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 29; background: rgba(0,0,0,.42); }
  .sidebar-scrim.open { display: block; }
  .main-frame { margin-left: 0; }
  .menu-button { display: grid; }
  .topbar { padding: 10px 18px; }
  .content { padding: 20px 18px 90px; }
  .pos-layout { grid-template-columns: 1fr; }
  .cart-card { position: static; }
  .dashboard-grid, .split-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .topbar { min-height: 68px; }
  .page-title-wrap h1 { font-size: 17px; }
  .page-title-wrap p, .sync-pill, .profile-copy, .role-switcher > button > span:last-child { display: none; }
  .role-switcher > button { min-width: 42px; width: 42px; padding: 3px; }
  .topbar-actions { gap: 7px; }
  .icon-button { width: 38px; height: 38px; }
  .content { padding: 16px 12px 85px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .page-actions { width: 100%; overflow-x: auto; }
  .page-actions .btn { flex: 0 0 auto; }
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .stat-card { min-height: 120px; padding: 14px; }
  .stat-card strong { font-size: clamp(16px,4.7vw,22px); }
  .stat-card > small { margin-top: 10px; }
  .dashboard-grid, .split-grid, .report-grid { gap: 12px; }
  .card-head { min-height: 59px; padding: 13px; }
  .card-body { padding: 13px; }
  .quick-actions { grid-template-columns: repeat(2,1fr); }
  .pos-products { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .pos-product .visual { height: 102px; }
  .pos-product .info { padding: 10px; }
  .toolbar { align-items: stretch; flex-wrap: wrap; }
  .toolbar .search-input { max-width: none; flex-basis: 100%; }
  .inventory-summary, .report-grid { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { display: flex; overflow-x: auto; }
  .settings-nav button { flex: 0 0 auto; width: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .mobile-nav { position: fixed; inset: auto 0 0 0; z-index: 25; display: grid; grid-template-columns: repeat(5,1fr); padding: 7px 6px max(7px,env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: color-mix(in srgb,var(--surface) 96%,transparent); backdrop-filter: blur(18px); }
  .mobile-nav a, .mobile-nav button { display: flex; min-height: 49px; align-items: center; justify-content: center; flex-direction: column; gap: 3px; border: 0; background: transparent; color: var(--muted); }
  .mobile-nav .active { color: #a47e22; }
  .mobile-nav span { font-size: 18px; }
  .mobile-nav small { font-size: 8px; font-weight: 800; }
  .toast-region { right: 10px; bottom: 77px; left: 10px; }
  .toast { min-width: 0; width: 100%; }
  .payment-methods { grid-template-columns: 1fr; }
  .donut-wrap { align-items: flex-start; }
}

@media print {
  .sidebar, .topbar, .mobile-nav, .page-head, .toolbar, .no-print { display: none !important; }
  .main-frame { margin: 0; }
  .content { padding: 0; }
  .card { border: 0; box-shadow: none; }
  body { background: #fff; color: #000; }
}
