:root {
    --primary: #D4A843;
    --primary-dark: #B8912E;
    --primary-light: #F0E0B8;
    --secondary: #2B7BB9;
    --secondary-dark: #1E5F8F;
    --secondary-light: #D0E4F5;
    --danger: #C62828;
    --danger-light: #F8D7DA;
    --success: #2E7D32;
    --success-light: #D4EDDA;
    --warning: #F57F17;
    --warning-light: #FFF3CD;

    --bg-primary: #F8F9FA;
    --bg-secondary: #FFFFFF;
    --bg-sidebar: #1A2332;
    --bg-sidebar-hover: #243447;
    --bg-sidebar-active: #2B7BB9;

    --text-primary: #2C3E50;
    --text-secondary: #6C757D;
    --text-sidebar: #CBD5E1;
    --text-sidebar-active: #FFFFFF;

    --border-color: #E2E8F0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --sidebar-width: 260px;
    --header-height: 64px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-primary: #0F172A;
    --bg-secondary: #1E293B;
    --bg-sidebar: #0B1120;
    --bg-sidebar-hover: #1A2744;
    --bg-sidebar-active: #2B7BB9;

    --text-primary: #E2E8F0;
    --text-secondary: #94A3B8;
    --text-sidebar: #94A3B8;
    --text-sidebar-active: #FFFFFF;

    --border-color: #334155;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: var(--transition);
}

a { color: var(--secondary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary); }

/* ========== LOGIN PAGE ========== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F0F2F5;
    padding: 20px 0;
}
[data-theme="dark"] .login-wrapper { background: #0B1120; }

/* 卡片宽度适配企微小面板(320px) + 左右 padding 28px*2 = 376px */
.login-card {
    width: 376px;
    max-width: calc(100vw - 32px);
    background: #FFF;
    border-radius: 10px;
    padding: 28px 28px 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}
[data-theme="dark"] .login-card {
    background: #1A2332;
    box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}

/* 品牌区 */
.login-brand {
    text-align: center;
    margin-bottom: 22px;
    overflow: hidden;
}
.login-brand > img {
    height: 200px !important;
    max-width: 280px !important;
    width: auto !important;
    object-fit: contain !important;
    display: block;
    margin: 0 auto 12px;
    border-radius: 4px;
}
/* inline style 覆盖 */
.login-brand img[style] {
    height: 200px !important;
    max-width: 280px !important;
}
.brand-icon {
    width: 56px; height: 56px;
    margin: 0 auto 12px;
    background: linear-gradient(135deg, #D4A843, #B8922E);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: #FFF;
}
.brand-name {
    font-size: 20px;
    font-weight: 700;
    color: #1A2332;
    letter-spacing: 2px;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    margin: 0;
}
[data-theme="dark"] .brand-name { color: #FFFFFF; }
.brand-subtitle {
    font-size: 13px;
    color: #888;
    margin: 6px 0 0;
}
[data-theme="dark"] .brand-subtitle { color: #FFFFFF; }

/* Tab */
.login-tabs {
    display: flex;
    gap: 24px;
    border-bottom: 1px solid #EBEBEB;
    margin-bottom: 18px;
}
[data-theme="dark"] .login-tabs { border-bottom-color: #2A3545; }
.tab-item {
    font-size: 14px;
    font-weight: 500;
    color: #888;
    padding-bottom: 10px;
    cursor: pointer;
    position: relative;
    user-select: none;
    transition: color 0.15s;
}
.tab-item:hover { color: #444; }
[data-theme="dark"] .tab-item { color: #FFFFFF; }
[data-theme="dark"] .tab-item:hover { color: #E0E8F0; }
.tab-item.active {
    color: #2B7BB9;
    font-weight: 600;
}
[data-theme="dark"] .tab-item.active { color: #5BAEE0; }
.tab-item.active::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 2px;
    background: #2B7BB9;
    border-radius: 1px;
}
[data-theme="dark"] .tab-item.active::after { background: #5BAEE0; }

/* 错误提示 */
.login-error {
    background: #FEF0F0;
    border: 1px solid #FDCFCF;
    color: #C0392B;
    padding: 9px 12px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 16px;
    text-align: left;
    line-height: 1.5;
}
[data-theme="dark"] .login-error {
    background: rgba(192,57,43,0.12);
    border-color: rgba(192,57,43,0.25);
    color: #E88;
}

/* 企微官方 JS SDK 渲染容器 */
.wx-login-wrap {
    display: flex;
    justify-content: center;
    margin: 4px 0 0;
    /* 企微小面板 320x380，让容器刚好适配 */
    min-height: 380px;
    align-items: center;
}
/* 消除企微组件注入的 iframe/div 的多余边框 */
.wx-login-wrap iframe {
    border: none !important;
}

.qr-tip {
    text-align: center;
    font-size: 12.5px;
    color: #888;
    margin: 6px 0 0;
    line-height: 1.5;
}
[data-theme="dark"] .qr-tip { color: #FFFFFF; }

/* 版权 */
.login-copyright {
    text-align: center;
    font-size: 12px;
    color: #AAA;
    margin-top: 16px;
}
[data-theme="dark"] .login-copyright { color: #FFFFFF; }

/* 未配置状态 */
.qr-not-configured {
    text-align: center;
    padding: 32px 0 24px;
    color: #AAA;
}
.qr-not-configured svg {
    margin-bottom: 12px;
}
.qr-not-configured p {
    font-size: 14px;
    color: #777;
    line-height: 1.7;
    margin: 0 0 12px;
}
.qr-not-configured small { font-size: 12px; color: #BBB; }
.link-btn {
    background: none;
    border: 1px solid #2B7BB9;
    color: #2B7BB9;
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}
.link-btn:hover { background: #F0F6FF; }

/* 邮箱表单 */
.email-form {
    display: flex;
    flex-direction: column;
    gap: 13px;
}
.email-form input {
    width: 100%;
    padding: 11px 12px;
    background: #F6F7F9;
    border: 1px solid #DDD;
    border-radius: 6px;
    color: #333;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-font-smoothing: antialiased;
}
.email-form input:focus {
    border-color: #2B7BB9;
    background: #FFF;
    box-shadow: 0 0 0 2.5px rgba(43,123,185,0.1);
}
.email-form input::placeholder { color: #BBB; }
[data-theme="dark"] .email-form input {
    background: rgba(255,255,255,0.04);
    border-color: #334155;
    color: #E2E8F0;
}
[data-theme="dark"] .email-form input:focus {
    border-color: #2B7BB9;
    background: rgba(15,23,42,0.6);
    box-shadow: 0 0 0 2.5px rgba(43,123,185,0.15);
}
.email-form button {
    width: 100%;
    padding: 11px 0;
    background: linear-gradient(135deg, #D4A843, #B8952E);
    color: #1A2332;
    font-size: 14.5px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    letter-spacing: 3px;
    -webkit-font-smoothing: antialiased;
    transition: opacity 0.2s;
}
.email-form button:hover { opacity: 0.85; }

/* ========== SIDEBAR ========== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    z-index: 100;
    transition: var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
}
.sidebar.collapsed { width: 72px; }
.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-header .logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #1A2332;
    font-size: 16px;
    flex-shrink: 0;
}
.sidebar-header .logo-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
    letter-spacing: 1px;
    white-space: nowrap;
    transition: opacity 0.2s;
}
.sidebar.collapsed .logo-text { opacity: 0; width: 0; }

.sidebar-nav { padding: 12px 0; }
.nav-section-title {
    padding: 16px 20px 8px;
    font-size: 11px;
    font-weight: 600;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    white-space: nowrap;
    transition: opacity 0.2s;
}
.sidebar.collapsed .nav-section-title { opacity: 0; height: 0; padding: 0; overflow: hidden; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--text-sidebar);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    border-left: 3px solid transparent;
    white-space: nowrap;
}
.nav-item:hover {
    background: var(--bg-sidebar-hover);
    color: #E2E8F0;
}
.nav-item.active {
    background: rgba(43,123,185,0.15);
    color: var(--text-sidebar-active);
    border-left-color: var(--secondary);
}
.nav-item .nav-icon {
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    font-size: 16px;
}
.nav-item .nav-label { transition: opacity 0.2s; }
.sidebar.collapsed .nav-label { opacity: 0; width: 0; }

.nav-item .nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}
.sidebar.collapsed .nav-badge { display: none; }

/* ========== MAIN CONTENT ========== */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: var(--transition);
}
.sidebar.collapsed ~ .main-wrapper { margin-left: 72px; }

.top-header {
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}
.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}
.btn-sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.btn-sidebar-toggle:hover { background: var(--bg-primary); color: var(--text-primary); }
.page-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}
.btn-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition);
    position: relative;
}
.btn-icon:hover { background: var(--bg-primary); color: var(--text-primary); border-color: var(--primary); }
.btn-icon .badge-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--bg-secondary);
}

.theme-toggle {
    cursor: pointer;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 12px 4px 4px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
}
.user-menu:hover { background: var(--bg-primary); }
.user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 13px;
}
.user-info { line-height: 1.3; }
.user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.user-role { font-size: 11px; color: var(--text-secondary); }

.main-content {
    padding: 24px;
}

/* ========== CARDS ========== */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}
.card-body { padding: 20px; }

/* ========== STAT CARDS ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}
.stat-card.gold::after { background: var(--primary); }
.stat-card.blue::after { background: var(--secondary); }
.stat-card.red::after { background: var(--danger); }
.stat-card.green::after { background: var(--success); }

.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.stat-icon.gold { background: var(--primary-light); color: var(--primary-dark); }
.stat-icon.blue { background: var(--secondary-light); color: var(--secondary-dark); }
.stat-icon.red { background: var(--danger-light); color: var(--danger); }
.stat-icon.green { background: var(--success-light); color: var(--success); }

[data-theme="dark"] .stat-icon.gold { background: rgba(212,168,67,0.15); }
[data-theme="dark"] .stat-icon.blue { background: rgba(43,123,185,0.15); }
[data-theme="dark"] .stat-icon.red { background: rgba(198,40,40,0.15); }
[data-theme="dark"] .stat-icon.green { background: rgba(46,125,50,0.15); }

.stat-info { flex: 1; }
.stat-label { font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; }
.stat-value { font-size: 26px; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.stat-change {
    font-size: 12px;
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
}
.stat-change.up { background: var(--success-light); color: var(--success); }
.stat-change.down { background: var(--danger-light); color: var(--danger); }

/* ========== TABLE ========== */
.table-wrapper { overflow-x: auto; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
    background: var(--bg-primary);
    white-space: nowrap;
}
.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}
.data-table tr:hover td { background: var(--bg-primary); }

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #1A2332;
    border-color: var(--primary);
}
.btn-primary:hover { box-shadow: 0 4px 12px rgba(212,168,67,0.3); transform: translateY(-1px); }
.btn-secondary {
    background: var(--secondary);
    color: white;
    border-color: var(--secondary);
}
.btn-secondary:hover { background: var(--secondary-dark); }
.btn-danger {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}
.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-color);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ========== STATUS BADGES ========== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 12px;
    white-space: nowrap;
}
.badge-gold { background: var(--primary-light); color: var(--primary-dark); }
.badge-blue { background: var(--secondary-light); color: var(--secondary-dark); }
.badge-red { background: var(--danger-light); color: var(--danger); }
.badge-green { background: var(--success-light); color: var(--success); }
.badge-gray { background: var(--bg-primary); color: var(--text-secondary); }
[data-theme="dark"] .badge-gold { background: rgba(212,168,67,0.15); }
[data-theme="dark"] .badge-blue { background: rgba(43,123,185,0.15); }
[data-theme="dark"] .badge-red { background: rgba(198,40,40,0.15); }
[data-theme="dark"] .badge-green { background: rgba(46,125,50,0.15); }

/* ========== FORMS ========== */
.form-group { margin-bottom: 16px; }
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(212,168,67,0.1);
}
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 100px; }

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* ========== MODAL ========== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.modal-backdrop.active { opacity: 1; pointer-events: all; }
.modal {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    width: 560px;
    max-width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: transform 0.3s;
}
.modal-backdrop.active .modal { transform: translateY(0); }
.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 600; }
.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
}
.modal-body { padding: 20px; }
.modal-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ========== SEARCH & FILTER BAR ========== */
.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.search-box {
    flex: 1;
    min-width: 200px;
    position: relative;
}
.search-box input {
    width: 100%;
    padding: 9px 14px 9px 38px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    transition: var(--transition);
}
.search-box input:focus { outline: none; border-color: var(--primary); }
.search-box .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 14px;
}

/* ========== PAGINATION ========== */
.pagination-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.pagination-info {
    font-size: 12px;
    color: var(--text-secondary);
}
.pagination-links {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}
.pagination-links .page-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
}
.pagination-links .page-item:hover:not(.active):not(.disabled) {
    border-color: var(--primary);
    color: var(--primary);
}
.pagination-links .page-item.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    font-weight: 600;
    cursor: default;
}
.pagination-links .page-item.disabled {
    color: var(--text-secondary);
    border-color: var(--border-color);
    opacity: 0.5;
    cursor: not-allowed;
}
.pagination-links .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
/* 兼容旧版 .pagination 结构 */
.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 16px;
    justify-content: center;
}
.pagination a, .pagination span {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    transition: var(--transition);
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .active {
    background: var(--secondary);
    color: white;
    border-color: var(--secondary);
}
.pagination .disabled {
    color: var(--text-secondary);
    border-color: var(--border-color);
    cursor: not-allowed;
    opacity: 0.6;
}

/* ========== CHART PLACEHOLDER ========== */
.chart-container {
    width: 100%;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    position: relative;
}

/* ========== EMPTY STATE ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.4; }
.empty-state h3 { font-size: 16px; font-weight: 500; margin-bottom: 8px; color: var(--text-primary); }
.empty-state p { font-size: 13px; }

/* ========== DASHBOARD EXCLUSIVE ========== */
/* 快捷操作按钮：统一块状 + 品牌色变体 */
.btn-block { display:block; width:100%; margin-bottom:10px; text-align:center; padding:10px 14px; font-size:13.5px; }
.btn-quick-blue { background:#E8F4FD; color:#2B7BB9; border:1px solid #C5DFF0; }
.btn-quick-blue:hover { background:#D0E8F5; }
.btn-quick-gold { background:#FEF3E8; color:#D4A843; border:1px solid #F5DEB3; }
.btn-quick-gold:hover { background:#FCEFDB; }

/* 状态分布条形图 */
.dash-status-bars { display:flex; flex-direction:column; gap:12px; padding:4px 0; }
.dash-status-bar-row { display:flex; align-items:center; gap:12px; }
.dash-status-label { width:64px; font-size:13px; color:var(--text-secondary); text-align:right; flex-shrink:0; white-space:nowrap; }
.dash-status-track { flex:1; height:28px; background:#F5F7FA; border-radius:8px; overflow:hidden; }
.dash-status-fill { height:100%; border-radius:8px; transition:width .8s ease-out; min-width:4px; }
.dash-status-count { width:36px; font-size:14px; font-weight:700; color:var(--text-primary); text-align:right; flex-shrink:0; }

/* 表格横向滚动包裹 */
.table-responsive { overflow-x:auto; -webkit-overflow-scrolling:touch; }
.nowrap { white-space:nowrap; }
.muted { color:var(--text-secondary); }
.muted-sm { font-size:11px; color:var(--text-secondary); }
.fw-600 { font-weight:600; }
.color-primary { color:var(--primary); }
.color-secondary { color:var(--secondary); }
.link-primary { color:var(--primary); font-weight:500; text-decoration:none; }
.link-primary:hover { text-decoration:underline; }

/* 工作台 grid 行布局 */
.dash-row { display:grid; gap:16px; margin-bottom:16px; }
.dash-row-aside { grid-template-columns:260px 1fr; }
.dash-row-2col { grid-template-columns:1fr 1fr; }
.dash-quick-actions { }
.dash-quick-actions .card-body { padding:14px; }
.dash-status-chart { }

/* 空状态 */
.dash-empty { text-align:center; padding:28px 0; color:var(--text-secondary); font-size:13.5px; }

/* 分管领导单元格 */
.dash-leader-cell { display:flex; align-items:center; gap:8px; }

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .dash-row-aside { grid-template-columns:1fr; }
    .dash-quick-actions { order:-1; }
}
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.mobile-open { transform: translateX(0); }
    .main-wrapper { margin-left:0 !important; }
    .stats-grid { grid-template-columns:1fr 1fr; }
    .form-row { grid-template-columns:1fr; }
    .dash-row-2col { grid-template-columns:1fr; }
    .dash-status-label { width:56px; font-size:12px; }
    .data-table th, .data-table td { padding:10px 12px; font-size:12.5px; }
    .btn-sm { padding:5px 10px; font-size:12px; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns:1fr; }
    .main-content { padding:14px !important; }
    .stat-card { padding:16px; gap:12px; }
    .stat-icon { width:40px; height:40px; font-size:18px; }
    .stat-value { font-size:22px; }
    .dash-status-label { width:48px; font-size:11px; }
    .dash-status-track { height:22px; }
    .card-header { padding:12px 14px !important; flex-wrap:wrap; gap:8px; }
    .card-body { padding:12px !important; }
    .btn-block { padding:9px 10px; font-size:13px; }
}

/* ========== ANIMATIONS ========== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: fadeInUp 0.4s ease-out forwards; }
.animate-delay-1 { animation-delay: 0.1s; opacity: 0; }
.animate-delay-2 { animation-delay: 0.2s; opacity: 0; }
.animate-delay-3 { animation-delay: 0.3s; opacity: 0; }
.animate-delay-4 { animation-delay: 0.4s; opacity: 0; }

/* ========== LOADING ========== */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== TOAST ========== */
.toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 300;
    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-md);
    animation: slideInRight 0.3s ease-out;
    min-width: 260px;
}
.toast-success { background: var(--success); color: white; }
.toast-error { background: var(--danger); color: white; }
.toast-warning { background: var(--warning); color: white; }
@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ========== LIVEWIRE ========== */
[data-loading] { opacity: 0.7; pointer-events: none; }

/* ========== GRID LAYOUTS ========== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 768px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ========== DETAIL PAGE ========== */
.detail-grid {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 8px 16px;
    font-size: 14px;
}
.detail-label { color: var(--text-secondary); font-weight: 500; }
.detail-value { color: var(--text-primary); }

/* ========== DROPDOWN ========== */
.dropdown {
    position: relative;
    display: inline-block;
}
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    min-width: 180px;
    padding: 4px;
    z-index: 60;
    display: none;
}
.dropdown-menu.show { display: block; }
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-primary);
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}
.dropdown-item:hover { background: var(--bg-primary); color: var(--primary); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: var(--danger-light); }
