/* ============================================================
   CONGELADOS — Design System
   Paleta: Ice Blue  #0ea5e9 / Deep Ocean #0369a1 / Frost #f0f9ff
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* --- Variables --- */
:root {
  --cong-primary:      #0ea5e9;
  --cong-primary-dark: #0284c7;
  --cong-deep:         #0369a1;
  --cong-frost:        #f0f9ff;
  --cong-ice:          #e0f2fe;
  --cong-text:         #0c4a6e;
  --cong-muted:        #64748b;
  --cong-border:       #bae6fd;
  --cong-success:      #22c55e;
  --cong-danger:       #ef4444;
  --cong-warning:      #f59e0b;
  --radius:            0.75rem;
  --shadow-sm:         0 1px 3px rgba(14,165,233,.12);
  --shadow-md:         0 4px 16px rgba(14,165,233,.18);
  --shadow-lg:         0 8px 32px rgba(14,165,233,.22);
}

/* --- Base --- */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--cong-frost);
  color: #1e293b;
  margin: 0;
}

/* --- Gradiente corporativo --- */
.bg-cong-gradient {
  background: linear-gradient(135deg, #0ea5e9 0%, #0369a1 50%, #1e3a5f 100%);
}

/* --- Botón primario --- */
.btn-cong {
  background: linear-gradient(135deg, #0ea5e9, #0369a1);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 0.625rem 1.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(14,165,233,.35);
}
.btn-cong:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(14,165,233,.45);
  background: linear-gradient(135deg, #38bdf8, #0284c7);
}
.btn-cong:active { transform: translateY(0); }

.btn-cong-outline {
  background: transparent;
  color: var(--cong-primary-dark);
  border: 2px solid var(--cong-primary);
  border-radius: var(--radius);
  padding: 0.5rem 1.25rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.btn-cong-outline:hover { background: var(--cong-ice); }

.btn-danger {
  background: linear-gradient(135deg, #f87171, #dc2626);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 0.5rem 1.25rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 2px 8px rgba(239,68,68,.25);
}
.btn-danger:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(239,68,68,.4); }

/* --- Card --- */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--cong-border);
  overflow: hidden;
}
.card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--cong-ice);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.card-body { padding: 1.5rem; }

/* --- Upload Zone --- */
.upload-zone {
  border: 2.5px dashed var(--cong-border);
  border-radius: var(--radius);
  background: var(--cong-frost);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all .25s ease;
  position: relative;
}
.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--cong-primary);
  background: var(--cong-ice);
  box-shadow: 0 0 0 4px rgba(14,165,233,.12);
}
.upload-zone .upload-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(14,165,233,.3));
}
.upload-zone p { color: var(--cong-muted); margin: 0.25rem 0; }
.upload-zone strong { color: var(--cong-primary-dark); }

/* --- Progress Bar --- */
.progress-bar-wrap {
  height: 8px;
  background: var(--cong-ice);
  border-radius: 99px;
  overflow: hidden;
  margin-top: .75rem;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #0284c7);
  border-radius: 99px;
  transition: width .3s ease;
  width: 0%;
}

/* --- Tabla de Productos --- */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--cong-border);
}
.productos-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  white-space: nowrap;
}
.productos-table thead th {
  background: linear-gradient(135deg, #0ea5e9, #0369a1);
  color: #fff;
  font-weight: 600;
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  position: sticky;
  top: 0;
  z-index: 1;
}
.productos-table tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: background .15s;
}
.productos-table tbody tr:hover { background: var(--cong-frost); }
.productos-table tbody td { padding: 0.6rem 1rem; color: #334155; vertical-align: middle; }

/* --- Badges --- */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: .03em;
}
.badge-success { background: #dcfce7; color: #15803d; }
.badge-danger  { background: #fee2e2; color: #b91c1c; }
.badge-info    { background: var(--cong-ice); color: var(--cong-deep); }
.badge-warning { background: #fef9c3; color: #a16207; }

/* --- Stats Cards --- */
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--cong-border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 1rem;
}
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 0.625rem;
  background: var(--cong-ice);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.stat-label { font-size: 0.75rem; color: var(--cong-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }
.stat-value { font-size: 1.75rem; font-weight: 700; color: var(--cong-deep); line-height: 1.1; }

/* --- Search / Filters --- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  padding: 1rem 1.5rem;
  background: var(--cong-frost);
  border-bottom: 1px solid var(--cong-border);
}
.filter-input {
  border: 1px solid var(--cong-border);
  border-radius: 0.5rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  outline: none;
  transition: all .2s;
  background: #fff;
  color: #334155;
  min-width: 160px;
}
.filter-input:focus { border-color: var(--cong-primary); box-shadow: 0 0 0 3px rgba(14,165,233,.15); }

/* --- Alerts / Toasts --- */
.alert {
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info    { background: var(--cong-ice); color: var(--cong-deep); border: 1px solid var(--cong-border); }

/* --- Navbar overrides --- */
.bg-cong-nav {
  background: linear-gradient(135deg, #0c4a6e 0%, #0369a1 100%);
}
.nav-link-active {
  background: rgba(255,255,255,.18) !important;
  color: #fff !important;
  border-radius: 0.5rem;
}

/* --- Login Page --- */
.login-bg {
  min-height: 100vh;
  background: linear-gradient(160deg, #0c4a6e 0%, #0ea5e9 50%, #38bdf8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}
.login-bg::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: rgba(255,255,255,.04);
  top: -150px; right: -150px;
}
.login-bg::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  bottom: -100px; left: -100px;
}
.login-card {
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(20px);
  border-radius: 1.25rem;
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(3,105,161,.35);
  position: relative;
  z-index: 1;
}
.login-logo-area {
  text-align: center;
  margin-bottom: 1.75rem;
}
.login-logo-area .logo-icon {
  font-size: 3.5rem;
  display: block;
  margin-bottom: .5rem;
  filter: drop-shadow(0 4px 8px rgba(14,165,233,.4));
}
.login-logo-area h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--cong-deep);
  margin: 0 0 .25rem;
  letter-spacing: -.02em;
}
.login-logo-area p { color: var(--cong-muted); font-size: .9rem; margin: 0; }

/* --- Misc --- */
.truncate-cell { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.monospace { font-family: 'Courier New', monospace; font-size: .8rem; }

/* --- Pagination --- */
.pagination { display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; }
.page-btn {
  padding: .3rem .65rem;
  border: 1px solid var(--cong-border);
  border-radius: .4rem;
  font-size: .8rem;
  background: #fff;
  color: var(--cong-deep);
  cursor: pointer;
  transition: all .15s;
}
.page-btn:hover { background: var(--cong-ice); }
.page-btn.active { background: var(--cong-primary); color: #fff; border-color: var(--cong-primary); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* Print */
@media print { .no-print { display: none !important; } }

/* Responsive */
@media (max-width: 768px) {
  .filter-bar { flex-direction: column; align-items: stretch; }
  .stat-cards-grid { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 480px) {
  .login-card { padding: 1.75rem 1.25rem; }
  .stat-cards-grid { grid-template-columns: 1fr !important; }
}
