/* BIGG Equipo · estilos (siguen el diseño "Sistema de sueldos BIGG") */
:root {
  --bg: #F4F5F7; --card: #FFFFFF; --ink: #14161A; --ink2: #3A3F48; --muted: #5B616E; --faint: #9AA0AC;
  --line: #E3E5E9; --line2: #ECEEF1; --field: #D5D8DE;
  --accent: #2F5BEA; --accent-soft: #EEF2FF; --accent-ink: #1F3BB3; --accent-line: #C9D4F6;
  --warn: #C2410C; --warn-soft: #FFF4EC; --warn-ink: #7C2D12; --warn-line: #F4C9AE;
  --ok: #15803D; --ok-soft: #ECFDF3;
  --side: #14161A; --side-act: #262A31; --side-ink: #C9CDD6; --side-line: #2B2F37;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --r: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.45 "Manrope", system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-ink); }
h1 { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
h2 { margin: 0; font-size: 17px; font-weight: 700; }
h3 { margin: 0; font-size: 15px; font-weight: 700; }
p { margin: 0 0 10px; }
.hidden { display: none !important; }
.mono { font-family: var(--mono); font-weight: 500; }
.muted { color: var(--muted); }
.small { font-size: 13px; color: var(--muted); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ---- Estructura ---- */
.app { display: flex; min-height: 100vh; }
.side { width: 248px; flex: 0 0 248px; background: var(--side); color: var(--side-ink); padding: 26px 14px; display: flex; flex-direction: column; gap: 3px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.marca { display: flex; align-items: center; gap: 10px; padding: 0 12px 26px; }
.marca .logo { width: 34px; height: 34px; border-radius: 8px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.marca b { color: #fff; display: block; font-size: 15px; }
.marca span { font-size: 12px; color: var(--faint); }
.side a.nav { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 8px; color: var(--side-ink); text-decoration: none; font-size: 14px; min-height: 42px; }
.side a.nav:hover { color: #fff; }
.side a.nav.on { background: var(--side-act); color: #fff; font-weight: 600; }
.side .badge { background: var(--warn); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; }
.side .pie { margin-top: auto; padding: 12px; border-top: 1px solid var(--side-line); display: flex; align-items: center; gap: 10px; }
.av { width: 32px; height: 32px; border-radius: 999px; background: #3A3F48; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex: 0 0 32px; }
.side .pie b { color: #fff; font-size: 13px; display: block; }
.side .pie span { font-size: 12px; color: var(--faint); }
.side .pie button { margin-left: auto; background: none; border: 1px solid var(--side-line); color: var(--side-ink); border-radius: 8px; padding: 6px 9px; font-size: 12px; cursor: pointer; }
.demo-tag { display: inline-block; background: #FDE68A; color: #713F12; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; letter-spacing: .04em; }
.side .demo-tag { margin: 0 12px 14px; align-self: flex-start; }
main.main { flex: 1; min-width: 0; padding: 30px 40px 60px; display: flex; flex-direction: column; gap: 22px; }
.top-movil { display: none; }

.cab { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; }
.cab .ante { font-size: 13px; color: var(--muted); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; display: block; margin-bottom: 6px; }
.cab .acc { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card .card-cab { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.fila { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.fila > .card { flex: 1 1 420px; }
.fila > .card.ancha { flex: 2 1 560px; }
.fila > .card.angosta { flex: 1 1 300px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kpi .t { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi .v { font-family: var(--mono); font-size: 25px; font-weight: 600; overflow-wrap: anywhere; }
.kpi .s { font-size: 13px; color: var(--muted); }

/* ---- Avisos ---- */
.aviso { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 13px 18px; border-radius: 10px; font-size: 14px; border: 1px solid; }
.aviso.warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn-ink); }
.aviso.info { background: var(--accent-soft); border-color: var(--accent-line); color: var(--ink2); }
.aviso.ok { background: var(--ok-soft); border-color: #B7E4C7; color: #14532D; }
.aviso .btn { margin-left: auto; }
.alertas { display: flex; flex-direction: column; gap: 10px; }
.alerta { display: flex; gap: 12px; padding: 12px; border-radius: 10px; background: #F1F3F6; }
.alerta.error { background: var(--warn-soft); }
.alerta.info { background: var(--accent-soft); }
.alerta .dot { flex: 0 0 8px; height: 8px; margin-top: 7px; border-radius: 999px; background: var(--muted); }
.alerta.error .dot { background: var(--warn); }
.alerta.info .dot { background: var(--accent); }
.alerta b { display: block; font-size: 14px; }
.alerta span { font-size: 13px; color: var(--muted); }

/* ---- Botones y campos ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent); color: #fff; font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { filter: brightness(1.06); }
.btn.out { background: #fff; color: var(--ink); border-color: var(--field); }
.btn.out:hover { border-color: #AEB3BD; filter: none; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13px; font-weight: 600; }
.btn.danger { background: var(--warn); border-color: var(--warn); }
.btn.link { background: none; border: none; color: var(--accent-ink); padding: 0; min-height: 0; font-weight: 600; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.busy { position: relative; color: transparent !important; }
.btn.busy::after { content: ""; position: absolute; width: 16px; height: 16px; border: 2px solid currentColor; border-color: #fff #fff transparent transparent; border-radius: 50%; animation: gira .7s linear infinite; }
.btn.out.busy::after { border-color: var(--ink) var(--ink) transparent transparent; }
@keyframes gira { to { transform: rotate(360deg); } }
.field { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--field); border-radius: 8px; background: #fff; font-size: 14px; }
textarea.field { padding: 10px 12px; resize: vertical; }
.field:focus, .btn:focus-visible, a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.field.sm { min-height: 36px; padding: 0 8px; }
.field.num { text-align: right; font-family: var(--mono); max-width: 140px; }
.lbl { display: block; font-size: 13px; font-weight: 600; color: var(--ink2); margin-bottom: 6px; }
.campo { display: flex; flex-direction: column; min-width: 0; }
.campos { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; min-height: 32px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.switch { width: 52px; height: 30px; border-radius: 999px; border: none; padding: 3px; display: inline-flex; background: #C9CDD6; justify-content: flex-start; cursor: pointer; flex: 0 0 52px; }
.switch[aria-checked="true"] { background: var(--accent); justify-content: flex-end; }
.switch span { width: 24px; height: 24px; border-radius: 999px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.acciones { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 6px; }
.sr { position: absolute; left: -9999px; }

/* ---- Tablas ---- */
.tabla-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; padding: 8px 10px 8px 0; white-space: nowrap; }
table.t td { border-top: 1px solid var(--line2); padding: 11px 10px 11px 0; vertical-align: middle; }
table.t td.m, table.t th.m { text-align: right; white-space: nowrap; }
table.t td.m { font-family: var(--mono); }
/* Campos numéricos dentro de tablas: pegados a la derecha, alineados con el título de la columna */
table.t td .field.num { display: block; margin-left: auto; width: 100%; max-width: 140px; }
table.t tr.clic { cursor: pointer; }
table.t tr.clic:hover td { background: #FAFBFC; }
table.t tfoot td { font-weight: 700; border-top: 2px solid var(--line); }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--line2); color: var(--ink2); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.azul { background: var(--accent-soft); color: var(--accent-ink); }
.pill.negro { background: var(--ink); color: #fff; }

/* ---- Pasos del cierre ---- */
.pasos { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.pasos li a { display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none; }
.pasos li .n { width: 24px; height: 24px; border-radius: 999px; background: var(--line2); display: flex; align-items: center; justify-content: center; font-size: 12px; }
.pasos li.hecho .n { background: var(--accent); color: #fff; }
.pasos li.on a { border-color: var(--accent); color: var(--ink); }

.archivos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.archivo { border: 1px solid var(--line); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 8px; background: #FAFBFC; }
.archivo .tit { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 700; }
.archivo .det { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.archivo .btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 6px; }

.control { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line2); }
.control:first-child { border-top: none; }
.control .ic { flex: 0 0 22px; height: 22px; border-radius: 999px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; color: #fff; background: var(--ok); margin-top: 1px; }
.control.no .ic { background: var(--warn); }
.control.av .ic { background: #CA8A04; }
.control b { display: block; font-size: 14px; }
.control span { font-size: 13px; color: var(--muted); }

.barra { display: grid; grid-template-columns: 160px minmax(0, 1fr) 60px; gap: 12px; align-items: center; font-size: 14px; }
.barra .b { height: 10px; background: var(--line2); border-radius: 999px; overflow: hidden; }
.barra .b i { display: block; height: 10px; background: var(--accent); border-radius: 999px; }
.barra .b i.bajo { background: var(--warn); }

.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid #DDE0E5; }
.tabs button { min-height: 44px; padding: 0 14px; border: none; border-bottom: 2px solid transparent; background: none; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { border-bottom-color: var(--accent); color: var(--ink); font-weight: 700; }

.desglose { display: flex; flex-direction: column; }
.desglose .it { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line2); font-size: 14px; }
.desglose .it:first-child { border-top: none; }
.desglose .it .m { font-family: var(--mono); white-space: nowrap; }
.desglose .tot { display: flex; justify-content: space-between; padding: 12px 0 0; border-top: 2px solid var(--ink); font-weight: 800; font-size: 16px; }

.lista-emp { display: flex; flex-direction: column; gap: 2px; max-height: 70vh; overflow-y: auto; }
.lista-emp button { text-align: left; background: none; border: none; padding: 10px 12px; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.lista-emp button:hover { background: var(--bg); }
.lista-emp button.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }

.pagos-pasos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pago-paso { border-radius: 10px; padding: 16px; background: #F7F8FA; border: 1px solid var(--line2); display: flex; flex-direction: column; gap: 8px; }
.pago-paso.hecho { background: var(--accent-soft); border-color: var(--accent-line); }
.pago-paso b { font-size: 14px; }
.pago-paso .btn { margin-top: auto; align-self: flex-start; }

.firmas { display: flex; flex-direction: column; gap: 10px; }
.firma { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line2); border-radius: 10px; }
.firma .av { background: var(--accent); }
.firma.pend .av { background: var(--line); color: var(--muted); }

/* ---- Modal y avisos flotantes ---- */
.modal-bg { position: fixed; inset: 0; background: rgba(20, 22, 26, .45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 50; overflow-y: auto; }
.modal { background: #fff; border-radius: 14px; padding: 26px; width: 100%; max-width: 520px; position: relative; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 20px 50px rgba(0,0,0,.2); }
.modal.ancho { max-width: 920px; }
.modal h2 { font-size: 20px; padding-right: 36px; }
.modal .x { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border: none; background: none; font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer; border-radius: 8px; }
.modal .x:hover { background: var(--bg); }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 14px; z-index: 60; max-width: calc(100vw - 32px); box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.toast.bad { background: var(--warn); }
.vacio { padding: 28px; text-align: center; color: var(--muted); font-size: 14px; border: 1px dashed #C4C8D0; border-radius: 10px; background: #FAFBFC; }
.cargando { padding: 40px; text-align: center; color: var(--muted); }

/* ---- Ingreso ---- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-l { background: var(--side); color: var(--side-ink); padding: 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.login-l h1 { color: #fff; font-size: 40px; line-height: 1.1; max-width: 460px; }
.login-l h1 em { font-style: normal; color: #8FA8FF; }
.login-r { display: flex; align-items: center; justify-content: center; padding: 40px 16px; }
.login .card { width: 100%; max-width: 420px; padding: 30px; gap: 14px; }
.login .card h2 { font-size: 22px; }
.err { background: var(--warn-soft); color: var(--warn-ink); border: 1px solid var(--warn-line); border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.cuenta-demo { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px; border: 1px solid var(--line); background: #fff; border-radius: 10px; cursor: pointer; }
.cuenta-demo:hover { border-color: var(--accent); }
.cuenta-demo strong { display: block; font-size: 14px; }
.cuenta-demo span { font-size: 12px; color: var(--muted); }

/* ---- Vacaciones ---- */
.pedido { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--line2); }
.pedido:first-of-type { border-top: none; }
.btns-ped { display: flex; gap: 8px; flex-wrap: wrap; }
.cal-cab, .cal-grilla { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-cab span { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 4px; }
.dia { min-height: 86px; border: 1px solid var(--line2); border-radius: 8px; padding: 6px; display: flex; flex-direction: column; gap: 3px; background: #fff; min-width: 0; }
.dia .n { font-size: 12px; font-weight: 700; color: var(--muted); }
.dia.finde { background: #FAFBFC; }
.dia.feriado { background: var(--warn-soft); border-color: var(--warn-line); }
.dia.hoy { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.dia.vacio-dia { border: none; background: none; }
.dia .fer { font-size: 11px; font-weight: 700; color: var(--warn); }
.quien { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.quien.aprobada { background: var(--accent); color: #fff; }
.quien.pendiente { background: #fff; color: var(--accent-ink); border: 1px dashed var(--accent); }

/* ---- Portal del empleado ---- */
body.solo-portal .side, body.solo-portal .top-movil { display: none; }
body.solo-portal main.main { padding: 24px 16px 48px; }
.portal { width: 100%; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.portal-cab { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.portal-cab .ante { font-size: 13px; color: var(--muted); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; display: block; margin-bottom: 4px; }
.tabs.grande button { flex: 1; font-size: 15px; min-height: 48px; }
.portal-total { align-items: flex-start; gap: 6px; }
.portal-total b { font-size: 38px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.1; }
.portal-total b.en-rev { font-family: inherit; font-size: 26px; font-weight: 800; color: var(--warn); }
details.card summary { cursor: pointer; min-height: 28px; }
.portal .barra { grid-template-columns: 130px minmax(0, 1fr) 50px; }

/* ---- Gráficos ---- */
svg.graf { width: 100%; height: auto; display: block; }
svg.graf .eje { font-size: 11px; fill: var(--muted); font-family: "Manrope", sans-serif; }
.leyenda { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--ink2); }
.leyenda i { display: inline-block; width: 14px; height: 4px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---- Celular ---- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .archivos, .pagos-pasos { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app { flex-direction: column; }
  .side { position: fixed; inset: 0 auto 0 0; z-index: 40; transform: translateX(-100%); transition: transform .2s; height: 100vh; }
  .side.abierto { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.4); }
  .top-movil { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--side); color: #fff; position: sticky; top: 0; z-index: 30; }
  .top-movil button { background: none; border: 1px solid var(--side-line); color: #fff; border-radius: 8px; min-height: 40px; padding: 0 12px; }
  main.main { padding: 20px 16px 48px; }
  h1 { font-size: 24px; }
  .login { grid-template-columns: 1fr; }
  .login-l { padding: 32px 20px; }
  .login-l h1 { font-size: 28px; }
  .barra { grid-template-columns: 110px minmax(0, 1fr) 50px; }
  .fila > .card { flex: 1 1 100% !important; }
  .dia { min-height: 64px; padding: 4px; }
  .quien { font-size: 10px; padding: 1px 4px; }
  .lista-emp { max-height: 38vh; }
}
@media (max-width: 520px) {
  .kpis { grid-template-columns: 1fr; }
  .card { padding: 16px; }
}
