/* Tipografía: Philosopher (humanista, la más cercana a la del logo) y Nunito (juvenil) como respaldo. Fuentes OFL alojadas en /fonts. */
@font-face { font-family: "Philosopher"; font-weight: 400; font-style: normal; font-display: swap; src: url(fonts/philosopher-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Philosopher"; font-weight: 700; font-style: normal; font-display: swap; src: url(fonts/philosopher-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Nunito"; font-weight: 400; font-style: normal; font-display: swap; src: url(fonts/nunito-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Nunito"; font-weight: 700; font-style: normal; font-display: swap; src: url(fonts/nunito-latin-700-normal.woff2) format("woff2"); }
/* Colores corporativos PROFLUX (tomados del logo y de proflux.com) */
:root {
  --primary: #112244;
  --primary-dark: #0a1630;
  --accent: #f4546f;
  --bg: #f5f5f6;
  --card: #ffffff;
  --text: #1c2733;
  --muted: #637083;
  --line: #e4e4e8;
  --ok: #1e8a4c;
  --warn: #b7791f;
  --bad: #c0392b;
  --radius: 12px;
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 17px; font-family: "Philosopher", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); line-height: 1.45; }
.top { background: #fff; color: var(--primary); display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 20px; box-shadow: 0 2px 12px rgba(17,34,68,.08); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { height: 46px; width: auto; }
.logo { font-weight: 600; letter-spacing: .02em; font-size: 1.35rem; color: var(--primary); font-family: "Palatino Linotype", Palatino, Georgia, serif; }
.logo sup { font-size: .5em; }
.sub { font-size: .72rem; color: var(--muted); border-left: 1px solid var(--line); padding-left: 10px; }
.user { display: flex; align-items: center; gap: 10px; font-size: .9rem; text-align: right; }
.tabs { display: flex; gap: 4px; background: var(--card); border-bottom: 1px solid var(--line); padding: 0 8px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 14px 14px; font: inherit; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--primary); border-color: var(--accent); font-weight: 600; }
main { max-width: 1100px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.4rem; margin: 4px 0 14px; color: var(--primary); }
h2 { font-size: 1.1rem; margin: 0 0 10px; color: var(--primary); }
.card { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; box-shadow: 0 2px 10px rgba(17,34,68,.05); }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat { text-align: center; }
.stat b { display: block; font-size: 2rem; color: var(--primary); }
.stat span { color: var(--muted); font-size: .85rem; }
label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 4px; }
input, select, textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 50%, transparent); outline-offset: 1px; }
.field { margin-bottom: 12px; }
.hint { color: var(--muted); font-size: .8rem; margin-top: 4px; }
.btn { font: inherit; font-weight: 600; background: var(--primary); color: #fff; border: 0; border-radius: 99px; padding: 10px 16px; cursor: pointer; }
.btn:hover { background: var(--primary-dark); }
.btn.accent { background: var(--accent); color: #fff; }
.btn.accent:hover { background: #e03d59; }
.btn.ghost { background: transparent; color: var(--primary); border: 1px solid var(--line); }
.btn.danger { background: var(--bad); }
.btn.sm { padding: 6px 10px; font-size: .85rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.grow { flex: 1 1 220px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .78rem; font-weight: 600; background: #e8edf3; color: var(--muted); }
.badge.ok { background: #e2f4ea; color: var(--ok); }
.badge.warn { background: #fdf1d9; color: var(--warn); }
.badge.bad { background: #fbe4e1; color: var(--bad); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: .9rem; }
th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.checks { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.checks label { display: flex; gap: 10px; align-items: center; font-weight: 500; border: 1px solid var(--line); border-radius: 8px; padding: 10px; cursor: pointer; margin: 0; }
.checks input { width: auto; }
.alert { padding: 10px 12px; border-radius: 8px; background: #fdf1d9; color: #6b4a0a; font-size: .88rem; margin-bottom: 12px; }
.alert.bad { background: #fbe4e1; color: #7b2118; }
.alert.ok { background: #e2f4ea; color: #145c33; }
.toast { position: fixed; left: 16px; right: 16px; top: calc(12px + env(safe-area-inset-top, 0px)); margin: 0 auto; width: fit-content; max-width: min(560px, calc(100vw - 32px)); transform: translateY(-160%); opacity: 0; background: var(--primary-dark); color: #fff; padding: 14px 18px; border-radius: 12px; box-shadow: 0 10px 30px rgba(8,22,48,.3); transition: transform .25s, opacity .25s; z-index: 70; line-height: 1.4; pointer-events: none; }
.toast.show { transform: translateY(0); opacity: 1; pointer-events: auto; }
.toast.err { background: var(--bad); }
.modal-bg { position: fixed; inset: 0; background: rgba(8, 20, 35, .55); display: flex; align-items: flex-start; justify-content: center; padding: 16px; overflow-y: auto; z-index: 40; }
.modal-bg[hidden] { display: none; }
.modal { background: var(--card); border-radius: var(--radius); width: 100%; max-width: 760px; padding: 20px; margin: 20px 0; }
.login { max-width: 420px; margin: 30px auto; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 16px; }
.seg button { flex: 1; padding: 10px; border: 0; background: #fff; font: inherit; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--primary); color: #fff; font-weight: 600; }
.progress { height: 8px; background: #e8edf3; border-radius: 99px; overflow: hidden; min-width: 80px; }
.progress i { display: block; height: 100%; background: var(--ok); }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; font-size: .9rem; }
.list li:last-child { border: 0; }
.muted { color: var(--muted); }
.docrow { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }

/* Tablas → tarjetas en pantallas pequeñas */
@media (max-width: 760px) {
  main { padding: 12px; }
  table.resp thead { display: none; }
  table.resp, table.resp tbody, table.resp tr, table.resp td { display: block; width: 100%; }
  table.resp tr { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; background: #fff; }
  table.resp td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  table.resp td::before { content: attr(data-l); color: var(--muted); font-weight: 600; text-align: left; flex: none; }
  table.resp td.act { justify-content: flex-start; flex-wrap: wrap; }
  table.resp td.act::before { display: none; }
  .user > span { display: none; }
}

.eyebrow { color: var(--accent); font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin: 0; }
h1 { letter-spacing: -.01em; }
.btn.ghost.danger-t { color: var(--bad); }
.pw { position: relative; }
.pw input { padding-right: 46px; }
.eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; display: grid; place-items: center; background: none; border: 0; border-radius: 8px; color: var(--muted); cursor: pointer; }
.eye:hover { color: var(--primary); background: #f0f0f3; }

/* Notificaciones de RRHH */
[hidden] { display: none !important; }
.tabs button { display: inline-flex; align-items: center; }
.tabc, .bellc { background: #e5233d; color: #fff; border-radius: 99px; font-size: .72rem; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center; line-height: 1; font-family: system-ui, sans-serif; }
.tabc { margin-left: 8px; }
.bellwrap { position: relative; }
.bell { position: relative; width: 42px; height: 42px; border: 0; background: transparent; color: var(--primary); border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.bell:hover { background: #f0f0f3; }
.bellc { position: absolute; top: 0; right: -2px; border: 2px solid #fff; box-sizing: content-box; }
.bellp { position: absolute; right: 0; top: 48px; width: min(380px, calc(100vw - 24px)); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(17,34,68,.18); z-index: 30; max-height: 70vh; overflow: auto; text-align: left; }
.bellh { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--primary); }
.linkbtn { background: none; border: 0; color: var(--accent); font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer; }
.bellit { display: flex; justify-content: space-between; gap: 10px; width: 100%; text-align: left; background: #fff; border: 0; border-bottom: 1px solid var(--line); padding: 12px 14px; font: inherit; font-size: .9rem; color: var(--text); cursor: pointer; }
.bellit:hover { background: #f6f6f8; }
.bellit.un { background: #fff4f6; }
.bellit small { color: var(--muted); white-space: nowrap; }
@media (max-width: 760px) { .bellp { position: fixed; left: 12px; right: 12px; top: 66px; width: auto; } }
@media (max-width: 520px) {
  .top { padding: 8px 12px; gap: 8px; }
  .brand img { height: 38px; width: auto; }
  .sub { font-size: .68rem; max-width: 104px; line-height: 1.2; }
}
.chip { font: inherit; font-size: .74rem; font-family: Consolas, monospace; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--line); background: #fff; color: var(--primary); cursor: pointer; }
.chip:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Carpeta del empleado: ventana ancha que aprovecha la pantalla; los documentos se reparten en columnas */
.modal.wide { max-width: min(1400px, 96vw); }
.docgrid { display: grid; grid-template-columns: 1fr; column-gap: 24px; }
@media (min-width: 1000px) { .docgrid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1500px) { .modal.wide { max-width: min(1600px, 96vw); } }
@media (max-width: 520px) { .modal-bg { padding: 0; } .modal { border-radius: 0; margin: 0; min-height: 100%; padding: 16px 14px; } }
@media (min-width: 1100px) {
  .modal.wide { display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; align-items: start; }
  .modal.wide > * { grid-column: 1 / -1; }
  .modal.wide > #ctr, .modal.wide > #ing { grid-column: auto; min-width: 0; }
  .modal.wide > #ctr:empty + #ing, .modal.wide > #ing:empty { grid-column: 1 / -1; }
}
