/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.625rem 1.125rem;
  font-size: 0.9375rem;
  font-weight: 500;
  font-family: inherit;
  line-height: 1.2;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), opacity var(--transition);
  text-decoration: none;
  touch-action: manipulation;
  min-height: 44px;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--btn-primary-background, linear-gradient(135deg, var(--brand-accent) 0%, var(--btn-color-end, #4f46e5) 100%));
  color: var(--btn-text-color, #fff);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
  text-decoration: none;
}

.btn-accent {
  background: var(--btn-accent-background, var(--brand-accent));
  color: var(--btn-accent-text, var(--btn-text-color, #fff));
}

.btn-accent:hover:not(:disabled) {
  filter: brightness(1.06);
  text-decoration: none;
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border-strong);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--color-bg);
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  color: var(--brand-primary);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(var(--brand-primary-rgb), 0.08);
  text-decoration: none;
}

.btn-danger {
  background: var(--color-error);
  color: #fff;
}

.btn-sm {
  min-height: 36px;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

.btn-lg {
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

.btn-icon {
  padding: 0.5rem;
  border-radius: var(--radius-sm);
}

/* Cards */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.card-body {
  padding: var(--space-lg);
}

.card-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--color-border);
  background: rgba(0, 0, 0, 0.02);
}

.card-title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Forms */
.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  margin-bottom: var(--space-xs);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
}

.form-hint {
  display: block;
  margin-top: var(--space-xs);
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(var(--brand-primary-rgb), 0.15);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.form-color-input {
  -webkit-appearance: none;
  appearance: none;
  width: 3.25rem;
  height: 3.25rem;
  flex-shrink: 0;
  padding: 0.125rem;
  border: 2px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  cursor: pointer;
  background: var(--color-surface);
}

.form-color-input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.form-color-input::-webkit-color-swatch {
  border: none;
  border-radius: calc(var(--radius-md) - 2px);
}

.form-color-input::-moz-color-swatch {
  border: none;
  border-radius: calc(var(--radius-md) - 2px);
}

.theme-color-field {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.theme-color-hex {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  text-transform: lowercase;
}

.theme-color-grid {
  display: grid;
  gap: var(--space-md);
}

@media (min-width: 640px) {
  .theme-color-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.admin-settings-tabs {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
}

.admin-settings-tabs .btn.is-active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
}

.settings-info-card {
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface-alt, #f8fafc);
  font-size: 0.875rem;
  line-height: 1.5;
}

.settings-info-card p {
  margin: 0 0 0.5rem;
}

.settings-info-card p:last-child {
  margin-bottom: 0;
}

.settings-theme-grid {
  display: grid;
  gap: var(--space-md);
}

.settings-theme-grid.is-theme-tab {
  align-items: start;
}

@media (min-width: 960px) {
  .settings-theme-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .settings-theme-grid.is-theme-tab .settings-theme-preview-col {
    position: sticky;
    top: calc(var(--header-height, 56px) + 0.75rem);
    max-height: calc(100vh - var(--header-height, 56px) - 1.5rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    align-self: start;
    z-index: 2;
  }
}

@media (max-width: 959px) {
  .settings-theme-grid.is-theme-tab {
    display: flex;
    flex-direction: column;
  }

  .settings-theme-grid.is-theme-tab .settings-theme-preview-col {
    order: -1;
    position: sticky;
    top: calc(var(--header-height, 56px) + 0.5rem);
    z-index: 5;
    box-shadow: var(--shadow-lg);
  }

  .settings-theme-grid.is-theme-tab .settings-theme-preview-col .theme-preview-panel {
    min-height: auto;
    max-height: min(38vh, 280px);
    overflow-y: auto;
  }
}

.theme-preview {
  --color-bg: #f1f5f9;
  --brand-primary: #1e293b;
  --brand-accent: #6366f1;
  --brand-primary-rgb: 30, 41, 59;
  --brand-accent-rgb: 99, 102, 241;
  --color-surface: #ffffff;
  --color-text: #1a1a1a;
  --color-text-muted: #6b7280;
  --color-border: #e5e2dc;
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  font-family: var(--font-sans);
  color: var(--color-text);
}

.theme-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--color-surface);
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
}

.theme-preview-business {
  font-weight: 700;
  font-size: var(--menu-title-size, 1.0625rem);
  font-family: var(--menu-title-font, inherit);
  color: var(--menu-title-color, inherit);
}

.theme-preview-badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.2);
}

.theme-preview-tabs {
  display: flex;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.theme-preview-tab {
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.theme-preview-tab.is-active {
  background: var(--brand-primary);
  color: #fff;
}

.theme-preview-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-md);
  padding: var(--space-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.theme-preview-card-info strong {
  display: block;
  margin-bottom: 0.125rem;
  color: var(--color-text);
}

.theme-preview-card-info p {
  margin: 0 0 0.375rem;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.theme-preview-price {
  font-weight: 700;
  color: var(--brand-accent);
}

.theme-preview-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-md);
  padding: var(--space-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.theme-preview-cart-label {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.theme-preview-screen-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.theme-preview-screen-tab {
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  cursor: pointer;
}

.theme-preview-screen-tab.is-active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
}

.theme-preview-panel {
  min-height: 320px;
}

.theme-preview-welcome-wrap {
  position: relative;
  min-height: 320px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: color-mix(in srgb, var(--welcome-overlay-bg, var(--brand-primary)) 52%, rgba(0, 0, 0, 0.42));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}

.theme-preview-welcome-card {
  width: 100%;
  max-width: 280px;
  padding: var(--space-md);
  border-radius: var(--radius-md);
  background: var(--welcome-card-bg, var(--color-surface));
  border: 1px solid var(--color-border);
  text-align: center;
  box-shadow: var(--shadow-md);
}

.theme-preview-welcome-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  color: var(--welcome-title-color, var(--brand-primary));
}

.theme-preview-welcome-card p {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  color: var(--welcome-text-color, var(--color-text-muted));
  line-height: 1.45;
}

.theme-preview-promo-panel {
  position: relative;
  overflow: hidden;
  margin: var(--space-md);
  padding: var(--space-md);
  border-radius: 1rem;
  background: var(--promo-panel-background, linear-gradient(
    145deg,
    color-mix(in srgb, var(--promo-panel-accent, var(--brand-accent)) 38%, #fff) 0%,
    color-mix(in srgb, var(--promo-panel-accent-end, var(--brand-primary)) 30%, #fff) 55%,
    color-mix(in srgb, var(--promo-panel-accent, var(--brand-accent)) 22%, var(--color-bg)) 100%
  ));
  border: 1.5px solid color-mix(in srgb, var(--promo-panel-accent, var(--brand-accent)) 48%, #fff 22%);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--promo-panel-accent, var(--brand-accent)) 22%, transparent);
}

.theme-preview-promo-head {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
  font-weight: 800;
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--promo-title-color, var(--promo-panel-accent, var(--brand-accent)));
}

.theme-preview-promo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: var(--radius-full);
  font-size: 0.55rem;
  color: var(--promo-badge-text, #fff);
  background: var(--promo-badge-color, var(--brand-accent));
  border: none;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--promo-badge-color, var(--brand-accent)) 40%, transparent);
}

.theme-preview-promo-card {
  padding: 0.65rem 0.75rem;
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--promo-card-bg, var(--color-surface)) 88%, var(--promo-panel-accent, var(--brand-accent)) 12%);
  border: 1px solid color-mix(in srgb, var(--promo-panel-accent, var(--brand-accent)) 32%, var(--color-border));
  border-left: 3px solid var(--promo-panel-accent, var(--brand-accent));
  font-size: 0.8125rem;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--promo-panel-accent, var(--brand-accent)) 14%, transparent);
}

.theme-preview-promo-card strong {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--promo-text-color, var(--color-text));
}

.theme-preview-promo-card span {
  font-size: 0.75rem;
  color: var(--promo-meta-color, var(--color-text-muted));
}

.theme-preview-order {
  margin: var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--order-card-bg, var(--color-surface));
  color: var(--order-text-color, var(--color-text));
  overflow: hidden;
}

.theme-preview-order-header {
  padding: var(--space-md);
  background: var(--order-header-background, linear-gradient(
    135deg,
    var(--order-header-bg, transparent) 0%,
    var(--order-header-bg-end, var(--order-header-bg, transparent)) 100%
  ));
  border-bottom: 1px solid var(--color-border);
  color: var(--order-header-text, inherit);
}

.theme-preview-order-header strong {
  display: block;
  font-size: 0.9375rem;
  color: var(--order-header-text, var(--color-text));
}

.theme-preview-order-header span {
  font-size: 0.75rem;
  color: color-mix(in srgb, var(--order-header-text, var(--color-text-muted)) 78%, transparent);
}

.theme-preview-order-steps {
  display: flex;
  gap: 0.5rem;
  padding: 0.65rem var(--space-md);
  overflow-x: auto;
}

.theme-preview-order-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  min-width: 3.5rem;
  opacity: 0.45;
  font-size: 0.625rem;
  color: var(--order-muted-text-color, var(--color-text-muted));
}

.theme-preview-order-step.is-done .theme-preview-order-dot {
  background: var(--brand-primary);
}

.theme-preview-order-step.is-current {
  opacity: 1;
  font-weight: 600;
  color: var(--color-text);
}

.theme-preview-order-step.is-current .theme-preview-order-dot {
  background: var(--order-status-color, var(--brand-accent));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--order-status-color, var(--brand-accent)) 30%, transparent);
}

.theme-preview-order-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: var(--radius-full);
  background: var(--color-border);
}

.theme-preview-order-items {
  list-style: none;
  margin: 0;
  padding: 0 var(--space-md) var(--space-md);
  font-size: 0.8125rem;
}

.theme-preview-order-items li {
  display: flex;
  justify-content: space-between;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--color-border);
}

.theme-preview-bill {
  margin: var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  overflow: hidden;
  background: var(--color-surface);
}

.theme-preview-bill-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  background: var(--bill-header-background, linear-gradient(
    135deg,
    var(--bill-header-bg, var(--color-surface)) 0%,
    var(--bill-header-bg-end, var(--bill-header-bg, var(--color-surface))) 100%
  ));
  border-bottom: 1px solid var(--color-border);
  color: var(--bill-header-text, inherit);
}

.theme-preview-bill-header strong {
  color: var(--bill-header-text, var(--color-text));
}

.theme-preview-bill-ticket {
  margin: var(--space-md);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--bill-card-bg, var(--color-surface));
  font-size: 0.8125rem;
  color: var(--bill-text-color, var(--color-text));
}

.theme-preview-bill-ticket-head {
  margin: calc(-1 * var(--space-md)) calc(-1 * var(--space-md)) 0.5rem;
  padding: 0.5rem var(--space-md);
  text-align: center;
  background: var(--bill-header-background, linear-gradient(
    135deg,
    var(--bill-header-bg, transparent) 0%,
    var(--bill-header-bg-end, var(--bill-header-bg, transparent)) 100%
  ));
  border-bottom: 1px dashed var(--color-border);
  font-size: 0.75rem;
  color: var(--bill-header-text, inherit);
}

.theme-preview-bill-ticket-head strong {
  display: block;
  font-size: 0.875rem;
}

.theme-preview-bill-line {
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--color-border);
}

.theme-preview-bill-total {
  display: flex;
  justify-content: space-between;
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--color-border);
  font-weight: 700;
}

.theme-preview-bill-total span:last-child {
  color: var(--bill-accent-color, var(--brand-accent));
}

.theme-surface-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.theme-template-group {
  margin-bottom: 1.25rem;
}

.theme-template-group-title {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin: 0 0 0.5rem;
}

.theme-template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  gap: 0.5rem;
}

.theme-template-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  padding: 0.45rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.theme-template-card:hover {
  border-color: var(--brand-accent);
}

.theme-template-card.is-active {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 1px var(--brand-primary);
}

.theme-template-swatch {
  display: block;
  width: 100%;
  height: 2.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.theme-template-name {
  font-size: 0.6875rem;
  line-height: 1.25;
  color: var(--color-text);
  font-weight: 500;
}

.form-check {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
}

.form-check input {
  width: 1.125rem;
  height: 1.125rem;
  accent-color: var(--brand-primary);
}

.form-row {
  display: grid;
  gap: var(--space-md);
}

@media (min-width: 640px) {
  .form-row-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.form-error {
  color: var(--color-error);
  font-size: 0.8125rem;
  margin-top: var(--space-xs);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge-primary {
  background: rgba(var(--brand-primary-rgb), 0.12);
  color: var(--brand-primary);
}

.badge-accent {
  background: rgba(var(--brand-accent-rgb), 0.18);
  color: #7a5c2e;
}

.badge-success {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.badge-warning {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.badge-error {
  background: var(--color-error-bg);
  color: var(--color-error);
}

.badge-info {
  background: var(--color-info-bg);
  color: var(--color-info);
}

.badge-neutral {
  background: var(--color-border);
  color: var(--color-text-muted);
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-wrap-scroll {
  max-height: 28rem;
  overflow-y: auto;
}

.table th.sortable {
  cursor: pointer;
  user-select: none;
}

.table th.sortable:hover {
  color: var(--brand-primary);
}

.table-sort-icon {
  margin-left: 0.25rem;
  font-size: 0.75rem;
  opacity: 0.6;
}

.admin-table-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
  margin-bottom: var(--space-md);
}

.admin-table-toolbar .form-input,
.admin-table-toolbar .form-select {
  max-width: 220px;
}

.admin-table-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: var(--space-md) 0 0;
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-sm);
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.admin-table-pagination {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table th,
.table td {
  padding: 0.625rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.table td:first-child:has(.table-thumb) {
  width: 68px;
  padding-right: 0.5rem;
}

.table th {
  font-weight: 600;
  color: var(--color-text-muted);
  background: rgba(0, 0, 0, 0.02);
  white-space: nowrap;
}

.table tbody tr:hover {
  background: rgba(var(--brand-primary-rgb), 0.03);
}

/* Acciones: mantener display:table-cell (flex en <td> rompe alineación y bordes de fila) */
.table th.table-actions-col,
.table td.table-actions {
  text-align: right;
}

.table td.table-actions {
  vertical-align: middle;
  white-space: nowrap;
  width: 1%;
}

.table td.table-actions .btn {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}

.table td.table-actions .btn-sm {
  min-height: 32px;
  padding: 0.35rem 0.65rem;
}

.table td.table-actions .btn + .btn {
  margin-left: var(--space-xs);
}

.table td.table-actions .btn-link {
  min-height: auto;
  padding: 0.25rem 0.5rem;
}

/* QR mesas — admin */
.qr-table-cell {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.qr-thumb {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #fff;
  line-height: 0;
}

.qr-thumb canvas {
  display: block;
}

.qr-table-actions {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

.qr-link-truncate {
  display: inline-block;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.qr-modal-dialog {
  max-width: 360px;
}

.qr-modal-body {
  text-align: center;
}

.qr-modal-preview {
  display: inline-flex;
  padding: var(--space-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
}

.qr-modal-preview canvas {
  display: block;
}

/* Manual embebido */
.manual-layout {
  display: grid;
  gap: var(--space-md);
}

@media (min-width: 900px) {
  .manual-layout {
    grid-template-columns: 240px 1fr;
    align-items: start;
  }
}

.manual-sidebar {
  position: sticky;
  top: var(--space-md);
}

.manual-sidebar-title {
  font-weight: 600;
  font-size: 0.875rem;
  margin: 0 0 var(--space-sm);
}

.manual-sidebar-cat {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin: var(--space-sm) 0 0.25rem;
}

.manual-index-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.manual-index-list li {
  padding: 0.35rem 0;
}

.manual-index-list a {
  color: var(--brand-primary);
  text-decoration: none;
  font-size: 0.875rem;
}

.manual-index-list a:hover,
.manual-index-list a.is-active {
  font-weight: 600;
  text-decoration: underline;
}

/* Ayuda contextual por módulo */
.admin-page-title-row,
.card-title-row {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-help-wrap {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
}

.admin-help-btn {
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: var(--color-surface, #fff);
  color: var(--color-text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.admin-help-btn:hover,
.admin-help-btn:focus-visible {
  color: var(--brand-primary);
  border-color: var(--brand-primary);
  outline: none;
}

.admin-help-popover {
  position: absolute;
  z-index: 40;
  top: calc(100% + 0.35rem);
  left: 0;
  min-width: 260px;
  max-width: min(360px, 90vw);
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 8px);
  background: var(--color-surface, #fff);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--color-text);
}

.admin-help-title {
  margin: 0 0 0.35rem;
  font-weight: 600;
  font-size: 0.875rem;
}

.admin-help-body ul {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
}

.admin-help-body li + li {
  margin-top: 0.2rem;
}

.admin-help-body p {
  margin: 0;
}

.table-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
  background: var(--color-surface-muted, #f3f4f6);
}

.table-row-clickable {
  cursor: pointer;
}

.table-row-clickable:hover td {
  background: var(--color-surface-muted, rgba(0, 0, 0, 0.03));
}

.cashier-pay-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.cashier-pay-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--color-success, #16a34a);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}

.modal-dialog-wide {
  max-width: 34rem;
}

.order-detail-panel {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.order-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--color-border);
}

.order-detail-folio {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--brand-primary);
}

.order-detail-sub {
  margin: 0.15rem 0 0;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.order-detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.order-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem 0.75rem;
  margin: 0;
}

.order-detail-grid > div {
  min-width: 0;
}

.order-detail-grid dt {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.order-detail-grid dd {
  margin: 0.1rem 0 0;
  font-size: 0.875rem;
  font-weight: 500;
}

.order-detail-items-title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.order-detail-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.order-detail-items-table th,
.order-detail-items-table td {
  padding: 0.4rem 0.35rem;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
}

.order-detail-items-table th {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.order-detail-items-table td:last-child,
.order-detail-items-table th:last-child {
  text-align: right;
  white-space: nowrap;
}

.order-detail-totals {
  padding: 0.65rem 0.75rem;
  background: var(--color-surface-muted, #f8fafc);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.order-detail-totals-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.8125rem;
  margin-bottom: 0.2rem;
}

.order-detail-totals-row.is-total {
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px dashed var(--color-border);
  font-size: 0.9375rem;
  font-weight: 700;
}

.process-stage-bar-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 8rem;
}

.process-stage-bar {
  height: 0.5rem;
  min-width: 0.25rem;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.75);
}

.status-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.status-timeline-item {
  position: relative;
  display: flex;
  gap: 0.75rem;
  padding-bottom: 1rem;
}

.status-timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 0.4375rem;
  top: 1rem;
  bottom: 0;
  width: 2px;
  background: var(--color-border);
}

.status-timeline-dot {
  flex-shrink: 0;
  width: 0.9375rem;
  height: 0.9375rem;
  margin-top: 0.125rem;
  border-radius: 50%;
  background: var(--color-primary, #6366f1);
  border: 2px solid var(--color-surface, #fff);
  box-shadow: 0 0 0 1px var(--color-border);
}

.status-timeline-body {
  flex: 1;
  min-width: 0;
}

.status-timeline-title {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.9375rem;
}

.status-timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-top: 0.15rem;
}

.status-timeline-duration {
  font-weight: 600;
  color: var(--color-primary, #6366f1);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  background: rgba(0, 0, 0, 0.45);
}

.modal-card {
  box-shadow: var(--shadow-lg);
}

.manual-content {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--color-text);
}

.manual-content h1,
.manual-content h2,
.manual-content h3 {
  margin: 1.25em 0 0.5em;
  line-height: 1.3;
}

.manual-content h1 { font-size: 1.5rem; }
.manual-content h2 { font-size: 1.25rem; }
.manual-content h3 { font-size: 1.0625rem; }

.manual-content p {
  margin: 0 0 1em;
}

.manual-content ul,
.manual-content ol {
  margin: 0 0 1em;
  padding-left: 1.5em;
}

.manual-content code {
  background: rgba(0, 0, 0, 0.05);
  padding: 0.1em 0.35em;
  border-radius: var(--radius-sm);
  font-size: 0.875em;
}

.manual-content blockquote {
  margin: 0 0 1em;
  padding-left: 1em;
  border-left: 3px solid var(--brand-primary);
  color: var(--color-text-muted);
}

.manual-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.25em;
  font-size: 0.875rem;
}

.manual-content th,
.manual-content td {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
}

.manual-content th {
  background: rgba(var(--brand-primary-rgb), 0.06);
  font-weight: 600;
}

.manual-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}

.manual-table-wrap {
  overflow-x: auto;
  margin: 0 0 1.25em;
  -webkit-overflow-scrolling: touch;
}

.manual-sidebar-cat.is-playbook {
  color: var(--brand-primary);
  font-weight: 700;
}

.manual-sidebar-cat.is-playbook::before {
  content: '';
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin-right: 0.35rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #0ea5e9);
  vertical-align: middle;
}

/* Playbook — lectura enriquecida */
.manual-content--playbook {
  --playbook-radius: 12px;
  --playbook-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
}

.manual-content--playbook > h1:first-child {
  display: none;
}

.playbook-hero {
  position: relative;
  margin: -0.25rem 0 1.75rem;
  border-radius: var(--playbook-radius);
  overflow: hidden;
  box-shadow: var(--playbook-shadow);
  min-height: 200px;
}

.playbook-hero > img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 0;
}

@media (min-width: 700px) {
  .playbook-hero > img {
    height: 280px;
  }
}

.playbook-hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.05) 0%, rgba(15, 23, 42, 0.72) 100%);
  color: #fff;
}

.playbook-hero-kicker {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.9;
  margin-bottom: 0.35rem;
}

.playbook-hero-lead {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.35;
  max-width: 36rem;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.25);
}

.playbook-pillars {
  display: grid;
  gap: 0.75rem;
  margin: 0 0 1.5rem;
}

@media (min-width: 640px) {
  .playbook-pillars {
    grid-template-columns: repeat(3, 1fr);
  }

  .playbook-pillars--inline {
    grid-template-columns: repeat(3, 1fr);
  }
}

.playbook-pillar {
  padding: 1rem 1.1rem;
  border-radius: var(--playbook-radius);
  background: linear-gradient(145deg, rgba(99, 102, 241, 0.07), rgba(14, 165, 233, 0.05));
  border: 1px solid rgba(99, 102, 241, 0.12);
}

.playbook-pillar-icon {
  display: block;
  font-size: 1.25rem;
  margin-bottom: 0.35rem;
  opacity: 0.85;
}

.playbook-pillar p {
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.playbook-cards {
  display: grid;
  gap: 0.75rem;
  margin: 0 0 1.5rem;
}

@media (min-width: 600px) {
  .playbook-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .playbook-cards--three {
    grid-template-columns: repeat(3, 1fr);
  }
}

.playbook-card {
  padding: 1rem 1.1rem;
  border-radius: var(--playbook-radius);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.playbook-card p {
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.playbook-card--problem {
  border-left: 3px solid #f59e0b;
  background: rgba(245, 158, 11, 0.04);
}

.playbook-card--success {
  border-left: 3px solid #10b981;
  background: rgba(16, 185, 129, 0.04);
}

.playbook-card--tip {
  border-left: 3px solid #6366f1;
  background: rgba(99, 102, 241, 0.04);
}

.playbook-quote {
  margin: 0 0 1.5rem;
  padding: 1rem 1.25rem;
  border-left: none;
  border-radius: var(--playbook-radius);
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.04), rgba(99, 102, 241, 0.06));
  color: var(--color-text);
}

.playbook-quote p {
  margin: 0;
}

.playbook-figure {
  margin: 0 0 1.5rem;
}

.playbook-figure img {
  width: 100%;
  display: block;
}

.playbook-figure figcaption {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-align: center;
}

.playbook-figure--split {
  display: grid;
  gap: 0.5rem;
}

@media (min-width: 600px) {
  .playbook-figure--split {
    grid-template-columns: 1fr 1fr;
  }
}

.playbook-steps {
  display: grid;
  gap: 0.75rem;
  margin: 0 0 1.5rem;
}

.playbook-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem 1.1rem;
  border-radius: var(--playbook-radius);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}

.playbook-step p {
  margin: 0.25rem 0 0.5rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.playbook-step a {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--brand-primary);
  text-decoration: none;
}

.playbook-step a:hover {
  text-decoration: underline;
}

.playbook-step-num {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--brand-primary);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
}

.playbook-steps--compact .playbook-step {
  padding: 0.85rem 1rem;
}

.playbook-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.5rem;
  margin: 0 0 1.5rem;
}

.playbook-flow-item {
  flex: 1 1 140px;
  padding: 0.85rem 1rem;
  border-radius: var(--playbook-radius);
  background: rgba(var(--brand-primary-rgb), 0.05);
  border: 1px solid rgba(var(--brand-primary-rgb), 0.1);
}

.playbook-flow-item span {
  display: inline-flex;
  width: 1.5rem;
  height: 1.5rem;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--brand-primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.playbook-flow-item p {
  margin: 0;
  font-size: 0.8125rem;
}

.playbook-flow-arrow {
  display: none;
  align-self: center;
  color: var(--color-text-muted);
  font-size: 1.25rem;
}

@media (min-width: 900px) {
  .playbook-flow-arrow {
    display: flex;
  }
}

.playbook-status-track {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.75rem;
  padding: 1rem;
  border-radius: var(--playbook-radius);
  background: rgba(var(--brand-primary-rgb), 0.04);
  border: 1px solid var(--color-border);
}

.playbook-status {
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}

.playbook-status--done {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #047857;
}

.playbook-status-arrow {
  color: var(--color-text-muted);
  font-size: 0.75rem;
}

.playbook-note {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0 0 1.25rem;
}

.playbook-checklist {
  margin: 0 0 1.5rem;
  padding: 1rem 1.25rem;
  border-radius: var(--playbook-radius);
  background: var(--color-surface-alt, #f8fafc);
  border: 1px solid var(--color-border);
}

.playbook-checklist--highlight {
  border-color: rgba(99, 102, 241, 0.25);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(14, 165, 233, 0.04));
}

.playbook-checklist ul {
  margin: 0;
}

.playbook-role-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(var(--brand-primary-rgb), 0.1);
}

.playbook-role-badge--waiter { background: rgba(14, 165, 233, 0.15); color: #0369a1; }
.playbook-role-badge--kitchen { background: rgba(245, 158, 11, 0.15); color: #b45309; }
.playbook-role-badge--cashier { background: rgba(16, 185, 129, 0.15); color: #047857; }
.playbook-role-badge--driver { background: rgba(139, 92, 246, 0.15); color: #6d28d9; }

/* Manual — edición inline de imágenes (manual:manage) */
.manual-content--editable .manual-img-wrap {
  position: relative;
  display: block;
  max-width: 100%;
  min-height: 3rem;
}

.manual-content--editable .manual-img-wrap.is-broken {
  min-height: 10rem;
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
  border-radius: var(--radius-md);
  border: 1px dashed var(--color-border);
}

.manual-content--editable .manual-img-wrap.is-broken > img {
  min-height: 6rem;
  max-height: 8rem;
  width: auto;
  margin: 0 auto;
  display: block;
  object-fit: contain;
  opacity: 0.35;
}

.manual-content--editable .manual-img-wrap.is-broken .manual-img-overlay {
  opacity: 1;
  pointer-events: auto;
}

.manual-content--editable .playbook-hero .manual-img-wrap {
  width: 100%;
  position: relative;
  z-index: 2;
}

.manual-content--editable .playbook-hero-overlay {
  pointer-events: none;
  z-index: 1;
}

.manual-content--editable .playbook-hero .manual-img-wrap > img {
  height: 220px;
  width: 100%;
  object-fit: cover;
  border-radius: 0;
}

@media (min-width: 700px) {
  .manual-content--editable .playbook-hero .manual-img-wrap > img {
    height: 280px;
  }
}

.manual-content--editable .manual-img-wrap > img {
  cursor: pointer;
}

.manual-img-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  transition: opacity 0.2s ease;
  border-radius: inherit;
  pointer-events: none;
}

.manual-img-wrap:hover .manual-img-overlay,
.manual-img-wrap.is-hover .manual-img-overlay,
.manual-img-wrap.is-broken .manual-img-overlay {
  opacity: 1;
  pointer-events: auto;
}

.manual-img-wrap.is-broken .manual-img-overlay {
  background: rgba(127, 29, 29, 0.55);
}

.manual-img-change-btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 999px;
  background: #fff;
  color: var(--brand-primary);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.manual-img-change-btn:hover {
  background: #f8fafc;
}

.manual-edit-hint {
  margin: 0 0 1rem;
  padding: 0.65rem 1rem;
  font-size: 0.8125rem;
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: var(--color-text-muted);
}

.manual-content--editable .playbook-figure .manual-img-wrap,
.manual-content--editable .playbook-figure--split .manual-img-wrap {
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  color: var(--color-text-muted);
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

/* Loading */
.spinner {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--color-border);
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-xl);
  color: var(--color-text-muted);
}

/* Stat cards */
.stat-grid {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.stat-card {
  padding: var(--space-md) var(--space-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--brand-accent);
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-xs);
}

.stat-value {
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

/* Image picker (admin) */
.image-picker-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  align-items: flex-start;
}

.image-picker-preview {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  flex-shrink: 0;
}

.image-picker-preview--logo {
  object-fit: contain;
  width: 64px;
  height: 64px;
}

.image-picker-preview-wrap {
  flex-shrink: 0;
}

.image-picker-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--color-border);
  background: var(--color-surface-muted, #f3f4f6);
  color: var(--color-text-muted, #6b7280);
  font-size: 0.6875rem;
  text-align: center;
  padding: 0.25rem;
}

.image-picker-placeholder--logo {
  width: 64px;
  height: 64px;
}

.image-picker-preview--bg {
  object-fit: cover;
}

.image-picker-placeholder--bg {
  width: 80px;
  height: 80px;
}

.image-picker-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
}

.image-picker-credit {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

.pexels-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}

.pexels-modal {
  width: 100%;
  max-width: 640px;
  max-height: min(90vh, 720px);
  overflow: auto;
}

.pexels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-sm);
}

.pexels-thumb {
  position: relative;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  background: var(--color-surface-muted);
  aspect-ratio: 1;
}

.pexels-thumb:hover:not(:disabled) {
  border-color: var(--brand-primary);
}

.pexels-thumb:disabled {
  opacity: 0.6;
  cursor: wait;
}

.pexels-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pexels-thumb-credit {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.2rem 0.35rem;
  font-size: 0.65rem;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Menú público — modales y opciones */
.menu-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: var(--z-modal);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: var(--space-md);
}

@media (min-width: 480px) {
  .menu-modal-backdrop {
    align-items: center;
  }
}

.menu-modal {
  width: 100%;
  max-width: 420px;
  max-height: min(90vh, 640px);
  overflow: auto;
}

.option-choices {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.option-choice {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.9375rem;
  cursor: pointer;
}

.menu-product-specs {
  width: 100%;
  box-sizing: border-box;
  padding: var(--space-md);
  margin: 0 calc(-1 * var(--space-md)) calc(-1 * var(--space-md));
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
}

.menu-product-specs .form-group:last-of-type {
  margin-bottom: var(--space-sm);
}

.menu-product-specs-price {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0 0 var(--space-md);
}

.menu-product-specs .option-choice span {
  min-width: 0;
  word-break: break-word;
}

.bank-details {
  margin: 0.75rem 0;
  font-size: 0.875rem;
}

.bank-details div {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: 0.35rem;
}

.bank-details dt {
  font-weight: 600;
  min-width: 4.5rem;
  margin: 0;
}

.bank-details dd {
  margin: 0;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.catalog-import-dialog {
  max-width: 42rem;
  width: calc(100% - 2rem);
}

.catalog-import-prompt {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-start;
}

.catalog-import-prompt code {
  flex: 1;
  display: block;
  font-size: 0.75rem;
  line-height: 1.4;
  padding: 0.5rem;
  background: var(--color-surface-muted, #f3f4f6);
  border-radius: var(--radius-sm, 4px);
  word-break: break-word;
}

.catalog-import-errors ul,
.catalog-import-warnings ul {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.875rem;
}

.catalog-import-errors li {
  color: var(--color-error, #b91c1c);
}

.catalog-import-preview-table {
  max-height: 16rem;
  overflow: auto;
}

.import-row-duplicate {
  background: #fffbeb;
}

.import-review-badge {
  margin-left: 0.35rem;
  font-size: 0.6875rem;
  vertical-align: middle;
}

.catalog-import-result .alert-warning {
  margin-bottom: 0.75rem;
  padding: 0.75rem;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: var(--radius-sm, 4px);
  font-size: 0.875rem;
}

.catalog-bulk-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
}

.catalog-bulk-toolbar .form-input {
  flex: 1;
  min-width: 10rem;
}

.catalog-bulk-filter,
.catalog-bulk-select-all {
  font-size: 0.8125rem;
  white-space: nowrap;
}

.catalog-bulk-count {
  font-size: 0.8125rem;
}

.catalog-select-col {
  width: 2.25rem;
  text-align: center;
}

.catalog-bulk-pexels-dialog {
  max-width: 36rem;
  width: calc(100% - 2rem);
}

.catalog-bulk-pexels-table {
  max-height: 18rem;
  overflow: auto;
}

.catalog-bulk-progress {
  height: 0.375rem;
  background: var(--color-surface-muted, #e5e7eb);
  border-radius: 999px;
  overflow: hidden;
}

.catalog-bulk-progress-bar {
  height: 100%;
  background: var(--color-primary, #0a4366);
  transition: width 0.2s ease;
}

.catalog-bulk-pexels-summary .card-body {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
}

/* ── Insights IA (estrategias agrupadas) ── */
.insights-page {
  max-width: 1120px;
}

.insights-run-bar-inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  align-items: flex-end;
  justify-content: space-between;
}

.insights-run-dates {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: flex-end;
}

.insights-run-field {
  margin: 0;
  min-width: 9rem;
}

.insights-run-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-sm);
}

.insights-run-last {
  margin: 0;
  font-size: 0.8125rem;
}

.insights-quota {
  width: min(20rem, 100%);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.insights-quota-label {
  font-size: 0.8125rem;
}

.insights-quota-track {
  width: 100%;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--color-surface-muted, #e5e7eb);
  overflow: hidden;
}

.insights-quota-fill {
  height: 100%;
  width: 0;
  background: var(--brand-accent);
  transition: width 0.25s ease;
}

.insights-redeem-row {
  display: flex;
  gap: 0.5rem;
  width: min(28rem, 100%);
}

.insights-redeem-row .form-input {
  flex: 1;
}

.insights-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.insights-summary-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.875rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.insights-summary-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--color-text);
}

.insights-summary-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.insights-summary-card--success .insights-summary-value {
  color: #059669;
}

.insights-summary-card--muted .insights-summary-value {
  color: var(--color-text-muted);
}

.insights-summary-card--accent .insights-summary-value {
  color: var(--brand-accent);
}

.insights-toolbar {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.insights-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
}

.insights-filter-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  min-width: 3.5rem;
}

.insights-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.insights-chip {
  padding: 0.35rem 0.75rem;
  font-size: 0.8125rem;
  font-family: inherit;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.insights-chip:hover {
  border-color: var(--color-border-strong);
  background: var(--color-bg);
}

.insights-chip.is-active {
  background: var(--brand-accent);
  border-color: var(--brand-accent);
  color: #fff;
}

.insights-groups {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.insights-category {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-surface);
}

.insights-category-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 1rem 1.125rem;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background var(--transition);
}

.insights-category-header:hover {
  background: var(--color-bg);
}

.insights-category-icon {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  font-size: 1.125rem;
  font-weight: 700;
}

.insights-category--product_positioning .insights-category-icon {
  background: #ede9fe;
  color: #6d28d9;
}

.insights-category--promotion .insights-category-icon {
  background: #fce7f3;
  color: #be185d;
}

.insights-category--pricing .insights-category-icon {
  background: #fef3c7;
  color: #b45309;
}

.insights-category--schedule .insights-category-icon {
  background: #dbeafe;
  color: #1d4ed8;
}

.insights-category--marketing .insights-category-icon {
  background: #d1fae5;
  color: #047857;
}

.insights-category--general .insights-category-icon {
  background: var(--color-bg);
  color: var(--color-text-muted);
}

.insights-category-heading {
  flex: 1;
  min-width: 0;
}

.insights-category-title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
}

.insights-category-desc {
  margin: 0.2rem 0 0;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.insights-category-count {
  flex-shrink: 0;
  min-width: 1.75rem;
  height: 1.75rem;
  padding: 0 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--color-bg);
  font-size: 0.8125rem;
  font-weight: 600;
}

.insights-category-chevron {
  flex-shrink: 0;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid var(--color-text-muted);
  border-bottom: 2px solid var(--color-text-muted);
  transform: rotate(45deg);
  transition: transform var(--transition);
  margin-left: 0.25rem;
}

.insights-category-chevron.is-collapsed {
  transform: rotate(-135deg);
}

.insights-category-body {
  border-top: 1px solid var(--color-border);
  padding: 1rem 1.125rem 1.125rem;
  background: var(--color-bg);
}

.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  gap: var(--space-sm);
}

.insight-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.insight-card.is-expanded {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand-accent) 25%, transparent);
}

.insight-card-header {
  padding: 0.75rem 0.875rem 0;
}

.insight-card-toggle {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.insight-card-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
  flex: 1;
}

.insight-card-badge {
  flex-shrink: 0;
  font-size: 0.6875rem;
}

.insight-card-preview {
  padding: 0.5rem 0.875rem 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.insight-card-excerpt {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.insight-card-more {
  align-self: flex-start;
  min-height: auto;
  padding: 0.25rem 0.5rem;
  font-size: 0.8125rem;
}

.insight-card-detail {
  padding: 0 0.875rem 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.insight-card-section-title {
  margin: 0 0 0.35rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

.insight-card-section p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
}

.insight-card-evidence ul {
  margin: 0;
  padding-left: 1.125rem;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.insight-card-evidence li {
  margin-bottom: 0.25rem;
}

.insight-card-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.625rem 0.75rem;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
}

.insight-card-meta-item {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.insight-card-meta-item strong {
  display: block;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin-bottom: 0.15rem;
}

.insight-card-meta-item--muted {
  color: var(--color-text-muted);
}

.insight-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.insight-card-collapse {
  align-self: flex-start;
  min-height: auto;
  padding: 0.25rem 0.5rem;
  font-size: 0.8125rem;
}

.insights-empty-body {
  text-align: center;
  padding: 2.5rem 1.5rem;
}

.insights-empty-title {
  margin: 0 0 0.5rem;
  font-weight: 600;
}

@media (max-width: 768px) {
  .insights-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .insights-run-bar-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .insights-run-dates {
    flex-direction: column;
    align-items: stretch;
  }

  .insights-run-field {
    min-width: 0;
  }
}

/* Roles admin */
.roles-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: var(--space-md);
  align-items: start;
}

.roles-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.roles-list-item {
  width: 100%;
  display: block;
  text-align: left;
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  margin-bottom: 0.5rem;
  cursor: pointer;
  font-family: inherit;
}

.roles-list-item.is-active {
  border-color: var(--brand-accent);
  background: rgba(var(--brand-accent-rgb), 0.06);
}

.roles-list-name {
  display: block;
  font-weight: 600;
  font-size: 0.9375rem;
}

.roles-list-meta {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 0.2rem;
}

.roles-detail-header {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.roles-section {
  margin-top: var(--space-lg);
}

.roles-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.roles-section-head h3 {
  margin: 0;
  font-size: 1rem;
}

.roles-perm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
  gap: var(--space-md);
}

.roles-perm-group {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  background: var(--color-bg);
}

.roles-perm-module {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}

.roles-perm-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.35rem 0;
  font-size: 0.8125rem;
  cursor: pointer;
}

.roles-perm-item.is-disabled {
  opacity: 0.7;
  cursor: default;
}

.roles-perm-item strong {
  display: block;
}

.roles-perm-item small {
  color: var(--color-text-muted);
}

.form-select-sm {
  min-height: 36px;
  padding: 0.35rem 0.5rem;
  font-size: 0.8125rem;
}

/* Piso / mesero */
.floor-page {
  max-width: 720px;
}

.floor-toolbar {
  display: flex;
  gap: 0.35rem;
  margin-bottom: var(--space-md);
}

.floor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr));
  gap: var(--space-sm);
}

.floor-card {
  text-align: left;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  padding: 1rem;
  cursor: pointer;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.floor-card:hover {
  border-color: var(--brand-accent);
  box-shadow: var(--shadow-sm);
}

.floor-card.is-attention {
  border-color: var(--color-warning);
  background: var(--color-warning-bg);
  animation: floor-card-pulse 1.4s ease-in-out infinite;
}

.floor-card.has-unread {
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.35);
}

.floor-card.is-attention.has-unread {
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.45);
}

.floor-card.is-bill-requested {
  border-color: var(--color-warning);
  background: var(--color-warning-bg);
}

.floor-bill-card {
  border-color: var(--color-warning);
  background: var(--color-warning-bg);
}

@keyframes floor-card-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.35); }
  50% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
}

.dashboard-table-legend {
  color: var(--color-text-muted);
}

.dashboard-table-dot {
  display: inline-block;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.dashboard-table-dot.is-free {
  background: #16a34a;
}

.dashboard-table-dot.is-open {
  background: #2563eb;
}

.dashboard-table-dot.is-attention {
  background: #f59e0b;
}

.dashboard-table-dot.is-bill {
  background: #7c3aed;
}

.dashboard-table-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 7rem), 1fr));
  gap: var(--space-sm);
}

.dashboard-table-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.5rem;
  text-align: center;
  font-size: 0.875rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.dashboard-table-card:hover {
  box-shadow: var(--shadow-sm);
}

.dashboard-table-card.is-free {
  border-color: #86efac;
  background: #f0fdf4;
}

.dashboard-table-card.is-open {
  border-color: #93c5fd;
  background: #eff6ff;
}

.dashboard-table-card.is-attention {
  border-color: var(--color-warning);
  background: var(--color-warning-bg);
}

.dashboard-table-card.is-bill_requested {
  border-color: #c4b5fd;
  background: #f5f3ff;
}

.floor-attention-banner {
  margin-bottom: var(--space-sm);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  background: var(--color-warning-bg);
  border: 1px solid var(--color-warning);
  color: var(--color-text);
  font-size: 0.875rem;
}

.floor-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.floor-card-title {
  margin: 0;
  font-size: 1.0625rem;
}

.floor-card-host {
  margin: 0.35rem 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.floor-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.floor-back {
  margin-bottom: var(--space-sm);
}

.floor-order-total {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0.75rem 0 0;
}

.floor-section-title {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}

.floor-items {
  list-style: none;
  margin: 0;
  padding: 0;
}

.floor-item {
  display: flex;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9375rem;
}

.floor-item-main {
  flex: 1;
  min-width: 0;
}

.floor-item-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.35rem;
  flex-wrap: wrap;
}

.floor-qty-btn {
  min-width: 2rem;
  padding: 0.15rem 0.35rem;
}

.floor-qty-label {
  min-width: 1.5rem;
  text-align: center;
  font-size: 0.875rem;
}

.floor-remove-btn {
  color: var(--color-danger, #c0392b);
  margin-left: 0.25rem;
}

.floor-catalog-dialog,
.floor-options-dialog {
  max-width: min(100%, 28rem);
  width: 100%;
}

.floor-catalog-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.75rem 0;
}

.floor-catalog-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 16rem;
  overflow-y: auto;
}

.floor-catalog-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.35rem;
  cursor: pointer;
  font-family: inherit;
}

.floor-catalog-item:hover {
  border-color: var(--brand-accent);
}

.floor-options-group {
  margin-bottom: 0.75rem;
}

.floor-options-label {
  margin: 0 0 0.35rem;
  font-weight: 600;
  font-size: 0.875rem;
}

.floor-options-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.floor-item:last-child {
  border-bottom: none;
}

.floor-status-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.floor-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

@media (max-width: 900px) {
  .roles-layout {
    grid-template-columns: 1fr;
  }
}

/* Mostrador / envíos */
.pickup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
  gap: var(--space-sm);
}

.pickup-card.is-ready {
  border-color: var(--color-success);
  background: var(--color-success-bg, #f0fdf4);
}

.delivery-kanban {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr));
  gap: var(--space-sm);
  align-items: start;
}

/* Leaflet: el reset global `img { max-width: 100% }` rompe el mosaico de tiles */
.leaflet-container img,
.leaflet-container img.leaflet-tile,
.leaflet-container img.leaflet-marker-icon,
.leaflet-container img.leaflet-marker-shadow {
  max-width: none !important;
  max-height: none !important;
  width: auto;
  padding: 0;
  border: none;
}

.delivery-admin-map {
  height: 320px;
  min-height: 320px;
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface-muted, #f3f4f6);
  position: relative;
  overflow: hidden;
  z-index: 0;
}

.delivery-admin-map.leaflet-container,
#delivery-track-map.leaflet-container {
  width: 100% !important;
  border-radius: inherit;
}

.delivery-admin-map.leaflet-container {
  height: 320px !important;
  min-height: 320px;
}

.delivery-chat-row {
  margin-bottom: 0.35rem;
}

.delivery-chat-status {
  display: block;
  font-size: 0.6875rem;
  color: var(--color-text-muted, #6b7280);
  margin: 0.1rem 0 0 0.15rem;
}

#delivery-track-map.leaflet-container {
  height: 240px !important;
  min-height: 240px;
}

.delivery-page .card-body {
  overflow: visible;
}

.delivery-card-focused {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.delivery-column-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 70vh;
  overflow-y: auto;
}

.delivery-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.65rem;
  background: var(--color-surface);
}

.delivery-card-pulse {
  border-color: var(--color-warning);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25);
  animation: delivery-card-pulse 1.4s ease-in-out 3;
}

.delivery-card-dismissed {
  opacity: 0.72;
}

@keyframes delivery-card-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25); }
  50% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.08); }
}

