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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f6fa;
    color: #333;
    -webkit-font-smoothing: antialiased;
}

#app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
}

/* Header */
.header {
    background: linear-gradient(135deg, #4e79ff, #2d5cff);
    color: white;
    padding: 16px;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(45, 92, 255, 0.3);
}

.header h1 {
    font-size: 18px;
    font-weight: 600;
}

.date-info {
    margin-top: 6px;
    font-size: 13px;
    opacity: 0.9;
}

.total-score {
    margin-left: 8px;
    font-weight: 600;
}

/* Tabs */
.tabs {
    display: flex;
    background: white;
    border-bottom: 1px solid #e8e8e8;
    position: sticky;
    top: 56px;
    z-index: 99;
}

.tab {
    flex: 1;
    padding: 12px 0;
    text-align: center;
    font-size: 14px;
    color: #999;
    border: none;
    background: none;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

.tab.active {
    color: #2d5cff;
    font-weight: 600;
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 25%;
    right: 25%;
    height: 3px;
    background: #2d5cff;
    border-radius: 2px;
}

/* Tab Content */
.tab-content {
    display: none;
    padding: 12px;
}

.tab-content.active {
    display: block;
}

/* Card */
.card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.card h3 {
    font-size: 15px;
    color: #333;
    margin-bottom: 12px;
}

/* Chart */
.chart {
    width: 100%;
    height: 280px;
}

/* Ranking List */
.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rank-item {
    background: white;
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.rank-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f0f0f0;
    color: #666;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.rank-num.top1 { background: #ff4d4f; color: white; }
.rank-num.top2 { background: #ff7a45; color: white; }
.rank-num.top3 { background: #ffa940; color: white; }

.rank-info {
    flex: 1;
    min-width: 0;
}

.rank-name {
    font-size: 15px;
    font-weight: 500;
    color: #333;
}

.rank-meta {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

.rank-score {
    font-size: 16px;
    font-weight: 600;
    color: #2d5cff;
    flex-shrink: 0;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.filter-select {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    background: white;
    outline: none;
}

.filter-select:focus {
    border-color: #2d5cff;
}

/* Search */
.search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.search-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.search-input:focus {
    border-color: #2d5cff;
}

.search-btn {
    padding: 10px 20px;
    background: #2d5cff;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

/* Employee Detail */
.emp-detail {
    display: none;
}

.emp-detail.active {
    display: block;
}

.emp-header {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.emp-name {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.emp-meta {
    font-size: 13px;
    color: #999;
    margin-top: 4px;
}

.emp-total {
    font-size: 28px;
    font-weight: 700;
    color: #2d5cff;
    margin-top: 12px;
}

.emp-rank {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

.emp-scores {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.score-item {
    background: white;
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.score-label {
    font-size: 14px;
    color: #666;
}

.score-value {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 14px;
}

/* Empty */
.empty {
    text-align: center;
    padding: 40px;
    color: #ccc;
    font-size: 14px;
}

/* Login Mask */
.login-mask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f5f6fa;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

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

.login-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e0e0e0;
    border-top-color: #2d5cff;
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 0.8s linear infinite;
}

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

.login-box p {
    color: #999;
    font-size: 14px;
}

/* No Permission */
.no-perm {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f5f6fa;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.no-perm-box {
    text-align: center;
    padding: 40px;
}

.no-perm-box p {
    color: #999;
    font-size: 15px;
}

/* User Info */
.user-info {
    margin-left: 8px;
    font-size: 12px;
    opacity: 0.8;
}
