/* =========================================================================
   ISP Casa — Base + componentes (NOC = HTML/CSS puro)
   ========================================================================= */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: var(--fw-regular);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv05" 1, "ss01" 1, "tnum" 0;
}
h1,h2,h3,h4 { font-weight: var(--fw-semibold); letter-spacing: -0.011em; color: var(--text); }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-sm); }
::selection { background: color-mix(in srgb, var(--brand) 24%, transparent); }

.mono { font-family: var(--font-mono); font-feature-settings: "tnum" 1; }
.tnum { font-variant-numeric: tabular-nums; }
.eyebrow {
  font-size: var(--fs-2xs); font-weight: var(--fw-semibold);
  letter-spacing: .07em; text-transform: uppercase; color: var(--text-3);
}
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }

/* ---------- Scrollbar ---------- */
.scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.scroll::-webkit-scrollbar-thumb { background: var(--n-300); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
.scroll::-webkit-scrollbar-thumb:hover { background: var(--n-400); background-clip: content-box; }
.scroll::-webkit-scrollbar-track { background: transparent; }

/* ---------- Card ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
}
.card-pad { padding: var(--sp-5); }
.card-hd {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border-subtle);
}
.card-hd h3 { font-size: var(--fs-h3); }
.card-title { display:flex; align-items:center; gap: var(--sp-2); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  height: 38px; padding: 0 var(--sp-4);
  border-radius: var(--r-sm);
  font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  border: 1px solid transparent; white-space: nowrap;
  transition: background .14s ease, border-color .14s ease, box-shadow .14s ease, transform .04s ease;
}
.btn:active { transform: translateY(.5px); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--brand); color: var(--text-onbrand); box-shadow: var(--sh-xs); }
.btn-primary:hover { background: var(--brand-600); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--sh-xs); }
.btn-secondary:hover { background: var(--n-50); border-color: var(--n-400); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--n-100); color: var(--text); }
.btn-danger { background: var(--bad-500); color: #fff; }
.btn-danger:hover { background: var(--bad-600); }
.btn-sm { height: 32px; padding: 0 var(--sp-3); font-size: var(--fs-xs); }
.btn-lg { height: 44px; padding: 0 var(--sp-5); font-size: var(--fs-body); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-icon { width: 36px; height: 36px; padding: 0; }

/* ---------- Pills / badges ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 10px; border-radius: var(--r-full);
  font-size: var(--fs-2xs); font-weight: var(--fw-semibold); line-height: 1;
  border: 1px solid transparent; white-space: nowrap;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-good { background: var(--good-50);  color: var(--good-700); border-color: color-mix(in srgb, var(--good-500) 22%, transparent); }
.pill-warn { background: var(--warn-50);  color: var(--warn-700); border-color: color-mix(in srgb, var(--warn-500) 26%, transparent); }
.pill-bad  { background: var(--bad-50);   color: var(--bad-700);  border-color: color-mix(in srgb, var(--bad-500) 24%, transparent); }
.pill-info { background: var(--info-50);  color: var(--info-700); border-color: color-mix(in srgb, var(--info-500) 22%, transparent); }
.pill-neutral { background: var(--n-100); color: var(--n-600); border-color: var(--border); }
.pill-brand { background: var(--brand-50); color: var(--brand-700); border-color: color-mix(in srgb, var(--brand) 22%, transparent); }

.tag {
  display:inline-flex; align-items:center; gap:6px; height:22px; padding:0 8px;
  border-radius: var(--r-xs); font-size: var(--fs-2xs); font-weight: var(--fw-medium);
  background: var(--n-100); color: var(--text-2); border:1px solid var(--border-subtle);
}

/* ---------- Inputs ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--text-2); }
.input, .select {
  height: 40px; padding: 0 var(--sp-3);
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  font-size: var(--fs-sm); font-family: inherit; width: 100%;
  transition: border-color .14s, box-shadow .14s;
}
.input::placeholder { color: var(--text-faint); }
.input:focus, .select:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.input-mono { font-family: var(--font-mono); letter-spacing: .01em; }
.hint { font-size: var(--fs-2xs); color: var(--text-3); }

/* ---------- Table ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.tbl thead th {
  text-align: left; font-size: var(--fs-2xs); font-weight: var(--fw-semibold);
  letter-spacing: .04em; text-transform: uppercase; color: var(--text-3);
  padding: 10px var(--sp-4); border-bottom: 1px solid var(--border);
  white-space: nowrap; background: var(--surface-2);
}
.tbl tbody td { padding: 13px var(--sp-4); border-bottom: 1px solid var(--border-subtle); vertical-align: middle; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: var(--n-50); cursor: pointer; }
.tbl tbody tr:last-child td { border-bottom: none; }

/* ---------- Misc ---------- */
.divider { height: 1px; background: var(--border-subtle); }
.kbd {
  font-family: var(--font-mono); font-size: var(--fs-2xs);
  background: var(--n-100); border: 1px solid var(--border); border-bottom-width: 2px;
  border-radius: var(--r-xs); padding: 2px 6px; color: var(--text-2);
}
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand-100); color: var(--brand-700);
  font-size: var(--fs-xs); font-weight: var(--fw-bold); flex: none;
}
.shimmer {
  background: linear-gradient(100deg, var(--n-100) 30%, var(--n-150) 50%, var(--n-100) 70%);
  background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; border-radius: var(--r-sm);
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Layout helpers ---------- */
.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }
.gap-1{gap:var(--sp-1)} .gap-2{gap:var(--sp-2)} .gap-3{gap:var(--sp-3)} .gap-4{gap:var(--sp-4)} .gap-5{gap:var(--sp-5)} .gap-6{gap:var(--sp-6)}
.grow{flex:1} .between{justify-content:space-between} .center{justify-content:center} .wrap{flex-wrap:wrap}
.grid{display:grid}
