/* Sistema de Rotación FB - Estilos Completos */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* Indicador de conexión */
.connection-status {
    position: fixed;
    top: 10px;
    right: 10px;
    background: #28a745;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    z-index: 1001;
}

/* Pantalla de Login */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.login-container {
    background: white;
    border-radius: 15px;
    padding: 40px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    text-align: center;
}

.login-header h1 {
    color: #4267B2;
    margin-bottom: 10px;
    font-size: 2em;
}

.login-header p {
    color: #6c757d;
    margin-bottom: 30px;
}

.login-form {
    text-align: left;
}

.login-btn {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    margin-top: 10px;
}

.login-help {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 12px;
    color: #6c757d;
}

/* Sistema principal */
.main-system {
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px;
}

.header {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.logo {
    font-size: clamp(1.2em, 4vw, 1.8em);
    font-weight: bold;
    color: #4267B2;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.role-badge {
    background: #42b883;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.role-badge.admin {
    background: #e74c3c;
}

.btn {
    background: #4267B2;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    background: #365899;
    transform: translateY(-2px);
}

.btn.secondary {
    background: #42b883;
}

.btn.secondary:hover {
    background: #369870;
}

.btn.danger {
    background: #e74c3c;
}

.btn.danger:hover {
    background: #c0392b;
}

.btn.warning {
    background: #f39c12;
}

.btn.warning:hover {
    background: #e67e22;
}

.panel {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.panel h2 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: clamp(1.2em, 4vw, 1.5em);
}

/* Dashboard de Estadísticas */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-left: 4px solid #007bff;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.stat-number {
    font-size: clamp(1.8em, 6vw, 2.2em);
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.stat-label {
    color: #6c757d;
    font-size: clamp(11px, 3vw, 13px);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card.disponible { border-left-color: #28a745; }
.stat-card.asignada { border-left-color: #ffc107; }
.stat-card.descanso { border-left-color: #dc3545; }
.stat-card.excelente { border-left-color: #28a745; }
.stat-card.regular { border-left-color: #ffc107; }
.stat-card.danada { border-left-color: #dc3545; }
.stat-card.total { border-left-color: #6f42c1; }

/* Pestañas */
.tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 2px solid #ecf0f1;
    overflow-x: auto;
}

.tab {
    background: none;
    border: none;
    padding: 12px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #7f8c8d;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tab.active {
    color: #4267B2;
    border-bottom-color: #4267B2;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Tablas */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 14px;
}

.table th,
.table td {
    padding: 10px 8px;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.table tr:hover {
    background: #f8f9fa;
}

.status {
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: bold;
    text-align: center;
    white-space: nowrap;
}

.status.disponible {
    background: #d4edda;
    color: #155724;
}

.status.asignada {
    background: #fff3cd;
    color: #856404;
}

.status.descanso {
    background: #f8d7da;
    color: #721c24;
}

/* Formularios */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4267B2;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* Modales */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    padding: 20px;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 25px;
    border-radius: 15px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #7f8c8d;
    padding: 5px;
}

/* Calificación */
.calificacion-option {
    background: #f8f9fa;
    border: 3px solid #e9ecef;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.calificacion-option:hover {
    transform: scale(1.02);
}

.calificacion-option[data-calificacion="excelente"] {
    background: #d4edda;
    border-color: #c3e6cb;
}

.calificacion-option[data-calificacion="regular"] {
    background: #fff3cd;
    border-color: #ffeaa7;
}

.calificacion-option[data-calificacion="danada"] {
    background: #f8d7da;
    border-color: #f5c6cb;
}

.rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
}

.rating.excelente {
    background: #d4edda;
    color: #155724;
}

.rating.regular {
    background: #fff3cd;
    color: #856404;
}

.rating.danada {
    background: #f8d7da;
    color: #721c24;
}

/* Cuentas Usuario */
.account-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    position: relative;
}

.account-card:hover {
    border-color: #4267B2;
    box-shadow: 0 6px 20px rgba(66, 103, 178, 0.15);
    transform: translateY(-2px);
}

.account-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.account-title {
    font-size: clamp(16px, 4vw, 18px);
    font-weight: bold;
    color: #2c3e50;
}

.account-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
    white-space: nowrap;
}

.account-info {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 15px;
}

.info-item {
    background: white;
    padding: 12px;
    border-radius: 8px;
    border-left: 3px solid #e9ecef;
}

.info-label {
    font-weight: 500;
    color: #6c757d;
    font-size: 12px;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    color: #2c3e50;
    font-size: 14px;
    word-break: break-all;
}

.password-field {
    display: flex;
    align-items: center;
    gap: 10px;
}

.password-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0;
    font-size: 14px;
    color: #2c3e50;
}

.password-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 5px;
    color: #6c757d;
    transition: all 0.3s ease;
}

.password-toggle:hover {
    color: #4267B2;
    transform: scale(1.1);
}

/* Alertas */
.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid;
    animation: slideIn 0.3s ease;
}

.alert.success {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.alert.error {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.alert.info {
    background: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

.alert.warning {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

/* Loading */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4267B2;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .header {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }

    .panel {
        padding: 15px;
    }

    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-card {
        padding: 12px;
    }

    .form-actions {
        justify-content: stretch;
    }

    .form-actions .btn {
        flex: 1;
    }

    .table {
        font-size: 12px;
    }

    .table th,
    .table td {
        padding: 8px 4px;
    }

    .modal-content {
        padding: 20px;
        margin: 10px;
    }

    .account-card {
        padding: 15px;
        margin-bottom: 15px;
    }

    .tabs {
        font-size: 12px;
    }

    .tab {
        padding: 10px 12px;
        font-size: 12px;
    }

    .table .hide-mobile {
        display: none;
    }

    .login-container {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .btn {
        padding: 12px;
        font-size: 14px;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

/* Utilidades */
.text-center {
    text-align: center;
}

.hidden {
    display: none;
}

.loading {
    opacity: 0.7;
    pointer-events: none;
}