/* ============================================================
   POSMelinda — Design Tokens
   ============================================================ */
:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --ink: #1e2432;
  --muted: #8a94a6;
  --line: #eef0f5;
  --accent: #c8102e;
  --accent-soft: #fdeeee;
  --blue: #3d7bfd;
  --blue-soft: #edf2ff;
  --green: #1faa59;
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(30, 36, 50, .05);
  --shadow-md: 0 10px 30px -12px rgba(30, 36, 50, .18);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ============================================================
   Layout shell & Modern Floating Capsule Sidebar
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 340px;
  min-height: 100vh;
  transition: grid-template-columns 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
.app.app-single {
  grid-template-columns: 72px minmax(0, 1fr);
}

/* State: sidebar-expanded (terbuka penuh) */
.app.sidebar-expanded {
  grid-template-columns: 240px minmax(0, 1fr) 340px;
}
.app.app-single.sidebar-expanded {
  grid-template-columns: 240px minmax(0, 1fr);
}

/* ---------- Sidebar Rail (Modern Pill Style) ---------- */
.rail {
  background: var(--surface);
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  height: 100vh;
  width: 72px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  padding: 16px 12px 18px;
  transition: width 220ms cubic-bezier(0.16, 1, 0.3, 1), padding 220ms ease;
  overflow: visible; /* Penting agar tombol bulat mengambang di tepi kanan tidak terpotong */
  z-index: 40;
}
.app:not(.sidebar-expanded) .rail {
  cursor: pointer;
}
.app.sidebar-expanded .rail {
  width: 240px;
  padding: 16px 16px 18px;
  cursor: default;
}

/* Tombol bulat mengambang di tepi kanan sidebar (‹ / ›) */
.rail-edge-toggle {
  position: absolute;
  top: 24px;
  right: -12px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(30, 36, 50, 0.16);
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 50;
  color: var(--muted);
  transition: transform 140ms ease, background 140ms ease, color 140ms ease, border-color 140ms ease;
  padding: 0;
}
.rail-edge-toggle:hover {
  transform: scale(1.14);
  color: var(--ink);
  background: #fff;
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(30, 36, 50, 0.2);
}
.rail-edge-toggle:active {
  transform: scale(0.92);
}
.rail-edge-toggle svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.rail-edge-toggle .edge-icon-collapse { display: none; }
.rail-edge-toggle .edge-icon-expand { display: block; }
.app.sidebar-expanded .rail-edge-toggle .edge-icon-collapse { display: block; }
.app.sidebar-expanded .rail-edge-toggle .edge-icon-expand { display: none; }

/* Brand Logo Header (Amar Plastik) */
.rail-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  width: 100%;
  text-decoration: none;
  color: inherit;
}
.app:not(.sidebar-expanded) .rail-brand {
  justify-content: center;
}
.app.sidebar-expanded .rail-brand {
  justify-content: flex-start;
  padding-left: 2px;
}

.rail-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  overflow: hidden;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
  padding: 3px;
  box-sizing: border-box;
}
.rail-logo:hover {
  transform: scale(1.05);
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(30, 36, 50, 0.12);
}
.rail-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.rail-brand-text {
  display: none;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}
.app.sidebar-expanded .rail-brand-text {
  display: flex;
}
.rail-brand-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.rail-brand-sub {
  font-size: 10.5px;
  font-style: italic;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

/* Section Header (MENU, LAINNYA) */
.rail-section-label {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #94a3b8;
  text-transform: uppercase;
  padding: 6px 8px 3px;
  display: none;
}
.app.sidebar-expanded .rail-section-label {
  display: block;
}

/* Navigasi */
.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.rail-btn {
  width: 44px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  color: var(--muted);
  text-decoration: none;
  box-sizing: border-box;
  margin: 0 auto;
  position: relative;
  transition: background 140ms ease, color 140ms ease, transform 100ms ease;
}
.rail-btn:active {
  transform: scale(0.96);
}
.rail-btn svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.rail-label {
  display: none;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  color: inherit;
}
.app.sidebar-expanded .rail-btn {
  width: 100%;
  padding: 0 12px;
  justify-content: flex-start;
  gap: 12px;
  margin: 0;
}
.app.sidebar-expanded .rail-label {
  display: inline-block;
}
.rail-btn:hover { background: var(--bg); color: var(--ink); }
.rail-btn.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

/* Floating Popover Tooltip saat mode collapsed di-hover (persis gambar kanan) */
.app:not(.sidebar-expanded) .rail-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%) scale(0.95);
  background: #ffffff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 9px;
  box-shadow: 0 4px 16px rgba(30, 36, 50, 0.16);
  border: 1px solid #e2e8f0;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 120ms ease, transform 120ms ease;
  z-index: 100;
}
.app:not(.sidebar-expanded) .rail-btn:hover::after {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

.rail-spacer { flex: 1; }

/* Profile Area at Bottom (Avatar + Cashier Name) */
.rail-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  width: 100%;
  box-sizing: border-box;
}
.app:not(.sidebar-expanded) .rail-profile {
  justify-content: center;
}
.app.sidebar-expanded .rail-profile {
  justify-content: flex-start;
  padding-left: 2px;
}

.rail-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f7d4d4, #e5a1a1);
  color: #8f1d24;
  font-weight: 800;
  font-size: 13px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(143, 29, 36, 0.15);
}

.rail-profile-info {
  display: none;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}
.app.sidebar-expanded .rail-profile-info {
  display: flex;
}
.rail-role {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--muted);
  text-transform: uppercase;
}
.rail-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Topbar trigger button alternatif */
.topbar-toggle-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease, transform 100ms ease;
}
.topbar-mobile-toggle {
  display: none;
}
.topbar-toggle-btn:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  color: var(--accent);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}
.topbar-toggle-btn:active {
  transform: scale(0.93);
}
.topbar-toggle-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Navigasi */
.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.rail-btn {
  width: 44px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  box-sizing: border-box;
  margin: 0 auto;
  transition: background 140ms ease, color 140ms ease, transform 100ms ease;
}
.rail-btn:active {
  transform: scale(0.96);
}
.rail-btn svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.rail-label {
  display: none;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  color: inherit;
}
.app.sidebar-expanded .rail-btn {
  width: 100%;
  padding: 0 12px;
  justify-content: flex-start;
  gap: 12px;
  margin: 0;
}
.app.sidebar-expanded .rail-label {
  display: inline-block;
}
.rail-btn:hover { background: var(--bg); color: var(--ink); }
.rail-btn.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }

.rail-spacer { flex: 1; }

/* Page Header Row dengan hamburger untuk halaman selain kasir */
.page-header-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}
.page-header-row .topbar-toggle-btn {
  margin-top: 2px;
}

/* Backdrop drawer mobile */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  z-index: 90;
}
.sidebar-backdrop[hidden] { display: none; }

/* ---------- Main column ---------- */
.main {
  padding: 22px 28px 32px;
  min-width: 0;
}

/* ---------- Halaman (multi-view sidebar) ---------- */
.page[hidden] { display: none; }
.page-pad { max-width: 860px; }
.page-pad.page-full,
.page-full { max-width: 100%; width: 100%; }
.page-title { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.page-sub { color: var(--muted); font-size: 13px; margin-bottom: 22px; }

/* Riwayat transaksi */
.trx-list { display: grid; gap: 12px; }
.trx-card {
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 16px;
}
.trx-card .trx-id { font-weight: 800; font-size: 13px; }
.trx-card .trx-time { color: var(--muted); font-size: 11.5px; grid-column: 1; }
.trx-card .trx-total { font-weight: 800; font-size: 15px; grid-row: 1 / span 2; align-self: center; font-variant-numeric: tabular-nums; }
.trx-card .trx-meta { color: var(--muted); font-size: 11.5px; grid-column: 1; }
.trx-empty {
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  padding: 42px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* Tabel produk & laporan */
.prod-table-wrap {
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}
.prod-table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 560px; }
.prod-table th {
  text-align: left;
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.prod-table td { padding: 11px 16px; border-bottom: 1px solid var(--line); }
.prod-table tr:last-child td { border-bottom: 0; }
.prod-table td:first-child { font-weight: 700; }
.prod-table .td-num { font-variant-numeric: tabular-nums; }
.prod-table .p-out { color: #e0342b; font-weight: 700; }
.prod-table .p-low { color: #f2a30f; font-weight: 700; }
.prod-table .p-ok { color: var(--green); font-weight: 700; }

/* ---------- Master data produk ---------- */
.master-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}
.btn-add {
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  padding: 11px 18px;
  border-radius: 11px;
  box-shadow: 0 8px 18px -6px rgba(200, 16, 46, .5);
  transition: transform .15s, box-shadow .15s;
}
.btn-add:hover { transform: translateY(-2px); box-shadow: 0 12px 22px -6px rgba(200, 16, 46, .55); }

.master-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 20px 0;
}
@media (max-width: 960px) {
  .master-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .master-cards { grid-template-columns: 1fr; }
}
.mcard {
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
}
.mcard .mc-label { color: var(--muted); font-size: 11.5px; font-weight: 600; }
.mcard .mc-value { font-size: 24px; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }
.mcard .mc-value.red { color: #e0342b; }
.mcard .mc-value.orange { color: #f2a30f; }

.master-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}
.msearch {
  flex: 1;
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  height: 42px;
  padding: 0 14px;
  box-shadow: var(--shadow-sm);
}
.msearch svg { width: 16px; height: 16px; stroke: var(--muted); fill: none; stroke-width: 2; stroke-linecap: round; flex-shrink: 0; }
.msearch input { border: 0; outline: none; width: 100%; font: inherit; font-size: 13px; background: transparent; }
.mfilter {
  height: 42px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  padding: 0 12px;
  cursor: pointer;
  outline: none;
  box-shadow: var(--shadow-sm);
}
.mexport {
  margin-left: auto;
  height: 42px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  padding: 0 16px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, color .15s;
}
.mexport:hover { border-color: var(--accent); color: var(--accent); }

/* Tabel master: kolom produk dengan emoji + SKU, badge status pill */
.master-table { border-radius: 14px; }
.master-table .prod-table th { padding: 13px 16px; background: #fafbfd; }
.master-table .prod-table td { padding: 13px 16px; vertical-align: middle; }
.p-name { display: flex; align-items: center; gap: 10px; }
.p-thumb {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}
.p-name strong { display: block; font-size: 12.5px; font-weight: 700; }
.p-name small { display: block; color: var(--muted); font-size: 10.5px; margin-top: 2px; }
.p-cat {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
.p-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.p-status.ok   { background: #e7f6ed; color: var(--green); }
.p-status.low  { background: #fdf3e0; color: #d68a00; }
.p-status.out  { background: #fdeaea; color: #e0342b; }

.p-actions { display: flex; gap: 6px; justify-content: flex-end; }
.p-act {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: grid; place-items: center;
  font-size: 13px;
  color: var(--muted);
  background: transparent;
  transition: background .15s, color .15s;
}
.p-act:hover { background: var(--bg); color: var(--ink); }
.p-act.del:hover { background: #fdeaea; color: #e0342b; }

.master-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 4px 0;
  color: var(--muted);
  font-size: 12px;
}
.master-pager { display: flex; gap: 6px; }
.master-pager button {
  min-width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-weight: 700;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.master-pager button.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.master-pager button:hover:not(.is-active):not(:disabled) { color: var(--ink); }
.master-pager button:disabled { opacity: .4; cursor: not-allowed; }

/* Kartu laporan */
.report-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.report-card {
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  padding: 16px;
}
.report-card .rc-label { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.report-card .rc-value { font-size: 22px; font-weight: 800; margin-top: 6px; font-variant-numeric: tabular-nums; }
.report-card .rc-value.green { color: var(--green); }

/* Pengaturan */
.settings-card {
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  padding: 8px 18px;
}
.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.settings-row:last-child { border-bottom: 0; }
.settings-label { color: var(--muted); font-weight: 600; }
.settings-row strong { font-weight: 700; text-align: right; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.topbar-heading {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.topbar-badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-block;
  width: fit-content;
}
.topbar-sub {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
}

.profile {
  display: flex;
  align-items: center;
  gap: 12px;
}
.profile-text { display: flex; flex-direction: column; align-items: flex-end; }
.profile-text strong { font-size: 13px; font-weight: 700; }
.profile-text small { color: var(--muted); font-size: 11.5px; }
.avatar {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #f7d4d4, #e5a1a1);
  color: #8f1d24;
  font-weight: 800;
  font-size: 13px;
}

/* ---------- Categories ---------- */
.categories {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}
.categories::-webkit-scrollbar { display: none; }

.cat-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 96px;
  padding: 14px 12px;
  background: var(--surface);
  border-radius: 14px;
  border: 1px solid transparent;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, transform .15s;
}
.cat-chip:hover { transform: translateY(-2px); }
.cat-chip strong { font-size: 12.5px; font-weight: 700; }
.cat-chip small { color: var(--muted); font-size: 10px; }

.cat-chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 10px 20px -8px rgba(200, 16, 46, .55);
}
.cat-chip.is-active .cat-emoji { background: rgba(255, 255, 255, .18); }
.cat-chip.is-active small { color: rgba(255, 255, 255, .8); }

/* ---------- Menu head with Search & Filter ---------- */
.menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 24px 0 16px;
  flex-wrap: wrap;
}
.menu-head h1 {
  font-size: 19px;
  font-weight: 800;
  white-space: nowrap;
}

.menu-head-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  max-width: 440px;
  justify-content: flex-end;
}

.search {
  flex: 1;
  min-width: 170px;
  max-width: 290px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0 12px;
  height: 40px;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
}
.search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, .1);
}
.search svg {
  width: 16px; height: 16px;
  stroke: var(--muted);
  fill: none; stroke-width: 2; stroke-linecap: round;
  flex-shrink: 0;
}
.search input {
  border: 0; outline: none;
  width: 100%;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  background: transparent;
}
.search input::placeholder { color: var(--muted); font-size: 12.5px; }

/* Filter Dropdown & Popover */
.filter-dropdown-wrap {
  position: relative;
}

.filter-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 13px;
  color: var(--muted);
  padding: 0 14px;
  height: 40px;
  border-radius: 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: color .15s, border-color .15s, background .15s;
  cursor: pointer;
  white-space: nowrap;
}
.filter-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.filter-btn:hover,
.filter-btn[aria-expanded="true"] {
  color: var(--ink);
  border-color: #cbd5e1;
}
.filter-btn.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: #f7d4d4;
}

.filter-badge {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
}
.filter-badge[hidden] {
  display: none !important;
}

/* Popover panel */
.filter-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  padding: 16px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: popIn .16s ease;
}
.filter-popover[hidden] {
  display: none;
}

.fp-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fp-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}

.fp-chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.fp-chip {
  padding: 7px 10px;
  border-radius: 8px;
  border: 1.5px solid var(--line);
  background: var(--bg);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, background .15s, color .15s;
}
.fp-chip:hover {
  border-color: #cbd5e1;
}
.fp-chip.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.fp-select-wrap {
  width: 100%;
}
.fp-select {
  width: 100%;
  height: 38px;
  border-radius: 9px;
  border: 1.5px solid var(--line);
  background: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  padding: 0 10px;
  outline: none;
  cursor: pointer;
  transition: border-color .15s;
}
.fp-select:focus {
  border-color: var(--accent);
}

.fp-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}
.fp-reset-btn {
  flex: 1;
  height: 34px;
  border-radius: 8px;
  background: var(--bg);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.fp-reset-btn:hover {
  background: #f1f5f9;
  color: var(--ink);
}
.fp-apply-btn {
  flex: 1.3;
  height: 34px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(200, 16, 46, .25);
  transition: opacity .15s, transform .15s;
}
.fp-apply-btn:hover {
  opacity: .92;
}

/* ---------- Menu grid ---------- */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 16px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform .18s, box-shadow .18s;
  cursor: pointer;
  border: 1px solid transparent;
  text-align: left;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--line);
}

.card-media {
  position: relative;
  height: 118px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 46px;
  margin-bottom: 11px;
  overflow: hidden;
}

/* Badge group — menampung beberapa tag sekaligus, wrap jika sempit */
.card-badges {
  position: absolute;
  top: 7px; left: 7px; right: 7px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-start;
  align-items: flex-start;
  pointer-events: none;
  z-index: 2;
}

.badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .02em;
  padding: 3.5px 7px;
  border-radius: 6px;
  color: #fff;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(30, 36, 50, .18);
}
.badge.is-blue   { background: var(--blue); }            /* diskon */
.badge.is-green  { background: var(--green); }           /* ready */
.badge.is-yellow { background: #f2a30f; }                /* stok menipis */
.badge.is-red    { background: #e0342b; }                /* stok habis */
.badge.is-gray   { background: #8a94a6; }                /* exp */

/* ---------- Kartu stok habis ---------- */
.card:disabled,
.card.is-disabled {
  cursor: not-allowed;
}
.card:disabled:hover {
  transform: none;               /* matikan efek hover angkat */
  box-shadow: var(--shadow-sm);
  border-color: transparent;
}
.card.is-disabled .media-emoji {
  filter: grayscale(1);
  opacity: .5;
}
.card.is-disabled .card-name,
.card.is-disabled .card-meta { opacity: .55; }
.card.is-disabled .card-price { opacity: .75; }

.media-emoji { pointer-events: none; }

.card-name { font-weight: 700; font-size: 13.5px; margin-bottom: 5px; }

.card-price {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-bottom: 9px;
  font-variant-numeric: tabular-nums;
}
.card-price s { color: var(--muted); font-size: 11.5px; }
.card-price strong { color: var(--accent); font-size: 14.5px; font-weight: 800; }
.card-price strong.only { color: var(--ink); }

.card-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10.5px;
}
.card-meta .stock { color: var(--green); font-weight: 600; }
.card-meta .stock.low { color: #e0342b; }

.menu-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 48px 0;
  font-size: 13px;
}

/* ============================================================
   Order panel
   ============================================================ */
.order {
  background: var(--surface);
  border-left: 1px solid var(--line);
  padding: 22px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden; /* list yang scroll, bukan seluruh panel */
}

.order-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.order-head h2 { font-size: 15px; font-weight: 800; margin-right: auto; }

.order-close-btn {
  display: none;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  place-items: center;
  background: var(--bg);
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  transition: background .15s, color .15s;
}
.order-close-btn:hover {
  background: #fdeeee;
  color: #e0342b;
}

.clear-all {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: #e0342b;
  padding: 7px 12px;
  border-radius: 9px;
  background: #fdeeee;
  transition: background .15s, transform .15s;
}
.clear-all:hover:not(:disabled) { background: #fbdcdc; transform: translateY(-1px); }
.clear-all:disabled { opacity: .45; cursor: not-allowed; }
.clear-all:focus-visible { outline: 2px solid #e0342b; outline-offset: 2px; }

/* ---------- Order items ---------- */
.order-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  min-height: 120px;
  overflow-y: auto;
  padding-right: 4px;            /* ruang scrollbar agar tidak menabrak konten */
  scrollbar-width: thin;
}

.order-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  grid-template-areas:
    "thumb info price"
    "thumb qty  price";
  column-gap: 12px;
  row-gap: 7px;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.order-item:last-child { border-bottom: 0; padding-bottom: 0; }

.oi-thumb {
  grid-area: thumb;
  width: 44px; height: 44px;
  border-radius: 11px;
  display: grid; place-items: center;
  font-size: 20px;
}

.oi-info {
  grid-area: info;
  min-width: 0;
  align-self: end;
}
.oi-info strong {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.oi-info small { color: var(--muted); font-size: 10.5px; }

.oi-qty {
  grid-area: qty;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: start;
  align-self: start;
}
.oi-qty button {
  width: 22px; height: 22px;
  border-radius: 7px;
  display: grid; place-items: center;
  background: var(--bg);
  color: var(--ink);
  font-weight: 800;
  font-size: 13px;
  line-height: 1;
  transition: background .15s, color .15s;
}
.oi-qty button:hover { background: var(--accent); color: #fff; }
.oi-qty button.del:hover { background: #e0342b; }
.oi-qty button.oi-del {
  margin-left: 2px;
  color: var(--muted);
}
.oi-qty button.oi-del:hover {
  background: #fdeeee;
  color: #e0342b;
}
.oi-qty button.oi-del svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.oi-qty button:disabled {
  opacity: .35;
  cursor: not-allowed;
  background: var(--bg);
  color: var(--muted);
}
.oi-qty span { min-width: 16px; text-align: center; font-weight: 700; font-size: 12.5px; font-variant-numeric: tabular-nums; }

.oi-price {
  grid-area: price;
  align-self: center;
  text-align: right;
  font-weight: 800;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.oi-price small { display: block; color: var(--muted); font-weight: 500; font-size: 10px; white-space: nowrap; }
.oi-price .oi-save { color: var(--green); font-weight: 700; }

.order-empty {
  margin: auto;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  padding: 26px 0;
}
.order-empty .big { font-size: 30px; display: block; margin-bottom: 8px; }

/* ---------- Totals ---------- */
.totals { display: flex; flex-direction: column; gap: 9px; }
.totals div {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
}
.totals dt { color: var(--muted); }
.totals dd { font-weight: 700; font-variant-numeric: tabular-nums; }
.totals .is-accent { color: var(--accent); }

.grand-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  font-size: 14px;
}
.grand-total strong {
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* ---------- Payment ---------- */
.payment p { font-weight: 800; font-size: 13.5px; margin-bottom: 11px; }

.payment-row { display: flex; gap: 10px; }

.pay-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 12px 6px 10px;
  border-radius: 13px;
  border: 1.5px solid var(--line);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  transition: border-color .15s, background .15s, color .15s;
}
.pay-ico { font-size: 18px; }
.pay-btn:hover { border-color: #f0b9b9; }
.pay-btn.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

/* ---------- CTA ---------- */
.cta {
  margin-top: auto;
  height: 52px;
  border-radius: 14px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
  font-size: 14.5px;
  letter-spacing: .01em;
  box-shadow: 0 12px 24px -10px rgba(31, 170, 89, .65);
  transition: transform .15s, box-shadow .15s, opacity .15s;
}
.cta:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 16px 28px -10px rgba(31, 170, 89, .7); }
.cta:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }

/* ---------- Cart FAB (mobile & tablet portrait) ---------- */
.cart-fab {
  display: none;
  align-items: center;
  gap: 8px;
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 45;
  padding: 13px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  box-shadow: 0 12px 24px -8px rgba(200, 16, 46, .65);
  transition: opacity .2s, transform .2s;
}
.cart-fab.is-hidden { display: none !important; opacity: 0; pointer-events: none; transform: translateY(8px); }
.fab-count {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--accent);
  font-weight: 800;
  border-radius: 999px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 13px 22px;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 50;
  max-width: 90vw;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* ============================================================
   Modal konfirmasi (popup custom, menggantikan confirm())
   ============================================================ */
.modal-backdrop,
.receipt-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 24, 34, .55);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 20px;
}
.modal-backdrop[hidden],
.receipt-backdrop[hidden] { display: none; }

.modal {
  background: #fff;
  border-radius: 18px;
  padding: 26px 24px 20px;
  width: min(360px, 100%);
  text-align: center;
  box-shadow: var(--shadow-md);
  animation: popIn .18s ease;
}
@keyframes popIn {
  from { transform: scale(.94); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.modal-icon { font-size: 34px; margin-bottom: 8px; }
.modal h3 { font-size: 16px; font-weight: 800; margin-bottom: 6px; }
.modal p { color: var(--muted); font-size: 13px; line-height: 1.5; margin-bottom: 18px; white-space: pre-line; }
.modal p:has(+ .cash-box) { margin-bottom: 12px; }

/* ---------- Box pembayaran tunai ---------- */
.cash-box {
  text-align: left;
  background: var(--bg);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 18px;
}
.cash-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
#cashInput {
  width: 100%;
  height: 46px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-size: 18px;
  font-weight: 800;
  text-align: right;
  padding: 0 12px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  outline: none;
  transition: border-color .15s;
}
#cashInput:focus { border-color: var(--green); }
#cashInput.is-error { border-color: #e0342b; }

.cash-quick { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 10px; }
.cash-btn {
  height: 36px;
  border-radius: 9px;
  background: #fff;
  border: 1.5px solid var(--line);
  font-weight: 800;
  font-size: 12px;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.cash-btn:hover { border-color: var(--green); color: var(--green); }
.cash-btn.is-active { background: var(--green); border-color: var(--green); color: #fff; }

/* Dropdown nominal lainnya — menyatu dengan tombol cepat */
.cash-more select {
  width: 100%;
  height: 36px;
  border-radius: 9px;
  background: #fff;
  border: 1.5px solid var(--line);
  font: inherit;
  font-weight: 800;
  font-size: 12px;
  color: var(--ink);
  cursor: pointer;
  padding: 0 6px;
  outline: none;
  transition: border-color .15s, color .15s;
}
.cash-more select:hover { border-color: var(--green); color: var(--green); }
.cash-more select:focus { border-color: var(--green); }

/* Kalkulasi tunai — mini tabel rapi: label kiri, nilai kanan, sejajar */
.cash-calc {
  margin-top: 12px;
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  display: grid;
  gap: 6px;
}
.cc-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.cc-row span { font-size: 12px; color: var(--muted); font-weight: 600; }
.cc-row strong {
  font-size: 13.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.cc-row.cc-result {
  border-top: 1.5px dashed var(--line);
  padding-top: 8px;
  margin-top: 2px;
}
.cc-row.cc-result span { font-size: 12.5px; color: var(--ink); font-weight: 800; }
.cc-row.cc-result strong { font-size: 19px; color: var(--green); }
.cc-row.cc-result strong.is-short { color: #e0342b; }

.cash-error {
  margin-top: 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: #e0342b;
}

.modal-actions { display: flex; gap: 10px; }
.modal-btn {
  flex: 1;
  height: 44px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 13.5px;
  transition: transform .15s, opacity .15s;
}
.modal-btn:hover { transform: translateY(-1px); }
.modal-btn.secondary { background: var(--bg); color: var(--ink); }
.modal-btn.danger    { background: #e0342b; color: #fff; }
.modal-btn.success   { background: var(--green); color: #fff; }

/* ============================================================
   Popup struk — hitam putih
   ============================================================ */
.receipt {
  background: #fff;
  color: #000;
  width: min(340px, 100%);
  max-height: 92vh;
  display: flex;
  flex-direction: column;   /* body scroll, footer tetap */
  border-radius: 6px;
  overflow: hidden;
  font-family: "Courier New", monospace;
  box-shadow: var(--shadow-md);
  animation: popIn .18s ease;
  text-align: center;
}

/* Area isi struk — scroll mandiri */
.receipt-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px 22px 16px;
  scrollbar-width: thin;
}

/* Footer tombol — selalu terlihat, tidak ikut terscroll */
.receipt-actions {
  display: flex;
  gap: 10px;
  padding: 12px 22px 16px;
  border-top: 1.5px solid #000;
  background: #fff;
  flex-shrink: 0;
}

.receipt-btn {
  flex: 1;
  height: 42px;
  border: 2px solid #000;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .05em;
  cursor: pointer;
  transition: opacity .15s, transform .15s;
  border-radius: 4px;
}
.receipt-btn:hover { transform: translateY(-1px); }
.receipt-btn:active { transform: translateY(0); }
.receipt-btn.print {
  background: #fff;
  color: #000;
}
.receipt-btn.print:hover { background: #000; color: #fff; }
.receipt-btn.done {
  background: #000;
  color: #fff;
}
.receipt-btn.done:hover { opacity: .85; }

.receipt-logo {
  width: 54px; height: 54px;
  margin: 0 auto 10px;
  border: 2.5px solid #000;
  border-radius: 12px;
  display: grid; place-items: center;
}
.receipt-logo svg {
  width: 30px; height: 30px;
  fill: none; stroke: #000;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.receipt-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: .08em;
}
.receipt-tag { font-size: 11px; margin-top: 2px; }
.receipt-addr { font-size: 11px; line-height: 1.5; margin-top: 6px; }

.receipt-sep {
  border-top: 1.5px dashed #000;
  margin: 12px 0;
}

.receipt-info { text-align: left; display: grid; gap: 4px; }
.receipt-info div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 11.5px;
}
.receipt-info span { color: #000; }
.receipt-info strong { font-weight: 700; text-align: right; }

.receipt-items { text-align: left; display: grid; gap: 8px; }
.receipt-items .ri-row { font-size: 11.5px; }
.receipt-items .ri-name { font-weight: 700; }
.receipt-items .ri-line {
  display: flex;
  justify-content: space-between;
}
.receipt-items .ri-disc {
  font-size: 10.5px;
  color: #555;
}
.receipt-items .ri-disc span:first-child { text-decoration: line-through; }

.receipt-totals { text-align: left; display: grid; gap: 4px; }
.receipt-totals div {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}
.receipt-totals .rt-total {
  font-size: 14px;
  font-weight: 800;
  border-top: 1.5px solid #000;
  padding-top: 6px;
  margin-top: 4px;
}
.receipt-totals .rt-pay { font-weight: 800; }

.receipt-thanks {
  font-size: 11.5px;
  line-height: 1.6;
}

.receipt-close {
  margin-top: 14px;
  width: 100%;
  height: 42px;
  border: 2px solid #000;
  background: #000;
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .05em;
  cursor: pointer;
  transition: opacity .15s;
}
.receipt-close:hover { opacity: .85; }

/* ============================================================
   Responsive
   ============================================================ */
/* Tablet Landscape (1024px): Rapikan grid ruang dan porsi kolom */
@media (max-width: 1080px) {
  .app {
    grid-template-columns: 72px minmax(0, 1fr) 320px;
  }
  .app.sidebar-expanded {
    grid-template-columns: 220px minmax(0, 1fr) 320px;
  }
  .order {
    padding: 18px 16px 20px;
  }
}

/* Tablet Portrait & Mobile (<=768px): Mode Drawer Penuh & Aksesibilitas Touch */
@media (max-width: 768px) {
  .app,
  .app.app-single,
  .app.sidebar-expanded,
  .app.app-single.sidebar-expanded {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .rail {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    height: 100vh;
    width: 260px !important;
    padding: 18px 16px !important;
    z-index: 95;
    box-shadow: var(--shadow-md);
    transform: translateX(-100%);
    transition: transform .25s cubic-bezier(.2, 0, 0, 1);
  }
  .app.sidebar-expanded .rail {
    transform: translateX(0);
  }
  .app.sidebar-expanded .rail-brand-text,
  .app.sidebar-expanded .rail-profile-info,
  .app.sidebar-expanded .rail-label,
  .app.sidebar-expanded .rail-section-label {
    display: flex !important;
  }
  .app.sidebar-expanded .rail-label {
    display: inline-block !important;
  }
  .app.sidebar-expanded .rail-btn {
    width: 100% !important;
    justify-content: flex-start !important;
    padding: 0 12px !important;
    gap: 12px !important;
  }

  /* Sembunyikan floating edge toggle di mobile/tablet agar tidak mengintip di pinggir layar */
  .rail-edge-toggle {
    display: none !important;
  }

  /* Sticky Topbar di mobile/tablet agar tetap terlihat saat scroll */
  .topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(248, 249, 251, 0.94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 12px 0 10px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  }

  /* Sidebar toggle khusus layar <=768px (ikon hamburger garis tiga modern & clean) */
  .topbar-mobile-toggle {
    display: grid !important;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    color: var(--ink);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
    transition: background 140ms ease, color 140ms ease, border-color 140ms ease, transform 100ms ease;
  }
  .topbar-mobile-toggle:active {
    transform: scale(0.92);
    background: var(--bg);
  }

  /* Cart FAB tampil di <=768px */
  .cart-fab {
    display: flex;
  }
  .cart-fab.is-hidden,
  body:has(.order.is-open) .cart-fab,
  .app:has(.order.is-open) + .cart-fab,
  .app:has(.order.is-open) ~ .cart-fab {
    display: none !important;
  }

  /* Order panel drawer */
  .order {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(380px, 92vw);
    z-index: 96;
    transform: translateX(100%);
    transition: transform .28s ease;
    box-shadow: -4px 0 24px rgba(15, 23, 42, .18);
  }
  .order.is-open {
    transform: translateX(0);
  }
  .order-close-btn {
    display: grid;
  }

  /* Backdrop order drawer di mobile/tablet portrait */
  .order-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(3px);
    z-index: 90;
    transition: opacity .2s;
  }
  .order-backdrop[hidden] {
    display: none;
  }
}

@media (max-width: 640px) {
  .main { padding: 16px 14px 24px; }
  .profile-text { display: none; }
  .menu-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .menu-head-tools { max-width: 100%; width: 100%; }
  .search { min-width: 0; max-width: none; flex: 1; }
  .filter-popover { width: calc(100vw - 32px); max-width: 320px; right: 0; }
  .menu-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
}

/* ============================================================
   Dashboard Utama (UI Sesuai Referensi)
   ============================================================ */
.db-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.db-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.db-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Time Filter Segment Controls */
.db-time-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid rgba(226, 232, 240, 0.9);
  padding: 4px;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
}
.db-filter-chips {
  display: flex;
  align-items: center;
  gap: 4px;
}
.db-chip {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}
.db-chip:hover {
  color: var(--ink);
}
.db-chip.is-active {
  background: #ffffff;
  color: #4f46e5;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

/* Custom Date Range Pop/Inline Picker */
.db-custom-date {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 8px;
  border-left: 1px solid #e2e8f0;
}
.db-custom-date[hidden] {
  display: none;
}
.db-date-input {
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink);
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 4px 8px;
  outline: none;
  transition: border-color 140ms ease;
}
.db-date-input:focus {
  border-color: #4f46e5;
}
.db-date-sep {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.db-date-apply-btn {
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 700;
  background: #4f46e5;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 140ms ease;
}
.db-date-apply-btn:hover {
  background: #4338ca;
}

.db-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  background: #4f46e5;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}
.db-btn-primary:hover {
  background: #4338ca;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.45);
}
.db-btn-primary:active {
  transform: scale(0.97);
}
.db-btn-primary svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
}

/* 4 Kartu Hero Warna (Gradient Banners) */
.db-cards-hero {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.db-hero-card {
  position: relative;
  border-radius: 18px;
  padding: 22px 20px 20px;
  color: #ffffff;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 148px;
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.db-hero-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
}
/* Warna Kartu Hero */
.db-card-purple {
  background: linear-gradient(135deg, #4338ca 0%, #6366f1 100%);
}
.db-card-emerald {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
}
.db-card-teal {
  background: linear-gradient(135deg, #0284c7 0%, #06b6d4 100%);
}
.db-card-amber {
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
}

.db-hero-bg-icon {
  position: absolute;
  right: -10px;
  top: -10px;
  width: 110px;
  height: 110px;
  opacity: 0.14;
  pointer-events: none;
}
.db-hero-bg-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.db-hero-top {
  display: flex;
  align-items: center;
  gap: 9px;
  position: relative;
  z-index: 2;
}
.db-hero-pill-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.22);
  display: grid;
  place-items: center;
  backdrop-filter: blur(4px);
}
.db-hero-pill-icon svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
.db-hero-label {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.94);
}
.db-hero-value {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 12px 0 6px;
  font-variant-numeric: tabular-nums;
  position: relative;
  z-index: 2;
}
.db-hero-sub {
  font-size: 11.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.78);
  position: relative;
  z-index: 2;
}

/* 4 Kartu Mini Ringkasan Cepat */
.db-cards-mini {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.db-mini-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(226, 232, 240, 0.8);
  transition: transform 140ms ease, box-shadow 140ms ease;
}
.db-mini-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.07);
}
.db-mini-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.db-mini-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.db-mini-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.db-mini-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #f1f5f9;
  display: grid;
  place-items: center;
  color: #64748b;
}
.db-mini-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

/* Grid Bawah: Tren Pendapatan & Produk Terlaris */
.db-bottom-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 20px;
}
.db-box {
  background: var(--surface);
  border-radius: 18px;
  padding: 22px 24px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(226, 232, 240, 0.8);
  display: flex;
  flex-direction: column;
}
.db-box-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.db-box-badge-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.db-box-badge-icon.purple {
  background: #ede9fe;
  color: #6366f1;
}
.db-box-badge-icon.blue {
  background: #e0f2fe;
  color: #0284c7;
}
.db-box-badge-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
.db-box-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.db-box-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
}
.db-box-sub {
  font-size: 12px;
  color: var(--muted);
}

/* Grafik Area Chart Tren Pendapatan */
.db-chart-wrap {
  display: grid;
  grid-template-columns: 85px 1fr;
  gap: 12px;
  align-items: center;
  height: 220px;
  margin-top: auto;
}
.db-chart-y-labels {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 180px;
  font-size: 10.5px;
  color: #94a3b8;
  text-align: right;
  padding-right: 8px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.db-chart-area-box {
  position: relative;
  height: 205px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.db-chart-svg {
  width: 100%;
  height: 180px;
  overflow: visible;
}
.chart-grid-line {
  stroke: #f1f5f9;
  stroke-width: 1;
}
.db-chart-x-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: #94a3b8;
  font-weight: 500;
  padding-top: 6px;
}

/* List Produk Terlaris */
.db-top-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.db-top-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  transition: background 140ms ease;
}
.db-top-item:hover {
  background: #f8fafc;
}
.db-top-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.db-top-rank {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #eef2ff;
  color: #4f46e5;
  font-size: 12px;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.db-top-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.db-top-item-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.db-top-item-sales {
  font-size: 11.5px;
  color: var(--muted);
}
.db-top-item-right strong {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* List Transaksi Terbaru (5 data terakhir dengan badge card abu-abu lembut) */
.db-recent-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.db-recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid rgba(226, 232, 240, 0.6);
  transition: background 140ms ease, transform 140ms ease;
}
.db-recent-item:hover {
  background: #f1f5f9;
  transform: translateX(2px);
}
.db-recent-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.db-recent-code {
  font-size: 12.5px;
  font-weight: 800;
  color: #1e293b;
  letter-spacing: 0.02em;
}
.db-recent-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: #64748b;
  flex-wrap: wrap;
}
.db-recent-cashier {
  color: #94a3b8;
  font-size: 11px;
}
.db-recent-right strong {
  font-size: 13.5px;
  font-weight: 800;
  color: #4f46e5;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* List Pelanggan Terbaik */
.db-customer-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.db-customer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 10px;
  border-radius: 12px;
  transition: background 140ms ease;
}
.db-customer-item:hover {
  background: #f8fafc;
}
.db-customer-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.db-customer-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #0284c7;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
}
.db-customer-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.db-customer-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.db-customer-count {
  font-size: 11.5px;
  color: var(--muted);
}
.db-customer-right strong {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Responsivitas Dashboard */
@media (max-width: 1180px) {
  .db-cards-hero {
    grid-template-columns: repeat(2, 1fr);
  }
  .db-cards-mini {
    grid-template-columns: repeat(2, 1fr);
  }
  .db-bottom-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   HALAMAN MASTER KATEGORI (MATCHING REFERENCE UI)
   ========================================================= */

.cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.cat-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cat-btn-add {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #4f46e5;
  color: #ffffff;
  border: none;
  border-radius: 9999px;
  padding: 10px 22px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
  transition: all 160ms ease;
}

.cat-btn-add:hover {
  background: #4338ca;
  transform: translateY(-1.5px);
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.45);
}

.cat-btn-add:active {
  transform: translateY(0);
}

.cat-btn-add svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
}

/* Category Toolbar: Search + View Toggles */
.cat-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.cat-search-wrap {
  position: relative;
  width: min(340px, 100%);
}

.cat-search-input {
  width: 100%;
  height: 44px;
  padding: 10px 42px 10px 16px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--ink);
  outline: none;
  transition: all 150ms ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.cat-search-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.cat-search-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  stroke: #94a3b8;
  stroke-width: 2.2;
  fill: none;
  pointer-events: none;
}

.cat-view-toggles {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: #f1f5f9;
  border-radius: 10px;
}

.cat-view-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: all 140ms ease;
}

.cat-view-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
}

.cat-view-btn:hover {
  color: #1e293b;
  background: rgba(255, 255, 255, 0.6);
}

.cat-view-btn.is-active {
  background: #e0e7ff;
  color: #4f46e5;
  box-shadow: 0 1px 3px rgba(79, 70, 229, 0.15);
}

/* Category Grid & Cards (Matching reference styling) */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.cat-card {
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid #edf2f7;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 180ms cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  position: relative;
}

.cat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
  border-color: #e2e8f0;
}

.cat-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #f8fafc;
  overflow: hidden;
}

.cat-card-media svg,
.cat-card-placeholder {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* Hover Action Pill Buttons (Edit & Delete floating on card top right) */
.cat-card-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0;
  transform: translateY(-4px);
  transition: all 180ms ease;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  padding: 4px 6px;
  border-radius: 9999px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  z-index: 2;
}

.cat-card:hover .cat-card-actions,
.cat-card:focus-within .cat-card-actions {
  opacity: 1;
  transform: translateY(0);
}

.cat-action-btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 140ms ease;
}

.cat-action-btn svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.2;
  fill: none;
}

.cat-action-btn.edit {
  color: #4f46e5;
}

.cat-action-btn.edit:hover {
  background: #eef2ff;
  transform: scale(1.08);
}

.cat-action-btn.delete {
  color: #ef4444;
}

.cat-action-btn.delete:hover {
  background: #fee2e2;
  transform: scale(1.08);
}

/* Card Body */
.cat-card-body {
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cat-card-title {
  font-size: 15.5px;
  font-weight: 800;
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.01em;
}

.cat-card-desc {
  font-size: 12.5px;
  color: #64748b;
  margin: 0;
  line-height: 1.45;
}

/* List View Variant */
.cat-grid.is-list-view {
  grid-template-columns: 1fr;
  gap: 12px;
}

.cat-grid.is-list-view .cat-card {
  flex-direction: row;
  align-items: center;
  border-radius: 14px;
}

.cat-grid.is-list-view .cat-card-media {
  width: 140px;
  aspect-ratio: 16 / 10;
  flex-shrink: 0;
}

.cat-grid.is-list-view .cat-card-body {
  flex: 1;
  padding: 14px 18px;
}

.cat-grid.is-list-view .cat-card-actions {
  position: static;
  opacity: 1;
  transform: none;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
  margin-right: 14px;
}

/* Empty State */
.cat-empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background: #ffffff;
  border-radius: 18px;
  border: 1px dashed #cbd5e1;
}

.cat-empty-state svg {
  width: 48px;
  height: 48px;
  stroke: #94a3b8;
  stroke-width: 1.5;
  fill: none;
  margin-bottom: 12px;
}

.cat-empty-state h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 6px;
}

.cat-empty-state p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

/* Category Modal Form */
.cat-modal {
  width: min(440px, 94vw);
  background: #ffffff;
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: popIn .18s ease;
}

.cat-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.cat-modal-head h3 {
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
  margin: 0;
}

.cat-modal-close {
  background: #f1f5f9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 14px;
  color: #64748b;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 140ms ease;
}

.cat-modal-close:hover {
  background: #fee2e2;
  color: #ef4444;
}

.cat-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cat-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.cat-form-group label {
  font-size: 12.5px;
  font-weight: 700;
  color: #334155;
}

.cat-input {
  height: 42px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--ink);
  outline: none;
  background: #ffffff;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.cat-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

@media (max-width: 640px) {
  .cat-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .cat-header-right {
    width: 100%;
  }
  .cat-btn-add {
    width: 100%;
    justify-content: center;
  }
  .cat-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .cat-search-wrap {
    width: 100%;
  }
  .cat-view-toggles {
    align-self: flex-end;
  }
  .cat-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

