/* Reset y variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --secondary-color: #764ba2;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-gray: #f8f9fa;
    --medium-gray: #e9ecef;
    --dark-gray: #495057;
    --text-color: #333;
    --border-radius: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--light-gray);
    color: var(--text-color);
    line-height: 1.6;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

.logo {
    text-align: center;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 10px;
    font-size: 28px;
    color: var(--text-color);
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
}

.login-footer {
    margin-top: 20px;
    text-align: center;
    color: #999;
}

/* Navbar */
.navbar {
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 18px;
    color: var(--primary-color);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 14px;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 32px;
    color: var(--text-color);
}

.clock {
    font-size: 24px;
    font-weight: 600;
    color: var(--primary-color);
    font-variant-numeric: tabular-nums;
}

/* Cards */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 25px;
    margin-bottom: 20px;
}

.card h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--text-color);
    padding-bottom: 10px;
    border-bottom: 2px solid var(--medium-gray);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark-gray);
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--medium-gray);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.filter-form {
    background: var(--light-gray);
    padding: 20px;
    border-radius: var(--border-radius);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: var(--dark-gray);
    color: white;
}

.btn-secondary:hover {
    background: #343a40;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-large {
    padding: 18px 40px;
    font-size: 18px;
}

.btn-entrada {
    background: var(--success-color);
    color: white;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-entrada:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.btn-salida {
    background: var(--danger-color);
    color: white;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-salida:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* Fichaje Panel */
.fichaje-panel {
    text-align: center;
    padding: 40px 20px;
}

.fichaje-status {
    margin-bottom: 40px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 10px;
}

.status-working {
    background: #d4edda;
    color: #155724;
}

.status-available {
    background: #f8f9fa;
    color: #666;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-working .status-dot {
    background: #28a745;
}

.status-available .status-dot {
    background: #999;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.fichaje-buttons {
    margin: 30px 0;
}

/* Fichajes List */
.fichajes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.fichaje-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--light-gray);
    border-radius: var(--border-radius);
}

.fichaje-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-entrada {
    background: #d4edda;
    color: #155724;
}

.icon-salida {
    background: #f8d7da;
    color: #721c24;
}

.fichaje-info {
    display: flex;
    flex-direction: column;
}

.fichaje-info strong {
    font-size: 14px;
    margin-bottom: 2px;
}

.fichaje-info span {
    font-size: 13px;
    color: #666;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.stat-card {
    background: var(--light-gray);
    padding: 25px;
    border-radius: var(--border-radius);
    text-align: center;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.stat-label {
    font-size: 13px;
    color: #666;
    text-transform: uppercase;
    font-weight: 500;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table thead {
    background: var(--light-gray);
}

.table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--dark-gray);
    border-bottom: 2px solid var(--medium-gray);
}

.table td {
    padding: 12px;
    border-bottom: 1px solid var(--medium-gray);
}

.table tbody tr:hover {
    background: var(--light-gray);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-primary {
    background: #e3e8ff;
    color: var(--primary-color);
}

.badge-secondary {
    background: var(--medium-gray);
    color: var(--dark-gray);
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

/* Export Actions */
.export-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: center;
}

/* Admin Layout */
.admin-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 0;
    min-height: calc(100vh - 60px);
}

.admin-sidebar {
    background: white;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    padding: 20px 0;
}

.admin-menu {
    display: flex;
    flex-direction: column;
}

.admin-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 25px;
    color: var(--dark-gray);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.admin-menu-item:hover {
    background: var(--light-gray);
    color: var(--primary-color);
}

.admin-menu-item.active {
    background: #e3e8ff;
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 600;
}

.admin-content {
    padding: 30px;
    overflow-x: hidden;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 25px;
    border-bottom: 1px solid var(--medium-gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--text-color);
}

.modal-content form {
    padding: 25px;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 1px solid var(--medium-gray);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 15px;
    }

    .page-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: sticky;
        top: 60px;
        z-index: 100;
    }

    .admin-menu {
        flex-direction: row;
        overflow-x: auto;
    }

    .admin-menu-item {
        white-space: nowrap;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .export-actions {
        flex-direction: column;
    }
}

/* Informe header */
.informe-header {
    background: var(--light-gray);
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.informe-header strong {
    color: var(--dark-gray);
}