/* ══════════════════════════════════════════════════════════════
   EL OTRO BANDO — Admin Panel CSS
   Estética: Neo-brutalista sobrio · Dark sidebar · Clean content
   ══════════════════════════════════════════════════════════════ */

/* ─── Variables Admin ─────────────────────────────────────── */
:root {
  --admin-sidebar-w: 240px;
  --admin-header-h: 60px;
  --admin-bg: #F4F3F1;
  --admin-surface: #FFFFFF;
  --admin-sidebar-bg: #111111;
  --admin-sidebar-border: rgba(255,255,255,0.07);
  --admin-sidebar-hover: rgba(255,255,255,0.06);
  --admin-sidebar-active-bg: rgba(255,77,0,0.12);
  --admin-border: 2px solid #1A1A1A;
  --admin-border-light: 1px solid #E5E3E1;
  --admin-shadow: 3px 3px 0 #1A1A1A;
  --admin-shadow-sm: 2px 2px 0 #1A1A1A;
  --admin-radius: 0px;
  --admin-transition: 0.18s ease;
}

/* ─── Base ────────────────────────────────────────────────── */
* { box-sizing: border-box; }

body {
  font-family: var(--font-body, 'DM Sans', sans-serif);
  background: var(--admin-bg);
  color: #1A1A1A;
  margin: 0;
  /* Override reset.css que pone fondo oscuro */
  background-color: var(--admin-bg) !important;
}

/* ─── Overrides del reset.css global ─────────────────────── */
/* reset.css hace img/svg display:block — rompía iconos en botones */
.admin-layout svg,
.admin-login svg {
  display: inline;
  max-width: none;
  height: auto;
}
/* Botón dentro de layout admin: svg debe ser inline-flex */
.btn svg { display: inline; flex-shrink: 0; }

/* reset.css hace p { max-width: 72ch } — rompe tablas y layouts */
.admin-layout p,
.admin-content p {
  max-width: none;
}

/* reset.css hace h1-h6 line-height: 1.05 (muy comprimido para el admin) */
.admin-header__title {
  line-height: 1.2;
}

/* Asegurar que <a> dentro de .btn no hereden color extraño */
.btn { text-decoration: none; }
a.btn { display: inline-flex; }

/* ══════════════════════════════════════════════════════════════
   LOGIN
   ══════════════════════════════════════════════════════════════ */

.admin-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111111;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(255,77,0,0.04) 39px, rgba(255,77,0,0.04) 40px),
    repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(255,77,0,0.04) 39px, rgba(255,77,0,0.04) 40px);
}

.admin-login__card {
  width: 100%;
  max-width: 380px;
  background: #FFFFFF;
  border: var(--admin-border);
  box-shadow: 6px 6px 0 #FF4D00;
  padding: 2.5rem;
}

.admin-login__logo {
  font-family: var(--font-headline, 'Bricolage Grotesque', sans-serif);
  font-size: 1.75rem;
  font-weight: 900;
  text-transform: uppercase;
  text-align: center;
  letter-spacing: -0.02em;
  color: #111111;
  margin-bottom: 0.25rem;
}
.admin-login__logo span { color: #FF4D00; }

.admin-login__subtitle {
  text-align: center;
  font-size: 0.8125rem;
  color: #6B6965;
  margin-bottom: 2rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
}

.admin-login__error {
  background: rgba(239,68,68,0.08);
  border: 2px solid #EF4444;
  color: #DC2626;
  padding: 0.625rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
}

/* ══════════════════════════════════════════════════════════════
   LAYOUT PRINCIPAL
   ══════════════════════════════════════════════════════════════ */

/*  Flex row: sidebar a la izquierda, main a la derecha.
    El sidebar es sticky (no fixed) para que admin-main
    tome flex:1 naturalmente sin calcular anchos.           */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* ══════════════════════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════════════════════ */

.admin-sidebar {
  background: var(--admin-sidebar-bg);
  border-right: 1px solid #2A2A2A;
  display: flex;
  flex-direction: column;
  position: sticky;          /* Sticky: en el flujo, no saca al admin-main */
  top: 0;
  width: var(--admin-sidebar-w);
  height: 100vh;
  flex-shrink: 0;             /* No se encoje aunque el main sea ancho */
  z-index: 200;
  overflow: hidden;
}

.admin-sidebar__logo {
  padding: 1.25rem 1.5rem;
  font-family: var(--font-headline, 'Bricolage Grotesque', sans-serif);
  font-size: 1.1rem;
  font-weight: 900;
  color: #FFFFFF;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  text-decoration: none;
  border-bottom: 1px solid var(--admin-sidebar-border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.admin-sidebar__logo span { color: #FF4D00; }
.admin-sidebar__logo::before {
  content: '';
  display: block;
  width: 8px;
  height: 8px;
  background: #FF4D00;
  border-radius: 50%;
  flex-shrink: 0;
}

.admin-sidebar__nav {
  flex: 1;
  padding: 0.75rem 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #2A2A2A transparent;
}
.admin-sidebar__nav::-webkit-scrollbar { width: 4px; }
.admin-sidebar__nav::-webkit-scrollbar-track { background: transparent; }
.admin-sidebar__nav::-webkit-scrollbar-thumb { background: #2A2A2A; border-radius: 2px; }

/* Nav group labels */
.admin-nav__group-label {
  padding: 0.75rem 1.5rem 0.25rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #444444;
}

.admin-nav__link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5625rem 1.5rem;
  color: #999999;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--admin-transition);
  border-left: 3px solid transparent;
  position: relative;
}

.admin-nav__link:hover {
  color: #FFFFFF;
  background: var(--admin-sidebar-hover);
  border-left-color: #444444;
}

.admin-nav__link.is-active {
  color: #FF4D00;
  background: var(--admin-sidebar-active-bg);
  border-left-color: #FF4D00;
  font-weight: 600;
}

.admin-nav__link svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  opacity: 0.85;
}

.admin-sidebar__footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--admin-sidebar-border);
  flex-shrink: 0;
}

.admin-sidebar__user {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.5rem;
}
.admin-sidebar__avatar {
  width: 28px;
  height: 28px;
  background: #FF4D00;
  border: 2px solid #2A2A2A;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #FFF;
  flex-shrink: 0;
}
.admin-sidebar__username {
  font-size: 0.8125rem;
  color: #AAAAAA;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-sidebar__footer a {
  color: #555555;
  font-size: 0.75rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  transition: color var(--admin-transition);
}
.admin-sidebar__footer a:hover { color: #EF4444; }

/* ══════════════════════════════════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════════════════════════════════ */

.admin-main {
  flex: 1;                   /* Ocupa todo el ancho restante al sidebar */
  min-width: 0;              /* Evita overflow en flex children */
  background: var(--admin-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.admin-header {
  background: var(--admin-surface);
  border-bottom: var(--admin-border-light);
  padding: 0 1.5rem;
  height: var(--admin-header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 1rem;
}

.admin-header__left {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.admin-header__title {
  font-family: var(--font-headline, 'Bricolage Grotesque', sans-serif);
  font-size: 1.125rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.admin-header__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Hamburger button (mobile) */
.admin-hamburger {
  display: none;
  background: none;
  border: 2px solid #1A1A1A;
  width: 36px;
  height: 36px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
  flex-shrink: 0;
}
.admin-hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: #1A1A1A;
  transition: all var(--admin-transition);
}

/* Mobile overlay */
.admin-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 150;
  cursor: pointer;
}
.admin-overlay.is-visible { display: block; }

.admin-content {
  padding: 1.5rem;
  flex: 1;              /* crece para llenar el alto disponible */
  min-width: 0;         /* evita overflow en flex children */
  /* width y box-sizing NO se especifican: el browser los calcula correctamente */
}

/* ══════════════════════════════════════════════════════════════
   ALERTS / MESSAGES
   ══════════════════════════════════════════════════════════════ */

.admin-alert {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
  border: 2px solid;
}
.admin-alert--success {
  background: rgba(34,197,94,0.08);
  border-color: #22C55E;
  color: #15803D;
}
.admin-alert--error {
  background: rgba(239,68,68,0.08);
  border-color: #EF4444;
  color: #DC2626;
}
.admin-alert--warning {
  background: rgba(245,158,11,0.08);
  border-color: #F59E0B;
  color: #B45309;
}

/* ══════════════════════════════════════════════════════════════
   STAT CARDS
   ══════════════════════════════════════════════════════════════ */

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--admin-surface);
  border: var(--admin-border);
  box-shadow: var(--admin-shadow-sm);
  padding: 1.25rem;
  position: relative;
  transition: transform var(--admin-transition), box-shadow var(--admin-transition);
}
.stat-card:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--admin-shadow);
}

.stat-card__icon {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  display: block;
}

.stat-card__label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6B6965;
  margin-bottom: 0.375rem;
}

.stat-card__value {
  font-family: var(--font-headline, 'Bricolage Grotesque', sans-serif);
  font-size: 1.75rem;
  font-weight: 900;
  line-height: 1;
  color: #111111;
}
.stat-card__value--accent { color: #FF4D00; }
.stat-card__value--success { color: #22C55E; }
.stat-card__value--error { color: #EF4444; }

.stat-card__sub {
  font-size: 0.75rem;
  color: #9C9895;
  margin-top: 0.375rem;
}

/* ══════════════════════════════════════════════════════════════
   TABLES
   ══════════════════════════════════════════════════════════════ */

.admin-table-wrap {
  background: var(--admin-surface);
  border: var(--admin-border);
  box-shadow: var(--admin-shadow-sm);
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6B6965;
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: var(--admin-border);
  background: #F8F7F5;
  white-space: nowrap;
}

.admin-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #EEECE9;
  font-size: 0.875rem;
  vertical-align: middle;
}

.admin-table tbody tr:last-child td { border-bottom: none; }

.admin-table tbody tr {
  transition: background var(--admin-transition);
}
.admin-table tbody tr:hover { background: #FAFAF8; }

/* Zebra */
.admin-table--zebra tbody tr:nth-child(even) { background: #FAFAF8; }

/* ══════════════════════════════════════════════════════════════
   STATUS BADGES
   ══════════════════════════════════════════════════════════════ */

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1875rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 2px solid;
  white-space: nowrap;
}

.status-badge--pendiente   { color: #B45309; border-color: #F59E0B; background: rgba(245,158,11,0.1); }
.status-badge--confirmado  { color: #15803D; border-color: #22C55E; background: rgba(34,197,94,0.1);  }
.status-badge--preparando  { color: #1D4ED8; border-color: #3B82F6; background: rgba(59,130,246,0.1); }
.status-badge--en_camino   { color: #6D28D9; border-color: #8B5CF6; background: rgba(139,92,246,0.1); }
.status-badge--entregado   { color: #15803D; border-color: #22C55E; background: rgba(34,197,94,0.1);  }
.status-badge--cancelado   { color: #B91C1C; border-color: #EF4444; background: rgba(239,68,68,0.1);  }

/* ══════════════════════════════════════════════════════════════
   FORMS
   ══════════════════════════════════════════════════════════════ */

.admin-form {
  background: var(--admin-surface);
  border: var(--admin-border);
  box-shadow: var(--admin-shadow-sm);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;          /* espacio automático entre form-group / admin-form__row */
  margin-bottom: 1.25rem;
}

/* Eliminar el margin-bottom en el último admin-form de la página */
.admin-form:last-child { margin-bottom: 0; }

/* admin-stats también necesita separación */
.admin-stats { margin-bottom: 1.25rem; }

/* Separación para tablas standalone */
.admin-table-wrap { margin-bottom: 1.25rem; }
.admin-table-wrap:last-child { margin-bottom: 0; }

.admin-form__title {
  font-family: var(--font-headline, 'Bricolage Grotesque', sans-serif);
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0 0 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: var(--admin-border);
}

.admin-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

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

.admin-form__actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: var(--admin-border-light);
  flex-wrap: wrap;
}

/* ─── Form controls ────────────────────────────────────────── */

.form-group { display: flex; flex-direction: column; gap: 0.375rem; }

.form-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #3D3B38;
}

.form-hint {
  font-size: 0.75rem;
  color: #9C9895;
  margin-top: 0.25rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  border: 2px solid #1A1A1A;
  background: #FFFFFF;
  padding: 0.5rem 0.75rem;
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size: 0.875rem;
  color: #111111;
  outline: none;
  transition: box-shadow var(--admin-transition);
  appearance: none;
  border-radius: 0;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  box-shadow: 3px 3px 0 #FF4D00;
  border-color: #FF4D00;
}

.form-input::placeholder { color: #B5B3B0; }

.form-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%231A1A1A' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
}

.form-textarea { resize: vertical; min-height: 80px; }

/* Checkbox custom */
.form-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
}
.form-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  border: 2px solid #1A1A1A;
  appearance: none;
  background: #FFF;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: all var(--admin-transition);
}
.form-checkbox input[type="checkbox"]:checked {
  background: #FF4D00;
  border-color: #FF4D00;
}
.form-checkbox input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  inset: 2px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 8'%3E%3Cpath d='M1 4l3 3 5-6' stroke='%23fff' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
}
.form-checkbox__label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #2D2B28;
}

/* ══════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 1.125rem;
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid #1A1A1A;
  cursor: pointer;
  transition: all var(--admin-transition);
  box-shadow: var(--admin-shadow-sm);
  white-space: nowrap;
  position: relative;
}

.btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 #1A1A1A;
}
.btn:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #1A1A1A;
}

.btn-primary {
  background: #FF4D00;
  color: #FFFFFF;
  border-color: #1A1A1A;
}

.btn-secondary {
  background: #FFFFFF;
  color: #1A1A1A;
  border-color: #1A1A1A;
}

.btn-danger {
  background: #FFFFFF;
  color: #EF4444;
  border-color: #EF4444;
}
.btn-danger:hover { box-shadow: 3px 3px 0 #EF4444; }
.btn-danger:active { box-shadow: 1px 1px 0 #EF4444; }

.btn-success {
  background: #22C55E;
  color: #FFFFFF;
  border-color: #1A1A1A;
}

.btn-sm {
  padding: 0.3125rem 0.75rem;
  font-size: 0.8125rem;
  box-shadow: 2px 2px 0 #1A1A1A;
}
.btn-sm:hover { box-shadow: 3px 3px 0 #1A1A1A; }

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

.btn-block { width: 100%; }

.btn-icon {
  padding: 0.375rem;
  line-height: 1;
}

/* ══════════════════════════════════════════════════════════════
   PAGE HEADER UTILITY
   ══════════════════════════════════════════════════════════════ */

.admin-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.admin-page-header__title {
  font-family: var(--font-headline, 'Bricolage Grotesque', sans-serif);
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  margin: 0;
}
.admin-page-header__meta {
  font-size: 0.8125rem;
  color: #9C9895;
}

/* ══════════════════════════════════════════════════════════════
   FILTER PILLS
   ══════════════════════════════════════════════════════════════ */

.admin-filters {
  display: flex;
  flex-direction: row;       /* fuerza fila — previene el stacking */
  flex-wrap: wrap;
  gap: 0.375rem 0.5rem;
  margin-bottom: 1.25rem;
  align-items: center;
  overflow-x: visible;
}

.filter-label {
  display: inline;           /* nunca block */
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9C9895;
  margin-right: 0.25rem;
  flex-shrink: 0;
  white-space: nowrap;
}

/* ══════════════════════════════════════════════════════════════
   EMPTY STATE
   ══════════════════════════════════════════════════════════════ */

.admin-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  color: #9C9895;
}
.admin-empty__icon { font-size: 2.5rem; display: block; margin-bottom: 0.75rem; }
.admin-empty__text { font-size: 0.9375rem; font-weight: 500; }

/* ══════════════════════════════════════════════════════════════
   SECTIONS / SEPARATORS
   ══════════════════════════════════════════════════════════════ */

.admin-section-title {
  font-family: var(--font-headline, 'Bricolage Grotesque', sans-serif);
  font-size: 0.9375rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 1.5rem 0 0.875rem;
  color: #111111;
}

/* ══════════════════════════════════════════════════════════════
   CONTABILIDAD — BAR CHART
   ══════════════════════════════════════════════════════════════ */

.chart-bars {
  display: flex;
  gap: 3px;
  align-items: flex-end;
  height: 140px;
  padding: 0.5rem 0;
}

.chart-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: default;
  position: relative;
}

.chart-bar-col:hover .chart-tooltip {
  opacity: 1;
  transform: translateY(-4px);
}

.chart-bar {
  width: 100%;
  background: linear-gradient(180deg, #FF4D00 0%, #CC3D00 100%);
  min-height: 4px;
  transition: opacity var(--admin-transition);
  position: relative;
}
.chart-bar-col:hover .chart-bar { opacity: 0.85; }

.chart-bar-label {
  font-size: 9px;
  color: #9C9895;
  font-weight: 500;
  text-align: center;
}

.chart-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: #111111;
  color: #FFF;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: all var(--admin-transition);
  z-index: 10;
}

/* ══════════════════════════════════════════════════════════════
   PEDIDO NUEVO — AJAX PRODUCT SEARCH
   ══════════════════════════════════════════════════════════════ */

.product-search-wrap {
  position: relative;
}

.product-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #FFFFFF;
  border: 2px solid #1A1A1A;
  border-top: none;
  z-index: 50;
  max-height: 280px;
  overflow-y: auto;
  display: none;
  box-shadow: 3px 3px 0 #1A1A1A;
}
.product-search-results.is-open { display: block; }

.product-search-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  cursor: pointer;
  border-bottom: 1px solid #EEECE9;
  transition: background var(--admin-transition);
  font-size: 0.875rem;
}
.product-search-item:last-child { border-bottom: none; }
.product-search-item:hover { background: #FAFAF8; }
.product-search-item__name { font-weight: 600; flex: 1; }
.product-search-item__cat  { font-size: 0.75rem; color: #9C9895; }
.product-search-item__price { font-weight: 700; color: #FF4D00; white-space: nowrap; }

/* Cart de items del pedido nuevo */
.pedido-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.pedido-item-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 0.5rem;
  align-items: center;
  background: #F8F7F5;
  border: 2px solid #1A1A1A;
  padding: 0.625rem 0.875rem;
}

.pedido-item-row__name { font-weight: 600; font-size: 0.875rem; }
.pedido-item-row__price { font-size: 0.875rem; color: #FF4D00; font-weight: 700; white-space: nowrap; }

.qty-control {
  display: flex;
  align-items: center;
  gap: 0;
}
.qty-control button {
  width: 28px;
  height: 28px;
  border: 2px solid #1A1A1A;
  background: #FFF;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background var(--admin-transition);
}
.qty-control button:hover { background: #FF4D00; color: #FFF; border-color: #FF4D00; }
.qty-control input {
  width: 40px;
  height: 28px;
  border: 2px solid #1A1A1A;
  border-left: none;
  border-right: none;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0;
}
.qty-control input:focus { outline: none; }

/* Totals summary */
.pedido-totals {
  background: #111111;
  color: #FFF;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.pedido-totals__row {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
}
.pedido-totals__row--total {
  font-family: var(--font-headline, sans-serif);
  font-size: 1.25rem;
  font-weight: 900;
  border-top: 1px solid #2A2A2A;
  padding-top: 0.5rem;
  margin-top: 0.25rem;
  color: #FF4D00;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE MOBILE
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 1023px) {
  .admin-stats { grid-template-columns: repeat(3, 1fr); }
  .admin-form__row { grid-template-columns: 1fr; }
  .admin-form__row--3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 767px) {
  /* En mobile el sidebar pasa a fixed para el efecto overlay deslizante */
  .admin-sidebar {
    position: fixed;
    left: 0;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .admin-sidebar.is-open { transform: translateX(0); }

  /* Al sacar el sidebar del flujo flex, admin-main toma todo el ancho */

  .admin-hamburger { display: flex; }

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

  .admin-content { padding: 1rem; }

  .pedido-item-row { grid-template-columns: 1fr auto auto; }

  .admin-content > div[style*="grid-template-columns"] {
    display: block !important;
  }
}

@media (max-width: 479px) {
  .admin-stats { grid-template-columns: 1fr 1fr; }
  .admin-header { padding: 0 1rem; }
  .admin-filters { gap: 0.25rem; }
}

/* ──────────────────────────────
   UTILITY MICRO-CLASSES
   ────────────────────────────── */

/* Alta especificidad para .btn — previene override de reset.css o components.css */
.admin-layout .btn,
.admin-login .btn {
  display: inline-flex !important;
  align-items: center;
  white-space: nowrap;
  text-decoration: none;
}

/* SVGs inline dentro de botones del admin */
.admin-layout .btn svg,
.admin-layout .btn img,
.admin-layout td svg,
.admin-layout .admin-nav__link svg {
  display: inline-block;
  flex-shrink: 0;
  vertical-align: middle;
}

/* Overflow protection — solo en las tablas, NO en el contenedor principal */
.admin-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Texto truncado en celdas largas */
.admin-table td {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Pero no en la columna de acciones */
.admin-table td:last-child {
  max-width: none;
  overflow: visible;
}

.admin-table__slug {
  font-size: 0.8125rem;
  color: #9C9895;
  font-family: monospace;
}

.admin-table__actions {
  display: flex;
  gap: 0.375rem;
  align-items: center;
}

