/* ═══════════════════════════════════════════════════════════════
   Comercial Alpaca S.A. — Sistema de Ventas — v2.0
   Diseño corporativo, sobrio y responsivo.
   ═══════════════════════════════════════════════════════════════ */

/* ─── Variables ─────────────────────────────────────────────────── */
:root {
  --navy:        #0d1e2e;
  --navy-mid:    #1a3557;
  --blue:        #1b5ea7;
  --blue-hover:  #154d8f;
  --blue-light:  #e8f0fb;
  --danger:      #b83230;
  --success:     #1a7a42;
  --warning:     #b06000;
  --bg:          #f3f5f8;
  --surface:     #ffffff;
  --border:      #d4d9e2;
  --border-lt:   #e8ecf1;
  --muted-bg:    #f7f8fa;
  --text:        #1e2531;
  --muted:       #6b7788;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.06);
  --shadow:      0 3px 8px rgba(0,0,0,.10);
  --radius:      4px;
  --radius-md:   6px;
  --trans:       .14s ease;
}

/* ─── Reset ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font: inherit; }
input, select, textarea { font: inherit; }

/* ─── Tipografía ─────────────────────────────────────────────────── */
h1 { font-size: 1.45rem; font-weight: 700; letter-spacing: -.15px; }
h2 { font-size: 1.2rem;  font-weight: 700; }
h3 { font-size: 1rem;    font-weight: 600; }

/* ═══ NAVBAR ═══════════════════════════════════════════════════════ */
.navbar {
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.navbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.navbar-brand {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 1.8px;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.navbar-brand span { color: rgba(255,255,255,.38); font-weight: 400; }
.navbar-brand:hover { text-decoration: none; }

/* Links desktop */
.navbar-links {
  display: flex;
  align-items: stretch;
  height: 52px;
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.navbar-links::-webkit-scrollbar { display: none; }

.navbar-links a {
  color: rgba(255,255,255,.6);
  padding: 0 .85rem;
  font-size: .805rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  transition: color var(--trans), background var(--trans);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  letter-spacing: .15px;
}

.navbar-links a:hover { color: #fff; background: rgba(255,255,255,.06); text-decoration: none; }
.navbar-links a.active {
  color: #fff;
  border-bottom-color: rgba(255,255,255,.5);
  background: rgba(255,255,255,.06);
}

/* Right section */
.navbar-right {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-left: auto;
  flex-shrink: 0;
}

.navbar-user {
  font-size: .76rem;
  color: rgba(255,255,255,.45);
  white-space: nowrap;
  display: none;
}
@media (min-width: 900px) { .navbar-user { display: block; } }

.btn-logout {
  background: transparent;
  border: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.65);
  padding: .28rem .75rem;
  border-radius: var(--radius);
  font-size: .775rem;
  font-weight: 500;
  transition: all var(--trans);
}
.btn-logout:hover { background: rgba(255,255,255,.1); color: #fff; }

.cart-nav-btn {
  display: flex;
  align-items: center;
  gap: .4rem;
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.14);
  color: rgba(255,255,255,.85);
  padding: .28rem .7rem;
  border-radius: var(--radius);
  font-size: .78rem;
  font-weight: 600;
  transition: all var(--trans);
  text-decoration: none;
}
.cart-nav-btn:hover { background: rgba(255,255,255,.16); color: #fff; text-decoration: none; }

.cart-badge {
  background: #d97706;
  color: #fff;
  border-radius: 3px;
  padding: 0 .32rem;
  font-size: .67rem;
  font-weight: 700;
  min-width: 16px;
  text-align: center;
}

/* Hamburger button */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: .5rem;
  background: transparent;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: rgba(255,255,255,.75);
  border-radius: 1px;
  transition: all var(--trans);
}

/* Mobile / tablet nav — colapsa a hamburguesa cuando hay poco ancho
   (con 7 links de admin, en fila se cortaban los últimos) */
@media (max-width: 1024px) {
  .nav-toggle { display: flex; }

  .navbar-links {
    position: fixed;
    top: 52px;
    left: 0; right: 0;
    background: var(--navy);
    flex-direction: column;
    height: auto;
    padding: .5rem 0 .75rem;
    border-top: 1px solid rgba(255,255,255,.07);
    display: none;
    box-shadow: 0 10px 30px rgba(0,0,0,.35);
    z-index: 99;
    max-height: calc(100vh - 52px);
    overflow-y: auto;
  }
  .navbar-links.open { display: flex; }

  .navbar-links a {
    height: 46px;
    padding: 0 1.5rem;
    border-bottom: none;
    border-left: 2px solid transparent;
    font-size: .875rem;
  }
  .navbar-links a.active {
    border-left-color: rgba(255,255,255,.5);
    border-bottom: none;
    background: rgba(255,255,255,.06);
  }
}

/* ═══ LAYOUT ════════════════════════════════════════════════════════ */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
}

@media (max-width: 480px) {
  .container { padding: 1rem .9rem; }
}

.page-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.page-header h1 { flex: 1; }

/* ═══ BUTTONS ══════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .44rem 1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: .815rem;
  transition: all var(--trans);
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: .1px;
  line-height: 1.45;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary  { background: var(--blue);    color: #fff; border-color: var(--blue); }
.btn-primary:hover:not(:disabled)  { background: var(--blue-hover); border-color: var(--blue-hover); }

.btn-success  { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover:not(:disabled)  { background: #155e35; border-color: #155e35; }

.btn-danger   { background: var(--danger);  color: #fff; border-color: var(--danger); }
.btn-danger:hover:not(:disabled)   { background: #9a2020; border-color: #9a2020; }

.btn-warning  { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-warning:hover:not(:disabled)  { background: #8e4d00; border-color: #8e4d00; }

.btn-outline  { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover:not(:disabled)  { background: var(--muted-bg); border-color: var(--muted); }

.btn-sm    { padding: .28rem .62rem; font-size: .77rem; }
.btn-lg    { padding: .58rem 1.4rem; font-size: .9rem; }
.btn-block { width: 100%; justify-content: center; }

/* ═══ FORMS ════════════════════════════════════════════════════════ */
.form-group { margin-bottom: .9rem; }

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: .28rem;
  font-size: .775rem;
  text-transform: uppercase;
  letter-spacing: .45px;
  color: var(--muted);
}

.form-control {
  width: 100%;
  padding: .44rem .72rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--trans), box-shadow var(--trans);
  font-size: .875rem;
}
.form-control:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(27,94,167,.1);
}
.form-control.error { border-color: var(--danger); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

.form-row { display: grid; gap: .9rem; }
@media (min-width: 600px) {
  .form-row.cols-2 { grid-template-columns: 1fr 1fr; }
  .form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
}

/* ═══ CARDS ════════════════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.card-header {
  padding: .85rem 1.2rem;
  border-bottom: 1px solid var(--border);
  background: var(--muted-bg);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}

.card-body   { padding: 1.2rem; }

.card-footer {
  padding: .8rem 1.2rem;
  border-top: 1px solid var(--border);
  background: var(--muted-bg);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

/* ═══ TABLES ═══════════════════════════════════════════════════════ */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .845rem;
}

.table th {
  background: var(--muted-bg);
  color: var(--muted);
  font-weight: 700;
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: .6rem .9rem;
  text-align: left;
  white-space: nowrap;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: .58rem .9rem;
  border-bottom: 1px solid var(--border-lt);
  vertical-align: middle;
}

.table tr:hover td { background: #f9fafb; }
.table tr:last-child td { border-bottom: none; }

/* ═══ BADGES ═══════════════════════════════════════════════════════ */
.badge {
  display: inline-block;
  padding: .14rem .5rem;
  border-radius: 3px;
  font-size: .71rem;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
}

.badge-primary { background: #ddeef9; color: #1b5ea7; }
.badge-success { background: #e0f3e8; color: #1a7a42; }
.badge-warning { background: #fef2de; color: #b06000; }
.badge-danger  { background: #fce8e7; color: #b83230; }
.badge-gray    { background: #ebeef3; color: #5a6478; }
.badge-agotado { background: #fce8e7; color: #b83230; font-size: .7rem; padding: .12rem .45rem; }

/* ═══ CATALOG LAYOUT ════════════════════════════════════════════════ */
.catalogo-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 768px) {
  .catalogo-layout { grid-template-columns: 210px 1fr; }
}

.filtros-panel {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 1rem;
  height: fit-content;
  position: sticky;
  top: 62px;
}

.filtros-panel h3 {
  margin-bottom: .8rem;
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--muted);
  font-weight: 700;
}

.filtros-panel .form-group { margin-bottom: .65rem; }
.filtros-panel label { font-size: .74rem; }

@media (max-width: 767px) {
  .filtros-panel { position: static; }
}

/* ═══ PRODUCT GRID ══════════════════════════════════════════════════ */
.productos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: .875rem;
}
@media (max-width: 480px) {
  .productos-grid { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
}
@media (min-width: 1200px) {
  .productos-grid { grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); }
}

/* ═══ PRODUCT CARD ══════════════════════════════════════════════════ */
.producto-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--trans), transform var(--trans);
}
.producto-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.producto-card.agotado { opacity: .68; }

/* Carousel */
.carousel {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--bg);
  overflow: hidden;
}
.carousel-img { width: 100%; height: 100%; object-fit: contain; transition: opacity .2s; }
.carousel-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  color: var(--border);
  font-size: 1.2rem; font-weight: 800; letter-spacing: 2px;
}
.carousel-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(13,30,46,.6); color: #fff; border: none;
  width: 25px; height: 25px; border-radius: 3px;
  font-size: .85rem; display: flex; align-items: center; justify-content: center;
  cursor: pointer; opacity: 0; transition: opacity var(--trans);
}
.carousel:hover .carousel-btn { opacity: 1; }
.carousel-btn.prev { left: 5px; }
.carousel-btn.next { right: 5px; }
.carousel-dots {
  position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 3px;
}
.carousel-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: rgba(255,255,255,.4); transition: background var(--trans);
}
.carousel-dot.active { background: #fff; }
.agotado-overlay { position: absolute; top: 8px; right: 8px; }

.producto-info {
  padding: .75rem .8rem;
  display: flex; flex-direction: column; gap: .22rem; flex: 1;
}
.producto-codigo {
  font-size: .67rem; color: var(--muted); font-weight: 600;
  letter-spacing: .6px; text-transform: uppercase;
}
.producto-nombre { font-size: .855rem; font-weight: 600; color: var(--text); line-height: 1.3; }
.producto-marca  { font-size: .68rem; color: var(--blue); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.producto-bulto  { font-size: .68rem; color: var(--muted); }
.producto-precio { font-size: 1.08rem; font-weight: 700; color: var(--text); margin-top: .3rem; }
.producto-iva    { font-size: .67rem; color: var(--muted); }

.producto-add {
  padding: .6rem .8rem;
  border-top: 1px solid var(--border);
  display: flex; gap: .4rem; align-items: center;
  background: var(--muted-bg);
}
.qty-input {
  width: 52px; padding: .3rem .38rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  text-align: center; font-size: .815rem; font-weight: 600;
}
.qty-input:focus { outline: none; border-color: var(--blue); }
.btn-agregar {
  flex: 1; background: var(--blue); color: #fff;
  border: none; border-radius: var(--radius);
  padding: .33rem .5rem; font-size: .775rem; font-weight: 600;
  transition: background var(--trans); letter-spacing: .15px;
}
.btn-agregar:hover:not(:disabled) { background: var(--blue-hover); }
.btn-agregar:disabled { background: #a0aab8; cursor: not-allowed; }

/* ═══ CART FAB ══════════════════════════════════════════════════════ */
.cart-fab {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  background: var(--navy); color: #fff; border: none;
  border-radius: var(--radius-md); padding: .65rem 1.15rem;
  font-size: .83rem; font-weight: 600;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
  display: flex; align-items: center; gap: .5rem;
  cursor: pointer; z-index: 50;
  transition: transform var(--trans), box-shadow var(--trans);
  text-decoration: none; letter-spacing: .2px;
}
.cart-fab:hover {
  transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.3);
  color: #fff; text-decoration: none;
}
.cart-fab-badge {
  background: #d97706; border-radius: 3px;
  padding: 0 .38rem; font-size: .68rem; min-width: 17px;
  text-align: center; font-weight: 700;
}

/* ═══ SEARCH BAR ════════════════════════════════════════════════════ */
.search-bar { display: flex; gap: .5rem; margin-bottom: 1rem; }
.search-bar input {
  flex: 1; padding: .48rem .78rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: .875rem; background: var(--surface); color: var(--text);
}
.search-bar input:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(27,94,167,.09);
}

/* ═══ MODAL ═════════════════════════════════════════════════════════ */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.38); z-index: 200;
  align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface); border-radius: var(--radius-md);
  max-width: 640px; width: 100%; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0,0,0,.2);
  animation: modalIn .17s ease;
}
@keyframes modalIn {
  from { transform: translateY(14px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.modal-lg { max-width: 860px; }

.modal-header {
  padding: .9rem 1.4rem; border-bottom: 1px solid var(--border);
  background: var(--muted-bg);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h2 { font-size: .97rem; font-weight: 700; }
.modal-close {
  background: none; border: none; font-size: 1.25rem;
  color: var(--muted); line-height: 1; padding: 0 .2rem;
  transition: color var(--trans);
}
.modal-close:hover { color: var(--danger); }
.modal-body { padding: 1.4rem; }
.modal-footer {
  padding: .85rem 1.4rem; border-top: 1px solid var(--border);
  background: var(--muted-bg);
  display: flex; gap: .7rem; justify-content: flex-end; flex-wrap: wrap;
}

/* ═══ ALERTS / TOAST ════════════════════════════════════════════════ */
.alert {
  padding: .68rem 1rem; border-radius: var(--radius);
  font-size: .845rem; margin-bottom: 1rem;
  border-left: 3px solid; display: flex; align-items: center; gap: .5rem;
}
.alert-success { background: #f0faf3; color: var(--success); border-color: var(--success); }
.alert-danger  { background: #fef5f4; color: var(--danger);  border-color: var(--danger); }
.alert-warning { background: #fffbf0; color: var(--warning); border-color: var(--warning); }
.alert-info    { background: #f0f6ff; color: var(--blue);    border-color: var(--blue); }

.toast-container {
  position: fixed; top: 62px; right: 1rem; z-index: 9999;
  display: flex; flex-direction: column; gap: .45rem;
  max-width: 310px; pointer-events: none;
}
.toast {
  background: var(--navy); color: #fff;
  padding: .65rem 1rem; border-radius: var(--radius-md);
  font-size: .825rem; box-shadow: var(--shadow);
  animation: slideIn .2s ease;
  display: flex; align-items: center; gap: .45rem;
  pointer-events: auto;
}
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
.toast.warning { background: var(--warning); }
@keyframes slideIn {
  from { transform: translateX(110%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ═══ LOADING ═══════════════════════════════════════════════════════ */
.loading {
  display: flex; align-items: center; justify-content: center;
  padding: 3rem; color: var(--muted); gap: .7rem; font-size: .875rem;
}
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border); border-top-color: var(--blue);
  border-radius: 50%; animation: spin .65s linear infinite; flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { text-align: center; padding: 3rem; color: var(--muted); font-size: .875rem; }

/* ═══ CART PAGE ══════════════════════════════════════════════════════ */
.carrito-layout { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
@media (min-width: 900px) { .carrito-layout { grid-template-columns: 1fr 360px; } }

.carrito-items-list { display: flex; flex-direction: column; gap: .55rem; }

.carrito-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: .75rem .95rem;
  display: grid; grid-template-columns: auto 1fr auto;
  gap: .75rem; align-items: center;
}
.carrito-item-img {
  width: 54px; height: 54px; object-fit: contain;
  border-radius: var(--radius); background: var(--bg);
}
.carrito-item-info  { min-width: 0; }
.carrito-item-nombre { font-weight: 600; font-size: .875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.carrito-item-codigo { font-size: .71rem; color: var(--muted); margin-top: .08rem; }
.carrito-item-precio { font-size: .9rem; font-weight: 700; color: var(--text); }
.carrito-item-actions { display: flex; align-items: center; gap: .4rem; }
.carrito-qty  { width: 52px; text-align: center; padding: .27rem .38rem; border: 1px solid var(--border); border-radius: var(--radius); font-weight: 600; font-size: .84rem; }
.carrito-dcto { width: 60px; text-align: center; padding: .27rem .38rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: .81rem; }
.btn-remove   { background: none; border: none; color: var(--muted); font-size: 1.1rem; padding: .18rem; transition: color var(--trans); }
.btn-remove:hover { color: var(--danger); }

/* Buscador rápido en carrito */
.prod-search-bar {
  display: flex; gap: .5rem; align-items: center;
}
.prod-search-bar .form-control { flex: 1; }
.prod-search-results {
  position: relative; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  margin-top: .3rem; max-height: 280px; overflow-y: auto;
  display: none; z-index: 100;
  box-shadow: var(--shadow);
}
.prod-search-item {
  display: grid; grid-template-columns: 90px 1fr auto;
  gap: .5rem; align-items: center;
  padding: .5rem .75rem; cursor: pointer;
  border-bottom: 1px solid var(--border-lt);
  font-size: .84rem; transition: background var(--trans);
}
.prod-search-item:last-child { border-bottom: none; }
.prod-search-item:hover { background: var(--blue-light); }
.prod-search-item.prod-search-empty { cursor: default; color: var(--muted); grid-template-columns: 1fr; }
.prod-search-code  { font-weight: 700; color: var(--navy); font-size: .78rem; }
.prod-search-name  { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prod-search-price { font-weight: 700; color: var(--blue); white-space: nowrap; }

.resumen-card { position: sticky; top: 62px; }
.resumen-linea {
  display: flex; justify-content: space-between;
  padding: .4rem 0; font-size: .875rem;
  border-bottom: 1px solid var(--border-lt);
}
.resumen-linea:last-child { border-bottom: none; }
.resumen-total {
  display: flex; justify-content: space-between;
  padding: .7rem 0 .2rem; font-size: 1.1rem; font-weight: 700; color: var(--text);
}

/* ═══ DRAG & DROP IMPORT ════════════════════════════════════════════ */
.drop-zone {
  border: 2px dashed var(--border); border-radius: var(--radius-md);
  padding: 3rem 2rem; text-align: center; cursor: pointer;
  transition: background var(--trans), border-color var(--trans);
  background: var(--muted-bg);
}
.drop-zone:hover, .drop-zone.dragover { background: var(--blue-light); border-color: var(--blue); }
.drop-zone p { color: var(--muted); font-size: .875rem; }
.drop-zone strong { color: var(--blue); }

/* ═══ STATS / CHARTS ════════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: .875rem; margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--surface); border-radius: var(--radius-md);
  padding: 1.1rem 1.2rem; border: 1px solid var(--border);
  box-shadow: var(--shadow-sm); border-top: 3px solid var(--blue);
}
.stat-card .label { font-size: .71rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin-bottom: .35rem; }
.stat-card .valor { font-size: 1.45rem; font-weight: 700; color: var(--text); }
.stat-card .subvalor { font-size: .76rem; color: var(--muted); margin-top: .18rem; }

.charts-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 900px) { .charts-grid { grid-template-columns: 1fr 1fr; } }

.chart-card {
  background: var(--surface); border-radius: var(--radius-md);
  border: 1px solid var(--border); padding: 1.2rem; box-shadow: var(--shadow-sm);
}
.chart-card h3 { margin-bottom: 1rem; font-size: .78rem; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; }

/* ═══ ADMIN IMAGES ══════════════════════════════════════════════════ */
.imagenes-grid { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.imagen-thumb {
  position: relative; width: 76px; height: 76px;
  border-radius: var(--radius); overflow: hidden; border: 2px solid var(--border);
}
.imagen-thumb img { width: 100%; height: 100%; object-fit: cover; }
.imagen-thumb.principal { border-color: var(--success); }
.imagen-thumb .del-btn {
  position: absolute; top: 2px; right: 2px;
  background: rgba(184,50,48,.88); color: #fff; border: none;
  width: 17px; height: 17px; border-radius: 2px;
  font-size: .6rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.principal-badge {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(26,122,66,.88); color: #fff;
  font-size: .58rem; text-align: center; padding: 1px;
  font-weight: 700; letter-spacing: .3px; text-transform: uppercase;
}

/* ═══ LOGIN PAGE ════════════════════════════════════════════════════ */
.login-page {
  min-height: 100vh; display: flex; align-items: center;
  justify-content: center; background: var(--navy); padding: 1rem;
}
.login-card {
  background: var(--surface); border-radius: var(--radius-md);
  padding: 2.5rem 2rem; max-width: 380px; width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.login-logo {
  text-align: center; margin-bottom: 2rem; padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.login-logo h1 {
  font-size: 2rem; color: var(--navy);
  letter-spacing: 3.5px; font-weight: 900;
}
.login-logo p { color: var(--muted); font-size: .8rem; margin-top: .3rem; letter-spacing: .15px; }
.login-error {
  background: #fef5f4; color: var(--danger);
  border-radius: var(--radius); border-left: 3px solid var(--danger);
  padding: .58rem .9rem; font-size: .845rem; margin-bottom: 1rem; display: none;
}

/* ═══ UTILITIES ═════════════════════════════════════════════════════ */
.text-right  { text-align: right; }
.text-center { text-align: center; }
.text-muted  { color: var(--muted); }
.font-bold   { font-weight: 700; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.d-flex       { display: flex; }
.gap-1        { gap: .5rem; }
.gap-2        { gap: 1rem; }
.align-center { align-items: center; }
.flex-wrap    { flex-wrap: wrap; }
.flex-1       { flex: 1; }
.hidden       { display: none !important; }
.w-100        { width: 100%; }

/* Estado colors */
.estado-Borrador               { color: var(--muted); }
.estado-Confirmado             { color: var(--blue); }
.estado-Enviado-a-administración { color: var(--warning); }
.estado-Cerrado                { color: var(--success); }

.badge-estado-Borrador  { background:#ebeef3; color:#5a6478; }
.badge-estado-Pendiente { background:#fef2de; color:#b06000; }
.badge-estado-Aprobado  { background:#e0f3e8; color:#1a7a42; }
.badge-estado-Rechazado { background:#fbe3e2; color:#b83230; }
.badge-estado-Cerrado   { background:#ddeef9; color:#1b5ea7; }

/* ═══ CATEGORY CHIPS ════════════════════════════════════════════════ */
.categorias-chips {
  display: flex;
  gap: .4rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 0 .75rem;
  margin-bottom: .25rem;
  scrollbar-width: none;
}
.categorias-chips::-webkit-scrollbar { display: none; }

.categoria-chip {
  flex-shrink: 0;
  padding: .3rem .85rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--surface);
  color: var(--muted);
  font-size: .775rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--trans);
  white-space: nowrap;
  letter-spacing: .15px;
}
.categoria-chip:hover { border-color: var(--blue); color: var(--blue); }
.categoria-chip.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

/* Result count */
.resultado-info {
  font-size: .775rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: .75rem;
}
