/* CSS OPTIMIZADO PARA SERVIDOR - Sin dependencias externas */
/* Evita problemas de firewall y carga de recursos externos */

:root {
    --primary: #1a1a1a;
    --secondary: #2d2d2d;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --light: #f8f9fa;
    --dark: #1a1a1a;
    --sidebar-width: 250px;
    --sidebar-collapsed: 60px;
    --text-primary: #333333;
    --text-secondary: #666666;
    --bg-primary: #fafafa;
    --bg-secondary: #ffffff;
    --border-color: #e0e0e0;
    --menu-bg: #1a1a1a;
    --menu-text: #ffffff;
}

/* Reset básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Contenedores principales */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* LOGIN STYLES */
.login-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    padding: 20px;
}

.logo {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.logo h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: bold;
}

.logo p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.logo-image {
    margin-bottom: 20px;
}

.company-logo {
    max-height: 80px;
    max-width: 200px;
    height: auto;
    width: auto;
}

.logo-placeholder {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    margin: 0 auto;
}

.logo-icon {
    font-size: 40px;
    color: white;
}

.form-container {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.form-section {
    display: none;
}

.form-section.active {
    display: block;
}

.form-section h2 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--primary);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.form-group small {
    color: #666;
    font-size: 0.8rem;
}

/* BOTONES */
.btn {
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-full-width {
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: 1px solid #2980b9;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2980b9, #1f5f8b);
}

.btn-success {
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
    border: 1px solid #229954;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: 1px solid #dc3545;
}

.btn-warning {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    border: 1px solid #e67e22;
}

.btn-info {
    background: #17a2b8;
    color: white;
    border: 1px solid #17a2b8;
}

.btn-secondary {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
    border: 1px solid #7f8c8d;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.switch-form {
    text-align: center;
    margin-top: 20px;
}

.switch-form a {
    color: var(--secondary);
    text-decoration: none;
}

/* MENSAJES */
.messages {
    margin-top: 20px;
    width: 100%;
    max-width: 400px;
}

.alert {
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* DASHBOARD STYLES */
.header {
    background-color: var(--menu-bg);
    color: var(--menu-text);
    padding: 8px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 56px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.sidebar-toggle span {
    width: 20px;
    height: 2px;
    background: var(--menu-text);
    transition: all 0.3s;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--menu-bg);
    color: var(--menu-text);
    height: calc(100vh - 56px);
    position: fixed;
    top: 56px;
    left: 0;
    padding-top: 20px;
    transition: all 0.3s ease;
    overflow-x: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    padding: 15px 20px;
    border-bottom: 1px solid #333;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.sidebar-menu li:hover {
    background-color: #333;
}

.sidebar-menu li.active {
    background-color: #444;
    border-right: 3px solid var(--success);
}

.sidebar-menu .icon {
    font-size: 18px;
    min-width: 20px;
}

.main-content {
    margin-left: var(--sidebar-width);
    margin-top: 56px;
    padding: 20px;
    transition: margin-left 0.3s ease;
    min-height: calc(100vh - 56px);
}

.main-content.expanded {
    margin-left: var(--sidebar-collapsed);
}

/* CARDS */
.card {
    background: var(--bg-secondary);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.card-header {
    background: var(--light);
    color: var(--text-primary);
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body {
    padding: 20px;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* TABLAS */
table {
    width: 100%;
    border-collapse: collapse;
}

table th, table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

table th {
    background-color: var(--light);
    font-weight: 600;
    color: var(--text-primary);
}

/* STATUS BADGES */
.status-badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-pending {
    background-color: #ffecd9;
    color: var(--warning);
}

.status-paid {
    background-color: #e6f7ee;
    color: var(--success);
}

.status-overdue {
    background-color: #feeaea;
    color: var(--danger);
}

/* MODALES */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    background: var(--menu-bg);
    color: var(--menu-text);
    padding: 15px 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding: 15px 20px 20px 20px;
    border-top: 1px solid var(--border-color);
}

.close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

/* NOTIFICACIONES */
.notifications-area {
    position: absolute;
    top: 100%;
    right: 0;
    width: 350px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 5px;
}

.notification-header {
    background: #f39c12;
    color: white;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
}

.notification-item {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* CALENDARIO */
#calendar {
    margin-top: 10px;
}

.calendar-legend {
    display: flex;
    gap: 20px;
    font-size: 14px;
    align-items: center;
}

.legend-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 5px;
}

/* FILTROS */
.filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* ADMIN ONLY */
.admin-only {
    display: none;
}

.role-admin .admin-only {
    display: block;
}

/* FOOTER */
.footer-credit {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

.footer-credit small {
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
}

.footer-credit a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .sidebar {
        width: var(--sidebar-collapsed);
    }
    
    .main-content {
        margin-left: var(--sidebar-collapsed);
    }
    
    .login-container {
        padding: 10px;
    }
    
    .form-container {
        padding: 20px;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
}

/* UTILIDADES */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-20 { margin-bottom: 20px; }
.mt-20 { margin-top: 20px; }
.p-20 { padding: 20px; }
.hidden { display: none; }
.visible { display: block; }