/* webmaster·urupass — panel oscuro petróleo, datos en mono */
:root {
  --bg: #0D1B24;
  --surface: #13242F;
  --surface2: #1A303D;
  --ink: #E7F0F6;
  --muted: #8AA2B2;
  --line: #24404F;
  --celeste: #5FB2E5;
  --celeste-deep: #1F7AB8;
  --gold: #E3A72F;
  --danger: #E2654E;
  --ok: #57B98A;
  --radius: 10px;
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  min-height: 100vh;
}
.hidden { display: none !important; }
.mono { font-family: var(--font-mono); font-size: 0.85em; }

.masthead {
  font-family: var(--font-display);
  font-weight: 700; letter-spacing: -0.02em; margin: 0;
}
.masthead .dot { color: var(--gold); }
.masthead.small { font-size: 1.25rem; }

/* ── Login ────────────────────────────────── */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center;
  background: radial-gradient(900px 500px at 20% -10%, #16303E 0%, var(--bg) 60%);
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--celeste);
  border-radius: var(--radius);
  padding: 2.2rem;
  width: min(420px, 92vw);
}
.login-card .masthead { font-size: 1.8rem; margin-bottom: 0.3rem; }
.login-sub { color: var(--muted); margin: 0 0 1.4rem; }

/* ── Formularios ──────────────────────────── */
.field { margin-bottom: 0.9rem; display: flex; flex-direction: column; }
.field label {
  font-family: var(--font-mono); font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); margin-bottom: 0.3rem;
}
.field input {
  font-family: var(--font-body); font-size: 0.95rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg); color: var(--ink);
}
.field input:focus, .panel-tools input:focus {
  outline: 2px solid var(--celeste); outline-offset: 1px;
}
.error { background: #3A1F1A; color: #F2A79A; border-radius: 6px; padding: 0.5rem 0.7rem; font-size: 0.88rem; margin-bottom: 0.8rem; }

/* ── Botones ──────────────────────────────── */
.btn {
  font-family: var(--font-display); font-weight: 600; font-size: 0.88rem;
  padding: 0.5rem 0.9rem; border-radius: 7px;
  border: 1px solid transparent; cursor: pointer;
  background: transparent; color: var(--ink);
}
.btn:focus-visible { outline: 2px solid var(--celeste); outline-offset: 2px; }
.btn-primary { background: var(--celeste-deep); color: #fff; }
.btn-primary:hover { background: #2588c9; }
.btn-ghost { color: var(--muted); }
.btn-ghost:hover { background: var(--surface2); color: var(--celeste); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: wait; }
.btn-mini {
  font-size: 0.72rem; padding: 0.28rem 0.55rem;
  border: 1px solid var(--line); color: var(--muted);
  border-radius: 6px; background: transparent; cursor: pointer;
  font-family: var(--font-mono);
}
.btn-mini:hover { border-color: var(--celeste); color: var(--celeste); }
.btn-mini.danger:hover { border-color: var(--danger); color: var(--danger); }

/* ── Estructura ───────────────────────────── */
.topbar {
  display: flex; align-items: center;
  padding: 0.7rem 1.4rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar-right { margin-left: auto; display: flex; gap: 0.4rem; }
.content { max-width: 1100px; margin: 0 auto; padding: 1.4rem; }

/* Tarjetas resumen */
.cards {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 0.9rem; margin-bottom: 1.2rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  display: flex; flex-direction: column; gap: 0.3rem;
}
.card-label {
  font-family: var(--font-mono); font-size: 0.7rem;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted);
}
.card-value {
  font-family: var(--font-mono); font-weight: 700; font-size: 1.7rem;
  color: var(--celeste);
}

/* Paneles */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  margin-bottom: 1.2rem;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 0.9rem; flex-wrap: wrap;
}
.panel-head h2 {
  font-family: var(--font-display); font-size: 1.05rem; margin: 0;
}
.panel-tools { display: flex; gap: 0.6rem; align-items: center; }
.panel-tools input {
  font-family: var(--font-body);
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line); border-radius: 7px;
  background: var(--bg); color: var(--ink);
}
.legend { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 0.3rem 0 0.8rem; }
.sw-sent { background: var(--celeste); }
.sw-recv { background: var(--gold); }
.meta { color: var(--muted); font-size: 0.75rem; margin: 0.6rem 0 0; }

/* Gráfico de barras CSS */
.chart {
  display: flex; align-items: flex-end; gap: 6px;
  height: 140px; padding-top: 0.4rem;
}
.chart .col {
  flex: 1; display: flex; flex-direction: column; justify-content: flex-end;
  gap: 2px; height: 100%; position: relative;
}
.chart .bar { border-radius: 2px 2px 0 0; min-height: 1px; }
.chart .bar.sent { background: var(--celeste); }
.chart .bar.recv { background: var(--gold); }
.chart .col .lbl {
  font-family: var(--font-mono); font-size: 0.58rem;
  color: var(--muted); text-align: center; margin-top: 3px;
}
.chart .col:hover .bar { filter: brightness(1.25); }
.chart .col .tip {
  display: none; position: absolute; bottom: 100%; left: 50%;
  transform: translateX(-50%);
  background: var(--bg); border: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 0.68rem;
  padding: 0.25rem 0.5rem; border-radius: 5px; white-space: nowrap; z-index: 5;
}
.chart .col:hover .tip { display: block; }

/* Tabla */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  font-family: var(--font-mono); font-size: 0.7rem;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--line);
}
th.num { text-align: right; }
td {
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}
td.num { text-align: right; font-family: var(--font-mono); font-size: 0.82rem; }
tr:hover td { background: var(--surface2); }
.u-email { font-family: var(--font-mono); font-size: 0.85rem; color: var(--ink); }

/* Barra de cuota */
.quota-cell { min-width: 160px; }
.quota-bar {
  height: 6px; border-radius: 99px;
  background: var(--line); overflow: hidden; margin-top: 0.3rem;
}
.quota-fill { height: 100%; background: var(--celeste); border-radius: 99px; }
.quota-fill.warn { background: var(--gold); }
.quota-fill.full { background: var(--danger); }
.quota-txt { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); }

.actions-col { text-align: right; }
td.actions { text-align: right; white-space: nowrap; }
td.actions .btn-mini { margin-left: 0.3rem; }

.empty { padding: 2rem 1rem; text-align: center; color: var(--muted); }

/* ── Modales ──────────────────────────────── */
.modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(5, 12, 17, 0.65);
  display: grid; place-items: center; padding: 1rem;
}
.modal-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--celeste);
  border-radius: var(--radius);
  padding: 1.3rem;
  width: min(420px, 96vw);
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.modal-head h3 { font-family: var(--font-display); margin: 0; }
.modal-foot { display: flex; gap: 0.6rem; margin-top: 0.5rem; }

.toast {
  position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%);
  background: var(--celeste-deep); color: #fff;
  padding: 0.6rem 1.1rem; border-radius: 8px;
  font-size: 0.9rem; z-index: 99;
}

/* ── Responsive ───────────────────────────── */
@media (max-width: 800px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .cards { grid-template-columns: 1fr; }
  .panel-tools { width: 100%; }
  .panel-tools input { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
