/* CAF · componentes compartidos */
.ic { width: 1.25em; height: 1.25em; flex: none; }

/* bloque de fecha */
.dblock { width: 54px; height: 58px; border-radius: 15px; background: var(--brand-soft); color: var(--brand); display: grid; place-content: center; text-align: center; flex: none; line-height: 1; }
.dblock b { font-size: 22px; font-weight: 700; letter-spacing: -.03em; }
.dblock i { font-style: normal; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-top: 3px; }

/* detalle de actividad */
.act-img { width: 100%; max-height: 420px; object-fit: cover; border-radius: 18px; margin-bottom: 12px; box-shadow: var(--shadow); }
.info-list { display: grid; gap: 10px; margin: 6px 0 14px; }
.info-row { display: flex; gap: 12px; align-items: flex-start; }
.info-row > .ic { margin-top: 2px; color: var(--brand); width: 20px; height: 20px; }
.desc { white-space: pre-line; color: var(--ink-2); margin: 6px 0 16px; }
.insc-box { border-top: 1px solid var(--line-2); padding-top: 16px; }
.ok-box { display: flex; gap: 12px; align-items: center; background: color-mix(in srgb, var(--good) 11%, transparent); color: var(--ink); border-radius: 16px; padding: 14px 16px; }
.ok-box > .ic { color: var(--good); width: 26px; height: 26px; }
.ok-box.big { padding: 18px; }
.warn-box, .note-box { border-radius: 14px; padding: 12px 14px; font-size: 14.5px; background: var(--gold-soft); color: #6b4c0a; }
@media (prefers-color-scheme: dark) { :root:not([data-tema="claro"]) .warn-box, :root:not([data-tema="claro"]) .note-box { color: #f0d68e; } }
.total-box { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 16px; border-radius: 16px; background: var(--brand-soft); }
.total-box b { font-size: 24px; color: var(--brand); letter-spacing: -.02em; }
.stepper { display: grid; grid-template-columns: 48px 1fr 48px; gap: 8px; align-items: center; }
.stepper button { height: 48px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); font-size: 24px; font-weight: 500; color: var(--brand); }
.stepper input { text-align: center; font-size: 20px; font-weight: 650; height: 48px; }

/* indicadores */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.kpi { background: var(--card); border: 1px solid var(--line-2); border-radius: 16px; padding: 13px 15px; box-shadow: var(--shadow); }
.kpi span { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.kpi b { display: block; font-size: 24px; letter-spacing: -.03em; margin-top: 2px; line-height: 1.15; }
.kpi b.good { color: var(--good); } .kpi b.bad { color: var(--bad); }

/* tablas (se desplazan en celular) */
.tabla-wrap { overflow-x: auto; border: 1px solid var(--line-2); border-radius: 16px; background: var(--card); -webkit-overflow-scrolling: touch; }
.tabla { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 560px; }
.tabla th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg-2) 60%, var(--card)); position: sticky; top: 0; white-space: nowrap; }
.tabla td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla .right { text-align: right; } .tabla td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* barra de progreso */
.bar { height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--brand); transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.bar.good > i { background: var(--good); } .bar.warn > i { background: var(--warn); } .bar.bad > i { background: var(--bad); } .bar.gold > i { background: var(--gold); }

.avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; display: grid; place-items: center; font-weight: 650; font-size: 15px; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 76px; height: 76px; font-size: 26px; }

/* asistente */
.asis-fab { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 70; display: inline-flex; align-items: center; gap: 8px; height: 52px; padding: 0 20px 0 16px; border: 0; border-radius: 999px; background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 88%, #fff), var(--brand)); color: #fff; font-weight: 650; font-size: 15px; box-shadow: 0 10px 28px -8px color-mix(in srgb, var(--brand) 70%, #000), 0 2px 6px rgba(0, 0, 0, .15); transition: transform .2s, opacity .2s; }
.asis-fab:active { transform: scale(.95); }
.asis-fab .ic { width: 22px; height: 22px; }
.asis-fab.en-app { bottom: calc(var(--tab-h) + 14px + env(safe-area-inset-bottom)); }
.asis-fab.oculto { opacity: 0; pointer-events: none; transform: scale(.8); }
@media (max-width: 420px) { .asis-fab span { display: none; } .asis-fab { padding: 0 15px; } }
@media (min-width: 900px) { .asis-fab.en-app { bottom: 22px; } }
.asis-panel { position: fixed; z-index: 95; right: 0; bottom: 0; left: 0; height: min(86dvh, 640px); background: var(--bg); border-radius: 24px 24px 0 0; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; transform: translateY(30px); opacity: 0; transition: .25s cubic-bezier(.2, .8, .2, 1); }
.asis-panel.in { transform: none; opacity: 1; }
@media (min-width: 640px) { .asis-panel { left: auto; right: 22px; bottom: 22px; width: 390px; border-radius: 24px; height: min(640px, 82dvh); } }
.asis-head { display: flex; align-items: center; gap: 12px; padding: 14px 12px 12px 16px; border-bottom: 1px solid var(--line-2); }
.asis-av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; }
.asis-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.asis-m { max-width: 86%; padding: 10px 14px; border-radius: 18px; font-size: 15px; line-height: 1.45; animation: pop .25s ease; word-wrap: break-word; }
.asis-m.el { background: var(--card); border: 1px solid var(--line-2); border-bottom-left-radius: 6px; align-self: flex-start; }
.asis-m.yo { background: var(--brand); color: #fff; border-bottom-right-radius: 6px; align-self: flex-end; }
.asis-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.asis-chips { display: flex; gap: 8px; overflow-x: auto; padding: 0 14px 8px; scrollbar-width: none; }
.asis-chips::-webkit-scrollbar { display: none; }
.asis-chips .chip { white-space: nowrap; }
.asis-form { display: flex; gap: 8px; padding: 10px 12px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-2); }
.asis-form .btn { width: 48px; min-width: 48px; padding: 0; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }

@media print { .asis-fab, .asis-panel, .toast-wrap, .no-print { display: none !important; } }
