/* ============================================================
   BASE RESET & FONTS
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    background: #f4f6f9;
    color: #222;
    -webkit-text-size-adjust: 100%;
}

/* ============================================================
   LAYOUT — APP SHELL
   ============================================================ */
.fab-app {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}

.fab-header {
    background: #00549c;
    color: #fff;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,.25);
}

.fab-logo {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: .5px;
    color: #fff;
    text-decoration: none;
}

.fab-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
}

.fab-btn-logout {
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.5);
    color: #fff;
    border-radius: 6px;
    padding: 0.25rem 0.65rem;
    cursor: pointer;
    font-size: 0.82rem;
}
.fab-btn-logout:hover { background: rgba(255,255,255,.3); }

.fab-main {
    flex: 1;
    padding: 1rem;
    max-width: 640px;
    width: 100%;
    margin: 0 auto;
}

/* ============================================================
   LOGIN
   ============================================================ */
.fab-login-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80dvh;
    padding: 1rem;
}

.fab-login-card {
    background: #fff;
    border-radius: 14px;
    padding: 2rem 1.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0,0,0,.10);
}

.fab-login-title {
    text-align: center;
    color: #00549c;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.fab-login-sub {
    text-align: center;
    color: #777;
    font-size: 0.9rem;
    margin-bottom: 1.75rem;
}

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.fab-form-wrap {
    background: #fff;
    border-radius: 14px;
    padding: 1.25rem 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,.07);
}

.fab-form-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #00549c;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e8eef5;
}

.fab-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 1rem;
}

.fab-field label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.fab-input {
    width: 100%;
    padding: 0.65rem 0.75rem;
    font-size: 1rem;
    border: 1.5px solid #ccd5df;
    border-radius: 8px;
    background: #fff;
    color: #222;
    appearance: auto;
    transition: border-color .15s;
}
.fab-input:focus {
    outline: none;
    border-color: #00549c;
    box-shadow: 0 0 0 3px rgba(0,84,156,.15);
}

.fab-textarea {
    resize: vertical;
    min-height: 80px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.fab-btn-primary {
    display: block;
    width: 100%;
    padding: 0.85rem;
    margin-top: 1.25rem;
    background: #00549c;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background .15s, opacity .15s;
}
.fab-btn-primary:hover:not(:disabled) { background: #003f78; }
.fab-btn-primary:disabled { opacity: .55; cursor: not-allowed; }

.fab-btn-link {
    display: block;
    width: 100%;
    background: none;
    border: none;
    color: #00549c;
    font-size: 0.85rem;
    text-align: center;
    margin-top: 0.85rem;
    padding: 0.3rem;
    cursor: pointer;
}
.fab-btn-link:hover { color: #003f78; }
.fab-btn-link:disabled { opacity: .55; cursor: not-allowed; }

/* ============================================================
   FEEDBACK MESSAGES
   ============================================================ */
.fab-error {
    background: #fff0f0;
    border: 1px solid #f5b3b3;
    color: #c0000c;
    border-radius: 8px;
    padding: 0.6rem 0.85rem;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.fab-ok {
    background: #f0fff4;
    border: 1px solid #9be3b3;
    color: #166c35;
    border-radius: 8px;
    padding: 0.6rem 0.85rem;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.fab-loading {
    text-align: center;
    color: #00549c;
    font-size: 0.95rem;
    padding: 2rem;
}

/* ============================================================
   BLAZOR ERROR UI
   ============================================================ */
#blazor-error-ui {
    background: #b32121;
    color: white;
    padding: 0.75rem 1rem;
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 999;
    font-size: 0.9rem;
}
#blazor-error-ui a.reload { color: #ffe; text-decoration: underline; margin-left: 0.5rem; }
#blazor-error-ui .dismiss { float: right; cursor: pointer; font-size: 1.1rem; }

/* ============================================================
   SELECTOR DE CENTRO
   ============================================================ */
.fab-btn-centro {
    display: block;
    width: 100%;
    padding: 0.85rem;
    background: #fff;
    color: #00549c;
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid #dde3ea;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
    text-align: center;
}
.fab-btn-centro:hover {
    border-color: #00549c;
    box-shadow: 0 4px 12px rgba(0,84,156,.15);
}

/* ============================================================
   MENU INICIO
   ============================================================ */
.fab-menu-wrap {
    padding: 0 0 1rem;
    text-align: center;
}
.fab-menu-logo-wrap { display: flex; justify-content: center; padding: 0.75rem 1rem 0; margin-top: 0; }
.fab-menu-logo { max-height: 136px; max-width: 340px; object-fit: contain; }
.fab-menu-bienvenida {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 0.25rem;
}
.fab-menu-sub {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 1.5rem;
}
.fab-menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.fab-menu-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 2px solid #dde3ea;
    border-radius: 14px;
    padding: 1.5rem 1rem;
    text-decoration: none;
    color: #00549c;
    transition: border-color .15s, box-shadow .15s;
    gap: 0.5rem;
}
.fab-menu-card:hover {
    border-color: #00549c;
    box-shadow: 0 4px 12px rgba(0,84,156,.15);
}
.fab-menu-icon { font-size: 2rem; display: flex; align-items: center; justify-content: center; }
.fab-menu-gc-icon  { width: 2rem; height: 2rem; }
.fab-menu-svg-icon { width: 2.2rem; height: 2.2rem; object-fit: contain; }
.fab-menu-label { font-size: 0.85rem; font-weight: 600; text-align: center; }

.fab-menu-grid-wrap {
    position: relative;
}
.fab-menu-maint {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    backdrop-filter: blur(2px);
}
.fab-menu-maint-icon { font-size: 2rem; }
.fab-menu-maint-msg  { font-size: 1rem; font-weight: 700; color: #c0392b; }
.fab-menu-maint-seg  { font-size: 0.85rem; color: #555; }

/* ============================================================
   REGISTRO ACUMULATIVO
   ============================================================ */
.fab-seccion-titulo {
    font-size: 0.85rem;
    font-weight: 700;
    color: #00549c;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin: 1.25rem 0 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid #e8eef5;
}

.fab-ultimos {
    background: #f5f8fc;
    border: 1px solid #dde3ea;
    border-radius: 10px;
    padding: 0.75rem;
    margin-bottom: 1rem;
}
.fab-ultimos-titulo {
    font-size: 0.8rem;
    font-weight: 700;
    color: #555;
    text-transform: uppercase;
    letter-spacing: .4px;
    margin-bottom: 0.6rem;
}
.fab-ultimos-vacio { font-size: 0.85rem; color: #999; }
.fab-loading-sm { font-size: 0.85rem; color: #00549c; }

.fab-registro-card {
    background: #fff;
    border: 1px solid #dde3ea;
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.82rem;
}
.fab-registro-card:last-child { margin-bottom: 0; }
.fab-registro-header {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.3rem;
    flex-wrap: wrap;
}
.fab-registro-fecha { font-weight: 700; color: #00549c; }
.fab-registro-turno {
    background: #e8f0fb;
    color: #00549c;
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 0.75rem;
}
.fab-registro-edu { color: #666; font-size: 0.78rem; }
.fab-registro-hechos { color: #333; line-height: 1.5; }

.fab-notas-titulo {
    font-size: 0.85rem;
    font-weight: 700;
    color: #00549c;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin: 1rem 0 0.5rem;
}
.fab-notas-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.fab-nota-item { display: flex; flex-direction: column; gap: 0.25rem; }
.fab-nota-label { font-size: 0.75rem; font-weight: 600; color: #555; }
.fab-nota-select { padding: 0.5rem; }

.fab-field-check { flex-direction: row; align-items: center; gap: 0.75rem; margin-top: 0.5rem; }
.fab-check-label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; font-size: 0.95rem; }
.fab-checkbox { width: 20px; height: 20px; cursor: pointer; }
.fab-trasvase-aviso {
    font-size: 0.78rem;
    color: #c07000;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 6px;
    padding: 0.4rem 0.7rem;
    margin-top: 0.4rem;
}

/* ============================================================
   VISITAS / SALIDAS / LLAMADAS
   ============================================================ */
.fab-visita-activa {
    background: #fff8e1;
    border: 1.5px solid #ffc107;
    border-radius: 10px;
    padding: 0.75rem;
    margin-bottom: 0.6rem;
    cursor: pointer;
    transition: box-shadow .15s;
}
.fab-visita-activa:hover { box-shadow: 0 3px 10px rgba(255,193,7,.35); }
.fab-va-nombre { font-weight: 700; color: #333; font-size: 0.95rem; margin-bottom: 0.3rem; }
.fab-va-info { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; font-size: 0.78rem; color: #666; }
.fab-va-supervisor { color: #00549c; font-weight: 600; }
.fab-va-hechos { font-size: 0.78rem; color: #555; margin-top: 0.35rem; line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.fab-tipo-grupo { display: flex; gap: 0.5rem; }
.fab-tipo-btn {
    flex: 1;
    padding: 0.55rem;
    border: 1.5px solid #ccd5df;
    border-radius: 8px;
    background: #fff;
    color: #555;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
}
.fab-tipo-btn.activo { background: #00549c; color: #fff; border-color: #00549c; }

.fab-menores-lista {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    max-height: 220px;
    overflow-y: auto;
    border: 1.5px solid #ccd5df;
    border-radius: 8px;
    padding: 0.5rem;
}
.fab-menor-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background .1s;
}
.fab-menor-check:hover { background: #f0f4fa; }
.fab-menor-check.seleccionado { background: #e8f0fb; font-weight: 600; color: #00549c; }

.fab-visita-banner {
    background: #e8f5e9;
    border: 1.5px solid #a5d6a7;
    border-radius: 8px;
    padding: 0.6rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #166c35;
    margin-bottom: 1rem;
}
.fab-menor-tag {
    display: inline-block;
    background: #e8f0fb;
    color: #00549c;
    border-radius: 20px;
    padding: 0.2rem 0.7rem;
    font-size: 0.82rem;
    font-weight: 600;
    margin: 0.15rem;
}
.fab-dinero-fila {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px solid #f0f0f0;
    gap: 0.75rem;
}
.fab-dinero-nombre { font-size: 0.88rem; color: #333; flex: 1; }
.fab-dinero-input { width: 90px; padding: 0.4rem 0.5rem; font-size: 0.95rem; text-align: right; }

/* Logo en login */
.fab-login-logo { display: block; max-width: 180px; margin: 0 auto 0.75rem; }
/* Logo en header */
.fab-header-logo { height: 28px; vertical-align: middle; }

/* ============================================================
   CUADRANTE DE MEDICACIÓN
   ============================================================ */
.fab-cuad-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0 0.5rem 2rem;
    max-width: 100%;
}
.fab-cuad-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0 0.25rem;
}
.fab-cuad-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #00549c;
}
.fab-cuad-controles {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.fab-cuad-casa-wrap { margin: 0; }
.fab-cuad-semana-nav {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.fab-cuad-nav-btn {
    padding: 0.4rem 0.75rem;
    border: 1.5px solid #ccd5df;
    border-radius: 7px;
    background: #fff;
    color: #333;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
}
.fab-cuad-nav-btn:hover { background: #f0f4fa; }
.fab-cuad-hoy { background: #00549c; color: #fff; border-color: #00549c; }
.fab-cuad-hoy:hover { background: #003f78; }
.fab-cuad-semana-label {
    flex: 1;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: #444;
}
.fab-cuad-loading, .fab-cuad-vacio {
    text-align: center;
    color: #888;
    padding: 2rem 0;
    font-size: 0.9rem;
}

/* Tabla */
.fab-cuad-tabla-wrap {
    overflow-x: auto;
    border-radius: 10px;
    border: 1.5px solid #ccd5df;
}
.fab-cuad-tabla {
    border-collapse: collapse;
    width: 100%;
    min-width: 600px;
    font-size: 0.8rem;
}
.fab-cuad-tabla thead tr {
    background: #f0f4fa;
}
.fab-cuad-th-fijo {
    padding: 0.5rem 0.6rem;
    border: 1px solid #dde4ef;
    text-align: left;
    font-weight: 700;
    color: #333;
    white-space: nowrap;
}
.fab-cuad-th-dia {
    padding: 0.4rem 0.5rem;
    border: 1px solid #dde4ef;
    text-align: center;
    font-weight: 700;
    color: #00549c;
    font-size: 0.75rem;
    min-width: 80px;
}
.fab-cuad-th-fecha { font-weight: 400; font-size: 0.7rem; color: #666; }
.fab-cuad-hoy-col { background: #fff8e1 !important; }
.fab-cuad-td-texto {
    padding: 0.45rem 0.6rem;
    border: 1px solid #eef0f5;
    color: #222;
    white-space: normal;
}
.fab-cuad-td-dosis {
    padding: 0.45rem 0.6rem;
    border: 1px solid #eef0f5;
    color: #555;
    white-space: normal;
}
.fab-cuad-td-toma {
    padding: 0.45rem 0.3rem;
    border: 1px solid #eef0f5;
    text-align: center;
    font-weight: 700;
    color: #1b7a3e;
    background: #f0faf4;
    letter-spacing: 0.5px;
}
.fab-cuad-td-fin {
    padding: 0.45rem 0.3rem;
    border: 1px solid #eef0f5;
    text-align: center;
    font-weight: 700;
    color: #c07000;
    background: #fff8e1;
    font-size: 0.72rem;
}
.fab-cuad-td-nodía {
    padding: 0.45rem 0.3rem;
    border: 1px solid #eef0f5;
    text-align: center;
    color: #bbb;
}
.fab-cuad-td-vacio {
    padding: 0.45rem 0.3rem;
    border: 1px solid #eef0f5;
    background: #f8f8f8;
}

/* Footer */
.fab-cuad-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding-top: 0.25rem;
}
.fab-cuad-leyenda {
    font-size: 0.78rem;
    color: #666;
}
.fab-cuad-print-btn { font-size: 0.85rem; padding: 0.45rem 0.9rem; }

/* ── Registro de administración — badges en celdas ── */
.fab-cuad-td-activa {
    padding: 0.35rem 0.25rem;
    border: 1px solid #eef0f5;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
}
.fab-cuad-td-activa:hover { background: #f0f4ff; }
.fab-cuad-td-fut {
    padding: 0.35rem 0.25rem;
    border: 1px solid #eef0f5;
    text-align: center;
    vertical-align: middle;
    opacity: 0.45;
}
.rm-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px; height: 26px;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 700;
    margin: 2px;
    flex-shrink: 0;
}
.rm-dado      { background: #dcfce7; color: #16a34a; border: 1.5px solid #86efac; }
.rm-pendiente { background: #fee2e2; color: #dc2626; border: 1.5px solid #fca5a5; }
.rm-fut       { background: #f3f4f6; color: #9ca3af; border: 1.5px solid #d1d5db; }
.rm-fin-label { font-size: 0.62rem; color: #c07000; margin-top: 2px; line-height: 1; }

/* ── Modal registro medicación ── */
.rm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rm-modal {
    background: #fff;
    border-radius: 14px;
    padding: 1.5rem;
    width: min(420px, 92vw);
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.rm-modal-header {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.75rem;
}
.rm-modal-menor { font-size: 1.05rem; font-weight: 700; color: #1a1a2e; }
.rm-modal-med   { font-size: 0.9rem;  color: #333; }
.rm-modal-dosis { font-size: 0.8rem;  color: #777; }
.rm-modal-fecha { font-size: 0.85rem; color: #555; font-weight: 500; }
.rm-modal-aviso {
    background: #fff8e1;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 0.45rem 0.75rem;
    font-size: 0.82rem;
    color: #856404;
}
.rm-modal-turnos {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    flex-wrap: wrap;
    padding: 0.25rem 0;
}
.rm-turno-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.85rem 1rem;
    border: 2px solid #d1d5db;
    border-radius: 10px;
    background: #f9fafb;
    color: #555;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    min-width: 80px;
    transition: border-color 0.15s, background 0.15s;
}
.rm-turno-btn:hover   { border-color: #4ade80; background: #f0fdf4; }
.rm-turno-dado        { background: #dcfce7; border-color: #22c55e; color: #15803d; }
.rm-turno-dado:hover  { background: #bbf7d0; }
.rm-turno-icono { font-size: 1.3rem; }
.rm-turno-check { font-size: 1rem; }
.rm-modal-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding-top: 0.5rem;
    border-top: 1px solid #eee;
}
.rm-btn-cancel {
    padding: 0.5rem 1.2rem;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    color: #555;
    font-size: 0.9rem;
    cursor: pointer;
}
.rm-btn-cancel:hover { background: #f3f4f6; }
.rm-btn-save {
    padding: 0.5rem 1.4rem;
    border-radius: 8px;
    border: none;
    background: #1976d2;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}
.rm-btn-save:hover     { background: #1565c0; }
.rm-btn-save:disabled  { background: #90caf9; cursor: not-allowed; }

/* Ocultar controles al imprimir y mostrar tabla completa */
@media print {
    .fab-cuad-header, .fab-cuad-controles, .fab-cuad-footer, .fab-back-btn { display: none !important; }
    .fab-cuad-tabla-wrap { border: none; overflow: visible; }
    .fab-cuad-tabla { min-width: unset; font-size: 9pt; }
}

/* ============================================================
   HUCHA / DINERO DE BOLSILLO
   ============================================================ */
.fab-hucha-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 560px;
    margin: 0 auto;
    padding: 0 1rem 2rem;
}
.fab-hucha-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0 0.25rem;
}
.fab-hucha-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #00549c;
}
.fab-hucha-loading {
    text-align: center;
    color: #888;
    padding: 2rem 0;
}
.fab-hucha-search-wrap { width: 100%; }
.fab-hucha-search { width: 100%; box-sizing: border-box; }

/* Lista de saldos */
.fab-hucha-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: 280px;
    overflow-y: auto;
    border: 1.5px solid #ccd5df;
    border-radius: 10px;
    padding: 0.5rem;
    background: #fafbfc;
}
.fab-hucha-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    cursor: pointer;
    transition: all .15s;
}
.fab-hucha-card:hover { background: #f0f4fa; border-color: #a0b8d4; }
.fab-hucha-card--sel { background: #e8f0fb; border-color: #00549c; }
.fab-hucha-card-nombre { font-size: 0.92rem; color: #222; font-weight: 600; }
.fab-hucha-card-saldo { font-size: 0.97rem; font-weight: 700; }

/* Colores pos/neg reutilizables */
.pos { color: #1b7a3e; }
.neg { color: #c0392b; }

/* Panel de detalle */
.fab-hucha-detalle {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: #fff;
    border: 1.5px solid #ccd5df;
    border-radius: 12px;
    padding: 1rem;
}
.fab-hucha-saldo-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e8eef5;
}
.fab-hucha-saldo-nombre { font-size: 1rem; font-weight: 700; color: #333; }
.fab-hucha-saldo-importe { font-size: 2rem; font-weight: 800; line-height: 1.1; }
.fab-hucha-saldo-label { font-size: 0.78rem; color: #888; }

/* Formulario */
.fab-hucha-form { display: flex; flex-direction: column; gap: 0.6rem; }
.fab-hucha-tipo-wrap { display: flex; gap: 0.5rem; }
.fab-hucha-tipo-btn {
    flex: 1;
    padding: 0.6rem;
    border: 1.5px solid #ccd5df;
    border-radius: 8px;
    background: #fff;
    color: #555;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s;
}
.fab-hucha-tipo-btn.active-ing { background: #e8f5e9; color: #1b7a3e; border-color: #4caf50; }
.fab-hucha-tipo-btn.active-ret { background: #ffebee; color: #c0392b; border-color: #ef9a9a; }
.fab-hucha-obs { resize: vertical; min-height: 52px; }
.fab-hucha-guardar { width: 100%; margin-top: 0.25rem; }

/* Historial */
.fab-hucha-hist-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #555;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding-top: 0.25rem;
}
.fab-hucha-hist {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.4rem;
}
.fab-hucha-hist-row {
    display: grid;
    grid-template-columns: 70px 1fr 70px 70px;
    gap: 0.4rem;
    align-items: center;
    padding: 0.35rem 0.4rem;
    border-radius: 6px;
    font-size: 0.82rem;
    background: #fafbfc;
    border: 1px solid #f0f0f0;
}
.fab-hucha-hist-fecha { color: #888; font-size: 0.78rem; }
.fab-hucha-hist-concepto { color: #333; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fab-hucha-hist-imp { font-weight: 700; text-align: right; }
.fab-hucha-hist-saldo { color: #555; text-align: right; font-size: 0.78rem; }
.fab-hucha-hist-vacio { text-align: center; color: #aaa; font-size: 0.85rem; padding: 0.75rem 0; }
.fab-hucha-hist-row { cursor: pointer; transition: background .12s; }
.fab-hucha-hist-row:hover { background: #f0f4fa; }
.fab-hucha-hist-row--sel { background: #e8f0fb; border-color: #a0b8d4; }

/* Panel detalle movimiento */
.fab-hucha-mov-detalle {
    position: relative;
    background: #f8faff;
    border: 1.5px solid #a0b8d4;
    border-radius: 10px;
    padding: 1rem 1rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.fab-hucha-mov-cerrar {
    position: absolute;
    top: 0.5rem;
    right: 0.6rem;
    background: none;
    border: none;
    font-size: 1rem;
    color: #888;
    cursor: pointer;
    line-height: 1;
}
.fab-hucha-mov-cerrar:hover { color: #333; }
.fab-hucha-mov-fecha { font-size: 0.78rem; color: #888; }
.fab-hucha-mov-importe { font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
.fab-hucha-mov-concepto { font-size: 0.97rem; font-weight: 600; color: #222; }
.fab-hucha-mov-obs-label { font-size: 0.75rem; font-weight: 700; color: #888; text-transform: uppercase; letter-spacing: .04em; margin-top: 0.25rem; }
.fab-hucha-mov-obs { font-size: 0.88rem; color: #444; line-height: 1.45; white-space: pre-wrap; }

/* ============================================================
   FUGAS
   ============================================================ */

/* Tarjeta de menú */
.fab-menu-card--fugas { border-color: #d32f2f; color: #c0000c; }
.fab-menu-card--fugas:hover { border-color: #c0000c; box-shadow: 0 4px 12px rgba(192,0,12,.18); }

/* Contenedor principal */
.fug-wrap {
    padding: 0 0 2rem;
    max-width: 640px;
    margin: 0 auto;
}
.fug-with-bar { padding-top: 4.5rem; }

/* ── Barra SOS fija ──────────────────────────────────────── */
.fug-sos-bar {
    position: fixed;
    top: 56px; /* debajo del header */
    left: 0; right: 0;
    z-index: 200;
    display: flex;
    gap: 0;
    background: #b71c1c;
    box-shadow: 0 3px 10px rgba(0,0,0,.35);
}
.fug-sos-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.25rem;
    color: #fff;
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 700;
    border: none;
    background: transparent;
    cursor: pointer;
    border-right: 1px solid rgba(255,255,255,.2);
    line-height: 1.2;
    gap: 0.1rem;
}
.fug-sos-btn:last-child { border-right: none; }
.fug-sos-btn:hover { background: rgba(255,255,255,.12); }
.fug-sos-btn small { font-size: 0.68rem; opacity: .85; font-weight: 400; }
.fug-sos-ico { font-size: 1.1rem; }
.fug-sos-112 { background: rgba(0,0,0,.15); font-size: 0.85rem; }

/* ── Ficha de emergencia overlay ─────────────────────────── */
.fug-ficha-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0,0,0,.6);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}
.fug-ficha-card {
    background: #fff;
    width: 100%;
    max-width: 640px;
    border-radius: 16px 16px 0 0;
    padding: 1rem 1rem 0;
    max-height: 85dvh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.fug-ficha-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1rem;
    font-weight: 700;
    color: #c0000c;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #fdd;
}
.fug-ficha-header button { background: none; border: none; font-size: 1.2rem; color: #888; cursor: pointer; }
.fug-ficha-body { flex: 1; }
.fug-ficha-row {
    padding: 0.4rem 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 0.92rem;
    line-height: 1.5;
}
.fug-ficha-row ul { padding-left: 1.2rem; }
.fug-ficha-row ul li { font-size: 0.9rem; }
.fug-med-alert { color: #c0000c; background: #fff8f8; border-radius: 6px; padding: 0.4rem 0.5rem; margin: 0.3rem 0; }
.fug-ubicacion { color: #00549c; }
.fug-btn-gps {
    margin-top: 0.5rem;
    background: #00549c;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.55rem 1rem;
    font-size: 0.9rem;
    cursor: pointer;
    font-weight: 600;
}
.fug-btn-gps:disabled { opacity: .6; cursor: not-allowed; }
.fug-ficha-call-btn {
    display: block;
    text-align: center;
    background: #c0000c;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    padding: 0.9rem;
    margin: 0.75rem -1rem 0;
    text-decoration: none;
    border-top: 1px solid #e8b3b3;
}

/* ── Auth step-up ────────────────────────────────────────── */
.fug-auth-card {
    max-width: 400px;
    margin: 2rem auto 0;
    background: #fff;
    border-radius: 14px;
    padding: 2rem 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,.10);
}
.fug-auth-icon { font-size: 2.5rem; text-align: center; margin-bottom: 0.5rem; }
.fug-auth-title { text-align: center; font-size: 1.2rem; font-weight: 700; color: #333; margin-bottom: 0.5rem; }
.fug-auth-info { font-size: 0.88rem; color: #555; text-align: center; margin-bottom: 0.4rem; line-height: 1.5; }
.fug-auth-aviso {
    font-size: 0.78rem;
    color: #fff;
    background: #00549c;
    border-radius: 6px;
    padding: 0.35rem 0.7rem;
    text-align: center;
    margin-bottom: 1.25rem;
}
.fug-btn-link {
    display: block;
    width: 100%;
    background: none;
    border: none;
    color: #00549c;
    font-size: 0.85rem;
    text-align: center;
    margin-top: 0.85rem;
    padding: 0.3rem;
    cursor: pointer;
    text-decoration: underline;
}
.fug-btn-link:hover { color: #003f78; }
.fug-registro-huella {
    max-width: 400px;
    margin: 0 auto 1.25rem;
    background: #eaf3ff;
    border: 1px solid #b8d8ff;
    border-radius: 10px;
    padding: 0.9rem 1rem;
    font-size: 0.85rem;
    color: #333;
    text-align: center;
}
.fug-registro-huella .fug-registro-botones { display: flex; gap: 0.6rem; justify-content: center; margin-top: 0.6rem; }

/* ── Selector de menor ───────────────────────────────────── */
.fug-section-header {
    padding: 1rem 1rem 0.5rem;
}
.fug-section-header h2 { font-size: 1.05rem; font-weight: 700; color: #333; }
.fug-empty { text-align: center; color: #999; padding: 2rem; }

.fug-menor-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0 0.75rem;
}
.fug-menor-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    background: #fff;
    border: 2px solid #dde3ea;
    border-radius: 12px;
    padding: 0.6rem 0.85rem;
    cursor: pointer;
    transition: all .15s;
    gap: 0.85rem;
    position: relative;
}
.fug-menor-card:hover { border-color: #00549c; box-shadow: 0 3px 10px rgba(0,84,156,.13); }
.fug-card-activa { border-color: #c0000c !important; background: #fff8f8; }

.fug-menor-foto {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    background: #e8eef5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #aaa;
    border: 2px solid #dde3ea;
    flex-shrink: 0;
}
.fug-foto-placeholder { font-size: 1.5rem; }
.fug-menor-info { display: flex; flex-direction: column; gap: 0.15rem; flex: 1; }
.fug-menor-nombre { font-size: 0.95rem; font-weight: 700; color: #222; line-height: 1.3; }
.fug-menor-edad { font-size: 0.8rem; color: #888; }
.fug-fuga-badge {
    background: #c0000c;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    border-radius: 4px;
    padding: 2px 7px;
    align-self: flex-start;
}

/* ── Cabecera fase ───────────────────────────────────────── */
.fug-fase-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #fff;
    border-bottom: 1px solid #e8eef5;
    font-size: 0.88rem;
    font-weight: 700;
    color: #333;
    position: sticky;
    top: 4.5rem;
    z-index: 50;
}
.fug-btn-back, .fug-btn-next {
    background: none;
    border: 1.5px solid #ccd5df;
    border-radius: 7px;
    padding: 0.35rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #00549c;
    cursor: pointer;
}
.fug-btn-next:hover, .fug-btn-back:hover { background: #f0f4fa; }
.fug-btn-fase2 { border-color: #00549c; }

.fug-menor-cabecera {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    color: #555;
    background: #f5f8fc;
    border-bottom: 1px solid #e8eef5;
}

/* ── Panel medicación ────────────────────────────────────── */
.fug-med-panel {
    margin: 0.75rem 1rem;
    background: #fff3cd;
    border: 1.5px solid #ffc107;
    border-radius: 10px;
    padding: 0.65rem 0.9rem;
}
.fug-med-panel.fug-med-none {
    background: #f0faf4;
    border-color: #a5d6a7;
    color: #1b7a3e;
    font-size: 0.88rem;
    font-weight: 600;
}
.fug-med-title { font-size: 0.82rem; font-weight: 700; color: #856404; margin-bottom: 0.4rem; }
.fug-med-item {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: baseline;
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(255,193,7,.3);
}
.fug-med-item:last-child { border-bottom: none; }
.fug-med-nombre { font-size: 0.9rem; font-weight: 700; color: #5d4037; }
.fug-med-dosis  { font-size: 0.82rem; color: #6d4c41; background: rgba(255,193,7,.2); border-radius: 4px; padding: 1px 6px; }
.fug-med-frec   { font-size: 0.78rem; color: #795548; font-style: italic; }

.fug-ficha-seccion {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #fff;
    background: #00549c;
    padding: 0.25rem 0.6rem;
    margin: 0.6rem -1rem 0;
}

/* ── Formulario fases ────────────────────────────────────── */
.fug-form-section { padding: 0 1rem; }
.fug-form-row { display: flex; gap: 0.75rem; }
.fug-form-row .fab-field { flex: 1; }
.fug-textarea { resize: vertical; }

.fug-check-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: #555;
    text-transform: uppercase;
    letter-spacing: .4px;
    margin: 1rem 0 0.5rem;
}
.fug-check-grid {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1rem;
}
.fug-check {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.92rem;
    color: #333;
    cursor: pointer;
    padding: 0.45rem 0.6rem;
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    background: #fafbfc;
}
.fug-check:hover { background: #f0f4fa; border-color: #a0b8d4; }
.fug-check input[type=checkbox] { width: 18px; height: 18px; cursor: pointer; accent-color: #00549c; }

/* ── Mensajes ────────────────────────────────────────────── */
.fug-msg-ok {
    background: #f0fff4;
    border: 1px solid #9be3b3;
    color: #166c35;
    border-radius: 8px;
    padding: 0.6rem 0.85rem;
    font-size: 0.9rem;
    margin: 0.5rem 1rem;
}

.fug-btn-guardar { margin: 0.5rem 1rem; width: calc(100% - 2rem); }

/* ============================================================
   ESPECIALIDADES MÉDICAS
   ============================================================ */

.esp-wrap {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 0 2rem;
}

.esp-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem 0.6rem;
    border-bottom: 1px solid #e8eef5;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
}

.esp-btn-volver {
    background: none;
    border: 1.5px solid #ccd5df;
    border-radius: 7px;
    padding: 0.3rem 0.65rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #00549c;
    cursor: pointer;
    white-space: nowrap;
}
.esp-btn-volver:hover { background: #f0f4fa; }

.esp-titulo {
    font-size: 1.05rem;
    font-weight: 700;
    color: #222;
    margin: 0;
}

.esp-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: #555;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.esp-selector-wrap {
    padding: 1rem 1rem 0.5rem;
}

.esp-vacio {
    text-align: center;
    color: #999;
    padding: 2rem 1rem;
    font-size: 0.9rem;
}

.esp-lista {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.5rem 1rem 1rem;
}

.esp-card {
    background: #fff;
    border: 1.5px solid #dde3ea;
    border-radius: 12px;
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.esp-card--incompleta {
    border-color: #ef9a9a;
    background: #fff5f5;
}

.esp-card-nombre {
    font-size: 1rem;
    font-weight: 700;
    color: #222;
    line-height: 1.3;
}

.esp-alerta {
    font-size: 0.78rem;
    color: #c0392b;
    font-weight: 600;
}

.esp-btn-maps {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #00549c;
    color: #fff;
    border-radius: 8px;
    padding: 0.5rem 0.9rem;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    align-self: flex-start;
}
.esp-btn-maps:hover { background: #003f78; }

.esp-dato {
    display: flex;
    gap: 0.4rem;
    align-items: flex-start;
    font-size: 0.88rem;
    color: #444;
    line-height: 1.45;
}
.esp-dato-ico { flex-shrink: 0; }
.esp-dato--contactos { flex-wrap: wrap; }

/* Teléfonos detectados automáticamente en el campo Contactos */
.esp-tel {
    color: #00549c;
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1.5px solid #a0c4e8;
    padding-bottom: 1px;
}
.esp-tel:hover { border-bottom-color: #00549c; }

/* ============================================================
   AGENDA
   ============================================================ */

/* ── Selector (página de entrada) ───────────────────────────── */
.ag-selector-wrap {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 0 2rem;
}
.ag-selector-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem 0.6rem;
    border-bottom: 1px solid #e8eef5;
    background: #fff;
}
.ag-selector-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem 1rem;
}
.ag-selector-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    background: #fff;
    border: 1.5px solid #dde3ea;
    border-radius: 16px;
    padding: 2rem 1rem;
    text-decoration: none;
    color: #222;
    transition: all .15s;
}
.ag-selector-card:hover { border-color: #00549c; box-shadow: 0 4px 14px rgba(0,84,156,.12); }
.ag-selector-ico   { font-size: 2.5rem; }
.ag-selector-titulo { font-size: 1.1rem; font-weight: 700; color: #222; }
.ag-selector-desc  { font-size: 0.85rem; color: #777; text-align: center; }

/* ── Lista de contactos ──────────────────────────────────────── */
.ag-wrap {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 0 2rem;
}
.ag-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem 0.6rem;
    border-bottom: 1px solid #e8eef5;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
}
.ag-busqueda-wrap { padding: 0.75rem 1rem 0.25rem; }
.ag-busqueda { width: 100%; box-sizing: border-box; }

.ag-count {
    font-size: 0.78rem;
    color: #999;
    padding: 0 1rem 0.5rem;
}
.ag-vacio {
    text-align: center;
    color: #999;
    padding: 2rem 1rem;
    font-size: 0.9rem;
}
.ag-lista {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0 1rem;
}

/* ── Tarjeta de contacto ─────────────────────────────────────── */
.ag-card {
    background: #fff;
    border: 1.5px solid #dde3ea;
    border-radius: 12px;
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.ag-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}
.ag-card-nombre   { font-size: 1rem; font-weight: 700; color: #222; line-height: 1.3; flex: 1; }
.ag-card-subtitulo { font-size: 0.85rem; color: #555; display: flex; flex-wrap: wrap; gap: 0.25rem; }
.ag-card-depto    { font-size: 0.8rem; color: #888; font-style: italic; }
.ag-sep           { color: #bbb; }

.ag-card-acciones {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.25rem;
}
.ag-btn-tel, .ag-btn-email {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 7px;
    padding: 0.35rem 0.75rem;
    text-decoration: none;
}
.ag-dato-tel {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    font-size: 0.88rem;
    color: #444;
    flex-wrap: wrap;
}
.ag-btn-email { background: #f0f4fa; color: #444; border-radius: 7px; padding: 0.35rem 0.75rem; text-decoration: none; font-size: 0.85rem; font-weight: 600; }
.ag-btn-email:hover { background: #e2e8f0; }

.ag-card-obs {
    font-size: 0.82rem;
    color: #666;
    background: #f8faff;
    border-radius: 6px;
    padding: 0.35rem 0.6rem;
    margin-top: 0.15rem;
    line-height: 1.4;
}

/* ── Prioridades (agenda de equipo) ──────────────────────────── */
.ag-badge {
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 5px;
    padding: 2px 8px;
    white-space: nowrap;
    flex-shrink: 0;
}
.ag-badge--urgente   { background: #ffebee; color: #c0392b; }
.ag-badge--proximo   { background: #fff8e1; color: #9a7d0a; }
.ag-badge--completado{ background: #f0f0f0; color: #888; }

.ag-card--urgente   { border-color: #ef9a9a; background: #fffafa; }
.ag-card--proximo   { border-color: #ffe082; background: #fffff8; }
.ag-card--completado{ border-color: #ccc;    background: #f8f8f8; opacity: .75; }

/* ============================================================
   PESO Y ESTATURA
   ============================================================ */

.pe-wrap {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 0 2rem;
}
.pe-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem 0.6rem;
    border-bottom: 1px solid #e8eef5;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
}
.pe-casa-wrap { padding: 0.75rem 1rem 0.25rem; }
.pe-instruccion {
    font-size: 0.85rem;
    color: #888;
    padding: 0.6rem 1rem 0.25rem;
    margin: 0;
}
.pe-lista {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
}
.pe-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: #fff;
    border: 1.5px solid #dde3ea;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all .15s;
}
.pe-card:hover { border-color: #00549c; box-shadow: 0 3px 10px rgba(0,84,156,.1); }

.pe-card-iniciales {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #e8f0fb;
    color: #00549c;
    font-size: 1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: -.5px;
}
.pe-card-datos { flex: 1; display: flex; flex-direction: column; gap: 0.15rem; }
.pe-medicion-fila { display: flex; flex-direction: column; gap: 0.05rem; }
.pe-medicion-valor { font-size: 0.9rem; font-weight: 600; color: #333; white-space: nowrap; }
.pe-fecha-small { font-size: 0.72rem; color: #aaa; }
.pe-fecha { font-size: 0.75rem; color: #999; }
.pe-card-arrow { font-size: 1.3rem; color: #bbb; }

/* Formulario */
.pe-form-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
}
.pe-menor-badge {
    align-self: flex-start;
    background: #e8f0fb;
    color: #00549c;
    font-size: 1rem;
    font-weight: 800;
    border-radius: 10px;
    padding: 0.4rem 0.85rem;
    margin-bottom: 0.25rem;
    border: 1.5px solid #a0c4e8;
}
.pe-ultima {
    font-size: 0.88rem;
    color: #555;
    background: #f0f4fa;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
}
.pe-ultima--sin { color: #999; background: #f8f8f8; }
.pe-ultima-fecha { color: #999; margin-left: 0.3rem; }
.pe-fila-doble {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.pe-aviso {
    background: #fff8e1;
    border: 1.5px solid #ffc107;
    color: #7a5c00;
    border-radius: 8px;
    padding: 0.6rem 0.85rem;
    font-size: 0.88rem;
    line-height: 1.45;
}

/* Calendario */
.cal-wrap { display: flex; flex-direction: column; min-height: 100dvh; padding-bottom: 1.5rem; }
.cal-header { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; }
.cal-btn-refresh { margin-left: auto; background: none; border: 1.5px solid #ccc; border-radius: 8px;
    padding: 0.3rem 0.7rem; font-size: 1.1rem; cursor: pointer; color: #555; }
.cal-btn-refresh:hover { background: #f0f0f0; }
.cal-lista { display: flex; flex-direction: column; gap: 0; padding: 0 1rem; }
.cal-grupo-fecha { font-size: 0.78rem; font-weight: 700; color: #00549c; text-transform: uppercase;
    letter-spacing: 0.04em; padding: 1rem 0 0.35rem; border-bottom: 1.5px solid #dde7f5; margin-bottom: 0.4rem; }
.cal-evento { background: #fff; border-radius: 10px; border: 1px solid #e8edf5;
    padding: 0.65rem 0.9rem; margin-bottom: 0.5rem; }
.cal-evento--fabulino { border-left: 3px solid #00549c; }
.cal-evento-titulo { font-weight: 600; font-size: 0.95rem; color: #222; }
.cal-evento-meta { font-size: 0.8rem; color: #888; margin-top: 0.2rem; }
.cal-evento-dur { color: #aaa; }
.cal-evento-desc { font-size: 0.82rem; color: #666; margin-top: 0.35rem;
    white-space: pre-line; border-top: 1px solid #f0f0f0; padding-top: 0.3rem; }
.cal-vacio { padding: 2rem 1rem; color: #999; text-align: center; }
.cal-evento { cursor: pointer; }
.cal-evento:active { background: #f0f5ff; }
.cal-evento-desc-preview { font-size: 0.82rem; color: #888; margin-top: 0.35rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Modal detalle evento */
.cal-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45);
    display: flex; align-items: flex-end; justify-content: center; z-index: 1000; }
.cal-modal { background: #fff; border-radius: 16px 16px 0 0; width: 100%; max-width: 560px;
    max-height: 85dvh; overflow-y: auto; padding: 1.25rem 1.25rem 2rem;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.15); }
.cal-modal-header { display: flex; align-items: flex-start; gap: 0.75rem; margin-bottom: 1rem; }
.cal-modal-titulo { flex: 1; font-size: 1.05rem; font-weight: 700; color: #00549c; line-height: 1.3; }
.cal-modal-cerrar { background: none; border: none; font-size: 1.1rem; color: #999;
    cursor: pointer; padding: 0; flex-shrink: 0; }
.cal-modal-cuerpo { display: flex; flex-direction: column; gap: 0.6rem; }
.cal-modal-fila { display: flex; gap: 0.75rem; font-size: 0.92rem; align-items: baseline; }
.cal-modal-etiqueta { font-size: 0.8rem; color: #888; white-space: nowrap; }
.cal-modal-separador { border-top: 1px solid #eee; margin: 0.25rem 0; }
.cal-modal-descripcion { font-size: 0.88rem; color: #444; white-space: pre-line;
    line-height: 1.5; margin-top: 0.35rem; }
.cal-modal-badge { display: inline-block; background: #e8f0fb; color: #00549c;
    font-size: 0.75rem; font-weight: 600; border-radius: 20px;
    padding: 0.25rem 0.75rem; margin-top: 0.5rem; }

/* Modal de confirmación */
.pe-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.pe-modal {
    background: #fff;
    border-radius: 14px;
    padding: 1.5rem 1.5rem 1.25rem;
    max-width: 340px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.22);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.pe-modal-titulo {
    font-size: 1.05rem;
    font-weight: 700;
    color: #00549c;
}
.pe-modal-resumen {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 1rem;
    background: #f4f8ff;
    border-radius: 8px;
    padding: 0.65rem 0.9rem;
}
.pe-modal-diff { font-size: 0.82rem; color: #666; margin-left: 0.35rem; }
.pe-modal-botones {
    display: flex;
    gap: 0.75rem;
}
.pe-btn-cancelar {
    flex: 1;
    padding: 0.65rem;
    border: 1.5px solid #ccc;
    border-radius: 8px;
    background: #fff;
    color: #555;
    font-size: 0.95rem;
    cursor: pointer;
    font-weight: 600;
}
.pe-btn-cancelar:hover { background: #f5f5f5; }

/* ============================================================
   REGISTRO DE ACTIVIDADES
   ============================================================ */

.act-wrap {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 0 2rem;
}

.act-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem 0.6rem;
    border-bottom: 1px solid #e8eef5;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
}

.act-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
}

.act-campo {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.act-section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.act-sel-count {
    font-size: 0.78rem;
    color: #888;
}

.act-select-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.4rem;
    background: #fafbfc;
}

.act-check {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.92rem;
    color: #333;
    cursor: pointer;
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    transition: all .12s;
    user-select: none;
}
.act-check:hover { background: #f0f4fa; border-color: #a0b8d4; }
.act-check--sel  { background: #e8f0fb; border-color: #00549c; }
.act-check input[type=checkbox] { width: 18px; height: 18px; cursor: pointer; accent-color: #00549c; flex-shrink: 0; }

.act-textarea { resize: vertical; min-height: 80px; }

.act-contador {
    font-size: 0.72rem;
    color: #aaa;
    text-align: right;
}

.act-btn-guardar {
    width: 100%;
    padding: 0.9rem;
    background: #00549c;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 0.25rem;
    transition: background .15s;
}
.act-btn-guardar:hover    { background: #003f78; }
.act-btn-guardar:disabled { opacity: .55; cursor: not-allowed; }

.act-ok {
    background: #f0fff4;
    border: 1px solid #9be3b3;
    color: #166c35;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.92rem;
    font-weight: 600;
    text-align: center;
}

.act-error {
    background: #fff5f5;
    border: 1px solid #fca5a5;
    color: #9b1c1c;
    border-radius: 8px;
    padding: 0.65rem 0.9rem;
    font-size: 0.88rem;
    line-height: 1.4;
}

/* Modal confirmación actividad */
.act-modal {
    background: #fff;
    border-radius: 14px;
    padding: 1.25rem 1.25rem 1.1rem;
    max-width: 380px;
    width: 92%;
    max-height: 85dvh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0,0,0,0.22);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.act-modal-titulo {
    font-size: 1.05rem;
    font-weight: 700;
    color: #00549c;
    border-bottom: 1.5px solid #e8eef5;
    padding-bottom: 0.5rem;
}
.act-modal-resumen {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.9rem;
}
.act-modal-fila {
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
}
.act-modal-etiqueta-fila {
    font-size: 0.75rem;
    font-weight: 700;
    color: #888;
    min-width: 64px;
    flex-shrink: 0;
}
.act-modal-sep {
    border-top: 1px solid #eee;
    margin: 0.25rem 0;
}
.act-modal-seccion {
    font-size: 0.75rem;
    font-weight: 700;
    color: #555;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-top: 0.1rem;
}
.act-modal-item {
    font-size: 0.88rem;
    color: #333;
    padding-left: 0.35rem;
}
.act-modal-texto {
    font-size: 0.84rem;
    color: #444;
    white-space: pre-line;
    line-height: 1.4;
    background: #f8faff;
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    max-height: 80px;
    overflow-y: auto;
}
.act-btn-confirmar {
    flex: 1;
    padding: 0.65rem;
    background: #00549c;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
}
.act-btn-confirmar:hover    { background: #003f78; }
.act-btn-confirmar:disabled { opacity: .55; cursor: not-allowed; }
