:root {
    /* 主色调 - 靛蓝色系 */
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;

    /* 状态颜色 */
    --success: #22c55e;
    --success-light: #4ade80;
    --warning: #f59e0b;
    --warning-light: #fbbf24;
    --danger: #ef4444;
    --danger-light: #f87171;
    --info: #06b6d4;

    /* 背景颜色 - 深色主题 */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: rgba(30, 41, 59, 0.8);

    /* 文字颜色 */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* 边框颜色 */
    --border-color: rgba(99, 102, 241, 0.2);
    --border-light: rgba(255, 255, 255, 0.1);

    /* 阴影 */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4);

    /* 圆角 */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* 过渡 */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;

    /* 状态标识颜色 */
    --status-present: #22c55e;
    --status-absent: #ef4444;
    --status-late: #f59e0b;
    --status-leave: #6b7280;
    --status-early: #f97316;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
                 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
                 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    min-height: 100vh;
    padding: 20px;
    padding-bottom: max(24px, env(safe-area-inset-bottom));
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

/* Toast 消息 */
.toast-message {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: var(--radius-lg);
    font-size: 14px;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
    opacity: 0;
    transition: all var(--transition-normal);
    z-index: 9999;
    max-width: 90%;
    text-align: center;
}

.toast-message.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-message.fade-out {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
}

/* 今日标记 */
.today-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
    color: white !important;
}

.today-cell {
    position: relative;
}

.today-cell::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
}

/* 周末标记 */
.weekend-header {
    background: rgba(107, 114, 128, 0.3) !important;
}

.weekend-cell {
    background: rgba(107, 114, 128, 0.1) !important;
}

/* 出勤率进度条 */
.summary-rate {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
}

.rate-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.rate-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success) 0%, var(--success-light) 100%);
    border-radius: 3px;
    transition: width var(--transition-slow);
}

.rate-text {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* 异常提醒 */
.summary-anomaly {
    margin-top: 8px;
    padding: 8px 10px;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--warning);
}

/* 月度概览 */
.monthly-overview {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border: 1px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
}

.overview-title {
    font-weight: 600;
    color: var(--primary-light);
    margin-bottom: 12px;
    font-size: 14px;
}

.overview-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

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

.overview-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.overview-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* 统计详情 */
.summary-detail {
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.detail-text {
    font-size: 11px;
    color: var(--text-muted);
}

/* 连续出勤徽章 */
.consecutive-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: linear-gradient(135deg, var(--success) 0%, var(--success-light) 100%);
    color: white;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    gap: 20px;
    flex-wrap: wrap;
}

.header-left {
    flex: 1;
    min-width: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info span {
    font-size: 15px;
    opacity: 0.9;
    white-space: nowrap;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    width: 44px;
    height: 44px;
    justify-content: center;
    align-items: center;
}

.menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-color);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

h1 {
    font-size: 28px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 32px;
}

.controls-main {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.date-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    flex: 1;
    min-width: 240px;
}

.action-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.btn-save {
    white-space: nowrap;
    background: linear-gradient(135deg, var(--success) 0%, var(--success-light) 100%) !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
    transition: all var(--transition-normal);
}

.btn-save:hover {
    opacity: 0.95;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(34, 197, 94, 0.4);
}

.btn-save:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.admin-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    border: none;
    font-size: 14px;
    padding: 12px 18px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
    font-weight: 500;
    min-height: 48px;
}

.btn-secondary:hover {
    opacity: 0.95;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);
}

.btn-secondary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

select, button, input {
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 15px;
    outline: none;
    min-height: 48px;
    font-family: inherit;
    transition: all var(--transition-fast);
    white-space: nowrap;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

select:focus, button:focus, input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

#year-select, #month-select {
    min-width: 100px;
    flex: 1;
}

button {
    cursor: pointer;
    background: var(--bg-secondary);
    transition: all var(--transition-normal);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    font-weight: 500;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover {
    opacity: 0.95;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
    opacity: 0.95;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.35);
}

.btn-danger:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%);
    color: #1f2937;
    border: none;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

.btn-warning:hover {
    opacity: 0.95;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.35);
}

.btn-warning:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

.clickable {
    cursor: pointer;
}

.table-container {
    overflow-x: auto;
    margin-bottom: 24px;
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    box-shadow: var(--shadow-sm);
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 100%;
    background: var(--bg-secondary);
}

th, td {
    padding: 0;
    border: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-primary);
    word-break: break-word;
    position: relative;
    height: 52px;
    min-width: 44px;
}

th {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    position: sticky;
    top: 0;
    z-index: 10;
    font-weight: 600;
    letter-spacing: 0.3px;
    padding: 8px 4px;
}

.employee-name {
    position: sticky;
    left: 0;
    background: var(--bg-tertiary);
    z-index: 20;
    text-align: left;
    min-width: 70px;
    width: 70px;
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    color: var(--primary-light);
    user-select: none;
    cursor: ew-resize;
    transition: background-color var(--transition-fast);
    padding: 8px 10px !important;
    padding-right: 16px !important;
}

.employee-name::after {
    content: '';
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: linear-gradient(180deg, var(--primary) 50%, transparent 50%);
    background-size: 4px 4px;
    border-radius: 2px;
    opacity: 0.5;
    transition: opacity var(--transition-fast);
}

.employee-name:hover::after,
.employee-name.resizing::after {
    opacity: 1;
}

.employee-name:hover {
    background: var(--bg-secondary);
}

.employee-name.resizing {
    background: var(--bg-secondary);
    cursor: col-resize;
}

td.cell {
    cursor: pointer;
    transition: background var(--transition-fast);
    position: relative;
}

td.cell:hover {
    background-color: rgba(99, 102, 241, 0.1);
}

/* Card View Styles */
.card-view {
    display: none;
    grid-template-columns: 1fr;
    gap: 12px;
}

.card-view.active {
    display: grid;
}

.employee-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.employee-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.card-header {
    font-weight: 700;
    color: var(--primary-light);
    margin-bottom: 16px;
    font-size: 17px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.card-dates {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
    gap: 8px;
}

/* 卡片底部统计 */
.card-summary {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.card-summary-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
}

.card-summary-stats span {
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.card-summary-stats .stat-present { color: var(--success); }
.card-summary-stats .stat-absent { color: var(--danger); }
.card-summary-stats .stat-late { color: var(--warning); }
.card-summary-stats .stat-leave { color: var(--text-secondary); }
.card-summary-stats .stat-early { color: var(--status-early); }

.card-summary-rate {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.card-date-cell {
    text-align: center;
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    position: relative;
    color: var(--text-primary);
    font-weight: 500;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
}

.card-date-cell:active {
    transform: scale(0.95);
}

.card-day {
    font-weight: 600;
    font-size: 15px;
    line-height: 1;
}

.card-date-cell.status-present {
    background: linear-gradient(135deg, #22c7a9 0%, var(--success) 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.card-date-cell.status-absent {
    background: linear-gradient(135deg, #f87171 0%, var(--danger) 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.card-date-cell.status-late {
    background: linear-gradient(135deg, #fbbf24 0%, var(--warning) 100%);
    color: #1f2937;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.card-date-cell.status-leave {
    background: linear-gradient(135deg, #9ca3af 0%, var(--status-leave) 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(107, 114, 128, 0.3);
}

.card-date-cell.status-early {
    background: linear-gradient(135deg, #fb923c 0%, var(--status-early) 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}

/* 岗位指示器 - 固定在右下角 */
.position-indicator,
.card-position-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 9px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    padding: 1px 4px;
    border-radius: 2px;
    font-weight: 600;
    z-index: 5;
    line-height: 1.2;
}

.card-position-indicator {
    bottom: 2px;
    right: 2px;
}

/* Status Styles - Table View */
.status-present {
    background: linear-gradient(135deg, #22c7a9 0%, var(--success) 100%) !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}
.status-present::after { content: '✓'; font-weight: bold; font-size: 12px; }

.status-absent {
    background: linear-gradient(135deg, #f87171 0%, var(--danger) 100%) !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}
.status-absent::after { content: '✗'; font-weight: bold; font-size: 12px; }

.status-late {
    background: linear-gradient(135deg, #fbbf24 0%, var(--warning) 100%) !important;
    color: #1f2937 !important;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}
.status-late::after { content: '迟'; font-size: 10px; }

.status-leave {
    background: linear-gradient(135deg, #9ca3af 0%, var(--status-leave) 100%) !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(107, 114, 128, 0.3);
}
.status-leave::after { content: '休'; font-size: 10px; }

.status-early {
    background: linear-gradient(135deg, #fb923c 0%, var(--status-early) 100%) !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}
.status-early::after { content: '早'; font-size: 10px; }

.btn-small {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    min-height: 32px;
}

/* Modal Overlay - 固定定位，覆盖整个页面 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 16px;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideUp 0.3s ease;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
}

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

.position-modal-content {
    max-width: 360px;
}

.batch-modal-content {
    max-width: 440px;
}

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

.modal-header h2, .modal-header h3 {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.modal-header button {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    min-height: auto;
}

.modal-header button:hover {
    color: var(--text-primary);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20000;
    display: none;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Legend */
.legend {
    display: flex;
    gap: 16px;
    margin-top: 18px;
    flex-wrap: wrap;
    justify-content: flex-start;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.legend-color {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    box-shadow: var(--shadow-sm);
}

.summary {
    margin-top: 28px;
    padding: 24px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

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

.summary-header-row h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.summary-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: all var(--transition-normal);
}

.summary-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.summary-title {
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--primary-light);
    font-size: 16px;
}

.summary-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    border: 1px solid transparent;
}

.stat-present { background: rgba(34, 197, 94, 0.2); color: var(--success); border-color: rgba(34, 197, 94, 0.3); }
.stat-absent { background: rgba(239, 68, 68, 0.2); color: var(--danger); border-color: rgba(239, 68, 68, 0.3); }
.stat-late { background: rgba(245, 158, 11, 0.2); color: var(--warning); border-color: rgba(245, 158, 11, 0.3); }
.stat-leave { background: rgba(107, 114, 128, 0.2); color: var(--text-secondary); border-color: rgba(107, 114, 128, 0.3); }
.stat-early { background: rgba(249, 115, 22, 0.2); color: var(--status-early); border-color: rgba(249, 115, 22, 0.3); }
.stat-unmarked { background: var(--bg-tertiary); color: var(--text-muted); border-color: var(--border-color); }

/* Position Grid */
.position-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.position-grid button {
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.position-grid button:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Batch Fill Modal Styles */
.batch-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.batch-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.batch-form .form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.batch-form .date-range {
    display: flex;
    align-items: center;
    gap: 10px;
}

.batch-form .date-range input {
    flex: 1;
    min-width: 0;
}

.batch-form .date-range span {
    color: var(--text-muted);
    font-size: 14px;
}

.employee-check-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.check-item {
    display: flex;
    align-items: center;
}

.check-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
    flex: 1;
}

.check-item label:hover {
    background: var(--bg-secondary);
}

.check-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-height: auto;
    cursor: pointer;
}

.check-all {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.batch-form select {
    width: 100%;
}

.batch-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.batch-actions button {
    flex: 1;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 24px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 16px;
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }

    .container {
        padding: 20px;
        border-radius: var(--radius-md);
    }

    header {
        flex-wrap: wrap;
        gap: 16px;
    }

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

    .menu-toggle {
        display: flex;
    }

    .controls-main {
        width: 100%;
        gap: 12px;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
    }

    .date-controls {
        width: 100%;
        min-width: 100%;
        gap: 10px;
        display: flex;
        min-height: 48px;
    }

    .date-controls select {
        flex: 1;
        min-width: 0;
    }

    .action-buttons {
        width: 100%;
        justify-content: flex-start;
        gap: 10px;
    }

    .action-buttons button {
        flex: 1;
        min-width: 0;
    }

    .btn-save {
        flex: 1;
    }

    #view-toggle {
        display: flex !important;
    }

    .admin-controls {
        width: 100%;
        display: none;
        flex-direction: column;
        gap: 12px;
    }

    .admin-controls.mobile-visible {
        display: flex;
    }

    #admin-controls button {
        width: 100%;
        justify-content: center;
    }

    td.cell {
        height: 48px;
        min-width: 42px;
        font-size: 13px;
    }

    th {
        padding: 8px 4px;
        font-size: 12px;
    }

    .employee-name {
        min-width: 70px !important;
        width: 70px !important;
        max-width: 70px !important;
        font-size: 13px;
        padding: 8px 10px !important;
    }

    .table-container {
        -webkit-overflow-scrolling: touch;
        border-radius: var(--radius-md);
    }

    button, .btn-small {
        min-height: 44px;
    }

    select, button, input {
        padding: 10px 12px;
        font-size: 16px;
    }

    table {
        font-size: 12px;
        min-width: 600px;
    }

    .summary-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .legend {
        font-size: 11px;
        gap: 10px;
        padding: 12px;
    }

    .legend-color {
        width: 16px;
        height: 16px;
    }

    .batch-actions {
        flex-direction: column;
    }

    .batch-actions button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    header {
        gap: 8px;
    }

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

    .controls-main {
        flex-direction: column;
        align-items: stretch;
    }

    .date-controls {
        width: 100%;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons button {
        width: 100%;
    }

    #year-select, #month-select {
        min-width: 70px;
    }

    .modal-content {
        padding: 16px;
    }
}

/* Login specific styles */
.login-content {
    max-width: 380px;
    padding: 40px 28px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    background: var(--bg-secondary);
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-header h3 {
    font-size: 24px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.input-group input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid var(--border-color);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
    background: var(--bg-secondary);
}

.btn-block {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--radius-md);
    letter-spacing: 0.5px;
    margin-top: 8px;
}

.btn-block:active {
    transform: scale(0.98);
}

.login-error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    padding: 12px;
    border-radius: var(--radius-md);
    font-size: 14px;
    margin-bottom: 20px;
    display: none;
    text-align: center;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.login-error.show {
    display: block;
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

@media (max-width: 480px) {
    .login-content {
        width: 95%;
        padding: 28px 20px;
    }

    .login-header h3 {
        font-size: 22px;
    }

    .input-group input {
        padding: 16px;
        font-size: 16px;
    }

    .btn-block {
        padding: 16px;
        font-size: 16px;
    }
}

/* Empty State */
#empty-state {
    margin: 12px 0 20px;
    padding: 16px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-md);
    color: var(--warning);
    font-size: 14px;
    text-align: center;
}

/* Error Bar */
#error-bar {
    margin: 12px 0 20px;
    padding: 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
    border-radius: var(--radius-md);
    font-size: 14px;
}

/* Ultra-small screens */
@media (max-width: 360px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 12px;
    }

    h1 {
        font-size: 16px;
    }

    .header-right {
        gap: 6px;
    }

    .user-info span {
        font-size: 12px;
    }

    .date-controls {
        gap: 6px;
    }

    .date-controls select {
        padding: 8px 6px;
        font-size: 14px;
    }

    .btn-secondary {
        padding: 8px 10px;
        font-size: 12px;
    }

    .employee-name {
        width: 55px !important;
        min-width: 55px !important;
        max-width: 55px !important;
        font-size: 11px;
    }
}
