/* App móvil del colaborador */
body { background: var(--bg); min-height: 100dvh; }
.app { max-width: 560px; margin: 0 auto; min-height: 100dvh; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.view { padding: 16px; display: grid; gap: 14px; }
.view-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 2px 0; }

/* Cabecera de estado */
.hero {
  --tone: var(--neutral); --tone-bg: var(--neutral-bg);
  background: linear-gradient(160deg, var(--brand) 0%, var(--brand-strong) 100%); color: #fff;
  padding: calc(16px + env(safe-area-inset-top)) 16px 18px; border-radius: 0 0 24px 24px;
}
:root[data-theme="dark"] .hero { background: linear-gradient(160deg, #12324a, #0c2234); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero { background: linear-gradient(160deg, #12324a, #0c2234); } }
.hero-top { display: flex; align-items: center; gap: 12px; }
.hero-top .who { flex: 1; min-width: 0; }
.hero-top .who strong { display: block; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-top .who small { color: rgba(255,255,255,.78); }
.hero .avatar { border: 2px solid rgba(255,255,255,.6); }
.hero .avatar-initials { background: rgba(255,255,255,.18); color: #fff; }
.sync-pill { font-size: .75rem; font-weight: 650; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.16); white-space: nowrap; }
.sync-pill.offline { background: #fbbf24; color: #3a2a0c; }

.status-card { margin-top: 16px; background: var(--surface); color: var(--text); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); display: grid; gap: 6px; }
.status-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.state-chip { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.05rem; padding: 6px 14px 6px 10px; border-radius: 999px; }
.state-chip .dot { width: 12px; height: 12px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 20%, transparent); }
.clock { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.status-sub { color: var(--text-2); font-size: .9rem; }

/* Indicadores */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.stat small { display: block; font-size: .78rem; font-weight: 600; color: var(--text-3); }
.stat strong { display: block; font-size: 1.2rem; font-variant-numeric: tabular-nums; margin-top: 2px; }

/* Botones de marcación */
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.action {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 10px;
  min-height: 96px; padding: 14px; border-radius: 18px; border: 0; cursor: pointer; text-align: left;
  font: inherit; font-weight: 700; font-size: 1rem; color: var(--tone); background: var(--tone-bg);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 22%, transparent);
}
.action svg { width: 28px; height: 28px; }
.action small { font-weight: 500; font-size: .78rem; opacity: .85; color: inherit; }
.action.primary { grid-column: 1 / -1; min-height: 84px; flex-direction: row; align-items: center; justify-content: flex-start; gap: 14px; font-size: 1.15rem; color: #fff; background: var(--tone); box-shadow: 0 6px 18px color-mix(in srgb, var(--tone) 35%, transparent); }
.action.primary svg { width: 34px; height: 34px; }
:root[data-theme="dark"] .action.primary { color: #06121f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .action.primary { color: #06121f; } }
.action:active { transform: scale(.985); }
.a-success { --tone: var(--success); --tone-bg: var(--success-bg); }
.a-warning { --tone: var(--warning); --tone-bg: var(--warning-bg); }
.a-info { --tone: var(--info); --tone-bg: var(--info-bg); }
.a-accent { --tone: var(--violet); --tone-bg: var(--violet-bg); }
.a-danger { --tone: var(--danger); --tone-bg: var(--danger-bg); }
.a-neutral { --tone: var(--neutral); --tone-bg: var(--neutral-bg); }
.ended-note { text-align: center; padding: 20px; color: var(--text-2); }

.current { display: flex; gap: 12px; align-items: flex-start; }
.current .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.current p { margin: 2px 0 0; color: var(--text-2); font-size: .9rem; }

/* Línea de tiempo */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 54px 14px 1fr; gap: 10px; align-items: start; padding: 8px 0; }
.timeline .t { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.timeline .rail { position: relative; height: 100%; }
.timeline .rail::before { content: ""; position: absolute; left: 6px; top: 6px; width: 2px; bottom: -14px; background: var(--border); }
.timeline li:last-child .rail::before { display: none; }
.timeline .rail::after { content: ""; position: absolute; left: 1px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--brand); border: 2px solid var(--surface); }
.timeline .rail.pending::after { background: var(--warning); }
.timeline .rail.bad::after { background: var(--danger); }
.timeline .what { font-weight: 600; }
.timeline .meta { font-size: .82rem; color: var(--text-3); display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 2px; }

/* Navegación inferior */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--border);
  display: grid; grid-template-columns: repeat(4, 1fr); padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a { display: grid; justify-items: center; gap: 2px; padding: 8px 4px 10px; color: var(--text-3); text-decoration: none; font-size: .72rem; font-weight: 600; position: relative; }
.tabbar a[aria-current="page"] { color: var(--brand); }
.tabbar .count { position: absolute; top: 4px; left: calc(50% + 8px); background: var(--danger); color: #fff; border-radius: 999px; font-size: .65rem; padding: 0 6px; line-height: 16px; }
@media (min-width: 600px) { .tabbar { left: 50%; transform: translateX(-50%); width: 560px; border: 1px solid var(--border); border-bottom: 0; border-radius: 16px 16px 0 0; } }

/* Hoja de marcación */
.geo-result { border-radius: 14px; padding: 14px; display: grid; gap: 4px; margin-bottom: 14px; }
.geo-result strong { font-size: 1.05rem; }
.geo-meta { font-size: .85rem; opacity: .9; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip-option input { position: absolute; opacity: 0; pointer-events: none; }
.chip-option span { display: inline-block; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: .88rem; font-weight: 600; cursor: pointer; }
.chip-option input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip-option input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.group-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); margin: 4px 0 8px; }
.step-center { text-align: center; padding: 18px 0; display: grid; gap: 12px; justify-items: center; }

/* Historial / solicitudes */
.day-card { padding: 14px; }
.day-card summary { list-style: none; cursor: pointer; display: grid; gap: 8px; }
.day-card summary::-webkit-details-marker { display: none; }
.day-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.day-figs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; font-size: .85rem; color: var(--text-2); }
.day-figs b { display: block; color: var(--text); font-variant-numeric: tabular-nums; }
.day-body { margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 10px; }
.list { display: grid; gap: 10px; }
.req-item { display: grid; gap: 6px; cursor: pointer; text-align: left; width: 100%; font: inherit; color: inherit; }
.req-item .row { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.messages { display: grid; gap: 8px; margin: 12px 0; }
.msg { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; font-size: .9rem; }
.msg small { display: block; margin-bottom: 2px; }
.segmented { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
.segmented button { border: 0; background: none; font: inherit; font-size: .85rem; font-weight: 600; padding: 6px 12px; border-radius: 8px; color: var(--text-2); cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--brand); color: #fff; }

/* Ingreso */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: linear-gradient(170deg, var(--brand) 0%, var(--brand-strong) 45%, var(--bg) 45.1%); }
.login .card { width: min(420px, 100%); padding: 28px 22px; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }

.brand img { width: 48px; height: 48px; }
.brand strong { font-size: 1.25rem; display: block; }

.profile-head { display: flex; gap: 14px; align-items: center; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .92rem; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; font-weight: 600; }
.bell { position: fixed; top: max(10px, env(safe-area-inset-top)); right: max(12px, calc(50% - 268px)); z-index: 14; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); display: grid; place-items: center; box-shadow: var(--shadow); cursor: pointer; }
.bell svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bell .count { position: absolute; top: -4px; right: -4px; background: var(--danger); color: #fff; border-radius: 999px; font-size: .65rem; padding: 0 6px; line-height: 18px; min-width: 18px; text-align: center; }
.notif { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; padding: 12px 14px; }
.notif.unread { border-left: 4px solid var(--primary); background: var(--surface-2, var(--surface)); }
.notif .small { font-size: .78rem; }
.btn-block { width: 100%; }
.fab { position: fixed; right: max(16px, calc(50% - 264px)); bottom: calc(88px + env(safe-area-inset-bottom)); z-index: 15; border-radius: 999px; box-shadow: var(--shadow); min-height: 52px; padding: 0 20px; }

/* Etiquetas pulsables (días con falta/tardanza, pruebas adjuntas) */
.chip { display: inline-block; padding: 6px 12px; margin: 2px 4px 2px 0; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: .85rem; font-weight: 600; cursor: pointer; color: inherit; }
.chip:hover { border-color: var(--brand); }
.files .chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* deja sitio a la campana de avisos */
.hero-top { padding-right: 52px; }
.view-title { padding-right: 52px; }
