:root {
      color-scheme: light;
      --primary: #FF6B1A;
      --primary-light: #FFF5EB;
      --primary-hover: #E85E10;
      --secondary: #FF8A4C;
      --dark: #0f1720;
      --bg: #F8F9FA;
      --surface: #FFFFFF;
      --border: #E5E7EB;
      --border-soft: #F3F4F6;
      --text: #1A1A1A;
      --text-muted: #9CA3AF;
      --text-secondary: #6B7280;
      --success: #16a34a;
      --warning: #d97706;
      --danger: #dc2626;
      --info: #0284c7;
      --sidebar-width: 220px;
      --sidebar-collapsed: 60px;
      --radius: 14px;
      --shadow: 0 1px 4px rgba(15,23,42,.06);
      --shadow-md: 0 4px 16px rgba(15,23,42,.08);
    }
    * { box-sizing: border-box; margin: 0; padding: 0; }
    html, body { height: 100%; font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }

    /* LOADING */
    #loading { position: fixed; inset: 0; background: #fff; z-index: 9999; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
    .spin { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
    @keyframes spin { to { transform: rotate(360deg); } }

    /* LAYOUT */
    .wrapper { display: flex; min-height: 100vh; }
    .sidebar { width: var(--sidebar-width); background: linear-gradient(175deg, #1E1209 0%, #2D1A0E 50%, #1A0F08 100%); color: #fff; position:fixed; top:0; left:0; bottom:0; display:flex; flex-direction:column; overflow-y:auto; z-index:100; border-right:none; box-shadow: 4px 0 20px rgba(10,6,4,.28); }
    .brand { display:flex; align-items:center; gap:10px; padding:18px 14px; border-bottom:1px solid rgba(255,255,255,.09); }
    .brand-icon { width:38px; height:38px; background:linear-gradient(135deg,var(--primary),var(--primary-2)); border-radius:12px; display:flex; align-items:center; justify-content:center; font-size:18px; flex-shrink:0; box-shadow:0 6px 16px rgba(255,107,26,.35); }
    .brand-name { font-size:16px; font-weight:800; color:#fff; letter-spacing:-.3px; }
    .brand-sub  { font-size:10px; color:rgba(255,200,160,.55); text-transform:uppercase; letter-spacing:1px; font-weight:700; }
    .store-info { padding:10px 14px; border-bottom:1px solid rgba(255,255,255,.08); background:rgba(255,255,255,.05); }
    .store-name { font-size:12px; font-weight:700; color:#fff; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
    .store-status { font-size:11px; margin-top:2px; }
    .nav { padding:10px 8px; flex:1; }
    .nav-section { font-size:10px; font-weight:800; letter-spacing:1.4px; text-transform:uppercase; color:rgba(255,195,155,.35); padding:14px 12px 5px; }
    .nav-btn { display:flex; align-items:center; gap:10px; width:100%; padding:10px 12px; border:none; background:none; color:rgba(255,230,210,.65); font-size:13px; font-weight:600; border-radius:12px; cursor:pointer; transition:all .15s; text-align:left; margin-bottom:3px; }
    .nav-btn i { width:17px; text-align:center; flex-shrink:0; font-size:15px; }
    .nav-btn:hover { background:rgba(255,255,255,.09); color:#fff; transform:translateX(2px); }
    .nav-btn.active { background:linear-gradient(135deg,var(--primary),var(--primary-2)); color:#fff; font-weight:700; box-shadow:0 6px 16px rgba(255,107,26,.35); }
    .nav-btn .badge-nav { background:var(--danger); color:#fff; border-radius:999px; padding:1px 7px; font-size:10px; font-weight:800; margin-left:auto; }
    .sidebar-footer { padding:12px 8px 16px; border-top:1px solid rgba(255,255,255,.09); }
    .main { flex:1; margin-left:var(--sidebar-width); display:flex; flex-direction:column; min-height:100vh; }
    .topbar { height:56px; background:#FFFFFF; border-bottom:1px solid var(--border-soft); display:flex; align-items:center; justify-content:space-between; padding:0 20px; position:sticky; top:0; z-index:90; }
    .topbar-title { font-size:15px; font-weight:600; color: var(--text); }
    .topbar-right { display:flex; align-items:center; gap:12px; }
    .toggle-status { display:flex; align-items:center; gap:8px; background:var(--border-soft); border-radius:999px; padding:5px 14px; cursor:pointer; border: 1px solid var(--border); font-weight:600; font-size:12px; transition:all .2s; }
    .toggle-status.open  { background:#f0fdf4; color:var(--success); }
    .toggle-status.closed{ background:#fef2f2; color:var(--danger); }
    .page { padding:24px; display:none; }
    .page.active { display:block; }
    .ph { display:flex; align-items:flex-end; justify-content:space-between; margin-bottom:24px; flex-wrap:wrap; gap:12px; }
    .ph h2 { font-size:20px; font-weight:800; }
    .ph p  { font-size:13px; color:var(--text-muted); margin-top:2px; }
    .ph-actions { display:flex; gap:8px; align-items:center; }
    .grid-4 { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin-bottom:24px; }
    .grid-3 { display:grid; grid-template-columns:repeat(3,1fr); gap:16px; }
    .grid-2 { display:grid; grid-template-columns:repeat(2,1fr); gap:16px; }
    .stat { background:#FFFFFF; border:1px solid var(--border-soft); border-radius:var(--radius); padding:14px 16px; display:flex; align-items:center; justify-content:space-between; transition:border-color .15s; }
    .stat:hover { border-color: #FFEDD5; }
    .stat-label { font-size:11px; font-weight:500; color:var(--text-muted); margin-bottom:4px; }
    .stat-value { font-size:22px; font-weight:700; line-height:1; }
    .stat-icon  { width:44px; height:44px; border-radius:12px; display:flex; align-items:center; justify-content:center; font-size:20px; }
    .card { background:#FFFFFF; border:1px solid var(--border-soft); border-radius:var(--radius); overflow:hidden; }
    .card-head { padding:12px 16px; border-bottom:1px solid var(--border-soft); font-weight:600; font-size:13px; display:flex; align-items:center; justify-content:space-between; background:#FAFAFA; }
    .card-body { padding:18px; }
    .tbl-wrap { background:var(--surface); border:1px solid var(--border-soft); border-radius:var(--radius); box-shadow:var(--shadow); overflow:hidden; }
    table { width:100%; border-collapse:collapse; }
    thead th { background:#fafbfc; padding:11px 16px; font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.4px; color:var(--text-muted); border-bottom:1px solid var(--border); text-align:left; }
    tbody td { padding:14px 16px; border-bottom:1px solid var(--border-soft); vertical-align:middle; }
    tbody tr:last-child td { border-bottom:none; }
    tbody tr:hover { background:#fafbfc; }
    .td-right { text-align:right; }
    .btn { display:inline-flex; align-items:center; gap:6px; padding:8px 16px; border-radius:12px; font-weight:700; font-size:13px; border:none; cursor:pointer; transition:all .15s; }
    .btn:hover { opacity: 0.9; }
    .btn-primary { background: var(--primary); color:#fff; }
    .btn-secondary { background:var(--surface); color:#4b5563; border:1px solid var(--border); }
    .btn-secondary:hover { background:var(--bg); }
    .btn-success { background:#f0fdf4; color:var(--success); border:1px solid #bbf7d0; }
    .btn-danger  { background:#fef2f2; color:var(--danger);  border:1px solid #fecaca; }
    .btn-warning { background:#fffbeb; color:var(--warning); border:1px solid #fde68a; }
    .btn-ghost { background:none; color:var(--text-muted); border:1px solid var(--border); }
    .btn-sm { padding:6px 12px; font-size:12px; border-radius:10px; }
    .btn-full { width:100%; justify-content:center; }
    .badge { display:inline-block; padding:3px 10px; border-radius:999px; font-size:11px; font-weight:700; }
    .badge-success { background:#f0fdf4; color:var(--success); }
    .badge-warning { background:#fffbeb; color:var(--warning); }
    .badge-danger  { background:#fef2f2; color:var(--danger); }
    .badge-info    { background:#f0f9ff; color:var(--info); }
    .badge-muted   { background:#f3f4f6; color:var(--text-muted); }
    .badge-primary { background:#fff3e8; color:var(--primary); }
    .form-group { margin-bottom:14px; }
    .form-label { display:block; font-size:11px; font-weight:700; color:#4b5563; text-transform:uppercase; letter-spacing:.4px; margin-bottom:5px; }
    .form-control { width:100%; padding:10px 13px; border:1.5px solid var(--border); border-radius:12px; font-size:13.5px; color:var(--text); background:#fafbfc; outline:none; transition:border-color .15s,box-shadow .15s; }
    .form-control:focus { border-color:var(--primary); box-shadow:0 0 0 3px rgba(255,106,0,.1); background:#fff; }
    textarea.form-control { resize:vertical; min-height:80px; }
    .form-row { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
    .divider { border:none; border-top:1px solid var(--border-soft); margin:16px 0; }
    .modal-bg { position:fixed; inset:0; background:rgba(15,23,42,.5); z-index:200; display:none; align-items:center; justify-content:center; padding:20px; }
    .modal-bg.open { display:flex; }
    .modal-box { background:#fff; border-radius:24px; box-shadow:0 24px 64px rgba(15,23,42,.2); width:100%; max-width:520px; max-height:90vh; overflow-y:auto; animation:mIn .2s ease; }
    .modal-box.wide { max-width:660px; }
    @keyframes mIn { from{opacity:0;transform:scale(.96) translateY(8px);}to{opacity:1;transform:none;} }
    .modal-head { padding:18px 22px; display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid var(--border-soft); }
    .modal-title { font-size:16px; font-weight:800; }
    .modal-close { width:30px; height:30px; border:none; background:var(--border-soft); border-radius:50%; cursor:pointer; font-size:14px; color:var(--text-muted); display:flex; align-items:center; justify-content:center; }
    .modal-body { padding:18px 22px; }
    .modal-foot { padding:14px 22px; border-top:1px solid var(--border-soft); display:flex; gap:8px; justify-content:flex-end; }
    #toasts { position:fixed; bottom:20px; right:20px; z-index:9000; display:flex; flex-direction:column; gap:8px; }
    .toast { background:var(--dark); color:#fff; padding:11px 16px; border-radius:12px; font-size:13px; font-weight:600; box-shadow:0 8px 24px rgba(0,0,0,.2); display:flex; align-items:center; gap:8px; max-width:320px; animation:tIn .2s ease; }
    .toast.success { border-left:4px solid var(--success); }
    .toast.error   { border-left:4px solid var(--danger); }
    .toast.warning { border-left:4px solid var(--warning); }
    .toast.info    { border-left:4px solid var(--info); }
    @keyframes tIn { from{opacity:0;transform:translateX(16px);}to{opacity:1;transform:none;} }
    .empty { text-align:center; padding:36px 20px; color:var(--text-muted); }
    .empty i { font-size:40px; display:block; margin-bottom:10px; opacity:.25; }
    .order-card { background:var(--surface); border:1px solid var(--border-soft); border-radius:var(--radius); padding:16px; box-shadow:var(--shadow); transition:transform .15s; }
    .order-card:hover { transform:translateY(-2px); }
    .order-card-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
    .order-id { font-size:12px; font-weight:700; color:var(--text-muted); font-family:monospace; }
    .order-items { font-size:13px; color:var(--text); margin-bottom:10px; line-height:1.5; }
    .order-footer { display:flex; align-items:center; justify-content:space-between; }
    .order-total { font-size:16px; font-weight:800; color:var(--success); }
    .order-time  { font-size:11px; color:var(--text-muted); }
    .orders-cols { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; }
    .orders-col-head { font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.5px; padding:10px 14px; border-radius:12px; margin-bottom:12px; text-align:center; }

.orders-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(320px, .9fr);
  gap: 18px;
  align-items: start;
}

.orders-board-shell,
.orders-detail-panel,
.orders-history-card {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.orders-board-shell,
.orders-history-card {
  padding: 18px;
}

.orders-detail-panel {
  position: sticky;
  top: 88px;
  min-height: 520px;
  padding: 20px;
  background: linear-gradient(180deg, #ffffff, #fffaf4);
}

.orders-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.orders-section-head h3 {
  font-size: 17px;
  margin: 0 0 4px;
}

.orders-section-head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.orders-section-head--history {
  margin-bottom: 14px;
}

.orders-detail-empty {
  min-height: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-muted);
  gap: 10px;
}

.orders-detail-empty i {
  font-size: 40px;
  opacity: .28;
}

.orders-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.orders-detail-code {
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.orders-detail-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

.orders-detail-total {
  font-size: 24px;
  font-weight: 900;
  color: var(--success);
  text-align: right;
}

.orders-detail-grid {
  display: grid;
  gap: 14px;
}

.orders-detail-box {
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  background: #fff;
  padding: 14px;
}

.orders-detail-box h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  margin: 0 0 10px;
}

.orders-detail-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  font-size: 13px;
}

.orders-detail-line span:first-child {
  color: var(--text-muted);
}

.orders-detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.orders-detail-actions .btn {
  justify-content: center;
}

.orders-detail-actions .btn[disabled] {
  display: none;
}

.orders-detail-items {
  display: grid;
  gap: 10px;
}

.orders-detail-item {
  border: 1px dashed rgba(148,163,184,.35);
  border-radius: 14px;
  padding: 10px 12px;
  background: #fffdfa;
}

.orders-detail-item strong {
  display: block;
  font-size: 13px;
}

.orders-detail-item small {
  color: var(--text-muted);
  display: block;
  margin-top: 4px;
  line-height: 1.45;
}

.kitchen-item {
  display: grid;
  gap: 8px;
  border-style: solid;
  background: #fff;
}

.kitchen-item.is-pizza {
  border-color: rgba(249,115,22,.32);
  background: #fffaf5;
}

.kitchen-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.kitchen-item-head strong {
  font-size: 14px;
  line-height: 1.25;
}

.kitchen-item-head span {
  flex-shrink: 0;
  color: var(--success);
  font-size: 13px;
  font-weight: 900;
}

.kitchen-item-line {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  font-size: 12px;
  line-height: 1.35;
}

.kitchen-item-line span {
  color: #64748b;
  font-weight: 900;
}

.kitchen-item-line strong {
  color: #111827;
  font-size: 12px;
  font-weight: 800;
}

.kitchen-item-muted {
  color: var(--text-muted);
  font-size: 12px;
}

.order-card-items-preview {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.order-card-items-preview .kitchen-item {
  padding: 9px 10px;
  border-radius: 12px;
  box-shadow: none;
}

.order-card-items-preview .kitchen-item-head strong,
.order-card-items-preview .kitchen-item-head span,
.kitchen-item.is-compact .kitchen-item-line strong,
.kitchen-item.is-compact .kitchen-item-line span {
  font-size: 11px;
}

.kitchen-item.is-compact .kitchen-item-line {
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 6px;
}

.order-card-more {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  padding-left: 2px;
}

.order-time-target {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.order-time-target span {
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
}

.order-time-target div {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2f7;
}

.order-time-target i {
  display: block;
  height: 100%;
  max-width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22c55e, #f59e0b 65%, #ef4444);
}

.detail-time-target {
  margin: -4px 0 14px;
}

.type-badge.type-delivery {
  background: #eff6ff;
  color: #1d4ed8;
}

.type-badge.type-pickup {
  background: #ecfdf5;
  color: #047857;
}

.type-badge.type-table {
  background: #fdf4ff;
  color: #7c3aed;
}

.kanban-card {
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.kanban-card.is-selected {
  border-color: rgba(255,106,0,.35);
  box-shadow: 0 18px 34px rgba(255,106,0,.16);
  background: linear-gradient(180deg, #ffffff, #fff8f1);
}

.order-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.order-card-customer {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 2px;
}

.order-card-address {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}
    .product-img { width:52px; height:52px; border-radius:12px; object-fit:cover; background:var(--border-soft); }
    .switch { position:relative; display:inline-block; width:44px; height:24px; }
    .switch input { opacity:0; width:0; height:0; }
    .slider { position:absolute; cursor:pointer; inset:0; background:#e5e7eb; border-radius:24px; transition:.3s; }
    .slider:before { position:absolute; content:""; height:18px; width:18px; left:3px; bottom:3px; background:#fff; border-radius:50%; transition:.3s; box-shadow:0 1px 4px rgba(0,0,0,.2); }
    input:checked + .slider { background:var(--primary); }
    input:checked + .slider:before { transform:translateX(20px); }
    .credit-bar-wrap { background:var(--border-soft); border-radius:999px; height:8px; overflow:hidden; margin-top:6px; }
    .credit-bar { height:100%; border-radius:999px; background:linear-gradient(90deg,var(--primary),var(--secondary)); transition:width .5s ease; }
    .fw-bold { font-weight:700; }
    .fw-800  { font-weight:800; }
    .fs-12   { font-size:12px; }
    .fs-13   { font-size:13px; }
    .text-muted   { color:var(--text-muted); }
    .text-success { color:var(--success); }
    .text-danger  { color:var(--danger); }
    .text-primary { color:var(--primary); }
    .text-warning { color:var(--warning); }
    .mt-2 { margin-top:8px; }
    .mb-4 { margin-bottom:16px; }
    ::-webkit-scrollbar { width:6px; }
    ::-webkit-scrollbar-thumb { background: var(--primary); border-radius:999px; opacity:0.7; }


    /* === NOVOS ESTILOS UI/UX === */

    /* Notif badge na topbar */
    .topbar-notif-btn {
      position: relative;
      width: 34px; height: 34px;
      background: var(--border-soft);
      border: none; border-radius: 9px;
      display: flex; align-items: center; justify-content: center;
      cursor: pointer; font-size: 16px;
      transition: background .15s;
    }
    .topbar-notif-btn:hover { background: var(--primary-light); }
    .topbar-notif-badge {
      position: absolute; top: -3px; right: -3px;
      width: 14px; height: 14px;
      background: var(--danger); border-radius: 50%;
      border: 2px solid #fff;
      display: flex; align-items: center; justify-content: center;
      font-size: 8px; color: #fff; font-weight: 700;
    }

    /* Store status pill na topbar */
    .topbar-store-pill {
      display: flex; align-items: center; gap: 7px;
      padding: 5px 14px;
      border-radius: 999px;
      border: 1px solid;
      font-size: 12px; font-weight: 600;
      cursor: pointer; transition: .2s;
    }
    .topbar-store-pill.open  { background:#F0FDF4; border-color:#BBF7D0; color:#16A34A; }
    .topbar-store-pill.closed{ background:#FEF2F2; border-color:#FECACA; color:#DC2626; }
    .topbar-store-dot { width: 7px; height: 7px; border-radius: 50%; }
    .topbar-store-pill.open  .topbar-store-dot { background: #22C55E; }
    .topbar-store-pill.closed .topbar-store-dot { background: #EF4444; }

    /* Nav icon para sidebar colapsada (mobile) */
    .nav-btn i { width: 18px; text-align: center; flex-shrink: 0; color: inherit; }
    .nav-btn.active i { color: var(--primary); }
    .nav-btn i.bi { font-size: 15px; }

    /* Pedidos novos — badge pulsante */
    @keyframes pulse-badge {
      0%, 100% { transform: scale(1); }
      50% { transform: scale(1.15); }
    }
    .badge-nav.pulse { animation: pulse-badge 1.5s infinite; }

    /* Kanban colunas — cabeçalho com indicador colorido */
    .orders-col-head { background: #FFFFFF; box-shadow: none; border: 1px solid var(--border-soft); }
    #col-new       .orders-col-head { border-top: 3px solid #F59E0B; }
    #col-preparing .orders-col-head { border-top: 3px solid #FF6B1A; }
    #col-delivery  .orders-col-head { border-top: 3px solid #6366F1; }
    #col-done      .orders-col-head { border-top: 3px solid #22C55E; }

    /* Kanban card — borda lateral colorida mais limpa */
    .kanban-card { border: 1px solid var(--border-soft); }
    .kanban-card::before { width: 4px; }

    /* Botão aceitar dentro do kanban — laranja sólido */
    .kanban-card .btn-primary { background: var(--primary); box-shadow: none; }
    .kanban-card .btn-success  { background: #F0FDF4; color: #16A34A; border: 1px solid #BBF7D0; }

    /* Página — padding mais compacto */
    .page { padding: 20px; }
    .ph   { margin-bottom: 18px; }
    .ph h2 { font-size: 18px; font-weight: 600; }
    .grid-4 { gap: 12px; margin-bottom: 18px; }

    /* Tabelas mais limpas */
    thead th { font-size: 11px; font-weight: 600; text-transform: none; letter-spacing: 0; }
    tbody tr:hover { background: var(--primary-light); }

    /* Modal com sombra suave */
    .modal-box { border-radius: 18px; box-shadow: 0 8px 32px rgba(15,23,42,.12); }
    .modal-head { border-bottom: 1px solid var(--border-soft); }
    .modal-title { font-size: 15px; font-weight: 600; }

    /* Form control com foco laranja */
    .form-control:focus {
      border-color: var(--primary);
      box-shadow: 0 0 0 3px rgba(255,107,26,.1);
      background: #fff;
    }

    /* Toast com fundo branco */
    .toast {
      background: #1A1A1A;
      color: #fff;
      border-radius: 10px;
      font-size: 13px;
      font-weight: 500;
      box-shadow: 0 4px 16px rgba(0,0,0,.15);
    }

    /* Orders detail panel — fundo branco simples */
    .orders-detail-panel {
      background: #FFFFFF;
    }

    /* Context pills — estilo mais limpo */
    .context-pill {
      background: var(--primary-light);
      border-color: #FFEDD5;
      color: var(--text-secondary);
    }
    .context-pill strong { color: var(--text); }

    /* Credit bar — laranja */
    .credit-bar { background: var(--primary); }

    /* Page header - mais limpo */
    .orders-section-head h3 { font-size: 15px; font-weight: 600; }

    /* Scroll suave */
    * { scroll-behavior: smooth; }


.context-summary-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.context-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid rgba(255,136,0,.16);
  border-radius: 999px;
  background: linear-gradient(180deg, #fff9f2, #fff4e6);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.context-pill strong {
  color: var(--text);
}

.order-type-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.filter-chip {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: .18s ease;
}

.filter-chip:hover {
  transform: translateY(-1px);
  border-color: var(--primary);
}

.filter-chip.active {
  color: #fff;
  border-color: transparent;
  background: var(--primary);
}

.order-meta-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.timer-badge,
.priority-badge,
.type-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.timer-badge {
  background: #fff7e9;
  color: #b45309;
}

.type-badge {
  background: #eff6ff;
  color: #1d4ed8;
}

.dispatch-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.dispatch-badge.awaiting {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fcd34d;
}

.dispatch-badge.assigned {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #bbf7d0;
}

.priority-badge.priority-normal {
  background: #ecfdf5;
  color: #047857;
}

.priority-badge.priority-warning {
  background: #fff7ed;
  color: #c2410c;
}

.priority-badge.priority-danger {
  background: #fef2f2;
  color: #dc2626;
}

.kanban-card.priority-warning {
  border-left: 4px solid #f59e0b;
}

.kanban-card.priority-normal {
  border-left: 4px solid #22c55e;
}

.kanban-card.priority-danger {
  border-left: 4px solid #ef4444;
  box-shadow: 0 18px 34px rgba(239,68,68,.14);
}

.module-chip-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.module-chip-stack .context-pill {
  margin: 0;
}

.hidden-by-module {
  display: none !important;
}

.merchant-local-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 16px;
  align-items: stretch;
  margin: 0 0 16px;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--premium-line, var(--border-soft));
  border-radius: 16px;
  box-shadow: var(--premium-shadow, var(--shadow));
}

.merchant-local-hero span {
  display: inline-flex;
  margin-bottom: 8px;
  color: #f97316;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.merchant-local-hero h3 {
  margin: 0;
  color: #0f172a;
  font-size: 24px;
  line-height: 1.16;
}

.merchant-local-hero p {
  max-width: 680px;
  margin-top: 8px;
  color: #64748b;
  font-size: 14px;
}

.merchant-finance-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-content: stretch;
}

.merchant-finance-panel > div {
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--premium-line, var(--border-soft));
  border-radius: 12px;
  background: #f8fafc;
}

.merchant-finance-panel span {
  display: block;
  margin: 0 0 6px;
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
}

.merchant-finance-panel strong {
  display: block;
  color: #0f172a;
  font-size: 16px;
  line-height: 1.2;
}

.merchant-finance-panel .finance-alert {
  grid-column: 1 / -1;
  min-height: auto;
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
  font-size: 12px;
  font-weight: 900;
}


.order-summary-card {
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.order-summary-card .summary-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-secondary);
  font-weight: 800;
}

.order-summary-card .summary-value {
  font-size: 18px;
  font-weight: 900;
  color: var(--text);
}

.order-summary-card .summary-caption {
  font-size: 12px;
  color: var(--text-secondary);
}

.product-modal-box {
  max-width: 1120px;
}

.product-modal-body {
  max-height: 72vh;
  overflow: auto;
}

.product-form-section {
  border: 1px solid var(--border);
  background: rgba(255,255,255,.02);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 16px;
}

.product-form-section-title {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .03em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.product-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.product-toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
}

.product-toggle-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
}

.section-head-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.addon-groups-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.addon-group-card {
  border: 1px dashed var(--border);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255,255,255,.02);
}

.addon-items-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.addon-item-row {
  display: grid;
  grid-template-columns: 1.8fr .8fr auto;
  gap: 10px;
  align-items: center;
}

.addon-empty-state {
  border: 1px dashed var(--border);
  border-radius: 16px;
  padding: 18px;
  text-align: center;
  color: var(--text-secondary);
}

.addon-empty-state i {
  font-size: 22px;
  display: block;
  margin-bottom: 8px;
}

.addon-group-action-wrap {
  display: flex;
  align-items: end;
}

.addon-check-wrap {
  display: flex;
  align-items: center;
}

.pizza-config-section {
  background: #fffdf8;
}

.pizza-builder-grid {
  display: grid;
  gap: 14px;
}

.pizza-builder-card {
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  background: #fff;
  padding: 14px;
}

.pizza-builder-card-wide {
  background: #fff7ed;
  border-color: #fed7aa;
}

.pizza-builder-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-bottom: 4px;
}

.pizza-builder-title i {
  color: var(--primary);
}

.pizza-options-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.pizza-option-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(120px, .7fr) 86px 40px;
  gap: 8px;
  align-items: center;
}

.pizza-option-row-flavor {
  grid-template-columns: minmax(140px, 1fr) minmax(180px, 1.2fr) minmax(160px, 1fr) minmax(110px, .6fr) 86px 40px;
}

.pizza-active-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  color: #4b5563;
}

.pizza-config-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.pizza-config-summary span,
.pizza-empty-row {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text-muted);
  background: #fff;
}

.subcat-preview-text {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  background: rgba(255,255,255,.04);
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  line-height: 1.45;
}

.cashback-method-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.cashback-method-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.cashback-method-option span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.cashback-method-option input {
  accent-color: var(--primary);
}

.grid {
  display: grid;
  gap: 12px;
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.muted {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--border-soft);
  border-radius: 14px;
  color: var(--text-muted);
  text-align: center;
  font-size: 13px;
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-soft);
}

.list-row:last-child {
  border-bottom: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.pill.green {
  background: #f0fdf4;
  color: #166534;
}

.pill.orange {
  background: #fff7ed;
  color: #c2410c;
}

.campaign-product-options {
  margin-top: 12px;
}

.campaign-highlight-preview {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  background: #fff;
  margin-bottom: 12px;
}

.campaign-highlight-preview:last-child {
  margin-bottom: 0;
}

.campaign-highlight-preview strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.campaign-highlight-preview p {
  margin: 6px 0;
  color: var(--text-muted);
}

.campaign-eyebrow {
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.campaign-highlight-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  min-width: 110px;
}

@media (max-width: 900px) {
  .grid.cols-2,
  .grid.cols-3,
  .campaign-workspace {
    grid-template-columns: 1fr;
  }

  .campaign-highlight-preview {
    flex-direction: column;
  }

  .campaign-highlight-actions {
    align-items: flex-start;
    flex-direction: row;
    flex-wrap: wrap;
  }
}

@media (max-width: 900px) {
  .product-grid-3,
  .product-toggle-grid,
  .addon-item-row,
  .pizza-option-row,
  .pizza-option-row-flavor {
    grid-template-columns: 1fr;
  }

  .product-modal-box {
    max-width: calc(100vw - 24px);
  }
}


.courier-layout {
  align-items: start;
}

.courier-card {
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  padding: 16px;
  background: linear-gradient(180deg, #ffffff, #fffaf4);
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.courier-card h4 {
  font-size: 15px;
  margin-bottom: 4px;
}

.courier-card .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  color: #475569;
}

.courier-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 136px;
}

.courier-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.courier-report-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.report-mini {
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 14px;
  background: #fff;
}

.report-mini-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: .4px;
}

.report-mini-value {
  font-size: 20px;
  font-weight: 800;
  margin-top: 6px;
}

.courier-ranking-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-soft);
}

.courier-ranking-item:last-child {
  border-bottom: none;
}

.courier-whatsapp-preview {
  margin-top: 14px;
  padding: 14px;
  border: 1px dashed rgba(255,106,0,.35);
  border-radius: 16px;
  background: #fff8f0;
  white-space: pre-wrap;
  font-size: 12px;
  line-height: 1.5;
  color: #334155;
  max-height: 220px;
  overflow: auto;
}

@media (max-width: 1080px) {
  .courier-filters,
  .courier-report-strip,
  .courier-layout {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .courier-filters,
  .courier-report-strip,
  .courier-layout,
  .form-row {
    grid-template-columns: 1fr;
  }

  .courier-card {
    flex-direction: column;
  }

  .courier-actions {
    flex-direction: row;
    min-width: auto;
    flex-wrap: wrap;
  }
}


@media (max-width: 1280px) {
  .orders-workspace { grid-template-columns: 1fr; }
  .orders-detail-panel { position: static; min-height: auto; }
}

@media (max-width: 1080px) {
  .orders-cols { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 720px) {
  .orders-cols, .orders-detail-actions { grid-template-columns: 1fr; }
  .orders-board-shell, .orders-history-card, .orders-detail-panel { padding: 14px; border-radius: 18px; }
}


/* Etapa visual extra - cards estilo operação delivery */
.order-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.orders-cols {
  grid-template-columns: repeat(4, minmax(340px, 1fr));
  gap: 18px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.orders-cols > div {
  min-width: 340px;
}

.orders-col-head {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(15,23,42,.06);
}

.kanban-card {
  position: relative;
  padding: 18px 18px 16px;
  border-radius: 24px;
  border: 1px solid rgba(226,232,240,.95);
  background: linear-gradient(180deg, #ffffff 0%, #fffdfa 100%);
  box-shadow: 0 14px 34px rgba(15,23,42,.08);
}

.kanban-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  border-radius: 24px 0 0 24px;
  background: #f59e0b;
}

#col-preparing .kanban-card::before { background: #0ea5e9; }
#col-delivery .kanban-card::before { background: #7c3aed; }
#col-done .kanban-card::before { background: #16a34a; }

.kanban-card .order-id {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.kanban-card .badge {
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
}

.kanban-card .order-card-address {
  margin-top: 12px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid rgba(226,232,240,.85);
  border-radius: 14px;
}

.kanban-card .order-meta-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.kanban-card .type-badge,
.kanban-card .timer-badge,
.kanban-card .priority-badge {
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.kanban-card .timer-badge {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.kanban-card .type-badge {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fdba74;
}

.kanban-card .priority-normal {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.kanban-card .priority-warning {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fcd34d;
}

.kanban-card .priority-danger {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

.kanban-card .text-success {
  font-size: 26px;
  letter-spacing: -.03em;
}

.kanban-card .order-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.kanban-card .order-card-actions .btn {
  width: 100%;
  min-height: 42px;
  border-radius: 14px;
  justify-content: center;
  font-weight: 800;
}

.kanban-card.is-selected {
  border-color: rgba(255,106,0,.38);
  box-shadow: 0 22px 42px rgba(255,106,0,.16);
  transform: translateY(-2px);
}

.orders-detail-panel {
  background: linear-gradient(180deg, #ffffff 0%, #fff7ed 100%);
}

.orders-detail-box {
  border-radius: 20px;
  box-shadow: 0 10px 24px rgba(15,23,42,.04);
}

.orders-detail-actions .btn {
  min-height: 42px;
  border-radius: 14px;
  font-weight: 800;
}

.orders-history-card table thead th {
  background: #fff7ed;
}

@media (max-width: 1080px) {
  .orders-cols {
    grid-template-columns: repeat(4, minmax(300px, 1fr));
  }
  .orders-cols > div { min-width: 300px; }
}

@media (max-width: 720px) {
  .kanban-card .order-card-actions {
    grid-template-columns: 1fr;
  }
  .orders-cols {
    grid-template-columns: repeat(4, 88vw);
  }
  .orders-cols > div { min-width: 88vw; }
}


@keyframes orderPulseGlow {
  0%,100% { box-shadow: 0 14px 34px rgba(15,23,42,.08), 0 0 0 0 rgba(255,106,0,0); }
  50% { box-shadow: 0 22px 42px rgba(255,106,0,.18), 0 0 0 8px rgba(255,106,0,.08); }
}

.is-new-order {
  animation: orderPulseGlow 1.2s ease-in-out infinite;
}

.timer-badge.timer-normal {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.timer-badge.timer-warning {
  background: #fff7ed;
  border-color: #fdba74;
  color: #c2410c;
  font-weight: 900;
}

.timer-badge.timer-danger {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #b91c1c;
  font-weight: 900;
  animation: orderPulseGlow 1.4s ease-in-out infinite;
}


.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.executive-summary-pill {
  min-width: 160px;
}

.stat {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(226,232,240,.9);
  background: linear-gradient(180deg,#ffffff 0%,#fff8f1 100%);
  box-shadow: 0 16px 34px rgba(15,23,42,.06);
}

.stat::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 90px;
  height: 90px;
  background: radial-gradient(circle, rgba(255,106,0,.12), transparent 70%);
}

.mini-kpi,
.card,
.orders-history-card,
.orders-detail-panel,
.orders-board {
  box-shadow: 0 16px 34px rgba(15,23,42,.06);
}

.context-summary-bar {
  background: linear-gradient(180deg,#ffffff 0%,#fff7ed 100%);
  border: 1px solid rgba(253,186,116,.28);
  box-shadow: 0 14px 30px rgba(15,23,42,.05);
}

.context-summary-pill,
.executive-summary-pill {
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(226,232,240,.8);
}

/* Tema escuro elegante */
body.merchant-dark {
  --bg: #0f172a;
  --panel: #111827;
  --panel-2: #0b1220;
  --text: #e5e7eb;
  --text-muted: #94a3b8;
  --border-soft: rgba(148,163,184,.16);
  background: linear-gradient(180deg, #0b1220 0%, #111827 100%);
  color: var(--text);
}

body.merchant-dark .main,
body.merchant-dark .wrapper {
  background: transparent;
}

body.merchant-dark .topbar,
body.merchant-dark .ph,
body.merchant-dark .card,
body.merchant-dark .stat,
body.merchant-dark .mini-kpi,
body.merchant-dark .orders-board,
body.merchant-dark .orders-history-card,
body.merchant-dark .orders-detail-panel,
body.merchant-dark .orders-detail-box,
body.merchant-dark .kanban-card,
body.merchant-dark .credit-package-btn,
body.merchant-dark .credit-request-card,
body.merchant-dark .context-summary-bar,
body.merchant-dark .context-summary-pill,
body.merchant-dark .executive-summary-pill,
body.merchant-dark .form-control,
body.merchant-dark .table-wrap,
body.merchant-dark table,
body.merchant-dark .mini-bar-track,
body.merchant-dark .empty,
body.merchant-dark .store-info {
  background: rgba(15,23,42,.88) !important;
  color: #e5e7eb;
  border-color: rgba(148,163,184,.16) !important;
}

body.merchant-dark .sidebar {
  background: linear-gradient(180deg,#081120 0%,#0f172a 100%);
}

body.merchant-dark .card-head,
body.merchant-dark .ph h2,
body.merchant-dark .topbar-title,
body.merchant-dark .stat-value,
body.merchant-dark strong,
body.merchant-dark td,
body.merchant-dark th,
body.merchant-dark label,
body.merchant-dark .order-card-customer,
body.merchant-dark .orders-detail-total,
body.merchant-dark .orders-detail-code {
  color: #f8fafc !important;
}

body.merchant-dark .text-muted,
body.merchant-dark .stat-label,
body.merchant-dark .ph p,
body.merchant-dark .orders-detail-subtitle,
body.merchant-dark .order-id,
body.merchant-dark small,
body.merchant-dark #merchant-name-top {
  color: #94a3b8 !important;
}

body.merchant-dark .btn.btn-secondary,
body.merchant-dark .toggle-status {
  background: #172033;
  color: #e5e7eb;
  border-color: rgba(148,163,184,.18);
}

body.merchant-dark .pizza-config-section,
body.merchant-dark .pizza-builder-card,
body.merchant-dark .pizza-config-summary span,
body.merchant-dark .pizza-empty-row {
  background: rgba(15,23,42,.72);
  color: #e5e7eb;
  border-color: rgba(148,163,184,.18);
}

body.merchant-dark .order-card-address,
body.merchant-dark .orders-detail-line,
body.merchant-dark .credit-summary-item {
  background: rgba(30,41,59,.72) !important;
}

body.merchant-dark .empty-state,
body.merchant-dark .list-row,
body.merchant-dark .campaign-highlight-preview,
body.merchant-dark .cashback-method-option {
  background: rgba(15,23,42,.88) !important;
  border-color: rgba(148,163,184,.16) !important;
  color: #e5e7eb;
}

body.merchant-dark .muted,
body.merchant-dark .campaign-highlight-preview p {
  color: #94a3b8 !important;
}

body.merchant-dark .orders-history-card table thead th {
  background: rgba(30,41,59,.9) !important;
}


.products-insights-bar {
  margin-bottom: 16px;
}

.products-table-wrap {
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 18px 36px rgba(15,23,42,.06);
}

.products-table-wrap table {
  border-collapse: separate;
  border-spacing: 0 12px;
  width: 100%;
}

.products-table-wrap thead th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  padding: 0 16px 6px;
}

.product-row td {
  background: linear-gradient(180deg,#ffffff 0%,#fffaf5 100%);
  border-top: 1px solid rgba(226,232,240,.9);
  border-bottom: 1px solid rgba(226,232,240,.9);
  padding: 16px;
  vertical-align: middle;
}

.product-row td:first-child {
  border-left: 1px solid rgba(226,232,240,.9);
  border-radius: 20px 0 0 20px;
}

.product-row td:last-child {
  border-right: 1px solid rgba(226,232,240,.9);
  border-radius: 0 20px 20px 0;
}

.product-main-cell {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.product-thumb {
  width: 72px;
  min-width: 72px;
  height: 72px;
  border-radius: 18px;
  overflow: hidden;
  background: #fff7ed;
  border: 1px solid rgba(253,186,116,.34);
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-thumb-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-thumb-placeholder {
  font-size: 24px;
  color: var(--primary);
}

.product-main-copy {
  min-width: 0;
  flex: 1;
}

.product-main-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.product-main-title {
  font-size: 16px;
}

.product-price-stack {
  min-width: fit-content;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 18px;
  color: var(--success);
}

.product-old-price {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: line-through;
}

.product-badge-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.badge-soft {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.badge-success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #86efac;
}

.product-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.product-meta-line span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.product-actions-inline {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

body.merchant-dark .product-row td {
  background: rgba(15,23,42,.88);
}

body.merchant-dark .products-table-wrap thead th,
body.merchant-dark .product-meta-line,
body.merchant-dark .product-old-price {
  color: #94a3b8 !important;
}

body.merchant-dark .product-thumb {
  background: rgba(30,41,59,.8);
}

@media (max-width: 920px) {
  .product-main-title-row {
    flex-direction: column;
  }
  .product-price-stack {
    align-items: flex-start;
  }
  .product-row td:nth-child(2) {
    display: none;
  }
}

@media (max-width: 720px) {
  .products-table-wrap {
    overflow-x: auto;
  }
  .product-actions-inline {
    justify-content: flex-start;
  }
  .product-row td {
    min-width: 160px;
  }
  .product-row td:first-child {
    min-width: 420px;
  }
}


.categories-insights-bar {
  margin-bottom: 16px;
}

.categories-table-wrap {
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 18px 36px rgba(15,23,42,.06);
}

.categories-table-wrap table {
  border-collapse: separate;
  border-spacing: 0 12px;
  width: 100%;
}

.categories-table-wrap thead th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  padding: 0 16px 6px;
}

.category-row td {
  background: linear-gradient(180deg,#ffffff 0%,#fffaf5 100%);
  border-top: 1px solid rgba(226,232,240,.9);
  border-bottom: 1px solid rgba(226,232,240,.9);
  padding: 16px;
  vertical-align: middle;
}

.category-row td:first-child {
  border-left: 1px solid rgba(226,232,240,.9);
  border-radius: 20px 0 0 20px;
}

.category-row td:last-child {
  border-right: 1px solid rgba(226,232,240,.9);
  border-radius: 0 20px 20px 0;
}

.category-main-cell {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.category-avatar {
  width: 60px;
  min-width: 60px;
  height: 60px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff7ed;
  color: var(--primary);
  border: 1px solid rgba(253,186,116,.34);
  font-size: 22px;
}

.category-main-copy {
  flex: 1;
  min-width: 0;
}

.category-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.category-main-title {
  font-size: 16px;
}

.category-badge-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.category-summary-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.order-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  border-radius: 999px;
  background: #fff7ed;
  color: var(--primary);
  font-weight: 900;
  border: 1px solid rgba(253,186,116,.34);
}

body.merchant-dark .category-row td {
  background: rgba(15,23,42,.88);
}

body.merchant-dark .categories-table-wrap thead th {
  color: #94a3b8 !important;
}

body.merchant-dark .category-avatar,
body.merchant-dark .order-pill {
  background: rgba(30,41,59,.82);
}

@media (max-width: 920px) {
  .category-title-row {
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .categories-table-wrap {
    overflow-x: auto;
  }
  .category-row td:first-child {
    min-width: 380px;
  }
}


.categories-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.categories-empty-state {
  grid-column: 1 / -1;
  background: #fff;
  border: 1px dashed rgba(226,232,240,.95);
  border-radius: 16px;
}

.category-card-pro {
  border-radius: 24px;
  border: 1px solid rgba(226,232,240,.9);
  background: linear-gradient(180deg,#ffffff 0%,#fff9f3 100%);
  box-shadow: 0 18px 36px rgba(15,23,42,.06);
  padding: 18px;
}

.category-card-top {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.category-icon-pro {
  width: 64px;
  min-width: 64px;
  height: 64px;
  border-radius: 20px;
  background: linear-gradient(135deg,#fff7ed 0%,#ffe2c0 100%);
  color: var(--primary);
  border: 1px solid rgba(253,186,116,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}

.category-card-head-copy {
  flex: 1;
  min-width: 0;
}

.category-card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.category-card-title-row h3 {
  margin: 0;
  font-size: 18px;
}

.category-card-title-row p {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.category-card-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.category-card-stats div {
  border-radius: 16px;
  background: rgba(255,255,255,.75);
  border: 1px solid rgba(226,232,240,.8);
  padding: 10px;
}

.category-card-stats strong {
  display: block;
  font-size: 18px;
}

.category-card-stats span {
  font-size: 12px;
  color: var(--text-muted);
}

.category-card-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed rgba(226,232,240,.9);
}

.section-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-weight: 800;
}

.category-chip-list,
.mini-addon-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-chip,
.mini-addon-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff7ed;
  border: 1px solid rgba(253,186,116,.35);
  color: #c2410c;
  font-size: 12px;
  font-weight: 700;
}

.category-chip.is-off {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #64748b;
}

.mini-addon-pill {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #334155;
}

.mini-addon-pill small {
  font-size: 11px;
  color: var(--text-muted);
}

.empty-chip {
  color: #64748b;
}

.category-card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.category-delete-btn {
  color: var(--danger);
}

body.merchant-dark .category-card-pro,
body.merchant-dark .category-card-stats div {
  background: rgba(15,23,42,.9) !important;
  border-color: rgba(148,163,184,.16) !important;
}

body.merchant-dark .category-card-title-row p,
body.merchant-dark .section-title,
body.merchant-dark .category-card-stats span,
body.merchant-dark .mini-addon-pill small {
  color: #94a3b8 !important;
}

body.merchant-dark .category-icon-pro,
body.merchant-dark .category-chip,
body.merchant-dark .mini-addon-pill {
  background: rgba(30,41,59,.8);
  border-color: rgba(148,163,184,.16);
  color: #e5e7eb;
}

@media (max-width: 920px) {
  .category-card-title-row {
    flex-direction: column;
  }
  .category-card-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .categories-card-grid {
    grid-template-columns: 1fr;
  }
  .category-card-pro {
    padding: 14px;
  }
  .category-card-top {
    flex-direction: column;
  }
  .category-card-actions .btn {
    flex: 1 1 auto;
  }
  .category-card-actions .category-delete-btn {
    flex: 0 0 42px;
  }
}

/* Categories follow the standard table rhythm used across the merchant panel. */
.categories-table-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.categories-table-wrap table {
  border-collapse: collapse;
  border-spacing: 0;
}

.categories-table-wrap thead th {
  background: #fafbfc;
  border-bottom: 1px solid var(--border);
  padding: 11px 16px;
  letter-spacing: .4px;
}

.category-row td {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border-soft);
  padding: 14px 16px;
}

.category-row:last-child td {
  border-bottom: 0;
}

.category-row td:first-child,
.category-row td:last-child {
  border-left: 0;
  border-right: 0;
  border-radius: 0;
}

.category-main-cell {
  align-items: center;
  gap: 12px;
}

.category-avatar {
  width: 42px;
  min-width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 18px;
}

.order-pill {
  min-width: 34px;
  height: 30px;
  border-radius: 10px;
  font-size: 12px;
}

body.merchant-dark .categories-table-wrap thead th,
body.merchant-dark .category-row td {
  background: transparent !important;
}

/* Merchant premium refresh */
:root {
      color-scheme: light;
  --premium-line: rgba(226,232,240,.92);
  --premium-shadow: 0 18px 42px rgba(15,23,42,.07);
  --premium-shadow-strong: 0 24px 56px rgba(15,23,42,.12);
}

body {
  background: #f6f7f9;
}

.sidebar {
  background: linear-gradient(175deg, #1E1209 0%, #2D1A0E 50%, #1A0F08 100%);
  box-shadow: 4px 0 20px rgba(10,6,4,.28);
}

.brand-icon {
  background: linear-gradient(135deg, #FF6B1A, #FF8C42) !important;
  box-shadow: 0 6px 16px rgba(255,107,26,.35) !important;
}

.nav-btn.active,
.btn-primary {
  background: #111827;
  box-shadow: none;
}

.nav-btn.active {
  border: 1px solid rgba(255,255,255,.1);
}

.topbar {
  height: 70px;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--premium-line);
  box-shadow: 0 10px 30px rgba(15,23,42,.04);
}

.page {
  padding: 26px 30px 34px;
}

.card,
.tbl-wrap,
.stat,
.mini-kpi,
.orders-board-shell,
.orders-detail-panel,
.orders-history-card {
  border: 1px solid var(--premium-line);
  border-radius: 16px;
  box-shadow: var(--premium-shadow);
}

.stat,
.mini-kpi,
.card,
.orders-board-shell,
.orders-detail-panel,
.orders-history-card {
  background: #fff;
}

.btn {
  border-radius: 10px;
}

.btn-primary {
  background: #111827;
  color: #fff;
}

.btn-primary:hover {
  background: #1f2937;
}

.btn-success {
  background: #0f7a3b;
  color: #fff;
  border-color: #0f7a3b;
}

.btn-danger {
  background: #fff;
  color: #b91c1c;
  border-color: #fecaca;
}

.btn-warning {
  background: #fff7ed;
  color: #9a3412;
  border-color: #fed7aa;
}

.icon-only {
  width: 38px;
  justify-content: center;
  padding-inline: 0;
}

#page-orders {
  padding-top: 22px;
}

.orders-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: end;
  padding: 22px 24px;
  margin-bottom: 16px;
  background: #fff;
  border: 1px solid var(--premium-line);
  border-radius: 18px;
  box-shadow: var(--premium-shadow);
}

.orders-eyebrow {
  display: inline-flex;
  margin-bottom: 8px;
  color: #f97316;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.orders-hero h2 {
  font-size: 30px;
  line-height: 1.1;
  margin: 0;
  color: #0f172a;
}

.orders-hero p {
  max-width: 560px;
  margin-top: 8px;
  color: #64748b;
  font-size: 14px;
}

.orders-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.orders-toolbar .form-control {
  width: 174px;
  min-height: 40px;
  background: #fff;
}

.orders-topline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.orders-live-summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--premium-line);
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(15,23,42,.04);
}

.orders-live-summary span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 6px 10px;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.orders-live-summary strong {
  color: #0f172a;
  font-size: 16px;
}

.order-type-filters {
  gap: 8px;
  margin: 0;
}

.filter-chip {
  min-height: 38px;
  padding: 8px 13px;
  border-radius: 12px;
  background: #fff;
  color: #475569;
}

.filter-chip.active {
  background: #111827;
  color: #fff;
  box-shadow: none;
}

.orders-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.orders-metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--premium-line);
  border-radius: 16px;
  box-shadow: 0 14px 30px rgba(15,23,42,.05);
}

.orders-metric span {
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.orders-metric strong {
  color: #0f172a;
  font-size: 32px;
  line-height: 1;
}

.orders-metric.is-waiting { border-left: 4px solid #f97316; }
.orders-metric.is-preparing { border-left: 4px solid #2563eb; }
.orders-metric.is-delivery { border-left: 4px solid #16a34a; }
.orders-metric.is-urgent { border-left: 4px solid #dc2626; }

.orders-workspace {
  grid-template-columns: minmax(0, 2.4fr) minmax(360px, .85fr);
  gap: 16px;
}

.orders-board-shell {
  padding: 18px;
  overflow: hidden;
}

.orders-section-head {
  margin-bottom: 14px;
}

.orders-section-head h3 {
  color: #0f172a;
  font-size: 18px;
}

.orders-section-head p {
  color: #64748b;
}

.orders-cols {
  display: grid;
  grid-template-columns: repeat(4, minmax(300px, 1fr));
  gap: 14px;
  overflow-x: auto;
  padding: 2px 2px 8px;
}

.orders-cols > div {
  min-width: 300px;
}

.orders-col-head {
  position: sticky;
  top: 0;
  z-index: 2;
  justify-content: flex-start;
  min-height: 42px;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: #f8fafc !important;
  color: #334155 !important;
  border: 1px solid var(--premium-line);
  border-radius: 12px;
  box-shadow: none;
  text-align: left;
}

.kanban-card {
  display: grid;
  gap: 12px;
  min-height: 188px;
  padding: 16px;
  margin-bottom: 10px;
  background: #fff;
  border: 1px solid var(--premium-line);
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(15,23,42,.06);
}

.kanban-card::before {
  display: none;
}

.kanban-card:hover,
.kanban-card.is-selected {
  transform: translateY(-2px);
  border-color: #fdba74;
  box-shadow: var(--premium-shadow-strong);
  background: #fff;
}

.kanban-card.priority-warning {
  border-left: 4px solid #f59e0b;
}

.kanban-card.priority-danger {
  border-left: 4px solid #dc2626;
}

.order-card-topline,
.order-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.order-short-id {
  color: #64748b;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 900;
}

.order-card-customer {
  font-size: 18px;
  line-height: 1.2;
  font-weight: 900;
  color: #0f172a;
}

.order-card-total {
  min-width: fit-content;
  color: #0f7a3b;
  font-size: 22px;
  font-weight: 900;
  text-align: right;
}

.kanban-card .order-card-address {
  margin-top: 6px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.35;
}

.order-card-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.timer-badge,
.type-badge,
.priority-badge,
.kanban-card .type-badge,
.kanban-card .timer-badge,
.kanban-card .priority-badge {
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 9px;
  font-size: 11px;
}

.timer-badge.timer-normal {
  background: #f8fafc;
  color: #334155;
  border: 1px solid #e2e8f0;
}

.timer-badge.timer-warning {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fdba74;
}

.timer-badge.timer-danger {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  animation: none;
}

.kanban-card .type-badge {
  background: #eef2ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
}

.kanban-card .order-card-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: auto;
}

.kanban-card .order-card-actions .btn {
  min-height: 42px;
  width: 100%;
  justify-content: center;
  border-radius: 11px;
  font-size: 12px;
}

.orders-detail-panel {
  top: 92px;
  min-height: 620px;
  padding: 18px;
  background: #fff;
  border-radius: 16px;
}

.orders-detail-header {
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--premium-line);
}

.orders-detail-code {
  color: #0f172a;
  font-size: 26px;
}

.orders-detail-total {
  color: #0f7a3b;
  font-size: 26px;
}

.orders-detail-subtitle {
  color: #64748b;
}

.orders-detail-actions.primary-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 14px;
}

.orders-detail-actions.primary-actions .btn {
  min-height: 42px;
}

.premium-detail-grid {
  grid-template-columns: 1fr;
  gap: 10px;
}

.orders-detail-box {
  padding: 13px;
  border-radius: 14px;
  box-shadow: none;
  background: #fff;
}

.orders-detail-box h4 {
  color: #64748b;
  font-size: 11px;
}

.orders-detail-line {
  align-items: flex-start;
  padding: 7px 0;
  border-bottom: 1px solid #f1f5f9;
}

.orders-detail-line:last-child {
  border-bottom: 0;
}

.orders-detail-line span:first-child {
  color: #64748b;
}

.orders-detail-line strong {
  max-width: 58%;
  color: #0f172a;
  text-align: right;
  line-height: 1.35;
}

.orders-detail-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.orders-history-card {
  margin-top: 16px;
  padding: 18px;
}

.orders-history-card table thead th {
  background: #f8fafc;
}

#orders-config-summary,
#orders-priority-summary {
  display: none !important;
}

body.merchant-dark .orders-hero,
body.merchant-dark .merchant-local-hero,
body.merchant-dark .merchant-finance-panel > div,
body.merchant-dark .orders-live-summary,
body.merchant-dark .orders-metric,
body.merchant-dark .orders-board-shell,
body.merchant-dark .orders-detail-panel,
body.merchant-dark .orders-history-card,
body.merchant-dark .kanban-card,
body.merchant-dark .orders-detail-box {
  background: rgba(15,23,42,.92) !important;
  border-color: rgba(148,163,184,.18) !important;
}

body.merchant-dark .orders-hero h2,
body.merchant-dark .merchant-local-hero h3,
body.merchant-dark .merchant-finance-panel strong,
body.merchant-dark .orders-section-head h3,
body.merchant-dark .order-card-customer,
body.merchant-dark .order-short-id,
body.merchant-dark .orders-metric strong,
body.merchant-dark .orders-detail-code,
body.merchant-dark .orders-detail-line strong,
body.merchant-dark .orders-live-summary strong {
  color: #f8fafc !important;
}

body.merchant-dark .orders-hero p,
body.merchant-dark .merchant-local-hero p,
body.merchant-dark .merchant-finance-panel span,
body.merchant-dark .orders-section-head p,
body.merchant-dark .order-card-address,
body.merchant-dark .order-card-strip,
body.merchant-dark .orders-live-summary span,
body.merchant-dark .orders-metric span {
  color: #94a3b8 !important;
}

body.merchant-dark .orders-col-head,
body.merchant-dark .filter-chip,
body.merchant-dark .orders-detail-item {
  background: rgba(30,41,59,.88) !important;
  border-color: rgba(148,163,184,.18) !important;
  color: #e5e7eb !important;
}

@media (max-width: 1280px) {
  .orders-workspace {
    grid-template-columns: 1fr;
  }

  .orders-detail-panel {
    position: static;
    min-height: auto;
  }
}

@media (max-width: 960px) {
  .page {
    padding: 20px;
  }

  .merchant-local-hero,
  .merchant-finance-panel {
    grid-template-columns: 1fr;
  }

  .orders-hero,
  .orders-topline {
    grid-template-columns: 1fr;
  }

  .orders-toolbar {
    justify-content: flex-start;
  }

  .orders-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .orders-hero {
    padding: 18px;
  }

  .orders-hero h2 {
    font-size: 24px;
  }

  .orders-toolbar .form-control {
    width: 100%;
  }

  .orders-toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .orders-toolbar .form-control {
    grid-column: span 2;
  }

  .orders-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .orders-metric {
    min-height: 68px;
    padding: 14px;
  }

  .orders-metric strong {
    font-size: 26px;
  }

  .orders-cols {
    grid-template-columns: repeat(4, 84vw);
  }

  .orders-cols > div {
    min-width: 84vw;
  }

  .kanban-card .order-card-actions,
  .orders-detail-actions.primary-actions {
    grid-template-columns: 1fr;
  }
}

/* Orange brand action refresh */
.brand-icon,
.nav-btn.active,
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary)) !important;
  color: #fff;
  box-shadow: 0 8px 18px rgba(255,106,0,.24);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #f97316, #ef4444) !important;
}

.btn-success {
  background: linear-gradient(135deg, var(--primary), #fb923c);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(255,106,0,.18);
}

.orders-workspace {
  display: block;
}

.orders-board-shell {
  width: 100%;
}

.orders-cols {
  grid-template-columns: repeat(4, minmax(280px, 1fr));
}

.orders-cols > div {
  min-width: 280px;
}

.orders-history-card {
  display: none;
}

@media (max-width: 720px) {
  .orders-cols {
    grid-template-columns: repeat(4, 84vw);
  }

  .orders-cols > div {
    min-width: 84vw;
  }
}

/* Final dark theme stabilization */
body.merchant-dark,
body.merchant-dark .main,
body.merchant-dark .wrapper,
body.merchant-dark .page {
  background: #0b1220 !important;
  color: #e5e7eb !important;
}

body.merchant-dark .topbar,
body.merchant-dark .ph,
body.merchant-dark .card,
body.merchant-dark .card-head,
body.merchant-dark .card-body,
body.merchant-dark .stat,
body.merchant-dark .mini-kpi,
body.merchant-dark .tbl-wrap,
body.merchant-dark .table-wrap,
body.merchant-dark .products-table-wrap,
body.merchant-dark .categories-table-wrap,
body.merchant-dark .modal-box,
body.merchant-dark .modal-head,
body.merchant-dark .modal-body,
body.merchant-dark .modal-foot,
body.merchant-dark .product-form-section,
body.merchant-dark .addon-group-card,
body.merchant-dark .addon-empty-state,
body.merchant-dark .empty-state,
body.merchant-dark .list-row,
body.merchant-dark .campaign-highlight-preview,
body.merchant-dark .cashback-method-option,
body.merchant-dark .credit-package-btn,
body.merchant-dark .credit-request-card,
body.merchant-dark .credit-summary-item,
body.merchant-dark .orders-hero,
body.merchant-dark .orders-live-summary,
body.merchant-dark .orders-metric,
body.merchant-dark .orders-board-shell,
body.merchant-dark .orders-detail-panel,
body.merchant-dark .orders-detail-box,
body.merchant-dark .orders-detail-item,
body.merchant-dark .orders-history-card,
body.merchant-dark .kanban-card,
body.merchant-dark .store-info,
body.merchant-dark .report-mini,
body.merchant-dark .courier-card,
body.merchant-dark .courier-whatsapp-preview {
  background: #111827 !important;
  border-color: rgba(148,163,184,.18) !important;
  color: #e5e7eb !important;
  box-shadow: 0 16px 36px rgba(0,0,0,.22);
}

body.merchant-dark .card-head,
body.merchant-dark .modal-head,
body.merchant-dark .modal-foot,
body.merchant-dark .orders-col-head {
  background: #0f172a !important;
  border-color: rgba(148,163,184,.18) !important;
}

body.merchant-dark .form-control,
body.merchant-dark .mono-box,
body.merchant-dark select.form-control,
body.merchant-dark textarea.form-control {
  background: #0b1220 !important;
  border-color: rgba(148,163,184,.24) !important;
  color: #e5e7eb !important;
}

body.merchant-dark .form-control:focus {
  background: #111827 !important;
  border-color: rgba(249,115,22,.78) !important;
  box-shadow: 0 0 0 3px rgba(249,115,22,.18) !important;
}

body.merchant-dark .form-control::placeholder {
  color: #64748b !important;
}

body.merchant-dark .form-control:disabled,
body.merchant-dark .form-control[readonly] {
  background: #1e293b !important;
  color: #94a3b8 !important;
}

body.merchant-dark label,
body.merchant-dark th,
body.merchant-dark td,
body.merchant-dark .orders-detail-line strong,
body.merchant-dark .orders-detail-code,
body.merchant-dark .order-card-customer,
body.merchant-dark .order-short-id,
body.merchant-dark .category-title-pro,
body.merchant-dark .product-main-info strong,
body.merchant-dark .campaign-highlight-preview strong,
body.merchant-dark .credit-package-btn strong,
body.merchant-dark .cashback-method-option strong,
body.merchant-dark .store-info strong,
body.merchant-dark .modal-title,
body.merchant-dark h1,
body.merchant-dark h2,
body.merchant-dark h3,
body.merchant-dark h4 {
  color: #f8fafc !important;
}

body.merchant-dark .muted,
body.merchant-dark .text-muted,
body.merchant-dark .fs-12,
body.merchant-dark .orders-detail-subtitle,
body.merchant-dark .orders-detail-line span:first-child,
body.merchant-dark .orders-hero p,
body.merchant-dark .orders-section-head p,
body.merchant-dark .orders-metric span,
body.merchant-dark .orders-live-summary span,
body.merchant-dark .order-card-address,
body.merchant-dark .order-card-strip,
body.merchant-dark .category-meta,
body.merchant-dark .product-meta,
body.merchant-dark .campaign-highlight-preview span,
body.merchant-dark .cashback-method-option span,
body.merchant-dark .credit-package-btn span,
body.merchant-dark .empty-state p {
  color: #94a3b8 !important;
}

body.merchant-dark table,
body.merchant-dark thead,
body.merchant-dark tbody {
  background: transparent !important;
  color: #e5e7eb !important;
}

body.merchant-dark thead th,
body.merchant-dark .orders-history-card table thead th {
  background: #0f172a !important;
  border-color: rgba(148,163,184,.18) !important;
  color: #94a3b8 !important;
}

body.merchant-dark tbody td,
body.merchant-dark .product-row td,
body.merchant-dark .category-row td {
  background: #111827 !important;
  border-color: rgba(148,163,184,.12) !important;
  color: #e5e7eb !important;
}

body.merchant-dark tbody tr:hover td,
body.merchant-dark .product-row:hover td,
body.merchant-dark .category-row:hover td {
  background: #172033 !important;
}

body.merchant-dark .product-thumb,
body.merchant-dark .category-avatar,
body.merchant-dark .category-icon-pro,
body.merchant-dark .order-pill,
body.merchant-dark .mini-bar-track,
body.merchant-dark .mini-addon-pill,
body.merchant-dark .subcat-preview-text,
body.merchant-dark .filter-chip,
body.merchant-dark .pill,
body.merchant-dark .badge-soft,
body.merchant-dark .category-chip,
body.merchant-dark .context-summary-pill,
body.merchant-dark .executive-summary-pill {
  background: #1e293b !important;
  border-color: rgba(148,163,184,.18) !important;
  color: #e5e7eb !important;
}

body.merchant-dark .filter-chip.active,
body.merchant-dark .cashback-method-option:has(input:checked),
body.merchant-dark .credit-package-btn.selected {
  background: rgba(249,115,22,.16) !important;
  border-color: rgba(249,115,22,.62) !important;
  color: #fed7aa !important;
}

body.merchant-dark .btn-secondary,
body.merchant-dark .btn-ghost,
body.merchant-dark .modal-close {
  background: #1e293b !important;
  border-color: rgba(148,163,184,.22) !important;
  color: #e5e7eb !important;
}

body.merchant-dark .btn-secondary:hover,
body.merchant-dark .btn-ghost:hover,
body.merchant-dark .modal-close:hover {
  background: #263449 !important;
}

body.merchant-dark .btn-danger {
  background: #3f1d24 !important;
  border-color: rgba(248,113,113,.35) !important;
  color: #fecaca !important;
}

body.merchant-dark .btn-warning {
  background: #422006 !important;
  border-color: rgba(251,146,60,.42) !important;
  color: #fed7aa !important;
}

body.merchant-dark .btn-success {
  background: linear-gradient(135deg, #15803d, #16a34a) !important;
  border-color: transparent !important;
  color: #fff !important;
}

body.merchant-dark .badge-muted {
  background: #1e293b !important;
  color: #cbd5e1 !important;
}

body.merchant-dark .badge-warning,
body.merchant-dark .timer-badge.warning {
  background: rgba(251,146,60,.16) !important;
  border-color: rgba(251,146,60,.34) !important;
  color: #fed7aa !important;
}

body.merchant-dark .badge-success,
body.merchant-dark .timer-badge.ok {
  background: rgba(34,197,94,.14) !important;
  border-color: rgba(34,197,94,.28) !important;
  color: #bbf7d0 !important;
}

body.merchant-dark .badge-danger,
body.merchant-dark .timer-badge.danger {
  background: rgba(248,113,113,.14) !important;
  border-color: rgba(248,113,113,.3) !important;
  color: #fecaca !important;
}

body.merchant-dark .sidebar {
  background: #0f172a !important;
  border-color: rgba(148,163,184,.18) !important;
}

body.merchant-dark .nav-btn {
  color: #cbd5e1 !important;
}

body.merchant-dark .nav-btn:hover {
  background: rgba(249,115,22,.12) !important;
  color: #fff !important;
}

body.merchant-dark .nav-btn.active {
  color: #fff !important;
}

.kanban-card.priority-normal {
  border-left: 4px solid #22c55e;
}

.kanban-card.priority-warning {
  border-left: 4px solid #f59e0b;
}

.kanban-card.priority-danger {
  border-left: 4px solid #ef4444;
}

body.merchant-dark .kitchen-item,
body.merchant-dark .order-card-items-preview .kitchen-item {
  background: rgba(15,23,42,.74);
  border-color: rgba(148,163,184,.18);
}

body.merchant-dark .kitchen-item.is-pizza {
  background: rgba(249,115,22,.08);
  border-color: rgba(249,115,22,.28);
}

body.merchant-dark .kitchen-item-line span,
body.merchant-dark .kitchen-item-muted,
body.merchant-dark .order-card-more {
  color: #94a3b8;
}

body.merchant-dark .kitchen-item-line strong,
body.merchant-dark .kitchen-item-head strong {
  color: #f8fafc;
}

body.merchant-dark .order-time-target span {
  color: #94a3b8;
}

body.merchant-dark .order-time-target div {
  background: rgba(148,163,184,.18);
}

body.merchant-dark .dispatch-badge.awaiting {
  background: rgba(251,191,36,.13);
  border-color: rgba(251,191,36,.28);
  color: #fde68a;
}

body.merchant-dark .dispatch-badge.assigned {
  background: rgba(34,197,94,.12);
  border-color: rgba(34,197,94,.26);
  color: #bbf7d0;
}

/* ── Bloquear modo escuro forçado pelo sistema ── */
/* A sidebar é INTENCIONALMENTE escura — não reverter */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: light;
    --bg      : #F7F4F1;
    --surface : #FFFFFF;
    --text    : #1C1410;
    --text-muted    : #9C8880;
    --text-secondary: #5C4A3E;
    --border        : #E8DDD5;
    --border-soft   : #F2EBE4;
  }
  html, body {
    background: #F7F4F1 !important;
    color: #1C1410 !important;
  }
  /* sidebar mantém escura — NÃO sobrescrever */
  .main   { background: #F7F4F1 !important; }
  .card   { background: #FFFFFF !important; color: #1C1410 !important; }
  .topbar { background: rgba(255,252,249,.92) !important;
            color: #1C1410 !important; }
  .page   { background: transparent !important; }
}