/**
 * Estilos del Sistema de Gestión Laboral
 * Bar Lola's Zalero
 */

/* Variables CSS */
:root {
    --primary-color: #23272b;
    --primary-light: #3a3f44;
    --secondary-color: #ffb347;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --text-color: #333;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-lg: 0 5px 20px rgba(0,0,0,0.15);
    --radius: 8px;
    --radius-sm: 4px;
    --transition: all 0.3s ease;
}

/* Reset y Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Dosis', sans-serif;
    background: #f0f2f5;
    color: var(--text-color);
    min-height: 100vh;
}

/* ================================
   LOGIN PAGE
================================ */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.login-header {
    background: var(--primary-color);
    color: #fff;
    padding: 30px;
    text-align: center;
}

.login-header h1 {
    font-family: 'Great Vibes', cursive;
    font-size: 2.5rem;
    margin-bottom: 5px;
}

.login-header p {
    opacity: 0.8;
    font-size: 0.95rem;
}

.login-form {
    padding: 30px;
}

.login-footer {
    padding: 0 30px 30px;
    text-align: center;
}

.back-link {
    color: var(--text-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.back-link:hover {
    color: var(--primary-color);
}

/* ================================
   FORM ELEMENTS
================================ */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(255, 179, 71, 0.2);
}

.password-wrapper {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.form-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 5px;
}

/* ================================
   BUTTONS
================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--secondary-color);
    color: var(--primary-color);
}

.btn-primary:hover {
    background: #ffa726;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--text-muted);
    color: #fff;
}

.btn-secondary:hover {
    background: var(--dark-color);
}

.btn-success {
    background: var(--success-color);
    color: #fff;
}

.btn-success:hover {
    background: #218838;
}

.btn-warning {
    background: var(--warning-color);
    color: var(--dark-color);
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-danger {
    background: var(--danger-color);
    color: #fff;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 15px 30px;
    font-size: 1.1rem;
}

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

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: var(--text-muted);
    transition: var(--transition);
}

.btn-icon.btn-danger {
    background: none;
    color: var(--danger-color);
}

.btn-icon.btn-danger:hover {
    color: #a71d2a;
}

.btn-logout {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    padding: 8px 15px;
    font-size: 0.9rem;
}

.btn-logout:hover {
    background: rgba(255,255,255,0.1);
}

/* ================================
   ALERTS
================================ */
.alert {
    padding: 15px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

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

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ================================
   BADGES
================================ */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-secondary {
    background: #e2e3e5;
    color: #383d41;
}

/* ================================
   DASHBOARD LAYOUT
================================ */
.dashboard-nav {
    background: var(--primary-color);
    color: #fff;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.3rem;
    font-weight: 600;
}

.menu-toggle {
    cursor: pointer;
    font-size: 1.2rem;
    display: none;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 20px;
}

.dashboard-container {
    display: flex;
    min-height: calc(100vh - 60px);
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: #fff;
    box-shadow: var(--shadow);
    padding: 20px 0;
    transition: var(--transition);
}

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

.sidebar-menu li {
    padding: 15px 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.sidebar-menu li:hover {
    background: var(--light-color);
}

.sidebar-menu li.active {
    background: var(--light-color);
    border-left-color: var(--secondary-color);
    color: var(--primary-color);
    font-weight: 600;
}

.sidebar-menu li i {
    width: 20px;
    text-align: center;
}

/* Main Content */
.dashboard-main {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    color: var(--primary-color);
}

/* ================================
   CARDS
================================ */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid var(--border-color);
}

.avatar {
    width: 50px;
    height: 50px;
    background: var(--secondary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.3rem;
}

.card-title h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.card-body {
    padding: 20px;
}

.card-body p {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
}

.card-body p i {
    width: 16px;
    color: var(--secondary-color);
}

.card-actions {
    padding: 15px 20px;
    background: var(--light-color);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.trabajador-card.inactivo {
    opacity: 0.6;
}

/* ================================
   TABLES
================================ */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    background: #fff;
    border-collapse: collapse;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

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

.data-table th {
    background: var(--primary-color);
    color: #fff;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.data-table tr:hover {
    background: var(--light-color);
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* ================================
   FILTERS
================================ */
.filter-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-group input,
.filter-group select {
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
}

/* ================================
   DOCUMENTS
================================ */
.documentos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.documento-card .card-header {
    justify-content: space-between;
}

.doc-list {
    list-style: none;
}

.doc-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.doc-list li:last-child {
    border-bottom: none;
}

.doc-list li a {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
}

.doc-list li a:hover {
    color: var(--secondary-color);
}

.doc-type {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--light-color);
    padding: 2px 8px;
    border-radius: 10px;
}

/* ================================
   EXPORT FORM
================================ */
.export-form {
    max-width: 600px;
    padding: 30px;
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: var(--radius);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
}

.modal-close:hover {
    color: var(--danger-color);
}

.modal-body {
    padding: 20px;
}

.modal-subtitle {
    margin-bottom: 20px;
    padding: 10px 15px;
    background: var(--light-color);
    border-radius: var(--radius-sm);
}

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

/* ================================
   EMPTY STATE
================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 15px;
    opacity: 0.3;
}

.empty-state.small {
    padding: 30px 20px;
}

.empty-state.small i {
    font-size: 2rem;
}

/* ================================
   TRABAJADOR PAGE
================================ */
.trabajador-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 25px;
}

.fichaje-panel {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    text-align: center;
    margin-bottom: 25px;
}

.fecha-actual {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.reloj-container {
    margin-bottom: 30px;
}

.reloj {
    font-size: 4rem;
    font-weight: 700;
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
}

.jornada-activa {
    background: #e8f5e9;
    border-radius: var(--radius);
    padding: 25px;
    margin-bottom: 25px;
}

.jornada-info {
    margin-bottom: 15px;
}

.jornada-info i {
    font-size: 2rem;
    color: var(--success-color);
    margin-bottom: 10px;
}

.jornada-info p {
    color: var(--text-muted);
    margin: 0;
}

.jornada-info strong {
    font-size: 2rem;
    color: var(--success-color);
}

.tiempo-trabajado {
    margin-top: 20px;
}

.tiempo-trabajado span {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.contador {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
}

.btn-fichaje {
    width: 100%;
    max-width: 400px;
    padding: 25px 40px;
    font-size: 1.3rem;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    transition: var(--transition);
    margin: 0 auto;
}

.btn-iniciar {
    background: linear-gradient(135deg, var(--success-color) 0%, #218838 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
}

.btn-iniciar:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.5);
}

.btn-finalizar {
    background: linear-gradient(135deg, var(--danger-color) 0%, #c82333 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
}

.btn-finalizar:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.5);
}

.btn-fichaje i {
    font-size: 1.5rem;
}

/* Stats Panel */
.stats-panel {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 25px;
    margin-bottom: 25px;
}

.stats-panel h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.stat-card {
    background: var(--light-color);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
}

.stat-icon {
    font-size: 2rem;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Historial Panel */
.historial-panel {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 25px;
}

.historial-panel h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.historial-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.historial-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: var(--light-color);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--success-color);
}

.historial-item.en_curso {
    border-left-color: var(--warning-color);
    background: #fff9e6;
}

.historial-fecha {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.historial-horas {
    display: flex;
    gap: 20px;
}

.hora-entrada,
.hora-salida {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-muted);
}

.historial-total strong {
    color: var(--success-color);
    font-size: 1.1rem;
}

/* ================================
   UTILITIES
================================ */
.text-muted {
    color: var(--text-muted);
}

.text-center {
    text-align: center;
}

/* ================================
   RESPONSIVE
================================ */
@media (max-width: 992px) {
    .menu-toggle {
        display: block;
    }
    
    .sidebar {
        position: fixed;
        left: -250px;
        top: 60px;
        height: calc(100vh - 60px);
        z-index: 99;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .dashboard-main {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .cards-grid,
    .documentos-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-group input,
    .filter-group select {
        width: 100%;
    }
    
    .nav-user span {
        display: none;
    }
    
    .reloj {
        font-size: 3rem;
    }
    
    .btn-fichaje {
        padding: 20px 30px;
        font-size: 1.1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .historial-item {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .historial-horas {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 480px) {
    .fichaje-panel {
        padding: 25px 15px;
    }
    
    .reloj {
        font-size: 2.5rem;
    }
    
    .contador {
        font-size: 2rem;
    }
    
    .jornada-info strong {
        font-size: 1.5rem;
    }
}
