:root {
  --bg: #f5f7f6;
  --bg-accent: #e9efec;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --surface-dark: #142f3a;
  --surface-soft: #eef4f1;
  --text: #142f3a;
  --muted: #65766f;
  --line: #dce5e1;
  --primary: #116149;
  --primary-strong: #0b4f3a;
  --primary-soft: #e4f0eb;
  --secondary: #16805d;
  --danger: #b94343;
  --warning: #c89b3c;
  --success: #16805d;
  --shadow-sm: 0 6px 20px rgba(20, 47, 58, .06);
  --shadow-md: 0 14px 36px rgba(20, 47, 58, .09);
  --shadow-lg: 0 22px 52px rgba(20, 47, 58, .12);
}

body {
  color: var(--text);
  background: linear-gradient(180deg, #fafcfb 0%, var(--bg) 100%);
}

.topbar,
.customer-app-header {
  border-color: rgba(220, 229, 225, .9);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 8px 26px rgba(20, 47, 58, .07);
}

.brand strong,
.customer-app-brand strong,
h1, h2, h3 {
  color: var(--text);
}

.button.primary,
button.primary,
.btn-primary,
.customer-primary-action,
.checkout-button {
  border-color: var(--primary) !important;
  background: var(--primary) !important;
  color: #fff !important;
  box-shadow: 0 8px 18px rgba(17, 97, 73, .18) !important;
}

.button.primary:hover,
button.primary:hover,
.btn-primary:hover,
.customer-primary-action:hover,
.checkout-button:hover {
  border-color: var(--primary-strong) !important;
  background: var(--primary-strong) !important;
}

.button.light,
.button.secondary,
.btn-secondary {
  border-color: var(--line) !important;
  background: #fff !important;
  color: var(--text) !important;
  box-shadow: none !important;
}

input,
select,
textarea {
  border-color: var(--line);
  color: var(--text);
  background-color: #fff;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--secondary) !important;
  box-shadow: 0 0 0 3px rgba(22, 128, 93, .12) !important;
  outline: 0;
}

.card,
.form-card,
.panel,
.stat-card,
.order-card,
.product-card,
.store-card,
.customer-product-card,
.customer-store-card,
.diagnostic-check,
.backup-panel {
  border-color: var(--line) !important;
  background: #fff;
  box-shadow: var(--shadow-sm) !important;
}

.main-menu a.active,
.bottom-nav a.active,
.customer-bottom-nav a.active,
.orders-tabs a.active,
.tabs a.active,
.filter-chip.active,
.category-chip.active {
  border-color: var(--primary) !important;
  background: var(--primary) !important;
  color: #fff !important;
}

.main-menu a:hover,
.bottom-nav a:hover,
.customer-bottom-nav a:hover,
.orders-tabs a:hover,
.tabs a:hover {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.badge,
.status-badge,
.category-badge {
  border-color: #c9d9d2;
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.status-cancelado,
.status-rechazado,
.badge.danger,
.text-danger {
  color: var(--danger);
}

.status-pendiente,
.status-pago-por-verificar,
.badge.warning {
  border-color: #ead9ad;
  background: #fbf5e7;
  color: #7a5a17;
}

.price,
.product-price,
.customer-product-price,
.summary-total,
.cart-total {
  color: var(--primary-strong) !important;
}

.notification-dot,
.nav-cart-count {
  background: var(--warning) !important;
  color: #fff !important;
}

.customer-hero,
.catalog-hero,
.welcome-hero {
  background: linear-gradient(135deg, #0b4f3a, #16805d) !important;
  color: #fff;
}

.customer-hero h1,
.customer-hero h2,
.catalog-hero h1,
.catalog-hero h2,
.welcome-hero h1,
.welcome-hero h2 {
  color: #fff;
}

.orders-tabs,
.customer-bottom-nav,
.bottom-nav {
  border-color: var(--line);
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 -6px 24px rgba(20, 47, 58, .07);
}

@media (max-width: 700px) {
  .card,
  .form-card,
  .panel,
  .order-card,
  .product-card,
  .store-card {
    box-shadow: 0 5px 16px rgba(20, 47, 58, .055) !important;
  }
}
/* Repartidor: evita que las acciones hereden la cuadrícula compacta en escritorio. */
@media (min-width: 761px) {
  body.page-pedidos .courier-delivery-grid {
    grid-template-columns: repeat(auto-fill, minmax(360px, 560px)) !important;
    align-items: start;
  }

  body.page-pedidos .courier-delivery-card {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.page-pedidos .courier-actions {
    width: 100% !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

@media (max-width: 760px) {
  body.page-pedidos .courier-delivery-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.page-pedidos .courier-actions,
  body.page-pedidos .courier-primary-action {
    width: 100% !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }
}
