/* ============================================
   BELLYWELL ADMIN — Design System
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Outfit:wght@500;600;700;800&display=swap');

:root {
  --g-950: #052E1A;
  --g-900: #0B3B24;
  --g-800: #166534;
  --g-700: #15803D;
  --g-600: #16A34A;
  --g-500: #22C55E;
  --g-400: #4ADE80;
  --g-200: #BBF7D0;
  --g-100: #DCFCE7;
  --g-50: #F0FDF4;

  --ink: #0F172A;
  --ink-2: #334155;
  --muted: #64748B;
  --line: #E2E8F0;
  --line-2: #F1F5F9;
  --bg: #F4F7F5;
  --white: #FFFFFF;

  --orange: #F97316;
  --orange-bg: #FFF1E6;
  --red: #EF4444;
  --red-bg: #FEE2E2;
  --blue: #3B82F6;
  --blue-bg: #DBEAFE;
  --purple: #8B5CF6;
  --purple-bg: #EDE9FE;

  /* Label highlight colors (as in Word labels) */
  --hl-yellow: #FFFF00;
  --hl-cyan: #00FFFF;
  --hl-red: #FF0000;
  --hl-gray: #C0C0C0;
  --hl-green: #00FF00;
  --hl-pink: #FF66FF;
  --menu-cyan: #00FFFF;
  --addr-dup: #9FC5E8;

  --font: 'Inter', system-ui, sans-serif;
  --font-display: 'Outfit', 'Inter', sans-serif;
  --r: 14px;
  --r-sm: 10px;
  --r-xs: 7px;
  --sh: 0 1px 2px rgba(15, 23, 42, .04), 0 2px 8px rgba(15, 23, 42, .04);
  --sh-md: 0 10px 30px rgba(15, 23, 42, .08);
  --sh-lg: 0 24px 60px rgba(15, 23, 42, .18);
  --sidebar: 252px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--ink); }
.hide { display: none !important; }

/* ---------- Layout ---------- */
.admin { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar);
  flex-shrink: 0;
  background: radial-gradient(120% 60% at 0% 0%, #14532D 0%, var(--g-950) 60%);
  color: #D1FAE5;
  position: fixed; inset: 0 auto 0 0;
  display: flex; flex-direction: column;
  padding: 22px 14px;
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; }
.brand-logo {
  width: 42px; height: 42px; border-radius: 12px; background: #fff;
  display: grid; place-items: center; overflow: hidden; box-shadow: 0 6px 18px rgba(0,0,0,.25);
}
.brand-logo img { width: 100%; height: 100%; object-fit: contain; }
.brand h1 { font-family: var(--font-display); font-size: 19px; color: #fff; letter-spacing: -.2px; }
.brand small { display: block; font-size: 11px; color: var(--g-400); font-weight: 600; letter-spacing: 1.4px; text-transform: uppercase; }

.nav-label { font-size: 10.5px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: rgba(209,250,229,.45); padding: 14px 12px 8px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 10px 12px; border-radius: 10px; font-size: 13.5px; font-weight: 500;
  color: rgba(236,253,245,.78); transition: all .18s ease; text-align: left; position: relative;
}
.nav-item .ni { width: 22px; text-align: center; font-size: 16px; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(74,222,128,.22), rgba(74,222,128,.04));
  color: #fff; font-weight: 600;
}
.nav-item.active::before {
  content: ''; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 4px;
  border-radius: 0 4px 4px 0; background: var(--g-400);
}
.nav-item .count {
  margin-left: auto; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px;
  background: rgba(74,222,128,.18); color: var(--g-400);
}
.sidebar-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid rgba(255,255,255,.08); }
.auto-chip { display: flex; align-items: center; gap: 8px; font-size: 12px; color: rgba(236,253,245,.75); }
.auto-chip .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.auto-chip.on .pulse { background: var(--g-400); box-shadow: 0 0 0 0 rgba(74,222,128,.7); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(74,222,128,0); } 100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); } }

.main { margin-left: var(--sidebar); flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px; padding: 14px 28px;
  background: rgba(244,247,245,.82); backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(226,232,240,.8);
}
.topbar h2 { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -.3px; }
.topbar .sub { font-size: 12.5px; color: var(--muted); }
.topbar .spacer { flex: 1; }

.date-nav {
  display: flex; align-items: center; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 4px; box-shadow: var(--sh);
}
.date-nav button { width: 32px; height: 32px; border-radius: 8px; font-size: 16px; color: var(--ink-2); }
.date-nav button:hover { background: var(--g-50); color: var(--g-700); }
.date-nav input { border: none; outline: none; padding: 0 8px; font-weight: 600; font-size: 13.5px; background: transparent; }
.date-nav .today-btn { width: auto; padding: 0 10px; font-size: 12px; font-weight: 600; color: var(--g-700); }

.content { padding: 24px 28px 60px; }
.view { display: none; animation: fadeUp .35s ease both; }
.view.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 20px; }
.stat {
  background: #fff; border-radius: var(--r); padding: 16px 18px; box-shadow: var(--sh);
  border: 1px solid var(--line-2); position: relative; overflow: hidden; transition: transform .2s, box-shadow .2s;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--sh-md); }
.stat .lbl { font-size: 12px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.stat .val { font-family: var(--font-display); font-size: 30px; font-weight: 700; margin-top: 6px; letter-spacing: -.5px; }
.stat .foot { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.stat::after {
  content: ''; position: absolute; right: -24px; top: -24px; width: 90px; height: 90px; border-radius: 50%;
  background: var(--accent, var(--g-100)); opacity: .55;
}
.stat .ico { position: absolute; right: 14px; top: 14px; font-size: 20px; z-index: 1; }
.stat.hero {
  background: linear-gradient(135deg, var(--g-700), var(--g-900)); color: #fff; border: none;
}
.stat.hero .lbl, .stat.hero .foot { color: rgba(255,255,255,.75); }
.stat.hero::after { background: rgba(255,255,255,.12); opacity: 1; }

/* ---------- Toolbar ---------- */
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--line-2); border-radius: var(--r);
  padding: 12px; box-shadow: var(--sh); margin-bottom: 16px;
}
.toolbar .grow { flex: 1; }
.search {
  display: flex; align-items: center; gap: 8px; min-width: 240px;
  border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; height: 38px; background: var(--line-2);
  transition: all .15s;
}
.search:focus-within { background: #fff; border-color: var(--g-500); box-shadow: 0 0 0 3px rgba(34,197,94,.15); }
.search input { border: none; outline: none; background: transparent; flex: 1; }
.select {
  height: 38px; border: 1px solid var(--line); border-radius: 10px; padding: 0 30px 0 12px; background: #fff;
  appearance: none; outline: none; font-weight: 500; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2364748B' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
.select:focus { border-color: var(--g-500); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 15px; border-radius: 10px; font-size: 13.5px; font-weight: 600;
  transition: all .16s ease; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: linear-gradient(135deg, var(--g-600), var(--g-700)); color: #fff; box-shadow: 0 4px 14px rgba(22,163,74,.3); }
.btn-primary:hover { box-shadow: 0 6px 20px rgba(22,163,74,.42); filter: brightness(1.05); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #1E293B; }
.btn-ghost { background: #fff; border: 1px solid var(--line); color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--g-400); color: var(--g-700); background: var(--g-50); }
.btn-yellow { background: #FDE047; color: #422006; box-shadow: 0 4px 14px rgba(234,179,8,.3); }
.btn-yellow:hover { filter: brightness(1.04); }
.btn-cyan { background: #22D3EE; color: #083344; box-shadow: 0 4px 14px rgba(6,182,212,.3); }
.btn-danger { background: var(--red-bg); color: #B91C1C; }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-excel { background: #ECFDF5; border: 1px solid #86EFAC; color: #15803D; font-weight: 600; }
.btn-excel:hover { background: #DCFCE7; border-color: #4ADE80; color: #166534; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.icon-btn {
  width: 30px; height: 30px; border-radius: 8px; display: inline-grid; place-items: center;
  font-size: 14px; color: var(--muted); transition: all .15s; text-decoration: none;
}
.icon-btn:hover { background: var(--line-2); color: var(--ink); }
.icon-btn.del:hover { background: var(--red-bg); color: var(--red); }

/* ---------- Tables ---------- */
.card { background: #fff; border-radius: var(--r); box-shadow: var(--sh); border: 1px solid var(--line-2); overflow: hidden; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.card-head h3 { font-size: 15px; font-weight: 700; }
.card-head .muted { font-size: 12.5px; color: var(--muted); }
.table-wrap { overflow: auto; max-height: calc(100vh - 330px); }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tbl thead th {
  position: sticky; top: 0; z-index: 2; background: #F8FAFC; color: var(--ink-2);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
  padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover td { background: #FAFDFB; }
.tbl tbody tr.sel td { background: var(--g-50); }
.tbl .c { text-align: center; }
.tbl .nowrap { white-space: nowrap; }
.tbl .strong { font-weight: 700; text-transform: uppercase; }
.tbl .addr { font-weight: 700; text-transform: uppercase; font-size: 12px; line-height: 1.45; max-width: 330px; }
.tbl .addr .note { display: block; margin-top: 6px; color: #B45309; }
.tbl td.dup { background: var(--addr-dup) !important; }
.tbl td.menu-cell { background: var(--menu-cyan) !important; font-weight: 700; font-size: 12px; text-transform: uppercase; line-height: 1.5; min-width: 200px; }
.tbl td.menu-cell .qty { display: block; margin-bottom: 6px; }
.tbl td.cat-cell { font-weight: 800; font-size: 11.5px; text-align: center; letter-spacing: .3px; }
.tbl .box-num { font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.tbl .actions { white-space: nowrap; text-align: right; }
.empty { padding: 60px 20px; text-align: center; color: var(--muted); }
.empty .big { font-size: 42px; margin-bottom: 10px; }

/* courier table - excel feel */
.tbl.excel td { border-right: 1px solid var(--line-2); }
.tbl.excel { font-size: 12.5px; }

.cb { width: 17px; height: 17px; accent-color: var(--g-600); cursor: pointer; }

.pill {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600;
  padding: 3px 10px; border-radius: 99px; white-space: nowrap;
}
.pill.green { background: var(--g-100); color: var(--g-800); }
.pill.orange { background: var(--orange-bg); color: #C2410C; }
.pill.blue { background: var(--blue-bg); color: #1D4ED8; }
.pill.gray { background: var(--line-2); color: var(--muted); }
.pill.purple { background: var(--purple-bg); color: #6D28D9; }

select.status-sel, select.kurir-sel {
  border: 1px solid transparent; border-radius: 99px; padding: 4px 24px 4px 10px; font-size: 11.5px; font-weight: 600;
  appearance: none; cursor: pointer; outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M1 1l3 3 3-3' stroke='currentColor' stroke-width='1.4' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
}
select.status-sel.pending { background-color: var(--orange-bg); color: #C2410C; }
select.status-sel.otw { background-color: var(--blue-bg); color: #1D4ED8; }
select.status-sel.delivered { background-color: var(--g-100); color: var(--g-800); }
select.status-sel.failed { background-color: var(--red-bg); color: #B91C1C; }
select.kurir-sel { background-color: var(--line-2); color: var(--ink-2); border-color: var(--line); }

/* ---------- Kurir summary chips ---------- */
.kurir-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 16px; }
.kurir-card {
  flex-shrink: 0; display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line-2);
  border-radius: 12px; padding: 10px 14px; box-shadow: var(--sh); cursor: pointer; transition: all .15s;
}
.kurir-card:hover, .kurir-card.on { border-color: var(--g-500); box-shadow: 0 0 0 3px rgba(34,197,94,.14); }
.kurir-card .av { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--g-500), var(--g-800)); }
.kurir-card .nm { font-size: 13px; font-weight: 700; }
.kurir-card .mt { font-size: 11.5px; color: var(--muted); }
.kurir-card .prog { width: 70px; height: 5px; background: var(--line-2); border-radius: 9px; overflow: hidden; margin-top: 4px; }
.kurir-card .prog i { display: block; height: 100%; background: var(--g-500); border-radius: 9px; }

/* ---------- Label previews ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 14px; border-radius: 3px; border: 1px solid rgba(0,0,0,.15); }

.label-board {
  background: #fff; border-radius: var(--r); padding: 22px; box-shadow: var(--sh); border: 1px solid var(--line-2);
  background-image: radial-gradient(#E2E8F0 1px, transparent 1px); background-size: 16px 16px;
}
.label-grid { display: grid; grid-template-columns: repeat(var(--cols, 3), 1fr); gap: 14px; }

/* Request label */
.rlabel {
  background: #fff; border: 1.5px dashed #94A3B8; border-radius: 6px; padding: 14px 10px 12px;
  text-align: center; font-family: 'Times New Roman', Times, serif; font-weight: 700; text-transform: uppercase;
  color: #000; position: relative; min-height: 125px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  transition: transform .15s, box-shadow .15s;
}
.rlabel:hover { transform: translateY(-2px); box-shadow: var(--sh-md); }
.rlabel .rn { font-size: 14pt; font-weight: 700; line-height: 1.2; margin-bottom: 2px; }
.rlabel .rc { font-size: 11.5pt; font-weight: 700; line-height: 1.2; margin-bottom: 4px; }
.rlabel .rq { font-size: 11pt; font-weight: 700; line-height: 1.35; display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; }
.rlabel .rq-line { display: inline-block; line-height: 1.35; }
.rlabel mark { color: #000 !important; font-weight: 700; font-family: 'Times New Roman', Times, serif; padding: 0 2px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.rlabel mark.yellow { background: var(--hl-yellow); }
.rlabel mark.cyan { background: var(--hl-cyan); }
.rlabel mark.red { background: var(--hl-red); }
.rlabel mark.gray { background: var(--hl-gray); }
.rlabel mark.green { background: var(--hl-green); }
.rlabel mark.pink { background: var(--hl-pink); }
.rlabel .copy-btn {
  position: absolute; top: 6px; right: 6px; font-family: var(--font); font-size: 11px; text-transform: none;
  padding: 3px 8px; border-radius: 6px; background: var(--ink); color: #fff; opacity: 0; transition: opacity .15s;
}
.rlabel:hover .copy-btn { opacity: 1; }
.rlabel .none { color: #94A3B8; font-weight: 600; font-size: 11px; }

/* Nutrition + delivery label */
.nlabel {
  background: #fff; border: 1.5px dashed #94A3B8; border-radius: 6px; padding: 10px 12px;
  font-family: Arial, Helvetica, sans-serif; color: #000; transition: transform .15s, box-shadow .15s;
}
.nlabel:hover { transform: translateY(-2px); box-shadow: var(--sh-md); }
.nf-head { background: #A6A6A6; text-align: center; padding: 2px 4px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.nf-head .t { font-weight: 800; letter-spacing: 4px; font-size: 12px; }
.nf-head .m { font-weight: 800; font-size: 11.5px; text-transform: uppercase; }
.nf-dish { text-align: center; font-weight: 800; font-size: 11px; text-transform: uppercase; margin: 3px 0 6px; }
.nf-row { display: flex; align-items: baseline; font-size: 11px; font-weight: 700; line-height: 1.45; }
.nf-row .k { white-space: nowrap; }
.nf-row .dots { flex: 1; border-bottom: 1.5px dotted #000; margin: 0 4px; transform: translateY(-3px); }
.nf-row .v { min-width: 26px; text-align: right; }
.nf-missing { font-size: 11px; color: #B91C1C; text-align: center; padding: 8px 0; font-weight: 600; }
.ship { margin-top: 8px; padding-top: 7px; border-top: 1.5px solid #000; font-size: 10.5px; line-height: 1.35; }
.ship .to { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.ship .to b { font-size: 12.5px; text-transform: uppercase; }
.ship .tag { font-size: 9.5px; font-weight: 800; border: 1.3px solid #000; padding: 0 5px; border-radius: 3px; white-space: nowrap; }
.ship .ad { font-weight: 700; text-transform: uppercase; margin-top: 2px; }
.ship .meta { display: flex; justify-content: space-between; gap: 6px; margin-top: 3px; font-weight: 600; }
.ship .nt { margin-top: 3px; font-style: italic; }

.warn-box {
  display: flex; gap: 10px; align-items: flex-start; background: #FFFBEB; border: 1px solid #FDE68A; color: #92400E;
  padding: 12px 14px; border-radius: 12px; font-size: 13px; margin-bottom: 14px;
}

/* ---------- Modal ---------- */
.modal-bg {
  position: fixed; inset: 0; background: rgba(15,23,42,.5); backdrop-filter: blur(4px); z-index: 100;
  display: grid; place-items: center; padding: 20px; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-bg.show { opacity: 1; pointer-events: auto; }
.modal {
  background: #fff; border-radius: 18px; width: min(720px, 100%); max-height: calc(100vh - 40px);
  display: flex; flex-direction: column; box-shadow: var(--sh-lg); transform: translateY(14px) scale(.98); transition: transform .22s ease;
}
.modal-bg.show .modal { transform: none; }
.modal.sm { width: min(460px, 100%); }
.modal.lg { width: min(920px, 100%); }
.modal-head { display: flex; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line-2); }
.modal-head h3 { font-family: var(--font-display); font-size: 19px; font-weight: 700; }
.modal-head .x { margin-left: auto; width: 34px; height: 34px; border-radius: 10px; font-size: 16px; color: var(--muted); }
.modal-head .x:hover { background: var(--line-2); color: var(--ink); }
.modal-body { padding: 20px 22px; overflow: auto; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 22px; border-top: 1px solid var(--line-2); background: #FAFBFC; border-radius: 0 0 18px 18px; }

/* Excel Import Components */
.excel-dropzone {
  border: 2px dashed #86efac;
  background: var(--g-50);
  border-radius: 14px;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all .2s ease;
  position: relative;
}
.excel-dropzone:hover, .excel-dropzone.dragover {
  border-color: var(--g-600);
  background: #E8F8EE;
  transform: scale(1.008);
}
.excel-dropzone-icon {
  font-size: 38px;
  margin-bottom: 6px;
  line-height: 1;
}
.excel-dropzone-text {
  font-weight: 700;
  color: var(--g-900);
  font-size: 15px;
}
.excel-dropzone-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.excel-preview-table-wrap {
  max-height: 330px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-top: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.excel-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  text-align: left;
}
.excel-preview-table th {
  position: sticky;
  top: 0;
  background: #F8FAFC;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  color: var(--ink-2);
  z-index: 2;
}
.excel-preview-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
}
.excel-preview-table tr:hover td {
  background: #F0FDF4;
}

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid.g4 { grid-template-columns: repeat(4, 1fr); }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.inp, .field select, .field textarea {
  width: 100%; height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; outline: none; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { height: auto; min-height: 74px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.inp:focus, .field select:focus, .field textarea:focus { border-color: var(--g-500); box-shadow: 0 0 0 3px rgba(34,197,94,.14); }
.section-sep { grid-column: 1 / -1; font-size: 11px; font-weight: 700; letter-spacing: 1.2px; color: var(--g-700); text-transform: uppercase; padding-top: 6px; border-top: 1px dashed var(--line); margin-top: 4px; }

.qty-box { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; height: 40px; overflow: hidden; }
.qty-box button { width: 40px; height: 100%; font-size: 18px; color: var(--g-700); background: var(--g-50); }
.qty-box button:hover { background: var(--g-100); }
.qty-box input { flex: 1; border: none; text-align: center; font-weight: 700; outline: none; width: 40px; }

/* request editor */
.req-list { display: flex; flex-direction: column; gap: 8px; }
.req-row { display: flex; align-items: center; gap: 8px; }
.req-row .inp { flex: 1; text-transform: uppercase; font-weight: 600; }
.swatches { display: flex; gap: 4px; }
.sw {
  width: 22px; height: 22px; border-radius: 6px; border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15);
  transition: transform .12s;
}
.sw:hover { transform: scale(1.12); }
.sw.on { border-color: var(--ink); }
/* request presets categorized */
.preset-filter-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 0 6px;
  margin-top: 8px;
  scrollbar-width: thin;
}
.pf-tab {
  padding: 4px 11px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.pf-tab:hover {
  border-color: var(--g-500);
  color: var(--g-700);
  background: var(--g-50);
}
.pf-tab.active {
  background: var(--g-600);
  color: #fff;
  border-color: var(--g-600);
  box-shadow: 0 1px 3px rgba(22, 163, 74, 0.3);
}

.preset-groups-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}
.preset-group {
  background: #F8FAFC;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 8px 12px 10px;
  transition: all 0.15s;
}
.preset-group-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-2);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.presets { display: flex; flex-wrap: wrap; gap: 5px; }
.preset {
  font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 99px; border: 1px dashed var(--line);
  color: var(--ink-2); background: #fff; cursor: pointer; transition: all .12s;
}
.preset:hover { border-color: var(--g-500); color: var(--g-700); background: var(--g-50); transform: translateY(-1px); }
.req-preview { margin-top: 12px; }
.req-preview .rlabel { min-height: auto; max-width: 260px; margin: 0 auto; }

.toggle-line { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.toggle-line:last-child { border-bottom: none; }
.toggle-line h4 { font-size: 14px; font-weight: 600; }
.toggle-line p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #CBD5E1; border-radius: 99px; transition: .2s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--g-600); }
.switch input:checked + span::after { transform: translateX(20px); }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.settings-grid .card { padding: 4px 20px 10px; }
.settings-grid .card h3 { font-size: 15px; padding: 16px 0 6px; }

.cat-dot { display: inline-block; width: 12px; height: 12px; border-radius: 4px; border: 1px solid rgba(0,0,0,.15); vertical-align: middle; margin-right: 6px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translate(-50%, 30px); z-index: 200; opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 13.5px; font-weight: 500;
  box-shadow: var(--sh-lg); display: flex; align-items: center; gap: 10px; transition: all .25s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast .ti { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--g-500); font-size: 12px; }
.toast.error .ti { background: var(--red); }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) { .stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 960px) {
  :root { --sidebar: 74px; }
  .brand h1, .brand small, .nav-item span:not(.ni), .nav-label, .nav-item .count, .auto-chip .txt { display: none; }
  .nav-item { justify-content: center; }
  .settings-grid { grid-template-columns: 1fr; }
  .label-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Perubahan Customer Styles ---------- */
.btn-wa {
  background: #25D366;
  color: #FFFFFF !important;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(37, 211, 102, .32);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.btn-wa:hover {
  background: #1EBE5D;
  box-shadow: 0 5px 14px rgba(37, 211, 102, .45);
  transform: translateY(-1px);
}
.btn-wa:active {
  transform: scale(0.97);
}

.diff-box {
  background: #F8FAFC;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12.5px;
  line-height: 1.45;
}
.diff-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}
.diff-item:last-child {
  margin-bottom: 0;
}
.diff-badge-old {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  background: #FEE2E2;
  color: #B91C1C;
  padding: 1px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}
.diff-badge-new {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  background: #DCFCE7;
  color: #15803D;
  padding: 1px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}
.diff-val-old {
  color: #64748B;
  text-decoration: line-through;
  word-break: break-word;
}
.diff-val-new {
  color: #0F172A;
  font-weight: 600;
  word-break: break-word;
}
.diff-note {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed #CBD5E1;
  font-size: 11.5px;
  color: #B45309;
  display: flex;
  align-items: center;
  gap: 5px;
}

.change-type-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.change-type-pill.alamat { background: #E0E7FF; color: #3730A3; }
.change-type-pill.tanggal { background: #FEF3C7; color: #92400E; }
.change-type-pill.slot { background: #E0F2FE; color: #0369A1; }
.change-type-pill.request { background: #FCE7F3; color: #9D174D; }
.change-type-pill.cutlery { background: #F3E8FF; color: #6B21A8; }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.status-badge.pending {
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FCD34D;
}
.status-badge.pending::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #F59E0B;
  box-shadow: 0 0 0 0 rgba(245, 158, 11, .7);
  animation: pulse 1.8s infinite;
}
.status-badge.confirmed {
  background: #DCFCE7;
  color: #15803D;
  border: 1px solid #86EFAC;
}
.status-badge.rejected {
  background: #FEE2E2;
  color: #B91C1C;
  border: 1px solid #FCA5A5;
}

.btn-status-action {
  height: 28px;
  padding: 0 8px;
  font-size: 11.5px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ============================================
   PRINT
   ============================================ */
#print-area { display: none; }

@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }
  body {
    background: #fff;
    margin: 0;
    padding: 0;
  }
  .admin, .modal-bg, .toast { display: none !important; }
  #print-area { display: block; margin: 0; padding: 0; }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }

  /* -------------------------------------------
     REQUEST LABELS: EXACT 3x4 (4 BARIS DI A4)
     ------------------------------------------- */
  .p-page-request {
    width: 210mm;
    height: 297mm;
    max-height: 297mm;
    padding: 16mm 12mm 0 12mm;
    box-sizing: border-box;
    page-break-after: always;
    break-after: page;
    overflow: hidden;
    background: #fff;
  }
  .p-page-request:last-child {
    page-break-after: auto;
    break-after: auto;
  }

  .p-grid-request {
    display: grid;
    grid-template-columns: repeat(3, 62mm);
    grid-template-rows: repeat(4, 54mm);
    column-gap: 0;
    row-gap: 0;
    justify-content: center;
    align-content: start;
    width: 186mm;
    margin: 0 auto;
    box-sizing: border-box;
  }

  .p-grid-request .rlabel {
    width: 62mm;
    height: 54mm;
    max-height: 54mm;
    box-sizing: border-box;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transform: none !important;
    background: transparent !important;
    padding: 3.5mm 1.5mm 0 !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    overflow: hidden;
    font-family: 'Times New Roman', Times, serif !important;
  }
  .p-grid-request .rlabel.empty-slot {
    visibility: hidden !important;
    border: none !important;
  }
  .p-grid-request .rlabel .rn {
    font-family: 'Times New Roman', Times, serif !important;
    font-size: 13.5pt !important;
    font-weight: 700 !important;
    color: #000 !important;
    line-height: 1.15 !important;
    margin-bottom: 2px !important;
    text-transform: uppercase !important;
  }
  .p-grid-request .rlabel .rc {
    font-family: 'Times New Roman', Times, serif !important;
    font-size: 11pt !important;
    font-weight: 700 !important;
    color: #000 !important;
    line-height: 1.15 !important;
    margin-bottom: 3.5px !important;
    text-transform: uppercase !important;
  }
  .p-grid-request .rlabel .rq {
    font-family: 'Times New Roman', Times, serif !important;
    font-size: 10.5pt !important;
    font-weight: 700 !important;
    color: #000 !important;
    line-height: 1.3 !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5px;
    width: 100%;
    text-transform: uppercase !important;
  }
  .p-grid-request .rlabel .rq-line {
    display: inline-block;
    line-height: 1.3 !important;
  }
  .p-grid-request .rlabel mark {
    font-family: 'Times New Roman', Times, serif !important;
    font-weight: 700 !important;
    color: #000 !important;
    padding: 0 1.5px !important;
    line-height: inherit !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .p-grid-request .rlabel mark.yellow { background-color: #FFFF00 !important; }
  .p-grid-request .rlabel mark.cyan   { background-color: #00FFFF !important; }
  .p-grid-request .rlabel mark.red    { background-color: #FF0000 !important; }
  .p-grid-request .rlabel mark.gray   { background-color: #C0C0C0 !important; }
  .p-grid-request .rlabel mark.green  { background-color: #00FF00 !important; }
  .p-grid-request .rlabel mark.pink   { background-color: #FF00FF !important; }

  .p-grid-request .rlabel .copy-btn { display: none !important; }

  /* -------------------------------------------
     SHIPPING & NUTRITION LABELS
     ------------------------------------------- */
  .p-grid { display: grid; grid-template-columns: repeat(var(--cols, 3), 1fr); gap: 0; padding: 10mm; }
  .p-grid .rlabel, .p-grid .nlabel {
    border-radius: 0; border: 1px dashed #777; break-inside: avoid; page-break-inside: avoid; box-shadow: none; transform: none;
  }
  .p-grid .rlabel { min-height: 34mm; display: flex; flex-direction: column; justify-content: center; padding: 3mm 2mm; }
  .p-grid .nlabel { min-height: 62mm; padding: 3mm; }
  .copy-btn { display: none !important; }

  .p-manifest h1 { font-family: Arial, sans-serif; font-size: 15pt; margin-bottom: 2mm; }
  .p-manifest .ph { display: flex; justify-content: space-between; font-family: Arial, sans-serif; font-size: 9pt; margin-bottom: 3mm; }
  .p-manifest table { width: 100%; border-collapse: collapse; font-family: Arial, sans-serif; font-size: 8.5pt; }
  .p-manifest th { background: #D9D9D9; border: 1px solid #000; padding: 1.5mm; text-transform: uppercase; }
  .p-manifest td { border: 1px solid #000; padding: 1.5mm; vertical-align: middle; font-weight: 700; text-transform: uppercase; }
  .p-manifest td.c { text-align: center; }
  .p-manifest td.menu { background: #00FFFF; }
  .p-manifest td.dup { background: #9FC5E8; }
  .p-manifest .group { break-after: page; }
  .p-manifest .group:last-child { break-after: auto; }
  .p-manifest .sign { margin-top: 6mm; display: flex; justify-content: space-between; font-family: Arial, sans-serif; font-size: 9pt; }
}
