/* estilos.css - Estilos generales del sistema FinanzasXG */

/* Variables de tema financiero */
:root {
    --primary-color: #2E7D32;
    --primary-dark: #1B5E20;
    --primary-light: #4CAF50;
    --secondary-color: #FF9800;
    --secondary-dark: #F57C00;
    --background-color: #f5f7fa;
    --card-bg: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --success-color: #4CAF50;
    --warning-color: #FF9800;
    --error-color: #f44336;
    --border-color: #e0e0e0;
    --shadow-light: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-medium: 0 4px 20px rgba(0,0,0,0.15);
}

/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background-color);
    min-height: 100vh;
}

/* Página de login */
.login-body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 1200px;
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo i {
    font-size: 3.5rem;
    color: var(--primary-color);
}

.logo h1 {
    font-size: 2.8rem;
    color: var(--text-primary);
}

.logo span {
    color: var(--primary-color);
    font-weight: 800;
}

.slogan {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-style: italic;
}

.login-card {
    background: var(--card-bg);
    border-radius: 15px;
    box-shadow: var(--shadow-medium);
    overflow: hidden;
    max-width: 450px;
    margin: 0 auto 40px;
}

.card-header {
    background: linear-gradient(to right, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 25px;
    text-align: center;
}

.card-header h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.card-header p {
    opacity: 0.9;
}

.login-form {
    padding: 30px;
}

/* Alertas */
.alert {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

.alert-error {
    background-color: rgba(244, 67, 54, 0.1);
    color: var(--error-color);
    border-left: 4px solid var(--error-color);
}

.alert-success {
    background-color: rgba(76, 175, 80, 0.1);
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

.alert-warning {
    background-color: rgba(255, 152, 0, 0.1);
    color: var(--warning-color);
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background-color: rgba(33, 150, 243, 0.1);
    color: #2196F3;
    border-left: 4px solid #2196F3;
}

.input-group {
    margin-bottom: 25px;
}

.input-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.input-group i {
    color: var(--primary-color);
}

.input-group input {
    width: 100%;
    padding: 14px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.password-container {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 5px;
    z-index: 2;
}

.toggle-password:hover {
    color: var(--primary-color);
}

.btn-login {
    width: 100%;
    padding: 16px;
    background: linear-gradient(to right, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.login-footer {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.login-footer p {
    margin-bottom: 10px;
}

.demo-credentials {
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 6px;
    border-left: 4px solid var(--secondary-color);
}

.security-notice {
    background-color: #f0f7f0;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--primary-dark);
    font-size: 0.9rem;
}

.login-features {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.feature {
    text-align: center;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: var(--shadow-light);
    width: 200px;
    transition: transform 0.3s ease;
}

.feature:hover {
    transform: translateY(-5px);
}

.feature i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.feature h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
}

/* Dashboard */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: linear-gradient(to bottom, var(--primary-dark), var(--primary-color));
    color: white;
    padding: 20px 0;
    flex-shrink: 0;
}

.user-info {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 2rem;
}

.user-info h3 {
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.user-role {
    background: rgba(255,255,255,0.2);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    display: inline-block;
}

.nav-menu {
    list-style: none;
    padding: 20px 0;
}

.nav-menu li {
    margin: 5px 0;
}

.nav-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    transition: all 0.3s ease;
}

.nav-menu a:hover, .nav-menu a.active {
    background: rgba(255,255,255,0.1);
    border-left: 4px solid var(--secondary-color);
    color: white;
}

.main-content {
    flex: 1;
    background: var(--background-color);
    padding: 20px;
    overflow-y: auto;
}

.top-bar {
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-light);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.content-header {
    background: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-light);
}

.content-header h1 {
    color: var(--primary-dark);
    margin-bottom: 10px;
    font-size: 1.8rem;
}

.content-header p {
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* Botones generales */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1rem;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(to right, var(--primary-color), var(--primary-dark));
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(to right, var(--primary-dark), #155724);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #3d8b40;
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--error-color);
    color: white;
}

.btn-danger:hover {
    background: #d32f2f;
    transform: translateY(-2px);
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background: #e68900;
    transform: translateY(-2px);
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.9rem;
}

.btn-lg {
    padding: 15px 30px;
    font-size: 1.1rem;
}

/* Badges generales */
.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
}

.badge.primary {
    background-color: rgba(46, 125, 50, 0.1);
    color: var(--primary-dark);
}

.badge.secondary {
    background-color: rgba(108, 117, 125, 0.1);
    color: #6c757d;
}

.badge.success {
    background-color: rgba(76, 175, 80, 0.1);
    color: var(--success-color);
}

.badge.danger {
    background-color: rgba(244, 67, 54, 0.1);
    color: var(--error-color);
}

.badge.warning {
    background-color: rgba(255, 152, 0, 0.1);
    color: var(--warning-color);
}

.badge.info {
    background-color: rgba(23, 162, 184, 0.1);
    color: #17a2b8;
}

/* Card general */
.card {
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow-light);
    overflow: hidden;
    margin-bottom: 20px;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.card-body {
    padding: 20px;
}

/* Tablas generales */
.table-container {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-light);
}

.table-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.table-title {
    font-size: 1.2rem;
    color: var(--primary-dark);
    margin: 0;
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

thead {
    background: #f8f9fa;
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

tbody tr:hover {
    background: #f8f9fa;
}

/* Formularios generales */
.form-container {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow-light);
    max-width: 1000px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.form-text {
    display: block;
    margin-top: 5px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Checkboxes y radios */
.checkbox-label, .radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    margin-bottom: 10px;
}

.checkbox-label input[type="checkbox"],
.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Textarea */
textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* Select */
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23333' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px;
    padding-right: 40px;
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Utilidades */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.text-muted {
    color: var(--text-secondary);
}

.text-success {
    color: var(--success-color);
}

.text-danger {
    color: var(--error-color);
}

.text-warning {
    color: var(--warning-color);
}

.text-info {
    color: #17a2b8;
}

.mb-0 {
    margin-bottom: 0;
}

.mt-0 {
    margin-top: 0;
}

.mb-20 {
    margin-bottom: 20px;
}

.mt-20 {
    margin-top: 20px;
}

.mb-30 {
    margin-bottom: 30px;
}

.mt-30 {
    margin-top: 30px;
}

.d-flex {
    display: flex;
}

.align-items-center {
    align-items: center;
}

.justify-content-between {
    justify-content: space-between;
}

.gap-10 {
    gap: 10px;
}

.gap-20 {
    gap: 20px;
}

.w-100 {
    width: 100%;
}

/* Estados vacíos */
.empty-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #e0e0e0;
}

.empty-state p {
    font-size: 1.1rem;
}

/* Estilos para página de login multiempresa */
.login-instructions {
    background-color: #e8f4fd;
    border-left: 4px solid var(--primary-color);
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.login-instructions strong {
    color: var(--primary-dark);
}

.login-instructions ul {
    margin: 10px 0 0 20px;
    padding: 0;
}

.login-instructions li {
    margin-bottom: 5px;
}

.empresa-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
    background-color: #f8f9fa;
    padding: 8px;
    border-radius: 4px;
    border-left: 3px solid var(--primary-light);
}

.superusuario-info {
    background-color: #fff3e0;
    border-left: 4px solid var(--warning-color);
    padding: 12px 15px;
    margin: 20px 0;
    border-radius: 6px;
    font-size: 0.9rem;
}

.superusuario-info p {
    margin-bottom: 5px;
}

.superusuario-info .text-muted {
    font-size: 0.85rem;
    color: #666;
}

/* Responsive general */
@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        order: 2;
    }
    
    .main-content {
        order: 1;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .table-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    .nav-menu a {
        padding: 10px 15px;
    }
    
    .content-header {
        padding: 20px;
    }
    
    .content-header h1 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .top-bar {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .breadcrumb {
        flex-wrap: wrap;
    }
    
    .form-container {
        padding: 15px;
    }
    
    .btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
    
    .login-features {
        flex-direction: column;
        align-items: center;
    }
    
    .feature {
        width: 100%;
        max-width: 300px;
    }
}

/* Modal básico */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1050;
    padding: 20px;
}

.modal-backdrop.show {
    display: flex;
}

.modal {
    background: white;
    border-radius: 10px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: var(--shadow-medium);
    animation: fadeIn 0.3s ease;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to right, var(--primary-color), var(--primary-dark));
    color: white;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.modal-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #f8f9fa;
}

/* Tooltip básico */
[title] {
    position: relative;
}

[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
}

[title]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.8);
    margin-bottom: -5px;
    z-index: 1000;
}

/* Estilo para nombre de empresa en la barra superior */
.empresa-activa {
    font-weight: 600;
    color: var(--primary-color);
    margin-right: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
    background-color: rgba(46, 125, 50, 0.05);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.95rem;
}

/* Nombre de empresa en el sidebar */
.empresa-en-sidebar {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #e0f0e0;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 10px;
    border-radius: 20px;
    margin: 8px 0;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.empresa-en-sidebar i {
    font-size: 0.9rem;
}

/* ============================================
   AJUSTES RESPONSIVOS GENERALES
   ============================================ */

@media (max-width: 1360px) {
    .dashboard-container {
        font-size: 14px;
    }
    
    .sidebar {
        width: 220px;
    }
    
    .nav-menu a {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .nav-menu a i {
        font-size: 1rem;
    }
    
    .content-header h1 {
        font-size: 1.5rem;
    }
    
    .content-header p {
        font-size: 0.9rem;
    }
    
    .btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
    
    .btn i {
        font-size: 0.9rem;
    }
}

@media (max-width: 992px) {
    .dashboard-container {
        font-size: 13px;
    }
    
    .sidebar {
        width: 200px;
    }
    
    .user-avatar {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .user-info h3 {
        font-size: 1rem;
    }
    
    .user-role {
        font-size: 0.75rem;
    }
    
    .nav-menu a {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .top-bar {
        padding: 10px 15px;
    }
    
    .breadcrumb {
        font-size: 0.85rem;
    }
    
    .welcome {
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        order: 2;
        padding: 10px 0;
    }
    
    .user-info {
        padding: 15px;
    }
    
    .nav-menu {
        display: flex;
        overflow-x: auto;
        padding: 5px 0;
        white-space: nowrap;
    }
    
    .nav-menu li {
        display: inline-block;
        margin: 0;
    }
    
    .nav-menu a {
        padding: 8px 15px;
        border-left: none;
        border-bottom: 3px solid transparent;
    }
    
    .nav-menu a.active {
        border-left: none;
        border-bottom: 3px solid var(--secondary-color);
    }
    
    .main-content {
        order: 1;
        padding: 10px;
    }
    
    .content-header {
        padding: 15px;
    }
    
    .content-header h1 {
        font-size: 1.3rem;
    }
}

/* Ajustes específicos para íconos */
@media (max-width: 1360px) {
    .fas, .far, .fab {
        font-size: 0.9em;
    }
    
    .fa-2x {
        font-size: 1.5em;
    }
    
    .fa-3x {
        font-size: 2em;
    }
}

@media (max-width: 768px) {
    .fas, .far, .fab {
        font-size: 0.85em;
    }
    
    .fa-2x {
        font-size: 1.3em;
    }
    
    .fa-3x {
        font-size: 1.7em;
    }
    
    /* Ajustar íconos grandes en tarjetas */
    .stat-icon,
    .asociado-stat-icon,
    .asociado-avatar-img {
        font-size: 1.2rem !important;
    }
}