/* ============================================================
   WABII — Sistema de diseño (Manual de Identidad v1.0)
   Paleta: Cian #00CCFF · Índigo #5123FF · Violeta #BC63FB
           Mint IA #00FDA4 · Carbón #0B0B0F
   Tipografía: Montserrat (títulos) · Inter (texto)
   ============================================================ */
:root {
  --cyan:   #00CCFF;
  --indigo: #5123FF;
  --violet: #BC63FB;
  --mint:   #00FDA4;
  --carbon: #0B0B0F;

  --grad: linear-gradient(135deg, #00CCFF 0%, #5123FF 50%, #BC63FB 100%);
  --grad-soft: linear-gradient(135deg, rgba(0,204,255,.15), rgba(81,35,255,.15), rgba(188,99,251,.15));

  --bg:        #0B0B0F;
  --bg-elev:   #14141c;
  --bg-elev-2: #1b1b25;
  --line:      rgba(255,255,255,.08);
  --line-2:    rgba(255,255,255,.14);
  --text:      #ECECF3;
  --muted:     #9A9AB2;
  --muted-2:   #6E6E86;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 12px 40px rgba(0,0,0,.45);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, .font-display {
  font-family: "Montserrat", "Inter", sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Utilidades ---- */
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.muted { color: var(--muted); }
.text-sm { font-size: .85rem; }
.text-xs { font-size: .76rem; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }

/* ---- Botones ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: "Montserrat", sans-serif; font-weight: 600; font-size: .92rem;
  padding: 11px 22px; border-radius: 999px; border: 1.5px solid transparent;
  cursor: pointer; transition: all .18s ease; text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 6px 20px rgba(81,35,255,.35); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 26px rgba(81,35,255,.5); }
.btn-ghost { background: rgba(255,255,255,.06); color: #fff; border-color: var(--line-2); backdrop-filter: blur(6px); }
.btn-ghost:hover { background: rgba(255,255,255,.13); border-color: #fff; }
.btn-mint { background: var(--mint); color: #04201a; }
.btn-mint:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn-sm { padding: 8px 16px; font-size: .85rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

/* ---- Tarjetas ---- */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.card-title { font-size: 1.05rem; margin: 0 0 4px; }
.card + .card { margin-top: 20px; }

/* ---- Formularios ---- */
.field { margin-bottom: 18px; }
.label { display: block; font-size: .82rem; color: var(--muted); margin-bottom: 7px; font-weight: 500; }
.input, .select, .textarea {
  width: 100%; background: var(--bg); color: var(--text);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: .92rem; font-family: inherit; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0,204,255,.18);
}
.input::placeholder { color: var(--muted-2); }
.hint { font-size: .76rem; color: var(--muted-2); margin-top: 6px; }
.error { color: #ff6b81; font-size: .78rem; margin-top: 6px; }

/* ---- Alertas ---- */
.alert { border-radius: var(--radius-sm); padding: 12px 16px; font-size: .88rem; margin-bottom: 18px; border: 1px solid; }
.alert-success { background: rgba(0,253,164,.1); border-color: rgba(0,253,164,.4); color: #7df7cf; }
.alert-error   { background: rgba(255,107,129,.1); border-color: rgba(255,107,129,.4); color: #ff9aab; }

/* ---- Badges ---- */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 600; padding: 4px 11px; border-radius: 999px; }
.badge-ok   { background: rgba(0,253,164,.14); color: var(--mint); }
.badge-off  { background: rgba(255,255,255,.08); color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot-ok { background: var(--mint); box-shadow: 0 0 8px var(--mint); }
.dot-off { background: var(--muted-2); }

/* ============================================================
   Layout del panel (sidebar + topbar)
   ============================================================ */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; flex-shrink: 0; background: #0e0e15; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 22px 16px; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; }
.sidebar .brand img { height: 34px; }
.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px;
  color: var(--muted); font-weight: 500; font-size: .92rem; transition: all .15s;
}
.nav a:hover { background: rgba(255,255,255,.05); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--grad-soft); color: #fff; border: 1px solid var(--line-2); }
.nav a svg { width: 19px; height: 19px; flex-shrink: 0; }
.sidebar .foot { border-top: 1px solid var(--line); padding-top: 14px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 30px; border-bottom: 1px solid var(--line); background: rgba(11,11,15,.7); backdrop-filter: blur(8px);
}
.topbar h1 { font-size: 1.15rem; margin: 0; }
.content { padding: 30px; max-width: 1100px; width: 100%; }

.user-chip { display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; font-weight: 700; color: #fff; font-size: .85rem; }

/* ---- Grid de stats ---- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.stat .n { font-family: "Montserrat"; font-size: 1.9rem; font-weight: 800; line-height: 1; }
.stat .l { color: var(--muted); font-size: .82rem; margin-top: 6px; }

/* ---- Tablas / listas ---- */
.list { display: flex; flex-direction: column; }
.list-item {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 8px;
  background: var(--bg-elev); transition: border-color .15s, background .15s;
}
.list-item:hover { border-color: var(--line-2); background: var(--bg-elev-2); text-decoration: none; }
.list-item .meta { color: var(--muted); font-size: .8rem; }

/* ---- Chat / inbox ---- */
.thread { display: flex; flex-direction: column; gap: 10px; padding: 8px 2px 20px; }
.bubble { max-width: 70%; padding: 10px 14px; border-radius: 14px; font-size: .92rem; line-height: 1.4; }
.bubble .t { display: block; font-size: .68rem; color: var(--muted-2); margin-top: 5px; }
.bubble.in  { align-self: flex-start; background: var(--bg-elev-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble.out { align-self: flex-end; background: linear-gradient(135deg, rgba(0,204,255,.22), rgba(81,35,255,.22)); border: 1px solid rgba(81,35,255,.4); border-bottom-right-radius: 4px; }
.composer { display: flex; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.composer .input { flex: 1; }

/* ---- Code pill ---- */
.code { font-family: ui-monospace, "SF Mono", Menlo, monospace; background: rgba(255,255,255,.07); border: 1px solid var(--line); border-radius: 7px; padding: 2px 8px; font-size: .82rem; color: var(--cyan); word-break: break-all; }

/* ---- Responsive ---- */
@media (max-width: 820px) {
  .sidebar { position: fixed; left: -260px; z-index: 40; transition: left .2s; }
  .sidebar.open { left: 0; }
  .content { padding: 20px; }
  .topbar { padding: 14px 18px; }
}
