/* ========================================
   CRM系统 - 简约蓝白风格
   ======================================== */

/* CSS 变量 */
:root {
    --primary-blue: #2563eb;
    --primary-blue-dark: #1d4ed8;
    --primary-blue-light: #3b82f6;
    --white: #ffffff;
    --black: #1f2937;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #0ea5e9;
    --font-size-base: 14px;
    --font-size-sm: 13px;
    --font-size-lg: 16px;
    --border-radius: 8px;
}

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: var(--font-size-base);
    color: var(--black);
    background: var(--gray-50);
    line-height: 1.5;
}

/* 导航栏 - 蓝色 */
.navbar {
    background: var(--primary-blue) !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 0.75rem 1.5rem;
}

.navbar-brand {
    color: var(--white) !important;
    font-size: var(--font-size-lg);
    font-weight: 600;
}

.navbar .nav-link,
.navbar .text-white {
    color: var(--white) !important;
    font-size: var(--font-size-base);
}

.navbar .btn-outline-light {
    border-color: rgba(255,255,255,0.5);
    color: var(--white);
    font-size: var(--font-size-base);
}

.navbar .btn-outline-light:hover {
    background: var(--white);
    color: var(--primary-blue);
}

/* 卡片 - 白色背景 */
.card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.card-header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 1.25rem;
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--black);
}

.card-body {
    padding: 1.25rem;
}

/* 统计卡片 */
.stat-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    border-left: 4px solid var(--primary-blue);
}

.stat-card:hover {
    box-shadow: 0 4px 6px rgba(0,0,0,0.07);
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--black);
    line-height: 1.2;
}

.stat-label {
    font-size: var(--font-size-base);
    color: var(--gray-500);
    margin-top: 4px;
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--white);
    background: var(--primary-blue);
}

/* 按钮样式 */
.btn {
    font-size: var(--font-size-base);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.btn-sm {
    font-size: var(--font-size-sm);
    padding: 0.375rem 0.75rem;
}

/* 主要按钮 - 蓝色 */
.btn-primary {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-blue-dark);
    border-color: var(--primary-blue-dark);
}

/* 成功按钮 - 绿色 */
.btn-success {
    background: var(--success);
    border-color: var(--success);
    color: var(--white);
}

.btn-success:hover {
    background: #16a34a;
    border-color: #16a34a;
}

/* 危险按钮 - 红色 */
.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
}

/* 警告按钮 - 橙色 */
.btn-warning {
    background: var(--warning);
    border-color: var(--warning);
    color: var(--white);
}

.btn-warning:hover {
    background: #d97706;
    border-color: #d97706;
}

/* 次要按钮 - 灰色 */
.btn-secondary {
    background: var(--gray-500);
    border-color: var(--gray-500);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--gray-700);
    border-color: var(--gray-700);
}

/* 轮廓按钮 */
.btn-outline-primary {
    color: var(--primary-blue);
    border-color: var(--gray-200);
    background: var(--white);
}

.btn-outline-primary:hover {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: var(--white);
}

/* 表格 */
.table {
    font-size: var(--font-size-base);
    color: var(--black);
}

.table thead th {
    background: var(--primary-blue);
    color: var(--white);
    font-weight: 600;
    font-size: var(--font-size-base);
    padding: 0.75rem 1rem;
    border: none;
}

.table tbody td {
    padding: 0.75rem 1rem;
    border-color: var(--gray-200);
    vertical-align: middle;
}

.table tbody tr:hover {
    background: var(--gray-50);
}

/* 表单 */
.form-control,
.form-select {
    font-size: var(--font-size-base);
    color: var(--black);
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-label {
    font-size: var(--font-size-base);
    font-weight: 500;
    color: var(--black);
    margin-bottom: 0.375rem;
}

/* 输入组 */
.input-group-text {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: var(--white);
    font-size: var(--font-size-base);
}

/* 徽章 */
.badge {
    font-size: 12px;
    font-weight: 500;
    padding: 0.35em 0.65em;
    border-radius: 4px;
}

.badge.bg-primary { background: var(--primary-blue) !important; }
.badge.bg-success { background: var(--success) !important; }
.badge.bg-danger { background: var(--danger) !important; }
.badge.bg-warning { background: var(--warning) !important; color: var(--white) !important; }
.badge.bg-info { background: var(--info) !important; }
.badge.bg-secondary { background: var(--gray-500) !important; }

/* 模态框 */
.modal-content {
    border: none;
    border-radius: var(--border-radius);
}

.modal-header {
    background: var(--primary-blue);
    color: var(--white);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    padding: 1rem 1.25rem;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.modal-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
}

.modal-body {
    padding: 1.25rem;
    font-size: var(--font-size-base);
}

.modal-footer {
    border-top: 1px solid var(--gray-200);
    padding: 1rem 1.25rem;
}

/* 页面头部 */
.page-header {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--black);
    margin: 0;
}

/* 欢迎卡片 */
.welcome-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.welcome-card h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--black);
    margin-bottom: 0.25rem;
}

.welcome-card p {
    font-size: var(--font-size-base);
    color: var(--gray-500);
    margin: 0;
}

/* 功能模块卡片 */
.module-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    height: 100%;
}

.module-card .card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.module-card .module-icon {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--white);
}

.module-card .module-title {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--black);
    margin: 0;
}

.module-card .module-desc {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
    margin: 0;
}

/* 操作按钮列表 */
.action-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.action-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0.875rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    text-decoration: none;
    color: var(--black);
    font-size: var(--font-size-base);
    transition: all 0.15s ease;
}

.action-item:hover {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: var(--white);
}

.action-item i {
    font-size: 14px;
}

/* 快速访问 */
.quick-link {
    display: block;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    padding: 1rem;
    text-align: center;
    text-decoration: none;
    transition: all 0.15s ease;
}

.quick-link:hover {
    border-color: var(--primary-blue);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.quick-link .icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 0.5rem;
    border-radius: var(--border-radius);
    background: var(--primary-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--white);
}

.quick-link .title {
    font-size: var(--font-size-base);
    font-weight: 500;
    color: var(--black);
    margin-bottom: 0.125rem;
}

.quick-link .desc {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
}

/* 分页 */
.pagination {
    gap: 0.25rem;
}

.page-link {
    font-size: var(--font-size-base);
    color: var(--black);
    border: 1px solid var(--gray-200);
    border-radius: 6px !important;
    padding: 0.375rem 0.75rem;
}

.page-link:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
    color: var(--black);
}

.page-item.active .page-link {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: var(--white);
}

/* 警告提示 */
.alert {
    font-size: var(--font-size-base);
    border-radius: var(--border-radius);
    border: none;
    padding: 0.75rem 1rem;
}

.alert-success { background: #dcfce7; color: #166534; }
.alert-danger { background: #fee2e2; color: #991b1b; }
.alert-warning { background: #fef3c7; color: #92400e; }
.alert-info { background: #dbeafe; color: #1e40af; }

/* 登录页面 */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    padding: 1.5rem;
}

.login-card {
    background: var(--white);
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-200);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 400px;
    overflow: hidden;
}

.login-header {
    background: var(--primary-blue);
    padding: 2rem;
    text-align: center;
    color: var(--white);
}

.login-header .logo {
    font-size: 48px;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-header .logo img {
    max-width: 100%;
    height: auto;
}

.login-header h1 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.login-header p {
    font-size: var(--font-size-base);
    opacity: 0.9;
    margin: 0;
}

.login-body {
    padding: 2rem;
}

.login-body .form-control {
    height: 44px;
    font-size: var(--font-size-base);
}

.login-body .btn {
    height: 44px;
    font-size: var(--font-size-base);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--gray-500);
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state .title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--black);
    margin-bottom: 0.25rem;
}

.empty-state .desc {
    font-size: var(--font-size-base);
}

/* 表格响应式 */
.table-responsive {
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-200);
}

/* 操作按钮组 */
.action-buttons {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.action-buttons .btn {
    padding: 0.25rem 0.5rem;
    font-size: var(--font-size-sm);
}

/* 筛选区域 */
.filter-section {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}

/* 下拉菜单 */
.dropdown-menu {
    font-size: var(--font-size-base);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.dropdown-item {
    font-size: var(--font-size-base);
    padding: 0.5rem 1rem;
    color: var(--black);
}

.dropdown-item:hover {
    background: var(--gray-100);
}

/* 滚动条 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* 图标颜色类 */
.icon-blue { color: var(--primary-blue); }
.icon-green { color: var(--success); }
.icon-red { color: var(--danger); }
.icon-orange { color: var(--warning); }
.icon-cyan { color: var(--info); }
.icon-purple { color: #8b5cf6; }
.icon-pink { color: #ec4899; }

/* 背景颜色类 */
.bg-blue { background: var(--primary-blue) !important; }
.bg-green { background: var(--success) !important; }
.bg-red { background: var(--danger) !important; }
.bg-orange { background: var(--warning) !important; }
.bg-cyan { background: var(--info) !important; }
.bg-purple { background: #8b5cf6 !important; }
.bg-pink { background: #ec4899 !important; }
