/* =========================================================
   COLONIAS — Sistema de diseño "Frasco oscuro"
   Dark mode con acentos vibrantes, inspirado en perfumería.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  /* Base */
  --bg-base: #0f0c14;
  --bg-surface: #1a1522;
  --bg-surface-2: #221b2e;
  --border: #322940;
  --border-soft: #241d30;

  /* Texto */
  --text-primary: #f5efe6;
  --text-muted: #a89bb8;
  --text-faint: #6f6480;

  /* Acentos */
  --gold: #e8b75c;
  --gold-soft: rgba(232, 183, 92, 0.14);
  --violet: #a855f7;
  --violet-soft: rgba(168, 85, 247, 0.16);
  --pink: #f472b6;
  --pink-soft: rgba(244, 114, 182, 0.14);
  --green: #34d399;
  --green-soft: rgba(52, 211, 153, 0.14);
  --red: #f87171;
  --red-soft: rgba(248, 113, 113, 0.14);

  /* Tipografía */
  --font-display: 'Fraunces', serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Radios y sombras */
  --radius: 14px;
  --radius-sm: 8px;
  --shadow-glow: 0 0 40px -12px rgba(168, 85, 247, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
}

body {
  background-image:
    radial-gradient(ellipse 900px 500px at 15% -10%, var(--violet-soft), transparent),
    radial-gradient(ellipse 700px 500px at 100% 10%, var(--pink-soft), transparent);
  background-repeat: no-repeat;
}

h1, h2, h3, .font-display {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

.mono, .stat-value, .price { font-family: var(--font-mono); }

a { color: inherit; text-decoration: none; }

/* ---------- Layout ---------- */
.app-shell {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border-soft);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.brand {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--pink));
  box-shadow: 0 0 12px var(--gold);
}

.nav-group { display: flex; flex-direction: column; gap: 4px; }

.nav-link {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background .15s ease, color .15s ease;
}

.nav-link:hover { background: var(--bg-surface-2); color: var(--text-primary); }

.nav-link.active {
  background: var(--violet-soft);
  color: var(--text-primary);
  border: 1px solid rgba(168,85,247,0.35);
}

.nav-icon { width: 8px; height: 8px; border-radius: 2px; background: currentColor; opacity: .6; }

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
  font-size: 13px;
  color: var(--text-faint);
}

.main { padding: 32px 40px; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.topbar h1 { font-size: 26px; }
.topbar .subtitle { color: var(--text-muted); font-size: 14px; margin-top: 4px; }

.socio-badge {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13.5px;
}

.socio-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--pink));
}

.btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform .1s ease, filter .15s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold), #d99a3c);
  color: #211505;
}
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }

.btn-ghost {
  background: var(--bg-surface-2);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

/* ---------- Grid & cards ---------- */
.grid { display: grid; gap: 20px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: 2fr 1fr; }

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 22px;
}

.stat-card { display: flex; flex-direction: column; gap: 10px; }
.stat-label { color: var(--text-muted); font-size: 13px; font-weight: 500; }
.stat-value { font-size: 28px; font-weight: 600; }
.stat-delta { font-size: 12.5px; font-weight: 600; width: fit-content; padding: 3px 8px; border-radius: 999px; }
.stat-delta.up { background: var(--green-soft); color: var(--green); }
.stat-delta.down { background: var(--red-soft); color: var(--red); }

.card-title {
  font-family: var(--font-display);
  font-size: 17px;
  margin-bottom: 16px;
}

/* ---------- Elemento firma: medidor de frasco ---------- */
.bottle-gauge {
  display: flex;
  align-items: center;
  gap: 14px;
}

.bottle-gauge svg { flex-shrink: 0; }

.bottle-info { display: flex; flex-direction: column; gap: 2px; }
.bottle-name { font-size: 14.5px; font-weight: 600; }
.bottle-meta { font-size: 12.5px; color: var(--text-muted); }
.bottle-meta .mono { color: var(--text-primary); }

.fragrance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-soft);
}
.fragrance-row:last-child { border-bottom: none; }

/* ---------- Tabla ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-soft);
}
td { padding: 13px 0; border-bottom: 1px solid var(--border-soft); }
tr:last-child td { border-bottom: none; }

.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.tag-ok { background: var(--green-soft); color: var(--green); }
.tag-low { background: var(--red-soft); color: var(--red); }
.tag-reserved { background: var(--violet-soft); color: var(--violet); }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .grid-4, .grid-2 { grid-template-columns: 1fr; }
}

/* ---------- Formularios ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.form-field.full { grid-column: 1 / -1; }

.input {
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  width: 100%;
}
.input:focus {
  outline: none;
  border-color: var(--violet);
  box-shadow: 0 0 0 3px var(--violet-soft);
}

.section-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.section-tabs a {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
}
.section-tabs a.active { color: var(--text-primary); background: var(--violet-soft); border-color: rgba(168,85,247,0.35); }

.filter-pills { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.filter-pills a {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
}
.filter-pills a.active { color: #211505; background: var(--gold); border-color: var(--gold); }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 34px 30px;
}
.login-card .brand { justify-content: center; margin-bottom: 6px; font-size: 24px; }
.login-card .subtitle { text-align: center; color: var(--text-muted); font-size: 13.5px; margin-bottom: 26px; }
