@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* =========================================================================
   IDENTIDAD VISUAL - Cooperativa de Ahorro y Credito Manantial de Oro
   Rojo institucional como unico acento, tinta gris-azulada, fondo blanco.
   Los nombres antiguos (--oro, --tinta, --verde...) se conservan como
   ALIAS de la paleta institucional para no tocar cada pantalla.
   ========================================================================= */
:root {
    /* ---- Paleta institucional ---- */
    --red: #B91F2B;
    --red-dark: #9E1720;
    --red-darker: #7D1119;
    --red-soft: #F9EDEE;
    --red-tint: #FBF6F6;

    --ink: #20242C;
    --ink-soft: #4A5260;
    --muted: #555B66;
    --placeholder: #6B717C;
    --border-strong: #C9CDD4;
    --line: #E7E9ED;
    --soft: #F5F6F8;
    --white: #FFFFFF;
    --success: #1C7A45;
    --success-soft: rgba(28, 122, 69, 0.10);

    /* ---- Alias de nombres antiguos (todas las vistas siguen funcionando) ---- */
    --tinta: var(--ink);
    --tinta-suave: var(--ink);
    --pizarra: var(--ink-soft);
    --pizarra-claro: var(--muted);
    --lienzo: var(--soft);
    --superficie: var(--white);
    --borde: var(--line);

    --oro: var(--red);
    --oro-oscuro: var(--red-dark);
    --oro-claro: var(--red-soft);
    --oro-fondo: var(--red-soft);

    --verde: var(--success);
    --verde-fondo: var(--success-soft);
    --rojo: var(--red);
    --rojo-fondo: var(--red-soft);
    /* Sin azules decorativos: la "informacion" usa tinta neutra */
    --azul-info: var(--ink-soft);
    --azul-fondo: var(--soft);

    /* ---- Forma y profundidad ---- */
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --sombra: 0 2px 8px rgba(32, 36, 44, 0.06);
    --sombra-md: 0 8px 24px rgba(32, 36, 44, 0.08);
    --sombra-lg: 0 18px 48px rgba(32, 36, 44, 0.12);

    /* ---- Tipografia: familia unica ---- */
    --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-display: var(--font);
    --font-body: var(--font);
    --font-mono: var(--font);

    --sidebar-width: 250px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.55;
    background: var(--lienzo);
    color: var(--tinta);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--tinta);
    letter-spacing: -0.01em;
    margin: 0 0 8px;
}

a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-dark); text-decoration: underline; }

:focus-visible {
    outline: 2px solid var(--red);
    outline-offset: 2px;
}

::placeholder { color: var(--placeholder); }

/* ================= LAYOUT ================= */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    background: var(--ink);
    padding: 22px 0 20px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.sidebar__brand {
    padding: 0 22px 22px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    margin-bottom: 14px;
}
.sidebar__brand-mark {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--white);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    padding: 3px;
}
.sidebar__brand-mark span {
    font-family: var(--font-display);
    font-weight: 800;
    color: var(--red);
    font-size: 14px;
}
.sidebar__brand-text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 15px;
    color: #fff;
    line-height: 1.2;
}
.sidebar__brand-text small { display: block; color: rgba(255,255,255,0.78); font-weight: 500; font-size: 11.5px; font-family: var(--font-body); }

.sidebar__nav { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; }
.sidebar__nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: rgba(255,255,255,0.82);
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    border-left: 3px solid transparent;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}
.sidebar__nav a svg { flex-shrink: 0; opacity: 0.9; }
.sidebar__nav a:hover { background: rgba(255,255,255,0.08); color: #fff; text-decoration: none; }
.sidebar__nav a.active {
    background: rgba(185, 31, 43, 0.38);
    color: #fff;
    font-weight: 700;
    border-left-color: var(--red);
}
.sidebar__nav a:focus-visible { outline-color: #fff; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
    height: 64px;
    background: var(--superficie);
    border-bottom: 1px solid var(--borde);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 28px;
    gap: 14px;
}
.topbar__user { display: flex; align-items: center; gap: 10px; }
.topbar__avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--red-soft); color: var(--red-dark);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-weight: 700; font-size: 13px;
}
.topbar__name { font-size: 14px; font-weight: 600; color: var(--tinta); }
.topbar__logout { font-size: 13px; color: var(--pizarra); }
.topbar__logout:hover { color: var(--red); }

.content { padding: 28px 32px; max-width: 1200px; }

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}
.page-header h2 { margin-bottom: 4px; font-size: 22px; font-weight: 800; }
.page-header p { color: var(--pizarra); font-size: 14px; margin: 0; }

/* ================= CARDS ================= */
.card {
    background: var(--superficie);
    border: 1px solid var(--borde);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--sombra);
}

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 28px; }
.stat-card {
    background: var(--superficie);
    border: 1px solid var(--borde);
    border-left: 4px solid var(--acento, var(--red));
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--sombra);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.stat-card__label { font-size: 12.5px; color: var(--pizarra); margin-bottom: 6px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.stat-card__value { font-family: var(--font-display); font-variant-numeric: tabular-nums; font-size: 28px; font-weight: 800; color: var(--tinta); }
.stat-card__icon {
    width: 40px; height: 40px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: var(--acento-fondo, var(--red-soft));
    color: var(--acento, var(--red-dark));
    flex-shrink: 0;
}

/* ================= FORMS ================= */
.form-group { margin-bottom: 18px; }
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--tinta); }
label + small { display: block; margin-top: 6px; color: var(--muted); font-size: 12.5px; }

input[type="text"], input[type="email"], input[type="password"], input[type="date"],
input[type="number"], input[type="time"], input[type="datetime-local"], input[type="search"],
input[type="file"], select, textarea {
    width: 100%;
    padding: 10px 13px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: var(--font-body);
    background: var(--soft);
    color: var(--tinta);
    transition: border-color 0.15s ease, background 0.15s ease;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--red); background: var(--white); }
textarea { resize: vertical; font-family: var(--font-body); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--red); }

/* ================= BUTTONS ================= */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius);
    border: none;
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font-body);
    cursor: pointer;
    background: var(--red);
    color: #fff;
    box-shadow: 0 4px 14px rgba(185, 31, 43, 0.22);
    transition: background 0.15s ease, transform 0.1s ease;
}
.btn:hover { background: var(--red-dark); color: #fff; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-secondary { background: var(--superficie); color: var(--tinta); border: 1.5px solid var(--line); box-shadow: none; }
.btn-secondary:hover { background: var(--red-soft); color: var(--tinta); border-color: var(--border-strong); }
.btn-danger { background: var(--red-dark); }
.btn-danger:hover { background: var(--red-darker); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-link { background: none; border: none; color: var(--red); cursor: pointer; padding: 0; font-size: 13px; font-weight: 700; box-shadow: none; }
.btn-link:hover { background: none; color: var(--red-dark); text-decoration: underline; }

/* ================= BADGES ================= */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.badge-email { background: var(--soft); color: var(--ink-soft); border: 1px solid var(--line); }
.badge-whatsapp { background: var(--success-soft); color: var(--success); }
.badge-sms { background: var(--soft); color: var(--ink-soft); border: 1px solid var(--line); }
.badge-activo { background: var(--success-soft); color: var(--success); }
.badge-inactivo { background: var(--soft); color: var(--ink-soft); }
.badge-alerta { background: var(--red-soft); color: var(--red-dark); }
.badge-outline { background: transparent; border: 1.5px solid var(--line); color: var(--ink-soft); }

/* ================= TABLE ================= */
.table-wrap { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radius); overflow-x: auto; box-shadow: var(--sombra); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--borde); font-size: 14px; }
th { color: #fff; font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; background: var(--red-dark); border-bottom: none; }
tbody tr:last-child td { border-bottom: none; }
.table-wrap tbody tr:nth-child(even) { background: var(--red-tint); }
.table-wrap tbody tr:hover { background: var(--red-soft); }
.table-wrap td:first-child { color: var(--red); font-weight: 700; }
.table-wrap td:first-child a { color: inherit; }

/* ================= ALERTS ================= */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; border-left: 3px solid transparent; }
.alert-error { background: var(--red-soft); color: var(--red-dark); border-left-color: var(--red); }
.alert-success { background: var(--success-soft); color: var(--success); border-left-color: var(--success); }

/* ================= EMPTY STATE ================= */
.empty-state {
    text-align: center;
    padding: 56px 24px;
    color: var(--pizarra);
}
.empty-state svg { color: var(--border-strong); margin-bottom: 14px; }
.empty-state h3 { color: var(--tinta); margin-bottom: 6px; }
.empty-state p { font-size: 14px; margin: 0 0 18px; }

/* ================= TEMPLATE CARDS ================= */
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.template-card {
    background: var(--superficie);
    border: 1px solid var(--borde);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--sombra);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.template-card:hover { box-shadow: var(--sombra-md); transform: translateY(-2px); }
.template-card__preview {
    height: 120px;
    background: linear-gradient(135deg, var(--soft), var(--red-soft));
    display: flex; align-items: center; justify-content: center;
    color: var(--red);
    border-bottom: 1px solid var(--borde);
}
.template-card__body { padding: 16px; }
.template-card__title { font-family: var(--font-display); font-weight: 700; font-size: 15px; margin-bottom: 8px; color: var(--tinta); }
.template-card__meta { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.template-card__footer { display: flex; justify-content: space-between; align-items: center; padding-top: 12px; border-top: 1px solid var(--borde); font-size: 12.5px; color: var(--muted); }
.template-card__actions { display: flex; gap: 12px; }

/* ================= FILTER PILLS ================= */
.pill-group { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.pill {
    padding: 7px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    border: 1.5px solid var(--borde);
    background: var(--superficie);
    color: var(--pizarra);
}
.pill.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.pill:hover { text-decoration: none; border-color: var(--red); color: var(--red-dark); }
.pill.active:hover { color: #fff; }

/* ================= LOGIN ================= */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--red-dark), var(--red-darker));
    position: relative;
    padding: 24px;
}
.login-box {
    background: var(--superficie);
    border-radius: var(--radius-xl);
    padding: 44px 40px 36px;
    width: 100%;
    max-width: 410px;
    box-shadow: var(--sombra-lg);
    position: relative;
}
.login-seal {
    width: 68px; height: 68px;
    margin: 0 auto 20px;
    border-radius: 50%;
    border: 2px solid var(--red);
    display: flex; align-items: center; justify-content: center;
    position: relative;
    overflow: hidden;
}
.login-seal::before {
    content: '';
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    border: 1px dashed var(--border-strong);
    pointer-events: none;
}
.login-seal span { font-family: var(--font-display); font-weight: 800; color: var(--red); font-size: 21px; }
.login-box h1 { font-size: 20px; font-weight: 800; text-align: center; margin: 0 0 4px; }
.login-box .login-sub { text-align: center; color: var(--pizarra); font-size: 13px; margin-bottom: 28px; }

/* ================= RECLAMOS E INCIDENTES ================= */
/* Semaforo de plazos: solo con la paleta institucional (rojo = atencion, verde = estado correcto) */
.sem {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px; border-radius: 999px;
    font-size: 12px; font-weight: 700; white-space: nowrap;
}
.sem::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.sem-en_plazo { background: var(--success-soft); color: var(--success); }
.sem-por_vencer { background: var(--red-soft); color: var(--red-dark); box-shadow: inset 0 0 0 1.5px var(--red); }
.sem-vencido { background: var(--red); color: #fff; }
.sem-pausado, .sem-sin_plazo { background: var(--soft); color: var(--ink-soft); box-shadow: inset 0 0 0 1px var(--line); }
.sem-cumplido { background: var(--success); color: #fff; }
.sem-incumplido { background: var(--red-dark); color: #fff; }

/* Prioridad: nivel 1 (mas urgente) a 4 */
.prio-1 { background: var(--red-darker); color: #fff; }
.prio-2 { background: var(--red-soft); color: var(--red-dark); box-shadow: inset 0 0 0 1px var(--red); }
.prio-3 { background: var(--soft); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.prio-4 { background: transparent; color: var(--ink-soft); box-shadow: inset 0 0 0 1px var(--border-strong); }

/* Barra de avance del plazo */
.sla-bar { height: 8px; background: var(--soft); border-radius: 999px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.sla-bar__fill { height: 100%; border-radius: 999px; background: var(--success); }
.sla-bar__fill.sem-por_vencer { background: var(--red); }
.sla-bar__fill.sem-vencido, .sla-bar__fill.sem-incumplido { background: var(--red-dark); }
.sla-bar__fill.sem-pausado, .sla-bar__fill.sem-sin_plazo { background: var(--border-strong); }

.reclamo-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
@media (max-width: 960px) { .reclamo-grid { grid-template-columns: 1fr; } }

.datos-caso { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px 20px; font-size: 14px; }
.datos-caso span { display: block; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 2px; }

.linea-tiempo { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); }
.linea-tiempo li { position: relative; padding: 0 0 16px 14px; font-size: 14px; }
.linea-tiempo li::before { content: ''; position: absolute; left: -25px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); box-shadow: 0 0 0 3px var(--white); }
.linea-tiempo li.publico::before { background: var(--red); }
.linea-tiempo__cab { display: flex; gap: 8px 12px; align-items: center; flex-wrap: wrap; margin-bottom: 3px; }

/* ================= UTILITIES ================= */
.text-muted { color: var(--pizarra); }
.text-sm { font-size: 13px; }
.mt-0 { margin-top: 0; }

/* ================= ENCUESTAS Y CODIGOS QR (panel del personal) ================= */
.panel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 20px; margin-bottom: 20px; }
.panel-titulo { font-size: 16px; font-weight: 800; margin: 0 0 8px; }
.panel-subtitulo { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin: 18px 0 6px; }
.kpi-sub { font-size: 12.5px; font-weight: 500; color: var(--muted); display: inline-block; }
.stat-card__value .kpi-sub { font-size: 14px; }

/* Niveles de resultado: verde = excelente, gris = aceptable, rojo = a mejorar (paleta institucional) */
.nivel-excelente { background: var(--success-soft); color: var(--success); }
.nivel-bien { background: var(--soft); color: var(--ink-soft); }
.nivel-mejorar { background: var(--red-soft); color: var(--red-dark); }
.nivel-sin_datos { background: transparent; color: var(--muted); }
.nivel-borde-excelente { --acento: var(--success); --acento-fondo: var(--success-soft); }
.nivel-borde-bien { --acento: var(--ink-soft); --acento-fondo: var(--soft); }
.nivel-borde-mejorar { --acento: var(--red); --acento-fondo: var(--red-soft); }
.nivel-borde-sin_datos { --acento: var(--border-strong); --acento-fondo: var(--soft); }
.nivel-fondo-excelente { background: var(--success); }
.nivel-fondo-bien { background: #8E95A1; }
.nivel-fondo-mejorar { background: var(--red); }
.nivel-fondo-sin_datos { background: var(--border-strong); }

/* Barras horizontales (promedio por pregunta) */
.barra-h { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) 44px; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.barra-h:last-of-type { border-bottom: none; }
.barra-h__texto { font-size: 13.5px; line-height: 1.3; }
.barra-h__pista { position: relative; height: 12px; background: var(--soft); border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); overflow: visible; }
.barra-h__relleno { height: 100%; border-radius: 999px; min-width: 2px; }
.barra-h__marca { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); opacity: 0.35; }
.barra-h__valor { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
@media (max-width: 560px) { .barra-h { grid-template-columns: 1fr 44px; } .barra-h__pista { grid-column: 1 / 2; } }
.datos-resumen { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13.5px; }
.datos-resumen span { display: block; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 2px; }

/* NPS: barra apilada */
.nps-apilada { display: flex; height: 34px; border-radius: 10px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); margin: 6px 0 10px; }
.nps-apilada__tramo { display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 13px; min-width: 2px; }
.nps-det { background: var(--red); }
.nps-pas { background: var(--border-strong); color: var(--ink); }
.nps-pro { background: var(--success); }
.nps-leyenda { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12.5px; color: var(--ink-soft); }
.nps-leyenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* Graficos SVG (GraficoSvg) */
.gf { width: 100%; height: auto; display: block; }
.gf-grid { stroke: var(--line); stroke-width: 1; }
.gf-eje { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.gf-valor { fill: var(--ink-soft); font-size: 11px; font-weight: 700; font-family: var(--font); }
.gf-col { fill: var(--red); }
.gf-col--bueno { fill: var(--success); }
.gf-col--medio { fill: var(--border-strong); }
.gf-col--malo { fill: var(--red); }
.gf-linea { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.gf-linea--a { stroke: var(--red); }
.gf-linea--b { stroke: var(--ink-soft); }
.gf-punto { stroke: #fff; stroke-width: 2; }
.gf-punto.gf-linea--a { fill: var(--red); }
.gf-punto.gf-linea--b { fill: var(--ink-soft); }
.gf-guia { stroke: var(--success); stroke-width: 1.5; stroke-dasharray: 5 4; }
.gf-guia-txt { fill: var(--success); font-size: 10.5px; font-weight: 700; font-family: var(--font); }

/* Tabla comparativa con celdas de color */
.tabla-comparativa th { text-align: center; }
.tabla-comparativa th:first-child { text-align: left; }
.tabla-comparativa td { text-align: center; font-variant-numeric: tabular-nums; }
.tabla-comparativa td:first-child { text-align: left; }
.celda-nivel { font-weight: 700; }
.tabla-comparativa .fila-total td { border-top: 2px solid var(--border-strong); font-weight: 800; background: var(--soft); }
.table-wrap tbody tr.fila-total:hover { background: var(--soft); }
.leyenda-preguntas { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 12px 0 0; }

.comentario-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.comentario-item:last-child { border-bottom: none; }
.comentario-item__cab { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 12.5px; margin-bottom: 4px; }
.comentario-item p { margin: 0; font-size: 14.5px; }

.tabla-editable input[type="text"], .tabla-editable input[type="number"] { padding: 7px 10px; }
.tabla-editable th, .tabla-editable td { padding: 8px 10px; }
.tabla-editable td:first-child input { min-width: 170px; }
.panel-grid--params { grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); }
@media (max-width: 1000px) { .panel-grid--params { grid-template-columns: 1fr; } }
.tabla-papel td { padding: 9px 12px; }

/* Codigos QR */
.qr-rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 16px; }
.qr-tarjeta { display: flex; gap: 14px; align-items: center; background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radius); padding: 14px; box-shadow: var(--sombra); }
.qr-tarjeta--principal { grid-column: 1 / -1; border-left: 4px solid var(--red); padding: 18px; }
.qr-tarjeta__codigo { flex-shrink: 0; line-height: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.qr-tarjeta__codigo svg { width: 124px; height: 124px; }
.qr-tarjeta--principal .qr-tarjeta__codigo svg { width: 190px; height: 190px; }
.qr-tarjeta__cuerpo { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.qr-tarjeta__url { font-size: 12px; word-break: break-all; color: var(--ink-soft); background: var(--soft); border-radius: 8px; padding: 6px 8px; }
.qr-tarjeta__acciones { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 520px) { .qr-tarjeta { flex-direction: column; align-items: flex-start; } }

/* ================= EVENTOS: consulta de productos y asistencia ================= */
.evt-eventos { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.evt-evento { display: flex; flex-direction: column; gap: 4px; padding: 18px; background: var(--superficie); border: 1.5px solid var(--borde); border-radius: var(--radius); box-shadow: var(--sombra); color: var(--ink); text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .1s; }
.evt-evento:hover { border-color: var(--red); box-shadow: var(--sombra-md); transform: translateY(-2px); text-decoration: none; color: var(--ink); }
.evt-evento strong { font-size: 16px; }
.evt-evento span { color: var(--ink-soft); font-size: 13.5px; }
.evt-evento small { color: var(--muted); }

.evt-banner { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 18px; margin-bottom: 18px; background: var(--ink); color: #fff; border-radius: var(--radius); }
.evt-banner > div:first-child { flex: 1; min-width: 200px; display: flex; flex-direction: column; }
.evt-banner__rotulo { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; opacity: .7; }
.evt-banner strong { font-size: 17px; }
.evt-banner small { opacity: .8; }
.evt-banner__total { font-size: 14px; } .evt-banner__total b { font-size: 26px; font-weight: 800; margin-right: 4px; }
.evt-banner .btn-secondary { background: transparent; color: #fff; border-color: rgba(255,255,255,.45); }
.evt-banner .btn-secondary:hover { background: rgba(255,255,255,.12); color: #fff; }

.evt-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 20px; align-items: start; }
@media (max-width: 960px) { .evt-grid { grid-template-columns: 1fr; } }
.evt-consulta label { font-size: 14px; }
.evt-consulta__fila { display: flex; gap: 10px; }
.evt-consulta__fila input { font-size: 22px; font-weight: 700; letter-spacing: .08em; padding: 14px 16px; flex: 1; min-width: 0; }
.evt-consulta__fila .btn { padding: 0 26px; font-size: 16px; }

.evt-resultado { margin-top: 18px; border-top: 5px solid var(--border-strong); }
.evt-resultado--con_cuentas { border-top-color: var(--success); }
.evt-resultado--no_cliente { border-top-color: var(--red); }
.evt-resultado__cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.evt-resultado__cab h3 { font-size: 20px; margin: 0 0 2px; }
.evt-resumen { font-size: 15px; margin: 14px 0 8px; }
.evt-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.evt-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; background: var(--success-soft); color: var(--success); font-weight: 700; font-size: 13.5px; }
.evt-tabla code { font-size: 14px; letter-spacing: .06em; color: var(--ink-soft); }
.evt-registrar { font-size: 17px; padding: 14px 30px; }
.evt-cat--con_cuentas { background: var(--success-soft); color: var(--success); }
.evt-cat--sin_cuentas { background: var(--soft); color: var(--ink-soft); box-shadow: inset 0 0 0 1px var(--line); }
.evt-cat--no_cliente { background: var(--red-soft); color: var(--red-dark); }
.evt-recientes { list-style: none; margin: 0; padding: 0; }
.evt-recientes li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.evt-recientes li:last-child { border-bottom: none; }
.evt-recientes small { display: block; color: var(--muted); font-size: 12.5px; }
.evt-punto { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; background: var(--border-strong); }
.evt-punto--con_cuentas { background: var(--success); } .evt-punto--no_cliente { background: var(--red); }
.evt-prod { font-size: 12.5px; color: var(--ink-soft); margin-top: 3px; } .evt-prod code { letter-spacing: .05em; }
.evt-seguimiento { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.evt-seguimiento select { width: auto; padding: 6px 8px; font-size: 13px; }
.evt-seguimiento input[type="text"] { flex: 1; min-width: 130px; padding: 6px 10px; font-size: 13px; }
.evt-recientes strong { word-break: break-word; overflow-wrap: anywhere; }

/* ================= EVENTOS: presentacion compacta y busqueda por nombre ================= */
.evt-compacto { font-size: 13.5px; }
.evt-compacto .page-header { margin-bottom: 14px; }
.evt-compacto .page-header h2 { font-size: 18px; margin-bottom: 2px; }
.evt-compacto .page-header p { font-size: 12.5px; }
.evt-compacto .btn { padding: 7px 14px; font-size: 13px; border-radius: 10px; box-shadow: none; gap: 6px; }
.evt-compacto .btn-sm { padding: 4px 10px; font-size: 12px; }
.evt-compacto .pill-group { margin-bottom: 12px; gap: 6px; }
.evt-compacto .pill { padding: 4px 12px; font-size: 12px; }
.evt-compacto .card { padding: 14px 16px; border-radius: 12px; }
.evt-compacto .panel-titulo { font-size: 14px; margin-bottom: 6px; }
.evt-compacto .panel-grid { gap: 14px; margin-bottom: 14px; }
.evt-compacto label { font-size: 12px; margin-bottom: 4px; }
.evt-compacto input[type="text"], .evt-compacto input[type="search"], .evt-compacto input[type="date"], .evt-compacto input[type="number"], .evt-compacto select, .evt-compacto textarea { padding: 7px 10px; font-size: 13px; border-radius: 8px; }
.evt-compacto .form-group { margin-bottom: 12px; }
.evt-compacto th, .evt-compacto td { padding: 8px 12px; font-size: 12.5px; }
.evt-compacto th { font-size: 10.5px; }
.evt-compacto .stat-grid { gap: 10px; margin-bottom: 16px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.evt-compacto .stat-card { padding: 10px 14px; border-radius: 12px; }
.evt-compacto .stat-card__label { font-size: 10.5px; margin-bottom: 2px; }
.evt-compacto .stat-card__value { font-size: 21px; }
.evt-compacto .kpi-sub { font-size: 11.5px; }
.evt-compacto .barra-h { padding: 5px 0; }
.evt-compacto .barra-h__texto { font-size: 12.5px; }
.evt-compacto .alert { padding: 8px 12px; font-size: 12.5px; margin-bottom: 12px; }
.evt-compacto .badge { font-size: 11px; padding: 2px 8px; }
.evt-compacto .gf-eje, .evt-compacto .gf-valor { font-size: 10px; }

.evt-subtitulo { font-size: 14px; margin: 0 0 10px; }
.evt-compacto .evt-eventos { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.evt-compacto .evt-evento { padding: 12px 14px; }
.evt-compacto .evt-evento strong { font-size: 14px; }
.evt-compacto .evt-evento span { font-size: 12px; }
.evt-compacto .evt-banner { padding: 8px 14px; margin-bottom: 12px; gap: 12px; border-radius: 10px; }
.evt-compacto .evt-banner strong { font-size: 14.5px; }
.evt-compacto .evt-banner small { font-size: 11.5px; }
.evt-compacto .evt-banner__total { font-size: 12.5px; }
.evt-compacto .evt-banner__total b { font-size: 19px; }
.evt-compacto .evt-banner__total small { display: inline; opacity: .8; }
.evt-compacto .evt-grid { gap: 14px; grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr); }
@media (max-width: 860px) { .evt-compacto .evt-grid { grid-template-columns: 1fr; } }
.evt-compacto .evt-consulta__fila input { font-size: 14px; font-weight: 600; letter-spacing: .03em; padding: 7px 10px; }
.evt-compacto .evt-consulta__fila .btn { padding: 0 16px; font-size: 13px; }
.evt-compacto .evt-resultado { margin-top: 12px; border-top-width: 4px; }
.evt-compacto .evt-resultado__cab h3 { font-size: 16px; }
.evt-compacto .evt-resumen { font-size: 13px; margin: 10px 0 6px; }
.evt-compacto .evt-chip { padding: 3px 10px; font-size: 12px; }
.evt-compacto .evt-tabla code { font-size: 12.5px; }
.evt-compacto .evt-registrar { font-size: 14px; padding: 9px 22px; box-shadow: 0 4px 12px rgba(185, 31, 43, .22); }
.evt-compacto .evt-recientes li { padding: 6px 0; }
.evt-compacto .evt-recientes strong { font-size: 12.5px; }
.evt-compacto .evt-recientes small { font-size: 11.5px; }

/* Buscador por nombre */
.evt-consulta > label { font-size: 12.5px; }
#evt-buscar { width: 100%; font-size: 15px; padding: 9px 12px; border: 1.5px solid var(--border-strong); border-radius: 10px; background: #fff; }
#evt-buscar:focus { border-color: var(--red); outline: none; box-shadow: 0 0 0 3px rgba(185, 31, 43, .12); }
.evt-estado { font-size: 12px; color: var(--muted); margin: 6px 0 4px; min-height: 16px; }
.evt-resultados { list-style: none; margin: 0 0 8px; padding: 0; max-height: 340px; overflow-y: auto; border-radius: 10px; }
.evt-resultados:empty { display: none; }
.evt-res { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-bottom: none; background: #fff; cursor: pointer; }
.evt-res:first-child { border-radius: 10px 10px 0 0; }
.evt-res:last-child { border-bottom: 1px solid var(--line); border-radius: 0 0 10px 10px; }
.evt-res:only-child { border-radius: 10px; }
.evt-res:hover, .evt-res--activo { background: var(--red-tint); border-color: var(--red-soft); }
.evt-res__nombre { font-weight: 700; font-size: 13.5px; color: var(--ink); }
.evt-res__nombre mark { background: #FBE3E5; color: var(--red-darker); border-radius: 3px; padding: 0 1px; }
.evt-res small { display: block; color: var(--muted); font-size: 11.5px; }
.evt-res--hecho { background: var(--soft); }
.evt-res__marca { font-size: 11px; font-weight: 700; color: var(--success); background: var(--success-soft); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.evt-manual { margin-top: 8px; font-size: 12.5px; }
.evt-manual summary { cursor: pointer; color: var(--red); font-weight: 600; padding: 4px 0; }
.evt-manual form { margin-top: 6px; }
.evt-nota { display: block; margin-top: 8px; color: var(--muted); font-size: 11.5px; }
.evt-resumen-carga { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 6px 0; }
.evt-resumen-carga div { display: flex; flex-direction: column; }
.evt-resumen-carga b { font-size: 19px; font-weight: 800; line-height: 1.1; }
.evt-resumen-carga span { font-size: 11.5px; color: var(--muted); }

/* Pantalla solo-registro (celular / app) */
.reg-body { margin: 0; background: var(--soft); font-family: var(--font); color: var(--ink); }
.reg-top { display: flex; align-items: center; gap: 10px; background: var(--ink); color: #fff; padding: 8px 14px; position: sticky; top: 0; z-index: 5; }
.reg-top__logo { width: 32px; height: 32px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 3px; flex-shrink: 0; }
.reg-top__logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.reg-top__logo span { font-weight: 800; color: var(--red); font-size: 12px; }
.reg-top__texto { flex: 1; display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.reg-top__texto strong { font-size: 13.5px; }
.reg-top__texto small { font-size: 11px; opacity: .75; }
.reg-top__usuario { font-size: 12px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 30%; }
.reg-top__salir { color: #fff; font-size: 12px; border: 1px solid rgba(255,255,255,.45); padding: 3px 10px; border-radius: 8px; }
.reg-top__salir:hover { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.reg-main { max-width: 760px; margin: 0 auto; padding: 12px 12px 30px; }

/* ================= Personal de atencion (encuesta): circulo con foto o iniciales ================= */
.pub-avatar { width: 76px; height: 76px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 800; overflow: hidden; flex-shrink: 0; box-shadow: 0 4px 12px rgba(32, 36, 44, 0.12); }
.pub-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pub-avatar--c0 { background: #F9EDEE; color: #B91F2B; }
.pub-avatar--c1 { background: #E7E9ED; color: #4A5260; }
.pub-avatar--c2 { background: #E3F1E8; color: #1C7A45; }
.pub-avatar--c3 { background: #FBE9E2; color: #B4532F; }
.pub-avatar--c4 { background: #E9ECF5; color: #3B4A8A; }
.pub-avatar--c5 { background: #F3EEDD; color: #7A6420; }
.pub-avatar--chico { width: 48px; height: 48px; font-size: 17px; box-shadow: none; }

.personal-agencias { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.personal-area { margin-bottom: 22px; }
.personal-area__titulo { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 0 0 10px; }
.personal-area__titulo h3 { margin: 0; font-size: 15px; }
.personal-rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.personal-tarjeta { display: flex; align-items: center; gap: 12px; padding: 12px; background: #fff; border: 1.5px solid var(--line); border-radius: 14px; }
.personal-tarjeta--inactiva { opacity: 0.55; background: var(--soft); }
.personal-tarjeta__datos { min-width: 0; flex: 1; }
.personal-tarjeta__datos strong { display: block; font-size: 14px; line-height: 1.2; overflow-wrap: anywhere; }
.personal-tarjeta__datos span { display: block; font-size: 12.5px; color: var(--muted); }
.personal-tarjeta__acciones { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.personal-agregar { margin-top: 12px; padding: 12px; background: var(--soft); border-radius: 12px; }
.personal-agregar textarea { min-height: 44px; }
.pub-avatar--figura svg { display: block; width: 100%; height: 100%; }