/**
 * Qrium Admin — layout, componentes y overrides Bootstrap
 */

.admin-app {
  font-family: var(--font-sans);
  background-color: var(--brand-surface);
  color: var(--brand-text);
  padding-top: var(--navbar-height);
  -webkit-font-smoothing: antialiased;
}

.auth-page {
  font-family: var(--font-sans);
  min-height: 100vh;
  background: var(--brand-surface);
  -webkit-font-smoothing: antialiased;
}

/* —— Navbar —— */
.admin-app .navbar {
  height: var(--navbar-height);
  background: var(--brand-gradient);
  box-shadow: var(--shadow-sm);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  padding: 0 1rem;
}

.admin-app .navbar .container-fluid {
  height: 100%;
  align-items: center;
}

.admin-app .navbar-brand {
  font-weight: 600;
  font-size: var(--font-size-lg);
  color: var(--brand-text-inverse) !important;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-app .navbar-brand img {
  height: 36px;
  width: auto;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

.admin-app .navbar .btn-outline-light {
  border-color: rgba(255, 255, 255, 0.45);
  font-size: var(--font-size-sm);
}

.admin-app .navbar .btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* —— Sidebar —— */
.admin-app .sidebar {
  position: fixed;
  top: var(--navbar-height);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--navbar-height));
  background: var(--brand-surface-elevated);
  border-right: 1px solid var(--brand-border);
  overflow-y: auto;
  z-index: 1020;
  padding: var(--space-3) 0;
}

.admin-app .sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--brand-text-secondary);
  padding: 0.65rem 1.25rem;
  margin: 2px 0.5rem;
  border-radius: var(--radius-md);
  border-left: none;
  font-size: var(--font-size-sm);
  font-weight: 500;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.admin-app .sidebar .nav-link i {
  font-size: 1.1rem;
  opacity: 0.85;
}

.admin-app .sidebar .nav-link:hover {
  background: var(--brand-primary-muted);
  color: var(--brand-primary);
}

.admin-app .sidebar .nav-link.active {
  background: var(--brand-primary-soft);
  color: var(--brand-primary);
  font-weight: 600;
}

.admin-app .sidebar-overlay {
  display: none;
  position: fixed;
  top: var(--navbar-height);
  left: 0;
  width: 100%;
  height: calc(100vh - var(--navbar-height));
  background: rgba(26, 29, 38, 0.4);
  z-index: 1015;
  backdrop-filter: blur(2px);
}

.admin-app .main-content {
  margin-left: var(--sidebar-width);
  padding: var(--space-6);
  min-height: calc(100vh - var(--navbar-height));
  max-width: 1400px;
}

/* —— Page header —— */
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.page-header h1 {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--brand-text);
}

.page-header .page-subtitle {
  font-size: var(--font-size-sm);
  color: var(--brand-text-muted);
  margin: var(--space-1) 0 0;
}

.page-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

/* —— Cards —— */
.admin-app .card {
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  margin-bottom: var(--space-6);
  background: var(--brand-surface-elevated);
}

.admin-app .card-header {
  background: transparent;
  border-bottom: 1px solid var(--brand-border);
  padding: var(--space-4) var(--space-5);
  font-weight: 600;
}

.admin-app .card-body {
  padding: var(--space-5);
}

/* —— Stat cards (KPI) —— */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.stat-card {
  background: var(--brand-surface-elevated);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--stat-accent, var(--brand-primary));
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.stat-card--warning { --stat-accent: var(--brand-warning); }
.stat-card--info { --stat-accent: var(--brand-info); }
.stat-card--success { --stat-accent: var(--brand-success); }
.stat-card--danger { --stat-accent: var(--brand-danger); }
.stat-card--primary { --stat-accent: var(--brand-primary); }

.stat-card-label {
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brand-text-muted);
}

.stat-card-value {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--brand-text);
  font-variant-numeric: tabular-nums;
  line-height: var(--line-height-tight);
}

.stat-card-hint {
  font-size: var(--font-size-xs);
  color: var(--brand-text-muted);
}

.stat-card-icon {
  position: absolute;
  right: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
  opacity: 0.12;
  color: var(--stat-accent, var(--brand-primary));
}

.stat-card-banner {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
}

/* —— KPI mini (rentabilidad) —— */
.kpi-mini {
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  height: 100%;
  background: var(--brand-surface-elevated);
}

.kpi-mini-label {
  font-size: var(--font-size-xs);
  color: var(--brand-text-muted);
  display: block;
  margin-bottom: var(--space-1);
}

.kpi-mini-value {
  font-size: var(--font-size-xl);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--brand-text);
}

/* —— Bootstrap overrides —— */
.admin-app .btn-primary {
  --bs-btn-bg: var(--brand-primary);
  --bs-btn-border-color: var(--brand-primary);
  --bs-btn-hover-bg: var(--brand-primary-hover);
  --bs-btn-hover-border-color: var(--brand-primary-hover);
  --bs-btn-active-bg: var(--brand-primary-hover);
  --bs-btn-active-border-color: var(--brand-primary-hover);
  font-weight: 500;
  border-radius: var(--radius-md);
}

.admin-app .btn-outline-primary {
  --bs-btn-color: var(--brand-primary);
  --bs-btn-border-color: var(--brand-primary);
  --bs-btn-hover-bg: var(--brand-primary);
  --bs-btn-hover-border-color: var(--brand-primary);
  border-radius: var(--radius-md);
}

.admin-app .form-control,
.admin-app .form-select {
  border-radius: var(--radius-md);
  border-color: var(--brand-border);
  font-size: var(--font-size-sm);
}

.admin-app .form-control:focus,
.admin-app .form-select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-primary-soft);
}

.admin-app .table {
  font-size: var(--font-size-sm);
}

.admin-app .table thead th {
  font-weight: 600;
  color: var(--brand-text-secondary);
  text-transform: uppercase;
  font-size: var(--font-size-xs);
  letter-spacing: 0.03em;
  border-bottom-width: 1px;
}

/* —— Action buttons legacy —— */
.action-btn {
  padding: 6px 12px;
  border: none;
  background: var(--brand-info);
  color: var(--brand-text-inverse);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--font-size-xs);
  font-weight: 500;
  transition: opacity var(--transition-fast);
}

.action-btn:hover {
  opacity: 0.9;
}

.action-btn.btn-success { background: var(--brand-success); }
.action-btn.btn-danger { background: var(--brand-danger); }

/* —— Login —— */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.auth-panel-brand {
  background: var(--brand-gradient);
  color: var(--brand-text-inverse);
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.auth-panel-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 80%, rgba(255,255,255,0.12) 0%, transparent 50%),
              radial-gradient(circle at 80% 20%, rgba(255,255,255,0.08) 0%, transparent 40%);
  pointer-events: none;
}

.auth-panel-brand-inner {
  position: relative;
  z-index: 1;
  max-width: 400px;
}

.auth-panel-brand h1 {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-4);
}

.auth-panel-brand p {
  font-size: var(--font-size-lg);
  opacity: 0.9;
  line-height: var(--line-height-normal);
}

.auth-panel-form {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  background: var(--brand-surface-elevated);
}

.auth-card {
  width: 100%;
  max-width: 400px;
}

.auth-card h2 {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  margin-bottom: var(--space-1);
  color: var(--brand-text);
}

.auth-card .auth-subtitle {
  color: var(--brand-text-muted);
  margin-bottom: var(--space-6);
  font-size: var(--font-size-sm);
}

/* —— Cash widget dashboard —— */
.cash-widget {
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  background: var(--brand-surface-elevated);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.cash-widget--open {
  border-color: var(--brand-success);
  background: var(--brand-success-soft);
}

.cash-widget--closed {
  border-style: dashed;
}

/* —— Theme preview (configuración) —— */
.theme-color-input {
  width: 52px;
  height: 42px;
  padding: 4px;
}

.theme-preview {
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--brand-surface);
  max-width: 320px;
}

.theme-preview-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--preview-gradient, var(--brand-gradient));
  color: #fff;
}

.theme-preview-logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.theme-preview-title {
  font-weight: 700;
  font-size: var(--font-size-sm);
}

.theme-preview-sub {
  font-size: var(--font-size-xs);
  opacity: 0.9;
}

.theme-preview-chip-row {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4) 0;
}

.theme-preview-chip {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
  border: 1px solid var(--brand-border);
  color: var(--preview-primary, var(--brand-primary));
  background: #fff;
}

.theme-preview-chip.active {
  background: var(--preview-primary, var(--brand-primary));
  border-color: var(--preview-primary, var(--brand-primary));
  color: #fff;
}

.theme-preview-card {
  margin: var(--space-3) var(--space-4) var(--space-4);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #fff;
}

.theme-preview-card-img {
  height: 72px;
  background: var(--preview-primary-soft, var(--brand-primary-soft));
  color: var(--preview-primary, var(--brand-primary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.theme-preview-card-body {
  padding: var(--space-3);
}

.theme-preview-card-body strong {
  display: block;
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-1);
}

.theme-preview-price {
  color: var(--preview-primary, var(--brand-primary));
  font-weight: 700;
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-2);
}

.theme-preview-btn {
  width: 100%;
  padding: 8px;
  border: none;
  border-radius: var(--radius-full);
  background: var(--preview-primary, var(--brand-primary));
  color: #fff;
  font-weight: 600;
  font-size: var(--font-size-xs);
}

/* —— Responsive —— */
@media (max-width: 991.98px) {
  .admin-app.sidebar-open {
    overflow: hidden;
  }

  .admin-app .sidebar-overlay.show {
    display: block;
  }

  .admin-app .sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
    box-shadow: var(--shadow-lg);
  }

  .admin-app .sidebar.show {
    transform: translateX(0);
  }

  .admin-app .main-content {
    margin-left: 0;
    padding: var(--space-4);
  }

  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-panel-brand {
    padding: var(--space-6);
    min-height: auto;
  }

  .auth-panel-brand h1 {
    font-size: var(--font-size-2xl);
  }
}

/* —— Sidebar sections (UI-3) —— */
.admin-app .sidebar-section {
  margin-bottom: var(--space-2);
}

.admin-app .sidebar-section-label {
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand-text-muted);
  padding: var(--space-3) 1.25rem var(--space-1);
  margin-top: var(--space-1);
}

.admin-app .sidebar-section:first-child .sidebar-section-label {
  margin-top: 0;
}

/* —— Admin tables (UI-3) —— */
.admin-table-wrap {
  overflow: auto;
  max-height: min(70vh, 640px);
  border-radius: var(--radius-md);
}

.admin-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--brand-surface-elevated);
  box-shadow: 0 1px 0 var(--brand-border);
}

.admin-table tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.02);
}

.admin-table tbody tr:hover {
  background: var(--brand-primary-muted);
}

.admin-empty-state {
  text-align: center;
  padding: var(--space-8) var(--space-4);
  color: var(--brand-text-muted);
}

.admin-empty-state-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: var(--space-3);
  opacity: 0.45;
}

.admin-empty-state-title {
  display: block;
  font-size: var(--font-size-base);
  color: var(--brand-text);
  margin-bottom: var(--space-2);
}

.admin-empty-state-message {
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-4);
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

.admin-skeleton {
  display: inline-block;
  height: 14px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--brand-border) 25%, rgba(0,0,0,0.04) 50%, var(--brand-border) 75%);
  background-size: 200% 100%;
  animation: admin-skeleton-pulse 1.2s ease-in-out infinite;
}

.admin-skeleton--cell {
  width: 70%;
  height: 16px;
}

@keyframes admin-skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* —— KDS full-screen (UI-3) —— */
:root {
  --kds-toolbar-height: 56px;
}

.admin-kds {
  padding-top: var(--kds-toolbar-height);
  background: #1a1d26;
  color: #f4f5f7;
  min-height: 100vh;
}

.admin-kds .kds-toolbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--kds-toolbar-height);
  z-index: 1030;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-4);
  background: #12151c;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-kds .kds-toolbar-start,
.admin-kds .kds-toolbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.admin-kds .kds-toolbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: var(--font-size-lg);
}

.admin-kds .kds-toolbar-brand img {
  height: 32px;
  width: auto;
  border-radius: var(--radius-sm);
}

.admin-kds .kds-toolbar-clock {
  font-variant-numeric: tabular-nums;
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  padding-left: var(--space-3);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.admin-kds .kds-toolbar-user {
  font-size: var(--font-size-sm);
  color: rgba(255, 255, 255, 0.65);
}

.admin-kds .kds-main {
  min-height: calc(100vh - var(--kds-toolbar-height));
  padding: var(--space-4);
}

.admin-kds .kds-screen {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-height: calc(100vh - var(--kds-toolbar-height) - var(--space-8));
}

.admin-kds .kds-screen-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
}

.admin-kds .kds-screen-toolbar-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.admin-kds .kds-area-label {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}

.admin-kds .kds-area-select {
  min-width: min(320px, 100%);
  font-size: var(--font-size-lg);
  font-weight: 600;
  background: #252a36;
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.admin-kds .kds-area-select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35);
}

.admin-kds .kds-board {
  flex: 1;
}

.admin-kds .kds-board-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  color: rgba(255, 255, 255, 0.45);
  font-size: var(--font-size-xl);
}

.admin-kds .kds-board-empty i {
  font-size: 4rem;
  margin-bottom: var(--space-4);
}

.admin-kds .kds-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  min-height: calc(100vh - var(--kds-toolbar-height) - 120px);
}

.admin-kds .kds-column {
  background: #252a36;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  min-height: 400px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-kds .kds-column-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4);
  font-size: var(--font-size-lg);
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-kds .kds-column-count {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
  padding: 2px 10px;
  font-size: var(--font-size-sm);
}

.admin-kds .kds-column--pending .kds-column-header { color: #fbbf24; }
.admin-kds .kds-column--in_progress .kds-column-header { color: #38bdf8; }
.admin-kds .kds-column--ready .kds-column-header { color: #4ade80; }

.admin-kds .kds-column-body {
  flex: 1;
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  overflow-y: auto;
}

.admin-kds .kds-column-empty {
  text-align: center;
  color: rgba(255, 255, 255, 0.25);
  padding: var(--space-6);
  font-size: var(--font-size-2xl);
}

.admin-kds .kds-card {
  background: #1a1d26;
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  border-left: 4px solid transparent;
}

.admin-kds .kds-card--warning { border-left-color: #fbbf24; }
.admin-kds .kds-card--info { border-left-color: #38bdf8; }
.admin-kds .kds-card--success { border-left-color: #4ade80; }

.admin-kds .kds-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.admin-kds .kds-card-qty {
  font-size: var(--font-size-2xl);
  font-weight: 800;
  color: #fff;
}

.admin-kds .kds-card-time {
  font-size: var(--font-size-sm);
  color: rgba(255, 255, 255, 0.5);
  font-variant-numeric: tabular-nums;
}

.admin-kds .kds-card-title {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 var(--space-2);
  color: #fff;
}

.admin-kds .kds-card-meta {
  font-size: var(--font-size-sm);
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: var(--space-4);
}

.admin-kds .kds-action-btn {
  width: 100%;
  font-weight: 700;
  border-radius: var(--radius-md);
}

@media (max-width: 991.98px) {
  .admin-kds .kds-columns {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .admin-kds .kds-toolbar-clock {
    display: none;
  }
}

/* —— Cash timeline + semáforo (UI-3) —— */
.cash-session-visual {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-5);
  align-items: start;
  margin-bottom: var(--space-4);
}

@media (max-width: 767.98px) {
  .cash-session-visual {
    grid-template-columns: 1fr;
  }
}

.cash-timeline {
  position: relative;
  padding-left: var(--space-6);
}

.cash-timeline::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--brand-border);
}

.cash-timeline-step {
  position: relative;
  padding-bottom: var(--space-4);
}

.cash-timeline-step:last-child {
  padding-bottom: 0;
}

.cash-timeline-dot {
  position: absolute;
  left: calc(-1 * var(--space-6) + 4px);
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--brand-surface-elevated);
  border: 3px solid var(--brand-border);
}

.cash-timeline-step--done .cash-timeline-dot {
  border-color: var(--brand-success);
  background: var(--brand-success);
}

.cash-timeline-step--active .cash-timeline-dot {
  border-color: var(--brand-primary);
  background: var(--brand-primary);
  box-shadow: 0 0 0 4px var(--brand-primary-soft);
}

.cash-timeline-step--future .cash-timeline-dot {
  opacity: 0.5;
}

.cash-timeline-label {
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brand-text-muted);
  margin-bottom: 2px;
}

.cash-timeline-value {
  font-size: var(--font-size-sm);
  font-weight: 600;
}

.cash-arqueo-semaphore {
  text-align: center;
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  border: 2px solid var(--brand-border);
  min-width: 160px;
  background: var(--brand-surface);
}

.cash-arqueo-semaphore--ok {
  border-color: var(--brand-success);
  background: var(--brand-success-soft);
}

.cash-arqueo-semaphore--warn {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
}

.cash-arqueo-semaphore--alert {
  border-color: var(--brand-danger);
  background: rgba(239, 68, 68, 0.1);
}

.cash-arqueo-light {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin: 0 auto var(--space-3);
  background: var(--brand-border);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.15);
}

.cash-arqueo-semaphore--ok .cash-arqueo-light {
  background: var(--brand-success);
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.5);
}

.cash-arqueo-semaphore--warn .cash-arqueo-light {
  background: #f59e0b;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.45);
}

.cash-arqueo-semaphore--alert .cash-arqueo-light {
  background: var(--brand-danger);
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.45);
}

.cash-arqueo-label {
  font-size: var(--font-size-sm);
  font-weight: 700;
  margin-bottom: var(--space-1);
}

.cash-arqueo-hint {
  font-size: var(--font-size-xs);
  color: var(--brand-text-muted);
  margin: 0;
}

.cash-arqueo-modal-preview {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--brand-surface);
  border: 1px solid var(--brand-border);
  margin-bottom: var(--space-4);
}

.cash-arqueo-modal-preview .cash-arqueo-light {
  width: 36px;
  height: 36px;
  margin: 0;
  flex-shrink: 0;
}

.cash-arqueo-modal-preview.cash-arqueo-preview--ok {
  border-color: var(--brand-success);
  background: var(--brand-success-soft);
}

.cash-arqueo-modal-preview.cash-arqueo-preview--ok .cash-arqueo-light {
  background: var(--brand-success);
}

.cash-arqueo-modal-preview.cash-arqueo-preview--warn {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
}

.cash-arqueo-modal-preview.cash-arqueo-preview--warn .cash-arqueo-light {
  background: #f59e0b;
}

.cash-arqueo-modal-preview.cash-arqueo-preview--alert {
  border-color: var(--brand-danger);
  background: rgba(239, 68, 68, 0.1);
}

.cash-arqueo-modal-preview.cash-arqueo-preview--alert .cash-arqueo-light {
  background: var(--brand-danger);
}

/* —— Promociones wizard (UI-4) —— */
.promo-wizard-progress {
  height: 4px;
  background: var(--brand-border);
}

.promo-wizard-progress-bar {
  height: 100%;
  background: var(--brand-primary);
  transition: width var(--transition-normal);
}

.promo-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-3);
}

.promo-type-card {
  margin: 0;
  cursor: pointer;
}

.promo-type-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.promo-type-card-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  padding: var(--space-4);
  border: 2px solid var(--brand-border);
  border-radius: var(--radius-lg);
  background: var(--brand-surface-elevated);
  height: 100%;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.promo-type-card-inner i {
  font-size: 1.25rem;
  color: var(--brand-primary);
}

.promo-type-card-inner strong {
  font-size: var(--font-size-sm);
}

.promo-type-card-inner small {
  font-size: var(--font-size-xs);
  color: var(--brand-text-muted);
  line-height: 1.3;
}

.promo-type-card input:checked + .promo-type-card-inner {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-primary-soft);
}

.promo-type-card:hover .promo-type-card-inner {
  border-color: var(--brand-primary);
}

.promo-review-card {
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  background: var(--brand-surface);
}

.promo-review-dl {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: var(--space-2) var(--space-4);
}

.promo-review-dl dt {
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brand-text-muted);
  margin: 0;
}

.promo-review-dl dd {
  margin: 0;
}

.promo-wizard-footer {
  position: sticky;
  bottom: 0;
  background: var(--brand-surface-elevated);
  z-index: 2;
}

/* —— Design system page (UI-4) —— */
.ds-section {
  margin-bottom: var(--space-8);
}

.ds-section h2 {
  font-size: var(--font-size-xl);
  font-weight: 700;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--brand-border);
}

.ds-swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-3);
}

.ds-swatch {
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.ds-swatch-color {
  height: 56px;
}

.ds-swatch-label {
  padding: var(--space-2) var(--space-3);
  font-size: var(--font-size-xs);
  font-family: ui-monospace, monospace;
}

.ds-component-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  margin-bottom: var(--space-4);
}

/* —— Mobile / touch (UI-4) —— */
@media (max-width: 767.98px) {
  .admin-app .modal-footer .btn,
  .admin-app .page-header-actions .btn {
    min-height: 44px;
  }

  .promo-type-grid {
    grid-template-columns: 1fr 1fr;
  }

  .promo-review-dl {
    grid-template-columns: 1fr;
  }
}
