/* ─── Reset & Base ──────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

:root {
  --color-primary:        #F97316;
  --color-primary-light:  #FFEDD5;
  --color-primary-hover:  #EA6C00;
  --color-bg:             #F3F4F6;
  --color-surface:        #FFFFFF;
  --color-border:         #E5E7EB;
  --color-text-primary:   #111827;
  --color-text-secondary: #6B7280;
  --color-text-muted:     #9CA3AF;
  --color-success:        #22C55E;
  --color-success-bg:     #DCFCE7;
  --color-warning:        #F59E0B;
  --color-warning-bg:     #FEF3C7;
  --color-danger:         #EF4444;
  --color-danger-bg:      #FEE2E2;
  --color-info:           #3B82F6;
  --color-info-bg:        #DBEAFE;
  --color-purple:         #7C3AED;
  --color-purple-bg:      #EDE9FE;
  --sidebar-width:         200px;
  --sidebar-collapsed-width: 52px;
  --topbar-height:        56px;
  --radius:               10px;
}

body {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--color-text-primary);
  background: var(--color-bg);
  line-height: 1.5;
}

/* ─── Layout ─────────────────────────────────────────────────────────────────── */
.app-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: width .22s ease;
  overflow: hidden;
}

/* Collapsed sidebar */
.app-layout--collapsed .sidebar { width: var(--sidebar-collapsed-width); }
.app-layout--collapsed .main-content { margin-left: var(--sidebar-collapsed-width); }
.app-layout--collapsed .sidebar-logo { justify-content: center; padding: 0; }
.app-layout--collapsed .sidebar-logo-img { display: none; }
.app-layout--collapsed .nav-label { display: none; }
.app-layout--collapsed .nav-section-label { display: none; }
.app-layout--collapsed .nav-item {
  justify-content: center;
  padding: 10px 0;
  position: relative;
}
.app-layout--collapsed .nav-item::after {
  content: attr(data-label);
  position: absolute;
  left: calc(100% + 6px);
  top: 50%; transform: translateY(-50%);
  background: var(--color-text-primary); color: #fff;
  padding: 5px 10px; border-radius: 6px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
  pointer-events: none;
  opacity: 0; transition: opacity .15s;
  z-index: 200;
}
.app-layout--collapsed .nav-item:hover::after { opacity: 1; }
.app-layout--collapsed .sidebar-footer {
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
  gap: 4px;
}
.app-layout--collapsed .sidebar-user { display: none; }
.app-layout--collapsed .btn-logout { padding: 6px 8px; gap: 0; }
.app-layout--collapsed .logout-text { display: none; }
.sidebar-logo {
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: var(--topbar-height);
}
.sidebar-logo-img { height: 42px; width: auto; object-fit: contain; display: block; }
.sidebar-logo-sub { font-size: 10.5px; font-weight: 500; color: var(--color-text-muted); letter-spacing: .02em; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 12px; }
.nav-section-label {
  font-size: 10px; font-weight: 600; letter-spacing: .08em;
  color: var(--color-text-muted); text-transform: uppercase;
  padding: 12px 8px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  cursor: pointer; transition: background .15s;
  color: var(--color-text-secondary);
  font-weight: 500; font-size: 13.5px;
  user-select: none;
  margin-bottom: 2px;
}
.nav-item:hover { background: var(--color-bg); color: var(--color-text-primary); }
.nav-item.active { background: var(--color-primary-light); color: var(--color-primary); font-weight: 600; }
.nav-item svg { flex-shrink: 0; }
.nav-item.active svg { stroke: var(--color-primary); }

/* Main */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left .22s ease;
}
.topbar {
  height: var(--topbar-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex; align-items: center;
  padding: 0 24px;
  gap: 12px;
  position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-weight: 600; font-size: 15px; color: var(--color-text-primary); }
.topbar-spacer { flex: 1; }
.topbar-user {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 500;
  color: var(--color-text-secondary);
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  white-space: nowrap;
}

.content-area { padding: 24px; flex: 1; }

/* ─── Cards ──────────────────────────────────────────────────────────────────── */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px 24px;
}
.page-header { margin-bottom: 20px; display: flex; align-items: flex-start; justify-content: space-between; }
.page-title  { font-size: 22px; font-weight: 700; color: var(--color-text-primary); }
.page-subtitle { font-size: 13px; color: var(--color-text-secondary); margin-top: 2px; }

/* ─── Forms ──────────────────────────────────────────────────────────────────── */
.input {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--color-text-primary);
  background: var(--color-surface);
  outline: none;
  transition: border-color .15s;
  width: 100%;
}
.input:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(249,115,22,.1); }
.input::placeholder { color: var(--color-text-muted); }

/* ─── Cross-browser form control normalization ───────────────────────────────
   Menghilangkan native Safari stepper (↑↓) pada select dan segmented date
   picker, diganti dengan chevron SVG dan tampilan yang konsisten di semua browser.
──────────────────────────────────────────────────────────────────────────── */

/* Select: hapus native arrow, pasang chevron SVG */
select.input {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px 14px;
  padding-right: 34px;
  cursor: pointer;
}
select.input:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(249,115,22,.1); }

/* Date input: hapus segmented native Safari UI, tampilkan sebagai input biasa */
input[type="date"].input,
input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  cursor: text;
}
/* Teks editable (dd/mm/yyyy) rata kiri, tanpa padding tambahan dari browser */
input[type="date"]::-webkit-datetime-edit { padding: 0; }
input[type="date"]::-webkit-datetime-edit-fields-wrapper { padding: 0; }
/* Hapus spinner stepper bawaan Safari */
input[type="date"]::-webkit-inner-spin-button,
input[type="date"]::-webkit-outer-spin-button { display: none; -webkit-appearance: none; }
/* Calendar icon: sedikit redup agar sesuai warna design system */
input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0.45;
  cursor: pointer;
  padding: 0;
  margin-left: 4px;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover { opacity: 0.75; }

.filter-card { margin-bottom: 16px; }
.filter-search-row { margin-bottom: 12px; }
.filter-search-wrap {
  position: relative; display: flex; align-items: center;
}
.filter-search-icon {
  position: absolute; left: 10px;
  color: var(--color-text-muted); pointer-events: none;
}
.filter-search-input {
  padding-left: 34px !important; padding-right: 32px !important;
}
.filter-search-clear {
  position: absolute; right: 8px;
  background: none; border: none; cursor: pointer; padding: 2px;
  color: var(--color-text-muted); display: flex; align-items: center;
  border-radius: 4px;
}
.filter-search-clear:hover { color: var(--color-text-primary); background: var(--color-bg); }
.filter-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filter-row .input { width: auto; }
.filter-group .input { min-width: 130px; }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--color-text-secondary); margin-bottom: 5px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--color-border); }
.form-row { display: flex; gap: 12px; }
.hint { font-size: 12px; color: var(--color-text-muted); margin-top: 6px; }

/* ─── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px; font-size: 13.5px; font-weight: 600;
  cursor: pointer; border: none; transition: background .15s, opacity .15s;
  white-space: nowrap; font-family: inherit;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary   { background: var(--color-primary);  color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--color-primary-hover); }
.btn-secondary { background: var(--color-surface);  color: var(--color-text-primary); border: 1px solid var(--color-border); }
.btn-secondary:hover:not(:disabled) { background: var(--color-bg); }
.btn-success   { background: var(--color-success);  color: #fff; }
.btn-danger    { background: var(--color-danger);   color: #fff; }
.btn-info      { background: var(--color-info);     color: #fff; }
.btn-ghost     { background: transparent; color: var(--color-primary); border: none; }
.btn-sm        { padding: 5px 12px; font-size: 12.5px; }

.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 6px;
  border: 1px solid var(--color-border); background: var(--color-surface);
  cursor: pointer; transition: background .12s;
  color: var(--color-text-secondary);
}
.btn-icon:hover { background: var(--color-bg); color: var(--color-text-primary); }
.btn-icon.btn-success { background: var(--color-success-bg); border-color: var(--color-success); color: var(--color-success); }
.btn-icon.btn-danger  { background: var(--color-danger-bg);  border-color: var(--color-danger);  color: var(--color-danger); }
.btn-icon.btn-primary { background: var(--color-primary-light); border-color: var(--color-primary); color: var(--color-primary); }
.btn-icon.btn-info    { background: var(--color-info-bg); border-color: var(--color-info); color: var(--color-info); }
.action-btns { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }

/* ─── Badges ─────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.badge-neutral { background: #F3F4F6; color: #6B7280; }
.badge-warning { background: var(--color-warning-bg); color: #B45309; }
.badge-info    { background: var(--color-info-bg);    color: #1D4ED8; }
.badge-success { background: var(--color-success-bg); color: #15803D; }
.badge-danger  { background: var(--color-danger-bg);  color: #B91C1C; }
.badge-purple  { background: var(--color-purple-bg);  color: var(--color-purple); }

.platform-tag {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 600; text-transform: capitalize;
  background: var(--color-bg); color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}
.platform-shopee   { background: #fff0f0; color: #e53935; border-color: #ffcdd2; }
.platform-tokopedia { background: #e8f5e9; color: #2e7d32; border-color: #c8e6c9; }
.platform-lazada   { background: #f3e5f5; color: #7b1fa2; border-color: #e1bee7; }
.platform-tiktok   { background: #fce4ec; color: #ad1457; border-color: #f8bbd0; }
.platform-blibli   { background: #e3f2fd; color: #1565c0; border-color: #bbdefb; }

/* ─── Table ──────────────────────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }
.order-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.order-table th {
  padding: 10px 12px; text-align: left;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--color-text-secondary);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}
.order-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
.order-table tr:last-child td { border-bottom: none; }
.order-table tr:hover td { background: #fafafa; }
.order-table tr.row-highlight td { animation: highlight-fade 3s ease forwards; }
@keyframes highlight-fade {
  0%   { background: #FFEDD5; }
  80%  { background: #FFEDD5; }
  100% { background: transparent; }
}
.order-table input[type="checkbox"] { cursor: pointer; width: 15px; height: 15px; accent-color: var(--color-primary); }
.bundle-child-tr td { border-bottom: none !important; padding-top: 0 !important; background: #FAFAFA; }
.actions-cell { white-space: nowrap; }
.text-right  { text-align: right; }
.text-center { text-align: center; }

/* Detail table */
.detail-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.detail-table th {
  padding: 8px 12px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--color-text-secondary); background: var(--color-bg);
  border-bottom: 1px solid var(--color-border); text-align: left;
}
.detail-table td {
  padding: 9px 12px; border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}

/* ─── Detail Grid ────────────────────────────────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.detail-section { display: flex; flex-direction: column; gap: 0; }
.section-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--color-primary); margin-bottom: 10px;
}
.detail-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 7px 0; border-bottom: 1px solid var(--color-border);
  font-size: 13px;
}
.detail-row:last-child { border-bottom: none; }
.detail-row > span:first-child { color: var(--color-text-secondary); flex-shrink: 0; }
.detail-row > span:last-child  { text-align: right; font-weight: 500; }
.mt-16 { margin-top: 16px; }

/* ─── Modal ──────────────────────────────────────────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-start; justify-content: flex-end; }
.modal.hidden { display: none; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.4); backdrop-filter: blur(2px); }
.modal-panel {
  position: relative; z-index: 1;
  background: var(--color-surface);
  width: min(680px, 95vw);
  height: 100vh;
  display: flex; flex-direction: column;
  box-shadow: -4px 0 24px rgba(0,0,0,.1);
  overflow: hidden;
}
.modal-sm { width: min(440px, 95vw); }
.modal-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}
.modal-header h3 { font-size: 15px; font-weight: 700; flex: 1; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px; }

/* ── Centered modal variant (detail pesanan) ── */
.modal--center {
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal--center .modal-panel {
  width: min(960px, 96vw);
  height: auto;
  max-height: min(90vh, 880px);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0,0,0,.22), 0 0 0 1px rgba(0,0,0,.07);
  animation: modal-in .18s ease;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(-10px) scale(.985); }
  to   { opacity: 1; transform: none; }
}
.modal--center .modal-body { padding: 0; }

/* Header redesign — detail modal */
.modal-header--detail {
  background: var(--color-bg);
  padding: 18px 24px;
  align-items: flex-start;
  gap: 16px;
}
.mh-left { flex: 1; min-width: 0; }
.mh-left h3 { font-size: 16px; font-weight: 700; color: var(--color-text-primary); }
.modal-subtitle { display: flex; align-items: center; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.mh-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }

/* ─── Order Detail — redesain ────────────────────────────────────────────────── */
.od-body { display: flex; flex-direction: column; }

/* Top 2-col grid: Info Order | Info Penerima */
.od-top-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--color-border);
}
.od-card {
  padding: 20px 24px;
  display: flex; flex-direction: column;
}
.od-card + .od-card { border-left: 1px solid var(--color-border); }
.od-card-title {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .09em; color: var(--color-primary);
  margin-bottom: 12px;
}
.od-row {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  padding: 7px 0; border-bottom: 1px solid var(--color-border);
  font-size: 13px;
}
.od-row:last-child { border-bottom: none; }
.od-row > span:first-child { color: var(--color-text-secondary); flex-shrink: 0; min-width: 88px; }
.od-row > span:last-child { text-align: right; font-weight: 500; color: var(--color-text-primary); word-break: break-word; }
.od-row--notes > span:last-child { color: var(--color-warning); font-style: italic; }

/* Section wrapper */
.od-section { border-bottom: 1px solid var(--color-border); }
.od-section--last { border-bottom: none; }
.od-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px 8px;
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .09em; color: var(--color-primary);
}
.od-section-count {
  font-size: 11px; font-weight: 600; color: var(--color-text-muted);
  background: var(--color-bg); border-radius: 999px;
  padding: 2px 8px; text-transform: none; letter-spacing: 0;
}

/* Items list */
.od-items { padding: 0 24px 16px; }
.od-item { padding: 13px 0; }
.od-item--border { border-top: 1px solid var(--color-border); }
.od-item-main { display: flex; gap: 14px; align-items: flex-start; }
.od-item-img {
  width: 58px; height: 58px; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--color-border); flex-shrink: 0;
}
.od-item-img-ph {
  width: 58px; height: 58px; border-radius: 8px;
  border: 1px dashed var(--color-border); background: var(--color-bg); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.od-item-detail { flex: 1; min-width: 0; }
.od-item-name { font-size: 13.5px; font-weight: 700; color: var(--color-text-primary); line-height: 1.4; }
.od-item-orig-name { font-size: 12px; color: var(--color-text-muted); margin-top: 2px; }
.od-item-meta { display: flex; gap: 10px; margin-top: 5px; font-size: 12px; color: var(--color-text-secondary); flex-wrap: wrap; }
.od-item-price { text-align: right; flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.od-item-qty-badge {
  background: var(--color-primary-light); color: var(--color-primary);
  border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; white-space: nowrap;
}
.od-item-sell { font-size: 14px; font-weight: 700; color: var(--color-text-primary); }
.od-item-orig-price { font-size: 11.5px; color: var(--color-text-muted); text-decoration: line-through; }

/* Bundle children */
.od-bundle-children { margin-top: 8px; padding-left: 72px; display: flex; flex-direction: column; gap: 5px; }
.od-bundle-child { display: flex; align-items: baseline; gap: 6px; }
.od-bundle-icon { color: var(--color-text-muted); font-size: 13px; flex-shrink: 0; }
.od-bundle-info { flex: 1; min-width: 0; }
.od-bundle-name { font-size: 13px; font-weight: 600; color: var(--color-text-primary); }
.od-bundle-sku { font-size: 11.5px; color: var(--color-text-muted); margin-left: 6px; }
.od-bundle-qty { font-size: 12px; font-weight: 600; color: var(--color-text-secondary); white-space: nowrap; flex-shrink: 0; }

/* Shipping info grid */
.od-info-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px; padding: 4px 24px 20px;
}
.od-info-block { display: flex; flex-direction: column; gap: 3px; }
.od-info-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--color-text-muted); }
.od-info-value { font-size: 13.5px; font-weight: 600; color: var(--color-text-primary); word-break: break-all; }

/* Booking order note */
.od-booking-note {
  margin: 8px 16px 16px;
  padding: 10px 14px;
  background: #FEF3C7;
  border: 1px solid #FDE68A;
  border-radius: 8px;
  font-size: 13px;
  color: #92400E;
  line-height: 1.5;
}

/* Financial strip */
.od-fin-grid {
  display: flex; flex-wrap: wrap; padding: 8px 16px 16px;
}
.od-fin-block {
  flex: 1; min-width: 120px;
  display: flex; flex-direction: column; gap: 3px;
  padding: 10px 12px;
  border-right: 1px solid var(--color-border);
}
.od-fin-block:last-child { border-right: none; }
.od-fin-label { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--color-text-muted); }
.od-fin-value { font-size: 14px; font-weight: 600; color: var(--color-text-primary); margin-top: 2px; }
.od-fin-block--highlight { background: #f0fdf4; border-radius: 8px; border-right: none; }

/* ─── Bulk Toolbar ───────────────────────────────────────────────────────────── */
.bulk-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--color-primary-light);
  border: 1px solid #fed7aa;
  border-radius: var(--radius);
  padding: 10px 16px;
  margin-bottom: 12px;
  font-size: 13px; font-weight: 500; color: var(--color-primary);
}
.bulk-toolbar.hidden { display: none; }

/* ─── Scan Page ──────────────────────────────────────────────────────────────── */
.scan-layout { display: flex; flex-direction: column; gap: 20px; }

/* ── Scan bar horizontal ── */
.scan-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  border-left: 4px solid var(--color-primary);
}
.scan-bar-left {
  display: flex; align-items: center; gap: 14px; flex-shrink: 0;
}
.scan-bar-icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--color-primary-light); color: var(--color-primary);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.scan-bar-title { font-size: 14px; font-weight: 700; color: var(--color-text-primary); }
.scan-bar-sub   { font-size: 12px; color: var(--color-text-muted); margin-top: 1px; }

.scan-bar-right {
  display: flex; align-items: center; gap: 10px; flex: 1; max-width: 560px;
}
.scan-bar-input {
  flex: 1; font-size: 15px; font-weight: 600;
  letter-spacing: .04em; height: 42px; padding: 0 14px;
  border-radius: 8px;
}
.scan-bar-input:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(249,115,22,.15); }
.scan-bar-btn {
  display: flex; align-items: center; gap: 6px;
  height: 42px; padding: 0 18px; white-space: nowrap; flex-shrink: 0;
}

/* animated pulse dot — menandakan siap scan */
.scan-bar-pulse {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--color-success); flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(34,197,94,.5);
  animation: scan-pulse 1.8s ease-in-out infinite;
}
@keyframes scan-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,.5); }
  70%  { box-shadow: 0 0 0 8px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

/* legacy */
.scan-input-card { text-align: center; max-width: 560px; margin: 0 auto; width: 100%; }
.scan-icon-wrap { margin: 8px auto 12px; width: 72px; height: 72px; display: flex; align-items: center; justify-content: center; background: var(--color-primary-light); border-radius: 50%; }
.scan-label { font-size: 14px; color: var(--color-text-secondary); margin-bottom: 16px; }
.scan-input-wrap { display: flex; gap: 8px; }
.scan-input { font-size: 16px; text-align: center; letter-spacing: .05em; font-weight: 600; }

/* ── Scan result card ── */
.scan-result        { max-width: 640px; margin: 0 auto; width: 100%; }
.scan-result-card   { padding: 0; overflow: hidden; }
.scan-not-found     { text-align: center; padding: 40px 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; }

/* status bar */
.scan-status-bar    { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--color-border); }
.scan-found-label   { display: flex; align-items: center; gap: 6px; color: var(--color-success); font-size: 13px; font-weight: 600; }
.scan-result-actions{ display: flex; gap: 8px; flex-wrap: wrap; }

/* resi block */
.scan-resi-block    { padding: 16px 20px 12px; }
.scan-resi-number   { font-size: 1.35rem; font-weight: 800; letter-spacing: .06em; color: var(--color-text-primary); margin-bottom: 8px; }
.scan-badges        { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* divider */
.scan-divider       { height: 1px; background: var(--color-border); margin: 0 20px; }

/* info grid */
.scan-info-grid     { display: grid; grid-template-columns: 1fr 1fr; gap: 0; padding: 14px 20px; }
.scan-info-col      { display: flex; flex-direction: column; gap: 3px; }
.scan-section-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--color-text-muted); margin-bottom: 2px; }
.scan-info-value--bold { font-size: 14px; font-weight: 700; color: var(--color-text-primary); }
.scan-info-value--sub  { font-size: 12.5px; color: var(--color-text-secondary); }

/* catatan */
.scan-notes { display: flex; align-items: flex-start; gap: 8px; padding: 10px 20px; background: var(--color-warning-bg); font-size: 13px; color: var(--color-text-primary); }

/* COD row */
.scan-cod-row       { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; background: var(--color-text-primary); }
.scan-cod-label     { font-size: 15px; font-weight: 900; letter-spacing: .15em; color: #fff; }
.scan-cod-amount    { font-size: 15px; font-weight: 700; color: #fff; }

/* items section */
.scan-items         { padding: 0 20px 16px; }
.scan-item          { padding: 14px 0; }
.scan-item--border  { border-top: 1px solid var(--color-border); }
.scan-item-main     { display: flex; gap: 14px; align-items: flex-start; }

/* product image */
.scan-item-img-wrap { position: relative; flex-shrink: 0; width: 64px; height: 64px; }
.scan-item-img      { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--color-border); cursor: zoom-in; display: block; transition: opacity .15s; }
.scan-item-img:hover { opacity: .85; }

/* lightbox overlay */
.img-lightbox {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.72);
  display: flex; align-items: center; justify-content: center;
  cursor: zoom-out;
  animation: lb-in .18s ease;
}
@keyframes lb-in { from { opacity:0 } to { opacity:1 } }
.img-lightbox img {
  max-width: 88vw; max-height: 88vh;
  object-fit: contain; border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0,0,0,.5);
  animation: lb-scale .18s ease;
}
@keyframes lb-scale { from { transform:scale(.88) } to { transform:scale(1) } }
.img-lightbox-close {
  position: absolute; top: 20px; right: 20px;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.15); border: none;
  color: #fff; cursor: pointer; font-size: 20px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.img-lightbox-close:hover { background: rgba(255,255,255,.28); }
.scan-item-img-placeholder {
  width: 64px; height: 64px; border-radius: 8px; border: 1px solid var(--color-border);
  background: var(--color-bg); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.scan-item-detail   { flex: 1; min-width: 0; }
.scan-item-name     { font-size: 14px; font-weight: 700; color: var(--color-text-primary); line-height: 1.4; }
.scan-item-orig     { font-size: 12px; color: var(--color-text-muted); margin-top: 2px; }
.scan-item-meta     { display: flex; gap: 10px; margin-top: 5px; font-size: 12px; color: var(--color-text-secondary); }
.scan-item-qty      { color: var(--color-text-primary); }

/* bundle children */
.scan-bundle-children { margin-top: 8px; padding-left: 78px; display: flex; flex-direction: column; gap: 6px; }
.scan-bundle-child  { display: flex; align-items: baseline; gap: 6px; }
.scan-bundle-icon   { color: var(--color-text-muted); font-size: 13px; flex-shrink: 0; }
.scan-bundle-info   { flex: 1; min-width: 0; }
.scan-bundle-name   { font-size: 13px; font-weight: 600; color: var(--color-text-primary); }
.scan-bundle-sku    { font-size: 11.5px; color: var(--color-text-muted); margin-left: 6px; }
.scan-bundle-qty    { font-size: 12px; font-weight: 600; color: var(--color-text-secondary); white-space: nowrap; flex-shrink: 0; }

/* legacy — masih dipakai di tempat lain */
.scan-result-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.scan-summary-grid  { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 12px; margin: 16px 0; }
.summary-block      { display: flex; flex-direction: column; gap: 3px; }
.summary-label      { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--color-text-muted); }
.summary-value      { font-size: 14px; font-weight: 600; color: var(--color-text-primary); }
.scan-item-row      { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--color-border); }
.scan-item-row:last-child { border-bottom: none; }
.item-num           { width: 22px; height: 22px; background: var(--color-primary-light); color: var(--color-primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.item-info          { flex: 1; }
.item-name          { font-weight: 600; font-size: 13.5px; }
.item-price         { font-weight: 700; color: var(--color-primary); white-space: nowrap; }

/* ─── Progress Bar ───────────────────────────────────────────────────────────── */
.progress-bar-wrap { background: var(--color-border); border-radius: 999px; height: 6px; }
.progress-bar { background: var(--color-primary); height: 100%; border-radius: 999px; transition: width .3s; }

/* ─── States ─────────────────────────────────────────────────────────────────── */
.loading {
  text-align: center; padding: 48px;
  color: var(--color-text-secondary); font-size: 14px;
}
.loading::before { content: ''; display: block; width: 28px; height: 28px; border: 3px solid var(--color-border); border-top-color: var(--color-primary); border-radius: 50%; animation: spin .7s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

.load-more-banner {
  text-align: center; padding: 8px 16px;
  font-size: 13px; color: var(--color-text-secondary);
  background: var(--color-bg); border-top: 1px solid var(--color-border);
}

/* ─── Dasbor ─────────────────────────────────────────────────────────────────── */

/* Stat Cards */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
  transition: box-shadow .15s, transform .15s;
}
.stat-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); transform: translateY(-2px); }
.stat-card--skeleton {
  height: 128px;
  background: linear-gradient(90deg, #f3f4f6 25%, #e9eaec 50%, #f3f4f6 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.stat-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.stat-icon--orange  { background: #FFEDD5; color: #F97316; }
.stat-icon--warning { background: #FEF3C7; color: #D97706; }
.stat-icon--info    { background: #DBEAFE; color: #2563EB; }
.stat-icon--success { background: #DCFCE7; color: #16A34A; }
.stat-icon--purple  { background: #EDE9FE; color: #7C3AED; }

.stat-card-value { font-size: 30px; font-weight: 700; color: var(--color-text-primary); line-height: 1; }
.stat-card-label { font-size: 13px; font-weight: 600; color: var(--color-text-primary); margin-top: 8px; }
.stat-card-sub   { font-size: 12px; color: var(--color-text-muted); margin-top: 2px; }

/* Charts Row */
.dash-charts-row {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 16px;
  margin-bottom: 20px;
}
.dash-charts-row--3 {
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  margin-top: 20px;
}
.dash-charts-row--2 {
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  margin-top: 20px;
}
#chart-products { max-height: 360px; }
.dash-chart-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.dash-chart-title  { font-size: 14px; font-weight: 600; color: var(--color-text-primary); }
.dash-chart-sub    { font-size: 11px; color: var(--color-text-muted); }

/* Legend */
.dash-legend { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; max-height: 200px; overflow-y: auto; }
.dash-legend-item  { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.dash-legend-dot   { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dash-legend-label { flex: 1; color: var(--color-text-secondary); }
.dash-legend-value { font-weight: 600; color: var(--color-text-primary); }

/* Status Bars */
.status-bars { display: flex; flex-direction: column; gap: 12px; }
.status-bar-row    { display: flex; align-items: center; gap: 12px; }
.status-bar-label  { width: 130px; flex-shrink: 0; font-size: 13px; color: var(--color-text-secondary); }
.status-bar-track  { flex: 1; height: 8px; background: var(--color-bg); border-radius: 4px; overflow: hidden; }
.status-bar-fill   { height: 100%; border-radius: 4px; transition: width .5s ease; }
.status-bar-count  { width: 100px; display: flex; align-items: center; justify-content: flex-end; gap: 6px; font-size: 13px; white-space: nowrap; }
.status-bar-num    { font-weight: 600; color: var(--color-text-primary); }
.status-bar-pct    { font-weight: 400; min-width: 36px; text-align: right; }

.empty-state, .error-state {
  text-align: center; padding: 48px;
  color: var(--color-text-secondary);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.error-state { color: var(--color-danger); }

/* ─── Toast ──────────────────────────────────────────────────────────────────── */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--color-text-primary); color: #fff;
  padding: 12px 18px; border-radius: var(--radius);
  font-size: 13.5px; font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  animation: slideIn .2s ease;
  max-width: 320px;
}
.toast.success { background: var(--color-success); }
.toast.error   { background: var(--color-danger);  }
.toast.info    { background: var(--color-info);    }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ─── Sidebar Footer ────────────────────────────────────────────────────────── */
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  min-width: 0;
}
.sidebar-user span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 7px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, color .15s, border-color .15s;
}
.btn-logout:hover {
  background: #FEE2E2;
  border-color: #FECACA;
  color: #B91C1C;
}

/* ─── Utilities ──────────────────────────────────────────────────────────────── */
.hidden        { display: none !important; }
.font-bold     { font-weight: 700; }
.font-mono     { font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace; }
.text-sm       { font-size: 12.5px; }
.text-muted    { color: var(--color-text-muted); }
.text-primary  { color: var(--color-primary); }
.text-success  { color: var(--color-success); }
.text-danger   { color: var(--color-danger); }
.text-warning  { color: var(--color-warning); }

/* ─── Pagination ─────────────────────────────────────────────────────────────── */
.pagination       { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 14px 0 4px; }
.pag-info         { font-size: 13px; color: var(--color-text-muted); }
.pag-pages        { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pag-btn          { min-width: 34px; height: 34px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--color-border); background: #fff; color: var(--color-text-primary); font-size: 13px; font-weight: 500; cursor: pointer; transition: all .15s; }
.pag-btn:hover:not(:disabled) { border-color: var(--color-primary); color: var(--color-primary); background: var(--color-primary-light); }
.pag-btn:disabled { opacity: .35; cursor: default; }
.pag-btn--active  { background: var(--color-primary); color: #fff; border-color: var(--color-primary); font-weight: 700; }
.pag-btn--active:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); color: #fff; }
.pag-ellipsis     { font-size: 13px; color: var(--color-text-muted); padding: 0 4px; line-height: 34px; }

/* ─── Date filter popup panel ───────────────────────────────────────────────── */
.date-filter-panel {
  width: min(400px, 94vw) !important;
  height: auto !important;
  border-radius: 16px !important;
  box-shadow: 0 20px 60px rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.06) !important;
}
.date-filter-panel .modal-header {
  border-bottom: 1px solid var(--color-border);
  padding: 18px 24px 16px;
}
.btn-date-active {
  border-color: var(--color-primary) !important;
  color: var(--color-primary) !important;
  background: var(--color-primary-light) !important;
}

/* ─── Sidebar toggle button ──────────────────────────────────────────────────── */
.btn-sidebar-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 6px;
  border: 1px solid transparent; background: transparent;
  cursor: pointer; transition: background .12s;
  color: var(--color-text-muted); flex-shrink: 0;
}
.btn-sidebar-toggle:hover { background: var(--color-bg); color: var(--color-text-primary); }

/* ─── Multi-select filter ────────────────────────────────────────────────────── */
.ms-wrap {
  position: relative;
  flex-shrink: 0;
}
.ms-trigger {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  font-size: 14px; font-family: inherit;
  color: var(--color-text-primary);
  cursor: pointer;
  white-space: nowrap;
  min-width: 105px;
  outline: none;
  transition: border-color .15s;
}
.ms-trigger:hover { border-color: var(--color-primary); }
.ms-trigger--active {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  color: var(--color-primary);
}
.ms-chevron { flex-shrink: 0; color: var(--color-text-muted); transition: transform .2s; }
.ms-trigger--open .ms-chevron { transform: rotate(180deg); }
.ms-trigger--active .ms-chevron { color: var(--color-primary); }
.ms-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 150;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  min-width: 200px;
  max-height: 260px;
  overflow-y: auto;
  padding: 6px;
}
.ms-opt {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--color-text-primary);
  user-select: none;
}
.ms-opt:hover { background: var(--color-bg); }
.ms-opt input[type="checkbox"] { cursor: pointer; accent-color: var(--color-primary); flex-shrink: 0; }
.ms-empty { padding: 10px; font-size: 13px; color: var(--color-text-muted); text-align: center; }

/* ─── Track column indicators (Label & Scan) ─────────────────────────────────── */
.track-check {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
}
.track-check--yes { color: var(--color-success); }
.track-check--no  { color: var(--color-border); font-size: 13px; }
