/* ── IMPORTS ─────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

/* ── TOKENS ──────────────────────────────────── */
:root {
  --primary:      #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eff6ff;
  --success:      #059669;
  --warning:      #d97706;
  --danger:       #dc2626;
  --info:         #0891b2;
  --sidebar-bg:   #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-hover:#1e293b;
  --sidebar-active:#2563eb;
  --body-bg:      #f1f5f9;
  --card-bg:      #ffffff;
  --border:       #e2e8f0;
  --text:         #0f172a;
  --text-muted:   #64748b;
  --radius:       12px;
  --radius-sm:    8px;
  --shadow:       0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.06);
  --shadow-lg:    0 4px 6px rgba(0,0,0,.05), 0 10px 40px rgba(0,0,0,.10);
  --transition:   all .18s ease;
}

[data-theme="dark"] {
  color-scheme: dark;
  --primary: #60a5fa;
  --primary-dark: #3b82f6;
  --primary-soft: #172554;
  --body-bg: #0b1120;
  --card-bg: #111827;
  --border: #283548;
  --text: #e5edf7;
  --text-muted: #94a3b8;
  --shadow: 0 1px 3px rgba(0,0,0,.28), 0 4px 16px rgba(0,0,0,.22);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.35);
}

/* ── BASE ────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'DM Sans', sans-serif;
  font-size: .9rem;
  background: var(--body-bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ── SIDEBAR ─────────────────────────────────── */
#sidebar {
  width: 248px;
  min-width: 248px;
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

#sidebar.collapsed {
  min-width: 0 !important;
  width: 0;
  overflow: hidden;
}

.sidebar-brand {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.02em;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.sidebar-brand i {
  color: var(--primary);
  font-size: 1.25rem;
}

.sidebar-section {
  padding: 1rem 1rem .25rem;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #475569;
}

#sidebar .nav-link {
  color: var(--sidebar-text);
  border-radius: var(--radius-sm);
  margin: .1rem .75rem;
  padding: .5rem .75rem;
  font-size: .875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: .6rem;
  transition: var(--transition);
}

#sidebar .nav-link i {
  font-size: 1rem;
  width: 1.1rem;
  text-align: center;
}

#sidebar .nav-link:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

#sidebar .nav-link.active {
  background: var(--primary);
  color: #fff;
}

.sidebar-footer {
  margin-top: auto;
  padding: 1rem;
  border-top: 1px solid rgba(255,255,255,.06);
}

.sidebar-footer .user-name {
  font-size: .825rem;
  font-weight: 600;
  color: #cbd5e1;
}

.sidebar-footer .user-role {
  font-size: .75rem;
  color: #475569;
  margin-bottom: .75rem;
}

/* ── TOPBAR ──────────────────────────────────── */
.topbar {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: .75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar .btn-toggle {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.25rem;
  padding: .25rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.topbar .btn-toggle:hover {
  background: var(--body-bg);
  color: var(--text);
}

.theme-selector {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: #e5e7eb;
  border: 1px solid var(--border);
}

.theme-option {
  width: 29px;
  height: 29px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #7c8491;
  cursor: pointer;
  transition: var(--transition);
}

.theme-option.active {
  background: var(--card-bg);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(15,23,42,.2);
}

[data-theme="dark"] .theme-selector { background: #273244; }
[data-theme="dark"] .theme-option.active { box-shadow: 0 1px 5px rgba(0,0,0,.45); }

.breadcrumb {
  margin: 0;
  font-size: .8rem;
}

.breadcrumb-item + .breadcrumb-item::before { color: var(--text-muted); }
.breadcrumb-item a { color: var(--text-muted); text-decoration: none; }
.breadcrumb-item a:hover { color: var(--primary); }
.breadcrumb-item.active { color: var(--text); font-weight: 500; }

/* ── MAIN ────────────────────────────────────── */
main {
  padding: 1.75rem;
  flex: 1;
}

/* ── CARDS ───────────────────────────────────── */
.card {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow) !important;
  background: var(--card-bg);
}

.card-header {
  border-bottom: 1px solid var(--border) !important;
  border-radius: var(--radius) var(--radius) 0 0 !important;
  background: var(--card-bg) !important;
  padding: 1rem 1.25rem !important;
  font-weight: 600;
  font-size: .875rem;
}

.card-body { padding: 1.25rem !important; }

/* Stat cards */
.stat-card {
  border-radius: var(--radius) !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow) !important;
  background: var(--card-bg);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: var(--transition);
}

.stat-card:hover { box-shadow: var(--shadow-lg) !important; transform: translateY(-1px); }

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.stat-value { font-size: 1.5rem; font-weight: 700; line-height: 1; letter-spacing: -.03em; }
.stat-label { font-size: .75rem; color: var(--text-muted); font-weight: 500; margin-top: .15rem; }

/* ── BUTTONS ─────────────────────────────────── */
.btn {
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: .825rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  letter-spacing: -.01em;
}

.btn-primary {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
}

.btn-primary:hover {
  background: var(--primary-dark) !important;
  border-color: var(--primary-dark) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37,99,235,.3);
}

.btn-outline-primary {
  color: var(--primary) !important;
  border-color: var(--primary) !important;
}

.btn-outline-primary:hover {
  background: var(--primary) !important;
  color: #fff !important;
}

.btn-outline-secondary {
  color: var(--text-muted) !important;
  border-color: var(--border) !important;
}

.btn-outline-secondary:hover {
  background: var(--body-bg) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

.btn-success {
  background: var(--success) !important;
  border-color: var(--success) !important;
}

.btn-danger { background: var(--danger) !important; border-color: var(--danger) !important; }
.btn-outline-danger { color: var(--danger) !important; border-color: #fecaca !important; }
.btn-outline-danger:hover { background: #fef2f2 !important; }

/* ── FORMS ───────────────────────────────────── */
.form-control, .form-select {
  border-radius: var(--radius-sm);
  border-color: var(--border);
  font-size: .875rem;
  font-family: 'DM Sans', sans-serif;
  transition: var(--transition);
  color: var(--text);
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.form-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: .35rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

/* ── TABLES ──────────────────────────────────── */
.table {
  font-size: .85rem;
}

.table thead th {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding: .75rem 1rem;
  background: var(--body-bg);
}

.table tbody td {
  padding: .875rem 1rem;
  border-bottom: 1px solid #f8fafc;
  vertical-align: middle;
}

.table-hover tbody tr {
  transition: var(--transition);
}

.table-hover tbody tr:hover {
  background: var(--primary-soft) !important;
}

/* ── BADGES ──────────────────────────────────── */
.badge {
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: .7rem;
  border-radius: 6px;
  padding: .3em .6em;
  letter-spacing: .02em;
}

/* ── PAGE TITLE ──────────────────────────────── */
.page-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -.03em;
  color: var(--text);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

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

/* ── ALERTS ──────────────────────────────────── */
.alert {
  border-radius: var(--radius-sm);
  border: none;
  font-size: .875rem;
}

.alert-success { background: #ecfdf5; color: #065f46; }
.alert-danger  { background: #fef2f2; color: #991b1b; }
.alert-warning { background: #fffbeb; color: #92400e; }
.alert-info    { background: #f0f9ff; color: #075985; }

/* ── WIZARD STEPS ─────────────────────────────── */
.wizard-steps {
  display: flex;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.wizard-step {
  flex: 1;
  text-align: center;
  padding: .875rem .5rem;
  background: var(--card-bg);
  color: var(--text-muted);
  font-size: .775rem;
  font-weight: 600;
  position: relative;
  letter-spacing: .01em;
  transition: var(--transition);
}

.wizard-step.ativo {
  background: var(--primary);
  color: #fff;
}

.wizard-step.concluido {
  background: #ecfdf5;
  color: var(--success);
}

.wizard-step:not(:last-child) {
  border-right: 1px solid var(--border);
}

/* ── PRODUTO CARD ─────────────────────────────── */
.produto-card {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
}

.produto-card:hover {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,.1) !important;
}

.produto-card.selecionado {
  border-color: var(--success) !important;
  background: #ecfdf5 !important;
  box-shadow: 0 0 0 3px rgba(5,150,105,.16) !important;
}

/* ── DARK MODE ────────────────────────────────── */
[data-theme="dark"] body,
[data-theme="dark"] main { background: var(--body-bg); color: var(--text); }
[data-theme="dark"] .card,
[data-theme="dark"] .card-header,
[data-theme="dark"] .card-footer,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .wizard-step,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .dropdown-menu,
[data-theme="dark"] .list-group-item {
  background-color: var(--card-bg) !important;
  color: var(--text);
  border-color: var(--border) !important;
}
[data-theme="dark"] .table {
  --bs-table-color: var(--text);
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--border);
  --bs-table-hover-color: var(--text);
  --bs-table-hover-bg: var(--primary-soft);
  color: var(--text);
}
[data-theme="dark"] .table thead th { background: #182235; }
[data-theme="dark"] .table tbody td { border-bottom-color: var(--border); }
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] .input-group-text {
  background-color: #0f172a;
  border-color: var(--border);
  color: var(--text);
}
[data-theme="dark"] .form-control::placeholder { color: #64748b; }
[data-theme="dark"] .form-control:disabled,
[data-theme="dark"] .form-select:disabled { background-color: #172033; color: var(--text-muted); }
[data-theme="dark"] .text-dark { color: var(--text) !important; }
[data-theme="dark"] .text-muted { color: var(--text-muted) !important; }
[data-theme="dark"] .bg-light { background-color: #1e293b !important; }
[data-theme="dark"] .border { border-color: var(--border) !important; }
[data-theme="dark"] .alert-light { background: #172033; color: var(--text); border-color: var(--border) !important; }
[data-theme="dark"] .alert-warning { background: #422006; color: #fde68a; }
[data-theme="dark"] .alert-danger { background: #450a0a; color: #fecaca; }
[data-theme="dark"] .alert-success { background: #052e24; color: #a7f3d0; }
[data-theme="dark"] .alert-info { background: #083344; color: #a5f3fc; }
[data-theme="dark"] .notif-dropdown { background: var(--card-bg); border-color: var(--border); }
[data-theme="dark"] .notif-item:hover,
[data-theme="dark"] .notif-item.unread { background: var(--primary-soft); }
[data-theme="dark"] .produto-card { background: var(--card-bg); color: var(--text); }
[data-theme="dark"] .produto-card.selecionado { background: #052e24 !important; }
[data-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }

@media (max-width: 575.98px) {
  .theme-selector { transform: scale(.92); transform-origin: right center; }
}

.produto-card-sm {
  min-height: 108px;
  padding: .7rem !important;
  box-shadow: none !important;
}

.produto-card-title {
  font-size: .86rem;
  line-height: 1.2;
  padding-right: 1.55rem;
  min-height: 2.05em;
}

.produto-card-desc {
  font-size: .72rem;
  line-height: 1.25;
  margin: .15rem 0 .45rem;
}

.produto-card-price {
  font-size: .78rem;
  white-space: nowrap;
}

.produto-card-min {
  color: #94a3b8;
  font-size: .68rem;
  font-weight: 700;
  margin-top: .2rem;
}

.produto-stock-badge {
  font-size: .62rem;
  padding: .18rem .35rem;
  white-space: nowrap;
}

.produto-check {
  position: absolute;
  top: .45rem;
  right: .45rem;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--success);
  color: #fff;
  font-size: .85rem;
  line-height: 1;
  opacity: 0;
  transform: scale(.8);
  transition: var(--transition);
}

.produto-card.selecionado .produto-check {
  opacity: 1;
  transform: scale(1);
}

#wizard-produtos {
  padding: 1rem !important;
}

.pedido-itens-table th,
.pedido-itens-table td {
  vertical-align: middle;
}

.qty-stepper {
  width: 112px;
  flex-wrap: nowrap;
}

.qty-stepper .btn {
  width: 30px;
  padding-left: 0;
  padding-right: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.qty-stepper .item-qty {
  min-width: 42px;
  max-width: 48px;
  padding-left: .2rem;
  padding-right: .2rem;
}

.price-group {
  width: 136px;
  flex-wrap: nowrap;
}

.price-group .input-group-text {
  font-size: .76rem;
  font-weight: 700;
  padding-left: .45rem;
  padding-right: .45rem;
}

.price-group .item-preco {
  min-width: 0;
  padding-left: .35rem;
  padding-right: .45rem;
}

.item-preco-feedback {
  max-width: 136px;
  font-size: .68rem;
  line-height: 1.2;
  margin-top: .22rem;
}

/* ── LOGIN ───────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 25px 60px rgba(0,0,0,.3);
}

.login-logo {
  width: 52px;
  height: 52px;
  background: var(--primary);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #fff;
  margin: 0 auto 1.25rem;
}

/* ── MISC ────────────────────────────────────── */
.text-primary { color: var(--primary) !important; }
.bg-primary   { background: var(--primary) !important; }

.hover-lift { transition: var(--transition); }
.hover-lift:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg) !important; }

code, .font-mono {
  font-family: 'DM Mono', monospace;
  font-size: .85em;
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }

/* ── WIZARD STEPS CLICÁVEIS ──────────────────── */
.wizard-step.clicavel {
  cursor: pointer;
  text-decoration: none;
}
.wizard-step.clicavel:hover {
  filter: brightness(0.92);
}

/* ── FLASH TOAST — bottom center ──────────────── */
.flash-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  pointer-events: none;
}
.flash-toast {
  pointer-events: all;
  padding: 14px 22px;
  border-radius: 12px;
  font-size: .9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  animation: slideUp .3s ease;
  min-width: 280px;
  max-width: 480px;
}
.flash-toast.success {
  background: #059669;
  color: #fff;
}
.flash-toast.danger {
  background: #dc2626;
  color: #fff;
}
.flash-toast.warning {
  background: #d97706;
  color: #fff;
}
.flash-toast.info {
  background: #2563eb;
  color: #fff;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(20px); }
}

/* ── SKELETON ROWS ─────────────────────────────── */
.skeleton-row td { padding: 16px 12px !important; border-bottom: 1px solid #f8fafc !important; }
.skeleton-row:hover td { background: transparent !important; }
.skeleton-cell {
  height: 13px; border-radius: 6px;
  background: linear-gradient(90deg, #f1f5f9 25%, #e8edf5 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skeleton-wave 1.6s ease-in-out infinite;
}
.skeleton-cell.sm { height: 10px; margin-top: 4px; }
.skeleton-cell.round { border-radius: 50px; }
@keyframes skeleton-wave {
  0%  { background-position: 200% 0; }
  100%{ background-position: -200% 0; }
}

/* ── LOJA SELECTOR ─────────────────────────────── */
.loja-selector select option { color: #0f172a; background: #fff; }

/* ── TOPBAR MELHORADO ──────────────────────────── */
.topbar { gap: 8px; }

/* ── TOOLTIPS ──────────────────────────────────── */
.tooltip {
  --bs-tooltip-font-size: .72rem;
  --bs-tooltip-padding-x: .5rem;
  --bs-tooltip-padding-y: .28rem;
}

/* ── RESPONSIVO / MOBILE ADMIN ─────────────────── */
.sidebar-close {
  display: none;
  margin-left: auto;
  border: 0;
  background: rgba(255,255,255,.08);
  color: #cbd5e1;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
}

.sidebar-close:hover {
  background: rgba(255,255,255,.14);
  color: #fff;
}

@media (max-width: 991.98px) {
  body.sidebar-open {
    overflow: hidden;
  }

  body.sidebar-open::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    z-index: 1035;
  }

  #wrapper {
    display: block !important;
    min-width: 0;
  }

  #sidebar,
  #sidebar.collapsed {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(84vw, 300px);
    min-width: min(84vw, 300px) !important;
    height: 100dvh;
    min-height: 100dvh;
    z-index: 1040;
    transform: translateX(-105%);
    overflow-y: auto;
    box-shadow: 18px 0 44px rgba(15, 23, 42, .24);
  }

  body.sidebar-open #sidebar {
    transform: translateX(0);
  }

  .sidebar-close {
    display: inline-flex;
  }

  .sidebar-brand {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--sidebar-bg);
  }

  .topbar {
    padding: .65rem .85rem;
    gap: .55rem;
    align-items: center;
  }

  .topbar-breadcrumb {
    min-width: 0;
  }

  .breadcrumb {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 34vw;
  }

  .topbar-actions {
    margin-left: auto;
    min-width: 0;
    flex-wrap: nowrap;
  }

  .topbar-actions > .btn {
    padding-left: .55rem;
    padding-right: .55rem;
    white-space: nowrap;
  }

  .topbar-actions > .btn .bi {
    margin-right: 0 !important;
  }

  .topbar-actions > .btn .bi + span,
  .topbar-actions > .btn span {
    display: none;
  }

  .loja-selector {
    max-width: 42vw !important;
    min-width: 0;
    overflow: hidden;
  }

  .loja-selector span,
  .loja-selector select {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  main {
    padding: 1rem;
    min-width: 0;
  }

  .page-title {
    font-size: 1.12rem;
    line-height: 1.25;
    min-width: 0;
    flex-wrap: wrap;
    margin-bottom: 1rem;
  }

  main > .d-flex.align-items-center.mb-4 {
    flex-wrap: wrap;
    gap: .75rem;
  }

  main > .d-flex.align-items-center.mb-4 > .page-title {
    width: 100%;
    margin-bottom: 0 !important;
  }

  main > .d-flex.align-items-center.mb-4 > .d-flex,
  main > .d-flex.align-items-center.mb-4 > form {
    width: 100%;
    flex-wrap: wrap;
  }

  main > .d-flex.align-items-center.mb-4 .btn {
    flex: 1 1 auto;
  }

  .card-header {
    padding: .85rem 1rem !important;
  }

  .card-body {
    padding: 1rem !important;
  }

  .card-body.p-0 {
    padding: 0 !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .card-body.p-0 > table,
  .card-body.p-0 > .table,
  .table-responsive > table,
  .table-responsive > .table {
    min-width: 680px;
  }

  .table thead th,
  .table tbody td {
    padding: .72rem .85rem;
  }

  .wizard-steps {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }

  .wizard-step {
    min-width: 128px;
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .flash-container {
    left: 12px;
    right: 12px;
    bottom: 14px;
    transform: none;
    align-items: stretch;
  }

  .flash-toast {
    min-width: 0;
    max-width: none;
    width: 100%;
  }

  .notif-dropdown {
    position: fixed;
    top: 58px;
    left: 12px;
    right: 12px;
    width: auto;
  }
}

@media (max-width: 575.98px) {
  body {
    font-size: .86rem;
  }

  .topbar {
    padding: .55rem .7rem;
  }

  .breadcrumb {
    display: none;
  }

  .topbar-icon {
    width: 34px !important;
    height: 34px !important;
  }

  .topbar-actions {
    gap: .25rem !important;
  }

  .topbar-actions > .btn {
    min-width: 38px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .loja-selector {
    max-width: 46vw !important;
    padding: 5px 8px !important;
  }

  main {
    padding: .75rem;
  }

  .card {
    border-radius: 10px !important;
  }

  .card-header {
    border-radius: 10px 10px 0 0 !important;
  }

  .stat-card {
    padding: 1rem;
  }

  .stat-icon {
    width: 40px;
    height: 40px;
  }

  .stat-value {
    font-size: 1.25rem;
  }

  .input-group[style*="min-width"] {
    min-width: 0 !important;
  }

  .d-flex.flex-wrap.align-items-center.gap-2 > .input-group.flex-grow-1 {
    flex-basis: 100%;
  }
}

/* Mantido ao final para prevalecer sobre estilos legados dos componentes. */
[data-theme="dark"] .notif-dropdown { background: var(--card-bg); border-color: var(--border); }
[data-theme="dark"] .notif-item { border-bottom-color: var(--border); }
[data-theme="dark"] .notif-item:hover,
[data-theme="dark"] .notif-item.unread { background: var(--primary-soft); }
[data-theme="dark"] .loja-selector select option { color: var(--text); background: var(--card-bg); }
[data-theme="dark"] .skeleton-row td { border-bottom-color: var(--border) !important; }
[data-theme="dark"] .skeleton-cell {
  background: linear-gradient(90deg, #172033 25%, #263449 50%, #172033 75%);
  background-size: 200% 100%;
}

/* ── FILTROS DE PEDIDOS ───────────────────────── */
@media (min-width: 1400px) {
  .pedidos-filtros-admin {
    display: grid;
    grid-template-columns: minmax(170px,.9fr) minmax(120px,.65fr) minmax(150px,.8fr) minmax(150px,.8fr) minmax(355px,1.55fr) auto;
    gap: .5rem;
    margin: 0;
  }
  .pedidos-filtros-admin > * { width: auto; max-width: none; padding: 0; }
  .pedidos-filtros-admin .filtro-acoes { white-space: nowrap; }
}

@media (min-width: 768px) and (max-width: 1399.98px) {
  .pedidos-filtros-admin {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
    margin: 0;
  }
  .pedidos-filtros-admin > * { width: auto; max-width: none; padding: 0; }
  .pedidos-filtros-admin .filtro-periodo { grid-column: 1 / -1; }
}

.pedidos-filtros-admin .filtro-periodo .form-control { min-width: 0; }

.loja-autocomplete { position: relative; }
.loja-autocomplete-menu {
  position: absolute;
  z-index: 1050;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  display: none;
  max-height: 280px;
  overflow-y: auto;
  padding: 5px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}
.loja-autocomplete-menu.show { display: block; }
.loja-autocomplete-item {
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  padding: .55rem .65rem;
  text-align: left;
  font-size: .84rem;
}
.loja-autocomplete-item:hover,
.loja-autocomplete-item:focus { background: var(--primary-soft); color: var(--primary); outline: none; }
.loja-autocomplete-empty { padding: .65rem; color: var(--text-muted); font-size: .82rem; text-align: center; }
.loja-autocomplete-toggle { padding-left: .65rem; padding-right: .65rem; }

@media (max-width: 767.98px) {
  .pedidos-filtros-admin .filtro-acoes { width: 100%; }
  .pedidos-filtros-admin .filtro-acoes .btn { flex: 1; }
  .pedidos-filtros-admin .filtro-periodo .input-group { flex-wrap: wrap; }
  .pedidos-filtros-admin .filtro-periodo .input-group-text { flex: 0 0 auto; }
  .pedidos-filtros-admin .filtro-periodo .form-control { flex: 1 1 calc(50% - 48px); }
}
