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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

header h1 {
    font-size: 1.5rem;
    color: #2c3e50;
}

nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-name {
    color: #666;
}

.btn {
    display: inline-block;
    padding: 8px 16px;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #95a5a6;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-google {
    background: #4285f4;
    padding: 12px 24px;
    font-size: 1rem;
}

.btn-google:hover {
    background: #357abd;
}

/* Login page */
.login-container {
    text-align: center;
    padding: 60px 20px;
}

.login-container h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

.login-container p {
    color: #666;
    margin-bottom: 30px;
}

/* Dashboard */
.dashboard h2 {
    text-align: center;
    margin-bottom: 10px;
    color: #2c3e50;
}

.holiday-badge {
    display: inline-block;
    background: #9b59b6;
    color: white;
    font-size: 0.6em;
    padding: 4px 10px;
    border-radius: 12px;
    vertical-align: middle;
    margin-left: 10px;
}

.weekend-notice {
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

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

.status-column {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.status-column h3 {
    font-size: 1rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
    color: #2c3e50;
}

.status-absent h3 {
    border-bottom-color: #e74c3c;
}

.status-holiday h3 {
    border-bottom-color: #9b59b6;
}

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

.employee-list li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
}

.employee-photo {
    display: inline-block;
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
    flex-shrink: 0;
    background-color: #ddd;
}

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

.employee-list .empty {
    color: #999;
    font-style: italic;
}

.until {
    color: #999;
    font-size: 0.85rem;
}

/* Declare page */
.declare-container {
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.declare-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.declare-header h2 {
    color: #2c3e50;
}

.declare-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.declare-table th,
.declare-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.declare-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.declare-table tr.locked {
    background: #f8f9fa;
    color: #999;
}

.locked-message {
    text-align: center;
    font-style: italic;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-default {
    background: #e8f4fd;
    color: #3498db;
}

.badge-locked {
    background: #fef3e2;
    color: #e67e22;
}

.badge-absent {
    background: #fdeaea;
    color: #e74c3c;
}

.declare-notice {
    background: #fef3e2;
    border: 1px solid #f0d9b5;
    border-radius: 4px;
    padding: 12px 16px;
    margin-bottom: 20px;
    color: #8a6d3b;
}

.holiday-notice {
    text-align: center;
    padding: 40px 20px;
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
    border-radius: 8px;
    color: #2e7d32;
    font-size: 1.1rem;
}

/* Leaderboard */
.leaderboard h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #2c3e50;
}

.leaderboard-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
}

.period-tabs {
    display: flex;
    gap: 0;
}

.period-tabs .tab {
    padding: 8px 20px;
    text-decoration: none;
    color: #666;
    background: #e9ecef;
    border: 1px solid #ddd;
}

.period-tabs .tab:first-child {
    border-radius: 4px 0 0 4px;
}

.period-tabs .tab:last-child {
    border-radius: 0 4px 4px 0;
    border-left: none;
}

.period-tabs .tab.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.period-tabs .tab.disabled {
    color: #aaa;
    cursor: not-allowed;
    pointer-events: none;
}

.no-data-message {
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    color: #666;
}

.no-data-message p {
    margin-bottom: 20px;
}

.period-selector select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
}

.date-range {
    text-align: center;
    color: #666;
    margin-bottom: 20px;
}

.leaderboard-table {
    width: 100%;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-collapse: collapse;
    overflow: hidden;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.leaderboard-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.leaderboard-table .rank {
    width: 50px;
    text-align: center;
    font-weight: 600;
    color: #666;
}

.leaderboard-table .employee {
    display: flex;
    align-items: center;
}

.leaderboard-table .days {
    width: 120px;
    color: #666;
}

.leaderboard-table .percentage {
    width: 80px;
    font-weight: 600;
    color: #27ae60;
}

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

.leaderboard-table .empty {
    text-align: center;
    color: #999;
    font-style: italic;
}

/* View toggle */
.view-toggle {
    display: flex;
    gap: 0;
    margin-left: auto;
}

.view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #e9ecef;
    border: 1px solid #ddd;
    color: #666;
    text-decoration: none;
}

.view-btn:first-child {
    border-radius: 4px 0 0 4px;
}

.view-btn:last-child {
    border-radius: 0 4px 4px 0;
    border-left: none;
}

.view-btn.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.view-btn:hover:not(.active) {
    background: #ddd;
}

/* Chart view */
.leaderboard-chart {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 20px;
}

.chart-row {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.chart-row:last-child {
    border-bottom: none;
}

.chart-rank {
    width: 30px;
    font-weight: 600;
    color: #666;
    text-align: center;
    flex-shrink: 0;
}

.chart-employee {
    width: 180px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.chart-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chart-bar-container {
    flex: 1;
    position: relative;
    height: 28px;
    background: #f0f0f0;
    border-radius: 4px;
    margin-left: 15px;
    overflow: hidden;
}

.chart-bar {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    border-radius: 4px;
    min-width: 2px;
    transition: width 0.3s ease;
}

.chart-value {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    font-weight: 500;
    color: #333;
}

/* Clickable employees */
.clickable-employee {
    cursor: pointer;
}

.leaderboard-table tbody tr.clickable-employee:hover {
    background: #e8f4fd;
}

.chart-row.clickable-employee:hover {
    background: #f8f9fa;
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 420px;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.modal-employee-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #2c3e50;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

/* Calendar Navigation */
.calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.calendar-nav-btn {
    background: #f0f0f0;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.calendar-nav-btn:hover {
    background: #e0e0e0;
}

#calendar-month-label {
    font-weight: 600;
    color: #2c3e50;
}

/* Calendar Grid */
.calendar-grid {
    margin-bottom: 20px;
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #666;
    margin-bottom: 8px;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    border-radius: 6px;
    background: #f5f5f5;
    color: #333;
}

.calendar-day.empty {
    background: transparent;
}

.calendar-day.weekend {
    background: #f0f0f0;
    color: #999;
}

.calendar-day.future {
    background: #fafafa;
    color: #ccc;
}

.calendar-day.office {
    background: #27ae60;
    color: white;
}

.calendar-day.remote {
    background: #3498db;
    color: white;
}

.calendar-day.holiday {
    background: #9b59b6;
    color: white;
}

.calendar-day.absent,
.calendar-day.undeclared {
    background: #e74c3c;
    color: white;
}

/* Calendar Legend */
.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #666;
}

.legend-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

.legend-color.office {
    background: #27ae60;
}

.legend-color.remote {
    background: #3498db;
}

.legend-color.holiday {
    background: #9b59b6;
}

.legend-color.absent {
    background: #e74c3c;
}

/* Responsive */
@media (max-width: 600px) {
    header {
        flex-direction: column;
        gap: 15px;
    }

    .status-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        margin: 10px;
    }
}
