/* ===== Login Screen ===== */
.login-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 40%, rgba(26,86,219,.15) 0%, transparent 60%),
                radial-gradient(circle at 70% 60%, rgba(124,58,237,.1) 0%, transparent 60%);
    pointer-events: none;
}

.login-card {
    position: relative;
    background: rgba(255,255,255,.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 20px;
    padding: 48px 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 25px 50px rgba(0,0,0,.3);
    animation: loginFadeIn .6s ease;
}

@keyframes loginFadeIn {
    from { opacity: 0; transform: translateY(20px) scale(.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo {
    text-align: center;
    margin-bottom: 36px;
}

.login-logo-icon {
    width: 64px; height: 64px;
    background: linear-gradient(135deg, #1a56db, #7c3aed);
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
    font-size: 28px;
    color: #fff;
    box-shadow: 0 8px 20px rgba(26,86,219,.4);
}

.login-logo h1 {
    color: #fff;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 6px;
}

.login-logo p {
    color: rgba(255,255,255,.5);
    font-size: 13px;
    font-weight: 400;
}

/* Login Tabs */
.login-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    background: rgba(255,255,255,.06);
    border-radius: 12px;
    padding: 4px;
}

.login-tab {
    flex: 1;
    padding: 10px 12px;
    background: transparent;
    border: none;
    color: rgba(255,255,255,.45);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 10px;
    transition: all .25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: inherit;
}

.login-tab:hover {
    color: rgba(255,255,255,.7);
    background: rgba(255,255,255,.06);
}

.login-tab.active {
    background: rgba(26,86,219,.5);
    color: #fff;
    box-shadow: 0 2px 8px rgba(26,86,219,.3);
}

.login-tab i {
    font-size: 14px;
}

.login-input-group {
    position: relative;
    margin-bottom: 16px;
}

.login-input-group i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,.35);
    font-size: 15px;
}

.login-input-group input,
.login-input-group select.login-select {
    width: 100%;
    padding: 14px 16px 14px 46px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    font-family: var(--font-cn);
    transition: all .25s ease;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.login-input-group select.login-select option {
    background: #1e293b;
    color: #fff;
    padding: 10px;
}

.login-input-group input::placeholder {
    color: rgba(255,255,255,.35);
}

.login-input-group input:focus,
.login-input-group select.login-select:focus {
    border-color: rgba(26,86,219,.6);
    background: rgba(255,255,255,.12);
    box-shadow: 0 0 0 3px rgba(26,86,219,.2);
}

.login-error {
    color: #f87171;
    font-size: 13px;
    min-height: 20px;
    margin-bottom: 8px;
    text-align: center;
    font-weight: 500;
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #1a56db, #1242a3);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all .25s ease;
    font-family: var(--font-cn);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login-btn:hover {
    background: linear-gradient(135deg, #1242a3, #0e3690);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(26,86,219,.4);
}

.login-btn:active {
    transform: translateY(0);
}

.login-footer {
    text-align: center;
    margin-top: 28px;
    color: rgba(255,255,255,.25);
    font-size: 11px;
    letter-spacing: .5px;
}

@media (max-width: 480px) {
    .login-card { padding: 36px 24px; }
    .login-logo-icon { width: 56px; height: 56px; font-size: 24px; }
    .login-logo h1 { font-size: 20px; }
}

/* ===== CSS Variables & Reset ===== */
:root {
    --primary: #1a56db;
    --primary-light: #e1effe;
    --primary-dark: #1242a3;
    --success: #059669;
    --success-light: #d1fae5;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --info: #0891b2;
    --info-light: #cffafe;
    --purple: #7c3aed;
    --purple-light: #ede9fe;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --topbar-height: 64px;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
    --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
    --shadow-xl: 0 20px 25px rgba(0,0,0,.1), 0 10px 10px rgba(0,0,0,.04);
    --transition: .25s cubic-bezier(.4,0,.2,1);
    --font-cn: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
    --font-en: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
}

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

html { font-size: 14px; -webkit-font-smoothing: antialiased; }

body {
    font-family: var(--font-cn);
    background: var(--gray-50);
    color: var(--gray-800);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--gray-900) 0%, #1a2332 100%);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0; top: 0;
    z-index: 100;
    transition: all var(--transition);
    overflow: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
    min-width: var(--sidebar-collapsed);
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,.08);
    min-height: 72px;
}

.logo { display: flex; align-items: center; gap: 12px; overflow: hidden; }

.logo-icon {
    width: 36px; height: 36px;
    background: var(--primary);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 16px;
    flex-shrink: 0;
}

.logo-text { display: flex; flex-direction: column; white-space: nowrap; }
.logo-title { color: #fff; font-size: 15px; font-weight: 700; letter-spacing: .5px; }
.logo-subtitle { color: var(--gray-400); font-size: 11px; margin-top: 2px; }

.sidebar.collapsed .logo-text,
.sidebar.collapsed .sidebar-footer .user-details,
.sidebar.collapsed .nav-item span { display: none; }

.sidebar-toggle {
    background: none; border: none; color: var(--gray-400);
    cursor: pointer; width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-xs);
    transition: var(--transition);
    flex-shrink: 0;
}
.sidebar-toggle:hover { color: #fff; background: rgba(255,255,255,.1); }
.sidebar.collapsed .sidebar-toggle i { transform: rotate(180deg); }

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    color: var(--gray-400);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
}
.nav-item i { width: 20px; text-align: center; font-size: 15px; flex-shrink: 0; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-item.active {
    color: #fff;
    background: var(--primary);
    box-shadow: 0 2px 8px rgba(26,86,219,.4);
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,.08);
}

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

.user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.user-details { display: flex; flex-direction: column; overflow: hidden; }
.user-name { color: #fff; font-size: 13px; font-weight: 600; }
.user-role { color: var(--gray-400); font-size: 11px; }

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition);
}

.sidebar.collapsed ~ .main-content { margin-left: var(--sidebar-collapsed); }

/* ===== Topbar ===== */
.topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-left { display: flex; align-items: center; gap: 16px; }

.menu-btn {
    display: none;
    background: none; border: none;
    font-size: 18px; color: var(--gray-600);
    cursor: pointer; padding: 8px;
    border-radius: var(--radius-xs);
}
.menu-btn:hover { background: var(--gray-100); }

.page-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
}

.topbar-right { display: flex; align-items: center; gap: 12px; }

.topbar-search {
    position: relative;
    width: 280px;
}
.topbar-search i {
    position: absolute;
    left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--gray-400); font-size: 13px;
}
.topbar-search input {
    width: 100%;
    padding: 9px 14px 9px 36px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 13px;
    background: var(--gray-50);
    color: var(--gray-800);
    transition: var(--transition);
    font-family: var(--font-cn);
}
.topbar-search input:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(26,86,219,.1);
}

.topbar-btn {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 16px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--gray-700);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-cn);
}
.topbar-btn:hover { border-color: var(--primary); color: var(--primary); }

#addCaseBtn {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
#addCaseBtn:hover { background: var(--primary-dark); }

.notification-btn { position: relative; padding: 8px 10px; }
.badge {
    position: absolute; top: 2px; right: 2px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    min-width: 18px; height: 18px;
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600;
}
.badge:empty, .badge[data-count="0"] { display: none; }

/* ===== Page Container ===== */
.page-container { flex: 1; padding: 24px 28px; overflow-y: auto; }
.page { display: none; animation: fadeIn .3s ease; }
.page.active { display: block; }

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

/* ===== Dashboard ===== */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: var(--transition);
}
.stat-card:hover { border-color: var(--gray-300); box-shadow: var(--shadow-md); }

.stat-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.stat-info { flex: 1; }
.stat-label { font-size: 12px; color: var(--gray-500); margin-bottom: 4px; font-weight: 500; }
.stat-value { font-size: 26px; font-weight: 800; font-family: var(--font-en); color: var(--gray-900); line-height: 1.2; }
.stat-change { font-size: 11px; color: var(--gray-500); margin-top: 4px; }
.stat-change .up { color: var(--success); }
.stat-change .down { color: var(--danger); }

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* 工作台左右两列布局 */
.dashboard-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: stretch;
}
.dash-left-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.dash-right-col {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.card {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-header h3 { font-size: 14px; font-weight: 600; color: var(--gray-800); }
.card-header .view-all {
    font-size: 12px; color: var(--primary); text-decoration: none; font-weight: 500;
    cursor: pointer;
}
.card-header .view-all:hover { text-decoration: underline; }

.card-body { padding: 16px 20px; }

/* ===== Deadline List (Dashboard) ===== */
.deadline-list { display: flex; flex-direction: column; gap: 12px; }

.deadline-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: var(--gray-50);
    transition: var(--transition);
    cursor: pointer;
}
.deadline-item:hover { background: var(--gray-100); }

.deadline-icon {
    width: 36px; height: 36px;
    border-radius: var(--radius-xs);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; flex-shrink: 0;
}
.deadline-icon.urgent { background: var(--danger-light); color: var(--danger); }
.deadline-icon.warning { background: var(--warning-light); color: var(--warning); }
.deadline-icon.normal { background: var(--info-light); color: var(--info); }

.deadline-info { flex: 1; min-width: 0; }
.deadline-title { font-size: 13px; font-weight: 600; color: var(--gray-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deadline-meta { font-size: 11px; color: var(--gray-500); margin-top: 2px; }

.deadline-date {
    font-size: 12px; font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-xs);
    white-space: nowrap;
}
.deadline-date.urgent { background: var(--danger-light); color: var(--danger); }
.deadline-date.warning { background: var(--warning-light); color: var(--warning); }
.deadline-date.normal { background: var(--info-light); color: var(--info); }

/* ===== Activity Log ===== */
.activity-list { display: flex; flex-direction: column; gap: 0; }

.activity-item {
    display: flex; gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
    align-items: flex-start;
}
.activity-item:last-child { border-bottom: none; }

.activity-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 12px; font-weight: 600;
    flex-shrink: 0;
}

.activity-content { flex: 1; }
.activity-text { font-size: 13px; color: var(--gray-700); line-height: 1.5; }
.activity-text strong { color: var(--gray-900); font-weight: 600; }
.activity-time { font-size: 11px; color: var(--gray-400); margin-top: 4px; }

/* ===== Kanban Board ===== */
.kanban-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px;
}
.kanban-header h2 { font-size: 16px; font-weight: 700; }

.kanban-board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 20px;
    min-height: calc(100vh - 200px);
}

.kanban-column {
    min-width: 280px;
    width: 280px;
    flex-shrink: 0;
    background: var(--gray-100);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 200px);
}

.column-header {
    padding: 14px 16px;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 2px solid transparent;
}
.column-header h4 {
    font-size: 13px; font-weight: 600; color: var(--gray-700);
    display: flex; align-items: center; gap: 8px;
}
.column-count {
    background: var(--gray-300);
    color: var(--gray-700);
    font-size: 11px; font-weight: 700;
    min-width: 22px; height: 22px;
    border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 6px;
}

.column-body {
    flex: 1;
    padding: 8px 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kanban-card {
    background: #fff;
    border-radius: var(--radius-sm);
    padding: 14px;
    border: 1px solid var(--gray-200);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}
.kanban-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.kanban-card-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: 8px;
}
.kanban-card-type {
    font-size: 10px; font-weight: 600;
    padding: 2px 8px; border-radius: 10px;
    text-transform: uppercase;
}
.kanban-card-priority {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
}
.kanban-card-priority.urgent { background: var(--danger); }
.kanban-card-priority.high { background: var(--warning); }
.kanban-card-priority.medium { background: var(--info); }
.kanban-card-priority.low { background: var(--gray-400); }

.kanban-card-title {
    font-size: 13px; font-weight: 600; color: var(--gray-800);
    margin-bottom: 8px; line-height: 1.4;
}

.kanban-card-client {
    font-size: 11px; color: var(--gray-500); margin-bottom: 10px;
    display: flex; align-items: center; gap: 4px;
}
.kanban-card-client i { font-size: 10px; }

.kanban-card-footer {
    display: flex; align-items: center; justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid var(--gray-100);
}

.kanban-card-avatar {
    width: 24px; height: 24px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 10px; font-weight: 600;
}

.kanban-card-amount {
    font-size: 11px; color: var(--gray-500); font-weight: 500;
    font-family: var(--font-en);
}

/* Column Colors */
.kanban-column[data-status="待接案"] .column-header { border-color: var(--gray-400); }
.kanban-column[data-status="已立案"] .column-header { border-color: var(--info); }
.kanban-column[data-status="庭审阶段"] .column-header { border-color: var(--warning); }
.kanban-column[data-status="执行阶段"] .column-header { border-color: var(--purple); }
.kanban-column[data-status="已结案"] .column-header { border-color: var(--success); }

/* ===== Cases Table ===== */
.cases-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px; flex-wrap: wrap; gap: 12px;
}
.cases-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.filter-btn {
    padding: 7px 14px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--gray-600);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-cn);
}
.filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.filter-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

select.filter-select {
    padding: 7px 30px 7px 12px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--gray-700);
    font-size: 12.5px;
    cursor: pointer;
    font-family: var(--font-cn);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.cases-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.cases-table thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: .3px;
}

.cases-table tbody tr {
    transition: var(--transition);
    cursor: pointer;
}
.cases-table tbody tr:hover { background: var(--gray-50); }

.cases-table tbody td {
    padding: 14px 16px;
    font-size: 13px;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-100);
    white-space: nowrap;
}
.cases-table tbody td:nth-child(2) {
    white-space: normal;
}
.cases-table tbody tr:last-child td { border-bottom: none; }

/* Batch operations */
.batch-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
}
.selected-row { background: rgba(26,86,219,.04) !important; }
.cases-table tbody tr.selected-row:hover { background: rgba(26,86,219,.08) !important; }
.task-item.selected-row { background: rgba(26,86,219,.04) !important; }

.case-name-cell {
    display: flex; flex-direction: column; gap: 2px;
    min-width: 180px;
}
.case-name-cell .name {
    font-weight: 600; color: var(--gray-900);
    white-space: normal; word-break: break-all; line-height: 1.4;
}
.case-name-cell .number { font-size: 11px; color: var(--gray-400); font-family: var(--font-en); }

/* ===== Status & Priority Tags ===== */
.status-tag {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}
.status-tag::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
}

.status-tag.待接案 { background: var(--gray-100); color: var(--gray-600); }
.status-tag.待接案::before { background: var(--gray-400); }
.status-tag.已立案 { background: var(--info-light); color: var(--info); }
.status-tag.已立案::before { background: var(--info); }
.status-tag.庭审阶段 { background: var(--warning-light); color: var(--warning); }
.status-tag.庭审阶段::before { background: var(--warning); }
.status-tag.执行阶段 { background: var(--purple-light); color: var(--purple); }
.status-tag.执行阶段::before { background: var(--purple); }
.status-tag.已结案 { background: var(--success-light); color: var(--success); }
.status-tag.已结案::before { background: var(--success); }

.priority-tag {
    display: inline-flex; padding: 2px 8px;
    border-radius: 8px; font-size: 11px; font-weight: 600;
}
.priority-tag.紧急 { background: var(--danger-light); color: var(--danger); }
.priority-tag.高 { background: var(--warning-light); color: var(--warning); }
.priority-tag.中 { background: var(--info-light); color: var(--info); }
.priority-tag.低 { background: var(--gray-100); color: var(--gray-500); }

.type-tag {
    display: inline-flex; padding: 2px 8px;
    border-radius: 8px; font-size: 11px; font-weight: 600;
    background: var(--gray-100); color: var(--gray-600);
}

/* ===== Task Styles ===== */
.task-filters { margin-bottom: 20px; }

.task-list { display: flex; flex-direction: column; gap: 10px; }

.task-item {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: var(--transition);
    cursor: pointer;
}
.task-item:hover { border-color: var(--primary); box-shadow: var(--shadow); }

.task-checkbox {
    width: 20px; height: 20px;
    border: 2px solid var(--gray-300);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition);
}
.task-checkbox:hover { border-color: var(--primary); }
.task-checkbox.completed {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
    font-size: 10px;
}

.task-content { flex: 1; min-width: 0; }
.task-title { font-size: 13px; font-weight: 600; color: var(--gray-800); margin-bottom: 4px; }
.task-title.completed { text-decoration: line-through; color: var(--gray-400); }
.task-meta { font-size: 11.5px; color: var(--gray-500); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.task-meta i { font-size: 11px; }

.task-assignee {
    display: flex; align-items: center; gap: 6px;
}
.task-assignee-avatar {
    width: 22px; height: 22px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 9px; font-weight: 600;
}

.task-due {
    font-size: 12px; font-weight: 600;
    padding: 3px 8px; border-radius: var(--radius-xs);
}
.task-due.overdue { background: var(--danger-light); color: var(--danger); }
.task-due.soon { background: var(--warning-light); color: var(--warning); }
.task-due.normal { background: var(--gray-100); color: var(--gray-600); }

/* ===== Team Grid ===== */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.team-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    transition: var(--transition);
}
.team-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }

.team-avatar {
    width: 64px; height: 64px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 24px; font-weight: 700;
    margin: 0 auto 12px;
}

.team-name { font-size: 16px; font-weight: 700; color: var(--gray-900); margin-bottom: 4px; }
.team-role {
    font-size: 12px; font-weight: 500;
    padding: 2px 10px; border-radius: 10px;
    display: inline-block; margin-bottom: 8px;
    background: var(--primary-light); color: var(--primary);
}
.team-specialty { font-size: 12px; color: var(--gray-500); margin-bottom: 16px; }

.team-stats {
    display: flex; justify-content: center; gap: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-100);
}
.team-stat { text-align: center; }
.team-stat-value { font-size: 20px; font-weight: 800; font-family: var(--font-en); color: var(--gray-900); }
.team-stat-label { font-size: 11px; color: var(--gray-500); margin-top: 2px; }

/* ===== Analytics Charts ===== */
.analytics-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.chart-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 20px;
}
.chart-card h3 { font-size: 14px; font-weight: 600; color: var(--gray-800); margin-bottom: 16px; }
.chart-container { position: relative; height: 300px; }

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 16px;
    overflow-y: auto;
}
.modal-overlay.active { display: flex; }

.modal {
    background: #fff;
    border-radius: var(--radius);
    width: 100%;
    max-width: 900px;
    max-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    animation: slideUp .3s ease;
}

@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } }

.modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex; align-items: center; justify-content: space-between;
    flex-shrink: 0;
}
.modal-header h3 { font-size: 16px; font-weight: 700; color: var(--gray-900); }

.close-btn {
    background: none; border: none;
    color: var(--gray-400); font-size: 18px;
    cursor: pointer; padding: 4px;
    border-radius: var(--radius-xs);
    transition: var(--transition);
}
.close-btn:hover { color: var(--gray-600); background: var(--gray-100); }

.modal-body { padding: 24px; flex: 1; overflow-y: auto; min-height: 0; }

/* ===== Form ===== */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.form-grid .full-width { grid-column: 1 / -1; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
    font-size: 12px; font-weight: 600; color: var(--gray-700);
}
.form-label .required { color: var(--danger); margin-left: 2px; }

.form-input, .form-select, .form-textarea {
    padding: 9px 12px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--gray-800);
    transition: var(--transition);
    font-family: var(--font-cn);
    background: #fff;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,.1);
}
.form-textarea { min-height: 80px; resize: vertical; }

.form-actions {
    display: flex; justify-content: flex-end; gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-100);
}

.btn {
    padding: 9px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    font-family: var(--font-cn);
    display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--gray-100); color: var(--gray-700); border-color: var(--gray-200); }
.btn-secondary:hover { background: var(--gray-200); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #047857; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon { padding: 6px 8px; }

/* ===== Notification Panel ===== */
.notification-panel {
    position: fixed;
    top: 0; right: -400px;
    width: 400px;
    height: 100vh;
    background: #fff;
    box-shadow: var(--shadow-xl);
    z-index: 300;
    display: flex; flex-direction: column;
    transition: right var(--transition);
}
.notification-panel.active { right: 0; }

.notif-header {
    padding: 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex; align-items: center; justify-content: space-between;
}
.notif-header h3 {
    font-size: 15px; font-weight: 700; color: var(--gray-900);
    display: flex; align-items: center; gap: 8px;
}
.notif-header h3 i { color: var(--warning); }

.notif-body { flex: 1; padding: 16px; overflow-y: auto; }

.notif-item {
    padding: 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    border-left: 3px solid;
    cursor: pointer;
    transition: var(--transition);
}
.notif-item:hover { transform: translateX(4px); }
.notif-item.urgent { background: var(--danger-light); border-color: var(--danger); }
.notif-item.warning { background: var(--warning-light); border-color: var(--warning); }
.notif-item.info { background: var(--info-light); border-color: var(--info); }

.notif-item-title { font-size: 13px; font-weight: 600; color: var(--gray-800); margin-bottom: 4px; }
.notif-item-desc { font-size: 12px; color: var(--gray-600); line-height: 1.5; }
.notif-item-time { font-size: 11px; color: var(--gray-400); margin-top: 6px; }

/* ===== Search Results ===== */
.search-results-panel {
    position: fixed;
    top: var(--topbar-height);
    right: 28px;
    width: 400px;
    max-height: 500px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    z-index: 150;
    display: flex; flex-direction: column;
    border: 1px solid var(--gray-200);
}

.search-results-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--gray-200);
    display: flex; align-items: center; justify-content: space-between;
}
.search-results-header h3 { font-size: 13px; font-weight: 600; color: var(--gray-700); }

.search-results-body { padding: 8px; overflow-y: auto; flex: 1; }

.search-result-item {
    padding: 10px 12px;
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: var(--transition);
    display: flex; align-items: center; gap: 12px;
}
.search-result-item:hover { background: var(--gray-50); }

.search-result-icon {
    width: 32px; height: 32px;
    border-radius: var(--radius-xs);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; flex-shrink: 0;
    background: var(--primary-light); color: var(--primary);
}

.search-result-info { flex: 1; min-width: 0; }
.search-result-title { font-size: 13px; font-weight: 600; color: var(--gray-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result-meta { font-size: 11px; color: var(--gray-500); }

/* ===== Toast ===== */
.toast-container {
    position: fixed;
    top: 20px; right: 20px;
    z-index: 1000;
    display: flex; flex-direction: column; gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: toastIn .3s ease;
    display: flex; align-items: center; gap: 8px;
    min-width: 250px;
}
.toast.success { background: var(--success); color: #fff; }
.toast.error { background: var(--danger); color: #fff; }
.toast.info { background: var(--primary); color: #fff; }
.toast.warning { background: var(--warning); color: #fff; }

@keyframes toastIn { from { opacity: 0; transform: translateX(50px); } to { opacity: 1; transform: translateX(0); } }

/* ===== Case Detail View ===== */
.case-detail { max-width: 100%; }

.case-detail-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: 16px; flex-wrap: wrap; gap: 10px;
}

.case-detail-title-section { flex: 1; }
.case-detail-title-section h2 { font-size: 20px; font-weight: 800; color: var(--gray-900); margin-bottom: 8px; }
.case-detail-tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.case-detail-actions { display: flex; gap: 8px; }

.case-detail-tabs {
    display: flex; gap: 0;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 14px;
}
.case-detail-tab {
    padding: 10px 20px;
    font-size: 13px; font-weight: 600;
    color: var(--gray-500);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
    background: none; border-top: none; border-left: none; border-right: none;
    font-family: var(--font-cn);
}
.case-detail-tab:hover { color: var(--gray-700); }
.case-detail-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.case-detail-content {}

.detail-section {
    margin-bottom: 16px;
}
.detail-section-title {
    font-size: 14px; font-weight: 700; color: var(--gray-800);
    margin-bottom: 10px; display: flex; align-items: center; gap: 8px;
}
.detail-section-title i { color: var(--primary); font-size: 14px; }

.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.detail-field {}
.detail-field-label { font-size: 11px; color: var(--gray-500); font-weight: 500; margin-bottom: 4px; text-transform: uppercase; letter-spacing: .3px; }
.detail-field-value { font-size: 13px; color: var(--gray-800); font-weight: 500; }
.detail-field-value.amount { font-family: var(--font-en); font-weight: 700; color: var(--gray-900); }

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-400);
}
.empty-state i { font-size: 48px; margin-bottom: 16px; }
.empty-state p { font-size: 14px; color: var(--gray-500); }

/* ===== Data IO ===== */
.export-card {
    flex: 1;
    min-width: 220px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
}
.export-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.export-icon {
    width: 44px; height: 44px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; flex-shrink: 0;
}
.export-info { flex: 1; min-width: 0; }
.export-title { font-size: 13px; font-weight: 600; color: var(--gray-800); margin-bottom: 2px; }
.export-desc { font-size: 11px; color: var(--gray-500); }
.export-count {
    font-size: 11px; font-weight: 600;
    color: var(--gray-500);
    padding: 3px 8px;
    background: var(--gray-100);
    border-radius: var(--radius-xs);
    white-space: nowrap;
}

.import-drop-zone {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
}
.import-drop-zone:hover {
    border-color: var(--primary);
    background: rgba(26,86,219,.03);
}

/* ===== Assist Lawyer Multi-Select ===== */
.assist-lawyer-select {
    position: relative;
}

.assist-lawyer-tags {
    min-height: 40px;
    padding: 6px 10px;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    cursor: pointer;
    transition: border-color .2s ease;
}

.assist-lawyer-tags:hover {
    border-color: var(--primary);
}

.assist-placeholder {
    color: var(--gray-400);
    font-size: 13px;
}

.assist-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    border-radius: 14px;
}

.assist-tag i {
    font-size: 10px;
    cursor: pointer;
    opacity: .6;
    transition: opacity .15s;
}

.assist-tag i:hover {
    opacity: 1;
}

.assist-lawyer-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    margin-top: 4px;
    max-height: 240px;
    overflow-y: auto;
}

.assist-lawyer-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13px;
    transition: background .1s;
}

.assist-lawyer-option:hover {
    background: var(--gray-50);
}

.assist-lawyer-option input[type="checkbox"] {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* ===== Progress Tracking Timeline ===== */
.progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.progress-overview {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.progress-overview-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 90px;
}

.progress-overview-label {
    font-size: 11px;
    color: var(--gray-400);
    font-weight: 500;
}

.progress-overview-stage {
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.progress-bar-track {
    flex: 1;
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width .6s cubic-bezier(.4,0,.2,1);
}

.progress-overview-pct {
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-700);
    min-width: 36px;
    text-align: right;
}

/* Timeline */
.progress-timeline {
    position: relative;
    padding-left: 0;
}

.timeline-item {
    display: flex;
    gap: 16px;
    min-height: 80px;
}

.timeline-connector {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    width: 20px;
}

.timeline-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 16px;
}

.timeline-line {
    width: 2px;
    flex: 1;
    background: var(--gray-200);
    margin: 4px 0;
}

.timeline-content {
    flex: 1;
    padding-bottom: 16px;
    min-width: 0;
}

.timeline-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 14px 16px;
    transition: all .2s ease;
}

.timeline-item.latest .timeline-card {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(26,86,219,.08);
}

.timeline-item.milestone .timeline-card {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-color: #f59e0b;
}

.timeline-card:hover {
    box-shadow: var(--shadow-md);
}

.timeline-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.timeline-stage {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.timeline-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.timeline-date {
    font-size: 11px;
    color: var(--gray-400);
    display: flex;
    align-items: center;
    gap: 4px;
}

.timeline-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    color: var(--gray-400);
    padding: 4px;
    border-radius: 4px;
    transition: all .15s ease;
    opacity: 0;
}

.timeline-card:hover .timeline-action-btn {
    opacity: 1;
}

.timeline-action-btn:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.timeline-action-btn.danger:hover {
    color: var(--danger);
    background: var(--danger-light);
}

.timeline-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 4px;
    line-height: 1.5;
}

.timeline-desc {
    font-size: 12px;
    color: var(--gray-600);
    line-height: 1.7;
    margin-bottom: 8px;
    white-space: pre-wrap;
}

.timeline-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 11px;
    color: var(--gray-400);
}

.timeline-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.milestone-badge {
    color: #d97706 !important;
    font-weight: 600;
    background: #fef3c7;
    padding: 1px 8px;
    border-radius: 10px;
}

/* Progress Overlay (second modal layer) */
.progress-overlay {
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: rgba(0,0,0,.4);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity .2s ease;
}

.progress-overlay.active {
    opacity: 1;
}

.progress-modal {
    background: #fff;
    border-radius: var(--radius);
    width: 100%;
    max-width: 640px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    transform: translateY(10px);
    transition: transform .2s ease;
}

.progress-overlay.active .progress-modal {
    transform: translateY(0);
}

.progress-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
    border-radius: var(--radius) var(--radius) 0 0;
}

.progress-modal-header h3 {
    font-size: 15px;
    font-weight: 700;
}

.progress-modal-body {
    padding: 20px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--gray-300);
    border-radius: 22px;
    transition: .3s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: .3s ease;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(18px);
}

/* ===== Cases Page Search ===== */
.cases-search {
    min-width: 180px;
    max-width: 280px;
}
.cases-search input {
    font-size: 12.5px;
}

/* ===== Proactive Alert Animation ===== */
@keyframes shake {
    from { transform: rotate(-8deg); }
    to { transform: rotate(8deg); }
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: .3; }
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .dashboard-grid, .dashboard-grid-2col, .chart-grid { grid-template-columns: 1fr; }
    .topbar-search { width: 200px; }
    .analytics-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 200;
    }
    .sidebar.mobile-open { transform: translateX(0); }

    .main-content { margin-left: 0 !important; }
    .menu-btn { display: flex; }

    .topbar { padding: 0 16px; }
    .page-container { padding: 16px; }

    /* 优化#12：移动端保留搜索，调整布局 */
    .topbar-search:not(.cases-search) {
        position: fixed;
        top: var(--topbar-height);
        left: 0;
        right: 0;
        z-index: 49;
        width: 100% !important;
        padding: 8px 16px;
        background: #fff;
        border-bottom: 1px solid var(--gray-200);
        box-shadow: var(--shadow-sm);
        display: none;
    }
    .topbar-search:not(.cases-search).mobile-show {
        display: block;
    }
    .topbar-search:not(.cases-search) input {
        width: 100%;
    }
    .btn-text { display: none; }
    #addCaseBtn { padding: 8px 10px; }

    .form-grid { grid-template-columns: 1fr; }
    .stat-cards { grid-template-columns: repeat(2, 1fr); }
    .analytics-cards { grid-template-columns: 1fr; }

    .kanban-column { min-width: 260px; width: 260px; }
    .notification-panel { width: 100%; right: -100%; }

    /* 优化#12：移动端表格优先显示状态和优先级，隐藏程序/委托人/金额 */
    .cases-table { font-size: 12px; }
    .cases-table th:nth-child(4),
    .cases-table td:nth-child(4),
    .cases-table th:nth-child(8),
    .cases-table td:nth-child(8),
    .cases-table th:nth-child(9),
    .cases-table td:nth-child(9) { display: none; }

    .team-grid { grid-template-columns: 1fr; }
    .search-results-panel { width: calc(100% - 32px); right: 16px; }

    .progress-overview { flex-wrap: wrap; padding: 12px; }
    .timeline-action-btn { opacity: 1; }
    .progress-modal { max-width: 100%; margin: 10px; }

    /* 案件列表页搜索框移动端显示 */
    .cases-search { min-width: 100%; margin-left: 0 !important; margin-top: 8px; }
    .cases-filters { flex-direction: row; flex-wrap: wrap; }

    /* 主动提醒弹窗移动端适配 */
    #proactiveAlertOverlay > div { margin: 10px; max-width: 100%; }

    /* 优化#12：移动端工具栏排列优化 */
    .cases-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .cases-toolbar > div:last-child {
        justify-content: flex-end;
    }

    /* 移动端模态框优化 */
    .modal {
        max-width: 100%;
        margin: 4px;
        max-height: calc(100vh - 8px);
    }
    .detail-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* 移动端案件详情Tab横向滚动 */
    .case-detail-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
    }
    .case-detail-tab {
        white-space: nowrap;
        flex-shrink: 0;
    }
}

@media (max-width: 480px) {
    .stat-cards { grid-template-columns: 1fr; }
    .stat-card { padding: 16px; }
    .stat-value { font-size: 22px; }
}

/* ===== Schedule Module - 日程安排 ===== */

/* 日程页头部 */
.schedule-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}
.schedule-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}
.schedule-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0 4px;
}
.schedule-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.schedule-view-toggle {
    display: flex;
    gap: 4px;
}
.schedule-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
    font-size: 12px;
    color: var(--gray-500);
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}
.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* 月视图日历 */
.calendar-grid {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}
.calendar-weekday {
    padding: 10px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
}
.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}
.calendar-day {
    min-height: 120px;
    padding: 6px 8px;
    border-right: 1px solid var(--gray-100);
    border-bottom: 1px solid var(--gray-100);
    cursor: pointer;
    transition: background .15s;
}
.calendar-day:hover { background: var(--gray-50); }
.calendar-day:nth-child(7n) { border-right: none; }
.calendar-day.other-month { background: var(--gray-50); }
.calendar-day.other-month .day-number { color: var(--gray-300); }
.calendar-day.today { background: #eff6ff; }
.calendar-day.today .day-number {
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}
.calendar-day.weekend .day-number { color: var(--gray-400); }
.day-number {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 4px;
}
.day-events {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.day-event-dot {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    color: #fff;
    line-height: 1.4;
    word-break: break-all;
}
.day-event-time-label {
    font-size: 10px;
    opacity: .85;
    white-space: nowrap;
    flex-shrink: 0;
    font-weight: 600;
}
.day-event-text {
    flex: 1;
    min-width: 0;
}
.day-event-more {
    font-size: 10px;
    color: var(--gray-400);
    padding-left: 6px;
}

/* 周视图 */
.week-view {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}
.week-day {
    border-bottom: 1px solid var(--gray-100);
}
.week-day:last-child { border-bottom: none; }
.week-day.today { background: #eff6ff; }
.week-day.weekend { background: var(--gray-50); }
.week-day-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-50);
}
.week-day-header:hover { background: rgba(0,0,0,.02); }
.week-day-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-700);
    min-width: 40px;
}
.week-day-date {
    font-size: 13px;
    color: var(--gray-500);
}
.week-day-date.today-badge {
    background: var(--primary);
    color: #fff;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 600;
}
.week-day-count {
    margin-left: auto;
    font-size: 12px;
    color: var(--primary);
    font-weight: 600;
}
.week-day-empty {
    padding: 8px 16px 12px;
    font-size: 12px;
    color: var(--gray-300);
}
.week-day-events {
    padding: 4px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.week-event-item {
    padding: 10px 12px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all .15s;
}
.week-event-item:hover {
    background: var(--gray-100);
    transform: translateX(2px);
}
.week-event-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.week-event-label {
    font-size: 10px;
    font-weight: 600;
    padding: 1px 8px;
    border-radius: 10px;
}
.week-event-time {
    font-size: 11px;
    color: var(--gray-400);
    margin-left: auto;
}
.week-event-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 2px;
}
.week-event-meta {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: var(--gray-400);
}
.week-event-meta i { margin-right: 3px; }

/* 日期详情弹窗 */
.day-detail-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.day-detail-item {
    padding: 12px 14px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
}
.day-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.day-detail-label {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 10px;
}
.day-detail-label i { margin-right: 4px; }
.day-detail-time {
    font-size: 12px;
    color: var(--gray-500);
}
.day-detail-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 4px;
}
.day-detail-meta {
    display: flex;
    gap: 14px;
    font-size: 12px;
    color: var(--gray-400);
}
.day-detail-meta i { margin-right: 3px; }

/* 工作台本周日程概览 */
.dash-week-timeline {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.dash-week-day {
    padding: 6px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all .15s;
    min-height: 80px;
    background: var(--gray-50);
}
.dash-week-day:hover { background: var(--gray-100); }
.dash-week-day.today { background: #eff6ff; border: 1px solid var(--primary); }
.dash-week-day.past { opacity: 0.6; }
.dash-week-day-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 6px;
}
.dash-week-day-name {
    font-size: 10px;
    color: var(--gray-400);
    font-weight: 600;
}
.dash-week-day-date {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-700);
}
.dash-week-day.today .dash-week-day-date { color: var(--primary); }
.dash-week-day-empty {
    text-align: center;
    font-size: 12px;
    color: var(--gray-300);
    padding: 4px 0;
}
.dash-week-day-items {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.dash-week-item {
    padding: 3px 6px;
    background: #fff;
    border-radius: 3px;
    font-size: 10px;
    color: var(--gray-600);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.dash-week-item-title {
    overflow: hidden;
    text-overflow: ellipsis;
}
.dash-week-item-more {
    font-size: 10px;
    color: var(--gray-400);
    text-align: center;
    padding: 1px 0;
}

.schedule-type-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

/* 日程移动端适配 */
@media (max-width: 768px) {
    .schedule-header { flex-direction: column; align-items: flex-start; }
    .schedule-actions { width: 100%; justify-content: space-between; }
    .calendar-day { min-height: 80px; padding: 4px; }
    .day-number { font-size: 11px; }
    .day-event-dot { font-size: 9px; padding: 1px 3px; }
    .day-event-time-label { display: none; }
    .dash-week-timeline { grid-template-columns: repeat(7, 1fr); gap: 2px; }
    .dash-week-day { padding: 4px; min-height: 60px; }
    .dash-week-day-date { font-size: 14px; }
    .dash-week-item { font-size: 9px; }
    .week-event-meta { flex-direction: column; gap: 2px; }
}

/* ===== 工作台日程详情列表 ===== */
.dash-schedule-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.dash-sched-day {
    display: flex;
    gap: 10px;
    padding: 8px 6px;
    border-bottom: 1px solid var(--gray-100);
    align-items: flex-start;
}
.dash-sched-day:last-child { border-bottom: none; }
.dash-sched-day.today { background: #eff6ff; border-radius: var(--radius-sm); }
.dash-sched-day.past { opacity: 0.55; }
.dash-sched-day-label {
    min-width: 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    padding-top: 2px;
}
.dash-sched-weekday {
    font-size: 11px;
    color: var(--gray-400);
    font-weight: 600;
}
.dash-sched-date {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-600);
}
.dash-sched-date.today-badge {
    background: var(--primary);
    color: #fff;
    padding: 1px 10px;
    border-radius: 10px;
}
.dash-sched-empty {
    font-size: 12px;
    color: var(--gray-300);
    padding: 4px 0;
}
.dash-sched-events {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.dash-sched-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background .15s;
    flex-wrap: wrap;
}
.dash-sched-item:hover { background: var(--gray-100); }
.dash-sched-item-label {
    font-size: 10px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 8px;
    flex-shrink: 0;
}
.dash-sched-item-time {
    font-size: 11px;
    color: var(--gray-500);
    flex-shrink: 0;
}
.dash-sched-item-title {
    font-size: 12px;
    font-weight: 500;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dash-sched-item-date {
    font-size: 11px;
    color: var(--gray-400);
    font-weight: 600;
    flex-shrink: 0;
    min-width: 36px;
}

/* 迷你月历 */
.dash-mini-calendar {
    margin-bottom: 12px;
}
.dash-mini-title {
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: 8px;
}
.dash-mini-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    text-align: center;
}
.dash-mini-head {
    font-size: 10px;
    font-weight: 600;
    color: var(--gray-400);
    padding: 4px 0;
}
.dash-mini-cell {
    font-size: 12px;
    padding: 4px 0;
    border-radius: 4px;
    cursor: pointer;
    color: var(--gray-600);
    transition: background .1s;
}
.dash-mini-cell:hover { background: var(--gray-100); }
.dash-mini-cell.empty { visibility: hidden; }
.dash-mini-cell.today {
    background: var(--primary);
    color: #fff;
    font-weight: 700;
}
.dash-mini-cell.has-event:not(.today) {
    background: #eff6ff;
    color: var(--primary);
    font-weight: 600;
}
.dash-month-events {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    flex: 1;
}

/* ===== 操作日志 ===== */
.logs-timeline {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.logs-date-group {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}
.logs-date-label {
    padding: 10px 16px;
    background: var(--gray-50);
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-600);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 8px;
}
.logs-date-label i { color: var(--primary); }
.logs-date-count {
    margin-left: auto;
    font-size: 11px;
    font-weight: 500;
    color: var(--gray-400);
}
.logs-date-items {
    display: flex;
    flex-direction: column;
}
.logs-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-50);
    transition: background .1s;
}
.logs-item:last-child { border-bottom: none; }
.logs-item:hover { background: var(--gray-50); }
.logs-item-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}
.logs-item-body {
    flex: 1;
    min-width: 0;
}
.logs-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 3px;
}
.logs-item-operator {
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-800);
}
.logs-item-action {
    font-size: 12px;
    color: var(--primary);
    background: rgba(26,86,219,.08);
    padding: 1px 8px;
    border-radius: 8px;
    font-weight: 500;
}
.logs-item-content {
    font-size: 13px;
    color: var(--gray-600);
    line-height: 1.5;
}
.logs-item-case {
    font-size: 11px;
    color: var(--gray-400);
    margin-top: 3px;
}
.logs-item-case i { margin-right: 4px; }

/* ===== Dashboard Schedule Card ===== */
.dash-schedule-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}
.dash-schedule-body {
    flex: 1;
    overflow-y: auto;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
}

/* ===== Dashboard Week View (dw-*) ===== */
.dw-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
    height: 100%;
    min-height: 420px;
}

.dw-day {
    border-right: 1px solid var(--gray-100);
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.dw-day:last-child { border-right: none; }

.dw-day.dw-past {
    opacity: .6;
}

.dw-day.dw-today {
    background: linear-gradient(180deg, rgba(26,86,219,.04) 0%, rgba(26,86,219,.01) 100%);
    opacity: 1;
}

/* 日期头 */
.dw-day-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 10px 8px;
    border-bottom: 1px solid var(--gray-100);
    flex-shrink: 0;
}

.dw-day-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    line-height: 1.2;
}

.dw-weekname {
    font-size: 11px;
    color: var(--gray-400);
    font-weight: 500;
    letter-spacing: .5px;
}

.dw-datenum {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-700);
    line-height: 1.1;
}

.dw-today-num {
    color: var(--primary);
    position: relative;
}
.dw-today-num::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
}

.dw-month {
    font-size: 10px;
    color: var(--gray-400);
}

/* 添加按钮 */
.dw-add-btn {
    width: 24px;
    height: 24px;
    border: 1.5px dashed var(--gray-200);
    border-radius: 6px;
    background: transparent;
    color: var(--gray-300);
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
    flex-shrink: 0;
}
.dw-add-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(26,86,219,.06);
}

/* 上午/下午区块 */
.dw-period {
    flex: 1;
    padding: 6px 8px 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-height: 80px;
}
.dw-period + .dw-period {
    border-top: 1px dashed var(--gray-100);
}

.dw-period-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--gray-400);
    display: flex;
    align-items: center;
    gap: 4px;
    padding-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.dw-period-label i {
    font-size: 10px;
}

.dw-empty {
    font-size: 12px;
    color: var(--gray-200);
    text-align: center;
    padding: 8px 0;
}

/* 事件卡片 */
.dw-event {
    background: #fff;
    border-radius: 8px;
    padding: 8px 10px;
    border-left: 3px solid var(--ev-color, var(--primary));
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    transition: box-shadow .15s, transform .15s;
    position: relative;
    cursor: pointer;
}
.dw-event:hover {
    box-shadow: 0 3px 8px rgba(0,0,0,.1);
    transform: translateY(-1px);
}

.dw-event-top {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.dw-event-tag {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.5;
}

.dw-event-time {
    font-size: 10px;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}
.dw-event-time i { font-size: 9px; }

.dw-event-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-800);
    line-height: 1.4;
    word-break: break-all;
}

.dw-event-case {
    font-size: 10px;
    color: var(--gray-400);
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dw-event-case i { font-size: 9px; }

/* 删除按钮 */
.dw-del-btn {
    margin-left: auto;
    width: 18px;
    height: 18px;
    border: none;
    background: transparent;
    color: var(--gray-300);
    font-size: 10px;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
    flex-shrink: 0;
    opacity: 0;
}
.dw-event:hover .dw-del-btn {
    opacity: 1;
}
.dw-del-btn:hover {
    background: rgba(239,68,68,.1);
    color: var(--danger);
}

/* 月视图日期标签 */
.dw-event-date-tag {
    font-size: 10px;
    font-weight: 600;
    color: var(--gray-500);
    background: var(--gray-50);
    padding: 1px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

/* 月视图事件列表 */
.dash-month-events {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    overflow-y: auto;
}

/* ===== 响应式适配 ===== */
@media (max-width: 1200px) {
    .dw-week {
        grid-template-columns: repeat(7, 1fr);
    }
    .dw-datenum { font-size: 16px; }
    .dw-event { padding: 6px 8px; }
}

@media (max-width: 768px) {
    .dw-week {
        grid-template-columns: repeat(7, minmax(120px, 1fr));
        min-height: auto;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .dash-schedule-body {
        overflow-x: auto;
    }
    .dw-period { min-height: 50px; }
    .dash-schedule-card { max-height: none; height: auto; }
    .dw-event-tag { font-size: 9px; }
    .dw-event-title { font-size: 11px; }

    /* 日程页月视图移动端优化 */
    .calendar-day { min-height: 80px; padding: 4px; }
    .day-event-dot { font-size: 9px; padding: 1px 3px; }
    .day-event-time-label { display: none; }
    .day-event-text { font-size: 10px; }

    /* 日程页周视图移动端 */
    .week-day { border-bottom: 1px solid var(--gray-100); }

    /* 日程页头部按钮换行 */
    .schedule-header { flex-direction: column; gap: 10px; }
    .schedule-actions { flex-wrap: wrap; gap: 8px; }
}

/* ===== 用户管理页面 ===== */
.users-page {
    padding: 0;
}

.users-section {
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.users-section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-700);
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.users-section-title i {
    color: var(--primary);
    font-size: 14px;
}

.users-count {
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: 12px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 12px;
    margin-left: 4px;
}

.users-table-wrap {
    overflow-x: auto;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.users-table th {
    text-align: left;
    padding: 10px 16px;
    background: var(--gray-50);
    color: var(--gray-500);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
    border-bottom: 1px solid var(--gray-100);
}

.users-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-50);
    vertical-align: middle;
}

.users-table tbody tr:hover {
    background: var(--gray-50);
}

.users-table tbody tr:last-child td {
    border-bottom: none;
}

.user-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.badge-label {
    background: var(--gray-100);
    color: var(--gray-600);
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 6px;
}

.status-badge.active {
    background: #d1fae5;
    color: #047857;
}

.status-badge.inactive {
    background: #fee2e2;
    color: #dc2626;
}

.visible-client-tag {
    display: inline-block;
    background: #dbeafe;
    color: #1d4ed8;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    margin: 2px 4px 2px 0;
}

.action-btns {
    display: flex;
    gap: 6px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    background: #fff;
    color: var(--gray-500);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: all .15s;
}

.btn-icon:hover {
    background: var(--gray-50);
    color: var(--primary);
    border-color: var(--primary);
}

.btn-icon-danger:hover {
    color: var(--danger);
    border-color: var(--danger);
    background: #fef2f2;
}

.visible-clients-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 8px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--gray-700);
    transition: background .15s;
}

.checkbox-item:hover {
    background: var(--gray-50);
}

.checkbox-item input[type="checkbox"] {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
}

/* 修改密码表单复用已有form样式 */

/* ===== Dispatch Module (任务派发) ===== */
.dispatch-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 16px;
    padding: 4px 0;
}

.dispatch-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    cursor: pointer;
    transition: all .2s ease;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dispatch-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(26, 86, 219, .1);
    transform: translateY(-1px);
}

.dispatch-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dispatch-mode-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .3px;
}

.dispatch-status-done {
    font-size: 11px;
    color: var(--success);
    font-weight: 600;
    margin-left: auto;
}

.dispatch-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1.4;
}

.dispatch-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: var(--gray-500);
}

.dispatch-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.dispatch-card-assignees {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dispatch-avatar-group {
    display: flex;
    align-items: center;
}

.dispatch-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border: 2px solid #fff;
    flex-shrink: 0;
}

.dispatch-avatar-group .dispatch-avatar {
    margin-left: -8px;
}

.dispatch-avatar-group .dispatch-avatar:first-child {
    margin-left: 0;
}

.dispatch-avatar-more {
    background: var(--gray-300) !important;
    color: var(--gray-600) !important;
    font-size: 10px;
}

.dispatch-assignee-names {
    font-size: 12px;
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.dispatch-card-latest {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    font-size: 12px;
}

.dispatch-msg-type-tag {
    display: inline-flex;
    padding: 1px 8px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
}

.dispatch-msg-type-tag.instruct {
    background: #dbeafe;
    color: #1d4ed8;
}

.dispatch-msg-type-tag.record {
    background: #d1fae5;
    color: #047857;
}

.dispatch-msg-preview {
    color: var(--gray-600);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Dispatch Assignee Checkboxes */
.dispatch-assignee-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 0;
}

.dispatch-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: all .15s;
    user-select: none;
}

.dispatch-checkbox-label:hover {
    border-color: var(--primary);
    background: rgba(26, 86, 219, .04);
}

.dispatch-checkbox-label input[type="checkbox"] {
    display: none;
}

.dispatch-checkbox-label:has(input:checked) {
    border-color: var(--primary);
    background: rgba(26, 86, 219, .08);
    color: var(--primary);
    font-weight: 600;
}

.dispatch-checkbox-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
}

/* Dispatch Timeline */
.dispatch-timeline {
    position: relative;
    padding-left: 20px;
}

.dispatch-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--gray-200);
}

.dispatch-timeline-item {
    position: relative;
    padding: 0 0 16px 16px;
}

.dispatch-timeline-item:last-child {
    padding-bottom: 0;
}

.dispatch-timeline-dot {
    position: absolute;
    left: -16px;
    top: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--gray-200);
}

.dispatch-timeline-content {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    transition: border-color .15s;
}

.dispatch-timeline-item.instruct .dispatch-timeline-content {
    border-left: 3px solid #1a56db;
}

.dispatch-timeline-item.record .dispatch-timeline-content {
    border-left: 3px solid #059669;
}

.dispatch-timeline-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.dispatch-timeline-author {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-800);
}

.dispatch-timeline-time {
    font-size: 11px;
    color: var(--gray-400);
    margin-left: auto;
}

.dispatch-timeline-text {
    font-size: 13px;
    color: var(--gray-700);
    line-height: 1.7;
    white-space: pre-wrap;
}

/* Dispatch Detail */
.dispatch-detail .detail-section {
    margin-bottom: 20px;
}

.btn-success {
    background: var(--success);
    color: #fff;
    border: none;
}

.btn-success:hover {
    background: #047857;
}

.btn-warning {
    background: var(--warning);
    color: #fff;
    border: none;
}

.btn-warning:hover {
    background: #d97706;
}

/* Responsive */
@media (max-width: 768px) {
    .dispatch-list {
        grid-template-columns: 1fr;
    }
}
