/* VIVAS Team — mismos tokens que el Time Clock y la página de empleos. */
@font-face { font-family: 'Poppins'; font-weight: 400; font-display: swap; src: url('/fonts/poppins-400-latin.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 500; font-display: swap; src: url('/fonts/poppins-500-latin.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 600; font-display: swap; src: url('/fonts/poppins-600-latin.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 700; font-display: swap; src: url('/fonts/poppins-700-latin.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 800; font-display: swap; src: url('/fonts/poppins-800-latin.woff2') format('woff2'); }

:root {
  --navy: #00163c; --navy-2: #16356b; --navy-3: #2f63c4; --energy: #009ADE;
  --tint: #f3f6fc; --tint-2: #e9eef8; --line: #e3e8f1; --bg: #f4f6fb; --white: #fff;
  --ink: #0f1b2d; --gray: #6b7686; --gray-soft: #97a1b1;
  --ok: #1f9d55; --ok-t: #e7f6ee; --amber: #b9760a; --amber-t: #fdf3e2; --warn: #d0271e; --warn-t: #fdecea;
  --grad-btn: linear-gradient(135deg, #2f63c4 0%, #16356b 55%, #00163c 100%);
  --r: 22px; --rs: 14px;
  --shadow: 0 10px 30px rgba(16, 35, 80, .08); --shadow-s: 0 4px 16px rgba(16, 35, 80, .06);
  --font: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
a { color: var(--navy-3); }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--energy); outline-offset: 2px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; font-size: .88rem;
  padding: 11px 20px; border-radius: 999px; border: 0; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn-navy { background: var(--grad-btn); color: #fff; box-shadow: 0 10px 24px rgba(22, 53, 107, .28); }
.btn-quiet { background: var(--tint-2); color: var(--navy); }
.btn-quiet:hover { background: #dbe5f6; }
.btn-danger { background: var(--warn-t); color: var(--warn); }
.btn-sm { padding: 7px 14px; font-size: .8rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: progress; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--navy-3); font-weight: 600; cursor: pointer; font-size: .82rem; }

/* Gate */
.gate { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.gate-card { width: 100%; max-width: 380px; background: var(--white); border-radius: var(--r); box-shadow: var(--shadow); padding: 34px 28px; text-align: center; }
.gate-logo { height: 22px; }
.gate h1 { font-size: 1.7rem; font-weight: 800; color: var(--navy); margin: 14px 0 6px; }
.gate p { color: var(--gray); font-size: .9rem; margin: 0 0 22px; }
.gate-msg { background: var(--warn-t); color: #8f1610 !important; border-radius: 12px; padding: 10px 12px; margin: 14px 0 0 !important; font-size: .84rem !important; }
.gate-foot { font-size: .8rem !important; margin: 14px 0 0 !important; }

/* Shell */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100%; }
.side { background: var(--white); border-right: 1px solid var(--line); padding: 22px 14px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 0 10px; }
.brand img { height: 18px; }
.brand span { font-weight: 800; color: var(--navy); }
.side nav { display: grid; gap: 4px; }
.side nav a { padding: 10px 12px; border-radius: 12px; color: var(--gray); text-decoration: none; font-weight: 600; font-size: .9rem; }
.side nav a.on { background: var(--tint-2); color: var(--navy); }
.me { margin-top: auto; padding: 0 10px; font-size: .78rem; color: var(--gray); display: grid; gap: 4px; word-break: break-all; }
.main { padding: 28px 32px 60px; min-width: 0; outline: none; }
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side nav { display: flex; gap: 4px; }
  .me { margin: 0 0 0 auto; display: flex; gap: 10px; align-items: center; }
  .me span { display: none; }
  .main { padding: 20px 16px 48px; }
}

/* Page header */
.ph { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.ph h1 { font-size: 1.5rem; font-weight: 800; color: var(--navy); }
.ph .sub { color: var(--gray); font-size: .86rem; }
.back { font-size: .84rem; font-weight: 600; text-decoration: none; display: inline-block; margin-bottom: 10px; }

.card { background: var(--white); border-radius: var(--r); box-shadow: var(--shadow-s); padding: 20px; }
.card + .card { margin-top: 14px; }
.card h2 { font-size: 1rem; font-weight: 800; color: var(--navy); margin-bottom: 12px; }

/* Tables */
.tbl { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .86rem; font-variant-numeric: tabular-nums; }
th { text-align: left; font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--gray-soft); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
tr.link { cursor: pointer; }
tr.link:hover td { background: var(--tint); }
td .n { font-weight: 600; } td .t { display: block; font-size: .76rem; color: var(--gray); }
.num { text-align: right; }

.chip { display: inline-block; font-size: .72rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.c-ok { background: var(--ok-t); color: var(--ok); } .c-am { background: var(--amber-t); color: var(--amber); }
.c-wr { background: var(--warn-t); color: var(--warn); } .c-nt { background: var(--tint-2); color: var(--navy); }

.empty { color: var(--gray); font-size: .9rem; padding: 18px 4px; }
.banner { border-radius: var(--rs); padding: 12px 14px; font-size: .86rem; margin-bottom: 14px; }
.banner.warn { background: var(--warn-t); color: #8f1610; } .banner.am { background: var(--amber-t); color: #6d4506; } .banner.info { background: var(--tint-2); color: var(--navy); }

/* Person */
.head { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-bottom: 18px; }
.av { width: 52px; height: 52px; border-radius: 50%; background: var(--tint-2); display: grid; place-items: center; font-weight: 800; color: var(--navy); flex: none; }
.head h1 { font-size: 1.45rem; font-weight: 800; color: var(--navy); }
.head .sub { color: var(--gray); font-size: .86rem; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.kpi { background: var(--white); border-radius: var(--rs); padding: 14px 16px; box-shadow: var(--shadow-s); }
.kpi small { display: block; font-size: .72rem; color: var(--gray); font-weight: 600; }
.kpi b { font-size: 1.3rem; color: var(--navy); font-variant-numeric: tabular-nums; }
.kpi em { display: block; font-style: normal; font-size: .74rem; color: var(--gray); }
@media (max-width: 760px) { .kpis { grid-template-columns: 1fr 1fr; } }
.tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 9px 0; color: var(--gray); font-weight: 600; text-decoration: none; white-space: nowrap; font-size: .9rem; }
.tabs a.on { color: var(--navy); box-shadow: inset 0 -2px 0 var(--navy); }

.docs { display: grid; gap: 8px; }
.doc { display: grid; grid-template-columns: 1fr auto; gap: 10px 14px; align-items: center; padding: 13px 16px; border-radius: var(--rs); background: var(--white); box-shadow: var(--shadow-s); }
.doc.i9 { box-shadow: inset 0 0 0 1.5px var(--line); background: transparent; }
.doc b { font-weight: 600; } .doc small { display: block; color: var(--gray); font-size: .78rem; }
.doc .acts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; align-items: center; }
.files { grid-column: 1 / -1; display: grid; gap: 4px; }
.file { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .8rem; color: var(--gray); background: var(--tint); border-radius: 10px; padding: 7px 10px; }
.file .fn { color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
.file .sp { margin-left: auto; display: flex; gap: 10px; }
@media (max-width: 560px) { .doc { grid-template-columns: 1fr; } .doc .acts { justify-content: flex-start; } }

/* Forms */
.form { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0 14px; }
.f { grid-column: span 3; margin-bottom: 14px; min-width: 0; }
.f.s2 { grid-column: span 2; } .f.s6 { grid-column: span 6; }
@media (max-width: 620px) { .form { grid-template-columns: 1fr; } .f, .f.s2, .f.s6 { grid-column: 1 / -1; } }
.f label { display: block; font-size: .78rem; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.f input, .f select { width: 100%; font: inherit; font-size: .95rem; color: var(--ink); background: var(--tint); border: 1.5px solid transparent; border-radius: 12px; padding: 11px 12px; min-height: 46px; }
.f input:focus, .f select:focus { outline: none; background: var(--white); border-color: var(--navy-3); box-shadow: 0 0 0 4px rgba(47, 99, 196, .14); }
.f.bad input, .f.bad select { border-color: var(--warn); background: var(--warn-t); }
.f .err { display: none; color: var(--warn); font-size: .76rem; font-weight: 600; margin-top: 5px; }
.f.bad .err { display: block; }
.f .help { color: var(--gray); font-size: .76rem; margin-top: 5px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }

/* Period nav */
.pnav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pnav b { font-size: .9rem; color: var(--navy); }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0, 13, 36, .55); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal-card { background: var(--white); border-radius: var(--r); box-shadow: var(--shadow); width: 100%; max-width: 960px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; overflow: hidden; }
.modal-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 1rem; color: var(--navy); overflow-wrap: anywhere; }
.modal-actions { display: flex; gap: 8px; }
.viewer-body { flex: 1; min-height: 60vh; background: var(--tint); display: grid; place-items: center; overflow: auto; }
.viewer-body iframe { width: 100%; height: 100%; min-height: 70vh; border: 0; background: #fff; }
.viewer-body img { max-width: 100%; height: auto; display: block; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 999px; font-size: .88rem; font-weight: 600; box-shadow: var(--shadow); z-index: 60; max-width: calc(100% - 32px); text-align: center; }
.toast.bad { background: var(--warn); }

/* Contratación */
.hire { margin-bottom: 14px; }
.hire-row { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.hire-row:first-of-type { border-top: 0; }
.hire-row b { font-weight: 700; color: var(--navy); font-size: .9rem; }
.hire-row small { display: block; color: var(--gray); font-size: .78rem; }
.hire-row .acts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
@media (max-width: 620px) { .hire-row { grid-template-columns: 1fr; } .hire-row .acts { justify-content: flex-start; } }
.navsep { height: 1px; background: var(--line); margin: 8px 12px; }
.card h2 + .form { margin-top: 2px; }
@media (max-width: 820px) { .navsep { display: none; } .side nav { flex-wrap: wrap; } }
