/* ============================================================
   LIA · Dashboard — Sistema de estilos
   Tema: Almond (Mintlify) · teal #009689
   ============================================================ */
:root {
  --bg: #0a0a0a;
  --bg-deep: #060606;
  --surface: #111111;
  --surface-2: #171717;
  --surface-3: #1e1e1e;
  --border: rgba(0, 200, 180, 0.12);
  --border-2: rgba(0, 200, 180, 0.25);
  --border-hover: rgba(0, 200, 180, 0.35);
  --accent: #009689;
  --accent-2: #00c4a7;
  --accent-glow: rgba(0, 150, 137, 0.35);
  --silver: #94a3b8;
  --silver-2: #cbd5e1;
  --chrome: #e2e8f0;
  --text: #f0f4ff;
  --muted: #6b84b0;
  --muted-2: #4d6494;
  --success: #22c55e;
  --warn: #f59e0b;
  --danger: #f87171;
  --gold: #f59e0b;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;

  --sb-w: 248px;

  /* Densidad (lo controla el Tweak) */
  --pad-card: 22px;
  --gap-grid: 20px;
  --row-h: 14px;
  --font-scale: 1;
}

[data-density="compacta"] {
  --pad-card: 15px;
  --gap-grid: 13px;
  --row-h: 9px;
  --font-scale: 0.94;
}
[data-density="amplia"] {
  --pad-card: 28px;
  --gap-grid: 26px;
  --row-h: 19px;
  --font-scale: 1.04;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
}
body {
  font-family: "Inter", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg-deep);
  font-size: calc(15px * var(--font-scale));
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* fondo con halo teal sutil */
.app-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1200px 600px at 78% -8%, rgba(0, 150, 137, 0.12), transparent 60%),
    radial-gradient(900px 500px at 8% 105%, rgba(0, 196, 167, 0.06), transparent 55%),
    var(--bg-deep);
  z-index: 0;
}

::selection { background: rgba(37, 99, 235, 0.4); color: #fff; }

/* scrollbars */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: rgba(96, 165, 250, 0.18); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: rgba(96, 165, 250, 0.32); background-clip: padding-box; }
*::-webkit-scrollbar-track { background: transparent; }

.font-display { font-family: "Syne", sans-serif; }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; font-feature-settings: "tnum"; }

/* ===================== LAYOUT ===================== */
.shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--sb-w) 1fr;
  height: 100vh;
}

/* ===================== SIDEBAR ===================== */
.sidebar {
  background: linear-gradient(180deg, rgba(6, 17, 40, 0.92), rgba(3, 11, 30, 0.96));
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  backdrop-filter: blur(14px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 6px 10px 18px;
}
.brand-mark {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: linear-gradient(150deg, #f5f8ff, #cdd9ef);
  display: grid; place-items: center;
  font-family: "Syne", sans-serif;
  font-weight: 800; font-size: 17px;
  color: var(--accent);
  letter-spacing: -0.04em;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.7);
}
.brand-mark .l { color: #64748b; }
.brand-name { font-family: "Syne", sans-serif; font-weight: 800; font-size: 19px; letter-spacing: -0.02em; line-height: 1; }
.brand-sub { font-size: 9.5px; color: var(--muted); letter-spacing: 0.14em; text-transform: uppercase; margin-top: 3px; }

.nav-group-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--muted-2); font-weight: 600;
  padding: 16px 12px 7px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9.5px 12px;
  border-radius: 10px;
  color: var(--silver);
  font-size: 13.5px; font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .15s ease;
  position: relative;
  user-select: none;
}
.nav-item:hover { background: rgba(0, 150, 137, 0.07); color: var(--text); }
.nav-item.active {
  background: rgba(0, 150, 137, 0.15);
  border-color: rgba(0, 150, 137, 0.4);
  color: #00c4a7;
}
.nav-item.active::before {
  content: ""; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 0 3px 3px 0; background: #009689;
  box-shadow: 0 0 10px rgba(0, 150, 137, 0.6);
}
.nav-ico { width: 18px; height: 18px; flex: none; opacity: .92; }
.nav-badge {
  margin-left: auto; font-size: 10.5px; font-weight: 700;
  background: rgba(96,165,250,0.16); color: var(--accent-2);
  padding: 1px 7px; border-radius: 99px; font-family: "Syne", sans-serif;
}
.sidebar-foot { margin-top: auto; padding-top: 14px; }
.user-card {
  display: flex; align-items: center; gap: 11px;
  padding: 11px; border-radius: 12px;
  background: rgba(96,165,250,0.06);
  border: 1px solid var(--border);
  cursor: pointer; transition: all .15s;
}
.user-card:hover { border-color: var(--border-2); }
.avatar {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: linear-gradient(140deg, var(--accent), #1d4ed8);
  display: grid; place-items: center;
  font-family: "Syne", sans-serif; font-weight: 700; font-size: 13px; color: #fff;
}
.user-meta { min-width: 0; }
.user-meta .n { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta .e { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===================== MAIN ===================== */
.main {
  display: flex; flex-direction: column;
  min-width: 0; height: 100vh; overflow: hidden;
}
.topbar {
  display: flex; align-items: center; gap: 18px;
  padding: 16px 30px;
  border-bottom: 1px solid rgba(148,185,255,0.14);
  background: rgba(7, 20, 48, 0.95);
  backdrop-filter: blur(10px);
  flex: none;
}
.crumb { font-size: 12px; color: var(--muted); }
.crumb b { color: var(--text); font-weight: 600; }
.page-title { font-family: "Syne", sans-serif; font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.search {
  margin-left: auto;
  display: flex; align-items: center; gap: 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 13px;
  width: 270px; color: var(--muted);
  transition: all .15s;
}
.search:focus-within { border-color: var(--border-hover); color: var(--text); }
.search input { background: none; border: none; outline: none; color: var(--text); font-size: 13px; width: 100%; font-family: inherit; }
.search input::placeholder { color: var(--muted); }
.kbd { font-size: 10px; border: 1px solid var(--border-2); border-radius: 5px; padding: 1px 5px; color: var(--muted); }

.credit-pill {
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(120deg, rgba(245,158,11,0.14), rgba(245,158,11,0.04));
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: 10px; padding: 7px 13px;
  cursor: pointer; transition: all .15s;
}
.credit-pill:hover { border-color: rgba(245,158,11,0.55); }
.credit-pill .dot { width: 7px; height: 7px; border-radius: 99px; background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.credit-pill .lab { font-size: 11px; color: var(--muted); }
.credit-pill .val { font-family: "Syne", sans-serif; font-weight: 700; font-size: 14px; color: var(--gold); }

.content {
  flex: 1; overflow-y: auto;
  padding: 26px 30px 60px;
}
.content-inner { max-width: 1280px; margin: 0 auto; }

/* ===================== PRIMITIVES ===================== */
.card {
  background: var(--surface);
  border: 1px solid rgba(148,185,255,0.14);
  border-radius: var(--r-lg);
  padding: var(--pad-card);
}
/* estilo de tarjeta (Tweak) */
[data-cardstyle="glass"] .card {
  background: rgba(8, 20, 48, 0.55);
  backdrop-filter: blur(16px);
  border-color: var(--border-2);
}
[data-cardstyle="elevado"] .card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border-color: rgba(96,165,250,0.18);
  box-shadow: 0 14px 40px -20px rgba(0,0,0,0.8), inset 0 1px 0 rgba(255,255,255,0.05);
}
[data-cardstyle="contorno"] .card {
  background: transparent;
  border-color: var(--border-2);
}

.section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.section-title { font-family: "Syne", sans-serif; font-weight: 700; font-size: 15.5px; letter-spacing: -0.01em; }
.section-sub { font-size: 12px; color: var(--muted); }
.spacer { flex: 1; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: "Syne", sans-serif; font-weight: 700; font-size: 12.5px;
  border-radius: 10px; padding: 9px 16px; cursor: pointer;
  border: 1px solid transparent; transition: all .15s; white-space: nowrap;
}
.btn-primary { background: linear-gradient(135deg, var(--accent), #1d4ed8); color: #fff; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 26px -8px var(--accent-glow); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--silver); }
.btn-ghost:hover { border-color: var(--border-hover); color: var(--text); }
.btn-success { background: linear-gradient(135deg, #16a34a, #15803d); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 11.5px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600;
  padding: 3.5px 10px; border-radius: 99px;
  border: 1px solid var(--border-2); color: var(--silver-2);
  background: rgba(96,165,250,0.06);
}

.tag {
  font-size: 10.5px; font-weight: 500;
  padding: 3px 9px; border-radius: 6px;
  background: rgba(96,165,250,0.08); color: var(--accent-2);
  border: 1px solid rgba(96,165,250,0.14);
}

/* estado badges */
.state { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 99px; font-family: "Syne", sans-serif; letter-spacing: 0.01em; display: inline-flex; align-items: center; gap: 6px; }
.state::before { content: ""; width: 6px; height: 6px; border-radius: 99px; background: currentColor; }
.state.nueva { color: var(--accent-2); background: rgba(96,165,250,0.12); }
.state.analisis { color: #c084fc; background: rgba(192,132,252,0.12); }
.state.preparando { color: var(--gold); background: rgba(245,158,11,0.12); }
.state.presentada { color: #38bdf8; background: rgba(56,189,248,0.12); }
.state.adjudicada { color: var(--success); background: rgba(34,197,94,0.13); }
.state.perdida { color: var(--muted); background: rgba(107,132,176,0.12); }

.inst-badge {
  width: 40px; height: 40px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  font-family: "Syne", sans-serif; font-weight: 800; font-size: 11px;
  color: #fff; letter-spacing: -0.02em;
  border: 1px solid rgba(255,255,255,0.12);
}

/* match ring */
.match { display: inline-flex; align-items: center; gap: 8px; }
.match .ring { width: 34px; height: 34px; border-radius: 99px; display: grid; place-items: center; position: relative; }
.match .ring span { font-family: "Syne", sans-serif; font-weight: 700; font-size: 10.5px; }

.muted { color: var(--muted); }
.amt { font-family: "Syne", sans-serif; font-weight: 700; letter-spacing: -0.01em; }

.divider { height: 1px; background: var(--border); margin: 16px 0; border: none; }

@keyframes fadeUp { from { transform: translateY(12px); } to { transform: translateY(0); } }
.fade-up { animation: fadeUp .32s ease; }
@keyframes liaSpin { to { transform: rotate(360deg); } }
.lia-spin { animation: liaSpin .8s linear infinite; }

/* grid helpers */
.grid { display: grid; gap: var(--gap-grid); }
.row { display: flex; gap: var(--gap-grid); }
