* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 24px 32px;
}

.header h1 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 4px;
}

.header .subtitle {
    font-size: 14px;
    opacity: 0.85;
}

.controls {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 20px 32px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    flex-wrap: wrap;
}

.date-selector {
    display: flex;
    align-items: center;
    gap: 12px;
}

.date-selector label {
    font-size: 14px;
    color: #495057;
    font-weight: 500;
}

.date-selector input[type="date"] {
    padding: 8px 12px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.date-selector input[type="date"]:focus {
    outline: none;
    border-color: #667eea;
}

.period-selector {
    display: flex;
    gap: 4px;
    background: #fff;
    padding: 4px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.period-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.period-btn:hover {
    background: #f1f3f4;
    color: #495057;
}

.period-btn.active {
    background: #667eea;
    color: #fff;
}

.refresh-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: auto;
}

.refresh-btn:hover {
    background: #5a6fd6;
    transform: translateY(-1px);
}

.refresh-icon {
    font-size: 16px;
    animation: spin 2s linear infinite;
    animation-play-state: paused;
}

.refresh-btn:hover .refresh-icon {
    animation-play-state: running;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.summary-bar {
    display: flex;
    gap: 32px;
    padding: 16px 32px;
    background: #fff;
    border-bottom: 1px solid #e9ecef;
}

.summary-item {
    display: flex;
    flex-direction: column;
}

.summary-label {
    font-size: 12px;
    color: #868e96;
    margin-bottom: 4px;
}

.summary-value {
    font-size: 20px;
    font-weight: 600;
    color: #212529;
}

.table-wrapper {
    overflow-x: auto;
    padding: 20px;
}

.clockin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.clockin-table th,
.clockin-table td {
    padding: 12px 8px;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
    font-size: 14px;
}

.clockin-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    position: sticky;
    top: 0;
    z-index: 1;
}

.name-column {
    width: 100px;
    text-align: left;
    padding-left: 20px;
}

.date-columns {
    white-space: nowrap;
}

.rate-column {
    width: 120px;
    font-weight: 600;
}

.clockin-table tbody tr:hover {
    background: #f8f9fa;
}

.clockin-table tbody td:first-child {
    font-weight: 500;
    color: #212529;
}

.status-cell {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.status-clockin {
    background: #d4edda;
    color: #155724;
}

.status-absent {
    background: #f8d7da;
    color: #721c24;
}

.status-weekend {
    background: #e9ecef;
    color: #6c757d;
    font-size: 10px;
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    gap: 16px;
    display: none;
}

.loading.show {
    display: flex;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading span {
    color: #6c757d;
    font-size: 14px;
}

.error {
    padding: 16px 32px;
    background: #f8d7da;
    color: #721c24;
    font-size: 14px;
    display: none;
    border-radius: 8px;
    margin: 16px;
}

.error.show {
    display: block;
}

@media (max-width: 768px) {
    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .date-selector {
        justify-content: center;
    }

    .period-selector {
        justify-content: center;
    }

    .refresh-btn {
        margin-left: 0;
        justify-content: center;
    }

    .summary-bar {
        flex-wrap: wrap;
        gap: 16px;
    }

    .header h1 {
        font-size: 22px;
    }
}
