/* Reset y Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-orange: #F39C12;
    --color-blue: #5DADE2;
    --color-red: #E74C3C;
    --color-green: #2ECC71;
    --color-dark: #2C3E50;
    --color-light: #ECF0F1;
    --color-white: #FFFFFF;
    --color-gray: #95A5A6;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-hover: 0 5px 20px rgba(0,0,0,0.15);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--color-light);
    color: var(--color-dark);
    line-height: 1.6;
}

/* Header */
.header {
    background-color: var(--color-white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-logo img {
    height: 50px;
    width: auto;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-dark);
}

.user-icon {
    color: var(--color-gray);
}

.username {
    font-weight: 600;
}

.btn-logout {
    background-color: var(--color-red);
    color: var(--color-white);
    border: none;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.btn-logout:hover {
    background-color: #C0392B;
    transform: translateY(-2px);
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 30px;
}

.container {
    width: 100%;
}

/* Welcome Section */
.welcome-section {
    background-color: var(--color-white);
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.welcome-section h1 {
    color: var(--color-dark);
    font-size: 2em;
    margin-bottom: 10px;
}

.last-access {
    color: var(--color-gray);
    font-size: 0.95em;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.dashboard-card {
    background-color: var(--color-white);
    padding: 40px 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--color-white);
    cursor: pointer;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.card-orange {
    background: linear-gradient(135deg, #F39C12, #E67E22);
}

.card-blue {
    background: linear-gradient(135deg, #5DADE2, #3498DB);
}

.card-red {
    background: linear-gradient(135deg, #E74C3C, #C0392B);
}

.card-green {
    background: linear-gradient(135deg, #2ECC71, #27AE60);
}

.card-icon {
    margin-bottom: 20px;
}

.card-icon svg {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.card-title {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.card-value {
    font-size: 2.5em;
    font-weight: bold;
}

/* Info Box */
.info-box {
    background-color: var(--color-white);
    padding: 25px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.info-box h3 {
    color: var(--color-dark);
    margin-bottom: 15px;
    font-size: 1.3em;
}

.info-box p {
    margin-bottom: 10px;
    color: var(--color-gray);
}

/* Login Page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
/*
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
*/
	background-color: #e9ecef;
}

.login-container {
    width: 100%;
    max-width: 450px;
    padding: 20px;
}

.login-box {
    background-color: var(--color-white);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-logo {
    text-align: center;
    margin-bottom: 20px;
}

.login-logo img {
    max-width: 150px;
    height: auto;
}

.login-box h1 {
    text-align: center;
    color: var(--color-dark);
    margin-bottom: 10px;
    font-size: 1.8em;
}

.login-subtitle {
    text-align: center;
    color: var(--color-gray);
    margin-bottom: 30px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--color-dark);
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-control:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

/* Buttons */
.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: var(--color-white);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background-color: var(--color-green);
    color: var(--color-white);
}

.btn-success:hover {
    background-color: #27AE60;
}

.btn-danger {
    background-color: var(--color-red);
    color: var(--color-white);
}

.btn-danger:hover {
    background-color: #C0392B;
}

.btn-warning {
    background-color: var(--color-orange);
    color: var(--color-white);
}

.btn-warning:hover {
    background-color: #E67E22;
}

.btn-secondary {
    background-color: var(--color-gray);
    color: var(--color-white);
}

.btn-secondary:hover {
    background-color: #7F8C8D;
}

.btn-block {
    width: 100%;
    display: block;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-error {
    background-color: #fadbd8;
    color: #c0392b;
    border-left: 4px solid var(--color-red);
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-left: 4px solid var(--color-green);
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-left: 4px solid var(--color-orange);
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid var(--color-blue);
}

/* Tables */
.table-container {
    background-color: var(--color-white);
    border-radius: 10px;
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 30px;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background-color: var(--color-dark);
    color: var(--color-white);
}

.table th,
.table td {
    padding: 15px;
    text-align: left;
}

.table tbody tr {
    border-bottom: 1px solid #eee;
    transition: background-color 0.3s ease;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

.table-actions {
    display: flex;
    gap: 10px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85em;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: var(--color-white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background-color: var(--color-dark);
    color: var(--color-white);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease;
    min-width: 300px;
}

.toast-success {
    background-color: var(--color-green);
}

.toast-error {
    background-color: var(--color-red);
}

.toast-warning {
    background-color: var(--color-orange);
}

.toast-info {
    background-color: var(--color-blue);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--color-white);
    padding: 30px;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 1.5em;
    color: var(--color-dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: var(--color-gray);
}

.modal-close:hover {
    color: var(--color-dark);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 25px;
    background-color: #f0f0f0;
    border-radius: 15px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-green), var(--color-blue));
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-white);
    font-size: 0.85em;
    font-weight: bold;
}

/* Search Box */
.search-box {
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    max-width: 400px;
    padding: 12px 20px;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 1em;
}

.search-input:focus {
    outline: none;
    border-color: var(--color-blue);
}

/* Responsive */
@media (max-width: 768px) {
    .header-container {
        padding: 15px 20px;
    }
    
    .main-content {
        padding: 0 20px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .welcome-section h1 {
        font-size: 1.5em;
    }
    
    .card-value {
        font-size: 2em;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .username {
        display: none;
    }
}

/* Loading Overlay */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255,255,255,0.3);
    border-top-color: var(--color-white);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}