:root {
    --bg-base: #0B0F19; --bg-glass: rgba(26, 32, 53, 0.75); --border-glass: rgba(255, 255, 255, 0.08);
    --primary: #007AFF; --primary-hover: #0056b3; --accent-gold: #FFD700; --accent-green: #00E676;
    --accent-red: #FF3B30; --accent-cyan: #00E5FF; --text-main: #FFFFFF; --text-muted: #8E9BAE;
    --shadow-glow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', system-ui, sans-serif; -webkit-tap-highlight-color: transparent; }

body { 
    background-color: #03050A; /* Fondo exterior oscuro para PC */
    background-image: radial-gradient(circle at 15% 50%, rgba(0, 122, 255, 0.08), transparent 25%), radial-gradient(circle at 85% 30%, rgba(255, 215, 0, 0.05), transparent 25%);
    color: var(--text-main); 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    min-height: 100vh; 
    overflow: hidden; 
}

/* Scrollbars nativos hermosos */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }

/* Wrapper responsivo (En PC se ve como un marco de app, en móvil ocupa todo) */
.web-wrapper { 
    width: 100%; 
    max-width: 480px; 
    height: 100vh; 
    position: relative; 
    background: radial-gradient(circle at top right, #1a2235, #0B0F19); 
    box-shadow: var(--shadow-glow); 
    overflow: hidden; 
    display: flex; 
    flex-direction: column;
}

@media (min-width: 600px) {
    .web-wrapper {
        height: 90vh;
        border-radius: 32px;
        border: 1px solid rgba(255,255,255,0.1);
        box-shadow: 0 25px 60px rgba(0,0,0,0.8), 0 0 20px rgba(0, 122, 255, 0.15);
    }
}

.hidden { display: none !important; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.text-center { text-align: center; }

.screen { width: 100%; height: 100%; position: absolute; top: 0; left: 0; display: flex; flex-direction: column; z-index: 1; }

.login-box { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 40px 32px; }
.brand-header { text-align: center; margin-bottom: 40px; }
.main-logo { width: 140px; height: 140px; border-radius: 50%; border: 3px solid var(--accent-gold); box-shadow: 0 0 25px rgba(255, 215, 0, 0.25); margin-bottom: 20px; object-fit: cover; }
.brand-header h1 { font-size: 26px; font-weight: 800; letter-spacing: 2px; background: linear-gradient(45deg, #FFF, var(--accent-gold)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.input-wrapper { position: relative; margin-bottom: 20px; }
.input-icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--primary); font-size: 18px; z-index: 5; pointer-events: none; }
.toggle-password { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--text-muted); cursor: pointer; padding: 10px; z-index: 10; font-size: 18px; transition: color 0.3s; }
.toggle-password:hover { color: var(--primary); }
.input-wrapper input { width: 100%; background: var(--bg-glass); border: 1px solid var(--border-glass); padding: 16px 48px; border-radius: 16px; color: var(--text-main); font-size: 16px; backdrop-filter: blur(15px); transition: all 0.3s ease; }
.input-wrapper input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 15px rgba(0, 122, 255, 0.3); background: rgba(26, 32, 53, 0.9); }

.custom-textarea { width:100%; background:var(--bg-glass); border:1px solid var(--border-glass); padding:16px; border-radius:16px; color:white; font-size:15px; resize:none; font-family: inherit; transition: all 0.3s ease; backdrop-filter: blur(10px); }
.custom-textarea:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 15px rgba(0, 122, 255, 0.3); background: rgba(26, 32, 53, 0.9); }

.btn-primary { width: 100%; background: linear-gradient(135deg, var(--primary), #0047FF); color: white; border: none; padding: 16px; border-radius: 16px; font-size: 15px; font-weight: bold; letter-spacing: 1px; cursor: pointer; transition: all 0.3s ease; box-shadow: 0 4px 15px rgba(0, 122, 255, 0.3); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0, 122, 255, 0.5); }
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-small { width: auto; padding: 8px 16px; font-size: 12px; border-radius: 12px; }

.error-text { color: var(--accent-red); text-align: center; margin-top: 12px; font-size: 14px; min-height: 20px; font-weight: 600; }

.sponsor-footer { margin-top: auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.sponsor-footer span { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1.5px; }
.sponsor-logo { height: 35px; object-fit: contain; opacity: 0.7; transition: 0.3s; }
.sponsor-logo:hover { opacity: 1; transform: scale(1.05); }

.app-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; background: rgba(11, 15, 25, 0.85); backdrop-filter: blur(15px); border-bottom: 1px solid var(--border-glass); z-index: 10; }
.user-profile-header { display: flex; align-items: center; gap: 12px; cursor: pointer; transition: 0.2s; }
.user-profile-header:hover { opacity: 0.8; }
.avatar-small { width: 44px; height: 44px; border-radius: 50%; background: var(--primary); display: flex; justify-content: center; align-items: center; overflow: hidden; border: 2px solid var(--border-glass); flex-shrink: 0; }
.avatar-small img, .avatar-large img { width: 100%; height: 100%; object-fit: cover; }
.avatar-small i, .avatar-large i { color: white; }
.user-info { display: flex; flex-direction: column; }
.greeting { font-size: 12px; color: var(--text-muted); }
.name { font-size: 15px; font-weight: bold; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.btn-icon { background: rgba(255,255,255,0.05); border: 1px solid var(--border-glass); color: var(--text-main); font-size: 16px; width: 38px; height: 38px; border-radius: 50%; cursor: pointer; transition: all 0.3s ease; display: flex; justify-content: center; align-items: center; }
.btn-icon:hover { background: rgba(255,255,255,0.1); color: var(--primary); transform: translateY(-2px); }

.scrollable-content { flex: 1; overflow-y: auto; padding: 20px; padding-bottom: 100px; scroll-behavior: smooth; }
.view { display: none; animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }

.dash-logo-container { display: flex; justify-content: center; align-items: center; margin-bottom: 20px; margin-top: 4px; }
.dash-center-logo { width: 90px; height: 90px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.1); object-fit: cover; box-shadow: 0 4px 20px rgba(0,0,0,0.4); }

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.glass-card { background: var(--bg-glass); border: 1px solid var(--border-glass); border-radius: 24px; padding: 20px; position: relative; overflow: hidden; backdrop-filter: blur(15px); box-shadow: 0 8px 32px rgba(0,0,0,0.2); }
.glass-card .bg-icon { position: absolute; right: -15px; bottom: -15px; font-size: 85px; opacity: 0.08; transition: 0.3s; }
.glass-card:hover .bg-icon { transform: scale(1.1); opacity: 0.12; }
.glass-card h2 { font-size: 30px; margin-bottom: 4px; position: relative; z-index: 1; font-weight: 800; }
.glass-card p { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; position: relative; z-index: 1; color: var(--text-muted); }
.glass-card.blue h2 { color: var(--primary); }
.glass-card.green h2 { color: var(--accent-green); }
.glass-card.red h2 { color: var(--accent-red); }
.glass-card.cyan h2 { color: var(--accent-cyan); }
.glass-card.gold { border-color: rgba(255, 215, 0, 0.25); background: linear-gradient(135deg, rgba(255, 215, 0, 0.05), rgba(0,0,0,0.4)); }

.interactive-card { cursor: pointer; transition: all 0.3s ease; }
.interactive-card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(255, 215, 0, 0.15); }

.section-title { color: var(--accent-gold); font-size: 13px; font-weight: bold; letter-spacing: 1.5px; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; text-transform: uppercase; }

.list-item { display: flex; align-items: center; padding: 14px; background: rgba(255,255,255,0.03); border-radius: 18px; margin-bottom: 12px; border: 1px solid transparent; transition: all 0.3s ease; }
.interactive-item { cursor: pointer; }
.interactive-item:hover, .list-item[onclick]:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.1); transform: translateX(4px); }
.list-item .avatar-small { margin-right: 16px; width: 50px; height: 50px; border-width: 2px; }
.item-details { flex: 1; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.item-title { font-size: 15px; font-weight: bold; margin-bottom: 4px; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-subtitle { font-size: 12px; font-weight: bold; letter-spacing: 0.5px; }

.search-box { position: relative; margin-bottom: 20px; }
.search-box input { width: 100%; background: rgba(0,0,0,0.3); border: 1px solid rgba(0, 122, 255, 0.4); padding: 16px 16px 16px 48px; border-radius: 16px; color: white; font-size: 15px; transition: 0.3s; }
.search-box input:focus { background: rgba(0,0,0,0.5); border-color: var(--primary); box-shadow: 0 0 15px rgba(0, 122, 255, 0.2); outline: none; }

.glass-nav { position: absolute; bottom: 0; left: 0; width: 100%; height: 75px; background: rgba(11, 15, 25, 0.85); backdrop-filter: blur(20px); display: flex; justify-content: space-around; align-items: center; border-top: 1px solid rgba(255,255,255,0.05); z-index: 20; padding-bottom: env(safe-area-inset-bottom, 10px); }
.nav-item { background: transparent; border: none; display: flex; flex-direction: column; align-items: center; gap: 6px; color: #5C6B82; flex: 1; cursor: pointer; transition: all 0.3s ease; padding-top: 10px; }
.nav-item i { font-size: 22px; transition: all 0.3s ease; }
.nav-item span { font-size: 10px; font-weight: 600; transition: 0.3s; }
.nav-item:hover { color: #8E9BAE; }
.nav-item.active { color: var(--primary); }
.nav-item.active i { transform: translateY(-5px); filter: drop-shadow(0 0 10px rgba(0, 122, 255, 0.8)); }
.nav-item.active span { transform: translateY(-2px); color: white; }

.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); backdrop-filter: blur(8px); display: flex; justify-content: center; align-items: center; z-index: 1000; opacity: 1; transition: opacity 0.3s ease; }
.modal.hidden { opacity: 0; pointer-events: none; }
.modal-glass { background: var(--bg-base); border: 1px solid rgba(0, 122, 255, 0.3); border-radius: 32px; padding: 32px; width: 88%; max-width: 380px; display: flex; flex-direction: column; align-items: center; box-shadow: 0 25px 60px rgba(0,0,0,0.8), inset 0 0 40px rgba(255,255,255,0.02); transform: scale(1); transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.modal.hidden .modal-glass { transform: scale(0.9); }
.avatar-large { width: 110px; height: 110px; border-radius: 50%; background: rgba(0,0,0,0.5); display: flex; justify-content: center; align-items: center; font-size: 45px; border: 3px solid var(--primary); overflow: hidden; margin-bottom: 20px; box-shadow: 0 10px 25px rgba(0, 122, 255, 0.3); }
.gradient-text { background: linear-gradient(to right, #FFF, #A0A0A5); -webkit-background-clip: text; -webkit-text-fill-color: transparent; text-align: center; margin-bottom: 8px; font-size: 24px; font-weight: 800; }
.badge { background: rgba(0, 122, 255, 0.15); color: var(--primary); padding: 6px 16px; border-radius: 20px; font-size: 12px; font-weight: bold; border: 1px solid rgba(0, 122, 255, 0.4); text-transform: uppercase; letter-spacing: 1px; }

.info-grid { width: 100%; display: flex; flex-direction: column; gap: 12px; }
.info-item { display: flex; align-items: center; gap: 16px; background: rgba(255,255,255,0.03); padding: 14px 16px; border-radius: 18px; border: 1px solid rgba(255,255,255,0.02); }
.info-item i { font-size: 20px; color: var(--primary); width: 24px; text-align: center; }
.info-item div { display: flex; flex-direction: column; }
.info-item .label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; margin-bottom: 2px; font-weight: bold; }
.info-item .value { font-size: 14px; font-weight: 600; color: white; }

.fab { position: fixed; bottom: 95px; right: 20px; width: 60px; height: 60px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), #0047FF); color: white; border: none; font-size: 24px; box-shadow: 0 8px 25px rgba(0,122,255,0.6); cursor: pointer; z-index: 50; display: flex; justify-content: center; align-items: center; transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.fab:hover { transform: scale(1.1) rotate(90deg); }
.fab:active { transform: scale(0.9); }

.form-select { width: 100%; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1); padding: 16px; border-radius: 16px; color: var(--text-main); font-size: 15px; margin-bottom: 16px; transition: 0.3s; appearance: none; }
.form-select:focus { border-color: var(--primary); outline: none; }
.form-select option { background: var(--bg-base); color: white; }

.att-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: rgba(255,255,255,0.02); border-radius: 18px; margin-bottom: 10px; border: 1px solid rgba(255,255,255,0.05); }
.att-name { font-size: 14px; font-weight: bold; flex: 1; }
.att-btns { display: flex; gap: 6px; }
.att-btn { padding: 10px 14px; border-radius: 10px; border: none; font-weight: bold; cursor: pointer; transition: all 0.2s; font-size: 13px; }
.att-btn:hover { transform: translateY(-2px); }
.btn-p { background: rgba(0,230,118,0.1); color: var(--accent-green); }
.btn-a { background: rgba(255,59,48,0.1); color: var(--accent-red); }
.btn-l { background: rgba(255,215,0,0.1); color: var(--accent-gold); }
.btn-p.active { background: var(--accent-green); color: black; box-shadow: 0 0 15px rgba(0,230,118,0.4); }
.btn-a.active { background: var(--accent-red); color: white; box-shadow: 0 0 15px rgba(255,59,48,0.4); }
.btn-l.active { background: var(--accent-gold); color: black; box-shadow: 0 0 15px rgba(255,215,0,0.4); }

.report-table { width: 100%; border-collapse: collapse; min-width: 700px; font-size: 13px; background: rgba(0,0,0,0.2); }
.report-table th, .report-table td { padding: 12px 10px; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.05); }
.report-table th { background: rgba(0,122,255,0.15); color: var(--primary); font-weight: bold; text-transform: uppercase; letter-spacing: 1px; font-size: 11px; }
.pay-btn { background: rgba(0,230,118,0.15); color: var(--accent-green); padding: 8px 16px; border: 1px solid rgba(0,230,118,0.3); border-radius: 10px; font-weight: bold; cursor: pointer; transition: 0.3s; }
.pay-btn:hover { background: var(--accent-green); color: black; box-shadow: 0 0 15px rgba(0,230,118,0.4); }
.status-paid { color: var(--accent-green); font-weight: bold; }
.status-debt { color: var(--accent-red); font-weight: bold; }

.horizontal-scroll-container { display: flex; gap: 16px; overflow-x: auto; padding: 10px 4px; width: 100%; scroll-snap-type: x mandatory; }
.scroll-avatar-item { display: flex; flex-direction: column; align-items: center; min-width: 65px; text-align: center; cursor: pointer; transition: transform 0.2s; scroll-snap-align: start; }
.scroll-avatar-item:hover { transform: scale(1.1); }
.avatar-border-status { padding: 3px; border-radius: 50%; border: 2.5px solid transparent; display: flex; justify-content: center; align-items: center; }
.scroll-avatar-item span { font-size: 11px; font-weight: bold; margin-top: 6px; color: var(--text-main); max-width: 65px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.debt-tag-wrap { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.debt-tag { padding: 4px 10px; border-radius: 8px; background: rgba(255, 59, 48, 0.1); border: 1px solid rgba(255, 59, 48, 0.3); color: var(--accent-red); font-size: 11px; font-weight: bold; }