:root { 
    /* TEMA STARTUP FINTECH */
    --bg: #f3f4f6;
    --sidebar: #ffffff; 
    --sidebar-text: #4b5563;
    --primary: #4f46e5; 
    --primary-hover: #4338ca;
    --primary-light: #e0e7ff;
    --success: #10b981; 
    --danger: #ef4444; 
    --warning: #f59e0b; 
    --text-main: #111827; 
    --text-muted: #6b7280;
    --border: #e5e7eb;
}
body { font-family: 'Inter', sans-serif; background: var(--bg); margin: 0;
    display: flex; color: var(--text-main); height: 100vh; overflow: hidden;
}

#splash-screen { position: fixed;
    top: 0; left: 0; width: 100%; height: 100%; background: #ffffff; z-index: 10002; display: none; flex-direction: column;
    align-items: center; justify-content: center;
}
@keyframes fadeGota { 
    0% { opacity: 0; transform: translateY(10px); filter: blur(2px); } 
    40% { opacity: 0.7; transform: translateY(0); filter: blur(0); } 
    80% { opacity: 0.7; transform: translateY(0); filter: blur(0); } 
    100% { opacity: 0; transform: translateY(-10px); filter: blur(2px); } 
}
.gota-agua { color: var(--primary); font-weight: 600; letter-spacing: 4px; font-size: 24px; text-transform: uppercase; opacity: 0; animation: fadeGota 2.5s ease-in-out forwards; }

#pantalla-login { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 9999; display: flex; background-color: var(--bg); }
.login-cover {
    flex: 1.2; background: linear-gradient(135deg, var(--primary) 0%, #1e1b4b 100%); display: flex; flex-direction: column; align-items: center; justify-content: center; color: white; padding: 40px; text-align: center; position: relative; overflow: hidden;
}
.login-cover::before {
    content: ''; position: absolute; width: 150%; height: 150%; background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%); top: -25%; left: -25%; pointer-events: none;
}
.login-form-container { width: 450px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--bg); position: relative; }
.login-box { 
    background: white; padding: 50px 40px; border-radius: 16px; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); text-align: center; color: var(--text-main); width: 340px; border: 1px solid var(--border); z-index: 10;
}
.login-box input, .login-box select { width: 100%; padding: 12px; margin: 10px 0; border: 1px solid var(--border); border-radius: 8px; font-family: 'Inter'; font-size: 15px; box-sizing: border-box; text-align: center; transition: 0.2s; background: #f9fafb; }
.login-box input:focus, .login-box select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15); outline: none; background: white; }
.login-box button { width: 100%; padding: 12px; background: var(--primary); color: white; border: none; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; margin-top: 10px; transition: 0.2s; }
.login-box button:hover { background: var(--primary-hover); transform: translateY(-1px); }

#pantalla-licencia { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(17, 24, 39, 0.95); z-index: 10000; display: none; flex-direction: column; align-items: center; justify-content: center; color: white; }
.licencia-box { background: #fee2e2; padding: 40px; border-radius: 16px; box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1); text-align: center; color: var(--text-main); width: 350px; border: 1px solid #fca5a5; }

#app-completa { display: none; width: 100%; height: 100%; } 

.sidebar { width: 260px; background: var(--sidebar); color: var(--sidebar-text); display: flex; flex-direction: column; height: 100%; border-right: 1px solid var(--border); z-index: 10005; }
.sidebar-header { padding: 25px 20px; text-align: center; border-bottom: 1px solid var(--border); position: relative; }
.nav-item { padding: 14px 20px; margin: 4px 12px; border-radius: 8px; color: var(--sidebar-text); cursor: pointer; transition: 0.2s; display: flex; align-items: center; gap: 12px; font-weight: 500; font-size: 14px; }
.nav-item:hover { background: #f3f4f6; color: var(--text-main); }
.nav-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }

.main { flex: 1; padding: 30px; overflow-y: auto; height: 100%; box-sizing: border-box; scroll-behavior: smooth; background-color: #f3f4f6; background-image: radial-gradient(at 0% 0%, rgba(79, 70, 229, 0.08) 0px, transparent 50%), radial-gradient(at 100% 0%, rgba(16, 185, 129, 0.06) 0px, transparent 50%); background-attachment: fixed; }

.section { background: white; padding: 30px; border-radius: 16px; border: 1px solid rgba(255,255,255,0.5); box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025); display: none; margin-bottom: 20px; }
.section.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

h2 { margin-top: 0; color: var(--text-main); border-bottom: 1px solid var(--border); padding-bottom: 12px; font-weight: 700; letter-spacing: -0.5px; font-size: 20px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
input, select, textarea { padding: 12px; border: 1px solid var(--border); border-radius: 8px; font-family: 'Inter'; font-size: 14px; outline: none; box-sizing: border-box; background: #f9fafb; transition: all 0.2s ease; color: var(--text-main); }
input:focus, select:focus, textarea:focus { border-color: var(--primary); background: white; box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15); }
input:disabled, select:disabled { background-color: #f3f4f6; color: #9ca3af; cursor: not-allowed; border-color: var(--border); }
input[readonly] { background-color: #f3f4f6; color: var(--text-muted); cursor: not-allowed; }

.btn { padding: 12px 18px; border: none; border-radius: 8px; font-weight: 600; cursor: pointer; color: var(--text-main); display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: 0.2s; font-family: 'Inter'; font-size: 14px; background: white; border: 1px solid var(--border); box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.btn:hover { background: #f9fafb; border-color: #d1d5db; }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--primary); color: white; border: none; }
.btn-primary:hover { background: var(--primary-hover); border: none; color: white; box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3); }
.btn-green { background: var(--success); color: white; border: none; }
.btn-green:hover { background: #059669; color: white;}
.btn-red { background: var(--danger); color: white; border: none; }
.btn-red:hover { background: #dc2626; color: white;}
.btn-warning { background: var(--warning); color: white; border: none; }
.btn-warning:hover { background: #d97706; color: white;}
.btn-dark { background: var(--text-main); color: white; border: none; }
.btn-dark:hover { background: #1f2937; color: white;}
.btn-wa { background: #10b981; color: white; text-decoration: none; padding: 10px 12px; border-radius: 8px; font-size: 13px; display: inline-flex; align-items: center; gap: 5px; font-weight: 500; transition: 0.2s; border: none; box-shadow: none; }
.btn-wa:hover { opacity: 0.9; color: white; }
.btn-action { padding: 8px; font-size: 13px; box-shadow: none; }

.preview-box { background: var(--primary-light); border: 1px solid rgba(79, 70, 229, 0.2); padding: 20px; border-radius: 8px; grid-column: span 2; color: var(--primary); font-weight: 500; text-align: center; }

.tabla-encapsulada { max-height: 480px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; background: white; margin-top: 15px; }
.tabla-encapsulada table { margin-top: 0; width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tabla-encapsulada thead th { position: sticky; top: 0; z-index: 10; background: #f9fafb; box-shadow: 0 1px 0 var(--border); }

table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
th { background: #f9fafb; padding: 14px 15px; text-align: left; color: var(--text-muted); font-weight: 600; text-transform: uppercase; font-size: 11px; border-bottom: 1px solid var(--border); border-top: 1px solid var(--border); letter-spacing: 0.5px; }
th:first-child { border-left: 1px solid var(--border); border-top-left-radius: 8px; border-bottom-left-radius: 8px; }
th:last-child { border-right: 1px solid var(--border); border-top-right-radius: 8px; border-bottom-right-radius: 8px; }
td { padding: 16px 15px; border-bottom: 1px solid #f3f4f6; color: var(--text-main); vertical-align: middle; transition: background-color 0.2s ease; }
tr:hover td { background: #f9fafb; }
.badge { padding: 4px 10px; border-radius: 9999px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; background: #f3f4f6; color: var(--text-muted); display: inline-block; }

.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 25px; }
.dash-card { background: white; padding: 25px; border-radius: 16px; border: 1px solid rgba(255,255,255,0.5); display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; transition: transform 0.2s ease, box-shadow 0.2s ease; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); }
.dash-card:hover { transform: translateY(-2px); box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08); }
.dash-title { margin:0; font-size: 12px; color: var(--text-muted); text-transform: uppercase; font-weight: 600; letter-spacing: 0.5px; display: flex; align-items: center; gap: 8px;}
.dash-value { margin:12px 0 0 0; font-size: 32px; font-weight: 700; color: var(--text-main); letter-spacing: -1px; }
.caja-grid { display: grid; grid-template-columns: 1fr; gap: 20px; margin-bottom: 30px; }

.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(17, 24, 39, 0.7); align-items: center; justify-content: center; z-index: 10000; backdrop-filter: blur(4px); }
.modal-content { background: white; padding: 30px; border-radius: 16px; width: 480px; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); border: 1px solid var(--border); }
#reciboGenerado { background: white; padding: 20px; border: 1px solid var(--border); margin-top: 15px; border-radius: 8px; display: none; font-family: monospace; color: black; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.r-header { text-align: center; border-bottom: 1px dashed black; padding-bottom: 10px; margin-bottom: 10px; }
.r-row { display: flex; justify-content: space-between; margin-bottom: 5px; font-size: 14px; }

.menu-toggle { display: none; background: none; border: none; font-size: 24px; color: var(--text-main); cursor: pointer; padding: 0; margin-right: 15px; }

@media (max-width: 1024px) {
    .dash-grid { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 768px) {
    .menu-toggle { display: inline-block; }
    .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform 0.3s ease; box-shadow: 5px 0 15px rgba(0,0,0,0.1); }
    .sidebar.open { transform: translateX(0); }
    .main { padding: 15px; width: 100%; overflow-x: hidden;}
    .form-grid { grid-template-columns: 1fr !important; }
    .dash-grid { grid-template-columns: 1fr !important; }
    .caja-grid { grid-template-columns: 1fr !important; }
    .login-box { width: 90%; padding: 30px 20px; }
    .modal-content { width: 95%; padding: 20px; }

    table { border: 0; }
    table thead { display: none; }
    table tr { display: block; margin-bottom: 15px; border: 1px solid var(--border); border-radius: 12px; background: white; padding: 12px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
    table td { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #f3f4f6; padding: 10px 5px; text-align: right; }
    table td:last-child { border-bottom: 0; justify-content: flex-end; }
    table td::before { content: attr(data-label); font-weight: 700; color: var(--text-muted); text-transform: uppercase; font-size: 11px; text-align: left; margin-right: 15px; flex-shrink: 0; }
}

.avatar-img { width: 65px; height: 65px; border-radius: 50%; object-fit: cover; border: 2px solid var(--primary); }
.expediente-foto { width: 180px; height: 180px; border-radius: 12px; object-fit: cover; border: 3px solid var(--primary); margin-bottom: 10px; box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); }