/* AsisteLaxClean — hoja de estilos. Dirección: "mesa de trabajo limpia".
   Fondo cálido, tarjetas blancas con borde fino, un solo acento azul LAX,
   rojo de marca solo para salida y alertas, botones en píldora, Poppins. */
:root {
  --bg: #faf8f4;
  --card: #ffffff;
  --text: #1c1410;
  --text-2: #4a443d;
  --muted: #837a70;
  --line: #ece7de;
  --line-strong: #d9d2c7;
  --soft: #f4f1ea;
  --primary: #004aad;
  --primary-dark: #003b86;
  --primary-soft: #eef4ff;
  --ok: #1a8a4a;
  --ok-text: #146a3a;
  --ok-soft: #e6f4ec;
  --warn: #e0a100;
  --warn-text: #9a5b00;
  --warn-soft: #fff1d6;
  --danger: #db0018;
  --danger-text: #b3000f;
  --danger-soft: #fff1f0;
  --info: #004aad;
  --info-text: #003b86;
  --info-soft: #eef4ff;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(28, 20, 16, 0.06), 0 0 0 1px rgba(28, 20, 16, 0.06);
  --font: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--primary); }
h1, h2, h3 { margin: 0 0 .5rem; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: 1.35rem; } h2 { font-size: 1.05rem; font-weight: 600; } h3 { font-size: .95rem; font-weight: 600; }
p { margin: 0 0 .6rem; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.hidden { display: none !important; }
.right { text-align: right; }
.center { text-align: center; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }
.mt { margin-top: 1rem; } .mb { margin-bottom: 1rem; }
.num { font-variant-numeric: tabular-nums; }
.ic { width: 18px; height: 18px; flex-shrink: 0; }
.ic.sm { width: 14px; height: 14px; }
.ic.lg { width: 22px; height: 22px; }

.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.1rem; margin-bottom: .85rem;
}
.card h2 { margin-bottom: .75rem; }

/* ---- botones ---- */
button, .btn {
  font: inherit; font-weight: 600; border: 0; border-radius: 999px; padding: .62rem 1.1rem; cursor: pointer;
  background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center;
  gap: .45rem; text-decoration: none; transition: filter .12s, transform .05s, background .12s; line-height: 1.2;
}
button:hover, .btn:hover { filter: brightness(1.06); }
button:active { transform: scale(.985); }
button:disabled { opacity: .5; cursor: not-allowed; }
.btn-secondary { background: #fff; color: var(--text); border: 1px solid var(--line-strong); }
.btn-secondary:hover { background: var(--soft); filter: none; }
.btn-outline { background: #fff; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-ghost { background: transparent; color: var(--primary); padding: .3rem .5rem; }
.btn-ok { background: var(--ok); } .btn-warn { background: var(--warn-text); } .btn-danger { background: var(--danger); }
.btn-info { background: var(--primary); }
.btn-sm { padding: .38rem .8rem; font-size: .8rem; }
.btn-big { width: 100%; height: 56px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: 999px; background: #fff; color: var(--text-2); border: 1px solid var(--line); }

/* ---- formularios ---- */
input, select, textarea {
  font: inherit; width: 100%; padding: .62rem .85rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: #fff; color: var(--text); outline: none; min-height: 44px;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
input[type="checkbox"], input[type="radio"] { min-height: 0; width: 18px; height: 18px; accent-color: var(--primary); }
textarea { min-height: 84px; resize: vertical; }
label { display: block; font-size: .78rem; color: var(--text-2); margin-bottom: .3rem; font-weight: 600; letter-spacing: .01em; }
.field { margin-bottom: .85rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; color: var(--text); font-size: .9rem; }
.check input { width: auto; }
details summary { cursor: pointer; font-weight: 600; }

/* ---- chips y avisos ---- */
.badge {
  display: inline-flex; align-items: center; gap: .35rem; padding: .22rem .65rem; border-radius: 999px; font-size: .74rem;
  font-weight: 600; background: var(--soft); color: var(--text-2); white-space: nowrap; line-height: 1.3;
}
.badge.ok { background: var(--ok-soft); color: var(--ok-text); }
.badge.warn { background: var(--warn-soft); color: var(--warn-text); }
.badge.danger { background: var(--danger-soft); color: var(--danger-text); }
.badge.info, .badge.primary { background: var(--info-soft); color: var(--info-text); }
.badge .dot { width: 7px; height: 7px; border-radius: 999px; background: currentColor; }

.alert { padding: .75rem .95rem; border-radius: var(--radius-sm); margin-bottom: .85rem; font-size: .9rem; font-weight: 500; }
.alert.error { background: var(--danger-soft); color: var(--danger-text); }
.alert.ok { background: var(--ok-soft); color: var(--ok-text); }
.alert.warn { background: var(--warn-soft); color: var(--warn-text); }
.alert.info { background: var(--info-soft); color: var(--info-text); }

/* ---- tablas ---- */
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .7rem .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.actions { display: flex; gap: .35rem; flex-wrap: wrap; }
.avatar { width: 34px; height: 34px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 700; flex-shrink: 0; }
.avatar.lg { width: 44px; height: 44px; font-size: .95rem; }

/* ---- indicadores ---- */
.stat { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: .95rem 1.05rem; display: flex; flex-direction: column; gap: .15rem; }
.stat .v { font-size: 1.7rem; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--text-2); font-size: .78rem; font-weight: 500; }
.stat.ok .v { color: var(--ok); } .stat.warn .v { color: var(--warn-text); } .stat.danger .v { color: var(--danger-text); }
.stat.info .v, .stat.primary .v { color: var(--primary); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: .75rem 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.cell { background: var(--bg); border-radius: var(--radius-sm); padding: .6rem .75rem; display: flex; flex-direction: column; gap: .1rem; }
.cell .k { font-size: .7rem; color: var(--muted); font-weight: 500; }
.cell .v { font-size: .95rem; font-weight: 600; font-variant-numeric: tabular-nums; }

.toast {
  position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%); background: var(--text); color: #fff;
  padding: .7rem 1rem; border-radius: 999px; font-size: .9rem; font-weight: 500; z-index: 50; box-shadow: 0 8px 24px rgba(28,20,16,.18);
  max-width: 92vw; opacity: 0; transition: opacity .2s; pointer-events: none;
}
.toast.show { opacity: 1; }
.toast.error { background: var(--danger); } .toast.ok { background: var(--ok); }

.modal-bg { position: fixed; inset: 0; background: rgba(28, 20, 16, .45); display: flex; align-items: flex-end; justify-content: center; z-index: 40; }
.modal { background: var(--card); width: 100%; max-width: 560px; border-radius: 22px 22px 0 0; padding: 1.2rem; max-height: 92vh; overflow-y: auto; }
@media (min-width: 700px) { .modal-bg { align-items: center; padding: 1rem; } .modal { border-radius: 22px; } }

/* ---- login ---- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.25rem; }
.login-card { width: 100%; max-width: 400px; }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: .8rem; margin-bottom: 1.4rem; }
.login-brand img { width: 180px; height: auto; }
.login-foot { display: flex; align-items: center; justify-content: center; gap: .4rem; margin-top: 1.2rem; font-size: .78rem; color: var(--muted); }

/* ---- app empleado ---- */
.app { max-width: 560px; margin: 0 auto; padding: 1rem 1rem 96px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: .9rem; gap: .6rem; }
.topbar .who { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.topbar .who .n { font-weight: 600; line-height: 1.2; }
.topbar .who .p { font-size: .78rem; color: var(--muted); }
.topbar h1 { font-size: 1.25rem; margin: 0; }
.hero { padding: 1.25rem; }
.hero .date { font-size: .85rem; color: var(--text-2); font-weight: 500; }
.clock { font-size: 2.9rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: .4rem; margin: .7rem 0; }
.clock .s { font-size: 1.15rem; font-weight: 500; color: var(--muted); }
.cells { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.geo { display: flex; align-items: center; gap: .45rem; font-size: .8rem; font-weight: 500; margin-top: .8rem; color: var(--text-2); }
.geo.ok { color: var(--ok-text); } .geo.bad { color: var(--danger-text); }
.acciones { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.acciones .solo { grid-column: 1 / -1; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; align-items: center; gap: .75rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline .tile { width: 34px; height: 34px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.timeline .tile.salida { background: var(--danger-soft); color: var(--danger-text); }
.timeline .tile.descanso { background: var(--warn-soft); color: var(--warn-text); }
.timeline .t { font-weight: 600; font-variant-numeric: tabular-nums; }
.timeline .body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.timeline .body .sub { font-size: .78rem; color: var(--muted); }
.aviso-card { background: var(--info-soft); border-radius: 16px; padding: .8rem .95rem; display: flex; gap: .6rem; align-items: flex-start; margin-bottom: .85rem; color: var(--info-text); }
.aviso-card .t { font-weight: 600; font-size: .9rem; }
.aviso-card .m { font-size: .82rem; color: var(--text-2); }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr); padding: .4rem .4rem calc(.5rem + env(safe-area-inset-bottom)); z-index: 30;
}
.tabbar button { background: none; color: var(--muted); flex-direction: column; gap: .2rem; font-size: .64rem; padding: .35rem 0; font-weight: 500; border-radius: 12px; }
.tabbar button:hover { filter: none; background: var(--soft); }
.tabbar button.active { color: var(--primary); font-weight: 600; }
.tabbar button .ic { width: 22px; height: 22px; }
.month-nav { display: inline-flex; align-items: center; gap: .15rem; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: .2rem; }
.month-nav button { width: 32px; height: 32px; padding: 0; background: transparent; color: var(--text-2); }
.month-nav button:hover { background: var(--soft); filter: none; }
.month-nav .lbl { font-size: .82rem; font-weight: 600; padding: 0 .4rem; min-width: 110px; text-align: center; text-transform: capitalize; }
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: .35rem; }
.calendar .dow { font-size: .7rem; color: var(--muted); font-weight: 600; text-align: center; }
.calendar .d { height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: .78rem; color: #c9c1b6; }
.calendar .d.off { background: var(--bg); }
.calendar .d.ok { background: var(--ok-soft); color: var(--ok-text); font-weight: 600; }
.calendar .d.warn { background: var(--warn-soft); color: var(--warn-text); font-weight: 600; }
.calendar .d.danger { background: var(--danger-soft); color: var(--danger-text); font-weight: 600; }
.calendar .d.info { background: var(--info-soft); color: var(--info-text); font-weight: 600; }
.calendar .d.hoy { background: var(--primary); color: #fff; font-weight: 700; }
.calendar .d.click { cursor: pointer; }
.legend { display: flex; gap: .8rem; flex-wrap: wrap; font-size: .72rem; color: var(--text-2); margin-top: .7rem; }
.legend span { display: inline-flex; align-items: center; gap: .3rem; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.day-card { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .7rem 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.day-card:last-child { border-bottom: 0; }
.day-card .dn { width: 44px; display: flex; flex-direction: column; line-height: 1.1; }
.day-card .dn .w { font-size: .68rem; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.day-card .dn .n { font-size: 1.15rem; font-weight: 700; }
.day-card .d { font-weight: 600; font-size: .9rem; }
.day-card .h { font-size: .78rem; color: var(--muted); }
.day-card .body { flex: 1; min-width: 0; }

/* ---- admin ---- */
.admin { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { background: #fff; border-right: 1px solid var(--line); color: var(--text-2); padding: 1.2rem .85rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.sidebar .brand { padding: .2rem .5rem 1rem; display: flex; flex-direction: column; gap: .5rem; }
.sidebar .brand img { width: 132px; height: auto; }
.sidebar .brand .sub { font-size: .68rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sidebar nav { display: flex; flex-direction: column; gap: .15rem; }
.sidebar nav button { display: flex; width: 100%; background: none; color: var(--text-2); justify-content: flex-start; gap: .6rem; padding: .62rem .75rem; border-radius: 12px; font-weight: 500; font-size: .9rem; }
.sidebar nav button:hover { background: var(--soft); filter: none; }
.sidebar nav button.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
.sidebar .count { margin-left: auto; background: var(--danger); color: #fff; border-radius: 999px; font-size: .68rem; padding: .05rem .45rem; min-width: 20px; text-align: center; }
.sidebar .foot { margin-top: auto; padding: .75rem; border-radius: 14px; background: var(--bg); font-size: .8rem; color: var(--muted); display: flex; flex-direction: column; gap: .2rem; }
.sidebar .foot #who { font-weight: 600; color: var(--text); font-size: .85rem; }
.sidebar .foot a { color: var(--primary); }
.main { padding: 1.5rem 1.75rem 2.5rem; min-width: 0; }
.main header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.1rem; gap: 1rem; flex-wrap: wrap; }
.main header h1 { font-size: 1.45rem; margin: 0; }
.main header .sub { font-size: .82rem; color: var(--muted); }
.filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: 1rem; }
.filters .field { margin: 0; min-width: 150px; }
.menu-btn { display: none; }
.jardin { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .9rem; }
.jardin .card { margin: 0; position: relative; }
.jardin .podio { position: absolute; top: 12px; left: 12px; padding: .15rem .55rem; border-radius: 999px; background: var(--text); color: #fff; font-size: .7rem; font-weight: 700; }
.jardin .podio.plata { background: var(--soft); color: var(--text-2); }
@media (max-width: 860px) {
  .admin { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -270px; width: 260px; transition: left .2s; z-index: 45; box-shadow: 0 0 40px rgba(28,20,16,.2); }
  .sidebar.open { left: 0; }
  .menu-btn { display: inline-flex; }
  .main { padding: 1rem; }
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } .cells { grid-template-columns: repeat(3, 1fr); } }

/* ---- árbol de la vida ---- */
.arbol-card { display: flex; gap: 1rem; align-items: center; }
.arbol-card.compacto { flex-direction: column; align-items: center; text-align: center; }
.arbol-dibujo { background: var(--primary-soft); border-radius: 16px; padding: .5rem; flex-shrink: 0; line-height: 0; display: flex; align-items: center; justify-content: center; }
.arbol-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .35rem; }
.arbol-nombre { font-weight: 600; font-size: .95rem; }
.arbol-pts { font-size: 1.8rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.arbol-pts small { font-size: .78rem; color: var(--muted); font-weight: 500; margin-left: .3rem; }
.arbol-barra { height: 8px; background: var(--soft); border-radius: 999px; overflow: hidden; }
.arbol-barra span { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.arbol-msg { margin: 0; padding: .6rem .75rem; border-radius: var(--radius-sm); background: var(--bg); font-size: .8rem; font-weight: 500; color: var(--text-2); }
.puntos-dias { display: flex; flex-wrap: wrap; gap: 4px; margin-top: .2rem; }
.puntos-dias .pd { width: 13px; height: 13px; border-radius: 4px; background: #e6e0d6; }
.puntos-dias .pd.ok { background: var(--ok); } .puntos-dias .pd.warn { background: var(--warn); }
.puntos-dias .pd.danger { background: var(--danger); } .puntos-dias .pd.info { background: var(--info); }
