/* TransporteIL · Diseñado por Sistemas03il · Tel. 6452-0450 */
@font-face { font-family: 'Inter'; src: url('lib/inter.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --pri: #0e7c86; --pri-600: #0b6770; --pri-700: #08505a; --pri-50: #e7f6f6; --pri-100: #c9ecec;
  --nav: #0a2e3a; --nav-2: #0f3c4b;
  --bg: #f4f7f9; --surface: #ffffff; --line: #e5eaee; --line-2: #eef2f5;
  --tx: #0f1c24; --tx-2: #4a5d68; --tx-3: #8798a3;
  --ok: #16a34a; --ok-50: #e9f8ef; --warn: #d97706; --warn-50: #fff6e6; --bad: #dc2626; --bad-50: #fdeeee; --info: #2563eb; --info-50: #ebf1fe;
  --sun: #f4a93b;
  --r: 14px; --r-sm: 10px;
  --sh-1: 0 1px 2px rgba(16,40,52,.06), 0 1px 3px rgba(16,40,52,.06);
  --sh-2: 0 8px 24px rgba(16,40,52,.08), 0 2px 6px rgba(16,40,52,.05);
  --sh-3: 0 24px 60px rgba(10,30,40,.22);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--tx); font-size: 14.5px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0 0 10px; letter-spacing: -.02em; }
h2 { font-size: 22px; font-weight: 700; } h3 { font-size: 16px; font-weight: 650; }
a { color: var(--pri); }
.ico { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }

/* Botones */
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; background: var(--pri); color: #fff; border: 1px solid transparent; border-radius: var(--r-sm);
  padding: 9px 15px; font: 600 14px/1.2 inherit; font-family: inherit; cursor: pointer; transition: background .15s, box-shadow .15s, transform .05s; white-space: nowrap; }
button:hover { background: var(--pri-600); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .6; cursor: default; }
button.sec { background: var(--surface); color: var(--tx); border-color: var(--line); box-shadow: var(--sh-1); }
button.sec:hover { background: #f7fafb; border-color: #d5dde3; }
button.ghost { background: transparent; color: var(--tx-2); }
button.ghost:hover { background: var(--line-2); color: var(--tx); }
button.peligro { background: var(--bad-50); color: var(--bad); }
button.peligro:hover { background: #fbdcdc; }
button.peq { padding: 6px 11px; font-size: 13px; }
button.icon-btn { padding: 8px; border-radius: 9px; }

/* Formularios */
input, select, textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); font: 15px inherit; font-family: inherit; color: var(--tx);
  background: #fff; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--pri); box-shadow: 0 0 0 4px rgba(14,124,134,.14); }
textarea { min-height: 84px; resize: vertical; }
label { display: block; font-size: 12.5px; color: var(--tx-2); margin-bottom: 6px; font-weight: 600; }
.campo { margin-bottom: 14px; }
.grid-form { display: grid; gap: 0 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.form-sec { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--tx-3); margin: 6px 0 12px; }
.form-sec::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* Superficies */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin-bottom: 18px; box-shadow: var(--sh-1); }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 10px; }
.card-head h3 { margin: 0; display: flex; align-items: center; gap: 8px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-2 { display: grid; gap: 18px; grid-template-columns: 1.6fr 1fr; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }
.fila { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fila > input, .fila > select, .toolbar > input, .toolbar > select { width: auto; }
.mutado { color: var(--tx-3); font-size: 13px; }
.firma { text-align: center; color: var(--tx-3); font-size: 12px; padding: 18px; }

/* KPIs */
.kpi-card { display: flex; gap: 14px; align-items: center; padding: 18px; }
.kpi-ico { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; flex-shrink: 0; }
.kpi-ico .ico { width: 22px; height: 22px; }
.kpi { font-size: 26px; font-weight: 750; letter-spacing: -.03em; line-height: 1.1; }
.kpi-label { color: var(--tx-3); font-size: 13px; margin-top: 2px; }
.t-pri { background: var(--pri-50); color: var(--pri); } .t-ok { background: var(--ok-50); color: var(--ok); }
.t-warn { background: var(--warn-50); color: var(--warn); } .t-bad { background: var(--bad-50); color: var(--bad); } .t-info { background: var(--info-50); color: var(--info); }

/* Accesos rápidos */
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.quick button { background: var(--surface); color: var(--tx); border: 1px solid var(--line); box-shadow: var(--sh-1); padding: 14px; justify-content: flex-start; border-radius: var(--r); font-weight: 600; }
.quick button:hover { border-color: var(--pri-100); box-shadow: var(--sh-2); background: #fff; }
.quick .kpi-ico { width: 36px; height: 36px; border-radius: 10px; }
.quick .kpi-ico .ico { width: 18px; height: 18px; }

/* Tablas */
.tabla-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); box-shadow: var(--sh-1); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; text-align: left; font-size: 14px; vertical-align: middle; }
th { font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--tx-3); background: #fafcfd; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { border-bottom: 1px solid var(--line-2); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .1s; }
tbody tr.clic { cursor: pointer; }
tbody tr.clic:hover td { background: #f6fafb; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.buscar { position: relative; flex: 1; min-width: 220px; max-width: 380px; }
.buscar .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--tx-3); }
.buscar input { padding-left: 38px; }
.vacio { text-align: center; padding: 46px 20px; color: var(--tx-3); }
.vacio .ico { width: 40px; height: 40px; stroke-width: 1.5; margin-bottom: 8px; color: var(--pri-100); }
@media (max-width: 760px) {
  .tabla-wrap.resp { border: 0; background: none; box-shadow: none; }
  .resp table, .resp tbody, .resp tr, .resp td { display: block; }
  .resp thead { display: none; }
  .resp tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 10px; padding: 8px 4px; box-shadow: var(--sh-1); }
  .resp td { border: 0; padding: 5px 12px; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .resp td::before { content: attr(data-label); font-size: 12px; font-weight: 600; color: var(--tx-3); text-align: left; }
}

/* Etiquetas */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--line-2); color: var(--tx-2); white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.b-programado, .b-agencia { background: var(--info-50); color: var(--info); }
.b-en_curso, .b-en_ruta, .b-hotel, .b-preventivo { background: var(--warn-50); color: var(--warn); }
.b-finalizado, .b-disponible, .b-directo, .b-admin { background: var(--ok-50); color: var(--ok); }
.b-cancelado, .b-inactivo { background: var(--line-2); color: var(--tx-3); }
.b-taller, .b-correctivo { background: var(--bad-50); color: var(--bad); }
.b-chofer, .b-oficina { background: var(--pri-50); color: var(--pri); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 8px; background: var(--line-2); font-size: 13px; font-weight: 600; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* Alertas */
.alerta { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: var(--r-sm); margin-bottom: 8px; background: var(--warn-50); font-size: 14px; }
.alerta .ico { color: var(--warn); margin-top: 1px; }
.alerta.roja { background: var(--bad-50); } .alerta.roja .ico { color: var(--bad); }
.alerta small { display: block; color: var(--tx-3); }
.todo-bien { display: flex; gap: 10px; align-items: center; padding: 14px; border-radius: var(--r-sm); background: var(--ok-50); color: var(--ok); font-weight: 600; }

/* Timeline de viajes */
.tl-item { display: flex; gap: 14px; padding: 12px; border-radius: var(--r-sm); cursor: pointer; transition: background .12s; align-items: center; }
.tl-item:hover { background: #f6fafb; }
.tl-hora { width: 62px; text-align: center; flex-shrink: 0; }
.tl-hora b { display: block; font-size: 16px; letter-spacing: -.02em; }
.tl-hora small { color: var(--tx-3); font-size: 12px; }
.tl-barra { width: 4px; align-self: stretch; border-radius: 4px; flex-shrink: 0; }
.tl-info { flex: 1; min-width: 0; }
.tl-info b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-info span { color: var(--tx-3); font-size: 13px; }

/* Flota mini */
.veh { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.veh:last-child { border: 0; }
.veh .kpi-ico { width: 38px; height: 38px; border-radius: 10px; }

/* Toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; align-items: center; background: var(--tx); color: #fff; padding: 12px 18px;
  border-radius: 12px; z-index: 999; box-shadow: var(--sh-3); font-weight: 500; animation: subir .25s ease; max-width: calc(100% - 32px); }
.toast .ico { color: #4ade80; }
.toast.error .ico { color: #f87171; }
@keyframes subir { from { opacity: 0; transform: translate(-50%, 12px); } }

/* Panel lateral (drawer) y modal */
.modal-bg { position: fixed; inset: 0; background: rgba(10,30,40,.42); backdrop-filter: blur(2px); z-index: 60; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100%); background: var(--surface); box-shadow: var(--sh-3); display: flex; flex-direction: column; animation: entrar .25s cubic-bezier(.2,.8,.2,1); }
@keyframes entrar { from { transform: translateX(40px); opacity: .4; } }
.drawer-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.drawer-head h3 { margin: 0; font-size: 18px; }
.drawer-head p { margin: 2px 0 0; color: var(--tx-3); font-size: 13px; }
.drawer-body { padding: 20px 22px; overflow-y: auto; flex: 1; }
.drawer-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; background: #fafcfd; }
.det-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.det { background: #f7fafb; border-radius: var(--r-sm); padding: 12px; }
.det small { display: block; color: var(--tx-3); font-size: 12px; font-weight: 600; margin-bottom: 3px; }
.det b { font-size: 15px; }
.bitacora { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bit { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px; }
.bit h4 { display: flex; align-items: center; gap: 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--tx-3); }
.bit p { margin: 4px 0; }
.fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.fotos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }

/* ======= Panel de oficina ======= */
.layout { display: flex; min-height: 100vh; }
.side { width: 252px; background: linear-gradient(180deg, var(--nav) 0%, #082530 100%); color: #fff; flex-shrink: 0; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .logo { padding: 20px 18px 14px; }
.side .logo img { width: 100%; display: block; }
.side nav { padding: 4px 12px; flex: 1; }
.side .grupo { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #6f97a5; margin: 16px 10px 6px; }
.side a { display: flex; align-items: center; gap: 11px; color: #c4dbe3; padding: 9px 12px; text-decoration: none; font-size: 14px; font-weight: 500; border-radius: 10px; margin-bottom: 2px; transition: background .12s, color .12s; }
.side a .ico { width: 18px; height: 18px; opacity: .85; }
.side a:hover { background: rgba(255,255,255,.07); color: #fff; }
.side a.activo { background: linear-gradient(90deg, rgba(19,163,163,.35), rgba(19,163,163,.12)); color: #fff; box-shadow: inset 3px 0 0 #3fd0cf; }
.side .usuario { margin: 12px; padding: 12px; border-radius: 12px; background: rgba(255,255,255,.06); display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: linear-gradient(135deg, #13a3a3, #0b5e7a); color: #fff; flex-shrink: 0; }
.side .usuario b { display: block; font-size: 13.5px; } .side .usuario small { color: #8fb3bf; font-size: 12px; text-transform: capitalize; }
.side .usuario button { margin-left: auto; background: transparent; color: #8fb3bf; padding: 6px; }
.side .usuario button:hover { color: #fff; background: rgba(255,255,255,.08); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; background: rgba(244,247,249,.85); backdrop-filter: saturate(1.4) blur(10px); padding: 16px 28px; display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid transparent; }
.top.scroll { border-color: var(--line); }
.top h2 { margin: 0; }
.top .sub { color: var(--tx-3); font-size: 13px; }
.top .sub::first-letter { text-transform: uppercase; }
.contenido { padding: 6px 28px 10px; flex: 1; }
.menu-btn { display: none; }
@media (max-width: 900px) {
  .side { position: fixed; left: -270px; z-index: 70; transition: left .25s; }
  .side.abierto { left: 0; box-shadow: var(--sh-3); }
  .menu-btn { display: inline-flex; }
  .top { padding: 12px 16px; } .contenido { padding: 4px 16px 10px; }
  .top .acc-txt { display: none; }
  .bitacora { grid-template-columns: 1fr; }
}
.side-bg { display: none; }
.side.abierto + .side-bg { display: block; position: fixed; inset: 0; background: rgba(10,30,40,.4); z-index: 65; }

/* Calendario */
.cal-layout { display: grid; grid-template-columns: 240px 1fr; gap: 18px; align-items: start; }
.cal-side h4 { margin: 16px 0 8px; font-size: 11.5px; color: var(--tx-3); text-transform: uppercase; letter-spacing: .06em; }
.cal-side h4:first-child { margin-top: 0; }
.cal-chk { display: flex; align-items: center; gap: 9px; font-size: 14px; margin-bottom: 8px; cursor: pointer; font-weight: 500; color: var(--tx); }
.cal-chk input { width: 17px; height: 17px; accent-color: var(--pri); }
.cal-main { padding: 14px; min-width: 0; }
.fc { --fc-button-bg-color: #fff; --fc-button-text-color: var(--tx); --fc-button-border-color: var(--line);
  --fc-button-hover-bg-color: #f4f8f9; --fc-button-hover-border-color: #d5dde3; --fc-button-active-bg-color: var(--pri-50);
  --fc-button-active-border-color: var(--pri-100); --fc-today-bg-color: #f0fafa; --fc-border-color: var(--line-2); --fc-event-border-color: transparent;
  --fc-page-bg-color: #fff; --fc-neutral-bg-color: #fafcfd; font-size: 13.5px; }
.fc .fc-button { border-radius: 9px; font-weight: 600; text-transform: capitalize; box-shadow: none !important; padding: 6px 12px; }
.fc .fc-button-active { color: var(--pri) !important; }
.fc .fc-toolbar-title { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.fc .fc-toolbar-title::first-letter { text-transform: uppercase; }
.fc .fc-col-header-cell { padding: 8px 0; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--tx-3); }
.fc .fc-col-header-cell-cushion, .fc .fc-daygrid-day-number { color: var(--tx-2); text-decoration: none; }
.fc .fc-day-today .fc-daygrid-day-number { background: var(--pri); color: #fff; border-radius: 50%; width: 26px; height: 26px; display: grid; place-items: center; margin: 4px; padding: 0; }
.fc .fc-daygrid-event { border-radius: 6px; padding: 2px 6px; cursor: pointer; font-weight: 500; }
.fc .fc-timegrid-event { border-radius: 8px; padding: 2px 4px; box-shadow: var(--sh-1); }
.fc .ev-cancelado .fc-event-title { text-decoration: line-through; }
.fc .ev-finalizado { opacity: .72; }
.fc-daygrid-day:hover { background: #f8fbfc; cursor: pointer; }
@media (max-width: 900px) { .cal-layout { grid-template-columns: 1fr; } .cal-side { order: 2; } .fc .fc-toolbar-title { font-size: 17px; } }

/* ======= Login ======= */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-hero { background: radial-gradient(1000px 500px at 80% 10%, rgba(244,169,59,.35), transparent 60%), linear-gradient(150deg, #13a3a3 0%, #0b5e7a 50%, #082f3c 100%);
  color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-hero h1 { font-size: 40px; line-height: 1.1; letter-spacing: -.03em; max-width: 460px; margin: 0 0 14px; }
.login-hero p { color: #d3eef0; font-size: 16px; max-width: 420px; margin: 0; }
.login-hero ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; }
.login-hero li { display: flex; gap: 10px; align-items: center; color: #e6f6f7; }
.login-hero li .ico { color: #ffd166; }
.login-hero .deco { position: absolute; right: -80px; bottom: -60px; width: 420px; opacity: .14; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.login-box { width: 100%; max-width: 380px; }
.login-box h2 { font-size: 26px; margin: 26px 0 4px; } .login-box .mutado { margin-bottom: 24px; }
.btn-grande { width: 100%; padding: 13px; font-size: 15.5px; border-radius: 12px; }
@media (max-width: 900px) { .login-wrap { grid-template-columns: 1fr; } .login-hero { display: none; } }

/* ======= App chofer ======= */
.app-head { background: linear-gradient(150deg, #13a3a3 0%, #0b5e7a 60%, #08465b 100%); color: #fff; padding: 18px 18px 64px; position: relative; }
.app-head .fila { justify-content: space-between; flex-wrap: nowrap; }
.app-head h2 { font-size: 22px; margin: 14px 0 2px; }
.app-head p { margin: 0; color: #cdeef0; font-size: 14px; }
.app-head p::first-letter { text-transform: uppercase; }
.app-head button { background: rgba(255,255,255,.14); border: 0; color: #fff; }
.app { max-width: 560px; margin: -48px auto 0; padding: 0 14px 96px; position: relative; }
.resumen { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.resumen div { background: #fff; border-radius: var(--r); padding: 12px; text-align: center; box-shadow: var(--sh-2); }
.resumen b { display: block; font-size: 22px; letter-spacing: -.02em; } .resumen small { color: var(--tx-3); font-size: 12px; }
.viaje-card { background: #fff; border-radius: 18px; padding: 16px; margin-bottom: 12px; box-shadow: var(--sh-2); border: 1px solid var(--line-2); position: relative; overflow: hidden; }
.viaje-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--info); }
.viaje-card.en_curso::before { background: var(--warn); } .viaje-card.finalizado::before { background: var(--ok); }
.viaje-card .hora { font-size: 24px; font-weight: 750; letter-spacing: -.03em; }
.viaje-card .ruta { display: flex; gap: 10px; margin: 12px 0; padding: 12px; background: #f7fafb; border-radius: 12px; }
.ruta-linea { display: flex; flex-direction: column; align-items: center; padding-top: 4px; }
.ruta-linea i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--pri); background: #fff; }
.ruta-linea i:last-child { background: var(--pri); }
.ruta-linea span { width: 2px; flex: 1; background: var(--pri-100); margin: 3px 0; min-height: 14px; }
.ruta-txt { display: flex; flex-direction: column; justify-content: space-between; gap: 8px; font-size: 14px; }
.meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--tx-2); font-size: 13.5px; }
.meta span { display: inline-flex; align-items: center; gap: 5px; } .meta .ico { width: 16px; height: 16px; color: var(--tx-3); }
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; background: rgba(255,255,255,.95); backdrop-filter: blur(12px); border-top: 1px solid var(--line); display: flex; z-index: 10; padding-bottom: env(safe-area-inset-bottom); }
.tabbar button { flex: 1; flex-direction: column; gap: 3px; background: none; color: var(--tx-3); border-radius: 0; padding: 10px 4px 9px; font-size: 11.5px; font-weight: 600; }
.tabbar button .ico { width: 22px; height: 22px; }
.tabbar button.activo { color: var(--pri); }
.tabbar button.activo .ico { stroke-width: 2.4; }
.pantalla { background: #fff; border-radius: 18px; padding: 18px; box-shadow: var(--sh-2); }
.pantalla h2 { display: flex; align-items: center; gap: 10px; font-size: 20px; }
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.check { display: flex; align-items: center; gap: 9px; padding: 11px; border: 1.5px solid var(--line); border-radius: 12px; font-size: 14px; font-weight: 500; cursor: pointer; margin: 0; color: var(--tx); transition: all .12s; }
.check input { width: 20px; height: 20px; accent-color: var(--ok); margin: 0; }
.check:has(input:checked) { border-color: #9be2b6; background: var(--ok-50); }
.check.full { grid-column: 1 / -1; }
.niveles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.niveles label { margin: 0; }
.niveles input { display: none; }
.niveles span { display: block; text-align: center; padding: 10px 2px; border: 1.5px solid var(--line); border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--tx-2); cursor: pointer; }
.niveles input:checked + span { border-color: var(--pri); background: var(--pri-50); color: var(--pri); }
.foto-btn { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 16px; border: 2px dashed var(--pri-100); border-radius: 14px; color: var(--pri); font-weight: 600; cursor: pointer; background: #f7fcfc; margin: 0; font-size: 14px; }
.foto-btn input { display: none; }
.foto-prev { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.foto-prev img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; }
.chips-sel { display: flex; gap: 8px; flex-wrap: wrap; }
.chips-sel label { margin: 0; } .chips-sel input { display: none; }
.chips-sel span { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border: 1.5px solid var(--line); border-radius: 99px; font-size: 14px; font-weight: 600; color: var(--tx-2); cursor: pointer; text-transform: capitalize; }
.chips-sel input:checked + span { border-color: var(--pri); background: var(--pri-50); color: var(--pri); }
.hist-item { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.hist-item:last-child { border: 0; }
.hist-item .kpi-ico { width: 40px; height: 40px; border-radius: 12px; }
.hist-item div { flex: 1; } .hist-item small { color: var(--tx-3); display: block; }

/* Ajustes para celular */
.grid-2 > * { min-width: 0; }
.card-head { flex-wrap: wrap; }
.tl-item .badge { flex-shrink: 0; }
@media (max-width: 760px) {
  .grid.kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpis .kpi-card { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; }
  .kpis .kpi { font-size: 21px; }
  .kpis .kpi-ico { width: 38px; height: 38px; border-radius: 11px; }
  .quick { grid-template-columns: 1fr 1fr; gap: 10px; }
  .quick button { white-space: normal; text-align: left; padding: 12px; font-size: 13.5px; }
  .tl-item { padding: 10px 4px; gap: 10px; }
  .tl-hora { width: 50px; }
  .tl-item .badge { display: none; }
  .card { padding: 14px; }
}

/* Selector de idioma ES | EN */
.lang { display: inline-flex; padding: 3px; border-radius: 10px; background: rgba(127,150,160,.16); gap: 2px; }
.lang button { background: transparent; color: inherit; opacity: .7; padding: 5px 10px; font-size: 12px; font-weight: 700; border-radius: 7px; letter-spacing: .04em; }
.lang button:hover { background: rgba(127,150,160,.18); opacity: 1; }
.lang button.activo { background: #fff; color: var(--pri); opacity: 1; box-shadow: var(--sh-1); }
.side .lang { color: #c4dbe3; background: rgba(255,255,255,.07); }
.app-head .lang { color: #fff; background: rgba(255,255,255,.16); }
.app-head .lang button { padding: 6px 9px; }

/* Aviso de instalación de la app */
.instalar { display: flex; gap: 12px; align-items: flex-start; background: #fff; border-radius: 16px; padding: 14px; margin-bottom: 14px; box-shadow: var(--sh-2); border: 1px solid var(--pri-100); }
.instalar img { width: 44px; height: 44px; border-radius: 11px; }
.instalar .tit { display: block; margin-bottom: 2px; }
.instalar small { color: var(--tx-2); font-size: 13px; line-height: 1.45; display: block; }

/* Android y iPhone */
html { -webkit-tap-highlight-color: transparent; }
body { overscroll-behavior-y: none; }
button, .check, .niveles span, .chips-sel span, .foto-btn, .tabbar button { touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.app-head { padding-top: calc(18px + env(safe-area-inset-top)); padding-left: calc(18px + env(safe-area-inset-left)); padding-right: calc(18px + env(safe-area-inset-right)); }
.app { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
@media (max-width: 900px) {
  /* En iPhone, letra de 16px o más evita que Safari haga zoom al tocar un campo */
  input, select, textarea { font-size: 16px; }
  .top { padding-top: calc(12px + env(safe-area-inset-top)); }
}
input[type="date"], input[type="time"] { -webkit-appearance: none; appearance: none; min-height: 44px; }
select { -webkit-appearance: none; appearance: none; padding-right: 34px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238798a3' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center; }
