/* ===========================================================
   APEL TDF — Estilos de la autogestión (login, panel, admin)
   Reutiliza la paleta de ../styles.css
   =========================================================== */
:root {
  --azul-900: #0a2540; --azul-700: #103a66; --azul-500: #1d5fa8; --azul-300: #4b8fd6;
  --cian: #18b6c4; --ambar: #f5a623; --ambar-d: #e08e08;
  --tinta: #16212e; --gris: #5b6b7b; --linea: #e3e9f0; --bg-alt: #f4f7fb;
  --ok: #1ca672; --ok-bg: #e3f7ee; --no: #d64545; --no-bg: #fdeaea;
  --ff-title: "Sora", system-ui, sans-serif; --ff-body: "Inter", system-ui, sans-serif;
  --shadow: 0 10px 30px rgba(16,58,102,.10); --shadow-lg: 0 24px 60px rgba(10,37,64,.18);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--ff-body); color: var(--tinta); background: var(--bg-alt); line-height: 1.6; }
a { color: var(--azul-500); }
h1,h2,h3 { font-family: var(--ff-title); }

/* ---- App bar ---- */
.appbar { background: #fff; border-bottom: 1px solid var(--linea); position: sticky; top: 0; z-index: 20; }
.appbar__inner { max-width: 1000px; margin: 0 auto; display: flex; align-items: center; gap: 1rem; padding: .8rem 1.2rem; }
.appbar__brand { display: flex; align-items: center; gap: .6rem; font-family: var(--ff-title); font-weight: 800; color: var(--azul-900); }
.appbar__brand img { height: 40px; width: 40px; border-radius: 50%; object-fit: cover; }
.appbar__spacer { margin-left: auto; }
.appbar__user { color: var(--gris); font-size: .9rem; }

.wrap { max-width: 1000px; margin: 0 auto; padding: 1.6rem 1.2rem 3rem; }

/* ---- Botones ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; font-family: var(--ff-title); font-weight: 600; border: 2px solid transparent; border-radius: 999px; padding: .65rem 1.3rem; cursor: pointer; font-size: .95rem; transition: transform .15s, background .2s; }
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--ambar); color: var(--azul-900); }
.btn--primary:hover { background: var(--ambar-d); }
.btn--blue { background: var(--azul-700); color: #fff; }
.btn--blue:hover { background: var(--azul-500); }
.btn--ghost { background: transparent; border-color: var(--linea); color: var(--azul-700); }
.btn--ghost:hover { border-color: var(--azul-300); }
.btn--sm { padding: .4rem .9rem; font-size: .85rem; }
.btn--block { width: 100%; }
.btn--danger { background: var(--no-bg); color: var(--no); }

/* ---- Tarjetas ---- */
.card { background: #fff; border: 1px solid var(--linea); border-radius: 16px; box-shadow: var(--shadow); padding: 1.6rem; }
.card + .card { margin-top: 1.4rem; }
.card h2 { margin: 0 0 1rem; color: var(--azul-900); font-size: 1.3rem; }

/* ---- Formularios ---- */
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: .85rem; font-weight: 600; color: var(--azul-900); margin-bottom: .3rem; }
.field input, .field select, .field textarea { width: 100%; padding: .7rem .85rem; border: 1.5px solid var(--linea); border-radius: 10px; font-family: var(--ff-body); font-size: .95rem; background: #fbfdff; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--azul-300); box-shadow: 0 0 0 3px rgba(75,143,214,.18); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ---- Mensajes ---- */
.msg { padding: .7rem 1rem; border-radius: 10px; font-size: .9rem; margin-bottom: 1rem; display: none; }
.msg.show { display: block; }
.msg--err { background: var(--no-bg); color: var(--no); }
.msg--ok { background: var(--ok-bg); color: var(--ok); }

/* ---- Login ---- */
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 1.2rem;
  background: radial-gradient(900px 500px at 80% -10%, rgba(24,182,196,.35), transparent 60%), linear-gradient(135deg, var(--azul-900), var(--azul-700)); }
.login-box { width: 100%; max-width: 410px; background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); padding: 2rem; }
.login-box__logo { display: flex; flex-direction: column; align-items: center; gap: .5rem; margin-bottom: 1.4rem; }
.login-box__logo img { height: 84px; width: 84px; border-radius: 50%; object-fit: cover; box-shadow: var(--shadow); }
.login-box__logo strong { font-family: var(--ff-title); color: var(--azul-900); font-size: 1.4rem; }
.login-box__logo span { color: var(--gris); font-size: .82rem; text-align: center; }
.login-tabs { display: flex; gap: .4rem; margin-bottom: 1.2rem; background: var(--bg-alt); padding: .3rem; border-radius: 12px; }
.login-tabs button { flex: 1; border: 0; background: transparent; padding: .55rem; border-radius: 9px; font-weight: 600; color: var(--gris); cursor: pointer; font-size: .9rem; }
.login-tabs button.is-active { background: #fff; color: var(--azul-900); box-shadow: var(--shadow); }
.login-link { background: none; border: 0; color: var(--azul-500); cursor: pointer; font-size: .85rem; text-decoration: underline; padding: 0; margin-top: .8rem; }

/* ---- Carnet ---- */
.carnet { background: linear-gradient(135deg, var(--azul-900), var(--azul-500)); color: #fff; border-radius: 18px; padding: 1.6rem; position: relative; overflow: hidden; box-shadow: var(--shadow-lg); }
/* Foto del salón esfumada de fondo (debajo de la info) */
.carnet::before { content: ""; position: absolute; inset: -14px; z-index: 0; background: url('../assets/carnet-bg.jpg') center/cover no-repeat; filter: blur(5px) brightness(.55) saturate(1.15); opacity: .5; }
.carnet::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: rgba(245,166,35,.25); z-index: 0; }
.carnet__body, .carnet__qr { position: relative; z-index: 1; }
.carnet__head { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.2rem; position: relative; z-index: 1; }
.carnet__head img { height: 46px; width: 46px; border-radius: 50%; object-fit: cover; background: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,.6); }
.carnet__head strong { font-family: var(--ff-title); letter-spacing: .5px; }
.carnet__head small { display: block; opacity: .8; font-size: .72rem; }
.carnet__body { display: flex; justify-content: space-between; gap: 1rem; position: relative; z-index: 1; align-items: flex-end; }
.carnet__data dt { font-size: .68rem; text-transform: uppercase; letter-spacing: .8px; opacity: .75; margin-top: .6rem; }
.carnet__data dd { margin: 0; font-size: 1.05rem; font-weight: 600; }
.carnet__data dd.big { font-size: 1.5rem; font-family: var(--ff-title); }
.carnet__qr { background: #fff; padding: 8px; border-radius: 10px; line-height: 0; }
.carnet__qr img, .carnet__qr canvas { display: block; width: 104px; height: 104px; }
.estado { display: inline-block; padding: .25rem .8rem; border-radius: 999px; font-weight: 700; font-size: .8rem; }
.estado--activo { background: var(--ok); color: #fff; }
.estado--inactivo { background: var(--no); color: #fff; }

/* ---- Notificaciones ---- */
.notif { border-left: 4px solid var(--azul-300); background: var(--bg-alt); border-radius: 0 10px 10px 0; padding: .9rem 1.1rem; margin-bottom: .8rem; }
.notif--general { border-color: var(--ambar); }
.notif__top { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.notif__top strong { color: var(--azul-900); }
.notif__date { color: var(--gris); font-size: .78rem; white-space: nowrap; }
.notif__badge { font-size: .65rem; text-transform: uppercase; letter-spacing: .5px; background: var(--ambar); color: var(--azul-900); padding: .1rem .5rem; border-radius: 5px; font-weight: 700; margin-left: .4rem; }
.empty { text-align: center; color: var(--gris); padding: 2rem; }

/* ---- Tabla admin ---- */
.tabla { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tabla th, .tabla td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--linea); }
.tabla th { font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; color: var(--gris); }
.tabla tr:hover td { background: var(--bg-alt); }
.pill { font-size: .72rem; font-weight: 700; padding: .2rem .6rem; border-radius: 999px; }
.pill--activo { background: var(--ok-bg); color: var(--ok); }
.pill--inactivo { background: var(--no-bg); color: var(--no); }
.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.toolbar input { flex: 1; min-width: 180px; padding: .6rem .85rem; border: 1.5px solid var(--linea); border-radius: 10px; }
.rolsel { padding: .3rem .5rem; border: 1.5px solid var(--linea); border-radius: 8px; font-size: .8rem; margin-right: .3rem; background: #fff; }

@media (max-width: 620px) {
  .row2 { grid-template-columns: 1fr; }
  .carnet__body { flex-direction: column; align-items: stretch; }
  .carnet__qr { align-self: center; }
  .tabla thead { display: none; }
  .tabla, .tabla tbody, .tabla tr, .tabla td { display: block; width: 100%; }
  .tabla tr { border: 1px solid var(--linea); border-radius: 10px; margin-bottom: .8rem; padding: .4rem; }
  .tabla td { border: 0; padding: .35rem .5rem; }
  .tabla td::before { content: attr(data-label); font-weight: 700; color: var(--gris); display: inline-block; min-width: 110px; }
}
