/* Default: Cyberpunk */
:root {
    --bg-dark: #050505;
    --bg-gradient: linear-gradient(180deg, #050505 0%, #1a1a2e 100%);
    --accent-primary: #00f2fe; /* Cyan */
    --accent-secondary: #bf00ff; /* Purple/Rose */
    --text-main: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.6);
    --glass: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.12);
}

/* Theme: Carbon (Masculino) */
[data-theme="carbon"] {
    --bg-dark: #0a0a0a;
    --bg-gradient: linear-gradient(180deg, #0a0a0a 0%, #222222 100%);
    --accent-primary: #00ff88; /* Emerald Green */
    --accent-secondary: #ff8800; /* Burned Orange */
    --text-main: #e0e0e0;
    --text-muted: rgba(224, 224, 224, 0.6);
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(0, 255, 136, 0.2);
}

/* Theme: Rose Quartz (Femenino) */
[data-theme="rose"] {
    --bg-dark: #1a0f14;
    --bg-gradient: linear-gradient(180deg, #1a0f14 0%, #3d2b33 100%);
    --accent-primary: #ffc2d1; /* Soft Pink */
    --accent-secondary: #e5989b; /* Rose Gold */
    --text-main: #ffe5ec;
    --text-muted: rgba(255, 229, 236, 0.6);
    --glass: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 194, 209, 0.3);
}

/* Theme: Aurora (Femenino) */
[data-theme="aurora"] {
    --bg-dark: #0f172a;
    --bg-gradient: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    --accent-primary: #a7f3d0; /* Mint Green */
    --accent-secondary: #c4b5fd; /* Lavender */
    --text-main: #f1f5f9;
    --text-muted: rgba(241, 245, 249, 0.6);
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(167, 243, 208, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

html {
    background-color: var(--bg-dark);
}

body {
    background: var(--bg-dark);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    color: var(--text-main);
    overflow-x: hidden;
    transition: background 0.5s ease;
}

/* App Container (Mobile First) */
.app-container {
    width: 100%;
    max-width: 500px;
    min-height: 100vh;
    background: var(--bg-gradient);
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 100px rgba(0, 0, 0, 0.5);
    transition: background 0.5s ease;
}

/* Header */
header {
    padding: 40px 24px 16px;
    text-align: center;
}

h1 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-top: 10px;
    animation: breatheTextGlow 4s infinite ease-in-out;
}

@keyframes breatheTextGlow {
    0% { filter: drop-shadow(0 0 2px var(--accent-primary)); }
    50% { filter: drop-shadow(0 0 12px var(--accent-primary)); }
    100% { filter: drop-shadow(0 0 2px var(--accent-primary)); }
}

@keyframes breatheGlow {
    0% { box-shadow: 0 0 4px var(--glass-border); border-color: var(--glass-border); }
    50% { box-shadow: 0 0 20px var(--accent-primary), inset 0 0 8px rgba(255,255,255,0.03); border-color: var(--accent-primary); }
    100% { box-shadow: 0 0 4px var(--glass-border); border-color: var(--glass-border); }
}

.subtitle {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    color: var(--accent-primary);
    letter-spacing: 2px;
    margin-top: 4px;
    opacity: 0.8;
}

/* Main Content */
main {
    flex: 1;
    padding: 0 20px;
    overflow-y: auto;
    padding-bottom: 100px;
}

/* Hide Scrollbar */
main::-webkit-scrollbar {
    display: none;
}

.card {
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.4s ease;
    animation: breatheGlow 5s infinite ease-in-out;
}

.card:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

h2 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 1px;
}

/* Buttons */
.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-primary);
    border: none;
    color: #000;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-primary {
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    color: #000;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    text-transform: uppercase;
    animation: breatheGlow 3s infinite ease-in-out;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    filter: brightness(1.2);
    transform: scale(1.02);
}

/* Item List */
.item-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 14px;
    border-left: 3px solid var(--accent-secondary);
}

.item.deposit {
    border-left-color: var(--accent-primary);
}

.item-info h4 {
    font-size: 16px;
    font-weight: 600;
}

.item-info span {
    font-size: 12px;
    color: var(--text-muted);
}

.item-amount {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    color: var(--accent-primary);
}

/* Optimization Schedule */
.schedule-view {
    font-size: 13px;
    color: var(--text-muted);
}

.match-pair {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px;
    background: rgba(0, 242, 254, 0.05);
    border-radius: 12px;
}

.match-arrow {
    color: var(--accent-cyan);
}

/* Tab Bar */
.tab-bar {
    height: 70px;
    background: transparent;
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: sticky;
    bottom: 0;
    width: 100%;
    border-top: none;
    padding-bottom: env(safe-area-inset-bottom, 10px);
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 600;
    gap: 4px;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.tab-item:active {
    transform: scale(0.9);
    opacity: 0.8;
}

.tab-item.active {
    color: var(--accent-primary);
    text-shadow: 0 0 12px var(--accent-primary);
}

select {
    width: 100%;
    background: rgba(0, 0, 0, 0.60) !important;
    border: 1px solid var(--glass-border);
    padding: 12px;
    border-radius: 12px;
    color: var(--text-main) !important;
    outline: none;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    -webkit-appearance: none;
    appearance: none;
}

select option {
    background-color: #0d0d0d;
    color: #fff;
}

/* View Management */
.view {
    animation: fadeIn 0.4s ease;
}

.hidden {
    display: none !important;
}

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

/* Year Grid */
.year-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    padding-top: 10px;
}

.month-container {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 15px;
    border: 1px solid var(--glass-border);
}

.month-name {
    font-size: 14px;
    font-weight: 800;
    color: var(--accent-primary);
    margin-bottom: 10px;
    text-transform: uppercase;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    font-size: 10px;
    text-align: center;
}

.day {
    padding: 5px 0;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.day:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.day.has-payment {
    background: var(--accent-secondary);
    color: #fff;
    font-weight: 800;
}

.day.withdrawal-day {
    border: 1px solid var(--accent-primary);
    box-shadow: 0 0 10px var(--accent-primary);
}

/* Indicador de punto para días de retiro */
.day.withdrawal-day::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--accent-primary);
    border-radius: 50%;
    box-shadow: 0 0 5px var(--accent-primary);
}

/* Toast Styles */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    width: 90%;
    max-width: 400px;
    animation: slideUp 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

.toast-content {
    padding: 20px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 1px var(--accent-primary);
}

.toast-header {
    font-weight: 800;
    color: var(--accent-primary);
    margin-bottom: 8px;
    font-size: 14px;
}

.toast-body {
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-main);
}

.toast-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
}

/* Settings */
.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--glass-border);
}

.theme-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 15px;
    width: 100%;
}

.btn-theme {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
}

.btn-theme.active {
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.1);
}

.item-name {
    font-weight: 700;
    color: var(--accent-primary);
}

.delete-btn {
    width: 24px;
    height: 24px;
    background: rgba(255, 51, 51, 0.2);
    color: #ff3333;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.delete-btn:hover {
    background: #ff3333;
    color: #fff;
    transform: scale(1.1);
}

/* Modal specific field handling */
.hidden {
    display: none !important;
}

/* Modals */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.hidden {
    display: none !important;
}

.modal {
    width: 340px;
    padding: 30px;
    border-radius: 30px;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.80);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    animation: slideUp 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

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

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 10px;
    color: var(--accent-primary);
    margin-bottom: 8px;
    font-weight: 700;
    letter-spacing: 1px;
}

.input-group input {
    width: 100%;
    background: rgba(0, 0, 0, 0.55) !important;
    border: 1px solid var(--glass-border);
    padding: 12px;
    border-radius: 12px;
    color: var(--text-main) !important;
    outline: none;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
}

.input-group input:focus {
    border-color: var(--accent-primary);
}

.modal-actions {
    display: flex;
    gap: 15px;
}

.btn-secondary {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: transparent;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

/* Custom Scrollbar for Main */
main::-webkit-scrollbar {
    width: 4px;
}
main::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 2px;
}

/* ============================================
   AUTH OVERLAY
   ============================================ */
.auth-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
    padding: 24px;
    animation: fadeIn 0.4s ease;
}

.auth-overlay.hidden {
    display: none !important;
}

.auth-card {
    width: 100%;
    max-width: 380px;
    padding: 40px 32px;
    border-radius: 32px;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    animation: slideUp 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    display: flex;
    flex-direction: column;
    gap: 0;
}

.auth-card h1 {
    text-align: center;
    font-size: 36px;
    margin-bottom: 4px;
    margin-top: 0;
}

.auth-subtitle {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 28px;
    letter-spacing: 0.5px;
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 24px;
    background: rgba(255,255,255,0.04);
    border-radius: 14px;
    padding: 4px;
}

.auth-tab {
    padding: 10px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
}

.auth-tab.active {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--accent-primary);
    text-shadow: 0 0 8px var(--accent-primary);
}

.btn-auth-submit {
    width: 100%;
    padding: 14px;
    font-size: 13px;
    border-radius: 14px;
    margin-top: 8px;
    letter-spacing: 1px;
    transition: opacity 0.2s ease, transform 0.1s ease;
}

.btn-auth-submit:active {
    transform: scale(0.97);
    opacity: 0.85;
}

.btn-auth-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.auth-message {
    margin-top: 14px;
    font-size: 12px;
    text-align: center;
    min-height: 18px;
    color: var(--text-muted);
    line-height: 1.4;
}

.auth-message.error   { color: #ff5555; }
.auth-message.success { color: #00ff88; }
.auth-message.warn    { color: #ffaa00; }

/* ============================================
   USER INFO EN HEADER
   ============================================ */
header {
    padding: 40px 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 6px 14px;
    animation: fadeIn 0.3s ease;
}

.user-info.hidden {
    display: none !important;
}

.user-email {
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'Space Mono', monospace;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-logout {
    background: none;
    border: 1px solid rgba(255, 51, 51, 0.4);
    color: #ff5555;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
}

.btn-logout:hover {
    background: rgba(255, 51, 51, 0.15);
    border-color: #ff5555;
}

.placeholder-text {
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    padding: 10px 0;
}

/* ============================================
   ADMIN PANEL STYLES
   ============================================ */
.admin-header-card {
    border-color: rgba(255, 170, 0, 0.3) !important;
    box-shadow: 0 0 20px rgba(255, 170, 0, 0.08) !important;
}

.admin-title-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.admin-crown {
    font-size: 28px;
    filter: drop-shadow(0 0 8px rgba(255, 170, 0, 0.6));
}

.admin-subtitle-text {
    font-size: 11px;
    color: rgba(255, 170, 0, 0.7);
    margin-top: 3px;
    font-family: 'Space Mono', monospace;
    letter-spacing: 0.3px;
}

/* Stats Grid */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.admin-stat-card {
    background: rgba(255, 170, 0, 0.06);
    border: 1px solid rgba(255, 170, 0, 0.2);
    border-radius: 16px;
    padding: 14px 10px;
    text-align: center;
    transition: all 0.3s ease;
}

.admin-stat-card:hover {
    background: rgba(255, 170, 0, 0.12);
    transform: translateY(-2px);
}

.admin-stat-value {
    font-family: 'Space Mono', monospace;
    font-size: 26px;
    font-weight: 700;
    color: #ffaa00;
    text-shadow: 0 0 12px rgba(255, 170, 0, 0.5);
    line-height: 1;
    margin-bottom: 6px;
}

.admin-stat-label {
    font-size: 9px;
    font-weight: 700;
    color: rgba(255, 170, 0, 0.6);
    letter-spacing: 1.5px;
}

/* User List */
.admin-user-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-user-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    transition: all 0.2s ease;
    animation: fadeIn 0.3s ease;
}

.admin-user-row:hover {
    background: rgba(255, 170, 0, 0.05);
    border-color: rgba(255, 170, 0, 0.2);
}

.admin-user-main {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.admin-user-badge {
    font-size: 18px;
    flex-shrink: 0;
}

.admin-user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.admin-user-email {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 190px;
}

.admin-user-meta {
    font-size: 10px;
    color: var(--text-muted);
    font-family: 'Space Mono', monospace;
}

.admin-user-counters {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.admin-counter {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 8px;
}

.admin-counter.pay {
    background: rgba(191, 0, 255, 0.15);
    color: var(--accent-secondary);
}

.admin-counter.dep {
    background: rgba(0, 242, 254, 0.1);
    color: var(--accent-primary);
}

.admin-clear-btn {
    background: rgba(255, 51, 51, 0.12);
    border: 1px solid rgba(255, 51, 51, 0.3);
    color: #ff5555;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.admin-clear-btn:hover {
    background: rgba(255, 51, 51, 0.25);
    transform: scale(1.1);
}

.admin-clear-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Admin tab glow cuando activo */
#tab-admin.active {
    color: #ffaa00 !important;
    text-shadow: 0 0 12px rgba(255, 170, 0, 0.7) !important;
}

/* ============================================
   [Nivel 7] APP LOCK / FACE ID MOCK
   ============================================ */
.app-lock {
    position: fixed;
    inset: 0;
    background: var(--bg-dark);
    z-index: 10000; /* Por encima de todo */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.lock-content {
    width: 100%;
    max-width: 320px;
    padding: 40px;
    border-radius: 40px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.biometric-icon {
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--accent-primary);
    border-radius: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 50px;
    position: relative;
    overflow: hidden;
    margin-bottom: 10px;
}

.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-primary);
    box-shadow: 0 0 15px var(--accent-primary);
    animation: scanLine 2s infinite ease-in-out;
}

@keyframes scanLine {
    0% { top: 0; opacity: 0; }
    50% { top: 100%; opacity: 1; }
    100% { top: 0; opacity: 0; }
}

#btn-unlock {
    width: 100%;
    margin-top: 10px;
    padding: 15px;
    font-size: 14px;
}


