:root {
    /* --- 清新的浅绿色主色调 --- */
    --primary-green: #a8e6cf;       /* 主要浅绿色 */
    --primary-green-light: #dcedc8;  /* 更浅的绿，用于背景 */
    --primary-green-medium: #81c784; /* 中等绿色，用于强调和成功 */
    --primary-green-dark: #4caf50;   /* 深绿色，用于按钮和图标 */
    --secondary-blue: #bbdefb;       /* 辅助蓝色 */
    --accent-yellow: #fff9c4;       /* 辅助黄色，用于警告 */
    --accent-orange: #ffcc80;       /* 辅助橙色，用于待处理 */
    --accent-red: #ffcdd2;          /* 辅助红色，用于错误 */

    --text-dark: #2e7d32;           /* 深绿色文字 */
    --text-secondary: #558b2f;      /* 次级深绿色文字 */
    --text-light: #81c784;          /* 浅色文字 */

    --bg-base: #f1f8e9;            /* 页面基础背景，非常浅的绿色 */
    --card-bg: #ffffff;            /* 卡片背景 */
    --sidebar-bg: linear-gradient(180deg, var(--primary-green-dark), var(--primary-green)); /* 侧边栏渐变背景 */

    --border-light: #c8e6c9;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
    
    --radius-md: 10px;
    --radius-lg: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ===== 顶部导航栏 ===== */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 28px;
    background: var(--card-bg);
    box-shadow: var(--shadow-sm);
    z-index: 100;
    border-bottom: 1px solid var(--border-light);
    position: sticky; /* 固定定位 */
    top: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-green-dark);
}
.logo::before {
    content: "";
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--primary-green), var(--primary-green-dark));
    border-radius: 10px;
    display: inline-block;
}

.top-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.notification-btn, .user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid var(--primary-green);
    transition: all 0.2s;
    position: relative;
}

.notification-btn {
    background: linear-gradient(135deg, var(--primary-green), var(--primary-green-dark));
    color: white;
}

.user-avatar {
    background: linear-gradient(135deg, var(--accent-orange), var(--primary-green));
    color: white;
    font-weight: bold;
}

.notification-btn:hover, .user-avatar:hover {
    transform: scale(1.05);
}

.notification-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--accent-red);
    color: white;
    font-size: 0.7rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== 主容器 ===== */
.container {
    display: flex;
    min-height: calc(100vh - 70px);
}

/* ===== 侧边栏 (固定) ===== */
.sidebar {
    width: 250px; /* 固定宽度 */
    background: var(--sidebar-bg);
    box-shadow: var(--shadow-md);
    padding: 28px 0;
    flex-shrink: 0; /* 不允许收缩 */
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    position: sticky; /* 固定定位 */
    top: 70px; /* 与top-bar高度一致 */
    height: calc(100vh - 70px); /* 高度占满剩余空间 */
    overflow-y: auto; /* 内容过多时可滚动 */
}

.menu-title {
    padding: 0 28px 14px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary-green-light);
    font-weight: 600;
}

.nav-list {
    list-style: none;
}

.nav-item {
    margin-bottom: 2px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 15px 28px;
    color: #e8f5e9;
    text-decoration: none;
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    cursor: default; /* 导航按钮默认为default光标 */
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    border-left: 4px solid white;
    color: white;
    font-weight: 600;
}

.nav-icon {
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

.nav-badge {
    background: var(--accent-red);
    color: white;
    font-size: 0.7rem;
    border-radius: 4px;
    padding: 2px 7px;
    margin-left: auto;
}

/* ===== 主内容区 ===== */
.main-content {
    flex: 1;
    padding: 28px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.page-title {
    font-size: 1.7rem;
    font-weight: 600;
    color: var(--text-dark);
}

.action-buttons {
    display: flex;
    gap: 14px;
}

.btn {
    padding: 11px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-green-dark), var(--primary-green));
    color: white;
}
.btn-primary:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-dark);
}
.btn-outline:hover {
    background: var(--primary-green-light);
    border-color: var(--primary-green-dark);
    color: var(--primary-green-dark);
}

/* ===== 仪表盘卡片网格 ===== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 22px;
    margin-bottom: 30px;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--border-light);
}
.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.card-title {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-value {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--primary-green-dark);
}

.card-trend {
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 5px;
}
.trend-up { color: var(--primary-green-medium); }
.trend-down { color: var(--accent-red); }

/* ===== 两列布局区域 ===== */
.content-columns {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 26px;
}

/* ===== 列表样式 ===== */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.search-box {
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    background: var(--primary-green-light);
    color: var(--text-dark);
    width: 250px;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 16px 18px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

th {
    background-color: var(--primary-green-light);
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
}

tr:hover {
    background-color: rgba(168, 230, 207, 0.1);
}

.status-badge {
    padding: 5px 12px;
    border-radius: 22px;
    font-size: 0.78rem;
    font-weight: 500;
}
.status-pending { background: var(--accent-orange); color: #5d4037; }
.status-processing { background: var(--secondary-blue); color: #1a237e; }
.status-completed { background: var(--primary-green-medium); color: white; }
.status-low { background: var(--accent-red); color: #b71c1c; }
.status-normal { background: var(--primary-green-light); color: var(--text-secondary); }
.status-high { background: var(--primary-green-medium); color: white; }

.action-cell {
    display: flex;
    gap: 8px;
}

.action-btn {
    padding: 7px 12px;
    border-radius: 8px;
    border: none;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background-color 0.2s;
}
.action-btn.process { background: var(--secondary-blue); color: #1a237e; }
.action-btn.process:hover { background: #1a237e; color: white; }
.action-btn.detail { background: var(--primary-green-light); color: var(--text-secondary); }
.action-btn.detail:hover { background: var(--text-secondary); color: white; }

/* ===== 表单样式 ===== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: var(--primary-green-light);
    color: var(--text-dark);
    font-size: 0.95rem;
    transition: border-color 0.2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary-green-dark);
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

/* ===== 图表容器 ===== */
.chart-container {
    position: relative;
    width: 100%;
    height: 300px;
    margin: 20px 0;
}

/* ===== 提醒卡 (合并客户评价) ===== */
.reminder-card {
    padding: 24px;
}

.reminder-item {
    padding: 18px 0;
    border-bottom: 1px solid var(--border-light);
}
.reminder-item:last-child {
    border-bottom: none;
}

.reminder-title {
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: var(--text-dark);
}
.reminder-time {
    font-size: 0.84rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.btn-small {
    padding: 8px 15px;
    font-size: 0.82rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
}
.btn-action {
    background: var(--primary-green);
    color: white;
}
.btn-action:hover {
     background: var(--primary-green-dark);
}
.btn-outline-small {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-dark);
}
.btn-outline-small:hover {
    background: var(--primary-green-light);
    border-color: var(--primary-green-dark);
    color: var(--primary-green-dark);
}

/* ===== 项目进度卡 ===== */
.progress-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chart-container-sm {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 18px;
}

.progress-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 18px;
    margin-top: 18px;
    width: 100%;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.84rem;
}
.legend-dot {
    width: 13px;
    height: 13px;
    border-radius: 50%;
}
.dot-completed { background: var(--primary-green-medium); }
.dot-in-progress { background: var(--secondary-blue); }
.dot-pending { background: var(--accent-orange); }

/* ===== 通知抽屉 ===== */
.notification-drawer {
    position: fixed;
    top: 0;
    right: -350px; /* 初始隐藏 */
    width: 320px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: right 0.3s ease;
    padding: 20px;
    display: flex;
    flex-direction: column;
}
.notification-drawer.open {
    right: 0; /* 打开时的位置 */
}
.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-light);
}
.close-drawer {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}
.notification-list {
    flex: 1;
    overflow-y: auto;
    margin-top: 15px;
}
.notification-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}
.notification-item:last-child {
    border-bottom: none;
}
.notification-item p {
    margin: 0;
    font-size: 0.9rem;
}
.notification-item small {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* ===== 遮罩层 ===== */
.overlay {
    display: none; /* 默认隐藏 */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}
.overlay.show {
    display: block;
}

/* ===== 隐藏内容区（用于模拟不同页面）===== */
.page-content {
    display: none;
}
.page-content.active {
    display: block;
}

/* ===== 响应式断点 ===== */
@media (max-width: 992px) {
    .content-columns {
        grid-template-columns: 1fr;
    }
    .sidebar {
        width: 75px;
    }
    .nav-link span { display: none; }
    .nav-link {
        justify-content: center;
        padding: 15px 10px;
    }
    .logo span { display: none; }
    .req-list-header, .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .top-bar {
        flex-direction: row;
        justify-content: space-between;
    }
    .action-buttons {
        flex-wrap: wrap;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .notification-drawer {
        width: 100%;
        right: -100%;
    }
}

/* ===== 模态窗样式 ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
}

.modal-header h3 {
    margin: 0;
    color: var(--text-dark);
}

.close-modal {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.close-modal:hover {
    color: var(--accent-red);
}

.modal-body {
    padding: 20px 24px;
}

.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-value {
    padding: 12px 15px;
    background: var(--primary-green-light);
    border-radius: 8px;
    color: var(--text-dark);
    min-height: 20px;
    white-space: pre-wrap; /* 保留换行符 */
}

.modal-footer {
    padding: 16px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid var(--border-light);
}

/* ===== 标签页样式 ===== */
.tab-container {
    margin-bottom: 20px;
}

.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 20px;
}

.tab {
    padding: 12px 24px;
    cursor: pointer;
    background: var(--primary-green-light);
    border: 1px solid var(--border-light);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    margin-right: 5px;
    transition: all 0.3s;
}

.tab.active, .tab.tab-active {
    background: var(--card-bg);
    border-bottom: 1px solid var(--card-bg);
    margin-bottom: -1px;
    font-weight: bold;
    color: var(--primary-green-dark);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}


/* 在原有CSS基础上添加以下样式 */
.history-panel {
    position: fixed;
    top: 70px;
    right: -350px;
    width: 320px;
    height: calc(100vh - 70px);
    background: white;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: right 0.3s ease;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.history-panel.open {
    right: 0;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 15px;
}

.history-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.history-list {
    flex: 1;
    overflow-y: auto;
}

.history-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

.history-item:last-child {
    border-bottom: none;
}

.history-item p {
    margin: 0;
    font-size: 0.9rem;
}

.history-item small {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.history-toggle-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid var(--primary-green);
    transition: all 0.2s;
    position: relative;
    background: linear-gradient(135deg, var(--primary-green), var(--primary-green-dark));
    color: white;
}

.history-toggle-btn:hover {
    transform: scale(1.05);
}

.history-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--accent-red);
    color: white;
    font-size: 0.7rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 修改通知抽屉位置 */
.notification-drawer {
    position: fixed;
    top: 0;
    right: -350px; /* 初始隐藏 */
    width: 320px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: right 0.3s ease;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

/* 移动通知按钮到左边 */
.notification-btn {
    background: linear-gradient(135deg, var(--primary-green), var(--primary-green-dark));
    color: white;
    margin-right: 10px;
}

.history-btn {
    margin-right: 10px;
}