/* 钢筋供应链工作台 - 自定义样式 */

:root {
    --sidebar-width: 240px;
    --primary-dark: #1a3a5c;
    --accent: #2563eb;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
}

/* 导航栏 */
.navbar-brand {
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* 侧边栏 */
.sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: #fff;
    border-right: 1px solid #e5e7eb;
    padding: 1rem 0;
    z-index: 100;
    overflow-y: auto;
}

.sidebar .nav-link {
    color: #4b5563;
    padding: 0.65rem 1.5rem;
    font-size: 0.95rem;
    border-left: 3px solid transparent;
    transition: all 0.15s;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: var(--accent);
    background: #eff6ff;
    border-left-color: var(--accent);
}

.sidebar .nav-link i {
    margin-right: 0.5rem;
    width: 20px;
    text-align: center;
}

/* 主内容区 */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 1.5rem;
    min-height: calc(100vh - 56px);
}

/* 卡片 */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s;
}

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

.card-header {
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    font-weight: 600;
}

/* 概览统计卡片 */
.stat-card {
    text-align: center;
    padding: 1.5rem;
    border-radius: 10px;
    color: #fff;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-top: 0.25rem;
}

.bg-card-blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.bg-card-green { background: linear-gradient(135deg, #10b981, #059669); }
.bg-card-orange { background: linear-gradient(135deg, #f59e0b, #d97706); }
.bg-card-purple { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }

/* 状态徽章 */
.badge-status-executing { background: #10b981; }
.badge-status-paused { background: #f59e0b; }
.badge-status-completed { background: #6b7280; }

/* 项目卡片 */
.project-card {
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.1);
}

/* 价格条款高亮 */
.price-clause-highlight {
    background: #fffbeb !important;
    border-left: 4px solid #f59e0b !important;
}

/* 表格 */
.table th {
    background: #f9fafb;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
}

.table td {
    vertical-align: middle;
}

/* Tab页 */
.nav-tabs .nav-link {
    color: #6b7280;
    border: none;
    padding: 0.75rem 1.25rem;
}

.nav-tabs .nav-link.active {
    color: var(--accent);
    border-bottom: 2px solid var(--accent);
    font-weight: 600;
}

/* 进度条 */
.progress {
    height: 10px;
    border-radius: 5px;
}

/* 表单 */
.form-label {
    font-weight: 500;
    color: #374151;
    font-size: 0.9rem;
}

/* 打印样式 */
@media print {
    .sidebar, .navbar, .btn, .no-print {
        display: none !important;
    }
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}

/* 响应式 */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        top: 0;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
}

/* 逾期行红色标记 */
tr.overdue-row {
    background: #fef2f2 !important;
}

tr.overdue-row td {
    color: #dc2626;
}

/* 合计行 */
tr.total-row {
    background: #f0fdf4 !important;
    font-weight: 700;
    border-top: 2px solid #10b981;
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 搜索框 */
.search-box {
    position: relative;
}

.search-box .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

.search-box input {
    padding-left: 36px;
}

/* 数据为空 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #9ca3af;
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* 确认弹窗自定义 */
.modal-confirm .modal-header {
    border-bottom: none;
}

.modal-confirm .modal-footer {
    border-top: none;
}

/* 主要联系人行 */
.contact-primary {
    background-color: #e8f4fd !important;
}

/* 走访记录时间线 */
.visit-timeline {
    padding: 1rem;
}

.visit-card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    background: #fff;
}

.visit-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.visit-date {
    font-weight: 600;
    color: #333;
}

.visit-location {
    color: #6c757d;
    font-size: 0.9rem;
}

.visit-card-body {
    font-size: 0.92rem;
    color: #444;
}

.visit-card-body > div {
    margin-bottom: 0.5rem;
}

.visit-participants {
    color: #555;
    font-size: 0.9rem;
}

.visit-issues {
    color: #d9534f;
}

.visit-actions {
    color: #5bc0de;
}

.visit-next {
    color: #5cb85c;
    font-size: 0.9rem;
}

.visit-card-footer {
    margin-top: 0.75rem;
    text-align: right;
    border-top: 1px solid #eee;
    padding-top: 0.5rem;
}

/* 走访类型标签 */
.badge-visit-type {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #fff;
}

.badge-inspection {
    background-color: #5bc0de;
}

.badge-issue {
    background-color: #f0ad4e;
}

.badge-progress {
    background-color: #5cb85c;
}

.badge-collection {
    background-color: #d9534f;
}

.badge-other {
    background-color: #999;
}

/* ==================== 背靠背联营模式增强样式 ==================== */

/* 新增概览卡片配色 */
.bg-card-teal { background: linear-gradient(135deg, #14b8a6, #0d9488); }
.bg-card-pink { background: linear-gradient(135deg, #ec4899, #db2777); }
.bg-card-red { background: linear-gradient(135deg, #ef4444, #dc2626); }

/* 供应商评级标签 */
.badge-rating-A { background: #28a745; }
.badge-rating-B { background: #17a2b8; }
.badge-rating-C { background: #ffc107; color: #333; }

/* 付款状态 */
.badge-payment-paid { background: #28a745; }
.badge-payment-pending { background: #ffc107; color: #333; }
.badge-payment-submitted { background: #17a2b8; }
.badge-payment-delayed { background: #dc3545; }

/* 核对差异行 */
.settlement-diff { background: #fff3cd !important; }
.settlement-matched { background: #d4edda !important; }

/* 预付额度预警 */
.prepay-warning { color: #dc3545; font-weight: bold; }

/* 供应商详情页区块 */
.supplier-detail-card { margin-bottom: 20px; }
.supplier-stat-item { text-align: center; padding: 15px; }
.supplier-stat-value { font-size: 24px; font-weight: bold; }
.supplier-stat-label { font-size: 12px; color: #6c757d; }

/* 表格内链接 */
.table-link { color: #007bff; text-decoration: none; }
.table-link:hover { text-decoration: underline; }

/* 汇总行 */
.summary-row { background: #f8f9fa; font-weight: bold; }

/* 额度进度条 */
.limit-progress { height: 8px; margin-top: 4px; }

/* 付款计划汇总卡片 */
.pp-summary-card { background: #f8f9fa; border-radius: 8px; padding: 16px; }
.pp-summary-value { font-size: 20px; font-weight: bold; }
.pp-summary-label { font-size: 12px; color: #6c757d; }

/* 采购协议汇总行 */
.pa-summary-bar { background: #e8f4fd; border-radius: 6px; padding: 12px 16px; margin-bottom: 12px; }
