* { box-sizing: border-box; }

:root {
  --bg: #f5f5f5;
  --card: #ffffff;
  --border: #e0e0e0;
  --text: #111111;
  --muted: #666666;
  --primary: #000000;
  --hover: #f3f4f6;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --info: #2563eb;
  --radius: 12px;
  --shadow: 0 6px 24px rgba(0,0,0,0.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sidebar-w: 240px;
  --topbar-h: 68px;
}

[data-theme="dark"] {
  --bg: #0f1115;
  --card: #171a21;
  --border: #2a2f3a;
  --text: #e8ebf0;
  --muted: #9aa3b2;
  --primary: #ffffff;
  --hover: #22262f;
  --shadow: 0 6px 24px rgba(0,0,0,0.4);
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background 0.15s, color 0.15s;
}

h1, h2, h3 { font-weight: 700; margin: 0 0 12px; line-height: 1.25; }
h1 { font-size: 24px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, select, textarea { font-family: inherit; font-size: inherit; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.empty { text-align: center; color: var(--muted); padding: 24px; }
.mb-16 { margin-bottom: 16px; }
.mt-24 { margin-top: 24px; }
.center { text-align: center; }
.narrow { max-width: 780px; margin: 0 auto; }

/* ============ TOPBAR ============ */
.topbar {
  height: var(--topbar-h);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 30;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.5px;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand-logo { height: 38px; width: auto; }

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.user { color: var(--muted); font-size: 14px; }

.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  width: 36px; height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  transition: background 0.15s;
}
.theme-toggle:hover { background: var(--hover); }

.hamburger {
  display: none;
  background: none;
  border: 0;
  width: 38px; height: 38px;
  cursor: pointer;
  padding: 8px;
}
.hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text);
  margin: 4px auto;
}

/* ============ SIDEBAR ============ */
.sidebar {
  position: fixed;
  top: var(--topbar-h); left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--card);
  border-right: 1px solid var(--border);
  padding: 16px 10px;
  z-index: 20;
  overflow-y: auto;
}
.sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--text);
  font-weight: 500;
  font-size: 14px;
  transition: background 0.15s;
}
.sidebar a:hover { background: var(--hover); text-decoration: none; }
.sidebar a.active { background: var(--primary); color: var(--bg); }
[data-theme="dark"] .sidebar a.active { color: #000; }
.sidebar a img {
  width: 20px;
  height: 20px;
  opacity: 0.75;
  flex-shrink: 0;
}
.sidebar a.active img {
  opacity: 1;
  filter: brightness(0) invert(1);
}
[data-theme="dark"] .sidebar a img {
  filter: brightness(0) invert(1);
  opacity: 0.7;
}
[data-theme="dark"] .sidebar a.active img {
  opacity: 1;
  filter: brightness(0);
}

/* ============ CONTENT ============ */
.content {
  margin-left: var(--sidebar-w);
  padding: calc(var(--topbar-h) + 20px) 24px 60px;
  max-width: 1300px;
}
.public-content { padding-top: 0; }

.page-title { font-size: 22px; margin-bottom: 16px; }
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 15;
}
.overlay.open { display: block; }

/* ============ BUTTONS ============ */
.btn-primary, .btn-ghost, .btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: var(--bg); }
.btn-primary:hover { opacity: 0.85; text-decoration: none; }
[data-theme="dark"] .btn-primary { color: #000; }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--hover); text-decoration: none; }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { display: flex; width: 100%; padding: 12px; font-size: 15px; }
.btn-lg { padding: 13px 24px; font-size: 16px; }
.link-btn {
  background: none;
  border: 0;
  color: var(--info);
  cursor: pointer;
  padding: 0;
  font-weight: 600;
  text-decoration: underline;
}

.btn-primary img,
.btn-ghost img,
.btn-danger img {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
[data-theme="dark"] .btn-primary img {
  filter: brightness(0);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-icon:hover { background: var(--hover); }
.btn-icon img { width: 16px; height: 16px; display: block; }
.btn-icon-danger {
  color: var(--danger);
  border-color: var(--danger);
}
.btn-icon-danger:hover { background: var(--danger); }
.btn-icon-danger:hover img { filter: brightness(0) invert(1); }

/* ============ CARDS ============ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.card h2 { font-size: 16px; margin-bottom: 14px; }

/* ============ STATS ============ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}
.stat-label { color: var(--muted); font-size: 13px; }
.stat-value { font-size: 22px; font-weight: 800; }
.stat-sub { color: var(--muted); font-size: 12px; }

.stat-icon {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 24px;
  height: 24px;
  opacity: 0.35;
  pointer-events: none;
}
[data-theme="dark"] .stat-icon {
  filter: brightness(0) invert(1);
  opacity: 0.5;
}

/* ============ BADGES ============ */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-pending { background: #fff7ed; color: var(--warning); }
.badge-confirmed { background: #ecfdf5; color: var(--success); }
.badge-failed { background: #fef2f2; color: var(--danger); }
.badge-unknown { background: #f3f4f6; color: var(--muted); }
.badge-in_review { background: #f3f4f6; color: var(--muted); }
.badge-hold { background: #fff7ed; color: var(--warning); }
.badge-delivered { background: #ecfdf5; color: var(--success); }
.badge-partial_delivered { background: #eff6ff; color: var(--info); }
.badge-cancelled { background: #fef2f2; color: var(--danger); }
.badge-exceptional { background: #fef2f2; color: var(--danger); }
.badge-delivered_approval_pending { background: #ecfdf5; color: var(--success); }
.badge-partial_delivered_approval_pending { background: #eff6ff; color: var(--info); }
.badge-cancelled_approval_pending { background: #fef2f2; color: var(--danger); }
.badge-unknown_approval_pending { background: #f3f4f6; color: var(--muted); }
.badge-exchange { background: #eef2ff; color: #4338ca; font-size: 11px; margin-left: 6px; }
.badge-courier { background: #f3f4f6; color: var(--muted); text-transform: capitalize; }

[data-theme="dark"] .badge-pending { background: #422006; color: #fbbf24; }
[data-theme="dark"] .badge-confirmed { background: #052e16; color: #4ade80; }
[data-theme="dark"] .badge-failed { background: #450a0a; color: #f87171; }
[data-theme="dark"] .badge-unknown { background: #1f2937; color: var(--muted); }
[data-theme="dark"] .badge-in_review { background: #1f2937; color: var(--muted); }
[data-theme="dark"] .badge-hold { background: #422006; color: #fbbf24; }
[data-theme="dark"] .badge-delivered { background: #052e16; color: #4ade80; }
[data-theme="dark"] .badge-partial_delivered { background: #172554; color: #60a5fa; }
[data-theme="dark"] .badge-cancelled { background: #450a0a; color: #f87171; }
[data-theme="dark"] .badge-exchange { background: #1e1b4b; color: #a5b4fc; }
[data-theme="dark"] .badge-courier { background: #1f2937; color: var(--muted); }

/* ============ CHIPS ============ */
.chip {
  display: inline-block;
  padding: 2px 8px;
  background: var(--bg);
  border-radius: 12px;
  font-size: 12px;
  margin: 2px 2px 2px 0;
}
[data-theme="dark"] .chip { background: var(--hover); }

/* ============ TABS ============ */
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tab {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 8px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
}
.tab.active { background: var(--primary); color: var(--bg); border-color: var(--primary); }
[data-theme="dark"] .tab.active { color: #000; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ============ SEARCH ROW ============ */
.search-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.search-row input[type="text"] { flex: 1; min-width: 200px; }

/* ============ FORMS ============ */
.form label, .grid-2 label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 12px;
  color: var(--text);
}

input[type="text"], input[type="number"], input[type="password"],
input[type="email"], select, textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  outline: none;
  width: 100%;
  font-size: 14px;
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
input::placeholder, textarea::placeholder { color: var(--muted); }
textarea { resize: vertical; font-family: inherit; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.col-span { grid-column: span 2; }
.form-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.checkbox { flex-direction: row; align-items: center; gap: 8px; }
.checkbox input { width: auto; }

.password-wrap { position: relative; display: flex; align-items: center; }
.password-wrap input { padding-right: 44px; }
.eye-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 0;
  padding: 8px;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
}
.eye-btn:hover { color: var(--text); }
.eye-btn img {
  width: 18px;
  height: 18px;
  display: block;
}
[data-theme="dark"] .eye-btn img {
  filter: brightness(0) invert(1);
  opacity: 0.6;
}
.eye-btn:hover img { opacity: 1; }

/* ============ ITEM BUILDER ============ */
.items-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 10px;
}
.items-header h3 {
  margin: 0;
  font-size: 15px;
}

.items-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.item-row {
  display: grid;
  grid-template-columns: 2fr 1fr 80px 40px;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
}
[data-theme="dark"] .item-row {
  background: var(--hover);
}

.item-product,
.item-size,
.item-qty {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  width: 100%;
  min-width: 0;
}

.item-product { font-weight: 600; }
.item-qty { text-align: center; }

.item-remove {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 8px;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

#ai-items-empty,
#m-items-empty {
  margin: 0 0 4px;
  padding: 8px 0;
}

/* ============ TABLES ============ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text);
}
th { color: var(--muted); font-weight: 600; font-size: 13px; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.row-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.row-actions form { margin: 0; }

/* ============ PAGER ============ */
.pager {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  margin-top: 14px;
  flex-wrap: wrap;
}

/* ============ MODAL ============ */
.modal {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 50;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal.open { display: flex; }
.modal-box {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}
.modal-close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: 0; cursor: pointer;
  font-size: 22px;
  color: var(--text);
  line-height: 1;
}
.order-modal-box { max-width: 640px; }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.detail-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 11px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.detail-item.col-span-2 { grid-column: span 2; }
.detail-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.4px;
}
.detail-value {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
  word-break: break-word;
}
.item-line { padding: 2px 0; }

.detail-list {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  margin: 12px 0;
}
[data-theme="dark"] .detail-list { background: var(--hover); }
.detail-line {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.detail-line:last-child { border-bottom: 0; }
.detail-line span { color: var(--muted); }

/* ============ TOAST ============ */
.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--primary);
  color: var(--bg);
  padding: 12px 18px;
  border-radius: 8px;
  z-index: 100;
  max-width: 90vw;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
[data-theme="dark"] .toast { color: #000; }

/* ============ BANNERS ============ */
.banner {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 500;
}
.banner-warn { background: #fef2f2; color: var(--danger); border-left: 4px solid var(--danger); }
.banner-info { background: #eff6ff; color: var(--info); border-left: 4px solid var(--info); }
[data-theme="dark"] .banner-warn { background: #450a0a; color: #f87171; }
[data-theme="dark"] .banner-info { background: #172554; color: #60a5fa; }

/* ============ FLASH ============ */
.flash-wrap { margin-bottom: 16px; }
.flash {
  padding: 11px 14px;
  border-radius: 8px;
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 14px;
}
.flash-success { background: #ecfdf5; color: var(--success); }
.flash-error { background: #fef2f2; color: var(--danger); }
.flash-warning { background: #fff7ed; color: var(--warning); }
[data-theme="dark"] .flash-success { background: #052e16; color: #4ade80; }
[data-theme="dark"] .flash-error { background: #450a0a; color: #f87171; }
[data-theme="dark"] .flash-warning { background: #422006; color: #fbbf24; }

/* ============ AUTH ============ */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px 28px;
  box-shadow: var(--shadow);
}
.auth-head { text-align: center; margin-bottom: 24px; }
.auth-logo {
  height: 56px;
  width: auto;
  margin: 0 auto 12px;
  display: block;
}
[data-theme="dark"] .auth-logo {
  filter: brightness(0) invert(1);
}
.auth-head h1 { font-size: 22px; margin: 8px 0 6px; letter-spacing: 2px; }
.auth-head p { margin: 0; font-size: 13px; }
.auth-form { display: flex; flex-direction: column; }
.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 14px;
}
.auth-row {
  display: flex;
  justify-content: flex-end;
  margin: -6px 0 12px;
}
.auth-foot { text-align: center; margin-top: 20px; font-size: 14px; }
.auth-resend { text-align: center; margin-top: 12px; }
.auth-foot a { font-weight: 600; }

.otp-input {
  text-align: center;
  font-size: 22px;
  letter-spacing: 8px;
  font-weight: 700;
  font-family: monospace;
}
.hp-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  overflow: hidden;
}

/* ============ PUBLIC ============ */
.hero {
  padding: 64px 20px 56px;
  background: linear-gradient(180deg, var(--bg), var(--card));
  border-bottom: 1px solid var(--border);
}
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  align-items: center;
}
.hero-badge {
  display: inline-block;
  background: var(--primary);
  color: var(--bg);
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}
[data-theme="dark"] .hero-badge { color: #000; }
.hero-text h1 {
  font-size: 44px;
  line-height: 1.1;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}
.hero-sub { color: var(--muted); font-size: 17px; margin-bottom: 24px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }

.hero-couriers {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 16px 0 12px;
}
.hero-couriers img {
  height: 22px;
  width: auto;
  opacity: 0.75;
  transition: opacity 0.15s;
}
.hero-couriers img:hover { opacity: 1; }

.hero-art img {
  width: 100%;
  height: auto;
  display: block;
  max-width: 400px;
  margin: 0 auto;
}

.section { padding: 60px 20px; }
.section.alt {
  background: var(--card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.section-head { text-align: center; margin-bottom: 36px; }
.section-head h2 { font-size: 28px; }
.section-head p { margin: 8px 0 0; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
}
.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.feature-card h3 { font-size: 16px; margin-bottom: 8px; }
.feature-card p { color: var(--muted); font-size: 14px; margin: 0; }
.feature-icon {
  display: block;
  width: 28px;
  height: 28px;
  margin-bottom: 14px;
  opacity: 0.85;
}
[data-theme="dark"] .feature-icon {
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.page-hero {
  padding: 60px 20px 30px;
  border-bottom: 1px solid var(--border);
}
.page-hero h1 { font-size: 34px; margin-bottom: 8px; }

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  max-width: 760px;
  margin: 0 auto;
}
.pricing-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  position: relative;
}
.pricing-card.featured {
  border-color: var(--primary);
  border-width: 2px;
}
.pricing-card h3 {
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.price {
  font-size: 42px;
  font-weight: 800;
  margin: 12px 0;
}
.price span {
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
}
.check-list {
  list-style: none;
  padding: 0;
  margin: 20px 0;
  text-align: left;
}
.check-list li {
  padding: 8px 0 8px 24px;
  position: relative;
  color: var(--muted);
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}
.check-list li:last-child { border-bottom: 0; }
.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: 700;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}
.stat-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.stat-box strong { font-size: 32px; }
.stat-box span { color: var(--muted); font-size: 13px; }
.stat-box img {
  display: block;
  margin: 0 auto 12px;
  opacity: 0.7;
}
[data-theme="dark"] .stat-box img {
  filter: brightness(0) invert(1);
}

.cta-band {
  padding: 60px 20px;
  background: var(--primary);
  color: var(--bg);
}
[data-theme="dark"] .cta-band { color: #000; }
.cta-band .muted { color: inherit; opacity: 0.8; }
.cta-band h2 { font-size: 28px; margin-bottom: 8px; }
.cta-band .btn-primary {
  background: var(--bg);
  color: var(--primary);
  margin-top: 20px;
}
[data-theme="dark"] .cta-band .btn-primary {
  background: #fff;
  color: #000;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.contact-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.contact-card h3 { margin-bottom: 8px; font-size: 15px; }
.contact-card p { margin: 4px 0; font-size: 14px; }

.faq {
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  padding: 4px 0;
  list-style: none;
}
.faq summary::after {
  content: " +";
  float: right;
  color: var(--muted);
}
.faq[open] summary::after { content: " −"; }
.faq p {
  margin: 10px 0 4px;
  color: var(--muted);
  font-size: 14px;
}

.legal h2 { margin-top: 24px; font-size: 17px; }
.legal p, .legal li { color: var(--muted); font-size: 14px; }
.legal ul { padding-left: 20px; }

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 1000px;
  margin: 0 auto;
}
.step-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
}
.step-number {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 16px;
}
[data-theme="dark"] .step-number { color: #000; }
.step-card h3 { font-size: 16px; margin-bottom: 8px; }
.step-card p { color: var(--muted); font-size: 14px; margin: 0; }

.error-page {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 20px;
  text-align: center;
}
.error-page h1 { font-size: 72px; margin: 0; }

.danger-zone { border-color: var(--danger); }
.danger-zone h2 { color: var(--danger); }

/* ============ COURIER CARDS (Orders) ============ */
.courier-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.courier-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 12px;
  transition: all 0.15s;
  text-decoration: none;
  color: inherit;
}
.courier-card:hover {
  border-color: var(--muted);
  text-decoration: none;
  transform: translateY(-2px);
}
.courier-card.active {
  border-color: var(--primary);
  background: var(--bg);
}
[data-theme="dark"] .courier-card.active { background: var(--hover); }
.courier-card-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--bg);
  border-radius: 8px;
}
[data-theme="dark"] .courier-card-icon { background: var(--hover); }
.courier-card-icon img {
  max-height: 28px;
  max-width: 36px;
  width: auto;
  height: auto;
}
[data-theme="dark"] .courier-card-icon img {
  filter: brightness(0) invert(1);
  opacity: 0.9;
}
.courier-card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.courier-card-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.courier-card-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.courier-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: var(--bg);
  border-radius: 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
[data-theme="dark"] .courier-pill { background: var(--hover); }
.courier-pill img {
  height: 14px;
  width: auto;
  max-width: 24px;
}
[data-theme="dark"] .courier-pill img {
  filter: brightness(0) invert(1);
  opacity: 0.8;
}

/* ============ PAYMENT ============ */
.payment-methods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.payment-method-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 24px 20px;
  text-align: center;
  transition: all 0.15s;
}
.payment-method-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}
.payment-method-logo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  padding: 14px;
  border: 2px solid var(--border);
}
[data-theme="dark"] .payment-method-logo { background: var(--hover); }
.payment-method-logo img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
.payment-method-name { font-size: 16px; margin-bottom: 16px; }

.checkout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.checkout-method-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.checkout-logo {
  height: 48px;
  width: auto;
  max-width: 90px;
  object-fit: contain;
  display: block;
}
[data-theme="dark"] .checkout-logo {
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.amount-highlight {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border: 1px solid #10b981;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  margin: 12px 0;
}
[data-theme="dark"] .amount-highlight {
  background: linear-gradient(135deg, #052e16, #064e3b);
}
.amount-bdt {
  font-size: 28px;
  font-weight: 800;
  color: #047857;
  margin: 6px 0;
}
[data-theme="dark"] .amount-bdt { color: #4ade80; }
.amount-highlight small { display: block; font-size: 12px; }

.number-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 12px 0;
}
[data-theme="dark"] .number-box { background: var(--hover); }
.number-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.number-value {
  margin: 4px 0 0;
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
}
.wallet-value {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 600;
  word-break: break-all;
}
.checkout-divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}
.checkout-summary { display: flex; flex-direction: column; gap: 6px; }
.summary-row { display: flex; justify-content: space-between; font-size: 14px; }

.payment-success-card {
  max-width: 520px;
  margin: 40px auto;
  text-align: center;
  padding: 32px;
}
.success-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #ecfdf5;
  display: flex;
  align-items: center;
  justify-content: center;
}
[data-theme="dark"] .success-icon { background: #052e16; }
.success-icon img { width: 40px; height: 40px; }

/* ============ STORAGE ============ */
.storage-packs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.storage-pack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 16px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.storage-pack:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}
.pack-title { font-size: 18px; font-weight: 800; color: var(--text); }
.pack-price { font-size: 14px; color: var(--success); font-weight: 700; }

.storage-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.storage-tab {
  padding: 8px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  font-family: inherit;
}
.storage-tab.active {
  background: var(--primary);
  color: var(--bg);
  border-color: var(--primary);
}
[data-theme="dark"] .storage-tab.active { color: #000; }

.storage-slider-wrap label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-weight: 600;
}
#storage-range {
  width: 100%;
  accent-color: var(--primary);
  margin: 8px 0 16px;
  height: 6px;
}
.storage-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.storage-price {
  font-size: 24px;
  font-weight: 800;
  color: var(--success);
}

/* ============ WHATSAPP FAB ============ */
.whatsapp-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
  z-index: 999;
  transition: transform 0.2s, box-shadow 0.2s;
}
.whatsapp-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 28px rgba(37, 211, 102, 0.55);
  text-decoration: none;
  color: #fff;
}
.whatsapp-fab svg { display: block; }

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-text h1 { font-size: 34px; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .steps-grid { grid-template-columns: 1fr; max-width: 400px; }
  .courier-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .hamburger { display: block; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s;
  }
  .sidebar.open { transform: translateX(0); }
  .content {
    margin-left: 0;
    padding: calc(var(--topbar-h) + 16px) 16px 60px;
  }
  .brand { font-size: 16px; }
  .brand-logo { height: 32px; }
  .user { display: none; }
  .stat-grid { grid-template-columns: 1fr; }
  .form-row, .grid-2 { grid-template-columns: 1fr; }
  .col-span { grid-column: auto; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-item.col-span-2 { grid-column: auto; }
  .page-head { flex-direction: column; align-items: stretch; }
  .search-row { flex-direction: column; }
  .search-row > * { width: 100%; }
  .feature-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .hero { padding: 40px 16px; }
  .hero-text h1 { font-size: 28px; }
  .section { padding: 40px 16px; }
  .modal-box { padding: 18px; }
  .auth-card { padding: 24px 20px; }
  .checkout-grid { grid-template-columns: 1fr; }
  .whatsapp-fab {
    width: 50px;
    height: 50px;
    bottom: 16px;
    right: 16px;
  }
  .whatsapp-fab svg {
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 600px) {
  .storage-packs-grid { grid-template-columns: 1fr; }
  .item-row {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "prod prod"
      "size qty"
      "remove remove";
    gap: 8px;
  }
  .item-product { grid-area: prod; }
  .item-size { grid-area: size; }
  .item-qty { grid-area: qty; }
  .item-remove {
    grid-area: remove;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .courier-cards { grid-template-columns: 1fr; }
  .courier-card { padding: 12px 14px; }
  .courier-card-icon { width: 36px; height: 36px; }
  .courier-card-icon img { max-height: 22px; }
  .hero-couriers { gap: 10px; }
  .hero-couriers img { height: 20px; }
  .hero-art { margin-top: 24px; }
}
/* ============ TOAST ============ */
.toast {
  position: fixed;
  bottom: 90px;
  right: 24px;
  background: var(--primary);
  color: var(--bg);
  padding: 12px 20px;
  border-radius: 10px;
  z-index: 9999;
  max-width: 90vw;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  animation: toastIn 0.2s ease-out;
}
[data-theme="dark"] .toast {
  color: #000;
}

.toast.show { display: block; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Mobile */
@media (max-width: 768px) {
  .toast {
    bottom: 80px;
    right: 16px;
    left: 16px;
    text-align: center;
  }
}