@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");

:root {
  --bg: #f7f7f8;
  --card: #fff;
  --text: #111;
  --muted: #6b7280;
  --brand: #ff8e44;

  /* Paleta de cores laranja */
  --orange-50: #fff5ec;
  --orange-100: #ffe7d1;
  --orange-200: #ffd1a6;
  --orange-300: #ffb36b;
  --orange-400: #ff9440;
  --orange-500: #ff7a00;
  --orange-600: #e66e00;
  --orange-700: #b85700;
  --orange-800: #8a4100;
  --orange-900: #5c2b00;
}

/* Modo noturno */
[data-theme="dark"] {
  --bg: #0f172a;
  --card: #1e293b;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --brand: #ff8e44;

  /* Paleta de cores laranja para modo escuro */
  --orange-50: #5c2b00;
  --orange-100: #8a4100;
  --orange-200: #b85700;
  --orange-300: #e66e00;
  --orange-400: #ff7a00;
  --orange-500: #ff9440;
  --orange-600: #ffb36b;
  --orange-700: #ffd1a6;
  --orange-800: #ffe7d1;
  --orange-900: #fff5ec;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: "Poppins", ui-sans-serif, system-ui, -apple-system, Segoe UI,
    Roboto, sans-serif;
  font-size: 11px;
  background: var(--bg);
  color: var(--text);
  transition: background-color 0.3s ease, color 0.3s ease;
}
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 240px;
  background: #0f172a;
  color: #fff;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto,
    sans-serif;
  transition: background-color 0.3s ease;
}

[data-theme="dark"] .sidebar {
  background: #1e293b;
}

/* Botão de modo noturno */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  border-radius: 0.5rem;
  transition: background-color 0.2s ease;
  font-size: 0.875rem;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.theme-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
  transition: transform 0.3s ease;
}

.theme-toggle:hover svg {
  transform: scale(1.1);
}

/* Estilos para cards e elementos em modo noturno */
[data-theme="dark"] .card,
[data-theme="dark"] .table-container,
[data-theme="dark"] .delivery-item,
[data-theme="dark"] .delivery-details,
[data-theme="dark"] .main-content,
[data-theme="dark"] .content-wrapper,
[data-theme="dark"] .page-header,
[data-theme="dark"] .stats-grid,
[data-theme="dark"] .chart-container {
  background: var(--card);
  border: 1px solid #334155;
  color: var(--text);
}

/* Estilos específicos para cards do dashboard no tema dark */
[data-theme="dark"] .card h3 {
  color: white !important;
}

[data-theme="dark"] .card div {
  color: white !important;
}

[data-theme="dark"] .card * {
  color: white !important;
}
[data-theme="dark"] .delivery-log-item {
  background: var(--card);
  border-color: #334155;
}
[data-theme="dark"] .status-pill-muted {
  background: #334155;
  color: var(--text);
}

[data-theme="dark"] .table-container table {
  background: var(--card);
  color: var(--text);
}

[data-theme="dark"] .table-container th {
  background: #334155 !important;
  color: var(--text) !important;
  border-bottom: 1px solid #475569 !important;
}

[data-theme="dark"] .table-container td {
  border-bottom: 1px solid #334155;
  color: var(--text);
  background: var(--card);
}

[data-theme="dark"] .table-container tr:hover {
  background: #334155;
}

[data-theme="dark"] .table-container tr:hover td {
  background: #334155;
}

/* Estilos específicos para tabelas */
[data-theme="dark"] table {
  background: var(--card) !important;
  color: var(--text) !important;
}

[data-theme="dark"] table th {
  background: #334155 !important;
  color: var(--text) !important;
  border-bottom: 1px solid #475569 !important;
}

[data-theme="dark"] table td {
  background: var(--card) !important;
  color: var(--text) !important;
  border-bottom: 1px solid #334155 !important;
}

[data-theme="dark"] table tr:hover {
  background: #334155 !important;
}

[data-theme="dark"] table tr:hover td {
  background: #334155 !important;
}

[data-theme="dark"] .btn {
  background: var(--brand);
  color: #fff;
}

[data-theme="dark"] .btn:hover {
  background: var(--orange-600);
}

[data-theme="dark"] .btn-secondary {
  background: #475569;
  color: #fff;
}

[data-theme="dark"] .btn-secondary:hover {
  background: #64748b;
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: var(--card);
  border: 1px solid #334155;
  color: var(--text);
}

[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
  border-color: var(--brand);
  outline: none;
}

[data-theme="dark"] .paginacao {
  background: var(--card);
  color: var(--text);
}

[data-theme="dark"] .paginacao button {
  background: #475569;
  color: var(--text);
  border: 1px solid #334155;
}

[data-theme="dark"] .paginacao button:hover {
  background: #64748b;
}

[data-theme="dark"] .filters {
  background: var(--card);
  border: 1px solid #334155;
}

[data-theme="dark"] .filters input,
[data-theme="dark"] .filters select {
  background: var(--card);
  border: 1px solid #334155;
  color: var(--text);
}

/* Estilos específicos para modo noturno */
[data-theme="dark"] .main-content {
  background: var(--bg);
  color: var(--text);
}

[data-theme="dark"] .page-header h1 {
  color: var(--text);
}

[data-theme="dark"] .page-header p {
  color: var(--muted);
}

[data-theme="dark"] .stats-grid .stat-card {
  background: var(--card);
  border: 1px solid #334155;
  color: var(--text);
}

[data-theme="dark"] .stats-grid .stat-card .stat-value {
  color: var(--text);
}

[data-theme="dark"] .stats-grid .stat-card .stat-label {
  color: var(--muted);
}

[data-theme="dark"] .chart-container {
  background: var(--card);
  border: 1px solid #334155;
}

[data-theme="dark"] .delivery-timestamps {
  background: var(--card);
  border: 1px solid #334155;
  color: var(--text);
}

[data-theme="dark"] .delivery-timestamps .timestamp-header {
  color: var(--text);
}

[data-theme="dark"] .delivery-timestamps .timestamp-value {
  color: var(--brand);
}

[data-theme="dark"] .delivery-timestamps .timestamp-label {
  color: var(--muted);
}

[data-theme="dark"] .delivery-timestamps .timestamp-details {
  background: #334155;
  border: 1px solid #475569;
}

[data-theme="dark"] .delivery-timestamps .timestamp-item {
  border-bottom: 1px solid #475569;
}

[data-theme="dark"] .delivery-timestamps .timestamp-item:last-child {
  border-bottom: none;
}

[data-theme="dark"] .modal {
  background: rgba(0, 0, 0, 0.8);
}

[data-theme="dark"] .modal-content {
  background: var(--card);
  border: 1px solid #334155;
  color: var(--text);
}

[data-theme="dark"] .modal-header {
  border-bottom: 1px solid #334155;
}

[data-theme="dark"] .modal-header h2 {
  color: var(--text);
}

[data-theme="dark"] .modal-close {
  color: var(--text);
}

[data-theme="dark"] .modal-close:hover {
  color: var(--brand);
}

/* Estilos específicos para tabelas em modo escuro */
[data-theme="dark"] #tbClientes,
[data-theme="dark"] #tbEntregas,
[data-theme="dark"] #tbUsuarios,
[data-theme="dark"] #tbConfiguracoes {
  background: var(--card) !important;
  color: var(--text) !important;
}

[data-theme="dark"] #tbClientes th,
[data-theme="dark"] #tbEntregas th,
[data-theme="dark"] #tbUsuarios th,
[data-theme="dark"] #tbConfiguracoes th {
  background: #334155 !important;
  color: var(--text) !important;
  border-bottom: 1px solid #475569 !important;
}

[data-theme="dark"] #tbClientes td,
[data-theme="dark"] #tbEntregas td,
[data-theme="dark"] #tbUsuarios td,
[data-theme="dark"] #tbConfiguracoes td {
  background: var(--card) !important;
  color: var(--text) !important;
  border-bottom: 1px solid #334155 !important;
}

[data-theme="dark"] #tbClientes tr:hover,
[data-theme="dark"] #tbEntregas tr:hover,
[data-theme="dark"] #tbUsuarios tr:hover,
[data-theme="dark"] #tbConfiguracoes tr:hover {
  background: #334155 !important;
}

[data-theme="dark"] #tbClientes tr:hover td,
[data-theme="dark"] #tbEntregas tr:hover td,
[data-theme="dark"] #tbUsuarios tr:hover td,
[data-theme="dark"] #tbConfiguracoes tr:hover td {
  background: #334155 !important;
}

/* Forçar estilos para elementos específicos */
[data-theme="dark"] .table-container {
  background: var(--card) !important;
  border: 1px solid #334155 !important;
}

[data-theme="dark"] .table-container * {
  color: var(--text) !important;
}

[data-theme="dark"] .table-container th {
  background: #334155 !important;
  color: var(--text) !important;
}

[data-theme="dark"] .table-container td {
  background: var(--card) !important;
  color: var(--text) !important;
}
.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sidebar a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  color: #e5e7eb;
  text-decoration: none;
  height: 2.75rem;
  transition: all 0.2s;
}

.sidebar a.active {
  background: var(--orange-50);
  color: var(--orange-500);
}

.sidebar a:hover {
  background: #1f2937;
}

.sidebar-icon {
  width: 18px;
  height: 18px;
  opacity: 0.85;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  position: relative;
}

.sidebar-brand .theme-toggle {
  margin-left: auto;
}

.sidebar-brand-icon {
  width: 20px;
  height: 20px;
  color: var(--orange-500);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid #374151;
}

.sidebar-footer button {
  width: 100%;
  margin-bottom: 1rem;
}
main {
  margin-left: 260px;
  padding: 24px;
}
.card {
  background: var(--card);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.card-header h3 {
  margin: 0;
}
.stats-grid .card h3 {
  margin-top: 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.stats-grid .card div {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
}
.dashboard-panels {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  gap: 16px;
  align-items: stretch;
}
.dashboard-panels .card {
  height: 100%;
}
.chart-wrapper {
  position: relative;
  height: 360px;
}
.delivery-log-card .card-header {
  margin-bottom: 8px;
}
.delivery-log-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.delivery-log-item {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
  background: var(--bg);
}
.delivery-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.delivery-log-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.log-icon {
  font-size: 18px;
}
.log-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.log-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.95rem;
  padding: 4px 0;
}
.log-value {
  color: var(--orange-700);
  font-weight: 600;
}
.delivery-log-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}
.status-pill-muted {
  background: var(--orange-50);
  color: var(--orange-700);
}
.small {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 4px 0 0;
}
.grid {
  display: grid;
  gap: 16px;
}
.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}
.btn {
  background: var(--orange-500);
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
}
.btn:hover {
  background: var(--orange-600);
}
.btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}
.btn-primary {
  background: #3b82f6;
}
.btn-primary:hover {
  background: #2563eb;
}
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th,
.table td {
  padding: 10px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}
.table th {
  background: #f9fafb;
  font-weight: 600;
}
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}
.hidden {
  display: none;
}
.input {
  width: 100%;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}
.paginacao {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  justify-content: center;
  padding: 16px 0;
  border-top: 1px solid #e5e7eb;
}
.paginacao span {
  font-weight: 500;
  color: var(--muted);
}
copyright,
.copyright {
  font-size: 12px;
  margin-top: 12px;
  color: #cbd5e1;
  display: block;
}

/* Estilos para horários de entrega */
.delivery-timestamps {
  margin-top: 0.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 200px;
}

.delivery-timestamps:hover {
  background: var(--orange-100);
}

.timestamp-accordion {
  position: relative;
}

.timestamp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--orange-50);
  border-radius: 6px;
  font-size: 0.875rem;
}

.timestamp-arrow {
  font-size: 0.7rem;
  color: var(--orange-600);
  transition: transform 0.3s ease;
}

.timestamp-accordion.expanded .timestamp-arrow {
  transform: rotate(180deg);
}

.timestamp-details {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  animation: slideDown 0.3s ease;
}

.timestamp-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  background: var(--orange-100);
  border-radius: 6px;
  font-size: 0.875rem;
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
  }
  to {
    opacity: 1;
    max-height: 200px;
  }
}

/* Estilos para tela de login */
.login-body {
  min-height: 100vh;
  background: linear-gradient(
    135deg,
    var(--orange-500) 0%,
    var(--orange-700) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.login-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.1;
}

.login-fire-icon {
  font-size: 20rem;
  color: white;
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.2;
  }
}

.login-container {
  background: white;
  border-radius: 20px;
  padding: 3rem 2.5rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 420px;
  margin: 1rem;
  position: relative;
  z-index: 1;
}

.login-logo {
  text-align: center;
  margin-bottom: 2.5rem;
}

.login-logo h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--orange-600);
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.login-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.login-input-group label {
  font-weight: 600;
  color: var(--orange-700);
  font-size: 0.9rem;
}

.login-input {
  padding: 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: #f9fafb;
}

.login-input:focus {
  outline: none;
  border-color: var(--orange-500);
  background: white;
  box-shadow: 0 0 0 3px var(--orange-100);
}

.login-input::placeholder {
  color: #9ca3af;
}

.login-btn {
  background: linear-gradient(
    135deg,
    var(--orange-500) 0%,
    var(--orange-600) 100%
  );
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 1rem;
  box-shadow: 0 4px 12px rgba(255, 122, 0, 0.3);
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 122, 0, 0.4);
}

.login-btn:active {
  transform: translateY(0);
}

/* Responsividade para mobile */
@media (max-width: 480px) {
  .login-container {
    margin: 0.5rem;
    padding: 2rem 1.5rem;
  }

  .login-logo h1 {
    font-size: 2rem;
  }

  .login-fire-icon {
    font-size: 15rem;
  }

  .login-input {
    padding: 0.875rem;
  }

  .login-btn {
    padding: 0.875rem 1.5rem;
  }
}

.timestamp-label {
  font-weight: 500;
  color: var(--orange-700);
}

.timestamp-value {
  color: var(--orange-600);
  font-family: monospace;
}

.timestamp-total {
  background: var(--orange-100);
  border: 1px solid var(--orange-200);
  font-weight: 600;
}

.timestamp-total .timestamp-label {
  color: var(--orange-800);
}

.timestamp-total .timestamp-value {
  color: var(--orange-700);
}

/* ===== RESPONSIVIDADE E MOBILE ===== */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 1000;
  }

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

  main {
    margin-left: 0;
    padding: 16px;
  }
  .dashboard-panels {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .chart-wrapper {
    height: 280px;
  }
  .modal-grid {
    grid-template-columns: 1fr;
  }
  .modal-panel {
    width: min(720px, 100%);
    max-height: 88vh;
  }

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

  .grid-3 {
    grid-template-columns: 1fr;
  }

  .table {
    font-size: 0.875rem;
  }

  .table th,
  .table td {
    padding: 8px 4px;
  }

  .header-actions {
    flex-direction: column;
    gap: 8px;
  }

  .btn {
    font-size: 12px;
    padding: 8px 12px;
  }

  .card {
    padding: 16px;
  }

  .container {
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .table {
    font-size: 0.75rem;
  }

  .table th,
  .table td {
    padding: 6px 2px;
  }

  .delivery-timestamps {
    font-size: 0.75rem;
  }

  .timestamp-item {
    padding: 0.25rem;
  }
}

/* Botão hamburger */
.hamburger {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 1001;
  background: var(--orange-500);
  color: white;
  border: none;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
  .hamburger {
    display: block;
  }
}

/* Overlay para mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

@media (max-width: 768px) {
  .sidebar-overlay {
    display: block;
  }

  .sidebar-overlay.hidden {
    display: none;
  }
}

/* Filtros de entrega */
.filters-wrapper {
  margin-bottom: 16px;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  max-height: 1000px;
  opacity: 1;
}

.filters-wrapper.collapsed {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

.filters-wrapper .delivery-filters {
  background: var(--card);
  border-radius: 16px;
  padding: 16px 20px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.delivery-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--orange-700);
}

.filter-select {
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: white;
  font-size: 0.875rem;
  min-width: 120px;
}

.filter-select:focus {
  outline: none;
  border-color: var(--orange-400);
  box-shadow: 0 0 0 2px var(--orange-100);
}
.filter-period .period-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.period-inputs .filter-select {
  flex: 1;
  width: auto;
  min-width: 140px;
}

.period-separator {
  font-size: 0.75rem;
  color: var(--orange-700);
}

.filter-actions {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

/* Visualização desktop para entregas */
@media (min-width: 769px) {
  .mobile-delivery-view {
    display: none !important;
  }

  .desktop-delivery-view {
    display: block !important;
  }

  .period-inputs .filter-select {
    width: auto;
  }

  .filter-actions {
    margin-left: 0;
    align-items: flex-start;
  }
}

@media (max-width: 768px) {
  .delivery-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group {
    width: 100%;
  }

  .filter-select {
    width: 100%;
  }

  .filter-period .period-inputs {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .period-separator {
    display: none;
  }

  .filter-actions {
    margin-left: 0;
  }

  /* Visualização mobile para entregas */
  .mobile-delivery-view {
    display: block;
  }

  .desktop-delivery-view {
    display: none;
  }

  .delivery-item {
    background: white;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--orange-500);
  }

  .delivery-item.expanded {
    border-left-color: var(--orange-600);
  }

  .delivery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
  }

  .delivery-name {
    font-weight: 600;
    color: var(--orange-700);
    font-size: 1rem;
  }

  .delivery-status {
    font-size: 0.875rem;
    padding: 4px 8px;
    border-radius: 4px;
    background: var(--orange-50);
    color: var(--orange-700);
  }

  .delivery-details {
    display: none;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
  }

  .delivery-details.expanded {
    display: block;
  }

  .detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.875rem;
  }

  .detail-label {
    font-weight: 500;
    color: var(--orange-600);
    min-width: 80px;
  }

  .detail-value {
    color: #374151;
    text-align: right;
    flex: 1;
    margin-left: 12px;
  }

  .delivery-timestamps {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
  }

  /* Visualização mobile para clientes */
  .client-item {
    background: white;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--orange-500);
  }

  .client-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
  }

  .client-name {
    font-weight: 600;
    color: var(--orange-700);
    font-size: 1rem;
  }

  .client-orders {
    font-size: 0.875rem;
    padding: 4px 8px;
    border-radius: 4px;
    background: var(--orange-50);
    color: var(--orange-700);
  }

  .client-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 0.875rem;
  }

  .client-detail {
    display: flex;
    flex-direction: column;
  }

  .client-detail-label {
    font-weight: 500;
    color: var(--orange-600);
    font-size: 0.75rem;
  }

  .client-detail-value {
    color: #374151;
  }
}

/* Produtos */
.btn-small {
  padding: 6px 10px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-danger {
  background: #ef4444;
  color: #fff;
}

.btn-danger:hover {
  background: #dc2626;
}

.dialog-title {
  color: var(--orange-700);
  font-weight: 700;
  margin-bottom: 10px;
}
.dialog-subtle {
  background: #fff7ed;
  border: 1px solid #ffe4c7;
  border-radius: 10px;
  padding: 10px 12px;
  margin: 8px 0;
  color: var(--orange-700);
  font-weight: 600;
}
.status-badge-lg {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  background: #f1f5f9;
  color: #1f2937;
  border: 1px solid #e2e8f0;
}
.status-badge-lg[data-status="enviado"] {
  background: #e0f2fe;
  color: #075985;
  border-color: #bae6fd;
}
.status-badge-lg[data-status="entregue"] {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}
.status-badge-lg[data-status="cancelado"] {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecdd3;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  padding: 16px;
}
.modal-panel {
  background: var(--card);
  border-radius: 14px;
  padding: 18px;
  width: min(860px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
  border: 1px solid #e5e7eb;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.modal-header h3 {
  margin: 0;
}
.modal-close {
  background: transparent;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--muted);
}
.modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
}
.modal-field-full {
  grid-column: span 2;
}
.modal-field span {
  color: var(--muted);
  font-weight: 600;
}
.modal-field input,
.modal-field select,
.modal-field textarea {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  font-size: 0.95rem;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.btn-muted {
  background: #e5e7eb;
  color: #374151;
}

.btn-muted:hover {
  background: #d1d5db;
}

.produto-nome {
  font-weight: 600;
  color: var(--orange-700);
  display: flex;
  align-items: center;
  gap: 8px;
}

.produto-status.inativo {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 0.75rem;
  font-weight: 500;
}

.produto-acoes {
  display: flex;
  gap: 8px;
  align-items: center;
}

.produto-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  border-left: 4px solid var(--orange-500);
  margin-bottom: 12px;
}

[data-theme="dark"] .produto-card {
  background: var(--card);
  border: 1px solid #334155;
}

.produto-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.produto-card-nome {
  font-weight: 600;
  color: var(--orange-700);
  font-size: 1rem;
}

[data-theme="dark"] .produto-card-nome {
  color: var(--orange-400);
}

.produto-card-valor {
  font-weight: 600;
  color: var(--orange-600);
}

.produto-card-body {
  margin-top: 12px;
  display: grid;
  gap: 6px;
  color: var(--text);
  font-size: 0.875rem;
}

.produto-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

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

.produto-form .form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
}

.produto-form .form-field span {
  font-weight: 500;
  color: var(--orange-700);
}

.produto-form .form-field input,
.produto-form .form-field textarea,
.produto-form .form-field select {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  font-size: 0.95rem;
  background: #fff;
  color: #111;
}

[data-theme="dark"] .produto-form .form-field input,
[data-theme="dark"] .produto-form .form-field textarea,
[data-theme="dark"] .produto-form .form-field select {
  background: var(--card);
  border: 1px solid #475569;
  color: var(--text);
}

.produto-form .form-field textarea {
  resize: vertical;
}

.produto-form .form-field select[multiple] {
  min-height: 140px;
  padding: 8px 10px;
}

.form-multi-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.form-multi-row input {
  flex: 1;
}

.produto-form .form-hint {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--muted);
}

.produto-form .form-full {
  grid-column: span 2;
}

.produto-form .checkbox-field {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.modal-actions {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

@media (max-width: 768px) {
  .produto-card {
    border-left-width: 3px;
  }

  .produto-form .form-grid {
    grid-template-columns: 1fr;
  }

  .produto-form .form-full {
    grid-column: span 1;
  }
}
.produto-header-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

.btn-outline {
  background: transparent;
  border: 1px solid #d1d5db;
  color: #111827;
}

.btn-outline:hover {
  background: #f3f4f6;
}

[data-theme="dark"] .btn-outline {
  border-color: #475569;
  color: var(--text);
}

[data-theme="dark"] .btn-outline:hover {
  background: #1e293b;
}

.produto-resumo {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--muted);
}

.produto-resumo span {
  background: #f3f4f6;
  padding: 4px 8px;
  border-radius: 6px;
}

[data-theme="dark"] .produto-resumo span {
  background: #1e293b;
}

.produto-detalhes-row td {
  background: #f9fafb;
  padding: 16px 20px;
}

[data-theme="dark"] .produto-detalhes-row td {
  background: var(--card);
}

.produto-detalhes {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.produto-detalhes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.produto-detalhe {
  display: flex;
  flex-direction: column;
  padding: 12px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e5e7eb;
}

[data-theme="dark"] .produto-detalhe {
  background: var(--card);
  border-color: #334155;
}

.produto-detalhe span {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.produto-detalhe strong {
  margin-top: 6px;
  font-size: 1rem;
  color: var(--text);
}

.produto-observacoes {
  padding: 12px;
  border-radius: 8px;
  background: #fff7ed;
  border-left: 4px solid var(--orange-500);
  font-size: 0.9rem;
}

[data-theme="dark"] .produto-observacoes {
  background: rgba(255, 122, 0, 0.1);
}

.produto-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--muted);
}

.produto-meta span {
  background: #f3f4f6;
  padding: 6px 10px;
  border-radius: 6px;
}

[data-theme="dark"] .produto-meta span {
  background: #1e293b;
}

.produto-card-status {
  font-size: 0.75rem;
  color: var(--muted);
}

.produto-card-meta {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--muted);
}

.produto-card-body div {
  font-size: 0.85rem;
}

@media (max-width: 768px) {
  .produto-resumo {
    flex-direction: column;
    gap: 6px;
  }

  .produto-detalhes-grid {
    grid-template-columns: 1fr;
  }

  .produto-meta {
    flex-direction: column;
  }

  .produto-header-actions {
    justify-content: flex-start;
  }
}
.table-empty {
  text-align: center;
  padding: 18px;
  color: var(--muted);
  font-weight: 500;
}

.delivery-driver {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.driver-phone {
  font-size: 0.875rem;
  color: var(--orange-700);
  text-decoration: none;
}

.driver-phone:hover {
  text-decoration: underline;
}

.delivery-values {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.payment-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--orange-700);
  background: var(--orange-100);
  border-radius: 999px;
  padding: 4px 12px;
  width: fit-content;
}

.delivery-values-breakdown {
  display: grid;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--muted);
}

.delivery-total {
  font-weight: 600;
  color: var(--orange-700);
}

.delivery-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.delivery-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #e2e8f0;
  color: #1f2937;
}

.delivery-status-success {
  background: #dcfce7;
  color: #15803d;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #e2e8f0;
  color: #475569;
}

.status-badge.status-success {
  background: #dcfce7;
  color: #15803d;
}

.status-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  color: var(--text);
}

.status-toggle input[type="checkbox"] {
  appearance: none;
  width: 38px;
  height: 20px;
  border-radius: 999px;
  background: var(--gray-300);
  border: 1px solid var(--gray-400);
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.status-toggle input[type="checkbox"]::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  top: 1px;
  left: 1px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.24);
  transition: transform 0.2s ease;
}

.status-toggle input[type="checkbox"]:checked {
  background: var(--orange-500);
  border-color: var(--orange-500);
}

.status-toggle input[type="checkbox"]:checked::after {
  transform: translateX(17px);
}

.status-toggle span {
  font-weight: 500;
}

.muted {
  color: var(--gray-500);
}

.row-inativo {
  opacity: 0.65;
}

.prefill-banner {
  border: 1px dashed var(--orange-400);
  background: var(--orange-50);
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 18px;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.prefill-banner.visible {
  display: flex;
}

.prefill-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
}

.prefill-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.9rem;
}

.prefill-details strong {
  font-weight: 600;
}

.prefill-actions {
  display: flex;
  gap: 8px;
}

.prefill-highlight {
  animation: prefillPulse 1.6s ease-in-out 2;
  background: #fef9c3 !important;
}

@keyframes prefillPulse {
  0% {
    background: #fefce8;
  }
  50% {
    background: #fde68a;
  }
  100% {
    background: #fefce8;
  }
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-field label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--orange-700);
}

.field-readonly {
  margin: 0;
  padding: 10px 12px;
  background: var(--orange-50);
  border-radius: 10px;
  font-weight: 500;
  color: var(--text);
}

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

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

.modal-field--full {
  grid-column: 1 / -1;
}

.modal-field.checkbox-field {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.modal-field.checkbox-field .form-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-summary {
  padding: 12px;
  background: var(--orange-50);
  border-radius: 12px;
  font-weight: 600;
  color: var(--orange-700);
}

.modal-summary strong {
  font-size: 1.1rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.delivery-values-mobile {
  align-items: flex-start;
}

.delivery-values-mobile .detail-value {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
}

.filters-wrapper.collapsed .delivery-filters {
  box-shadow: none;
}

@media (max-width: 768px) {
  .filters-wrapper .delivery-filters {
    padding: 12px;
  }

  .modal-grid {
    grid-template-columns: 1fr;
  }

  .modal-grid--two {
    grid-template-columns: 1fr;
  }

  .delivery-actions {
    flex-direction: column;
  }
}
