/* Sbeltia ID — hoja única, sin dependencias. Tema claro/oscuro por sistema. */

:root {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --border: #e3e8f0;
  --text: #1b2330;
  --muted: #6b7688;
  --brand: #2f6bff;
  --brand-ink: #ffffff;
  --ok-bg: #e7f7ec; --ok-ink: #1f7a3d;
  --err-bg: #fdecec; --err-ink: #b4232a;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(20, 33, 61, .08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e131b;
    --panel: #161d29;
    --border: #263143;
    --text: #eef2f8;
    --muted: #9aa6b8;
    --brand: #5b8bff;
    --brand-ink: #0e131b;
    --ok-bg: #14311f; --ok-ink: #7fe0a0;
    --err-bg: #3a1a1c; --err-ink: #ff9ba0;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--brand); }

.foot {
  margin-top: auto;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* ── Tarjeta central (login) ─────────────────────────────────────────────── */
.auth {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.card {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}
.brand {
  text-align: center;
  margin-bottom: 20px;
}
.brand .logo {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--brand);
  color: var(--brand-ink);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 22px;
  margin-bottom: 10px;
}
.brand h1 { margin: 0; font-size: 20px; }
.brand p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }
input[type=email], input[type=password], input[type=text] {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
}
input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }

.btn {
  display: block; width: 100%;
  margin-top: 18px;
  padding: 12px;
  border: 0; border-radius: 10px;
  background: var(--brand); color: var(--brand-ink);
  font-size: 15px; font-weight: 700;
  cursor: pointer;
  text-align: center; text-decoration: none;
}
.btn:hover { filter: brightness(1.05); }
.btn.google {
  background: var(--panel); color: var(--text);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.btn.google svg { width: 18px; height: 18px; }

.sep { display: flex; align-items: center; gap: 12px; margin: 20px 0 6px; color: var(--muted); font-size: 13px; }
.sep::before, .sep::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.notice { padding: 10px 12px; border-radius: 10px; font-size: 14px; margin-bottom: 8px; }
.notice.err { background: var(--err-bg); color: var(--err-ink); }
.notice.ok  { background: var(--ok-bg);  color: var(--ok-ink); }

/* ── Portal ──────────────────────────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.topbar .who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar .who b { font-size: 15px; }
.topbar .who span { color: var(--muted); font-size: 13px; }
.topbar a.link { color: var(--muted); text-decoration: none; font-size: 14px; }
.topbar a.link:hover { color: var(--text); }

.wrap { width: 100%; max-width: 920px; margin: 0 auto; padding: 24px 20px; }
.wrap h2 { font-size: 16px; color: var(--muted); font-weight: 600; margin: 0 0 16px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.tile {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform .08s ease;
}
.tile:hover { transform: translateY(-2px); }
.tile .ico {
  width: 54px; height: 54px; margin: 0 auto 12px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 800; color: #fff;
}
.tile b { display: block; font-size: 15px; }
.tile small { color: var(--muted); }

.empty { color: var(--muted); background: var(--panel); border: 1px dashed var(--border); border-radius: var(--radius); padding: 28px; text-align: center; }

/* ── Tablas de admin ─────────────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
.table th { color: var(--muted); font-weight: 600; background: var(--bg); }
.table tr:last-child td { border-bottom: 0; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; background: var(--bg); border: 1px solid var(--border); color: var(--muted); }
.nav { display: flex; gap: 16px; margin-bottom: 18px; }
.nav a { color: var(--muted); text-decoration: none; font-size: 14px; }
.nav a.active, .nav a:hover { color: var(--text); }
