/* ==============================================================================
   SUNERA / eRAsolar - MÓDULO DE VISITAS TÉCNICAS & ABASTECIMIENTO INTELIGENTE
   Estilos Profesionales: Paleta Corporativa Slate / Gold / Emerald
   Diseño Mobile-First optimizado para levantamientos de campo y pantallas táctiles
   ============================================================================== */

:root {
    --era-gold: #f59e0b;
    --era-gold-hover: #d97706;
    --era-gold-light: #fef3c7;
    --era-emerald: #10b981;
    --era-emerald-dark: #059669;
    --era-blue: #0284c7;
    --era-slate-950: #020617;
    --era-slate-900: #0f172a;
    --era-slate-850: #1e293b;
    --era-slate-800: #1e293b;
    --era-slate-700: #334155;
    --era-slate-600: #475569;
    --era-slate-400: #94a3b8;
    --font-brand: 'Outfit', sans-serif;
    --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background-color: #0b1120;
    color: #f1f5f9;
    font-family: var(--font-ui);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

/* --- CONTENEDOR GENERAL ESTÁNDAR SUITE SUNERA --- */
.budget-app-container {
    max-width: 1560px;
    width: 100%;
    box-sizing: border-box;
    margin: 0 auto;
    padding: 1.25rem 1.5rem 3rem;
}

/* --- TARJETA DE CABECERA DE PROYECTO --- */
.card-project-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 14px;
    padding: 1.1rem 1.4rem;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.5);
}

.project-header-top {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.project-select-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
    min-width: 280px;
}

.project-select-group label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--era-gold);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.project-selector {
    background: #0f172a;
    border: 1px solid #475569;
    border-radius: 8px;
    padding: 0.65rem 0.9rem;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font-brand);
    outline: none;
    transition: all 0.2s;
}

.project-selector:focus {
    border-color: var(--era-gold);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.project-quick-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.project-kpis-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    padding-top: 0.85rem;
}

.kpi-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.kpi-lbl {
    font-size: 0.68rem;
    color: var(--era-slate-400);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.kpi-val {
    font-size: 0.85rem;
    font-weight: 600;
}

/* --- TABS NAVIGATION --- */
.tabs-nav-wrapper {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid #1e293b;
    padding-bottom: 0.4rem;
    overflow-x: auto;
}

.tab-btn {
    background: transparent;
    border: none;
    border-radius: 8px 8px 0 0;
    padding: 0.65rem 1.1rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
    color: var(--era-gold);
    background: #1e293b;
    border-bottom: 3px solid var(--era-gold);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- UTILIDADES GENERALES DE ESPACIADO Y LAYOUT --- */
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 0.75rem !important; }
.mb-4 { margin-bottom: 1.25rem !important; }
.mb-6 { margin-bottom: 1.5rem !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 0.75rem !important; }
.mt-4 { margin-top: 1rem !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.hidden { display: none !important; }
.w-full { width: 100%; }

/* --- FIELD INFO CARD (DISEÑO COMPACTO & PROFESIONAL) --- */
.field-info-card {
    background: linear-gradient(135deg, #131c2e 0%, #0c1424 100%);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 12px;
    padding: 0.85rem 1.15rem;
    margin-bottom: 1.25rem !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    clear: both;
    position: relative;
    z-index: 10;
}

.field-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.7rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.field-info-title {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--era-gold);
    display: flex;
    align-items: center;
    gap: 0.45rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: var(--font-brand);
}

.field-info-badge {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.25);
    padding: 2px 8px;
    border-radius: 9999px;
}

.field-info-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
    align-items: flex-end;
}

@media (max-width: 1024px) {
    .field-info-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }
}

@media (max-width: 580px) {
    .field-info-grid {
        grid-template-columns: 1fr;
        gap: 0.65rem;
    }
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.field-group label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
}

.field-group .field-input {
    width: 100%;
    background: #090e1a;
    border: 1px solid #334155;
    border-radius: 7px;
    padding: 0.52rem 0.75rem;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 500;
    outline: none;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.field-group .field-input:focus {
    border-color: var(--era-gold);
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25);
    background: #0f172a;
}

.input-lbl {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--era-slate-400);
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.3rem;
}

.field-input {
    width: 100%;
    background: #0f172a;
    border: 1px solid #475569;
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    color: #ffffff;
    font-size: 0.85rem;
    outline: none;
    box-sizing: border-box;
    transition: all 0.2s;
}

.field-input:focus {
    border-color: var(--era-gold);
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

/* --- CATEGORY PILLS SECTION (SEPARACIÓN CLARA & SIN SOLAPAMIENTO) --- */
.category-pills-section {
    margin-bottom: 1.25rem !important;
    clear: both;
    position: relative;
    z-index: 5;
}

.category-bar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.45rem;
    padding: 0 0.2rem;
}

.category-bar-title {
    font-size: 0.74rem;
    font-weight: 800;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-brand);
}

.category-pills-bar {
    display: flex;
    gap: 0.45rem;
    overflow-x: auto;
    padding: 0.25rem 0.15rem 0.55rem 0.15rem;
    scrollbar-width: thin;
    scrollbar-color: #475569 transparent;
}

.category-pills-bar::-webkit-scrollbar {
    height: 6px;
}

.category-pills-bar::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 3px;
}

.cat-pill {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 9999px;
    padding: 0.42rem 0.85rem;
    font-size: 0.74rem;
    font-weight: 600;
    color: #cbd5e1;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
    transition: all 0.2s;
    user-select: none;
}

.cat-pill:hover {
    border-color: var(--era-gold);
    color: #ffffff;
    background: #253347;
}

.cat-pill.active {
    background: rgba(245, 158, 11, 0.18);
    border-color: var(--era-gold);
    color: var(--era-gold);
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.15);
}

/* --- QUICK ADD TOUCH BOX --- */
.quick-add-box {
    background: #1e293b;
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 14px;
    padding: 1.1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.quick-add-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.quick-add-title {
    font-size: 0.88rem;
    font-weight: 800;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    font-family: var(--font-brand);
}

.catalog-dropdown-wrapper {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 10px;
    padding: 0.75rem 0.9rem;
    margin-bottom: 0.85rem;
}

.catalog-select-field {
    width: 100%;
    background: #090d16;
    border: 1.5px solid rgba(245, 158, 11, 0.5);
    border-radius: 8px;
    padding: 0.7rem 0.95rem;
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 600;
    font-family: var(--font-brand);
    outline: none;
    box-sizing: border-box;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.catalog-select-field:focus {
    border-color: var(--era-gold);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
    background: #0f172a;
}

.catalog-select-field option {
    background: #0f172a;
    color: #f8fafc;
    padding: 8px 12px;
    font-size: 0.88rem;
}

.quick-add-grid {
    display: grid;
    grid-template-columns: 2.5fr 1.3fr 0.9fr 1.1fr 1.2fr auto;
    gap: 0.6rem;
    align-items: center;
    position: relative;
}

@media (max-width: 900px) {
    .quick-add-grid {
        grid-template-columns: 1fr 1fr;
    }
    .quick-col-search {
        grid-column: span 2;
    }
    .quick-col-btn {
        grid-column: span 2;
    }
}

.quick-col-search {
    position: relative;
}

.search-input {
    width: 100%;
    background: #0f172a;
    border: 1px solid #475569;
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
    color: #ffffff;
    font-size: 0.88rem;
    outline: none;
    box-sizing: border-box;
    transition: all 0.2s;
}

.search-input:focus {
    border-color: var(--era-gold);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #0f172a;
    border: 1px solid #475569;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 220px;
    overflow-y: auto;
    z-index: 50;
    box-shadow: 0 10px 25px rgba(0,0,0,0.6);
}

.autocomplete-dropdown.hidden {
    display: none;
}

.autocomplete-item {
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}

.autocomplete-item:hover {
    background: #1e293b;
    color: var(--era-gold);
}

.stepper-box {
    display: flex;
    align-items: center;
    background: #0f172a;
    border: 1px solid #475569;
    border-radius: 8px;
    overflow: hidden;
}

.btn-step {
    background: #334155;
    border: none;
    color: white;
    width: 34px;
    height: 38px;
    cursor: pointer;
    font-weight: 800;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.btn-step:hover {
    background: #475569;
}

.qty-field {
    width: 100%;
    background: transparent;
    border: none;
    color: white;
    text-align: center;
    font-weight: 700;
    font-size: 0.95rem;
    outline: none;
}

.btn-add-touch {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: none;
    border-radius: 8px;
    color: #0f172a;
    font-weight: 800;
    font-size: 0.85rem;
    padding: 0.65rem 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    height: 38px;
    white-space: nowrap;
    transition: transform 0.15s, box-shadow 0.15s;
}

.btn-add-touch:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.quick-increments-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.65rem;
    overflow-x: auto;
}

.btn-chip-inc {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.25rem 0.55rem;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-chip-inc:hover {
    border-color: var(--era-gold);
    color: #ffffff;
}

/* --- TABLA DE ITEMS LEVANTADOS --- */
.items-card-container {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.items-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 1.25rem;
    background: #0f172a;
    border-bottom: 1px solid #334155;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.items-badge {
    background: rgba(2, 132, 199, 0.15);
    border: 1px solid rgba(2, 132, 199, 0.3);
    color: #38bdf8;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 9999px;
}

.visit-running-total {
    font-size: 1.15rem;
    font-weight: 900;
    color: var(--era-emerald);
    font-family: var(--font-brand);
    margin-right: 0.5rem;
}

.table-wrapper {
    overflow-x: auto;
    width: 100%;
}

.era-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.era-table th {
    background: #0f172a;
    color: var(--era-slate-400);
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid #334155;
    white-space: nowrap;
    text-align: left;
}

.era-table td {
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
    vertical-align: middle;
}

.era-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* --- BADGES Y CHIPS --- */
.badge-cat {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-cat.tuberia { background: rgba(56, 189, 248, 0.15); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3); }
.badge-cat.cableado { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-cat.protecciones { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-cat.tierra { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-cat.ferreteria { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }
.badge-cat.accesorios { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.3); }

/* --- BOTONES DE ACCIÓN --- */
.btn-primary-gold {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #0f172a;
    font-weight: 800;
    font-size: 0.8rem;
    padding: 0.55rem 0.95rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.15s;
}

.btn-primary-gold:hover {
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.btn-primary-emerald {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.8rem;
    padding: 0.55rem 0.95rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.15s;
}

.btn-primary-emerald:hover {
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.btn-secondary-dark {
    background: #0f172a;
    border: 1px solid #475569;
    color: #cbd5e1;
    font-weight: 600;
    font-size: 0.78rem;
    padding: 0.55rem 0.85rem;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.15s;
}

.btn-secondary-dark:hover {
    border-color: #94a3b8;
    color: #ffffff;
}

.btn-mini-gold {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #f59e0b;
    font-weight: 700;
    font-size: 0.72rem;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.15s;
}

.btn-mini-gold:hover {
    background: #f59e0b;
    color: #0f172a;
}

.btn-whatsapp {
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    color: white;
    font-weight: 800;
    font-size: 0.85rem;
    padding: 0.65rem 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: all 0.15s;
}

.btn-whatsapp:hover {
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.4);
}

.btn-call {
    background: #1e293b;
    border: 1px solid #10b981;
    color: #10b981;
    font-weight: 700;
    font-size: 0.82rem;
    padding: 0.6rem 0.9rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    text-decoration: none;
    transition: all 0.15s;
}

.btn-call:hover {
    background: rgba(16, 185, 129, 0.15);
}

/* --- BANNER DE UBICACIÓN Y CERCANÍA --- */
.location-banner {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(15, 23, 42, 0.8) 100%);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 10px;
    padding: 0.75rem 1rem;
}

.loc-icon-wrap {
    background: rgba(245, 158, 11, 0.2);
    padding: 0.4rem;
    border-radius: 8px;
    flex-shrink: 0;
}

/* --- CARD PANEL --- */
.card-panel {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 14px;
    padding: 1.1rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.card-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.9rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    flex-wrap: wrap;
    gap: 0.4rem;
}

.summary-box {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-lbl {
    font-size: 0.75rem;
    color: var(--era-slate-400);
    font-weight: 600;
}

.summary-val {
    font-size: 0.95rem;
    font-weight: 800;
    font-family: var(--font-brand);
}

.rfq-preview-textarea {
    width: 100%;
    background: #0f172a;
    border: 1px solid #475569;
    border-radius: 8px;
    padding: 0.75rem;
    color: #f1f5f9;
    font-family: monospace;
    font-size: 0.8rem;
    line-height: 1.45;
    outline: none;
    resize: vertical;
    box-sizing: border-box;
}

.rfq-preview-textarea:focus {
    border-color: var(--era-blue);
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.2);
}

/* --- STAT CARDS --- */
.stat-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 0.9rem 1.1rem;
}

.stat-title {
    font-size: 0.72rem;
    color: var(--era-slate-400);
    text-transform: uppercase;
    font-weight: 700;
}

.stat-num {
    font-size: 1.4rem;
    font-weight: 900;
    font-family: var(--font-brand);
    margin: 0.25rem 0;
}

.stat-sub {
    font-size: 0.68rem;
    color: var(--era-slate-400);
}

/* --- MODAL --- */
.era-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.era-modal.hidden {
    display: none;
}

.era-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
}

.era-modal-box {
    position: relative;
    background: #1e293b;
    border: 1px solid #475569;
    border-radius: 14px;
    width: 100%;
    max-width: 540px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    animation: modalPop 0.2s ease-out;
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.era-modal-header {
    background: #0f172a;
    padding: 0.85rem 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #334155;
}

.modal-close-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.modal-close-btn:hover {
    color: white;
}

.era-modal-body {
    padding: 1.1rem 1.25rem;
}

.era-modal-footer {
    background: #0f172a;
    padding: 0.85rem 1.25rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    border-top: 1px solid #334155;
}

/* --- TOAST --- */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.era-toast {
    background: #0f172a;
    border: 1px solid #334155;
    color: white;
    padding: 0.75rem 1.1rem;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: toastSlide 0.2s ease-out;
}

.era-toast.success { border-color: var(--era-emerald); color: #a7f3d0; }
.era-toast.info { border-color: var(--era-blue); color: #bae6fd; }
.era-toast.warn { border-color: var(--era-gold); color: #fef08a; }

@keyframes toastSlide {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* --- PWA INSTALL BANNER & MOBILE APP STYLES --- */
.pwa-install-banner {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(245, 158, 11, 0.12) 100%);
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: 12px;
    padding: 0.85rem 1.15rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    position: relative;
}

.pwa-icon-box {
    width: 42px;
    height: 42px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.badge-pwa-chip {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34d399;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-pwa-install {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.55rem 1rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-pwa-install:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.btn-pwa-guide {
    background: #1e293b;
    border: 1px solid #475569;
    color: #cbd5e1;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.55rem 0.85rem;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-pwa-guide:hover {
    border-color: var(--era-gold);
    color: #ffffff;
}

/* --- SHEET FLOTANTE AUTOMÁTICO PARA CELULARES --- */
.mobile-install-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    padding: 0.85rem 1.15rem 1.35rem 1.15rem;
    background: rgba(11, 17, 32, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1.5px solid rgba(245, 158, 11, 0.4);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.8);
    animation: sheetSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-install-sheet.hidden {
    display: none !important;
}

@keyframes sheetSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.mobile-install-content {
    max-width: 520px;
    margin: 0 auto;
}

.btn-sheet-close {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #94a3b8;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.2s;
}

.btn-sheet-close:hover {
    color: white;
    background: rgba(255, 255, 255, 0.18);
}

.btn-sheet-install-action {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    font-size: 0.88rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.35);
    transition: all 0.2s;
}

.btn-sheet-install-action:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
}