/* 企基CRM客户管理系统样式 - 响应式设计，移动端优化 */

/* 全局样式 */
:root {
    --primary-color: #0d6efd;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 登录页面样式 */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.login-card {
    border-radius: 20px;
    border: none;
    overflow: hidden;
}

.login-card .card-body {
    background: #fff;
}

/* 响应式导航栏 */
.navbar {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.1rem;
}


/* 移动端优化 - 触摸友好 */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1rem;
    }
    
    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.95rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1.05rem;
    }
    
}

/* 卡片样式 */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.card-header {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    border-radius: 12px 12px 0 0 !important;
    padding: 1rem 1.25rem;
}

.card-body {
    padding: 1.25rem;
}

/* 客户列表卡片 */
.customer-item {
    cursor: pointer;
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
}

.customer-item:hover {
    border-left-color: var(--success-color);
    transform: translateX(5px);
}

.customer-item.public-customer {
    border-left-color: #ffc107;
}

.customer-item .badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.65rem;
}

/* 移动端客户卡片 */
@media (max-width: 768px) {
    .customer-item {
        margin-bottom: 0.75rem;
    }
    
    .customer-name {
        font-size: 1rem;
        font-weight: 600;
    }
    
    .customer-info {
        font-size: 0.85rem;
        color: #6c757d;
    }
}

/* 表单样式 */
.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

.form-label.required::after {
    content: "*";
    color: var(--danger-color);
    margin-left: 4px;
}

.form-control {
    border: 1px solid #ced4da;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.1);
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    min-height: 100px;
}

/* 移动端表单优化 */
@media (max-width: 768px) {
    .form-control {
        font-size: 16px; /* 防止iOS自动缩放 */
    }
}

/* 按钮样式优化 */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    min-height: 44px; /* 移动端触摸目标大小 */
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f8a 100%);
}

.btn-group {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.btn-group .btn {
    border-radius: 0;
}

/* 响应式按钮 */
@media (max-width: 768px) {
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        width: 100%;
        margin-bottom: 0.5rem;
        border-radius: 8px;
    }
}

/* 徽章样式 */
.badge {
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-weight: 500;
}

/* 加载指示器 */
.spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.25em;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* 分页样式 */
.pagination {
    margin-top: 1.5rem;
}

.page-link {
    border-radius: 8px;
    margin: 0 2px;
    border: none;
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.page-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.page-item.active .page-link {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* 移动端分页优化 */
@media (max-width: 768px) {
    .pagination {
        flex-wrap: wrap;
    }
    
    .page-link {
        margin: 2px;
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
}

/* 操作按钮组 */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.action-buttons .btn {
    flex: 1;
    min-width: 80px;
}

@media (max-width: 576px) {
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons .btn {
        width: 100%;
    }
}

/* 工具栏优化 */
.toolbar {
    background: white;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .toolbar {
        padding: 0.75rem;
    }
}

/* 搜索框优化 */
input[type="text"].form-control,
input[type="search"].form-control {
    -webkit-appearance: none;
    appearance: none;
}

/* 模态框优化 */
.modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
    border-radius: 16px 16px 0 0;
    position: relative;
}

.modal-header .close {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    font-weight: bold;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.modal-header .close:hover {
    opacity: 1;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    border-radius: 0 0 16px 16px;
}

/* 防止模态框导致水平滚动条 */
.modal-open {
    overflow-x: hidden !important;
}

/* 确保 modal-xl 在小屏幕上不会超出视口 */
@media (max-width: 1200px) {
    .modal-xl {
        max-width: calc(100% - 2rem);
    }
}

@media (max-width: 768px) {
    .modal-xl {
        max-width: calc(100% - 1rem);
    }
    
    .modal-dialog {
        margin: 0.5rem;
    }
}

/* 确保回收站模态框内容不会超出 */
#recycleBinModal .table-responsive {
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

/* 客户表单样式 */
.customer-form {
    width: 100%;
}

.customer-form .card {
    margin-bottom: 1rem;
}

/* 提示信息 */
.alert {
    border-radius: 12px;
    border: none;
    padding: 1rem 1.25rem;
}

.alert-info {
    background: #e7f3ff;
    color: #0c5460;
}

/* 响应式容器 */
@media (max-width: 768px) {
    .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .mt-4 {
        margin-top: 1rem !important;
    }
    
    .mb-3 {
        margin-bottom: 1rem !important;
    }
}

/* 特殊优化：防止移动端横屏时字体过大 */
@media screen and (min-width: 768px) and (max-width: 1024px) {
    body {
        font-size: 15px;
    }
}

/* 底部安全区域（移动端） */
@supports (padding: max(0px)) {
    body {
        padding-bottom: max(0px, env(safe-area-inset-bottom));
    }
}

/* 优化滚动行为 */
html {
    scroll-behavior: smooth;
}

/* 触摸设备优化 */
@media (hover: none) {
    .card:hover {
        transform: none;
    }
    
    .customer-item:hover {
        transform: none;
    }
}

/* 动画优化 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* 响应式工具类 */
@media (max-width: 576px) {
    .text-center-sm {
        text-align: center !important;
    }
    
    .w-100-sm {
        width: 100% !important;
    }
}

/* ========== 新布局样式：顶部导航 + 左侧菜单 ========== */

/* 主体容器 */
.app-container {
    display: flex;
    min-height: calc(100vh - 56px);
}

/* 左侧菜单样式 */
.sidebar {
    width: 250px;
    background-color: #2c3e50;
    color: #ecf0f1;
    position: fixed;
    height: calc(100vh - 56px);
    left: 0;
    top: 56px;
    overflow-y: auto;
    z-index: 999;
    transition: transform 0.3s ease, width 0.3s ease;
}

.sidebar .nav {
    padding: 1rem 0;
}

.sidebar .nav-item {
    margin: 0;
}

.sidebar .nav-link {
    color: #ecf0f1;
    padding: 0.875rem 1.5rem;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    position: relative;
}

.sidebar .nav-link i {
    margin-right: 0.75rem;
    font-size: 1.1rem;
    width: 20px;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background-color: #34495e;
    border-left-color: #3498db;
    color: #fff;
}

.sidebar .nav-link.active {
    background-color: #3498db;
    font-weight: 600;
}

/* 子菜单 */
.submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    background-color: #1a252f;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.submenu.show {
    max-height: 500px;
}

body.sidebar-transitioning .sidebar .submenu {
    transition: none !important;
}

body.sidebar-transitioning.sidebar-collapsing .sidebar .submenu {
    display: none !important;
}

.submenu li {
    margin: 0;
}

.submenu a {
    display: block;
    padding: 0.75rem 1.5rem 0.75rem 3.5rem;
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.3s ease;
}

.submenu a i {
    margin-right: 0.5rem;
    font-size: 0.9rem;
    width: 15px;
}

.submenu a:hover {
    background-color: #2c3e50;
    color: #fff;
    padding-left: 3.75rem;
}

.submenu a.active {
    background-color: #3498db;
    color: #fff;
}

.sidebar-collapse-fab {
    position: absolute;
    bottom: 16px;
    left: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: #ecf0f1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease, transform 0.2s ease;
    z-index: 1000;
}

.sidebar-collapse-fab:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.sidebar-collapse-fab:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.5);
}

.sidebar-collapse-fab i {
    font-size: 1rem;
    line-height: 1;
}

/* 折叠状态浮动菜单预览 */
.sidebar-flyout {
    position: fixed;
    top: 0;
    left: 0;
    min-width: 220px;
    max-width: 280px;
    background-color: #1f2d3a;
    border-radius: 12px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
    padding: 0.5rem 0.25rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 1200;
}

.sidebar-flyout.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
}

.sidebar-flyout-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-flyout-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    padding: 0.5rem 1.5rem 0;
}

.sidebar-flyout-menu {
    list-style: none;
    padding: 0.25rem 0;
    margin: 0;
}

.sidebar-flyout-menu li a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.5rem;
    color: #ecf0f1;
    text-decoration: none;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    transition: background 0.2s ease, border-left-color 0.2s ease, padding 0.2s ease;
}

.sidebar-flyout-menu li a i {
    width: 18px;
    text-align: center;
}

.sidebar-flyout-menu li a:hover {
    background-color: #2c3e50;
    border-left-color: #3498db;
    padding-left: 1.75rem;
}

.sidebar-flyout-menu li a.active {
    background-color: #3498db;
    border-left-color: #3498db;
    color: #fff;
}

.sidebar-flyout-single-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: background 0.2s ease, border-left-color 0.2s ease;
}

.sidebar-flyout-single-link:hover {
    background-color: #2c3e50;
    border-left-color: #3498db;
}

body:not(.sidebar-collapsed) .sidebar-flyout {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

@media (max-width: 991px) {
    .sidebar-flyout {
        display: none;
    }
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 0;
    background-color: #f5f5f5;
}

/* 移动端菜单切换 */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
}

@media (min-width: 992px) {
    body.sidebar-collapsed .sidebar {
        width: 72px;
    }

    body.sidebar-collapsed .main-content {
        margin-left: 72px;
    }

    body.sidebar-collapsed .sidebar .nav-link {
        justify-content: center;
        padding: 0.875rem 0.5rem;
    }

    body.sidebar-collapsed .sidebar .nav-link span,
    body.sidebar-collapsed .sidebar .submenu,
    body.sidebar-collapsed .sidebar .menu-arrow {
        display: none !important;
    }

    body.sidebar-collapsed .sidebar .nav-link i {
        margin-right: 0;
    }
    
    body.sidebar-collapsed .sidebar-collapse-fab {
        left: 16px;
    }
}

/* 菜单箭头样式 - 固定位置，通过旋转改变方向 */
.sidebar .nav-link .menu-arrow,
.sidebar .nav-link .bi-chevron-down {
    margin-left: auto;
    font-size: 0.875rem;
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    transform-origin: center center;
    flex-shrink: 0;
}

/* 当菜单展开时，旋转箭头180度（使用:has()选择器，现代浏览器） */
.sidebar .nav-item:has(.submenu.show) .nav-link .menu-arrow,
.sidebar .nav-item:has(.submenu.show) .nav-link .bi-chevron-down {
    transform: rotate(180deg);
}

/* 使用 expanded 类控制箭头旋转（兼容所有浏览器） */
.sidebar .nav-link.expanded .menu-arrow,
.sidebar .nav-link.expanded .bi-chevron-down {
    transform: rotate(180deg);
}

/* 兼容不支持:has()的浏览器 - 确保 expanded 类优先级 */
@supports not selector(:has(*)) {
    .sidebar .nav-link.expanded .menu-arrow,
    .sidebar .nav-link.expanded .bi-chevron-down {
        transform: rotate(180deg);
    }
}

/* 统计卡片优化 */
.card.bg-primary,
.card.bg-warning,
.card.bg-success {
    border: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.card-title {
    font-size: 0.9rem;
    opacity: 0.9;
}

.display-4 {
    font-size: 3rem;
}

/* 快捷操作按钮 */
.btn.py-3 {
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.btn.py-3:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn.py-3:active {
    transform: translateY(-1px);
}

/* 快捷操作按钮图标动画 */
.quick-action-btn i {
    transition: transform 0.3s ease;
}

.quick-action-btn:hover i {
    transform: scale(1.1) rotate(5deg);
}

.quick-action-btn:hover .bi-arrow-clockwise {
    animation: spin 1s ease-in-out;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 数据卡片样式增强 */
.card.shadow-sm {
    border: none;
    transition: all 0.3s ease;
}

.card.shadow-sm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15) !important;
}

/* 数据卡片图标动画 */
.card.shadow-sm .display-4 i {
    transition: transform 0.3s ease;
}

.card.shadow-sm:hover .display-4 i {
    transform: scale(1.1);
}

/* 侧边栏滚动条样式 */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #2c3e50;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #777;
}

/* ========== 客户列表页面增强样式 ========== */

/* 页面标题 */
.page-header {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    padding: 1.5rem;
    border-radius: 16px;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .page-header {
        padding: 1rem;
        border-radius: 12px;
    }
}

/* 搜索框优化 */
.search-input-wrapper {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-radius: 12px;
    overflow: hidden;
}

.search-input-wrapper .form-control:focus {
    box-shadow: none;
}

.search-input-wrapper .input-group-text {
    border: none;
}

/* 筛选按钮组优化 */
.customer-filter-group {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-radius: 12px;
    overflow: hidden;
}

.customer-filter-group .btn {
    border: none;
    padding: 0.75rem 1rem;
    font-weight: 500;
}

@media (max-width: 768px) {
    .customer-filter-group {
        flex-direction: column;
    }
    
    .customer-filter-group .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* 统计信息 */
.comm-statistics {
    gap: 1rem;
}

.stat-item {
    padding: 0.5rem 1rem;
    background: rgba(13, 110, 253, 0.05);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
}

.stat-item i {
    margin-right: 0.5rem;
}

/* 模态框渐变头部 */
.modal-header.bg-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

/* 表单输入组优化 */
.input-group-text {
    background-color: #f8f9fa;
    border-color: #ced4da;
    color: #6c757d;
    min-width: 40px;
    justify-content: center;
}

.input-group .form-control:focus ~ .input-group-text,
.input-group .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.1);
}

/* 客户卡片增强 */
.customer-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none !important;
}

.customer-item .card-body {
    padding: 1.25rem;
}

.customer-item:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.12) !important;
}

@media (max-width: 768px) {
    .customer-item .card-body {
        padding: 1rem;
    }
    
    .action-buttons {
        width: 100%;
        margin-top: 0.75rem;
    }
    
    .action-buttons .btn {
        flex: 1;
    }
}

/* 模态框在移动端全屏 */
@media (max-width: 768px) {
    .modal-dialog {
        max-width: 100%;
        margin: 0;
    }
    
    .modal-content {
        min-height: 100vh;
        border-radius: 0;
    }
    
    .modal-body {
        padding: 1rem;
    }
}

/* 空状态优化 */
.empty-state {
    background: rgba(108, 117, 125, 0.05);
    border-radius: 16px;
}

.empty-state h5 {
    color: #6c757d;
    font-size: 1.25rem;
}

/* 加载动画 */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading-pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

/* 卡片阴影效果 */
.shadow-sm {
    box-shadow: 0 4px 6px rgba(0,0,0,0.07) !important;
}

/* 响应式表格（未来可以用于详情） */
.table-responsive {
    border-radius: 12px;
    overflow: hidden;
}

/* 标签徽章优化 */
.badge {
    padding: 0.4rem 0.8rem;
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* 按钮过渡效果 */
.btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* 表单分组颜色主题 */
.bg-primary.bg-opacity-10 {
    background-color: rgba(13, 110, 253, 0.08) !important;
}

.bg-success.bg-opacity-10 {
    background-color: rgba(25, 135, 84, 0.08) !important;
}

.bg-info.bg-opacity-10 {
    background-color: rgba(13, 202, 240, 0.08) !important;
}

.bg-warning.bg-opacity-10 {
    background-color: rgba(255, 193, 7, 0.08) !important;
}

/* 滚动条美化 */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 移动端下拉菜单优化 */
@media (max-width: 768px) {
    .dropdown-menu {
        min-width: 100%;
    }
}

/* 客户详情展示优化 */
.customer-details {
    background: rgba(248, 249, 250, 0.5);
    padding: 0.75rem;
    border-radius: 8px;
}

.customer-info {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: #6c757d;
}

.customer-info i {
    font-size: 1rem;
}

/* 操作按钮优化 */

/* ========== 分页样式优化 ========== */

/* PC端分页样式 */
.pagination-pc .pagination {
    margin-bottom: 1rem;
}

.pagination-pc .page-item {
    margin: 0 2px;
}

.pagination-pc .page-link {
    min-width: 38px;
    text-align: center;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    color: #495057;
    border-color: #dee2e6;
}

.pagination-pc .page-link:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.pagination-pc .page-item.active .page-link {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(13, 110, 253, 0.3);
}

.pagination-pc .page-item.disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-pc .page-link i {
    font-size: 0.875rem;
}

/* 移动端分页样式 */
.pagination-mobile {
    padding: 1rem 0;
}

.pagination-mobile .btn {
    min-height: 44px; /* 移动端触摸友好尺寸 */
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    touch-action: manipulation;
}

.pagination-mobile .btn.disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

.pagination-mobile .btn:not(.disabled):active {
    transform: scale(0.95);
}

.pagination-mobile .btn-primary {
    box-shadow: 0 2px 4px rgba(13, 110, 253, 0.3);
}

.pagination-mobile .btn-sm {
    min-height: 36px;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    min-width: 44px; /* 确保按钮足够大，易于点击 */
}

/* 移动端页码按钮组 */
.pagination-mobile .d-flex {
    gap: 0.5rem !important;
}

.pagination-mobile .btn-sm {
    flex: 0 0 auto;
}

/* 响应式调整 */
@media (max-width: 576px) {
    .pagination-mobile .btn {
        min-height: 40px;
        padding: 0.5rem 0.875rem;
        font-size: 0.85rem;
    }
    
    .pagination-mobile .btn-sm {
        min-height: 36px;
        min-width: 38px;
        padding: 0.35rem 0.65rem;
        font-size: 0.8rem;
    }
    
    .pagination-pc .page-link {
        min-width: 32px;
        padding: 0.4rem 0.6rem;
        font-size: 0.875rem;
    }
}
.btn-outline-warning {
    color: #ffc107;
    border-color: #ffc107;
}

.btn-outline-warning:hover {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #000;
}

.btn-outline-danger {
    color: #dc3545;
    border-color: #dc3545;
}

.btn-outline-danger:hover {
    background-color: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

/* 移动端按钮文字隐藏 */
@media (max-width: 768px) {
    .action-buttons .btn span {
        display: none;
    }
    
    .action-buttons .btn {
        min-width: 40px;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

/* 分页器优化 */
.pagination .page-link {
    border-radius: 8px;
    margin: 0 3px;
}

@media (max-width: 768px) {
    .pagination .page-link {
        padding: 0.35rem 0.6rem;
        font-size: 0.85rem;
        margin: 0 2px;
    }
}

/* 客户卡片动画 */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: slideInUp 0.3s ease-out;
}

/* 统计信息动画 */
.stat-item {
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* 优化工具栏卡片 */
.card.shadow-sm {
    transition: all 0.3s ease;
}

/* 表单卡片间距 */
.form-card {
    margin-bottom: 1rem;
}

/* 输入框焦点效果 */
.form-control:focus,
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
}

/* 徽章动画 */
.badge {
    transition: transform 0.2s ease;
}

.badge:hover {
    transform: scale(1.05);
}

/* 空状态图标动画 */
.empty-state i {
    animation: fadeIn 1s ease-in-out;
}

/* 响应式字体大小 */
@media (max-width: 576px) {
    .page-header h4 {
        font-size: 1.25rem;
    }
    
    .customer-name {
        font-size: 1rem;
    }
    
    .stat-item {
        font-size: 0.85rem;
    }
}

/* ========== 统一UI组件样式规范 ========== */

/* 1. TAB切换统一样式 */
.nav-pills {
    background: transparent;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 0.5rem;
}

.nav-pills .nav-link {
    color: #495057;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem 0.5rem 0 0;
    transition: all 0.3s ease;
    font-weight: 500;
    margin-right: 0.25rem;
    border: none;
    background: transparent;
}

.nav-pills .nav-link i {
    margin-right: 0.5rem;
    font-size: 1rem;
}

.nav-pills .nav-link:hover {
    background-color: #f8f9fa;
    color: #0d6efd;
}

.nav-pills .nav-link.active {
    background-color: #0d6efd;
    color: white;
    font-weight: 600;
}

.nav-pills .nav-link.active:hover {
    background-color: #0b5ed7;
    color: white;
}

/* TAB容器样式 */
.tab-nav-wrapper {
    background: white;
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.tab-content {
    margin-top: 1rem;
}

/* 2. 表单标签统一样式 */
.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.75rem;
    display: block;
    font-size: 0.95rem;
    letter-spacing: 0.2px;
}

.form-label i {
    font-size: 1.05rem;
    margin-right: 0.5rem;
    vertical-align: middle;
    color: #0d6efd;
}

.form-label .text-danger {
    font-size: 0.9rem;
    margin-left: 0.25rem;
    font-weight: 600;
}

.form-label.small {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* 3. 表单输入框统一样式 */
.form-control,
.form-select {
    border-radius: 0.5rem;
    border: 1px solid #ced4da;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background-color: #fff;
    color: #495057;
}

.form-control:focus,
.form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
    outline: none;
    background-color: #fff;
}

.form-control:hover:not(:focus),
.form-select:hover:not(:focus) {
    border-color: #adb5bd;
}

.form-control-sm,
.form-select-sm {
    font-size: 0.875rem;
    border-radius: 0.375rem;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* 4. 下拉选择框统一样式 */
.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    padding-right: 2.5rem;
    /* 修复下拉菜单双箭头问题 - 隐藏浏览器默认箭头 */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
}
/* 隐藏IE和其他浏览器的默认箭头 */
.form-select::-ms-expand {
    display: none;
}

/* 5. 复选框统一样式 */
.form-check {
    margin-bottom: 0.75rem;
    padding-left: 1.75rem;
}

.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.125rem;
    margin-left: -1.75rem;
    border: 2px solid #ced4da;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-check-label {
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    margin-left: 0.5rem;
}

.form-check-label i {
    margin-right: 0.5rem;
    color: #6c757d;
}

/* 复选框列表 */
.checkbox-list,
.user-checkbox-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
    margin-top: 0.5rem;
}

.checkbox-list .form-check,
.user-checkbox-list .form-check {
    margin-bottom: 0;
    flex: 0 0 auto;
    min-width: 150px;
}

/* Switch开关样式 */
.form-switch .form-check-input {
    width: 2.5rem;
    height: 1.25rem;
    border-radius: 1.25rem;
    background-color: #ced4da;
    border: none;
}

.form-switch .form-check-input:checked {
    background-color: #0d6efd;
}

/* 6. 页面标题统一样式 */
.page-header {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    padding: 1.5rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e9ecef;
}

.page-header h4 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 0.5rem;
}

.page-header h4 i {
    margin-right: 0.75rem;
    font-size: 1.5rem;
    vertical-align: middle;
}

.page-header p {
    font-size: 0.95rem;
    color: #6c757d;
    margin-bottom: 0;
}

/* 卡片标题 */
.card-header h5,
.card-header h6 {
    font-weight: 600;
    color: #212529;
    margin-bottom: 0;
}

.card-header h5 i,
.card-header h6 i {
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

/* 7. 说明文字统一样式 */
.form-text,
small.form-text {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.5rem;
    display: block;
    line-height: 1.5;
}

.form-text.text-muted {
    color: #6c757d;
}

.form-text.text-danger {
    color: #dc3545;
    font-weight: 500;
}

.form-text.text-success {
    color: #198754;
}

/* 8. 表单分组样式 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .nav-pills .nav-link {
        padding: 0.625rem 1rem;
        font-size: 0.9rem;
    }
    
    .page-header {
        padding: 1rem;
        border-radius: 0.5rem;
    }
    
    .page-header h4 {
        font-size: 1.25rem;
    }
    
    .form-label {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    .form-control,
    .form-select {
        padding: 0.625rem 0.875rem;
        font-size: 0.9rem;
    }
    
    .checkbox-list,
    .user-checkbox-list {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .checkbox-list .form-check,
    .user-checkbox-list .form-check {
        min-width: auto;
        width: 100%;
    }
}

/* 客户搜索选择器 */
.customer-picker-wrapper {
    position: relative;
}

.customer-picker-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    min-height: 48px;
    max-height: 260px;
    overflow-y: auto;
    z-index: 1100;
    padding: 4px 0;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
    transition: opacity 0.15s ease;
}

.customer-picker-item {
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    padding: 0.6rem 0.85rem;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #212529;
    display: block;
}

.customer-picker-item + .customer-picker-item {
    margin-top: 2px;
}

.customer-picker-item:hover,
.customer-picker-item:focus {
    background: rgba(13, 110, 253, 0.08);
    outline: none;
}

.customer-picker-message {
    padding: 12px 16px;
    font-size: 0.9rem;
    color: #6b7280;
    min-height: 40px;
    display: flex;
    align-items: center;
}

.customer-picker-message::before {
    content: '';
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #f59e0b;
    margin-right: 10px;
    border-top-color: transparent;
}

.customer-picker-dropdown[data-state="loading"] .customer-picker-message::before {
    border-color: #0d6efd;
    border-top-color: transparent;
    animation: customer-picker-spin 1s linear infinite;
}

.customer-picker-dropdown[data-state="empty"] .customer-picker-message {
    color: #94a3b8;
}

.customer-picker-dropdown[data-state="error"] .customer-picker-message {
    color: #dc3545;
}

.customer-picker-dropdown[data-state="hint"] .customer-picker-message {
    color: #64748b;
}

@keyframes customer-picker-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.customer-picker-input {
    background-color: #fff;
}

