/* 打卡管理系统 - 企业级后台样式 */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

:root {
    --sidebar-bg: #0c1222;
    --sidebar-hover: #151d32;
    --sidebar-active: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    --sidebar-width: 260px;
    --accent: #2563eb;
    --accent-light: #3b82f6;
    --accent-gold: #c9a227;
    --bg: #f1f5f9;
    --surface: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 4px 6px rgba(15, 23, 42, 0.04), 0 20px 40px rgba(15, 23, 42, 0.08);
    --radius: 12px;
    --radius-sm: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'DM Sans', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.app { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    border-right: 1px solid rgba(255,255,255,0.06);
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 28px 24px 32px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.brand-logo {
    width: 44px; height: 44px;
    background: linear-gradient(135deg, #2563eb, #1e40af);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 16px; color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.brand-text { display: flex; flex-direction: column; }
.brand-text strong { color: #f8fafc; font-size: 17px; font-weight: 600; }
.brand-text span { font-size: 11px; color: #64748b; text-transform: uppercase; letter-spacing: 1.2px; margin-top: 2px; }

.nav { flex: 1; padding: 20px 12px; }

.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 16px;
    margin-bottom: 4px;
    border-radius: var(--radius-sm);
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-item:hover { background: var(--sidebar-hover); color: #e2e8f0; }
.nav-item.active {
    background: var(--sidebar-active);
    color: #fff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.nav-icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer {
    padding: 20px 24px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.sidebar-stat { display: flex; justify-content: space-between; font-size: 13px; color: #64748b; }
.sidebar-stat strong { color: var(--accent-gold); font-size: 18px; }

.main {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 24px 36px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky; top: 0; z-index: 50;
}

.topbar h1 { font-size: 24px; font-weight: 700; color: var(--text); }
.topbar-desc { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.date-badge {
    background: #f8fafc;
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.content { padding: 28px 36px 48px; flex: 1; }

.toast { padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 24px; font-size: 14px; font-weight: 500; }
.toast-success { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.toast-error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }

.panel {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 24px;
    overflow: hidden;
}

.panel-head {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-head h2 { font-size: 16px; font-weight: 600; }
.panel-head p { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.panel-body { padding: 24px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

@media (max-width: 1200px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); }
    .main { margin-left: 0; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .content { padding: 20px; }
    .topbar { padding: 16px 20px; }
}

.metric-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.metric-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.metric-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
}

.metric-card.gold::before { background: linear-gradient(90deg, #c9a227, #dbb94a); }
.metric-card.green::before { background: linear-gradient(90deg, #059669, #10b981); }
.metric-card.orange::before { background: linear-gradient(90deg, #ea580c, #f97316); }
.metric-card.purple::before { background: linear-gradient(90deg, #7c3aed, #8b5cf6); }

.metric-label { font-size: 13px; color: var(--text-muted); font-weight: 500; margin-bottom: 8px; }
.metric-value { font-size: 32px; font-weight: 700; color: var(--text); line-height: 1.2; }
.metric-unit { font-size: 14px; font-weight: 500; color: var(--text-muted); }

.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }
.form-field label { display: block; font-size: 13px; font-weight: 500; color: var(--text-muted); margin-bottom: 6px; }
.form-field input, .form-field select, .form-field textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.form-field.full { grid-column: 1 / -1; }

.form-actions { display: flex; gap: 12px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 20px;
    border: none; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 600; font-family: inherit;
    cursor: pointer; transition: all 0.2s;
    text-decoration: none;
}
.btn-primary { background: linear-gradient(135deg, #2563eb, #1d4ed8); color: #fff; box-shadow: 0 2px 8px rgba(37,99,235,0.3); }
.btn-primary:hover { background: linear-gradient(135deg, #3b82f6, #2563eb); transform: translateY(-1px); }
.btn-ghost { background: #f8fafc; color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.btn-danger:hover { background: #fee2e2; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-link { background: none; border: none; color: var(--accent); padding: 4px 8px; cursor: pointer; font-size: 13px; font-weight: 500; text-decoration: none; }
.btn-link.danger { color: #dc2626; }

.checkbox-inline { display: flex; align-items: center; gap: 8px; padding-top: 28px; }
.checkbox-inline input { width: 16px; height: 16px; accent-color: var(--accent); }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th {
    text-align: left; padding: 12px 16px;
    background: #f8fafc; color: var(--text-muted);
    font-weight: 600; font-size: 12px;
    text-transform: uppercase; letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}
.data-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tbody tr:hover { background: #f8fafc; }
.data-table tbody tr:last-child td { border-bottom: none; }

.emp-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #1e40af);
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 600;
    margin-right: 12px;
    flex-shrink: 0;
}

.emp-cell { display: flex; align-items: center; }
.emp-name { font-weight: 600; color: var(--text); text-decoration: none; display: block; }
.emp-name:hover { color: var(--accent); }
.emp-sub { font-size: 12px; color: var(--text-muted); }

.tag { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.tag-green { background: #ecfdf5; color: #059669; }
.tag-orange { background: #fff7ed; color: #ea580c; }
.tag-blue { background: #eff6ff; color: #2563eb; }
.tag-red { background: #fef2f2; color: #dc2626; }
.tag-purple { background: #f5f3ff; color: #7c3aed; }

.empty-state { text-align: center; padding: 60px 24px; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.4; }
.empty-state h3 { font-size: 16px; color: var(--text); margin-bottom: 8px; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 16px; align-items: end; margin-bottom: 24px; }
.actions-cell { display: flex; gap: 8px; align-items: center; }

.detail-header { display: flex; align-items: center; gap: 20px; margin-bottom: 28px; }
.detail-avatar {
    width: 72px; height: 72px;
    border-radius: 16px;
    background: linear-gradient(135deg, #2563eb, #1e40af);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; font-weight: 700;
    box-shadow: 0 8px 24px rgba(37,99,235,0.3);
}
.detail-info h1 { font-size: 26px; font-weight: 700; margin-bottom: 4px; }
.detail-info p { color: var(--text-muted); font-size: 14px; }

.highlight-metrics .metric-card { border-color: #bfdbfe; background: linear-gradient(180deg, #fff 0%, #f8faff 100%); }

/* 编辑弹窗 - 屏幕正中 */
body.modal-open { overflow: hidden; }

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-overlay.open {
    display: flex;
}

.modal {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: 0 25px 50px rgba(15, 23, 42, 0.2);
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    border: 1px solid var(--border);
    margin: auto;
    animation: modalPop 0.25s ease;
    position: relative;
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 { font-size: 18px; font-weight: 600; }
.modal-close {
    background: none; border: none; font-size: 24px;
    color: var(--text-muted); cursor: pointer; line-height: 1;
    padding: 4px 8px; border-radius: 4px;
}
.modal-close:hover { background: #f1f5f9; color: var(--text); }

.modal-body { padding: 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}
