/* css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #1E40AF;
    --primary-dark: #1E3A8A;
    --primary-light: #3B82F6;
    --secondary: #1E293B;
    --secondary-dark: #0F172A;
    --accent: #60A5FA;
    --accent-dark: #2563EB;
    --dark: #0F172A;
    --dark-light: #1E293B;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    --white: #FFFFFF;
    --black: #000000;
    --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    --gradient-dark: linear-gradient(135deg, var(--dark) 0%, var(--dark-light) 100%);
    
    --bg-color: var(--dark);
    --surface-color: rgba(30, 41, 59, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-main: var(--gray-100);
    --text-muted: var(--gray-400);
    --glass-blur: blur(20px);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(30, 64, 175, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(96, 165, 250, 0.1), transparent 25%);
}

/* Page Specific Bodies */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
}

.dashboard-body {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 3rem 1rem;
}


/* ====================================
   LOGIN COMPONENT
   ==================================== */
.login-container {
    background: var(--surface-color);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    padding: 3.5rem 2.5rem;
    border-radius: 24px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.logo-main {
    max-width: 200px;
    height: auto;
    margin-bottom: 1.5rem;
    filter: brightness(0) invert(1); /* Forces it to be white if it's the black logo */
}

.login-header h1 {
    font-weight: 700;
    font-size: 1.8rem;
    letter-spacing: -0.5px;
    margin-bottom: 0.5rem;
    color: var(--white);
}

.login-header h1 span {
    color: var(--primary-light);
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.6rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.input-box {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.9rem 1rem;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-box:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
    background: rgba(15, 23, 42, 0.8);
}

.btn-primary {
    width: 100%;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 1rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 1rem;
}

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(30, 64, 175, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.role-badge { 
    text-align: center; 
    color: var(--text-muted); 
    font-size: 0.8rem; 
    margin-top: 1.5rem; 
    opacity: 0.8; 
}


/* ====================================
   DASHBOARD COMPONENTS
   ==================================== */
.dashboard-container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    background: var(--surface-color);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.6);
    animation: fadeIn 0.4s ease-out;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
}

.logo-header {
    max-width: 140px;
    height: auto;
    filter: brightness(0) invert(1);
}

.dashboard-header h1 span {
    color: var(--primary-light);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-outline:hover {
    background: rgba(255,255,255,0.08);
    border-color: var(--primary-light);
}

.btn-small { 
    background: rgba(30, 64, 175, 0.2); 
    border: 1px solid rgba(59, 130, 246, 0.3); 
    color: var(--gray-100); 
    padding: 0.4rem 0.8rem; 
    border-radius: 6px; 
    cursor: pointer; 
    font-size: 0.8rem; 
    transition: all 0.2s; 
}

.btn-small:hover { background: var(--primary); }

/* Formulario CRUD Asesores */
.form-panel { 
    background: rgba(15, 23, 42, 0.4); 
    padding: 2rem; 
    border-radius: 16px; 
    margin-bottom: 3rem; 
    border: 1px solid var(--border-color); 
}
.form-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
    gap: 1.5rem; 
    margin-bottom: 1.5rem; 
}


/* ====================================
   TABLAS DE DATOS
   ==================================== */
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
th { text-align: left; padding: 1rem; border-bottom: 1px solid var(--border-color); color: var(--gray-400); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; }
td { padding: 1.2rem 1rem; border-bottom: 1px solid rgba(255,255,255,0.03); font-size: 0.95rem; vertical-align: middle; }
tbody tr { transition: background 0.2s ease; }
tbody tr:hover { background: rgba(59, 130, 246, 0.05); }
.empty-state { text-align: center; padding: 4rem 1rem; color: var(--text-muted); font-style: italic; }


/* ====================================
   ALERTAS Y ESTADOS
   ==================================== */
.alert-box { padding: 1.2rem 1.5rem; border-radius: 12px; margin-bottom: 2rem; }
.alert-warning { background: rgba(245, 158, 11, 0.1); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.alert-success { background: rgba(16, 185, 129, 0.1); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.alert-danger { background: rgba(239, 68, 68, 0.1); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.error-msg {
    background: rgba(239, 68, 68, 0.1);
    border-left: 4px solid #ef4444;
    color: #f87171;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}


/* ====================================
   BADGES Y COMPONENTES DINÁMICOS
   ==================================== */
.badge { padding: 0.3rem 0.8rem; border-radius: 20px; font-size: 0.75rem; font-weight: 700; display: inline-block; }
.badge-code { background: rgba(30, 64, 175, 0.2); color: var(--primary-light); border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-link { background: rgba(96, 165, 250, 0.15); color: #93c5fd; border: 1px solid rgba(96, 165, 250, 0.3); }
.badge-count { background: var(--primary); color: white; padding: 0.2rem 0.6rem; border-radius: 12px; font-weight: 600; font-size: 0.8rem; }
.code-display { font-size: 1.6rem; font-weight: 800; letter-spacing: 2px; color: var(--accent); }
.action-link { display: inline-flex; align-items: center; background: var(--primary); color: white; padding: 0.5rem 1rem; border-radius: 8px; text-decoration: none; font-size: 0.85rem; font-weight: 600; transition: all 0.2s ease; }
.action-link:hover { background: var(--primary-light); transform: translateY(-2px); }
.date-col { color: var(--gray-500); font-size: 0.85rem; }


/* ====================================
   RESPONSIVE MOBILE-FIRST ENHANCEMENTS
   ==================================== */
@media (max-width: 768px) {
    .login-container { padding: 2.5rem 1.5rem; }
    .dashboard-body { padding: 1rem 0.5rem; }
    .dashboard-container { padding: 1.2rem; border-radius: 16px; }
    .dashboard-header { flex-direction: column; align-items: center; gap: 1.5rem; }
    .dashboard-header div { display: flex; flex-direction: column; gap: 0.8rem; width: 100%; margin-top: 0 !important; }
    .btn-outline { width: 100%; justify-content: center; text-align: center; }

    table, thead, tbody, th, td, tr { display: block; width: 100%; }
    thead { display: none; }
    tbody tr { margin-bottom: 1.5rem; background: rgba(30, 41, 59, 0.4); border: 1px solid var(--border-color); border-radius: 12px; padding: 0.5rem; }
    tbody td { display: flex; justify-content: space-between; align-items: center; text-align: right; padding: 0.8rem 0.5rem !important; border-bottom: 1px dashed rgba(255, 255, 255, 0.05) !important; }
    tbody td:last-child { border-bottom: none !important; flex-direction: column; align-items: stretch; gap: 0.8rem; margin-top: 0.5rem; }
    tbody td::before { content: attr(data-label); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; color: var(--gray-500); text-align: left; margin-right: 1rem; flex-basis: 40%; flex-shrink: 0; }
    .code-display { font-size: 1.8rem; text-align: center; display: block; width: 100%; margin: 0.5rem 0; }
    .action-link { justify-content: center; width: 100%; }
}
