/* ========================================
   客户信息管理系统 - 后台样式
   ======================================== */

/* --- 侧边栏 --- */
.sidebar {
    width: 240px;
    min-width: 240px;
    background: #1A1A2E;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
}

.sidebar-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    margin: 2px 0;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.sidebar-menu:hover {
    background: rgba(255, 140, 0, 0.12);
    color: #fff;
}

.sidebar-menu.active {
    background: rgba(255, 140, 0, 0.15);
    color: #FF8C00;
    font-weight: 500;
}

.sidebar-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 8px 14px;
}

/* --- 卡片 --- */
.card {
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body {
    padding: 20px;
}

/* --- 统计卡片 --- */
.stat-card {
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    padding: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1A1A2E;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 13px;
    color: #8c8c8c;
    margin-top: 4px;
}

/* --- 表格 --- */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #8c8c8c;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
}

.data-table td {
    padding: 12px 16px;
    font-size: 14px;
    color: #1A1A2E;
    border-bottom: 1px solid #f5f5f5;
}

.data-table tbody tr:hover {
    background: rgba(255, 140, 0, 0.06);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* --- 按钮 --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary {
    background: #FF8C00;
    color: #fff;
}

.btn-primary:hover {
    background: #e67e00;
    box-shadow: 0 2px 8px rgba(255, 140, 0, 0.3);
}

.btn-secondary {
    background: #f5f5f5;
    color: #1A1A2E;
    border: 1px solid #e8e8e8;
}

.btn-secondary:hover {
    background: #e8e8e8;
}

.btn-danger {
    background: #fff2f0;
    color: #ff4d4f;
    border: 1px solid #ffccc7;
}

.btn-danger:hover {
    background: #ff4d4f;
    color: #fff;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

.btn-xs {
    padding: 3px 8px;
    font-size: 11px;
    border-radius: 6px;
}

/* --- 状态开关按钮（弹跳动画） --- */
.toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.toggle-btn.on {
    background: rgba(255, 140, 0, 0.12);
    color: #FF8C00;
}

.toggle-btn.off {
    background: #f0f0f0;
    color: #999;
}

.toggle-btn:active {
    transform: scale(0.9);
}

.toggle-btn .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.toggle-btn.on .dot {
    background: #FF8C00;
    box-shadow: 0 0 4px rgba(255, 140, 0, 0.5);
}

.toggle-btn.off .dot {
    background: #bbb;
}

/* --- 标签 --- */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    background: #f5f5f5;
    color: #666;
}

.tag-orange {
    background: rgba(255, 140, 0, 0.1);
    color: #FF8C00;
}

.tag-blue {
    background: #e6f7ff;
    color: #1890ff;
}

.tag-green {
    background: #f6ffed;
    color: #52c41a;
}

/* --- Toast --- */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 14px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 400px;
}

.toast-success {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #52c41a;
}

.toast-error {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    color: #ff4d4f;
}

/* --- 分页 --- */
.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 20px;
}

.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border-radius: 8px;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.pagination a {
    color: #1A1A2E;
    background: #fff;
    border: 1px solid #e8e8e8;
}

.pagination a:hover {
    border-color: #FF8C00;
    color: #FF8C00;
}

.pagination .active {
    background: #FF8C00;
    color: #fff;
    border-color: #FF8C00;
}

.pagination .disabled {
    color: #ccc;
    background: #fafafa;
    border-color: #f0f0f0;
    cursor: not-allowed;
}

/* --- 输入框 --- */
.form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
    border-color: #FF8C00;
    box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.08);
}

.form-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.form-select:focus {
    border-color: #FF8C00;
    box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.08);
}

/* --- 上传区域 --- */
.upload-zone {
    border: 2px dashed #e8e8e8;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: #FF8C00;
    background: rgba(255, 140, 0, 0.04);
}

.upload-zone .upload-icon {
    font-size: 48px;
    color: #FF8C00;
    margin-bottom: 12px;
}

/* --- 选项卡 --- */
.tab-nav {
    display: flex;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 20px;
}

.tab-item {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #8c8c8c;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
}

.tab-item:hover {
    color: #FF8C00;
}

.tab-item.active {
    color: #FF8C00;
    border-bottom-color: #FF8C00;
}

/* --- 折叠面板 --- */
.collapse-panel {
    border: 1px solid #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
}

.collapse-header {
    padding: 12px 16px;
    background: #fafafa;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.collapse-header:hover {
    background: #f0f0f0;
}

.collapse-body {
    padding: 16px;
    border-top: 1px solid #f0f0f0;
}

/* --- 空状态 --- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #bbb;
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* --- 徽章 --- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.badge-success {
    background: #f6ffed;
    color: #52c41a;
}

.badge-error {
    background: #fff2f0;
    color: #ff4d4f;
}

.badge-warning {
    background: #fffbe6;
    color: #faad14;
}

.badge-info {
    background: #e6f7ff;
    color: #1890ff;
}

/* --- 进度条 --- */
.progress-bar {
    width: 100%;
    height: 6px;
    background: #f0f0f0;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar .progress-fill {
    height: 100%;
    border-radius: 3px;
    background: #FF8C00;
    transition: width 0.5s ease;
}

/* --- 辅助类 --- */
.text-orange {
    color: #FF8C00;
}

.bg-orange {
    background: #FF8C00;
}

.bg-orange-light {
    background: rgba(255, 140, 0, 0.08);
}

.hover-bg-orange:hover {
    background: rgba(255, 140, 0, 0.06);
}

/* --- 滚动条 --- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

/* --- 响应式表格容器 --- */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
