/* assets/css/estilo.css */

/* ===== VARIABLES ===== */
:root {
    --primary: #4361ee;
    --primary-dark: #3a56d4;
    --secondary: #3f37c9;
    --success: #4cc9f0;
    --danger: #f72585;
    --warning: #f8961e;
    --info: #4895ef;
    --dark: #1e1e2f;
    --light: #f8f9fa;
    --gray: #6c757d;
    --white: #ffffff;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.12);
    --transition: all 0.3s ease;
}

/* ===== RESET Y BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--light);
    color: #333;
    line-height: 1.5;
}

/* ===== LOGIN ===== */
.login-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: var(--white);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 40px 30px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    width: 80px;
    height: auto;
    margin-bottom: 20px;
}

.login-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 5px;
}

.login-header p {
    color: var(--gray);
    font-size: 14px;
}

.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
    font-size: 18px;
}

.input-group input {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border: 1px solid #e1e5eb;
    border-radius: 12px;
    font-size: 15px;
    transition: var(--transition);
}

.input-group input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.btn-login {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(67, 97, 238, 0.3);
}

.error-message {
    color: var(--danger);
    font-size: 14px;
    margin-bottom: 15px;
    text-align: center;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
}

.login-footer a {
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* ===== DASHBOARD LAYOUT ===== */
.dashboard {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1e1e2f 0%, #2d2d44 100%);
    color: var(--white);
    transition: var(--transition);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

.sidebar-header {
    padding: 25px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo-sidebar {
    width: 50px;
    height: auto;
    margin-bottom: 10px;
}

.sidebar-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.nav {
    list-style: none;
    padding: 20px 0;
}

.nav li {
    margin-bottom: 5px;
}

.nav li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.nav li a i {
    font-size: 20px;
    margin-right: 15px;
    width: 25px;
    text-align: center;
}

.nav li a span {
    font-size: 15px;
    font-weight: 500;
}

.nav li a:hover {
    background: rgba(255,255,255,0.1);
    color: var(--white);
    border-left-color: var(--primary);
}

.nav li a.active {
    background: rgba(67, 97, 238, 0.2);
    color: var(--white);
    border-left-color: var(--primary);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: var(--transition);
}

.topbar {
    background: var(--white);
    padding: 20px 30px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--dark);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info i {
    font-size: 32px;
    color: var(--primary);
}

.user-info span {
    font-weight: 500;
    color: var(--dark);
}

.content {
    padding: 30px;
}

/* Cards */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.card {
    background: var(--white);
    border-radius: 16px;
    padding: 25px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 20px;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-icon i {
    font-size: 30px;
    color: var(--white);
}

.card-info h3 {
    font-size: 16px;
    font-weight: 500;
    color: var(--gray);
    margin-bottom: 5px;
}

.card-info p {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
}

/* Chart container */
.chart-container {
    background: var(--white);
    border-radius: 16px;
    padding: 25px;
    box-shadow: var(--shadow);
    margin-top: 30px;
}

/* ===== TABLAS ===== */
.table-container {
    background: var(--white);
    border-radius: 16px;
    padding: 25px;
    box-shadow: var(--shadow);
}

.dataTables_wrapper {
    padding: 20px 0;
}

table.dataTable {
    border-collapse: collapse !important;
    width: 100%;
}

table.dataTable thead th {
    background: var(--light);
    color: var(--dark);
    font-weight: 600;
    padding: 12px 15px;
    border-bottom: 2px solid #e1e5eb;
}

table.dataTable tbody td {
    padding: 12px 15px;
    border-bottom: 1px solid #e1e5eb;
}

.actions {
    display: flex;
    gap: 10px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: var(--white);
}

.btn-icon.edit {
    background: var(--info);
}

.btn-icon.edit:hover {
    background: #3a78c2;
    transform: scale(1.1);
}

.btn-icon.delete {
    background: var(--danger);
}

.btn-icon.delete:hover {
    background: #d1145e;
    transform: scale(1.1);
}

/* ===== BOTONES ===== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(67, 97, 238, 0.3);
}

.btn-outline {
    background: transparent;
    border: 1px solid #e1e5eb;
    color: var(--gray);
}

.btn-outline:hover {
    background: #f1f3f5;
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #d1145e;
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: 20px;
    width: 90%;
    max-width: 50%;
    box-shadow: var(--shadow-hover);
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e1e5eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    overflow-y: auto;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--dark);
}

.modal-close {
    font-size: 28px;
    cursor: pointer;
    color: var(--gray);
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--danger);
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #e1e5eb;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

/* ===== FORMULARIOS ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e1e5eb;
    border-radius: 10px;
    font-size: 15px;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 15px;
}

/* ===== ALERTAS ===== */
.alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    animation: slideDown 0.3s;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid var(--danger);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar {
        width: var(--sidebar-collapsed-width);
    }
    
    .sidebar-header h3,
    .nav li a span {
        display: none;
    }
    
    .nav li a {
        justify-content: center;
        padding: 15px;
    }
    
    .nav li a i {
        margin-right: 0;
    }
    
    .main-content {
        margin-left: var(--sidebar-collapsed-width);
    }
    
    .cards {
        grid-template-columns: 1fr;
    }
    
    .topbar h1 {
        font-size: 20px;
    }
    
    .content {
        padding: 20px;
    }
    
    .table-container {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 30px 20px;
    }
    
    .modal-content {
        width: 95%;
    }
    
    .btn {
        padding: 8px 16px;
    }
}