/* ============================================

   标准 CRM 风格 - Professional Business Theme

   ============================================ */



/* Google Fonts - 专业商务字体 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');



:root {

    /* 主色调 - 专业蓝 */

    --primary: #1a73e8;

    --primary-hover: #1557b0;

    --primary-light: #e8f0fe;

    --secondary: #5f6368;

    --success: #34a853;

    --warning: #fbbc04;

    --danger: #ea4335;



    /* 背景色 - 干净明亮 */

    --bg-body: #f5f5f5;

    --bg-white: #ffffff;

    --bg-sidebar: #1a1a2e;

    --bg-hover: #f1f3f4;



    /* 文字颜色 */

    --text-primary: #202124;

    --text-secondary: #5f6368;

    --text-muted: #9aa0a6;

    --text-white: #ffffff;



    /* 边框 */

    --border-color: #dadce0;

    --border-light: #e8eaed;



    /* 阴影 */

    --shadow-sm: 0 1px 2px rgba(60, 64, 67, 0.1);

    --shadow-md: 0 1px 3px rgba(60, 64, 67, 0.15), 0 1px 2px rgba(60, 64, 67, 0.1);

    --shadow-lg: 0 4px 6px rgba(60, 64, 67, 0.15), 0 1px 3px rgba(60, 64, 67, 0.1);



    /* 尺寸 */

    --sidebar-width: 240px;

    --header-height: 56px;

    --radius: 8px;

    --radius-sm: 4px;

}



* {

    box-sizing: border-box;

    margin: 0;

    padding: 0;

}



body {

    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    background: var(--bg-body);

    color: var(--text-primary);

    font-size: 14px;

    line-height: 1.5;

    height: 100vh;

    overflow: hidden;

}



/* ============================================

   布局结构

   ============================================ */

#login-view {

    display: flex;

    justify-content: center;

    align-items: center;

    height: 100vh;

    background: linear-gradient(-45deg, #667eea, #764ba2, #11998e, #38ef7d, #4facfe, #f093fb);

    background-size: 400% 400%;

    animation: gradientBG 15s ease infinite;

}



@keyframes gradientBG {

    0% {

        background-position: 0% 50%;

    }



    25% {

        background-position: 50% 100%;

    }



    50% {

        background-position: 100% 50%;

    }



    75% {

        background-position: 50% 0%;

    }



    100% {

        background-position: 0% 50%;

    }

}



#main-view {

    display: flex;

    height: 100vh;

    width: 100vw;

}



.view.hidden {

    display: none !important;

}



/* ============================================

   登录页面

   ============================================ */

.login-container {

    width: 420px;

    padding: 48px 40px;

    background: rgba(255, 255, 255, 0.95);

    backdrop-filter: blur(10px);

    border-radius: 16px;

    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);

    border: 1px solid rgba(255, 255, 255, 0.2);

    animation: slideUp 0.6s ease;

}



@keyframes slideUp {

    from {

        opacity: 0;

        transform: translateY(30px);

    }



    to {

        opacity: 1;

        transform: translateY(0);

    }

}



.login-container h1 {

    font-size: 26px;

    font-weight: 700;

    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

    -webkit-background-clip: text;

    -webkit-text-fill-color: transparent;

    background-clip: text;

    text-align: center;

    margin-bottom: 36px;

}



.login-container .form-group {

    margin-bottom: 20px;

}



.login-container .form-group label {

    display: block;

    font-size: 13px;

    font-weight: 500;

    color: var(--text-secondary);

    margin-bottom: 6px;

}



.login-container input {

    width: 100%;

    padding: 12px 14px;

    border: 1px solid var(--border-color);

    border-radius: var(--radius-sm);

    font-size: 14px;

    transition: border-color 0.2s, box-shadow 0.2s;

}



.login-container input:focus {

    outline: none;

    border-color: var(--primary);

    box-shadow: 0 0 0 3px var(--primary-light);

}



.login-container button[type="submit"] {

    width: 100%;

    padding: 14px;

    background: linear-gradient(135deg, var(--primary) 0%, #5e35b1 100%);

    color: white;

    border: none;

    border-radius: var(--radius-sm);

    font-size: 15px;

    font-weight: 600;

    cursor: pointer;

    transition: all 0.3s ease;

    margin-top: 8px;

    box-shadow: 0 4px 15px rgba(66, 133, 244, 0.3);

}



.login-container button[type="submit"]:hover {

    transform: translateY(-2px);

    box-shadow: 0 6px 20px rgba(66, 133, 244, 0.4);

}



.login-container p.hint {

    text-align: center;

    font-size: 12px;

    color: var(--text-muted);

    margin-top: 20px;

}



/* ============================================

   侧边栏 - 深色专业风格

   ============================================ */

/* 状态变量控制 */
.sidebar-collapsed {
    --sidebar-width: 0px !important;
}

.sidebar {

    width: var(--sidebar-width);

    background: var(--bg-sidebar);

    display: flex;

    flex-direction: column;

    flex-shrink: 0;

    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);

}

/* 折叠状态下的侧边栏强制收缩与隐藏 */
.sidebar-collapsed .sidebar {
    width: 0 !important;
    overflow: hidden;
}

/* 侧边栏折叠/展开按钮通用样式 */
.toggle-sidebar-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    outline: none;
}

/* 侧边栏头部的收起按钮（圆形悬浮特效） */
.sidebar .brand {
    justify-content: space-between !important;
}
.sidebar .brand .brand-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.fold-btn {
    color: rgba(255, 255, 255, 0.5);
    width: 28px;
    height: 28px;
    border-radius: 50%;
}
.fold-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}
.fold-btn ion-icon {
    font-size: 18px;
    color: inherit !important; /* 覆盖全局 ion-icon 配色定义 */
}

/* 蓝色卡片内的展开按钮（高亮、极简圆圈，非常明示醒目） */
.unfold-btn {
    background: rgba(255, 255, 255, 0.25) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.45) !important;
    color: #fff !important;
    width: 36px;
    height: 36px;
    border-radius: 50% !important;
    margin-right: 16px;
    display: none; /* 默认隐藏 */
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.unfold-btn:hover {
    background: rgba(255, 255, 255, 0.4) !important;
    border-color: rgba(255, 255, 255, 0.7) !important;
    transform: scale(1.05);
}
.unfold-btn ion-icon {
    color: #fff !important;
    font-size: 22px !important;
}

/* 当处于折叠状态时显示展开按钮 */
.sidebar-collapsed .unfold-btn {
    display: flex;
}



.sidebar .brand {

    padding: 20px;

    display: flex;

    align-items: center;

    gap: 10px;

    color: var(--text-white);

    font-size: 18px;

    font-weight: 600;

    border-bottom: 1px solid rgba(255, 255, 255, 0.1);

}



.sidebar .brand ion-icon {

    font-size: 24px;

    color: var(--primary);

}



.sidebar-action {

    padding: 16px;

}



.btn-compose {

    width: 100%;

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 8px;

    background: var(--primary);

    color: white;

    border: none;

    padding: 12px 16px;

    border-radius: var(--radius-sm);

    font-size: 14px;

    font-weight: 500;

    cursor: pointer;

    transition: background 0.2s;

}



.btn-compose:hover {

    background: var(--primary-hover);

}



.menu {

    flex: 1;

    overflow-y: auto;

    padding: 8px 0;

}



.menu-item {

    display: flex;

    align-items: center;

    gap: 12px;

    padding: 12px 20px;

    color: rgba(255, 255, 255, 0.7);

    text-decoration: none;

    font-size: 14px;

    transition: all 0.15s;

    border-left: 3px solid transparent;

}



.menu-item:hover {

    background: rgba(255, 255, 255, 0.05);

    color: var(--text-white);

}



.menu-item.active {

    background: rgba(26, 115, 232, 0.15);

    color: var(--primary);

    border-left-color: var(--primary);

}



.menu-item ion-icon {

    font-size: 18px;

}



.user-profile {

    padding: 16px 20px;

    border-top: 1px solid rgba(255, 255, 255, 0.1);

    display: flex;

    align-items: center;

    gap: 12px;

    color: var(--text-white);

}



.user-profile .avatar {

    width: 36px;

    height: 36px;

    background: var(--primary);

    border-radius: 50%;

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 14px;

    font-weight: 600;

}



.user-profile .info {

    flex: 1;

}



.user-profile .info span {

    display: block;

    font-size: 13px;

    font-weight: 500;

}



.user-profile .info a {

    font-size: 12px;

    color: rgba(255, 255, 255, 0.5);

    text-decoration: none;

}



.user-profile .info a:hover {

    color: var(--primary);

}



/* ============================================

   主内容区域

   ============================================ */

.content-area {

    flex: 1;

    display: flex;

    flex-direction: column;

    overflow: hidden;

    background: var(--bg-body);

}



.section {

    flex: 1;

    padding: 24px;

    overflow-y: auto;

    display: none;

}



.section.active {

    display: block;

}



.section-header {

    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 24px;

}



.section-header h2 {

    font-size: 20px;

    font-weight: 600;

    color: var(--text-primary);

}



.section-header .actions {

    display: flex;

    gap: 12px;

}



/* ============================================

   卡片样式

   ============================================ */

.card,

.stat-card {

    background: var(--bg-white);

    border: 1px solid var(--border-light);

    border-radius: var(--radius);

    padding: 20px;

    box-shadow: var(--shadow-sm);

}



.card:hover,

.stat-card:hover {

    box-shadow: var(--shadow-md);

}



.stats-grid {

    display: grid;

    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));

    gap: 20px;

    margin-bottom: 24px;

}



.stat-card {

    display: flex;

    align-items: center;

    gap: 16px;

}



.stat-icon,

.icon-box {

    width: 48px;

    height: 48px;

    border-radius: var(--radius);

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 22px;

}



.icon-box.blue,

.stat-icon {

    background: var(--primary-light);

    color: var(--primary);

}



.icon-box.green {

    background: #e6f4ea;

    color: var(--success);

}



.icon-box.purple {

    background: #f3e8fd;

    color: #9334e6;

}



.icon-box.orange {

    background: #fef7e0;

    color: #f9ab00;

}



.stat-info {

    flex: 1;

}



.stat-value {

    font-size: 28px;

    font-weight: 700;

    color: var(--text-primary);

    line-height: 1.2;

}



.stat-label {

    font-size: 13px;

    color: var(--text-secondary);

    margin-top: 2px;

}



/* ============================================

   欢迎横幅

   ============================================ */

.welcome-banner {

    background: linear-gradient(135deg, var(--primary) 0%, #5e35b1 100%);

    border-radius: var(--radius);

    padding: 28px 32px;

    margin-bottom: 24px;

    display: flex;

    justify-content: space-between;

    align-items: center;

    color: white;

}



.welcome-content h1 {

    font-size: 22px;

    font-weight: 600;

    margin-bottom: 4px;

}



.welcome-content p {

    opacity: 0.9;

    font-size: 14px;

}



.welcome-time {

    text-align: right;

}



.time-display {

    font-size: 32px;

    font-weight: 700;

}



.date-display {

    opacity: 0.9;

    font-size: 13px;

}



/* ============================================

   按钮样式

   ============================================ */

button {

    font-family: inherit;

    cursor: pointer;

    transition: all 0.15s;

}



.btn-primary {

    background: var(--primary);

    color: white;

    border: none;

    padding: 8px 16px;

    border-radius: var(--radius-sm);

    font-size: 13px;

    font-weight: 500;

}



.btn-primary:hover {

    background: var(--primary-hover);

}



.btn-secondary {

    background: var(--bg-white);

    color: var(--text-secondary);

    border: 1px solid var(--border-color);

    padding: 8px 16px;

    border-radius: var(--radius-sm);

    font-size: 13px;

    font-weight: 500;

}



.btn-secondary:hover {

    background: var(--bg-hover);

    border-color: var(--text-secondary);

}



.btn-small {

    padding: 5px 10px;

    font-size: 12px;

    border-radius: var(--radius-sm);

    background: var(--bg-hover);

    border: 1px solid var(--border-color);

    color: var(--text-secondary);

}



.btn-small:hover {

    background: var(--primary);

    color: white;

    border-color: var(--primary);

}



.btn-warning {

    background: linear-gradient(135deg, #f9ab00 0%, #ff6f00 100%);

    color: white;

    border: none;

    padding: 8px 16px;

    border-radius: var(--radius-sm);

    font-size: 13px;

    font-weight: 500;

    display: inline-flex;

    align-items: center;

    gap: 4px;

}



.btn-warning:hover {

    background: linear-gradient(135deg, #ff6f00 0%, #e65100 100%);

    transform: translateY(-1px);

}



.btn-warning.active {

    background: linear-gradient(135deg, #4caf50 0%, #2e7d32 100%);

}



/* ============================================

   表格样式

   ============================================ */

.table-container {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    overflow: auto;
    box-shadow: var(--shadow-sm);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--bg-hover);
}

th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
}



tbody tr:hover {

    background: var(--bg-hover);

}



tbody tr:last-child td {

    border-bottom: none;

}



td button {

    margin-right: 6px;

}



/* ============================================

   徽章样式

   ============================================ */

.badge {

    display: inline-block;

    padding: 4px 10px;

    border-radius: 12px;

    font-size: 11px;

    font-weight: 500;

}



.badge.Lead {

    background: #e3f2fd;

    color: #1565c0;

}



.badge.Customer {

    background: #e8f5e9;

    color: #2e7d32;

}



.badge.Visited {

    background: #fff3e0;

    color: #ef6c00;

}



.badge.Churned {

    background: #ffebee;

    color: #c62828;

}



/* ============================================

   模态框 - 精致专业风格

   ============================================ */

.modal-overlay {

    position: fixed;

    top: 0;

    left: 0;

    right: 0;

    bottom: 0;

    width: 100vw;

    height: 100vh;

    background: rgba(15, 23, 42, 0.6);

    backdrop-filter: blur(4px);

    -webkit-backdrop-filter: blur(4px);

    z-index: 1000;

    overflow-y: auto;

    display: flex;

    align-items: flex-start;

    justify-content: center;

    padding: 60px 20px;

    animation: fadeIn 0.2s ease;

}



@keyframes fadeIn {

    from {

        opacity: 0;

    }



    to {

        opacity: 1;

    }

}



@keyframes slideUp {

    from {

        opacity: 0;

        transform: translateY(20px) scale(0.98);

    }



    to {

        opacity: 1;

        transform: translateY(0) scale(1);

    }

}



.modal-overlay.hidden {

    display: none !important;

}



.modal {

    background: var(--bg-white);

    border-radius: 12px;

    box-shadow:

        0 25px 50px -12px rgba(0, 0, 0, 0.25),

        0 0 0 1px rgba(0, 0, 0, 0.05);

    width: 580px;

    max-width: 95vw;

    max-height: 90vh;

    /* 限制最大高度 */

    margin: 0 auto;

    position: relative;

    animation: slideUp 0.3s ease;

    overflow: hidden;

    display: flex;

    flex-direction: column;

}



.modal.hidden {

    display: none !important;

}



.modal h3 {

    font-size: 18px;

    font-weight: 600;

    padding: 20px 28px;

    margin: 0;

    background: linear-gradient(135deg, var(--primary) 0%, #5e35b1 100%);

    color: white;

    display: flex;

    align-items: center;

    gap: 10px;

}



.modal h3 ion-icon {

    font-size: 22px;

}



.modal form {

    padding: 28px;

    background: var(--bg-white);

    flex: 1;

    overflow-y: auto;

    /* 内容超出时允许滚动 */

}



.modal-actions {

    padding: 20px 28px;

    border-top: 1px solid var(--border-light);

    display: flex;

    justify-content: flex-end;

    gap: 12px;

    background: #f8fafc;

}



.modal-actions button {

    padding: 10px 24px;

    border-radius: 6px;

    font-size: 14px;

    font-weight: 500;

    transition: all 0.2s ease;

}



.modal-actions button[type="button"] {

    background: white;

    border: 1px solid var(--border-color);

    color: var(--text-secondary);

}



.modal-actions button[type="button"]:hover {

    background: var(--bg-hover);

    border-color: var(--text-muted);

}



.modal-actions button[type="submit"],

.modal-actions .btn-primary {

    background: linear-gradient(135deg, var(--primary) 0%, #1557b0 100%);

    border: none;

    color: white;

    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);

}



.modal-actions button[type="submit"]:hover,

.modal-actions .btn-primary:hover {

    transform: translateY(-1px);

    box-shadow: 0 6px 16px rgba(26, 115, 232, 0.4);

}



/* ============================================

   权限树样式

   ============================================ */

.permission-tree {

    max-height: 400px;

    overflow-y: auto;

}



.permission-category {

    border-bottom: 1px solid #e8e8e8;

}



.permission-category:last-child {

    border-bottom: none;

}



.category-header {

    display: flex;

    align-items: center;

    padding: 12px 16px;

    cursor: pointer;

    background: #fafafa;

    transition: background 0.2s;

    user-select: none;

}



.category-header:hover {

    background: #f0f0f0;

}



.category-header input[type="checkbox"] {

    width: 18px;

    height: 18px;

    margin-right: 12px;

    cursor: pointer;

    accent-color: var(--primary);

}



.category-name {

    flex: 1;

    font-weight: 500;

    color: #333;

    font-size: 14px;

}



.expand-icon {

    color: #999;

    font-size: 12px;

    transition: transform 0.2s;

}



.category-header.expanded .expand-icon {

    transform: rotate(90deg);

}



.category-actions {

    padding: 8px 16px 12px 48px;

    background: #fff;

    display: flex;

    flex-wrap: wrap;

    gap: 8px 20px;

}



.category-actions.hidden {

    display: none;

}



.category-actions label {

    display: flex;

    align-items: center;

    gap: 6px;

    font-size: 13px;

    color: #666;

    cursor: pointer;

    padding: 4px 0;

}



.category-actions label:hover {

    color: var(--primary);

}



.category-actions input[type="checkbox"] {

    width: 16px;

    height: 16px;

    accent-color: var(--primary);

    cursor: pointer;

}





/* ============================================

   表单样式 - 优雅精致

   ============================================ */

.form-group {

    margin-bottom: 20px;

}



.form-group:last-child {

    margin-bottom: 0;

}



.form-group label {

    display: block;

    font-size: 13px;

    font-weight: 600;

    color: var(--text-primary);

    margin-bottom: 8px;

    letter-spacing: 0.3px;

}



.form-group label::after {

    content: '';

}



.form-group input,

.form-group select,

.form-group textarea {

    width: 100%;

    padding: 12px 14px;

    border: 1.5px solid var(--border-color);

    border-radius: 8px;

    font-size: 14px;

    font-family: inherit;

    background: #fafbfc;

    color: var(--text-primary);

    transition: all 0.2s ease;

}



.form-group input::placeholder,

.form-group textarea::placeholder {

    color: var(--text-muted);

}



.form-group input:hover,

.form-group select:hover,

.form-group textarea:hover {

    border-color: var(--text-muted);

    background: white;

}



.form-group input:focus,

.form-group select:focus,

.form-group textarea:focus {

    outline: none;

    border-color: var(--primary);

    background: white;

    box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.1);

}



.form-group select {

    cursor: pointer;

    appearance: none;

    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");

    background-position: right 12px center;

    background-repeat: no-repeat;

    background-size: 16px 16px;

    padding-right: 40px;

}



.form-group textarea {

    resize: vertical;

    min-height: 80px;

}



.form-row {

    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 20px;

}



@media (max-width: 600px) {

    .form-row {

        grid-template-columns: 1fr;

    }

}



/* ============================================

   CRM 布局

   ============================================ */

.crm-layout {

    display: flex;

    gap: 20px;

    height: calc(100vh - 150px);

}



.crm-list {

    flex: 1;

    background: var(--bg-white);

    border: 1px solid var(--border-light);

    border-radius: var(--radius);

    overflow: auto;

    box-shadow: var(--shadow-sm);

}



.crm-detail {

    width: 380px;

    background: var(--bg-white);

    border: 1px solid var(--border-light);

    border-radius: var(--radius);

    display: flex;

    flex-direction: column;

    box-shadow: var(--shadow-sm);

}



.crm-detail.hidden {

    display: none;

}



.detail-header {

    padding: 16px 20px;

    border-bottom: 1px solid var(--border-light);

    display: flex;

    justify-content: space-between;

    align-items: center;

}



.detail-header h3 {

    font-size: 16px;

    font-weight: 600;

    margin: 0;

    padding: 0;

    border: none;

}



.close-btn {

    background: none;

    border: none;

    font-size: 20px;

    color: var(--text-muted);

    cursor: pointer;

}



.close-btn:hover {

    color: var(--text-primary);

}



.detail-info-grid {
    padding: 12px 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    border-bottom: 1px solid var(--border-light);
    max-height: 45%;
    overflow-y: auto;
}



.info-item {

    display: flex;

    flex-direction: column;

}



.info-item label {

    font-size: 11px;

    color: var(--text-muted);

    text-transform: uppercase;

    margin-bottom: 2px;

}



.info-item span {

    font-size: 13px;

    color: var(--text-primary);

}



.info-item.full-width {

    grid-column: span 2;

}



.status-actions {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: var(--bg-white);
}
.status-actions button {
    flex: 1;
    min-width: 100px;
    margin: 0 !important;
}



.follow-ups {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 50%;
}



.follow-ups h4 {

    padding: 12px 20px;

    font-size: 13px;

    font-weight: 600;

    color: var(--text-secondary);

    background: var(--bg-hover);

    margin: 0;

}



#activity-list {

    flex: 1;

    overflow-y: auto;

    padding: 12px 20px;

}



.activity-item {

    padding: 12px 0;

    border-bottom: 1px solid var(--border-light);

    font-size: 13px;

}



.activity-item:last-child {

    border-bottom: none;

}



.activity-meta {

    font-size: 11px;

    color: var(--text-muted);

    margin-top: 4px;

}



.follow-up-actions {

    padding: 12px 20px;

    border-top: 1px solid var(--border-light);

    display: flex;

    gap: 8px;

}



.btn-visit {

    background: var(--bg-white);

    border: 1px solid var(--warning);

    color: var(--warning);

    padding: 8px 12px;

    border-radius: var(--radius-sm);

    font-size: 12px;

    font-weight: 500;

}



.btn-visit:hover {

    background: var(--warning);

    color: white;

}



/* ============================================

   面板和快捷操作

   ============================================ */

.dashboard-panels {

    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 20px;

}



.panel {

    background: var(--bg-white);

    border: 1px solid var(--border-light);

    border-radius: var(--radius);

    box-shadow: var(--shadow-sm);

}



.panel-header {

    padding: 16px 20px;

    border-bottom: 1px solid var(--border-light);

    display: flex;

    justify-content: space-between;

    align-items: center;

}



.panel-header h3 {

    font-size: 15px;

    font-weight: 600;

    margin: 0;

    display: flex;

    align-items: center;

    gap: 8px;

}



.view-all {

    font-size: 12px;

    color: var(--primary);

    text-decoration: none;

}



.view-all:hover {

    text-decoration: underline;

}



.panel-content {

    padding: 16px 20px;

}



.todo-item,

.recent-activity-item {

    display: flex;

    align-items: center;

    padding: 10px 0;

    border-bottom: 1px solid var(--border-light);

}

/* 跟进活动类型徽章 */
.activity-type-badge {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
    white-space: nowrap;
    margin-right: 4px;
    display: inline-block;
}

.activity-type-badge.call {
    background: rgba(76, 175, 80, 0.12);
    color: #2e7d32;
}

.activity-type-badge.wechat {
    background: rgba(0, 200, 83, 0.12);
    color: #00c853;
}

.activity-type-badge.visit {
    background: rgba(33, 150, 243, 0.12);
    color: #1565c0;
}

.activity-type-badge.system {
    background: rgba(158, 158, 158, 0.15);
    color: #616161;
}



.todo-item:last-child,

.recent-activity-item:last-child {

    border-bottom: none;

}



.todo-time,

.recent-activity-time {

    font-size: 12px;

    color: var(--primary);

    min-width: 70px;

    font-weight: 500;

}



.todo-content,

.recent-activity-content {

    flex: 1;

    margin-left: 12px;

}



.todo-customer,

.recent-activity-customer {

    font-size: 13px;

    font-weight: 500;

    color: var(--text-primary);

}



.todo-summary,

.recent-activity-summary {

    font-size: 12px;

    color: var(--text-muted);

}



.quick-actions {

    margin-top: 24px;

}



.quick-actions h3 {

    font-size: 15px;

    font-weight: 600;

    margin-bottom: 16px;

    display: flex;

    align-items: center;

    gap: 8px;

}



.action-buttons {

    display: grid;

    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));

    gap: 12px;

}



.quick-btn {

    background: var(--bg-white);

    border: 1px solid var(--border-light);

    border-radius: var(--radius);

    padding: 16px;

    display: flex;

    flex-direction: column;

    align-items: center;

    gap: 8px;

    font-size: 13px;

    color: var(--text-secondary);

    cursor: pointer;

    transition: all 0.15s;

}



.quick-btn ion-icon {

    font-size: 24px;

    color: var(--primary);

}



.quick-btn:hover {

    border-color: var(--primary);

    box-shadow: var(--shadow-md);

}



/* ============================================

   跟进统计面板

   ============================================ */

.follow-up-dashboard {

    display: flex;

    gap: 20px;

    margin-bottom: 20px;

}



.task-stats-panel,

.visit-stats-panel,

.history-stats-panel {

    flex: 1;

    background: var(--bg-white);

    border: 1px solid var(--border-light);

    border-radius: var(--radius);

    padding: 16px;

    box-shadow: var(--shadow-sm);

}



.task-stats-panel h4,

.visit-stats-panel h4,

.history-stats-panel h4 {

    font-size: 14px;

    font-weight: 600;

    color: var(--text-primary);

    margin-bottom: 12px;

    padding-bottom: 8px;

    border-bottom: 1px solid var(--border-light);

}



.stats-table {

    width: 100%;

}



.stats-table th {

    text-align: left;

    padding: 8px;

    font-size: 11px;

    color: var(--text-muted);

    font-weight: 500;

}



.stats-table td {

    padding: 8px;

    font-size: 13px;

}



.summary-row {

    background: var(--primary-light);

    font-weight: 600;

}



.highlight-row {

    cursor: pointer;

}



.highlight-row:hover {

    background: var(--bg-hover);

}



.clickable-stat {

    color: var(--primary);

    cursor: pointer;

    font-weight: 600;

}



.clickable-stat:hover {

    text-decoration: underline;

}



/* ============================================

   系统管理

   ============================================ */

#system-section .card {

    max-width: 600px;

}



#system-section .form-group label {

    display: flex;

    align-items: center;

    gap: 12px;

    padding: 12px;

    border: 1px solid var(--border-light);

    border-radius: var(--radius-sm);

    cursor: pointer;

    transition: background 0.15s;

}



#system-section .form-group label:hover {

    background: var(--bg-hover);

}



#system-section .form-group label strong {

    flex: 1;

}



#system-section .btn-primary {

    background: var(--danger);

}



#system-section .btn-primary:hover {

    background: #d32f2f;

}



/* ============================================

   响应式

   ============================================ */

@media (max-width: 1024px) {

    .dashboard-panels {

        grid-template-columns: 1fr;

    }



    .crm-layout {

        flex-direction: column;

    }



    .crm-detail {

        width: 100%;

        height: 50%;

    }

}



/* ============================================

   滚动条

   ============================================ */

::-webkit-scrollbar {

    width: 8px;

    height: 8px;

}



::-webkit-scrollbar-track {

    background: var(--bg-body);

}



::-webkit-scrollbar-thumb {

    background: var(--border-color);

    border-radius: 4px;

}



::-webkit-scrollbar-thumb:hover {

    background: var(--text-muted);

}



/* ============================================

   系统字典样式

   ============================================ */

.dict-tabs {

    display: flex;

    gap: 8px;

    margin-top: 20px;

    border-bottom: 2px solid var(--border-light);

}



.dict-tab {

    padding: 12px 24px;

    background: transparent;

    border: none;

    border-bottom: 3px solid transparent;

    color: var(--text-secondary);

    font-size: 14px;

    font-weight: 500;

    cursor: pointer;

    transition: all 0.2s;

    margin-bottom: -2px;

}



.dict-tab:hover {

    color: var(--primary);

    background: var(--bg-hover);

}



.dict-tab.active {

    color: var(--primary);

    border-bottom-color: var(--primary);

    font-weight: 600;

}



.text-muted {

    color: var(--text-muted);

    font-size: 12px;

}



/* 开关按钮样式 */

.switch {

    position: relative;

    display: inline-block;

    width: 44px;

    height: 24px;

}



.switch input {

    opacity: 0;

    width: 0;

    height: 0;

}



.slider {

    position: absolute;

    cursor: pointer;

    top: 0;

    left: 0;

    right: 0;

    bottom: 0;

    background-color: #ccc;

    transition: 0.3s;

    border-radius: 24px;

}



.slider:before {

    position: absolute;

    content: "";

    height: 18px;

    width: 18px;

    left: 3px;

    bottom: 3px;

    background-color: white;

    transition: 0.3s;

    border-radius: 50%;

}



input:checked+.slider {

    background-color: var(--primary);

}



input:checked+.slider:before {

    transform: translateX(20px);

}



/* ============================================

   工作台美化 - 渐变统计卡片

   ============================================ */

.stat-card.stat-leads {

    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

    color: white;

    border: none;

}



.stat-card.stat-customers {

    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);

    color: white;

    border: none;

}



.stat-card.stat-followups {

    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);

    color: white;

    border: none;

}



.stat-card.stat-employees {

    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);

    color: white;

    border: none;

}



.stat-card.stat-leads .stat-icon,

.stat-card.stat-customers .stat-icon,

.stat-card.stat-followups .stat-icon,

.stat-card.stat-employees .stat-icon {

    background: rgba(255, 255, 255, 0.2);

    color: white;

}



.stat-card.stat-leads .stat-value,

.stat-card.stat-customers .stat-value,

.stat-card.stat-followups .stat-value,

.stat-card.stat-employees .stat-value,

.stat-card.stat-leads .stat-label,

.stat-card.stat-customers .stat-label,

.stat-card.stat-followups .stat-label,

.stat-card.stat-employees .stat-label {

    color: white;

}



.stat-card.stat-leads .stat-label,

.stat-card.stat-customers .stat-label,

.stat-card.stat-followups .stat-label,

.stat-card.stat-employees .stat-label {

    opacity: 0.9;

}



/* 快捷操作美化 */

.quick-actions {

    background: var(--bg-white);

    border-radius: var(--radius);

    padding: 20px;

    margin-bottom: 24px;

    box-shadow: var(--shadow-sm);

}



.quick-actions h3 {

    font-size: 16px;

    font-weight: 600;

    margin-bottom: 16px;

    display: flex;

    align-items: center;

    gap: 8px;

    color: var(--text-primary);

}



.action-buttons {

    display: flex;

    gap: 12px;

    flex-wrap: wrap;

}



.quick-btn {

    display: flex;

    flex-direction: column;

    align-items: center;

    gap: 8px;

    padding: 16px 24px;

    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);

    border: 1px solid var(--border-light);

    border-radius: var(--radius);

    font-size: 13px;

    color: var(--text-primary);

    transition: all 0.2s ease;

    min-width: 100px;

}



.quick-btn ion-icon {

    font-size: 24px;

    color: var(--primary);

}



.quick-btn:hover {

    background: linear-gradient(135deg, var(--primary) 0%, #5e35b1 100%);

    color: white;

    transform: translateY(-2px);

    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);

}



.quick-btn:hover ion-icon {

    color: white;

}



/* 面板美化 */

.dashboard-panels {

    display: grid;

    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));

    gap: 20px;

}



.panel {

    background: var(--bg-white);

    border-radius: var(--radius);

    box-shadow: var(--shadow-sm);

    overflow: hidden;

}



.panel-header {

    display: flex;

    justify-content: space-between;

    align-items: center;

    padding: 16px 20px;

    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);

    border-bottom: 1px solid var(--border-light);

}



.panel-header h3 {

    font-size: 15px;

    font-weight: 600;

    display: flex;

    align-items: center;

    gap: 8px;

    color: var(--text-primary);

}



.panel-header .view-all {

    font-size: 13px;

    color: var(--primary);

    text-decoration: none;

}



.panel-body {

    padding: 16px 20px;

}



/* 自定义字段显示样式 */

.custom-fields-display {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    padding-top: 8px;
    border-top: 1px dashed var(--border-light);
    margin-top: 8px;
}
.custom-fields-display .info-item {
    background: none;
    padding: 0;
    border-radius: 0;
}
.custom-fields-display .info-item label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 2px;
}
.custom-fields-display .info-item span {
    font-size: 13px;
    color: var(--text-primary);
}



/* 加载占位符 */

.loading-placeholder {

    text-align: center;

    padding: 40px 20px;

    color: var(--text-secondary);

}



/* 公告滚动条 */

/* 蓝色卡片中央公告样式 */
.welcome-announcement {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 8px 16px;
    color: #fff;
    flex: 1;
    width: 100%;
    margin: 0 24px;
    overflow: hidden;
    flex-shrink: 1;
}

.welcome-announcement.hidden {
    display: none !important;
}

.welcome-announcement ion-icon {
    color: #fff;
    font-size: 16px;
    flex-shrink: 0;
}

.welcome-announcement .announcement-content {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
}

.welcome-announcement .announcement-content span {
    display: inline-block;
    animation: scrollText 60s linear infinite;
    color: #fff;
    font-weight: 500;
    font-size: 13px;
}



@keyframes scrollText {

    0% {

        transform: translateX(100%);

    }



    100% {

        transform: translateX(-100%);

    }

}



/* 超时遮罩 */

.timeout-overlay {

    position: fixed;

    top: 0;

    left: 0;

    right: 0;

    bottom: 0;

    background: rgba(0, 0, 0, 0.85);

    display: flex;

    flex-direction: column;

    justify-content: center;

    align-items: center;

    z-index: 9999;

}



.timeout-overlay h2 {

    color: white;

    font-size: 24px;

    margin-bottom: 16px;

}



.timeout-overlay p {

    color: #999;

    margin-bottom: 24px;

}



.timeout-overlay button {

    padding: 12px 32px;

    background: var(--primary);

    color: white;

    border: none;

    border-radius: var(--radius-sm);

    font-size: 16px;

    cursor: pointer;

}



/* ============================================

   键盘快捷键样式

   ============================================ */

kbd {

    display: inline-block;

    padding: 3px 8px;

    font-size: 12px;

    font-family: 'Consolas', 'Monaco', monospace;

    line-height: 1.4;

    color: #444;

    background-color: #f7f7f7;

    border: 1px solid #ccc;

    border-radius: 4px;

    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08), 0 2px 0 0 rgba(255, 255, 255, 0.7) inset;

}



/* ============================================

   缓存管理卡片样式覆盖

   ============================================ */

#system-section .card .btn-warning {

    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);

    color: white;

    border: none;

    padding: 10px 20px;

    border-radius: var(--radius-sm);

    display: inline-flex;

    align-items: center;

    gap: 8px;

    font-weight: 500;

    cursor: pointer;

    transition: all 0.2s ease;

}



#system-section .card .btn-warning:hover {

    background: linear-gradient(135deg, #f57c00 0%, #e65100 100%);

    transform: translateY(-1px);

    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);

}



#system-section .card .btn-secondary {

    background: var(--bg-white);

    color: var(--text-secondary);

    border: 1px solid var(--border-color);

    padding: 10px 20px;

    border-radius: var(--radius-sm);

    display: inline-flex;

    align-items: center;

    gap: 8px;

    font-weight: 500;

    cursor: pointer;

    transition: all 0.2s ease;

}



#system-section .card .btn-secondary:hover {

    background: var(--bg-hover);

    border-color: var(--primary);

    color: var(--primary);

}

/* ============================================
   ģ鿨Ƭʽ
   ============================================ */
.follow-up-modules {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 0 20px 20px 20px;
}

.follow-module-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-light);
}

.follow-module-card.wide {
    grid-column: span 1;
}

.follow-module-card.full-width {
    grid-column: span 2;
}

.follow-module-card h4 {
    margin: 0 0 8px 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    padding-bottom: 6px;
    border-bottom: 2px solid var(--primary);
}

.module-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    row-gap: 4px;
    column-gap: 12px;
}

@media (max-width: 768px) {
    .module-stats {
        grid-template-columns: 1fr;
    }
}

.stat-item {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    padding: 2px 10px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 13px;
}

.stat-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    padding: 0 8px;
    display: inline-block;
    box-sizing: border-box;
    line-height: 22px;
}

.stat-value.clickable-stat {
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.stat-value.clickable-stat:hover {
    background: var(--primary);
    color: white;
}

.stats-table.compact {
    font-size: 13px;
}

.stats-table.compact th,
.stats-table.compact td {
    padding: 8px 12px;
}



.clickable-stat {
    cursor: pointer;
    color: #1a73e8;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s;
}

.clickable-stat:hover {
    color: #1557b0;
}


/* Expanded CRM Detail Panel */
.crm-detail.expanded {
    position: fixed !important;
    /* 从固定头部下方开始（头部约 110px + 选项卡栏 42px） */
    top: 152px;
    left: 0;
    width: 100vw;
    height: calc(100vh - 152px);
    z-index: 900;
    border-left: none;
    padding: 24px 40px;
    display: grid;
    grid-template-columns: 380px 1fr;
    grid-template-rows: auto 1fr;
    gap: 24px 40px;
    overflow-y: auto;
    background: #fff;
    transition: all 0.3s ease;
}

.crm-detail.expanded .detail-header {
    grid-column: 1 / -1;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.crm-detail.expanded .detail-info-grid {
    grid-column: 1;
    grid-row: 2;
    align-self: start;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px 8px 0 0; /* 底部直角与按钮拼接 */
    max-height: none;           /* 清除侧边栏的高度限制 */
    overflow-y: visible;        /* 恢复自然可见 */
}

.crm-detail.expanded .status-actions {
    grid-column: 1;
    grid-row: 3;                /* 定位在左侧第一列的第三行（紧跟在信息下方） */
    align-self: start;
    border-bottom: none;
    border-top: 1px solid var(--border-light);
    padding: 16px 20px;
    background: #f8f9fa;        /* 背景色与上方保持一致 */
    margin-top: -24px;          /* 微调负边距与上面无缝贴合 */
    border-radius: 0 0 8px 8px; /* 底部圆角 */
}

.crm-detail.expanded .follow-ups {
    grid-column: 2;
    grid-row: 2 / span 2;       /* 跨越行，右侧高度全部拉满 */
    margin-top: 0;
    border-top: none;
    padding-top: 0;
}

/* Adjust expand button style */
.expand-btn ion-icon {
    transition: transform 0.2s;
}

.expand-btn:hover {
    background: #f0f0f0 !important;
    border-radius: 4px;
}



/* Fix Expanded Panel to respect Sidebar */
.crm-detail.expanded {
    left: var(--sidebar-width, 240px) !important;
    width: calc(100vw - var(--sidebar-width, 240px)) !important;
    /* 保持在固定头部下方 */
    top: 152px !important;
    height: calc(100vh - 152px) !important;
    z-index: 900 !important;
    border-left: 1px solid #ddd !important;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.1) !important;
}


/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
}

.tab-btn {
    padding: 8px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.emp-tab-content.hidden {
    display: none;
}

/* ============================================
   Sidebar Submenus (Stacked / Accordion)
   ============================================ */
.menu-group {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 0;
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    user-select: none;
}

.menu-header:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu-header ion-icon {
    font-size: 18px;
    opacity: 0.9;
}

.group-arrow {
    font-size: 14px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.5;
}

.menu-group.open .menu-header {
    background: rgba(255, 255, 255, 0.03);
    color: #ffffff;
}

.menu-group.open .group-arrow {
    transform: rotate(-180deg);
    opacity: 1;
}

/* Submenu Container */
.menu-submenu {
    display: none;
    background: rgba(0, 0, 0, 0.25);
    /* Darker inset for depth */
    box-shadow: inset 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    padding: 4px 0;
    overflow: hidden;
}

.menu-group.open .menu-submenu {
    display: block;
    animation: slideDown 0.25s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Submenu Items */
.menu-submenu .menu-item {
    padding: 10px 20px 10px 52px;
    /* 20px + 12px(gap) + 18px(icon) + padding */
    font-size: 13.5px;
    color: rgba(255, 255, 255, 0.6);
    border-left: 3px solid transparent;
    transition: all 0.15s;
    height: auto;
}

.menu-submenu .menu-item:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.menu-submenu .menu-item.active {
    background: rgba(26, 115, 232, 0.2);
    color: var(--primary);
    /* Or white/blue light */
    border-left-color: var(--primary);
}

/* Typography Tweaks */
.sidebar .brand {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(to right, rgba(26, 115, 232, 0.1), transparent);
}

.sidebar .brand ion-icon {
    color: var(--primary);
    filter: drop-shadow(0 2px 4px rgba(26, 115, 232, 0.3));
}

/* ============================================
   选项卡式页面导航样式
   ============================================ */

/* 固定头部区域 */
.content-fixed-header {
    background: var(--bg-body);
    padding: 16px 24px 0 24px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}

.content-fixed-header .section-header {
    margin-bottom: 12px;
}

/* 选项卡栏 */
.tab-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-body);
    padding: 0 24px;
    border-bottom: 1px solid var(--border-light);
    min-height: 42px;
    flex-shrink: 0;
    overflow-x: auto;
    scrollbar-width: thin;
}

.tab-bar::-webkit-scrollbar {
    height: 4px;
}

.tab-bar::-webkit-scrollbar-track {
    background: transparent;
}

.tab-bar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

/* 单个选项卡 */
.tab-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    transition: all 0.15s ease;
    position: relative;
    top: 1px;
}

.tab-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.tab-item.active {
    background: var(--bg-white);
    color: var(--primary);
    border-color: var(--border-color);
    font-weight: 500;
    box-shadow: 0 -2px 0 var(--primary) inset;
}

.tab-item ion-icon {
    font-size: 16px;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tab-item ion-icon:hover {
    transform: scale(1.25);
    color: var(--primary);
}

/* 选项卡关闭按钮 */
.tab-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 14px;
    color: var(--text-muted);
    transition: all 0.15s ease;
    margin-left: 4px;
}

.tab-close:hover {
    background: rgba(234, 67, 53, 0.1);
    color: var(--danger);
}

/* 全部关闭按钮 */
.tab-close-all {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
    margin-right: 4px;
    border: 1px solid transparent;
}

.tab-close-all:hover {
    background: rgba(234, 67, 53, 0.1);
    color: var(--danger);
    border-color: rgba(234, 67, 53, 0.2);
}

.tab-close-all ion-icon {
    font-size: 18px;
}

/* 选项卡内容区域 */
.tab-content-wrapper {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tab-content-wrapper .section {
    flex: 1;
    overflow-y: auto;
}

/* 空状态提示 */
.tab-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-size: 14px;
    gap: 12px;
}

.tab-empty-state ion-icon {
    font-size: 48px;
    opacity: 0.5;
}

/* 客户管理筛选按钮激活高亮样式 */
.filter-btn.active {
    background: var(--primary) !important;
    color: #fff !important;
    border-color: var(--primary) !important;
}

/* 新接未处理任务指示统计小药丸 */
.stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff2f0;
    border: 1px solid #ffccc7;
    border-radius: 20px;
    padding: 5px 16px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    box-shadow: 0 1px 2px rgba(255, 77, 79, 0.05);
}

.stat-pill:hover {
    background: #ff4d4f;
    border-color: #ff4d4f;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 77, 79, 0.2);
}

.stat-pill span {
    transition: color 0.25s ease;
}

.stat-pill:hover span {
    color: #fff !important;
}

/* 新增客户弹窗表单 Grid 布局优化 */
#modal-customer {
    width: 650px;
}

#customer-form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    column-gap: 20px;
    row-gap: 12px;
}

#customer-form .form-group {
    margin-bottom: 0;
}

#custom-fields-container {
    display: contents;
}

#customer-form .form-group.full-width {
    grid-column: span 2;
}

#customer-form .modal-actions {
    grid-column: span 2;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

@media (max-width: 768px) {
    #customer-form {
        grid-template-columns: 1fr;
    }
    #customer-form .form-group.full-width,
    #customer-form .modal-actions {
        grid-column: span 1;
    }
}

/* ============================================
   员工弹窗及详情排版优化辅助样式
   ============================================ */

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-span-2 {
    grid-column: span 2;
}

.form-span-3 {
    grid-column: span 3;
}

.form-section-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.form-section-card h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 15px;
    color: var(--text-dark);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-section-card h4::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 14px;
    background: var(--primary);
    border-radius: 2px;
}

@media (max-width: 768px) {
    .form-grid-3, .form-grid-2 {
        grid-template-columns: 1fr !important;
    }
    .form-span-2, .form-span-3 {
        grid-column: span 1 !important;
    }
}

/* 紧凑版表单与详情样式，缩减行距与垂直空间 */
.compact-form {
    padding: 12px 18px !important;
}

.compact-form .form-section-card {
    padding: 10px 14px !important;
    margin-bottom: 10px !important;
    border-radius: 6px !important;
}

.compact-form .form-section-card h4 {
    margin-bottom: 8px !important;
    font-size: 14px !important;
}

.compact-form .form-grid-3,
.compact-form .form-grid-2 {
    gap: 10px 12px !important; /* 减小间隙 */
}

.compact-form .form-group {
    margin-bottom: 8px !important; /* 极简行距 */
}

.compact-form .form-group label {
    margin-bottom: 4px !important;
    font-size: 12px !important;
}

.compact-form input,
.compact-form select {
    height: 32px !important;
    padding: 4px 10px !important;
    font-size: 13px !important;
}

.compact-form textarea {
    padding: 6px 10px !important;
    font-size: 13px !important;
}

/* 详情紧凑化 */
.compact-detail .modal-body {
    padding: 12px 18px !important;
}

.compact-detail .detail-card {
    padding: 10px 14px !important;
    border-radius: 6px !important;
}

.compact-detail .detail-columns {
    gap: 15px !important;
    margin-bottom: 10px !important;
}

.compact-detail .detail-card h4 {
    margin-bottom: 8px !important;
    font-size: 14px !important;
}

.compact-detail .info-item {
    margin-bottom: 2px !important;
}

.compact-detail .info-item label {
    margin-bottom: 2px !important;
    font-size: 11px !important;
}

.compact-detail .info-item span {
    font-size: 13px !important;
}