* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: system-ui, -apple-system, sans-serif; background: #f4f6f9; color: #223; }

/* ============ Layout: sidebar kiri + konten kanan ============ */
.layout { display: flex; min-height: 100vh; }

/* ============ Sidebar (pola Quinos) ============ */
.sidebar {
  width: 248px; flex: 0 0 248px;
  background: #242424; color: #f4f4f4;
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column;
  scrollbar-width: thin; scrollbar-color: #3a4f6b #242424;
}
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: #3a4f6b; border-radius: 8px; }
.sidebar::-webkit-scrollbar-track { background: #242424; }
.brand {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 14px 14px; border-bottom: 1px solid #2c3e52;
  text-align: center;
}
.brand .logo {
  width: 36px; height: 36px; border-radius: 9px; background: #EB1E2E; color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px;
  flex: 0 0 auto;
}
.brand .tanamera-logo {
  display: block; width: 190px; height: 61px; object-fit: contain; object-position: center;
}
.brand > div { line-height: 1.15; }
.brand strong { display: block; color: #fff; font-size: 16px; line-height: 1.2; letter-spacing: .01em; }
.brand .sub { display: block; margin-top: 3px; font-size: 11px; color: #b8b8b8; line-height: 1.2; }
.sidebar nav { flex: 1; padding: 8px 0 16px; }
.sidebar nav a {
  display: block; padding: 7px 18px 7px 19px; color: #c6d2e0; text-decoration: none;
  font-size: 13px; line-height: 1.35;
  border-left: 3px solid transparent;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar nav a:hover { background: #243346; color: #fff; }
.sidebar nav a.active {
  background: #2a3b4f; border-left-color: #EB1E2E; color: #fff; font-weight: 600;
  box-shadow: inset 0 0 0 1000px rgba(77, 163, 255, 0.06);
}
.sidebar .section {
  margin: 14px 18px 4px; padding-top: 12px;
  border-top: 1px solid #2c3e52;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: #7d90a8;
  white-space: nowrap;
}
.sidebar .section:first-of-type { margin-top: 10px; }

/* ============ Konten kanan ============ */
.content { flex: 1; min-width: 0; padding: 22px 26px 40px; }
.topbar { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 20px; }
.topbar h1 { font-size: 19px; color: #242424; }
.tag { color: #6b7a90; font-size: 12px; white-space: nowrap; }

/* ============ Kartu statistik ============ */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 28px; }
.card { background: #fff; border-radius: 10px; padding: 16px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.card h3 { font-size: 11px; text-transform: uppercase; color: #6b7a90; letter-spacing: .05em; margin-bottom: 8px; }
.card p { font-size: 22px; font-weight: 700; color: #242424; }
.card p small { font-size: 12px; font-weight: 500; color: #6b7a90; }

/* ============ Tabel laporan ============ */
section h2 { font-size: 15px; margin-bottom: 10px; color: #33475b; }
/* Judul per tabel pada halaman berisi >1 tabel (mis. Reports → Pajak) */
.judul-laporan { font-size: 15px; color: #33475b; margin: 20px 0 10px; }
.judul-laporan:first-of-type { margin-top: 6px; }
section { margin-bottom: 26px; }
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
th, td { text-align: left; padding: 9px 14px; border-bottom: 1px solid #eef1f5; font-size: 14px; }
th { background: #f0f3f7; font-size: 11.5px; text-transform: uppercase; color: #6b7a90; letter-spacing: .04em; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #f8fafc; }
td.money, td.int { text-align: right; white-space: nowrap; }
td.money { font-variant-numeric: tabular-nums; }
.kembali { margin-top: 18px; }
.kembali a { color: #EB1E2E; text-decoration: none; font-size: 14px; }
.kembali a:hover { text-decoration: underline; }

/* ============ Banner error ============ */
.banner.err { background: #fdecea; color: #b3261e; padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; font-size: 14px; }

@media (max-width: 760px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; flex: none; height: auto; position: static; scrollbar-width: auto; }
}

/* ============ CRUD Master Setup / Staff ============ */
.master-form { background: #fff; border-radius: 10px; padding: 22px; box-shadow: 0 1px 4px rgba(0,0,0,.08); max-width: 560px; }
.master-form .field { margin-bottom: 16px; display: flex; flex-direction: column; gap: 5px; }
.master-form label { font-size: 13px; font-weight: 600; color: #242424; }
.master-form .req { color: #b3261e; }
.master-form input[type="text"], .master-form input[type="number"], .master-form select {
  padding: 9px 11px; border: 1px solid #d7dee7; border-radius: 7px; font-size: 14px; background: #fff; width: 100%; box-sizing: border-box;
}
.master-form input[type="file"] { font-size: 13px; }
.master-form .hint { font-size: 12px; color: #6b7a90; }
.master-form .actions { display: flex; gap: 10px; margin-top: 20px; }
.btn { display: inline-block; background: #EB1E2E; color: #fff; padding: 8px 16px; border-radius: 7px; text-decoration: none; font-size: 14px; border: none; cursor: pointer; }
.btn:hover { background: #C81727; }
.btn-ghost { background: #eef1f5; color: #33475b; }
.btn-ghost:hover { background: #e2e8ef; }
.inline-del { display: inline; margin-left: 10px; }
.inline-del button { background: none; border: none; color: #b3261e; cursor: pointer; font-size: 13px; padding: 0; }
td.aksi { white-space: nowrap; }
td.aksi a { color: #EB1E2E; text-decoration: none; font-size: 13px; }
.alert { padding: 11px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.alert-error { background: #fdecea; color: #b3261e; border: 1px solid #f5c6c0; }

/* ============ Checkbox group & Mode group (M4b) ============ */
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.check-grid label.check { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 6px 8px; border: 1px solid #e2e8ef; border-radius: 7px; background: #fff; cursor: pointer; }
.check-grid label.check:hover { background: #f4f7fb; }
.check-grid input[type="checkbox"] { width: 16px; height: 16px; accent-color: #EB1E2E; }
.mode-grid { border: 1px solid #e2e8ef; border-radius: 8px; overflow: hidden; }
.mode-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border-bottom: 1px solid #eef1f5; }
.mode-row:last-child { border-bottom: none; }
.mode-row .mode-name { font-size: 13.5px; font-weight: 600; color: #242424; }
.mode-row select { padding: 6px 10px; border: 1px solid #d7dee7; border-radius: 7px; font-size: 13px; background: #fff; }

/* ============ Tabel Menu Template ala gambar (M4c) ============ */
.tpl-grid-wrap { border: 1px solid #e2e8ef; border-radius: 8px; overflow: auto; }
.tpl-grid { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tpl-grid thead th { background: #f1f5f9; text-align: left; padding: 8px 12px; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: #475569; border-bottom: 1px solid #e2e8ef; white-space: nowrap; }
.tpl-grid tbody td { padding: 7px 12px; border-bottom: 1px solid #eef1f5; vertical-align: middle; }
.tpl-grid tbody tr:last-child td { border-bottom: none; }
.tpl-grid tbody tr:hover { background: #f8fafc; }
.tpl-grid .tpl-name { font-weight: 600; color: #242424; }
.tpl-grid .tpl-center { text-align: center; }
.tpl-grid input[type="checkbox"] { width: 16px; height: 16px; accent-color: #EB1E2E; }
.tpl-grid input[type="number"], .tpl-grid input[type="text"].tpl-price-input { width: 110px; padding: 6px 9px; border: 1px solid #d7dee7; border-radius: 7px; font-size: 13px; text-align: right; background: #fff; }
.tpl-grid select { padding: 6px 9px; border: 1px solid #d7dee7; border-radius: 7px; font-size: 13px; background: #fff; }
.fee-badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.fee-inc { background: #dcfce7; color: #166534; }
.fee-exc { background: #fee2e2; color: #991b1b; }

/* ============ M12.6: toolbar search/filter, preview & import ============ */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 16px; }
.toolbar input[type="search"] { flex: 1; min-width: 200px; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 7px; font-size: 14px; background: #fff; }
.toolbar select { padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 7px; font-size: 14px; background: #fff; color: #242424; }
.thumb { width: 46px; height: 46px; object-fit: cover; border-radius: 7px; border: 1px solid #e2e8ef; display: block; background: #f1f5f9; }
.thumb-cell { width: 54px; }
.img-preview { margin-top: 8px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.img-preview img { max-height: 96px; max-width: 180px; object-fit: contain; border: 1px solid #e2e8ef; border-radius: 8px; background: #f8fafc; }
.hapus-gambar { color: #b91c1c; }
.import-box { max-width: 860px; }
.import-box ol li { margin: 6px 0; line-height: 1.5; }
.import-box code { background: #f1f5f9; padding: 1px 6px; border-radius: 4px; font-size: 13px; }
.import-form { margin-top: 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.import-form input[type="file"] { padding: 8px; border: 1px dashed #cbd5e1; border-radius: 7px; background: #fff; }
.alert-ok { background: #ecfdf5; border: 1px solid #34d399; color: #065f46; }

/* ============ M17: baris Category Detail (form Menu Category) + tombol Rename ============ */
.detail-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 6px 10px; margin-bottom: 6px; border: 1px solid #e2e8ef; border-radius: 7px; background: #fff; }
.detail-row .detail-name { font-size: 14px; color: #1f2d3d; }
.detail-row label.check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #64748b; margin: 0; cursor: pointer; }
.detail-row input[type="checkbox"] { width: 15px; height: 15px; accent-color: #EB1E2E; }
.detail-rename { flex: 1 1 220px; min-width: 160px; padding: 6px 8px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 14px; }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
