/* ============================================================
   Proingesa Intranet — Estilos de aplicación (componentes)
   Requiere: fonts.css + tokens.css (variables --px-*)
   ============================================================ */
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--px-bg); color: var(--px-ink); font-family: var(--px-body); -webkit-font-smoothing: antialiased; line-height: 1.5; }
h1,h2,h3,h4,h5 { margin: 0; font-family: var(--px-display); letter-spacing: -.01em; }
a { color: inherit; }
.mono-num { font-variant-numeric: tabular-nums; }
.muted { color: var(--px-ink-3); }

/* ---- Logo theme-aware (negro en claro, blanco en oscuro) ---- */
.px-logo { display: inline-flex; align-items: center; }
.px-logo-img { height: var(--logo-h, 30px); width: auto; display: block; }
.px-logo .on-dark { display: none; }
:root[data-theme="dark"] .px-logo .on-light { display: none; }
:root[data-theme="dark"] .px-logo .on-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .px-logo .on-light { display: none; }
  :root:not([data-theme]) .px-logo .on-dark { display: block; }
}

/* ---- Iconos sólidos ---- */
.ic-svg { display: block; }
.nav-item .em { display: inline-flex; align-items: center; justify-content: center; width: 20px; }
.nav-item .lock { display: inline-flex; align-items: center; }

/* ---- Accesos directos ---- */
.shortcuts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.shortcut { display: flex; flex-direction: column; gap: 8px; padding: 13px; border: 1px solid var(--px-line); border-radius: var(--px-radius-sm); background: var(--px-surface); text-decoration: none; color: var(--px-ink); transition: .15s; box-shadow: var(--px-sh-sm); }
.shortcut:hover { border-color: var(--px-blue); transform: translateY(-2px); box-shadow: var(--px-sh-md); }
.shortcut .ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--px-blue-wash); color: var(--px-blue-deep); }
.shortcut span { font-size: 12.5px; font-weight: 700; font-family: var(--px-display); }
.shortcut small { color: var(--px-ink-3); font-size: 11px; }
@media (max-width: 600px) { .shortcuts { grid-template-columns: repeat(2, 1fr); } }

/* ---- Marca ---- */
.brandmark { display: inline-flex; align-items: center; gap: 10px; }
.brandmark .iso { width: 30px; height: 30px; flex: none; }
.brandmark .word { font-family: var(--px-display); font-weight: 800; letter-spacing: .14em; font-size: 18px; color: var(--px-ink); }

/* ---- Layout app (sidebar + contenido) ---- */
.layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--px-surface); border-right: 1px solid var(--px-line); display: flex; flex-direction: column; padding: 18px 14px; gap: 3px; position: sticky; top: 0; height: 100vh; }
.side .brandmark { padding: 6px 8px 16px; }
/* La lista de navegación ocupa el alto disponible y hace scroll propio;
   así la ficha de perfil (.side-foot) queda siempre fija abajo, aun con el menú largo (admin/rrhh). */
.side-nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; }
.side-nav::-webkit-scrollbar { width: 6px; }
.side-nav::-webkit-scrollbar-thumb { background: var(--px-line-2); border-radius: 3px; }
.side-nav { scrollbar-width: thin; }
.nav-label { font-family: var(--px-display); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--px-ink-3); padding: 14px 10px 6px; font-weight: 700; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 10px; color: var(--px-ink-2); font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; }
.nav-item .em { width: 18px; text-align: center; flex: none; }
.nav-item:hover { background: var(--px-surface-3); color: var(--px-ink); }
.nav-item.active { background: var(--px-grad-blue); color: #fff; box-shadow: var(--px-sh-blue); }
.nav-item .lock { margin-left: auto; font-size: 11px; opacity: .65; }
.nav-item .badge { margin-left: auto; background: var(--px-red); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 999px; font-weight: 700; font-family: var(--px-display); }
.side-foot { flex: none; display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px; border-top: 1px solid var(--px-line); }
.side-foot .who { font-family: var(--px-display); font-size: 12.5px; color: var(--px-ink); font-weight: 700; line-height: 1.2; }
.side-foot .who small { display: block; color: var(--px-ink-3); font-weight: 500; font-family: var(--px-body); }

.av { border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-family: var(--px-display); background: var(--px-grad-blue); flex: none; }
.av.has-photo { background-size: cover; background-position: center; color: transparent; }
.av.sm { width: 32px; height: 32px; font-size: 13px; }
.av.md { width: 38px; height: 38px; font-size: 14px; }
.av.lg { width: 60px; height: 60px; font-size: 21px; }
.av.c2{background:linear-gradient(135deg,#e78a4f,#d4682f)}.av.c3{background:linear-gradient(135deg,#55bd8a,#2f9a5f)}.av.c4{background:linear-gradient(135deg,#a07fe0,#7a4fb0)}.av.c5{background:linear-gradient(135deg,#e0b84f,#b0892f)}.av.c6{background:linear-gradient(135deg,#4fbdd0,#2f9ab0)}

.main { background: var(--px-surface-2); min-width: 0; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 14px 24px; background: var(--px-surface); border-bottom: 1px solid var(--px-line); position: sticky; top: 0; z-index: 10; }
.topbar h1 { font-size: 18px; }
.search { flex: 1; max-width: 360px; margin-left: 8px; display: flex; align-items: center; gap: 8px; background: var(--px-surface-2); border: 1px solid var(--px-line); border-radius: 999px; padding: 8px 13px; color: var(--px-ink-3); font-size: 13px; box-shadow: var(--px-sh-inset); }
.search input { border: 0; background: transparent; outline: none; color: var(--px-ink); font: inherit; width: 100%; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; color: var(--px-ink-2); }
.page { padding: 22px 24px 40px; }
.grid { display: grid; gap: 16px; }

/* ---- Saludo personalizado (inicio) ---- */
.dash-hello { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.dash-hello h2 { font-size: 20px; font-weight: 800; }
.dash-hello p { margin: 3px 0 0; color: var(--px-ink-3); font-size: 13px; font-family: var(--px-display); font-weight: 600; }
.dash-date { color: var(--px-ink-3); font-size: 12.5px; font-family: var(--px-display); font-weight: 700; text-transform: capitalize; }

/* ---- Tarjetas ---- */
.card { background: var(--px-surface); border: 1px solid var(--px-line); border-radius: var(--px-radius); box-shadow: var(--px-sh-md); overflow: hidden; }
.card.flat { box-shadow: var(--px-sh-flat); }
.card.sm { box-shadow: var(--px-sh-sm); }
.card-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--px-line); }
.card-h h3 { font-size: 14px; }
.card-h a { font-family: var(--px-display); color: var(--px-blue-deep); font-size: 12.5px; font-weight: 700; text-decoration: none; }
.card-b { padding: 16px; }

/* ---- KPI ---- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi { background: var(--px-surface); border: 1px solid var(--px-line); border-radius: var(--px-radius); padding: 15px 16px; box-shadow: var(--px-sh-sm); position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--px-blue); }
.kpi.k-red::before { background: var(--px-red); } .kpi.k-good::before { background: var(--px-good); } .kpi.k-warn::before { background: var(--px-warn); }
.kpi .lbl { font-family: var(--px-display); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--px-ink-3); font-weight: 700; }
.kpi .val { font-family: var(--px-display); font-size: 26px; font-weight: 800; margin-top: 6px; }
.kpi .val small { font-size: 13px; color: var(--px-ink-3); font-weight: 600; }

/* ---- Pills / tags ---- */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; font-family: var(--px-display); }
.pill.good { background: var(--px-good-soft); color: var(--px-good); }
.pill.warn { background: var(--px-warn-soft); color: var(--px-warn); }
.pill.info { background: var(--px-blue-wash); color: var(--px-blue-deep); }
.tag { display: inline-block; font-family: var(--px-display); font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--px-red); background: var(--px-red-soft); padding: 3px 8px; border-radius: 6px; }

/* ---- Listas de personas ---- */
.plist { display: flex; flex-direction: column; }
.prow { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--px-line); }
.prow:first-child { border-top: 0; }
.prow .nm { font-size: 13.5px; font-weight: 700; font-family: var(--px-display); }
.prow .rl { font-size: 12px; color: var(--px-ink-3); }
.prow .when { margin-left: auto; font-size: 12px; color: var(--px-blue-deep); font-weight: 700; font-family: var(--px-display); white-space: nowrap; }
.prow.is-today .when { color: var(--px-red); font-weight: 800; }

/* ---- Directorio ---- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.chip { font-family: var(--px-display); font-size: 12.5px; padding: 6px 13px; border-radius: 999px; border: 1px solid var(--px-line-2); background: var(--px-surface); color: var(--px-ink-2); cursor: pointer; font-weight: 600; text-decoration: none; }
.chip.on { background: var(--px-blue-deep); color: #fff; border-color: var(--px-blue-deep); }
.dir-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.person-card { background: var(--px-surface); border: 1px solid var(--px-line); border-radius: var(--px-radius); padding: 18px 16px; text-align: center; transition: .18s; }
.person-card:hover { box-shadow: var(--px-sh-lg); transform: translateY(-3px); border-color: var(--px-blue-soft); }
.person-card .av { margin: 0 auto 10px; }
.person-card h4 { font-size: 15px; }
.person-card .rl { font-size: 12.5px; color: var(--px-ink-2); margin-top: 2px; }
.person-card .area { display: inline-block; margin-top: 9px; font-family: var(--px-display); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--px-blue-deep); background: var(--px-blue-wash); padding: 3px 9px; border-radius: 999px; }
.person-card .contact { display: flex; justify-content: center; gap: 14px; margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--px-line); color: var(--px-ink-3); font-size: 12px; }
.person-card .contact b { color: var(--px-ink-2); font-weight: 700; }

.rolebar { display: flex; align-items: center; gap: 10px; background: var(--px-red-soft); border: 1px solid var(--px-line); border-radius: var(--px-radius-sm); padding: 10px 14px; margin-bottom: 16px; font-size: 13px; color: var(--px-ink-2); box-shadow: var(--px-sh-sm); }
.rolebar b { color: var(--px-red-deep); font-weight: 700; }

/* ---- Tablas ---- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 540px; }
table.data thead th { text-align: left; font-family: var(--px-display); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--px-ink-3); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--px-line-2); }
table.data tbody td { padding: 12px; border-bottom: 1px solid var(--px-line); }
table.data tbody tr:nth-child(even) { background: var(--px-surface-2); }
table.data tbody tr:hover { background: var(--px-blue-wash); }
.st { font-family: var(--px-display); font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.st.vig { background: var(--px-good-soft); color: var(--px-good); }
.st.rev { background: var(--px-warn-soft); color: var(--px-warn); }

/* ---- Perfil ---- */
.profile-head { border-radius: var(--px-radius); overflow: hidden; border: 1px solid var(--px-line); background: var(--px-surface); box-shadow: var(--px-sh-lg); margin-bottom: 16px; }
.profile-cover { height: 100px; background: var(--px-grad-dark); position: relative; }
.profile-cover::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 80% 120%, rgba(221,24,59,.5), transparent 60%); }
.profile-id { display: flex; align-items: flex-end; gap: 16px; padding: 0 22px 18px; margin-top: -34px; position: relative; flex-wrap: wrap; }
.profile-id .av { width: 82px; height: 82px; font-size: 30px; border: 4px solid var(--px-surface); box-shadow: var(--px-sh-md); }
.profile-id .who h2 { font-size: 20px; }
.profile-id .who .rl { color: var(--px-ink-2); font-size: 14px; margin-top: 3px; }
.profile-id .spacer { margin-left: auto; }
.field { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--px-line); font-size: 13.5px; }
.field:first-child { border-top: 0; }
.field .k { color: var(--px-ink-3); }
.field .v { font-weight: 700; }

/* ---- Formularios ---- */
.form-group { margin-bottom: 15px; }
.form-group label { display: block; font-family: var(--px-display); font-size: 12.5px; font-weight: 700; color: var(--px-ink-2); margin-bottom: 6px; }
.input { width: 100%; border: 1px solid var(--px-line-2); border-radius: 10px; padding: 11px 13px; background: var(--px-surface-2); color: var(--px-ink); font: inherit; font-size: 14px; box-shadow: var(--px-sh-inset); outline: none; }
.input:focus { border-color: var(--px-blue); box-shadow: 0 0 0 3px var(--px-blue-wash); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 620px) { .form-grid { grid-template-columns: 1fr; } }
select.input { cursor: pointer; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h2 { font-size: 16px; }
.page-head .spacer { margin-left: auto; }
.person-card .edit { display: inline-block; margin-top: 12px; font-family: var(--px-display); font-size: 12px; font-weight: 700; color: var(--px-blue-deep); text-decoration: none; }

/* ---- Grid de checkboxes (asignación de proyectos, etc.) ---- */
.chk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.chk { display: flex; align-items: flex-start; gap: 9px; padding: 9px 11px; border: 1px solid var(--px-line-2); border-radius: 10px; background: var(--px-surface-2); cursor: pointer; font-size: 13.5px; color: var(--px-ink-2); transition: .12s; }
.chk:hover { border-color: var(--px-blue); }
.chk input { margin-top: 2px; flex: none; accent-color: var(--px-blue-deep); }
.chk span { font-weight: 600; line-height: 1.3; }
.chk span small { display: block; color: var(--px-ink-3); font-weight: 500; font-size: 11.5px; }
.chk:has(input:checked) { border-color: var(--px-blue); background: var(--px-blue-wash); color: var(--px-ink); }

/* ---- Chips de datos (habilidades, proyectos) ---- */
.tagchips { display: flex; flex-wrap: wrap; gap: 6px; }
.tagchip { display: inline-flex; align-items: center; gap: 5px; font-family: var(--px-display); font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--px-blue-wash); color: var(--px-blue-deep); }
.tagchip.skill { background: var(--px-surface-3); color: var(--px-ink-2); }
.tagchip.closed { background: var(--px-surface-3); color: var(--px-ink-3); }

/* ---- Botones ---- */
.btn { appearance: none; border: 1px solid var(--px-line-2); background: var(--px-surface); color: var(--px-ink); font-family: var(--px-display); font-weight: 700; font-size: 13px; padding: 9px 16px; border-radius: 999px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 7px; }
.btn:hover { border-color: var(--px-blue); }
.btn.primary { background: var(--px-grad-blue); border-color: transparent; color: #fff; box-shadow: var(--px-sh-blue); }
.btn.block { width: 100%; justify-content: center; padding: 12px; font-size: 14.5px; }

/* ---- Alertas ---- */
.alert { border-radius: var(--px-radius-sm); padding: 11px 14px; font-size: 13px; margin-bottom: 14px; border: 1px solid transparent; }
.alert.err { background: var(--px-danger-soft); color: var(--px-red-deep); border-color: var(--px-red-soft); }
.alert.ok { background: var(--px-good-soft); color: var(--px-good); }

/* ---- Login (tarjeta central compacta) ---- */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--px-bg); }
.auth-card { width: 100%; max-width: 380px; background: var(--px-surface); border: 1px solid var(--px-line); border-radius: var(--px-radius-lg); box-shadow: var(--px-sh-lg); padding: 34px 30px; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-brand .iso { width: 46px; height: 46px; }
.auth-brand h1 { font-size: 22px; font-weight: 800; text-align: center; }
.auth-card .row { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 18px; font-size: 12.5px; }
.auth-card .row label { color: var(--px-ink-2); display: flex; gap: 7px; align-items: center; }
.auth-card .row a { color: var(--px-blue-deep); text-decoration: none; font-weight: 700; font-family: var(--px-display); }
.auth-card .secure { margin-top: 16px; font-size: 11.5px; color: var(--px-ink-3); display: flex; align-items: center; gap: 7px; justify-content: center; text-align: center; }
.auth-top { display: flex; justify-content: flex-end; margin-bottom: 2px; }
.auth-help { font-size: 13px; color: var(--px-ink-2); text-align: center; margin: -6px 0 18px; }
.auth-foot { text-align: center; margin-top: 16px; font-size: 13px; }
.auth-foot a { color: var(--px-blue-deep); text-decoration: none; font-weight: 700; font-family: var(--px-display); }
.pw-rules { list-style: none; padding: 0; margin: -4px 0 16px; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--px-ink-3); }
.pw-rules li { display: flex; align-items: center; gap: 8px; }
.pw-rules .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--px-line-2); flex: none; transition: .15s; }
.pw-rules li.ok { color: var(--px-good); }
.pw-rules li.ok .dot { background: var(--px-good); }
.btn.primary:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; opacity: 0; }

/* ---- Carrusel de noticias (inicio) ---- */
.news-carousel .slides { position: relative; height: 210px; }
.slide { position: absolute; inset: 0; display: grid; grid-template-columns: 42% 1fr; opacity: 0; visibility: hidden; transition: opacity .5s ease; text-decoration: none; color: inherit; }
.slide.active { opacity: 1; visibility: visible; }
.slide-thumb { background: var(--px-grad-dark); background-size: cover; background-position: center; position: relative; }
.slide-thumb .slide-ph { position: absolute; inset: 0; display: grid; place-items: center; opacity: .5; }
.slide-body { padding: 18px 20px; display: flex; flex-direction: column; min-width: 0; }
.slide-body .tag { align-self: flex-start; }
.slide-body h4 { font-size: 17px; margin: 8px 0 6px; }
.slide-body p { margin: 0; color: var(--px-ink-2); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.slide-meta { margin-top: auto; color: var(--px-ink-3); font-size: 12px; padding-top: 8px; }
.slides-dots { display: flex; gap: 6px; justify-content: center; padding: 12px; border-top: 1px solid var(--px-line); }
.slides-dots .dot { width: 8px; height: 8px; border-radius: 999px; border: 0; background: var(--px-line-2); cursor: pointer; transition: .2s; padding: 0; }
.slides-dots .dot.on { background: var(--px-blue); width: 22px; }
@media (max-width: 560px) { .slide { grid-template-columns: 1fr; } .slide-thumb { display: none; } .news-carousel .slides { height: 170px; } }

/* ---- Noticias: listado y detalle ---- */
.news-featured { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 22px; }
.news-card { display: flex; flex-direction: column; background: var(--px-surface); border: 1px solid var(--px-line); border-radius: var(--px-radius); overflow: hidden; box-shadow: var(--px-sh-sm); text-decoration: none; color: inherit; transition: .16s; }
.news-card:hover { transform: translateY(-3px); box-shadow: var(--px-sh-md); border-color: var(--px-blue-soft); }
.news-card .thumb { height: 150px; background: var(--px-grad-dark); background-size: cover; background-position: center; display: grid; place-items: center; }
.news-card .thumb img.ph { height: 26px; opacity: .5; }
.news-card .body { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.news-card h3 { font-size: 15.5px; }
.news-card p { margin: 0; color: var(--px-ink-2); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-card .meta { margin-top: auto; color: var(--px-ink-3); font-size: 11.5px; }
.news-list { display: flex; flex-direction: column; }
.news-row { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--px-line); text-decoration: none; color: inherit; }
.news-row:first-child { border-top: 0; }
.news-row .mini { width: 72px; height: 54px; border-radius: 8px; background: var(--px-grad-dark); background-size: cover; background-position: center; flex: none; display: grid; place-items: center; }
.news-row .mini img.ph { height: 16px; opacity: .5; }
.news-row .info { min-width: 0; }
.news-row h4 { font-size: 14px; }
.news-row .meta { color: var(--px-ink-3); font-size: 12px; margin-top: 2px; }
.news-row:hover h4 { color: var(--px-blue-deep); }
.article { max-width: 760px; }
.article .cover { height: 300px; border-radius: var(--px-radius); background: var(--px-grad-dark); background-size: cover; background-position: center; margin-bottom: 18px; display: grid; place-items: center; }
.article .cover img.ph { height: 40px; opacity: .5; }
.article h1 { font-size: 26px; margin-bottom: 8px; }
.article .article-meta { color: var(--px-ink-3); font-size: 13px; margin-bottom: 18px; }
.article .article-body { font-size: 15px; line-height: 1.7; color: var(--px-ink-2); white-space: pre-line; }
@media (max-width: 760px) { .news-featured { grid-template-columns: 1fr; } }

/* ---- Marcas de asistencia ---- */
.punch { display: inline-block; font-family: var(--px-display); font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 6px; margin: 2px 4px 2px 0; white-space: nowrap; }
.punch.in { background: var(--px-good-soft); color: var(--px-good); }
.punch.out { background: var(--px-blue-wash); color: var(--px-blue-deep); }

/* ---- Switch tema ---- */
.switch { position: relative; width: 48px; height: 26px; flex: none; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: var(--px-blue-soft); border-radius: 999px; cursor: pointer; transition: .25s; }
.slider::before { content: "☀"; position: absolute; height: 20px; width: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .25s; display: grid; place-items: center; font-size: 11px; color: var(--px-warn); box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + .slider { background: var(--px-blue-deep); }
.switch input:checked + .slider::before { transform: translateX(22px); content: "☾"; color: var(--px-blue-deep); }

/* ---- Navegación móvil (hamburguesa + drawer) ---- */
.nav-toggle { display: none; appearance: none; border: 1px solid var(--px-line-2); background: var(--px-surface); color: var(--px-ink); border-radius: 10px; width: 40px; height: 40px; align-items: center; justify-content: center; cursor: pointer; flex: none; padding: 0; }
.nav-toggle:hover { border-color: var(--px-blue); }
.side-close { display: none; position: absolute; top: 12px; right: 12px; appearance: none; border: 0; background: transparent; color: var(--px-ink-2); cursor: pointer; padding: 6px; border-radius: 8px; }
.side-close:hover { background: var(--px-surface-3); color: var(--px-ink); }
.nav-backdrop { display: none; }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .nav-toggle { display: inline-flex; }
  .side-close { display: inline-flex; }
  /* Barra lateral como panel deslizable */
  .side {
    display: flex; position: fixed; top: 0; left: 0; z-index: 60;
    width: 272px; max-width: 86vw; height: 100vh; height: 100dvh;
    transform: translateX(-100%); transition: transform .25s ease;
    box-shadow: var(--px-sh-lg); overflow-y: auto;
  }
  body.nav-open .side { transform: translateX(0); }
  .nav-backdrop { position: fixed; inset: 0; z-index: 55; background: rgba(10,12,18,.5); }
  body.nav-open .nav-backdrop { display: block; }
  body.nav-open { overflow: hidden; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  /* Grids genéricos (dashboard, perfil, vacaciones) a una columna */
  .page .grid { grid-template-columns: 1fr !important; }
  .topbar { padding: 11px 16px; gap: 10px; }
  .topbar h1 { font-size: 16px; }
  .search { max-width: none; }
  .page { padding: 16px 14px 32px; }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .kpi .val { font-size: 22px; }
  .top-actions { gap: 8px; }
  .top-actions .av { display: none; } /* avatar ya visible en el menú lateral */
  .profile-id { padding: 0 16px 16px; }
  .profile-id .who h2 { font-size: 18px; }
}
@media (max-width: 380px) { .kpis { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Acciones de contacto (Microsoft Teams deep links, correo) */
.tm-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.tm-actions.is-compact { justify-content: center; }
.tm-act { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--px-line); background: var(--px-surface); color: var(--px-ink-2);
  font-size: 12px; font-weight: 600; text-decoration: none; line-height: 1;
  transition: background .12s ease, border-color .12s ease, color .12s ease; }
.tm-act:hover { border-color: var(--px-blue); color: var(--px-blue);
  background: color-mix(in srgb, var(--px-blue) 8%, var(--px-surface)); }
.tm-act svg { flex: none; }
.tm-act.tm-teams { color: #fff; background: #4b53bc; border-color: #4b53bc; } /* morado Microsoft Teams */
.tm-act.tm-teams:hover { background: #3d44a0; border-color: #3d44a0; color: #fff; }
.tm-actions.is-compact .tm-act span { display: none; }
.tm-actions.is-compact .tm-act { padding: 6px; }
