/* ==========================================================
   Subastas BOE — UI profesional
   ========================================================== */

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

:root {
  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-active: #1e293b;
  --sidebar-accent: #38bdf8;

  --bg: #f1f5f9;
  --surface: #ffffff;
  --text: #0f172a;
  --text-secondary: #475569;
  --muted: #64748b;

  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-soft: #e0f2fe;

  --success: #059669;
  --success-soft: #d1fae5;
  --warning: #d97706;
  --warning-soft: #fef3c7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;

  --border: #e2e8f0;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 4px 12px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 8px 24px rgba(15, 23, 42, 0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 14.5px;
  display: flex;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.1rem 0.4rem;
  font-size: 0.82em;
  color: #475569;
}

/* ----------------------------------------------------------
   Sidebar
   ---------------------------------------------------------- */

.sidebar {
  width: 240px;
  min-height: 100vh;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 50;
}

.sidebar-brand {
  padding: 1.4rem 1.5rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.sidebar-brand .logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-brand .logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.sidebar-brand .name {
  color: #f8fafc;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
}

.sidebar-brand .sub {
  font-size: 0.72rem;
  color: var(--sidebar-text);
  font-weight: 500;
}

.sidebar-nav {
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}

.sidebar-nav .section-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #475569;
  font-weight: 600;
  padding: 0.9rem 0.75rem 0.35rem;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-weight: 500;
  font-size: 0.88rem;
  transition: background 0.15s, color 0.15s;
}

.sidebar-nav a:hover {
  background: var(--sidebar-active);
  color: #e2e8f0;
  text-decoration: none;
}

.sidebar-nav a.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 600;
}

.sidebar-nav a.active svg {
  opacity: 1;
}

.sidebar-nav a svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  opacity: 0.85;
}

.galeria {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.galeria a {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 4 / 3;
  background: #f1f5f9;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.galeria a:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.15);
}

.galeria img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.doc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.doc-list a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--accent);
  text-decoration: none;
}

.doc-list a:hover {
  text-decoration: underline;
}

.nav-badge {
  display: inline-block;
  background: #f43f5e;
  color: #fff;
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
  font-size: 0.68rem;
  font-weight: 700;
  margin-left: 0.3rem;
}

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  font-size: 0.75rem;
  color: #475569;
}

.sidebar-footer .sched-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.4rem;
}

.sched-on { background: #34d399; box-shadow: 0 0 6px rgba(52, 211, 153, 0.7); }
.sched-off { background: #64748b; }

/* ----------------------------------------------------------
   Main layout
   ---------------------------------------------------------- */

.main {
  flex: 1;
  margin-left: 240px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.9rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.topbar .subtitle {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 0.1rem;
}

.content {
  padding: 1.75rem 2rem 3rem;
  max-width: 1280px;
  width: 100%;
}

.content-wide {
  max-width: none;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.table-subastas {
  width: 100%;
  table-layout: auto;
}

.table-wide {
  width: 100%;
  table-layout: auto;
}

.desc-cell-full {
  min-width: 280px;
  max-width: none;
  white-space: normal;
  word-break: break-word;
  line-height: 1.5;
  overflow: visible;
  text-overflow: unset;
}

.table-subastas .desc-cell-full {
  min-width: 280px;
  max-width: none;
  white-space: normal;
  word-break: break-word;
  line-height: 1.5;
  overflow: visible;
  text-overflow: unset;
}

.table-subastas .col-money {
  white-space: nowrap;
  font-size: 0.82rem;
  text-align: right;
}

.table-subastas thead .col-money {
  text-align: right;
}

/* ----------------------------------------------------------
   Cards / panels
   ---------------------------------------------------------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.panel h2 {
  margin: 0 0 1rem;
  font-size: 1.02rem;
  font-weight: 700;
}

.panel-flat { box-shadow: none; }

/* Stats */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon svg { width: 20px; height: 20px; }

.stat-icon.blue { background: var(--primary-soft); color: var(--primary); }
.stat-icon.green { background: var(--success-soft); color: var(--success); }
.stat-icon.amber { background: var(--warning-soft); color: var(--warning); }
.stat-icon.violet { background: #ede9fe; color: #7c3aed; }

.stat .value {
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.1;
}

.stat .label {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}

.section-label-admin {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

/* Dashboard — tarjetas por categoría */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.dash-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.dash-card-head h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
}

.dash-card-stat {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
}

.dash-card-stat span {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
}

.dash-card-meta {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}

.dash-card-meta dt {
  display: inline;
  font-weight: 600;
  color: var(--text-secondary);
}

.dash-card-meta dd {
  display: inline;
  margin: 0;
}

.dash-card-meta dd::after {
  content: '';
  display: block;
  margin-bottom: 0.15rem;
}

.dash-card-actions {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

/* Dashboard — tabla de categorías (legacy) */
.panel-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.35rem;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

.panel-table-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.panel-table-head a {
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
}

.panel-table-head a:hover {
  text-decoration: underline;
}

.dash-categorias .num-cell {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.dash-categorias .text-nuevo {
  color: var(--success);
  font-weight: 700;
}

.actions-cell {
  white-space: nowrap;
  text-align: right;
  font-size: 0.84rem;
}

.actions-cell a,
.link-btn {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
}

.actions-cell a:hover,
.link-btn:hover {
  text-decoration: underline;
}

.link-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

.act-sep {
  color: var(--muted);
  margin: 0 0.25rem;
}

.row-nuevo {
  background: #fefce8;
}

form.form-inline {
  display: inline;
}

/* ----------------------------------------------------------
   Botones
   ---------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--primary);
  color: #fff;
  border: 1px solid transparent;
  padding: 0.5rem 0.95rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  transition: background 0.15s, box-shadow 0.15s;
  text-decoration: none;
  line-height: 1.3;
}

.btn:hover {
  background: var(--primary-hover);
  color: #fff;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.btn:disabled { opacity: 0.55; cursor: wait; }

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}

.btn-outline:hover {
  background: #f8fafc;
  color: var(--text);
  border-color: #cbd5e1;
}

.btn-ghost {
  background: transparent;
  color: var(--primary);
}

.btn-ghost:hover { background: var(--primary-soft); }

.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b91c1c; }

.btn-success { background: var(--success); }
.btn-success:hover { background: #047857; }

.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.78rem; }
.btn-lg { padding: 0.65rem 1.3rem; font-size: 0.92rem; }

.btn svg { width: 15px; height: 15px; }

/* ----------------------------------------------------------
   Forms
   ---------------------------------------------------------- */

label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 600;
  display: block;
  margin-bottom: 0.3rem;
}

input[type="text"],
input[type="search"],
input[type="url"],
input[type="number"],
input[type="password"],
select,
textarea {
  padding: 0.52rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
}

.checkbox-row input { width: auto; }

.filter-bar {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  align-items: end;
}

.filter-bar > div { min-width: 120px; }
.filter-bar .grow { flex: 1; min-width: 200px; }

/* Buscador de subastas por secciones */
.filter-panel {
  padding: 0;
  overflow: hidden;
}

.filter-form {
  display: flex;
  flex-direction: column;
}

.filter-section {
  padding: 1.15rem 1.35rem;
  border-bottom: 1px solid var(--border);
}

.filter-section:last-of-type {
  border-bottom: none;
}

.filter-section-head {
  margin-bottom: 0.85rem;
}

.filter-section-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.filter-section-desc {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
}

.filter-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1rem;
  align-items: end;
}

.filter-fields-money {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.85rem 1rem;
}

.filter-fields-inline {
  align-items: end;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.filter-field label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.filter-field-grow {
  flex: 1 1 240px;
}

.filter-field-md {
  flex: 0 1 220px;
}

.filter-field-sm {
  flex: 0 1 180px;
}

.filter-field-xs {
  flex: 0 1 100px;
}

.filter-section-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: end;
  justify-content: space-between;
  background: #f8fafc;
}

.filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.filter-panel > .sep {
  margin: 0;
}

.filter-panel > .flex-between {
  padding: 0.85rem 1.35rem 1.1rem;
}

/* ----------------------------------------------------------
   Tablas
   ---------------------------------------------------------- */

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
}

.panel-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.panel-table .table-wrap {
  border-radius: 0;
}

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

th, td {
  padding: 0.7rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: #f8fafc;
  font-weight: 600;
  white-space: nowrap;
}

tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background 0.1s; }
tbody tr:hover td { background: #f8fafc; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-blue { background: var(--primary-soft); color: var(--primary-hover); }
.badge-green { background: var(--success-soft); color: var(--success); }
.badge-amber { background: var(--warning-soft); color: var(--warning); }
.badge-red { background: var(--danger-soft); color: var(--danger); }
.badge-gray { background: #f1f5f9; color: var(--muted); }

.ref {
  font-weight: 600;
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: 0.8rem;
}

.desc-cell {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
}

.actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }

/* ----------------------------------------------------------
   Paginación
   ---------------------------------------------------------- */

.pagination {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-top: 1.1rem;
  flex-wrap: wrap;
}

.pagination .current {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
}

/* ----------------------------------------------------------
   Detalle
   ---------------------------------------------------------- */

.detail-grid {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 0.55rem 1.25rem;
  font-size: 0.88rem;
  margin: 0;
}

.detail-grid dt {
  color: var(--muted);
  font-weight: 500;
  margin: 0;
}

.detail-grid dd { margin: 0; font-weight: 500; }

.detail-block {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

/* Comparador */
.diff-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.diff-list {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.diff-list .diff-head {
  padding: 0.75rem 1rem;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.diff-head.nuevas { background: var(--success-soft); color: var(--success); }
.diff-head.caidas { background: var(--danger-soft); color: var(--danger); }

.diff-item {
  padding: 0.7rem 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
}

.diff-item .ref { display: block; margin-bottom: 0.15rem; }
.diff-item .d { color: var(--muted); }

/* Empty states */
.empty {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--muted);
}

.empty svg {
  width: 44px;
  height: 44px;
  opacity: 0.35;
  margin-bottom: 0.75rem;
}

.empty p { margin: 0.25rem 0; }

/* Utils */
.muted { color: var(--muted); font-size: 0.85rem; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.flex { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }

hr.sep { border: 0; border-top: 1px solid var(--border); margin: 1.25rem 0; }

/* Toast/status */
#toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--sidebar-bg);
  color: #f1f5f9;
  padding: 0.8rem 1.2rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
  z-index: 100;
}

#toast.show { opacity: 1; transform: translateY(0); }

/* Login — Aurora background (inspirado en React Bits) */
body.login-page {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  overflow: hidden;
  background: #030712;
}

.login-aurora {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.aurora-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  mix-blend-mode: screen;
  will-change: transform;
}

.aurora-blob-1 {
  width: 55vmax;
  height: 55vmax;
  top: -20%;
  left: -15%;
  background: radial-gradient(circle, #0ea5e9 0%, #0284c7 40%, transparent 70%);
  animation: aurora-drift-1 18s ease-in-out infinite alternate;
}

.aurora-blob-2 {
  width: 50vmax;
  height: 50vmax;
  top: 30%;
  right: -20%;
  background: radial-gradient(circle, #6366f1 0%, #4f46e5 45%, transparent 70%);
  animation: aurora-drift-2 22s ease-in-out infinite alternate;
}

.aurora-blob-3 {
  width: 45vmax;
  height: 45vmax;
  bottom: -25%;
  left: 20%;
  background: radial-gradient(circle, #06b6d4 0%, #0891b2 35%, #164e63 60%, transparent 75%);
  animation: aurora-drift-3 20s ease-in-out infinite alternate;
}

@keyframes aurora-drift-1 {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(12vw, 8vh) scale(1.12); }
}

@keyframes aurora-drift-2 {
  0%   { transform: translate(0, 0) scale(1.05); }
  100% { transform: translate(-10vw, 12vh) scale(0.95); }
}

@keyframes aurora-drift-3 {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(8vw, -6vh) scale(1.08); }
}

.login-vignette {
  position: fixed;
  inset: 0;
  z-index: 2;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(3, 7, 18, 0.85) 100%);
  pointer-events: none;
}

.login-wrap {
  position: relative;
  z-index: 10;
  width: min(420px, 92vw);
  animation: login-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes login-rise {
  from { opacity: 0; transform: translateY(24px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-card {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 20px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 25px 50px -12px rgba(0, 0, 0, 0.55),
    0 0 80px -20px rgba(14, 165, 233, 0.25);
  padding: 2.25rem 2rem 2rem;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.login-logo {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.login-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.login-brand h1 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #f8fafc;
}

.login-brand p {
  margin: 0.2rem 0 0;
  color: #94a3b8;
  font-size: 0.88rem;
}

.login-field {
  margin-bottom: 1.1rem;
}

.login-form label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: #cbd5e1;
  letter-spacing: 0.02em;
}

.login-input-wrap {
  position: relative;
}

.login-input-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #64748b;
  pointer-events: none;
  transition: color 0.2s;
}

.login-form input {
  width: 100%;
  padding: 0.72rem 0.85rem 0.72rem 2.65rem;
  margin-bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 10px;
  color: #f1f5f9;
  font-size: 0.92rem;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.login-form input::placeholder {
  color: #475569;
}

.login-form input:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(15, 23, 42, 0.85);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.login-input-wrap:focus-within .login-input-icon {
  color: #38bdf8;
}

.btn-login {
  width: 100%;
  justify-content: center;
  margin-top: 0.5rem;
  padding: 0.78rem 1rem;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 10px;
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 50%, #0369a1 100%);
  box-shadow: 0 4px 20px rgba(14, 165, 233, 0.35);
  transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
}

.btn-login:hover {
  background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 50%, #0284c7 100%);
  box-shadow: 0 6px 28px rgba(14, 165, 233, 0.45);
  transform: translateY(-1px);
}

.btn-login:active {
  transform: translateY(0);
}

.btn-login svg {
  width: 18px;
  height: 18px;
  transition: transform 0.2s;
}

.btn-login:hover svg {
  transform: translateX(3px);
}

.login-alert {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(220, 38, 38, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.25);
  color: #fecaca;
  margin-bottom: 1.25rem;
}

.login-tagline {
  text-align: center;
  margin: 1.25rem 0 0;
  font-size: 0.78rem;
  color: #64748b;
  letter-spacing: 0.03em;
}

@media (prefers-reduced-motion: reduce) {
  .aurora-blob { animation: none; }
  .login-wrap { animation: none; }
}

.btn-block { width: 100%; justify-content: center; }

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.alert-error {
  background: var(--danger-soft);
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-ok {
  background: var(--success-soft);
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.sidebar-user {
  font-size: 0.78rem;
  color: #cbd5e1;
  margin-bottom: 0.25rem;
}

.sidebar-logout {
  display: block;
  font-size: 0.78rem;
  color: var(--sidebar-accent);
  margin-bottom: 0.5rem;
  text-decoration: none;
}

.sidebar-logout:hover { text-decoration: underline; }

.inline-form {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
}

/* Pestañas de vista (activas / favoritas / ocultas) */
.view-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.view-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.view-tab:hover {
  text-decoration: none;
  border-color: #cbd5e1;
  color: var(--text);
}

.view-tab.active {
  background: var(--primary-soft);
  border-color: #7dd3fc;
  color: var(--primary);
}

.tab-count {
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
}

.view-tab.active .tab-count {
  background: var(--primary-hover);
}

/* Countdown fin de subasta */
.countdown {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text);
}

.countdown-lg {
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}

.countdown-urgent {
  color: var(--warning);
}

.countdown-done {
  color: var(--muted);
  font-weight: 500;
}

/* Botones icono favorita */
.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: #cbd5e1;
  padding: 0.15rem;
  line-height: 1;
  transition: color 0.15s, transform 0.15s;
}

.icon-btn:hover {
  color: var(--warning);
  transform: scale(1.15);
}

.icon-btn.is-fav {
  color: var(--warning);
}

.btn-fav-active {
  border-color: var(--warning);
  color: var(--warning);
  background: var(--warning-soft);
}

/* ----------------------------------------------------------
   Responsive
   ---------------------------------------------------------- */

@media (max-width: 860px) {
  .sidebar {
    width: 64px;
  }
  .sidebar-brand {
    justify-content: center;
    padding: 1rem 0.5rem;
  }
  .sidebar-brand .name, .sidebar-brand .sub,
  .sidebar-nav a span, .sidebar-nav .section-label,
  .sidebar-footer { display: none; }
  .sidebar-nav a { justify-content: center; padding: 0.7rem; }
  .main { margin-left: 64px; }
  .content { padding: 1.25rem 1rem 2.5rem; }
  .topbar { padding: 0.8rem 1rem; }
  .diff-columns { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .desc-cell { max-width: 200px; }
}
