/* ═══════════════════════════════════════════════════════════════
   SanGa · Sistema Municipal · Diseño Premium
   GAD Municipal de Montúfar · 2026
   ─────────────────────────────────────────────────────────────── */

/* ── Tokens de Diseño ── */
:root {
    --primary:        #0f172a;
    --primary-mid:    #1e293b;
    --primary-light:  #334155;
    --primary-ultra:  #f1f5f9;
    --accent:         #0f9870;
    --accent-light:   #17c48e;
    --accent-ultra:   #e6f9f3;
    --danger:         #dc2626;
    --danger-light:   #fee2e2;
    --warning:        #d97706;
    --warning-light:  #fef3c7;
    --purple:         #7c3aed;
    --purple-light:   #ede9fe;
    --teal:           #0891b2;
    --teal-light:     #e0f2fe;
    --orange:         #ea580c;
    --orange-light:   #fff7ed;
    --navy:           #1e3a5f;
    --navy-light:     #dbeafe;

    --bg:          #f0f3f9;
    --surface:     #ffffff;
    --surface-2:   #f8faff;
    --surface-3:   #eef1f8;
    --border:      #e2e8f4;
    --border-soft: #edf1f9;

    --text-h:    #0a1628;
    --text-body: #354766;
    --text-sub:  #64748b;
    --text-dis:  #94a3b8;

    --r-xs: 4px;
    --r-sm: 8px;
    --r:    12px;
    --r-lg: 18px;
    --r-xl: 24px;

    --sh-xs: 0 1px 2px rgba(10,22,66,0.06);
    --sh-sm: 0 2px 8px rgba(10,22,66,0.08);
    --sh:    0 4px 16px rgba(10,22,66,0.10);
    --sh-lg: 0 8px 32px rgba(10,22,66,0.14);
    --sh-xl: 0 16px 56px rgba(10,22,66,0.18);

    --sidebar-w: 252px;
    --topbar-h:  62px;
    --bottom-h:  70px;
}

[data-theme="dark"] {
    --primary:       #334155;
    --primary-mid:   #475569;
    --primary-light: #94a3b8;
    --primary-ultra: #020617;
    --accent:        #22d4a0;
    --accent-light:  #40e8b8;
    --accent-ultra:  #0d2820;

    --bg:          #080d1a;
    --surface:     #0f1629;
    --surface-2:   #131f38;
    --surface-3:   #182340;
    --border:      #1e2d4d;
    --border-soft: #162035;

    --text-h:    #e8effe;
    --text-body: #8fa8cc;
    --text-sub:  #546882;
    --text-dis:  #344560;

    --sh-xs: 0 1px 2px rgba(0,0,0,0.3);
    --sh-sm: 0 2px 8px rgba(0,0,0,0.4);
    --sh:    0 4px 16px rgba(0,0,0,0.5);
    --sh-lg: 0 8px 32px rgba(0,0,0,0.6);
}

/* ── Reset base ── */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior:smooth; }
body {
    font-family:'Inter', system-ui, sans-serif;
    background:var(--bg); color:var(--text-body);
    font-size:14px; line-height:1.5;
    -webkit-tap-highlight-color:transparent;
    min-height:100vh;
}
input, select, textarea, button { font-family:inherit; }
a { color:var(--primary); text-decoration:none; }

/* ── Utilidades ── */
.d-none  { display:none !important; }
.w-100   { width:100%; }
.ml-auto { margin-left:auto; }
.text-muted   { color:var(--text-sub); }
.text-danger  { color:var(--danger); }
.text-success { color:var(--accent); }
.text-center  { text-align:center; }
.fw-700 { font-weight:700; }
.mt-2 { margin-top:8px; }
.mt-3 { margin-top:16px; }
.mt-4 { margin-top:28px; }
.mb-1 { margin-bottom:4px; }
.mb-2 { margin-bottom:10px; }
.mb-3 { margin-bottom:18px; }

/* ── Botones ── */
.btn {
    display:inline-flex; align-items:center; justify-content:center; gap:8px;
    padding:11px 20px; border-radius:var(--r-sm); font-weight:600;
    font-size:0.88rem; cursor:pointer; border:none; outline:none;
    transition:all 0.18s cubic-bezier(.4,0,.2,1); white-space:nowrap; letter-spacing:0.01em;
}
.btn-primary { background:var(--primary); color:#fff; box-shadow:0 2px 8px rgba(26,58,143,0.35); }
.btn-primary:hover { background:var(--primary-mid); box-shadow:0 4px 16px rgba(26,58,143,0.45); transform:translateY(-1px); }
.btn-outline { background:transparent; color:var(--primary); border:1.5px solid var(--primary); }
.btn-outline:hover { background:var(--primary); color:#fff; }
.btn-outline-white { background:rgba(255,255,255,0.12); color:#fff; border:1.5px solid rgba(255,255,255,0.4); backdrop-filter:blur(4px); }
.btn-outline-white:hover { background:rgba(255,255,255,0.22); }
.btn-white { background:#fff; color:var(--primary); font-weight:700; box-shadow:var(--sh-sm); }
.btn-white:hover { box-shadow:var(--sh); transform:translateY(-1px); }
.btn-ghost { background:transparent; color:var(--text-sub); }
.btn-ghost:hover { background:var(--surface-3); color:var(--text-body); }
.btn-large { padding:14px 24px; font-size:1rem; border-radius:var(--r); }

/* ── Formularios ── */
.form-group { margin-bottom:15px; }
.form-group label {
    display:block; margin-bottom:7px; font-weight:500;
    color:var(--text-h); font-size:0.85rem; letter-spacing:0.01em;
}
.form-group input, .form-group select, .form-group textarea {
    width:100%; padding:11px 14px; border:1.5px solid var(--border);
    border-radius:var(--r-sm); background:var(--surface); color:var(--text-body);
    font-size:0.93rem; outline:none; transition:border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color:var(--primary); box-shadow:0 0 0 3px rgba(26,58,143,0.12);
}

/* ── Chips / Badges ── */
.chip { display:inline-flex; align-items:center; gap:5px; padding:3px 10px; border-radius:20px; font-size:0.74rem; font-weight:600; }
.chip-blue   { background:var(--primary-ultra); color:var(--primary); }
.chip-green  { background:var(--accent-ultra); color:var(--accent); }
.chip-orange { background:var(--orange-light); color:var(--orange); }
.chip-red    { background:var(--danger-light); color:var(--danger); }
.chip-outline { background:transparent; border:1.5px solid var(--border); color:var(--text-body); cursor:pointer; transition:all 0.15s; }
.chip-outline:hover { background:var(--primary); color:#fff; border-color:var(--primary); }

.badge { display:inline-flex; align-items:center; padding:2px 8px; border-radius:4px; font-size:0.72rem; font-weight:700; }
.badge-success { background:var(--accent-ultra); color:var(--accent); }
.badge-warning { background:var(--warning-light); color:var(--warning); }
.badge-blue    { background:var(--primary-ultra); color:var(--primary); }
.badge-red     { background:var(--danger-light); color:var(--danger); }

/* ══════════════════════════════════════════════════
   VISTAS Y LAYOUT
══════════════════════════════════════════════════ */
.app-view { display:none; width:100vw; height:100vh; overflow:hidden; }
.app-view.active { display:flex; }

/* ── LOGIN ── */
#view-login { align-items:center; justify-content:center; padding:20px; overflow-y:auto;
    background: linear-gradient(160deg, #040c22 0%, #0a1e5e 45%, #0a3d2e 100%);
}
.login-bg { width:100%; display:flex; justify-content:center; align-items:center; min-height:100%; }
.login-card {
    background:var(--surface); padding:44px 38px;
    border-radius:var(--r-xl); box-shadow:var(--sh-xl);
    width:100%; max-width:430px; text-align:center;
    border:1px solid rgba(255,255,255,0.08);
    position:relative; overflow:hidden;
}
.login-card::before {
    content:''; position:absolute; top:-60px; right:-60px;
    width:180px; height:180px; border-radius:50%;
    background:radial-gradient(circle, rgba(26,58,143,0.06), transparent 70%);
    pointer-events:none;
}
.login-logo { width:78px; margin-bottom:16px; border-radius:var(--r); box-shadow:var(--sh); }
.login-brand {
    font-size:2.4rem; font-weight:800; letter-spacing:-1.5px;
    background:linear-gradient(135deg, var(--primary) 0%, var(--teal) 100%);
    -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text;
    margin-bottom:4px;
}
.login-subtitle { color:var(--text-sub); font-size:0.9rem; margin-bottom:30px; }
.login-form { text-align:left; }
.btn-register {
    display:flex; align-items:center; justify-content:center; gap:8px;
    width:100%; margin-top:16px; padding:13px;
    background:linear-gradient(135deg, var(--accent) 0%, #0a6e4f 100%);
    color:#fff; border:none; border-radius:var(--r); font-weight:600;
    font-size:0.9rem; cursor:pointer; transition:all 0.2s;
    box-shadow:0 2px 10px rgba(15,152,112,0.3);
}
.btn-register:hover { transform:translateY(-1px); box-shadow:0 4px 16px rgba(15,152,112,0.4); }
.login-divider {
    display:flex; align-items:center; gap:12px;
    color:var(--text-dis); font-size:0.78rem; margin:20px 0;
}
.login-divider::before,.login-divider::after { content:''; flex:1; height:1px; background:var(--border); }
.login-options { display:flex; flex-direction:column; gap:8px; }
.login-footer { margin-top:22px; font-size:0.76rem; color:var(--text-dis); }
.login-footer a { color:var(--primary-light); }

/* ── SHELL LAYOUT ── */
.layout-shell { flex-direction:column; }

/* ══════════════════════════════════════
   HEADER (TOP NAV) · DISEÑO INSTITUCIONAL
══════════════════════════════════════ */
.shell-header {
    display:flex; flex-direction:column; width:100%; flex-shrink:0;
    z-index:100;
}

/* ── Tier 1: Brand & User ── */
.sh-top-tier {
    height:var(--topbar-h); padding:0 24px;
    display:flex; align-items:center; justify-content:space-between;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-mid) 100%);
    color: #fff;
    box-shadow:0 2px 10px rgba(0,0,0,0.15);
}
.sh-brand { display:flex; align-items:center; gap:14px; }
.sb-logo-wrap { position:relative; flex-shrink:0; }
.sb-logo-wrap img { 
    width:42px; height:42px; border-radius:10px; 
    box-shadow:0 4px 12px rgba(0,0,0,0.25); background:#fff; 
    padding:2px; object-fit:contain; border:1px solid rgba(255,255,255,0.2);
}
.sb-online-dot {
    position:absolute; bottom:-2px; right:-2px;
    width:12px; height:12px; border-radius:50%;
    background:#22d4a0; border:2px solid var(--primary);
    animation:pulse-dot 2s infinite;
}
@keyframes pulse-dot {
    0%,100% { box-shadow:0 0 0 0 rgba(34,212,160,0.6); }
    50%      { box-shadow:0 0 0 6px rgba(34,212,160,0); }
}
.sb-brand-text { display:flex; flex-direction:column; justify-content:center; }
.brand-name { display:block; font-size:1.15rem; font-weight:800; color:#fff; letter-spacing:-0.2px; line-height:1.1; }
.brand-sub  { display:block; font-size:0.65rem; color:rgba(255,255,255,0.75); letter-spacing:1.5px; text-transform:uppercase; margin-top:2px; }

.sh-actions { display:flex; align-items:center; gap:12px; }
.sh-user-card {
    display:flex; align-items:center; gap:10px;
    padding:6px 12px; border-radius:20px;
    background:rgba(0,0,0,0.15); border:1px solid rgba(255,255,255,0.15);
    cursor:pointer; transition:all 0.18s; margin:0 6px;
}
.sh-user-card:hover { background:rgba(0,0,0,0.25); }
.sb-user-info { display:flex; flex-direction:column; align-items:flex-end; }
.sb-user-info strong { color:#fff; font-size:0.85rem; font-weight:600; line-height:1.2; }
.sb-user-info span   { font-size:0.65rem; color:rgba(255,255,255,0.7); }
.sb-user-avatar {
    width:34px; height:34px; border-radius:50%; flex-shrink:0;
    background:linear-gradient(135deg, #ffffff 0%, #e0e5ff 100%);
    color:var(--primary); font-size:0.9rem; font-weight:800;
    display:flex; align-items:center; justify-content:center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* ── Topbar Buttons ── */
.topbar-btn {
    display:flex; align-items:center; gap:6px;
    padding:8px 14px; border-radius:20px; border:none;
    font-size:0.85rem; font-weight:700; cursor:pointer;
    transition:all 0.2s cubic-bezier(.4,0,.2,1);
    background:rgba(255,255,255,0.1); color:#fff;
    border:1px solid rgba(255,255,255,0.15);
    backdrop-filter:blur(4px);
}
.topbar-btn:hover { background:rgba(255,255,255,0.2); transform:translateY(-1px); box-shadow:0 4px 12px rgba(0,0,0,0.15); }
.topbar-btn.danger { background:rgba(220,38,38,0.15); color:#ffd2d2; border-color:rgba(220,38,38,0.3); }
.topbar-btn.danger:hover { background:var(--danger); color:#fff; box-shadow:0 4px 12px rgba(220,38,38,0.4); border-color:var(--danger); }

.topbar-icon {
    width:36px; height:36px; border-radius:50%; border:none;
    background:rgba(255,255,255,0.1); color:#fff;
    cursor:pointer; display:flex; align-items:center; justify-content:center;
    font-size:1rem; transition:all 0.15s;
    border:1px solid rgba(255,255,255,0.1);
}
.topbar-icon:hover { background:rgba(255,255,255,0.25); transform:translateY(-1px); }

.sb-logout-btn {
    width:36px; height:36px; border-radius:50%; border:none;
    background:rgba(255,255,255,0.1); color:#fff;
    cursor:pointer; display:flex; align-items:center; justify-content:center;
    font-size:0.95rem; transition:all 0.15s;
    border:1px solid rgba(255,255,255,0.1);
}
.sb-logout-btn:hover { background:var(--danger); border-color:var(--danger); transform:translateY(-1px); box-shadow:0 4px 12px rgba(220,38,38,0.3); }

/* ── Tier 2: Horizontal Nav ── */
.sh-nav-tier {
    height:50px; background:var(--surface);
    border-bottom:1px solid var(--border-soft);
    box-shadow:var(--sh-sm); z-index:99;
}
.sh-nav-scroll {
    display:flex; align-items:center; gap:6px;
    height:100%; padding:0 24px; overflow-x:auto; overflow-y:hidden;
}
.sh-nav-scroll::-webkit-scrollbar { height:0; display:none; }

.nav-divider-v {
    width:1px; height:20px; background:var(--border);
    margin:0 4px; flex-shrink:0;
}

.nav-btn {
    display:flex; align-items:center; gap:8px;
    height:100%; padding:0 12px; background:transparent; border:none;
    color:var(--text-sub); font-size:0.88rem; font-weight:600; cursor:pointer;
    transition:all 0.15s; position:relative; white-space:nowrap; flex-shrink:0;
}
.nav-btn:hover { color:var(--text-h); background:var(--surface-2); }

.nav-btn.active { color:var(--primary); background:rgba(26,58,143,0.03); }
.nav-btn.active::after {
    content:''; position:absolute; bottom:0; left:0; width:100%; height:3px;
    background:var(--primary); border-radius:3px 3px 0 0;
}

.nav-icon-wrap {
    font-size:1rem; color:var(--text-dis); transition:color 0.15s;
}
.nav-btn:hover .nav-icon-wrap { color:var(--text-sub); }
.nav-btn.active .nav-icon-wrap { color:var(--primary); }

.nav-ai-badge {
    font-size:0.6rem; font-weight:800; letter-spacing:0.5px;
    background:var(--primary-ultra); color:var(--primary);
    padding:2px 6px; border-radius:12px; margin-left:4px;
}
.nav-notif {
    font-size:0.65rem; font-weight:700;
    background:var(--danger); color:#fff; margin-left:4px;
    width:18px; height:18px; border-radius:50%;
    display:flex; align-items:center; justify-content:center;
    animation:notif-bounce 2s infinite;
}


/* ── LAYOUT FIXES ── */
.shell-main { flex:1; display:flex; flex-direction:column; overflow:hidden; position:relative; min-width:0; background:var(--bg); }


/* ── PÁGINAS ── */
.pages-container { flex:1; overflow-y:auto; padding-bottom:var(--bottom-h); }
@media (min-width:768px) { .pages-container { padding-bottom:0; } }
.pages-container::-webkit-scrollbar { width:5px; }
.pages-container::-webkit-scrollbar-track { background:transparent; }
.pages-container::-webkit-scrollbar-thumb { background:var(--border); border-radius:3px; }

.page { display:none; padding:26px; max-width:880px; margin:0 auto; animation:pgIn 0.28s ease; }
.page.active { display:block; }
.page.page-flex { display:none; flex-direction:column; max-width:none; padding:0; height:100%; }
.page.active.page-flex { display:flex; }
@keyframes pgIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

/* ── SECCION TITLES ── */
.section-title {
    font-size:0.95rem; font-weight:700; color:var(--text-h);
    margin-bottom:16px; display:flex; align-items:center; gap:8px;
}
.section-title::before { content:''; width:4px; height:18px; background:var(--primary); border-radius:2px; flex-shrink:0; }
.subsec-title { font-size:0.75rem; font-weight:700; color:var(--text-sub); text-transform:uppercase; letter-spacing:1.5px; margin-bottom:10px; }
.page-hdr { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:22px; flex-wrap:wrap; gap:12px; }
.page-hdr h2 { font-size:1.18rem; font-weight:700; color:var(--text-h); }
.page-hdr p  { font-size:0.82rem; color:var(--text-sub); margin-top:2px; }

/* ── HERO BANNER ── */
.hero-banner {
    background:linear-gradient(130deg, #070f2b 0%, #0f2060 40%, #083d28 100%);
    border-radius:var(--r-lg); padding:30px 28px; color:#fff;
    margin-bottom:26px; box-shadow:var(--sh-lg);
    display:flex; flex-direction:column; gap:22px;
    position:relative; overflow:hidden;
}
.hero-banner::before {
    content:''; position:absolute; top:-80px; right:-80px;
    width:300px; height:300px; border-radius:50%;
    background:radial-gradient(circle, rgba(74,124,232,0.15), transparent 65%);
    pointer-events:none;
}
.hero-banner::after {
    content:''; position:absolute; bottom:-60px; left:20%;
    width:200px; height:200px; border-radius:50%;
    background:radial-gradient(circle, rgba(34,212,160,0.1), transparent 65%);
    pointer-events:none;
}
@media (min-width:600px){ .hero-banner { flex-direction:row; align-items:center; justify-content:space-between; } }
.hero-text { position:relative; z-index:1; }
.hero-date { font-size:0.72rem; opacity:0.55; text-transform:uppercase; letter-spacing:1.5px; margin-bottom:8px; }
.hero-banner h1 { font-size:1.85rem; font-weight:800; letter-spacing:-0.5px; margin-bottom:2px; }
.hero-sub   { font-size:0.78rem; opacity:0.55; margin-bottom:3px; letter-spacing:0.5px; }
.hero-slogan{ font-size:0.88rem; opacity:0.78; margin-bottom:20px; font-style:italic; }
.hero-btns { display:flex; gap:10px; flex-wrap:wrap; }
.hero-stats { display:flex; gap:0; flex-shrink:0; position:relative; z-index:1; }
.hstat {
    text-align:center; padding:14px 22px; cursor:pointer;
    border-left:1px solid rgba(255,255,255,0.1); transition:background 0.15s;
}
.hstat:first-child { border-left:none; }
.hstat:hover { background:rgba(255,255,255,0.05); border-radius:var(--r-sm); }
.hstat-n { display:block; font-size:1.9rem; font-weight:800; color:#fff; line-height:1; }
.hstat-l { display:block; font-size:0.68rem; opacity:0.55; text-transform:uppercase; letter-spacing:0.5px; margin-top:4px; }

/* ── SHORTCUTS GRID ── */
.shortcuts-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin-bottom:28px; }
@media (max-width:500px) { .shortcuts-grid { grid-template-columns:repeat(4,1fr); } }
.sc-card {
    background:var(--surface); border:1px solid var(--border-soft);
    border-radius:var(--r); padding:16px 8px; text-align:center;
    cursor:pointer; transition:all 0.2s cubic-bezier(.4,0,.2,1);
    box-shadow:var(--sh-xs);
}
.sc-card:hover { transform:translateY(-3px); box-shadow:var(--sh); border-color:var(--primary-ultra); }
.sc-icon {
    width:44px; height:44px; border-radius:11px; margin:0 auto 10px;
    display:flex; align-items:center; justify-content:center; font-size:1.05rem; color:#fff;
}
.sc-icon.blue   { background:linear-gradient(135deg,var(--primary),var(--primary-mid)); }
.sc-icon.green  { background:linear-gradient(135deg,var(--accent),#0a7a5a); }
.sc-icon.orange { background:linear-gradient(135deg,var(--orange),#c24600); }
.sc-icon.teal   { background:linear-gradient(135deg,var(--teal),#0674a0); }
.sc-icon.brown  { background:linear-gradient(135deg,#92400e,#6b2f00); }
.sc-icon.purple { background:linear-gradient(135deg,var(--purple),#5b2bc8); }
.sc-icon.navy   { background:linear-gradient(135deg,var(--navy),#0d1e40); }
.sc-icon.primary{ background:linear-gradient(135deg,var(--primary-mid),var(--primary-light)); }
.sc-card span { font-size:0.77rem; font-weight:600; color:var(--text-h); display:block; }

/* ── NEWS ── */
.news-grid { display:grid; grid-template-columns:1fr; gap:14px; margin-bottom:26px; }
@media (min-width:580px){ .news-grid { grid-template-columns:repeat(2,1fr); } }
.news-card {
    background:var(--surface); border:1px solid var(--border-soft);
    border-radius:var(--r); overflow:hidden; box-shadow:var(--sh-xs);
    cursor:pointer; transition:all 0.2s;
}
.news-card:hover { box-shadow:var(--sh); transform:translateY(-2px); }
.news-img { height:145px; background-size:cover; background-position:center; position:relative; }
.news-body { padding:15px; }
.news-body h4 { font-size:0.95rem; font-weight:600; color:var(--text-h); margin:7px 0 5px; }
.news-body p  { font-size:0.82rem; color:var(--text-sub); line-height:1.55; margin-bottom:8px; }
.news-date { font-size:0.73rem; color:var(--text-dis); display:flex; align-items:center; gap:5px; }

/* ── CIERRE POLÍTICO ── */
.political-cierre {
    display:flex; align-items:flex-start; gap:16px;
    background:linear-gradient(135deg, var(--primary-ultra), var(--accent-ultra));
    border:1px solid var(--border-soft); border-radius:var(--r);
    padding:20px; margin-bottom:12px;
}
.cierre-logo { width:46px; height:46px; border-radius:var(--r-sm); flex-shrink:0; object-fit:contain; }
.political-cierre p { font-size:0.87rem; color:var(--text-body); line-height:1.65; }
.slogan-final { margin-top:7px; font-weight:700; color:var(--primary); font-size:0.88rem; }

/* ── CHAT ── */
.chat-wrap { flex:1; display:flex; flex-direction:column; background:var(--bg); overflow:hidden; }
.chat-hdr {
    padding:12px 20px; background:var(--surface);
    border-bottom:1px solid var(--border-soft);
    display:flex; align-items:center; justify-content:space-between;
    box-shadow:var(--sh-xs);
}
.chat-hdr-info { display:flex; align-items:center; gap:13px; }
.chat-avatar { width:40px; border-radius:10px; box-shadow:var(--sh-xs); }
.chat-hdr-info strong { display:block; font-size:0.93rem; color:var(--text-h); }
.dot-online { font-size:0.72rem; color:var(--accent); font-weight:500; }
.chat-msgs { flex:1; padding:20px; overflow-y:auto; display:flex; flex-direction:column; gap:14px; }
.chat-msgs::-webkit-scrollbar { width:4px; }
.chat-msgs::-webkit-scrollbar-thumb { background:var(--border); border-radius:2px; }
.msg-row { display:flex; max-width:82%; }
.msg-row.bot { align-self:flex-start; }
.msg-row.user { align-self:flex-end; flex-direction:row-reverse; }
.msg-bubble { padding:12px 16px; border-radius:14px; font-size:0.9rem; line-height:1.55; }
.bot .msg-bubble { background:var(--surface); border:1px solid var(--border-soft); border-bottom-left-radius:3px; color:var(--text-body); box-shadow:var(--sh-xs); }
.bot .msg-bubble p { margin-bottom:6px; } .bot .msg-bubble p:last-child { margin:0; }
.user .msg-bubble { background:linear-gradient(135deg, var(--primary), var(--primary-mid)); color:#fff; border-bottom-right-radius:3px; box-shadow:0 2px 8px rgba(26,58,143,0.3); }
.chat-quick-btns { display:flex; flex-wrap:wrap; gap:7px; padding:4px 0 8px; }
.chat-quick-btns button {
    padding:7px 14px; border-radius:20px;
    border:1.5px solid var(--border); background:var(--surface);
    color:var(--text-body); font-size:0.81rem; cursor:pointer; transition:all 0.15s;
}
.chat-quick-btns button:hover { background:var(--primary); color:#fff; border-color:var(--primary); }
.chat-input-row {
    padding:12px 16px; background:var(--surface);
    border-top:1px solid var(--border-soft);
    display:flex; align-items:center; gap:6px;
    box-shadow:0 -2px 8px rgba(10,22,66,0.05);
}
#chat-input {
    flex:1; border:1.5px solid var(--border); border-radius:20px;
    padding:10px 16px; background:var(--surface-2); color:var(--text-body);
    font-size:0.9rem; outline:none; transition:all 0.2s;
}
#chat-input:focus { border-color:var(--primary); background:var(--surface); box-shadow:0 0 0 3px rgba(26,58,143,0.1); }
.ci-btn { width:36px; height:36px; border-radius:50%; border:none; background:transparent; color:var(--text-sub); font-size:1rem; cursor:pointer; transition:all 0.15s; flex-shrink:0; }
.ci-btn:hover { background:var(--surface-3); }
.ci-btn.primary { background:linear-gradient(135deg,var(--primary),var(--primary-mid)); color:#fff; box-shadow:0 2px 6px rgba(26,58,143,0.3); }
.ci-btn.primary:hover { box-shadow:0 3px 10px rgba(26,58,143,0.4); }

/* ── LISTA CARDS ── */
.list-container { display:flex; flex-direction:column; gap:12px; }
.item-card {
    background:var(--surface); border:1px solid var(--border-soft);
    border-radius:var(--r); padding:18px 20px; box-shadow:var(--sh-xs);
    transition:box-shadow 0.2s;
}
.item-card:hover { box-shadow:var(--sh-sm); }
.item-card-top { display:flex; justify-content:space-between; align-items:flex-start; gap:10px; margin-bottom:10px; }
.item-title { font-size:0.97rem; font-weight:600; color:var(--text-h); margin-bottom:4px; }
.item-meta  { font-size:0.81rem; color:var(--text-sub); margin-bottom:3px; display:flex; align-items:center; gap:6px; }
.item-meta i { color:var(--primary); opacity:0.7; font-size:0.78rem; }
.item-actions { margin-top:14px; padding-top:14px; border-top:1px solid var(--border-soft); display:flex; justify-content:flex-end; gap:8px; }
.amount-big { font-size:1.55rem; font-weight:800; color:var(--danger); display:block; margin:6px 0; }

/* ── PAGOS: Selector de tipo ── */
.pay-type-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
@media (min-width:500px){ .pay-type-grid { grid-template-columns:repeat(6,1fr); } }
.pay-type-card {
    background:var(--surface); border:1.5px solid var(--border-soft);
    border-radius:var(--r); padding:14px 8px; text-align:center;
    cursor:pointer; transition:all 0.18s; box-shadow:var(--sh-xs);
}
.pay-type-card:hover { border-color:var(--primary); box-shadow:var(--sh-sm); transform:translateY(-1px); }
.pay-type-card.active-pay-type { border-color:var(--primary); background:var(--primary-ultra); }
.pt-icon { width:38px; height:38px; border-radius:9px; margin:0 auto 8px; display:flex; align-items:center; justify-content:center; color:#fff; font-size:1rem; }
.pt-icon.blue   { background:linear-gradient(135deg,var(--primary),var(--primary-mid)); }
.pt-icon.teal   { background:linear-gradient(135deg,var(--teal),#066a8a); }
.pt-icon.orange { background:linear-gradient(135deg,var(--orange),#c24600); }
.pt-icon.gray   { background:linear-gradient(135deg,#607d8b,#455a64); }
.pt-icon.red    { background:linear-gradient(135deg,var(--danger),#b01c1c); }
.pt-icon.navy   { background:linear-gradient(135deg,var(--navy),#0d1e40); }
.pt-icon.yellow { background:linear-gradient(135deg, #eab308, #ca8a04); }
.pt-icon.cyan   { background:linear-gradient(135deg, #06b6d4, #0891b2); }
.pay-type-card span { font-size:0.74rem; font-weight:600; color:var(--text-h); }

/* ── GRID CARDS (Turismo, Rural) ── */
.grid-cards { display:grid; grid-template-columns:1fr; gap:16px; }
@media (min-width:520px){ .grid-cards { grid-template-columns:repeat(2,1fr); } }
.info-card {
    background:var(--surface); border:1px solid var(--border-soft);
    border-radius:var(--r); overflow:hidden; box-shadow:var(--sh-xs);
    cursor:pointer; transition:all 0.2s;
}
.info-card:hover { box-shadow:var(--sh); transform:translateY(-3px); }
.info-card img { width:100%; height:175px; object-fit:cover; display:block; transition:transform 0.4s; }
.info-card:hover img { transform:scale(1.03); }
.info-card-body { padding:16px; }
.info-card-body h3 { font-size:0.97rem; font-weight:700; color:var(--text-h); margin-bottom:6px; }
.info-card-body p  { font-size:0.82rem; color:var(--text-sub); line-height:1.55; margin-bottom:12px; }
.info-card-meta { display:flex; flex-wrap:wrap; gap:6px; }

/* ── FILTROS TURISMO ── */
.turismo-filters { display:flex; gap:8px; flex-wrap:wrap; }
.filter-btn {
    padding:7px 16px; border:1.5px solid var(--border); border-radius:20px;
    background:var(--surface); color:var(--text-sub);
    font-size:0.82rem; font-weight:600; cursor:pointer; transition:all 0.15s;
}
.filter-btn.active, .filter-btn:hover { background:var(--primary); color:#fff; border-color:var(--primary); box-shadow:0 2px 8px rgba(26,58,143,0.25); }

/* ── EVENTOS ── */
.eventos-grid { display:grid; grid-template-columns:1fr; gap:16px; }
@media (min-width:580px){ .eventos-grid { grid-template-columns:repeat(2,1fr); } }
.evento-card {
    background:var(--surface); border:1px solid var(--border-soft);
    border-radius:var(--r); overflow:hidden; box-shadow:var(--sh-xs);
    transition:all 0.2s;
}
.evento-card:hover { box-shadow:var(--sh); transform:translateY(-2px); }
.evento-img { height:185px; background-size:cover; background-position:center; position:relative; }
.evento-date-badge {
    position:absolute; top:12px; left:12px;
    background:linear-gradient(135deg, var(--primary), var(--primary-mid));
    color:#fff; padding:7px 13px; border-radius:var(--r-sm);
    font-size:0.75rem; font-weight:700; text-align:center;
    box-shadow:var(--sh-sm);
}
.evento-date-badge strong { display:block; font-size:1.4rem; line-height:1.1; }
.evento-body { padding:16px; }
.evento-body h3 { font-size:0.97rem; font-weight:700; color:var(--text-h); margin-bottom:5px; }
.evento-body p  { font-size:0.82rem; color:var(--text-sub); line-height:1.55; margin-bottom:12px; }
.evento-info { display:flex; flex-direction:column; gap:4px; }
.evento-info span { font-size:0.78rem; color:var(--text-sub); display:flex; align-items:center; gap:6px; }
.evento-info i { color:var(--primary); font-size:0.78rem; width:14px; }

/* ── TRANSPARENCIA ── */
.progress-bar-wrap { height:7px; background:var(--surface-3); border-radius:4px; overflow:hidden; margin-top:8px; }
.progress-bar { height:100%; border-radius:4px; transition:width 1.2s ease; }

/* ── BANNERS ── */
.section-banner {
    border-radius:var(--r-lg); padding:34px 28px; color:#fff;
    background-size:cover; background-position:center; position:relative;
    box-shadow:var(--sh);
}
.section-banner::before { content:''; position:absolute; inset:0; border-radius:var(--r-lg); background:linear-gradient(135deg, rgba(7,15,43,0.75), rgba(15,56,38,0.6)); }
.sbanner-text { position:relative; }
.sbanner-text h2 { font-size:1.8rem; font-weight:800; margin-bottom:6px; letter-spacing:-0.3px; }
.sbanner-text p  { font-size:0.9rem; opacity:0.8; }
.rural-banner   { background-image:url('https://images.unsplash.com/photo-1500382017468-9049fed747ef?auto=format&fit=crop&w=900&q=80'); }
.turismo-banner { background-image:url('https://images.unsplash.com/photo-1464822759023-fed622ff2c3b?auto=format&fit=crop&w=900&q=80'); }

/* ── CONSULTAS ── */
.search-hero { background:linear-gradient(135deg, var(--primary), var(--primary-mid)); border-radius:var(--r-lg); padding:30px; color:#fff; text-align:center; box-shadow:var(--sh); }
.search-hero h2 { font-size:1.4rem; font-weight:700; margin-bottom:6px; }
.search-hero p { opacity:0.75; margin-bottom:18px; }
.search-bar-lg { display:flex; background:#fff; border-radius:var(--r); overflow:hidden; max-width:520px; margin:0 auto; box-shadow:var(--sh-sm); }
.search-bar-lg input { flex:1; border:none; outline:none; padding:13px 18px; font-size:0.93rem; color:var(--text-body); }
.search-bar-lg button { background:var(--primary); color:#fff; border:none; padding:13px 20px; cursor:pointer; font-size:1rem; transition:background 0.15s; }
.search-bar-lg button:hover { background:var(--primary-mid); }
.consult-chips { display:flex; flex-wrap:wrap; gap:8px; }
.consulta-result { background:var(--surface); border:1px solid var(--border-soft); border-radius:var(--r); padding:20px; margin-top:20px; box-shadow:var(--sh-xs); }

/* ═══════════════════════════════════════════════════
   PERFIL · DISEÑO PREMIUM
═══════════════════════════════════════════════════ */
#page-perfil { padding:0; max-width:none; }
.profile-cover {
    height:140px;
    background:linear-gradient(130deg, #070f2b 0%, #0f2060 45%, #083d28 100%);
    position:relative;
}
.profile-cover::after {
    content:''; position:absolute; inset:0;
    background:url('https://images.unsplash.com/photo-1464822759023-fed622ff2c3b?auto=format&fit=crop&w=900&q=80') center/cover;
    opacity:0.15;
}
.profile-card-wrap { padding:0 24px 30px; max-width:700px; margin:0 auto; }
.profile-main-card {
    background:var(--surface); border:1px solid var(--border-soft);
    border-radius:var(--r-lg); margin-top:-50px; padding:24px;
    box-shadow:var(--sh); margin-bottom:18px; position:relative;
}
.profile-avatar-wrap { display:flex; justify-content:center; margin-bottom:14px; position:relative; display:inline-block; margin-left:50%; transform:translateX(-50%); }
.avatar-xl {
    width:84px; height:84px;
    background:linear-gradient(135deg, var(--primary), var(--primary-mid));
    color:#fff; border-radius:var(--r-lg); display:flex; align-items:center;
    justify-content:center; font-size:2rem; font-weight:800;
    box-shadow:0 4px 16px rgba(26,58,143,0.4); border:4px solid var(--surface);
}
.avatar-edit-btn {
    position:absolute; bottom:-4px; right:-4px; width:28px; height:28px;
    border-radius:50%; background:var(--primary); color:#fff;
    border:2px solid var(--surface); cursor:pointer; font-size:0.7rem;
    display:flex; align-items:center; justify-content:center;
}
.profile-info { text-align:center; margin-bottom:18px; }
.profile-info h2 { font-size:1.2rem; font-weight:700; color:var(--text-h); margin-bottom:5px; }
.profile-info p  { font-size:0.83rem; color:var(--text-sub); display:flex; align-items:center; justify-content:center; gap:6px; margin-bottom:3px; }
.profile-badge {
    display:inline-flex; align-items:center; gap:5px; margin-top:8px;
    background:var(--accent-ultra); color:var(--accent); font-size:0.75rem;
    font-weight:600; padding:4px 12px; border-radius:20px;
}
.profile-stats-row {
    display:flex; border-top:1px solid var(--border-soft);
    margin-top:16px; padding-top:16px;
}
.pstat {
    flex:1; text-align:center; padding:10px; cursor:pointer;
    border-left:1px solid var(--border-soft); transition:background 0.15s;
    border-radius:var(--r-sm);
}
.pstat:first-child { border-left:none; }
.pstat:hover { background:var(--surface-2); }
.pstat-n { display:block; font-size:1.6rem; font-weight:800; color:var(--text-h); line-height:1; }
.pstat-l { display:block; font-size:0.7rem; color:var(--text-sub); margin-top:4px; font-weight:500; }

/* Settings Grupos */
.settings-group { margin-bottom:16px; }
.settings-label {
    font-size:0.65rem; font-weight:700; letter-spacing:2px;
    color:var(--text-sub); padding:0 4px 8px; display:block;
}
.settings-card {
    background:var(--surface); border:1px solid var(--border-soft);
    border-radius:var(--r); overflow:hidden; box-shadow:var(--sh-xs);
}
.setting-row {
    display:flex; align-items:center; gap:14px; padding:15px 18px;
    cursor:pointer; transition:background 0.15s;
    border-bottom:1px solid var(--border-soft);
}
.setting-row:last-child { border-bottom:none; }
.setting-row:hover { background:var(--surface-2); }
.srow-icon { width:36px; height:36px; border-radius:9px; display:flex; align-items:center; justify-content:center; font-size:0.9rem; color:#fff; flex-shrink:0; }
.srow-icon.blue   { background:linear-gradient(135deg,var(--primary),var(--primary-mid)); }
.srow-icon.green  { background:linear-gradient(135deg,var(--accent),#0a7a5a); }
.srow-icon.orange { background:linear-gradient(135deg,var(--orange),#c24600); }
.srow-icon.teal   { background:linear-gradient(135deg,var(--teal),#066a8a); }
.srow-icon.navy   { background:linear-gradient(135deg,var(--navy),#0d1e40); }
.srow-icon.purple { background:linear-gradient(135deg,var(--purple),#5b2bc8); }
.srow-icon.red    { background:linear-gradient(135deg,var(--danger),#b01c1c); }
.srow-text { flex:1; }
.srow-text strong { display:block; font-size:0.9rem; color:var(--text-h); font-weight:600; }
.srow-text span   { display:block; font-size:0.78rem; color:var(--text-sub); margin-top:1px; }
.srow-arrow { color:var(--text-dis); font-size:0.8rem; }
.btn-logout-full {
    width:100%; margin-top:18px; padding:13px;
    background:var(--danger-light); color:var(--danger); border:1.5px solid rgba(220,38,38,0.2);
    border-radius:var(--r); font-weight:700; font-size:0.9rem; cursor:pointer;
    display:flex; align-items:center; justify-content:center; gap:8px; transition:all 0.15s;
}
.btn-logout-full:hover { background:var(--danger); color:#fff; }

/* Toggle */
.toggle-switch { width:42px; height:24px; background:var(--border); border-radius:12px; position:relative; transition:background 0.25s; flex-shrink:0; }
.toggle-switch::after { content:''; position:absolute; top:2px; left:2px; width:20px; height:20px; background:#fff; border-radius:50%; transition:left 0.25s; box-shadow:0 1px 4px rgba(0,0,0,0.2); }
[data-theme="dark"] .toggle-switch { background:var(--primary); }
[data-theme="dark"] .toggle-switch::after { left:20px; }

/* ── ADMIN ── */
.kpi-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(185px,1fr)); gap:14px; }
.kpi-card {
    background:var(--surface); border:1px solid var(--border-soft);
    border-radius:var(--r); padding:20px; display:flex; align-items:center;
    gap:16px; box-shadow:var(--sh-xs); transition:box-shadow 0.2s;
}
.kpi-card:hover { box-shadow:var(--sh-sm); }
.kpi-icon { width:46px; height:46px; border-radius:11px; display:flex; align-items:center; justify-content:center; font-size:1.2rem; color:#fff; flex-shrink:0; }
.kpi-icon.blue  { background:linear-gradient(135deg,var(--primary),var(--primary-mid)); }
.kpi-icon.red   { background:linear-gradient(135deg,var(--danger),#b01c1c); }
.kpi-icon.green { background:linear-gradient(135deg,var(--accent),#0a7a5a); }
.kpi-icon.teal  { background:linear-gradient(135deg,var(--teal),#066a8a); }
.kpi-card p  { font-size:0.78rem; color:var(--text-sub); margin-bottom:3px; }
.kpi-card h2 { font-size:1.5rem; font-weight:800; color:var(--text-h); line-height:1; }
.admin-table { width:100%; border-collapse:collapse; background:var(--surface); border:1px solid var(--border-soft); border-radius:var(--r); overflow:hidden; box-shadow:var(--sh-xs); }
.admin-table th, .admin-table td { padding:12px 16px; text-align:left; border-bottom:1px solid var(--border-soft); font-size:0.87rem; }
.admin-table th { background:var(--surface-2); color:var(--text-sub); font-weight:700; font-size:0.72rem; text-transform:uppercase; letter-spacing:0.8px; }
.admin-table tr:last-child td { border-bottom:none; }
.admin-table tbody tr:hover { background:var(--surface-2); }

/* ── CHARTS ADMIN ── */
.charts-grid { display:grid; grid-template-columns:1fr; gap:16px; margin-bottom:24px; }
@media (min-width:768px){ .charts-grid { grid-template-columns:repeat(2,1fr); } }
.chart-card {
    background:var(--surface); border:1px solid var(--border-soft);
    border-radius:var(--r); padding:20px; box-shadow:var(--sh-xs);
}
.chart-card h4 {
    font-size:0.95rem; font-weight:700; color:var(--text-h);
    margin-bottom:16px; display:flex; align-items:center; gap:8px;
}
.chart-card h4 i { color:var(--primary); }
.canvas-wrap { position:relative; width:100%; height:250px; }


/* ── BOTTOM NAV ── */
.bottom-nav {
    display:flex; height:var(--bottom-h); background:var(--surface);
    border-top:1px solid var(--border-soft); position:fixed; bottom:0; width:100%;
    z-index:100; padding-bottom:env(safe-area-inset-bottom);
    box-shadow:0 -2px 12px rgba(10,22,66,0.08);
}
@media (min-width:768px){ .bottom-nav { display:none; } }
.bottom-nav .nav-btn { flex:1; flex-direction:column; gap:3px; padding:8px; justify-content:center; font-size:0.66rem; color:var(--text-sub); border-radius:0; }
.bottom-nav .nav-btn.active { background:transparent; color:var(--primary); }
.bottom-nav .nav-btn i { font-size:1.2rem; }
.fab-nav { flex:1; }
.fab-circle {
    width:52px; height:52px;
    background:linear-gradient(135deg, var(--primary), var(--primary-mid));
    border-radius:50%; display:flex; align-items:center; justify-content:center;
    color:#fff; font-size:1.4rem; margin:0 auto;
    box-shadow:0 4px 16px rgba(26,58,143,0.5);
    transform:translateY(-14px); border:4px solid var(--bg);
    transition:all 0.2s;
}
.fab-nav.active .fab-circle { background:linear-gradient(135deg, var(--primary-mid), var(--primary-light)); }

/* ── MODALES ── */
.modal-overlay {
    position:fixed; inset:0; background:rgba(5,12,40,0.65);
    display:none; align-items:center; justify-content:center;
    z-index:1000; padding:16px; backdrop-filter:blur(5px);
}
.modal-overlay.active { display:flex; }
.modal {
    background:var(--surface); width:100%; max-width:530px;
    border-radius:var(--r-xl); box-shadow:var(--sh-xl); overflow:hidden;
    animation:mIn 0.25s cubic-bezier(.4,0,.2,1);
    max-height:90vh; display:flex; flex-direction:column;
    border:1px solid var(--border-soft);
}
.modal-hdr {
    padding:18px 22px; border-bottom:1px solid var(--border-soft);
    display:flex; justify-content:space-between; align-items:center; flex-shrink:0;
}
.modal-hdr h3 { font-size:0.98rem; font-weight:700; color:var(--text-h); display:flex; align-items:center; gap:8px; }
.modal-hdr h3 i { color:var(--primary); }
.close-btn { width:30px; height:30px; border-radius:var(--r-sm); border:none; background:var(--surface-3); color:var(--text-sub); cursor:pointer; font-size:1rem; display:flex; align-items:center; justify-content:center; transition:all 0.15s; }
.close-btn:hover { background:var(--border); color:var(--text-h); }
.modal-body { padding:20px 22px; overflow-y:auto; flex:1; }
.modal-body::-webkit-scrollbar { width:4px; }
.modal-body::-webkit-scrollbar-thumb { background:var(--border); border-radius:2px; }
@keyframes mIn { from{transform:translateY(24px) scale(0.97);opacity:0} to{transform:translateY(0) scale(1);opacity:1} }

/* ── UPLOAD ── */
.upload-area {
    border:2px dashed var(--border); border-radius:var(--r);
    padding:30px; text-align:center; background:var(--surface-2);
    color:var(--text-sub); transition:all 0.2s; position:relative;
}
.upload-area:hover { border-color:var(--primary); background:var(--surface); color:var(--primary); }
.upload-area i { font-size:1.8rem; margin-bottom:10px; display:block; color:var(--primary); }
.upload-area p { font-size:0.84rem; }
.upload-area input { opacity:0; position:absolute; inset:0; cursor:pointer; }

/* ── RECIBO PREMIUM ── */
.premium-receipt {
    background: var(--surface);
    border-radius: var(--r-lg);
    border: 1px solid var(--border-soft);
    overflow: hidden;
    margin-bottom: 10px;
    box-shadow: 0 10px 40px rgba(10, 22, 66, 0.08);
}
.pr-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 24px 24px 20px; background: linear-gradient(135deg, var(--surface), var(--surface-2));
}
.pr-brand { display: flex; align-items: center; gap: 14px; }
.pr-brand img { width: 44px; height: 44px; border-radius: 10px; box-shadow: var(--sh-sm); }
.pr-brand h4 { font-size: 0.95rem; font-weight: 800; color: var(--text-h); margin-bottom: 2px; line-height: 1.1; }
.pr-brand span { font-size: 0.72rem; color: var(--text-sub); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.pr-badge {
    background: var(--accent-ultra); color: var(--accent);
    padding: 6px 14px; border-radius: 20px; font-weight: 700;
    font-size: 0.8rem; display: flex; align-items: center; gap: 6px;
    border: 1px solid rgba(15, 152, 112, 0.2);
}
.pr-divider { height: 1px; background: dashed var(--border) 2px; margin: 0 24px; opacity: 0.6; }
.pr-meta { display: flex; gap: 20px; padding: 20px 24px; background: var(--surface); }
.pr-meta-item { flex: 1; }
.pr-meta-item span { display: block; font-size: 0.7rem; color: var(--text-dis); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 4px; font-weight: 600; }
.pr-meta-item strong { display: block; font-size: 0.88rem; color: var(--text-h); font-family: monospace; font-weight: 700; }

.pr-details {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
    padding: 0 24px 24px; background: var(--surface);
}
.pr-detail-box {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 16px; background: var(--surface-2);
    border-radius: var(--r-sm); border: 1px solid var(--border-soft); transition: all 0.2s;
}
.pr-detail-box:hover { background: var(--surface-3); border-color: var(--border); }
.pr-detail-box.full-width { grid-column: 1 / -1; }
.pr-detail-box.highlight { background: linear-gradient(135deg, var(--primary-ultra), #ffffff); border-color: rgba(26,58,143,0.15); }
[data-theme="dark"] .pr-detail-box.highlight { background: linear-gradient(135deg, var(--primary-ultra), var(--surface-2)); }

.pr-detail-box i {
    width: 34px; height: 34px; border-radius: 8px; background: var(--surface); color: var(--primary);
    display: flex; align-items: center; justify-content: center; font-size: 0.95rem; box-shadow: var(--sh-xs); flex-shrink: 0;
}
.prd-text span { display: block; font-size: 0.7rem; color: var(--text-sub); margin-bottom: 2px; }
.prd-text strong { display: block; font-size: 0.9rem; color: var(--text-h); font-weight: 600; line-height: 1.3; }

.pr-footer {
    display: flex; justify-content: space-between; align-items: center;
    padding: 24px; background: linear-gradient(135deg, var(--primary), var(--primary-mid)); color: #fff;
}
.pr-total-section span { display: block; font-size: 0.75rem; color: rgba(255,255,255,0.7); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.pr-amount { font-size: 2.4rem; font-weight: 800; line-height: 1; text-shadow: 0 2px 10px rgba(0,0,0,0.2); }
.pr-qr-section { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.premium-qr { background: #fff; padding: 6px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.3); }
.pr-qr-section span { font-size: 0.65rem; color: rgba(255,255,255,0.6); text-transform: uppercase; letter-spacing: 0.5px; }

/* ── PAGO MODAL ── */
.pago-info-row {
    display:flex; justify-content:space-between; align-items:center;
    background:var(--surface-2); border-radius:var(--r-sm);
    padding:14px 16px; margin-bottom:18px; border:1px solid var(--border-soft);
}
.pago-monto-val { font-size:1.6rem; font-weight:800; color:var(--accent); }
.pay-tabs-bar { display:flex; border-bottom:2px solid var(--border-soft); margin-bottom:18px; }
.pay-tab {
    flex:1; padding:12px; background:transparent; border:none;
    border-bottom:2px solid transparent; font-weight:600; color:var(--text-sub);
    cursor:pointer; transition:all 0.15s; display:flex; align-items:center;
    justify-content:center; gap:6px; margin-bottom:-2px; font-size:0.87rem;
}
.pay-tab.active { color:var(--primary); border-bottom-color:var(--primary); }

/* Card preview */
.card-preview {
    background:linear-gradient(135deg, #0a1628 0%, #1a3a8f 50%, #0f6a4a 100%);
    border-radius:var(--r-lg); padding:22px; color:#fff; margin-bottom:16px;
    box-shadow:var(--sh); min-height:124px; position:relative; overflow:hidden;
}
.card-preview::before { content:''; position:absolute; right:-40px; top:-40px; width:160px; height:160px; border-radius:50%; background:rgba(255,255,255,0.05); }
.card-preview::after  { content:''; position:absolute; left:-30px; bottom:-30px; width:120px; height:120px; border-radius:50%; background:rgba(255,255,255,0.04); }
.cp-top { display:flex; justify-content:space-between; align-items:center; margin-bottom:22px; position:relative; }
.cp-bank { font-size:0.65rem; opacity:0.6; letter-spacing:2px; text-transform:uppercase; }
.cp-brand { font-size:1.9rem; opacity:0.85; }
.cp-num { font-size:1.05rem; letter-spacing:3px; font-family:monospace; margin-bottom:16px; position:relative; }
.cp-bot { display:flex; justify-content:space-between; font-size:0.76rem; opacity:0.75; position:relative; }
.secure-badges { display:flex; gap:8px; flex-wrap:wrap; margin-top:12px; }
.secure-badges span { font-size:0.7rem; color:var(--text-sub); display:flex; align-items:center; gap:4px; background:var(--surface-2); padding:4px 8px; border-radius:4px; border:1px solid var(--border-soft); }
.secure-badges i { color:var(--accent); }

/* Bank info */
.bank-info-box { background:var(--surface-2); border:1px solid var(--border-soft); border-radius:var(--r); padding:14px; }
.bank-detail-table { width:100%; font-size:0.84rem; border-collapse:collapse; }
.bank-detail-table td { padding:6px 8px; border-bottom:1px solid var(--border-soft); color:var(--text-body); }
.bank-detail-table td:first-child { color:var(--text-sub); width:110px; font-size:0.78rem; }
.bank-detail-table tr:last-child td { border-bottom:none; }

/* ── RECIBO ── */
.recibo-header { background:linear-gradient(130deg, #070f2b, #1a3a8f); color:#fff; margin:-20px -22px 20px; padding:24px 22px; text-align:center; }
.recibo-logo { width:56px; margin-bottom:10px; border-radius:var(--r-sm); }
.recibo-body table { width:100%; border-collapse:collapse; font-size:0.87rem; }
.recibo-body td { padding:8px 4px; border-bottom:1px solid var(--border-soft); color:var(--text-body); }
.recibo-body td:first-child { color:var(--text-sub); width:145px; font-size:0.8rem; }
.recibo-body tr:last-child td { border-bottom:none; }
.recibo-total { background:var(--accent-ultra); border-radius:var(--r-sm); padding:14px; text-align:center; margin-top:16px; border:1px solid rgba(15,152,112,0.15); }
.recibo-total .rt-val { font-size:2rem; font-weight:800; color:var(--accent); }
.recibo-qr { text-align:center; margin-top:16px; padding-top:16px; border-top:1px dashed var(--border); }
.recibo-qr .qr-box { width:80px; height:80px; background:var(--surface-2); margin:8px auto; border:1px solid var(--border); display:flex; align-items:center; justify-content:center; border-radius:var(--r-sm); font-size:2rem; color:var(--text-sub); }

/* ── REGISTRO ── */
.reg-steps { display:flex; align-items:center; padding:16px 22px 0; justify-content:center; gap:0; }
.reg-step { width:32px; height:32px; border-radius:50%; border:2px solid var(--border); display:flex; align-items:center; justify-content:center; font-size:0.8rem; font-weight:700; color:var(--text-sub); background:var(--surface); transition:all 0.3s; flex-shrink:0; }
.reg-step.active { background:var(--primary); border-color:var(--primary); color:#fff; box-shadow:0 2px 8px rgba(26,58,143,0.35); }
.reg-step.done   { background:var(--accent); border-color:var(--accent); color:#fff; }
.reg-step-line   { flex:1; height:2px; background:var(--border); max-width:60px; }
.reg-paso { animation:pgIn 0.2s ease; }
.reg-paso-titulo { font-weight:700; font-size:0.76rem; text-transform:uppercase; letter-spacing:1.5px; color:var(--primary); margin-bottom:18px; padding-bottom:10px; border-bottom:2px solid var(--border-soft); }
.pass-strength-bar { height:5px; background:var(--border); border-radius:3px; margin-top:8px; overflow:hidden; }
.strength-fill { height:100%; border-radius:3px; transition:all 0.3s; width:0; }
.pass-strength-label { font-size:0.73rem; margin-top:5px; font-weight:600; }
.otp-box { background:var(--accent-ultra); border:1px solid rgba(15,152,112,0.2); border-radius:var(--r); padding:16px; text-align:center; }
.otp-icon { font-size:1.8rem; color:var(--accent); display:block; margin-bottom:8px; }
.otp-box p { font-size:0.87rem; color:var(--text-body); line-height:1.5; }
.otp-inputs { display:flex; gap:10px; justify-content:center; margin-top:12px; }
.otp-digit { width:46px; height:54px; text-align:center; font-size:1.5rem; font-weight:700; border:2px solid var(--border); border-radius:var(--r-sm); background:var(--surface); color:var(--text-h); outline:none; transition:all 0.2s; }
.otp-digit:focus { border-color:var(--primary); box-shadow:0 0 0 3px rgba(26,58,143,0.12); }
.reg-success-icon { width:72px; height:72px; background:var(--accent-ultra); border-radius:50%; display:flex; align-items:center; justify-content:center; margin:0 auto 16px; font-size:2rem; color:var(--accent); box-shadow:0 4px 16px rgba(15,152,112,0.2); }
.reg-resumen { background:var(--surface-2); border:1px solid var(--border-soft); border-radius:var(--r); padding:14px; text-align:left; font-size:0.84rem; }
.reg-resumen p { margin-bottom:7px; color:var(--text-body); }
.reg-resumen p:last-child { margin-bottom:0; }
.reg-resumen strong { color:var(--text-h); }

/* ── TOASTS ── */
#toast-container { position:fixed; top:18px; right:18px; z-index:9999; display:flex; flex-direction:column; gap:8px; }
.toast {
    background:var(--surface); border-left:3px solid var(--accent);
    padding:12px 18px; border-radius:var(--r-sm); box-shadow:var(--sh);
    color:var(--text-body); font-size:0.87rem; max-width:320px;
    animation:toastIn 0.3s, toastOut 0.35s 3.2s forwards;
    display:flex; align-items:center; gap:8px;
    border:1px solid var(--border-soft);
}
.toast.warn { border-left-color:var(--warning); }
.toast.err  { border-left-color:var(--danger); }
@keyframes toastIn  { from{transform:translateX(100%);opacity:0} to{transform:translateX(0);opacity:1} }
@keyframes toastOut { to{transform:translateX(100%);opacity:0} }

/* ── RESPONSIVE MÓVIL ── */
@media (max-width: 768px) {
    .sh-header { padding: 10px 12px; gap: 8px; }
    .sb-logo-wrap img { width: 34px; height: 34px; border-radius: 8px; }
    .brand-name { font-size: 1rem; }
    .brand-sub { display: none; } /* Ocultar para ganar espacio */
    
    /* Botones de acción arriba */
    .topbar-btn span { display: none; } /* Oculta texto "Emergencia" */
    .topbar-btn { padding: 8px; border-radius: 50%; justify-content: center; }
    .sh-actions { gap: 6px; }
    
    /* Tarjeta de usuario */
    .sb-user-info { display: none; } /* Oculta el nombre en móvil */
    .sh-user-card { margin: 0; padding: 2px; background: transparent; border: none; }
    .sh-user-card:hover { background: transparent; }
    .sb-user-avatar { width: 30px; height: 30px; font-size: 0.8rem; }
    .sb-logout-btn { width: 30px; height: 30px; font-size: 0.85rem; }

    /* Navegación con scroll horizontal suave */
    .sh-nav-scroll { 
        padding: 0 12px; 
        -webkit-overflow-scrolling: touch; 
    }
    
    /* Layout general */
    .page { padding: 16px 12px; }
    .page-hdr { flex-direction: column; gap: 6px; }
}

/* ── SANGA IA – CHAT WIDGETS ── */

/* Tarjeta de pago inline en el chat */
.chat-pay-card {
    background: var(--surface);
    border: 1.5px solid var(--border-soft);
    border-radius: var(--r);
    padding: 12px 14px;
    margin: 4px 0;
    cursor: pointer;
    transition: all 0.18s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.chat-pay-card:hover { border-color: var(--primary); background: var(--primary-ultra); transform: translateX(3px); }
.chat-pay-card .cpc-left { display: flex; align-items: center; gap: 10px; }
.chat-pay-card .cpc-icon { width: 36px; height: 36px; border-radius: 8px; background: var(--primary-ultra); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 0.95rem; flex-shrink: 0; }
.chat-pay-card .cpc-info .cpc-tipo { font-size: 0.84rem; font-weight: 700; color: var(--text-h); }
.chat-pay-card .cpc-info .cpc-vence { font-size: 0.73rem; color: var(--text-sub); margin-top: 2px; }
.chat-pay-card .cpc-monto { font-size: 1.05rem; font-weight: 800; color: var(--accent); flex-shrink: 0; }

/* Lista de pagos en el chat */
.chat-pay-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }

/* Voucher/comprobante preview en el chat */
.chat-voucher-preview {
    background: var(--accent-ultra);
    border: 1.5px dashed var(--accent);
    border-radius: var(--r);
    padding: 14px;
    text-align: center;
    margin: 4px 0;
}
.chat-voucher-preview i { font-size: 2rem; color: var(--accent); display: block; margin-bottom: 6px; }
.chat-voucher-preview p { font-size: 0.84rem; color: var(--text-body); }
.chat-voucher-preview .cvp-filename { font-size: 0.78rem; font-weight: 700; color: var(--accent); margin-top: 4px; }
.chat-voucher-preview .cvp-validating { font-size: 0.78rem; color: var(--text-sub); margin-top: 4px; display: flex; align-items: center; justify-content: center; gap: 6px; }

/* Mini form conversacional en el chat */
.chat-mini-form { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.chat-mini-form select,
.chat-mini-form input[type="text"],
.chat-mini-form textarea {
    width: 100%; padding: 9px 12px; border-radius: var(--r-sm);
    border: 1.5px solid var(--border); background: var(--surface);
    color: var(--text-h); font-size: 0.87rem; font-family: inherit;
    box-sizing: border-box; transition: border-color 0.15s;
}
.chat-mini-form select:focus,
.chat-mini-form input:focus,
.chat-mini-form textarea:focus { border-color: var(--primary); outline: none; }
.chat-mini-form textarea { resize: vertical; min-height: 64px; }
.chat-mini-form label { font-size: 0.78rem; font-weight: 700; color: var(--text-sub); }

/* Método de pago selector en el chat */
.chat-pay-methods { display: flex; gap: 8px; margin-top: 6px; }
.chat-pay-method-btn {
    flex: 1; padding: 10px 8px; border-radius: var(--r-sm);
    border: 1.5px solid var(--border); background: var(--surface);
    cursor: pointer; font-size: 0.82rem; font-weight: 600; color: var(--text-sub);
    transition: all 0.18s; display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.chat-pay-method-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-ultra); }
.chat-pay-method-btn i { font-size: 1.2rem; }

/* Badge de validado */
.chat-validated-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--accent-ultra); color: var(--accent);
    border: 1px solid rgba(15,152,112,0.2); border-radius: 20px;
    padding: 4px 12px; font-size: 0.78rem; font-weight: 700;
    margin-top: 6px;
}

/* Typing dots animation */
.typing-dots { display:inline-flex; gap:4px; align-items:center; padding:2px 0; }
.typing-dots span { width:6px; height:6px; border-radius:50%; background:var(--text-dis); animation:tdot 1.2s infinite; }
.typing-dots span:nth-child(2) { animation-delay:.2s; }
.typing-dots span:nth-child(3) { animation-delay:.4s; }
@keyframes tdot { 0%,80%,100%{transform:scale(0.7);opacity:0.4} 40%{transform:scale(1);opacity:1} }
