/* ============================================================================
   🎯 CSS RESPONSIVE - ARCHIVO EXTERNO
   ============================================================================ */

/* ========== RESET Y BASE ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); 
    min-height: 100vh;
    overflow-x: hidden;
}

/* ========== LOGIN ========== */
.login-container { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    min-height: 100vh; 
    padding: 20px; 
    position: fixed; 
    top: 0; left: 0; 
    width: 100%; height: 100%; 
    z-index: 9999; 
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); 
}
.login-card { 
    background: white; 
    padding: 30px 20px; 
    border-radius: 8px; 
    box-shadow: 0 10px 40px rgba(0,0,0,0.3); 
    width: 100%; 
    max-width: 450px; 
}
.login-card h2 { 
    text-align: center; 
    color: #007bff; 
    margin-bottom: 10px; 
    font-size: 1.5rem; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 10px; 
}
.form-group { 
    margin-bottom: 18px; 
    position: relative; 
}
.form-group input, .form-group select { 
    width: 100%; 
    padding: 12px 40px 12px 15px; 
    border: 2px solid #e0e0e0; 
    border-radius: 8px; 
    font-size: 0.9rem; 
}
.btn { 
    width: 100%; 
    padding: 14px; 
    border: none; 
    border-radius: 8px; 
    font-size: 1rem; 
    font-weight: 600; 
    cursor: pointer; 
    background: #007bff; 
    color: white; 
}

/* ========== APP CONTAINER ========== */
.app-container { 
    display: none; 
    min-height: 100vh; 
    background: #f5f6fa; 
    flex-direction: column; 
}
.app-container.active { display: flex; }

/* ========== HEADER ========== */
.app-container header { 
    background: white; 
    padding: 15px 20px; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    position: sticky; 
    top: 0; 
    z-index: 100; 
    gap: 15px;
}
.logo { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
}
.logo img { 
    width: 40px; 
    height: 40px; 
    border-radius: 8px; 
}
.logo h1 { 
    font-size: 1.1rem; 
    color: #343a40; 
}
.user-info { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
}
.user-avatar { 
    width: 40px; 
    height: 40px; 
    background: #007bff; 
    color: white; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-weight: bold; 
    font-size: 1rem; 
}
.logout-btn { 
    background: #dc3545; 
    color: white; 
    border: none; 
    padding: 8px 15px; 
    border-radius: 8px; 
    cursor: pointer; 
    font-weight: 600; 
}

/* ========== HAMBURGUESA ========== */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}
.hamburger-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background: #343a40;
    margin: 5px 0;
    transition: 0.3s;
}
.hamburger-btn.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger-btn.active span:nth-child(2) { opacity: 0; }
.hamburger-btn.active span:nth-child(3) { transform: rotate(-45deg) translate(7px, -6px); }

/* ========== MOTIVACIONAL ========== */
.motivational-message {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 120px;
}
.motivational-message h2 {
    margin-bottom: 10px;
    font-size: 1.5rem;
    color: white;
}
.motivational-message p {
    font-size: 1rem;
    color: white;
}

/* ========== MAIN LAYOUT ========== */
.main-content { 
    display: flex; 
    gap: 20px; 
    padding: 15px; 
    flex: 1; 
    max-width: 1400px; 
    margin: 0 auto; 
    width: 100%; 
}
.dashboard { 
    flex: 1; 
    background: white; 
    border-radius: 12px; 
    padding: 20px; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); 
    display: flex; 
    flex-direction: column; 
}
.sidebar { 
    width: 350px; 
    flex-shrink: 0; 
    display: flex; 
    flex-direction: column; 
    gap: 15px; 
}

/* ========== SIDEBAR MÓVIL ========== */
.sidebar.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 20px rgba(0,0,0,0.2);
    transition: right 0.3s ease;
    z-index: 999;
    overflow-y: auto;
    padding-top: 80px;
    padding-left: 20px;
    padding-right: 20px;
}
.sidebar.mobile-menu.active {
    right: 0;
}

/* ========== OVERLAY ========== */
.menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 998;
}
.menu-overlay.active {
    display: block;
}

/* ========== BOTONES ACCIÓN ========== */
.action-buttons { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 10px; 
    margin-bottom: 20px; 
    justify-content: center; 
}
.btn-action { 
    padding: 12px 18px; 
    border: none; 
    border-radius: 8px; 
    font-weight: 600; 
    cursor: pointer; 
    display: inline-flex; 
    align-items: center; 
    gap: 8px; 
    font-size: 0.85rem; 
    color: white; 
    white-space: nowrap; 
    flex: 1;
    max-width: 200px;
}
.btn-add { background: #28a745; }
.btn-import { background: #17a2b8; }
.btn-save { background: #ffc107; color: #212529; }
.btn-quote { background: #007bff; }
.btn-visit { background: #6f42c1; }
.btn-admin { background: #dc3545; }

/* ========== TABLA ========== */
.table-wrapper { 
    overflow-x: auto; 
    border-radius: 8px; 
    border: 1px solid #e0e0e0; 
    flex: 1; 
    -webkit-overflow-scrolling: touch; 
}
table { 
    width: 100%; 
    min-width: 800px; 
    border-collapse: collapse; 
    background: white; 
}
th { 
    background: #007bff; 
    color: white; 
    padding: 12px 10px; 
    text-align: left; 
    font-weight: 600; 
    font-size: 0.8rem; 
}
td { 
    padding: 10px; 
    border-bottom: 1px solid #e0e0e0; 
    font-size: 0.85rem; 
}

/* ========== TOGGLES ========== */
.advisor-toggle-btn { 
    width: 100%; 
    background: white; 
    border: none; 
    padding: 15px; 
    border-radius: 8px; 
    cursor: pointer; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    font-weight: 600; 
    color: #343a40; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); 
}
.advisor-info { 
    background: white; 
    padding: 20px; 
    border-radius: 8px; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); 
}
.advisor-info.collapsed { display: none; }

/* ========== MODALES ========== */
.modal { 
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0; 
    top: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.6); 
    overflow-y: auto; 
}
.modal.active { 
    display: flex; 
    align-items: flex-start; 
    justify-content: center; 
    padding: 20px; 
}
.modal-content { 
    background: white; 
    padding: 20px; 
    border-radius: 8px; 
    width: 100%; 
    max-width: 700px; 
    position: relative; 
    max-height: 90vh; 
    overflow-y: auto; 
    margin: auto; 
}

/* ========== MEDIA QUERIES ========== */

/* Tablets */
@media (max-width: 1024px) {
    .main-content { flex-direction: column; }
    .sidebar { display: none; }
    .btn-action { max-width: calc(50% - 10px); }
    table { min-width: 1000px; }
}

/* Móviles */
@media (max-width: 768px) {
    .hamburger-btn { display: block; }
    .logo h1 { font-size: 0.9rem; }
    .user-details { display: none; }
    .logout-btn { padding: 6px 10px; font-size: 0.7rem; }
    .motivational-message h2 { font-size: 1.2rem; }
    .motivational-message p { font-size: 0.85rem; }
    .btn-action { 
        flex: 1 1 calc(50% - 10px); 
        max-width: calc(50% - 10px); 
        padding: 10px 12px; 
        font-size: 0.8rem; 
    }
    .modal-content { max-width: 95%; padding: 15px; }
}

/* Móviles pequeños */
@media (max-width: 480px) {
    .btn-action { flex: 1 1 100%; max-width: 100%; }
    .mobile-menu { width: 100%; }
}

/* ESTADOS */
.hidden { display: none !important; }