/* ============================================================================
 * app.css — Estilos del módulo RRHH (panel autenticado + página de encuesta).
 * ========================================================================== */

/* ── Login gate ─────────────────────────────────────────────────────────────── */
body.rrhh-locked #app{ display:none !important; }
#loginScreen{
  position:fixed; inset:0; z-index:9999;
  background:linear-gradient(165deg,#eef2ea 0%,#e1e9d9 100%);
  display:flex; align-items:center; justify-content:center; padding:20px;
  transition:opacity .35s ease, visibility .35s ease;
}
:root[data-theme="dark"] #loginScreen{ background:linear-gradient(165deg,#12160f 0%,#0b0e08 100%); }
body.authenticated #loginScreen{ opacity:0; visibility:hidden; pointer-events:none; }
.login-card{
  background:var(--pr-surface); border-radius:24px; padding:40px 34px 26px;
  max-width:400px; width:100%; text-align:center; box-shadow:var(--pr-shadow-lg);
}
.login-brand{ display:flex; align-items:center; justify-content:center; gap:13px; margin:4px 0 20px; }
.login-dot{ width:34px; height:34px; border-radius:50%;
  background:radial-gradient(circle at 38% 34%, #5cb24a 0%, #2f7d24 78%);
  box-shadow:0 0 0 7px rgba(54,124,43,.14); }
.login-brandname{ font-size:30px; font-weight:800; color:var(--pr-green-deep); letter-spacing:-.5px; }
.login-title{ font-size:18px; font-weight:800; color:var(--pr-green-deep); margin:0 0 8px; }
.login-subtitle{ color:var(--pr-grey-600); font-size:14.5px; line-height:1.45; margin:0 auto 22px; max-width:300px; }
.login-btn{ display:flex; align-items:center; justify-content:center; gap:12px; padding:15px 28px; width:100%;
  background:linear-gradient(180deg,#418a33 0%,#2d6b22 100%); color:#fff; border:0; border-radius:13px;
  font-size:16px; font-weight:700; cursor:pointer; box-shadow:0 8px 20px rgba(45,107,34,.28); }
.login-btn:hover{ filter:brightness(1.06); }
.login-hint{ margin:18px 0 2px; font-size:12.5px; color:var(--pr-grey-600); }
.login-loading{ display:inline-flex; align-items:center; gap:12px; padding:14px 28px; color:var(--pr-grey-600); font-size:14px; }
.login-spinner{ width:18px; height:18px; border:2.5px solid var(--pr-line); border-top-color:var(--pr-green);
  border-radius:50%; animation:spin .7s linear infinite; }
@keyframes spin{ to{ transform:rotate(360deg); } }
.login-error{ margin:14px 0 0; padding:10px 14px; background:var(--pr-danger-bg); color:var(--pr-danger);
  border-radius:8px; font-size:12.5px; font-weight:600; text-align:left; }

/* ── App shell ──────────────────────────────────────────────────────────────── */
.app-header{ background:var(--pr-grad-header); color:#fff; padding:14px 20px;
  display:flex; align-items:center; justify-content:space-between; box-shadow:var(--pr-shadow-sm); }
.app-brand{ display:flex; align-items:center; gap:12px; }
.app-logo-dot{ width:30px; height:30px; border-radius:50%;
  background:radial-gradient(circle at 38% 34%, #7fd06e 0%, #367C2B 80%); box-shadow:0 0 0 4px rgba(255,255,255,.15); }
.app-h1{ font-size:19px; font-weight:800; margin:0; letter-spacing:-.3px; }
.app-subtitle{ font-size:12px; margin:0; opacity:.85; }
.app-header-acts{ display:flex; align-items:center; gap:8px; }
.hbtn{ background:rgba(255,255,255,.14); color:#fff; border:0; border-radius:10px; padding:8px 10px;
  cursor:pointer; font-size:14px; }
.hbtn:hover{ background:rgba(255,255,255,.24); }
.user-badge{ font-size:12.5px; opacity:.95; }
.user-badge .salir{ text-decoration:underline; cursor:pointer; margin-left:8px; font-weight:600; }

main{ max-width:1080px; margin:0 auto; padding:24px 20px 60px; }

/* ── Cards / tiles ──────────────────────────────────────────────────────────── */
.card{ background:var(--pr-surface); border:1px solid var(--pr-line); border-radius:var(--pr-r-lg);
  padding:22px; box-shadow:var(--pr-shadow-sm); margin-bottom:20px; }
.card h2{ margin:0 0 4px; font-size:17px; }
.card .muted{ color:var(--pr-grey-600); font-size:13.5px; margin:0 0 16px; }

.tiles{ display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:16px; }
.tile{ background:var(--pr-surface); border:1px solid var(--pr-line); border-radius:var(--pr-r-lg);
  padding:20px; cursor:pointer; transition:transform var(--pr-dur-fast), box-shadow var(--pr-dur-fast); }
.tile:hover{ transform:translateY(-2px); box-shadow:var(--pr-shadow-md); border-color:var(--pr-green-light); }
.tile.disabled{ opacity:.5; cursor:not-allowed; }
.tile .ico{ font-size:26px; }
.tile .t{ font-weight:700; margin:8px 0 4px; }
.tile .d{ font-size:12.5px; color:var(--pr-grey-600); }

.btn{ background:var(--pr-green); color:#fff; border:0; border-radius:var(--pr-r-md); padding:11px 18px;
  font-weight:700; font-size:14px; cursor:pointer; }
.btn:hover{ filter:brightness(1.06); }
.btn.secondary{ background:var(--pr-surface-2); color:var(--pr-ink); border:1px solid var(--pr-line); }
.btn:disabled{ opacity:.55; cursor:not-allowed; }

.pill{ display:inline-block; padding:3px 10px; border-radius:var(--pr-r-pill); font-size:11.5px; font-weight:700; }
.pill.ok{ background:var(--pr-success-bg); color:var(--pr-success); }
.pill.pend{ background:var(--pr-warning-bg); color:var(--pr-warning); }

/* ── Acceso denegado ────────────────────────────────────────────────────────── */
.noaccess{ max-width:460px; margin:8vh auto; text-align:center; }
.noaccess .ico{ font-size:44px; }
.noaccess h2{ margin:12px 0 6px; }
.noaccess p{ color:var(--pr-grey-600); }

/* ── Tabla / lista buscable ─────────────────────────────────────────────────── */
.searchbar{ width:100%; padding:11px 14px; border:1px solid var(--pr-line); border-radius:var(--pr-r-md);
  background:var(--pr-surface); color:var(--pr-ink); font-size:14px; margin-bottom:14px; }
table{ width:100%; border-collapse:collapse; font-size:13.5px; }
th,td{ text-align:left; padding:9px 12px; border-bottom:1px solid var(--pr-line); }
th{ color:var(--pr-grey-600); font-weight:700; font-size:12px; text-transform:uppercase; letter-spacing:.4px; }
tr:hover td{ background:var(--pr-row-hover); }

/* ── Tabs de la sección Encuesta ────────────────────────────────────────────── */
.enc-tabs{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:16px; }
.enc-tab{ background:var(--pr-surface); border:1px solid var(--pr-line); border-radius:var(--pr-r-pill);
  padding:9px 16px; font-weight:700; font-size:13.5px; cursor:pointer; color:var(--pr-ink); }
.enc-tab:hover:not(:disabled){ border-color:var(--pr-green-light); }
.enc-tab.active{ background:var(--pr-green); color:#fff; border-color:var(--pr-green); }
.enc-tab:disabled{ opacity:.5; cursor:not-allowed; }
.fld{ display:block; font-size:13px; color:var(--pr-grey-600); font-weight:600; margin:10px 0; }
.fld input, .fld textarea{ margin-top:5px; }

/* ── Encuesta pública ───────────────────────────────────────────────────────── */
.survey{ max-width:720px; margin:0 auto; padding:24px 20px 80px; }
.survey-head{ text-align:center; margin-bottom:8px; }
.survey-demo{ background:var(--pr-surface-2); border:1px solid var(--pr-line); border-radius:var(--pr-r-md);
  padding:12px 16px; font-size:13px; color:var(--pr-grey-600); margin:16px 0 26px; }
.survey-demo b{ color:var(--pr-ink); }
.q{ background:var(--pr-surface); border:1px solid var(--pr-line); border-radius:var(--pr-r-md); padding:16px 18px; margin-bottom:14px; }
.q .q-text{ font-weight:600; margin-bottom:12px; }
.scale{ display:flex; gap:8px; flex-wrap:wrap; }
.scale label{ flex:1; min-width:88px; text-align:center; border:1px solid var(--pr-line); border-radius:var(--pr-r-md);
  padding:10px 6px; cursor:pointer; font-size:12.5px; }
.scale input{ display:block; margin:0 auto 6px; }
.scale label:has(input:checked){ border-color:var(--pr-green); background:var(--pr-success-bg); color:var(--pr-success); font-weight:700; }
