/* ===== 铁航专列管理系统 - 自定义样式 ===== */

:root {
    --sidebar-width: 210px;
    --sidebar-bg: #1e293b;
    --primary: #0d6efd;
}

/* 侧边栏 */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar-bg);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-header {
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-header h5 {
    font-size: 15px;
}
.sidebar-header small {
    font-size: 11px;
}

.sidebar .nav-link {
    color: #cbd5e1;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 2px;
    transition: all 0.15s;
    font-size: 14px;
}

.sidebar .nav-link:hover {
    background: #334155;
    color: #fff;
}

.sidebar .nav-link.active {
    background: var(--primary);
    color: #fff;
}

.sidebar .nav-link i {
    margin-right: 8px;
}

/* 侧边栏分组 */
.sidebar-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 8px 4px;
    list-style: none;
}
.sidebar-group-heading {
    padding: 8px 14px 4px 14px;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    list-style: none;
}

/* 主内容区 */
.main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    max-width: none;
    padding: 24px 32px;
    min-height: 100vh;
    background: #f8fafc;
}

/* 统计卡片 */
.stat-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: box-shadow 0.2s;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.stat-card .card-body {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-icon.blue { background: #eff6ff; color: #3b82f6; }
.stat-icon.green { background: #ecfdf5; color: #10b981; }
.stat-icon.orange { background: #fffbeb; color: #f59e0b; }
.stat-icon.purple { background: #eef2ff; color: #4f46e5; }
.stat-icon.red { background: #fef2f2; color: #ef4444; }

.stat-value {
    font-size: 26px;
    font-weight: 700;
    color: #1e293b;
}

.stat-label {
    font-size: 13px;
    color: #64748b;
}

/* 卡片 */
.card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 16px 20px;
    font-weight: 600;
}

/* 表格 */
.table th {
    background: #f8fafc;
    font-weight: 600;
    font-size: 13px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
}

.table td {
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background: #f8fafc;
}

/* 订单详情页 - 左右全屏布局 */
.detail-two-col {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}
.detail-left {
    flex: 1 1 65%;
    min-width: 0;
}
.detail-right {
    flex: 0 0 35%;
    min-width: 360px;
}

/* 订单基本信息行 - 紧凑胶囊式 */
.order-info-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 6px;
}
.order-info-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 13px;
}
.order-info-pill .pill-label {
    color: #94a3b8;
    white-space: nowrap;
}
.order-info-pill .pill-value {
    color: #1e293b;
    font-weight: 600;
}

/* 旅客列表项 - 紧凑行设计 */
.pax-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}
.pax-list-item:last-child { border-bottom: none; }
.pax-seq {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
}
.pax-seq.elder { background: #fef3c7; color: #d97706; }
.pax-seq.child { background: #dcfce7; color: #16a34a; }
.pax-seq.very-elder { background: #fee2e2; color: #dc2626; }
.pax-main {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}
.pax-name {
    font-weight: 600;
    font-size: 15px;
    color: #1e293b;
    white-space: nowrap;
}
.pax-idcard {
    font-size: 12px;
    color: #6c757d;
    background: #f8f9fa;
    padding: 1px 6px;
    border-radius: 4px;
}
.pax-phone {
    font-size: 12px;
    color: #6c757d;
}
.pax-badges {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
    flex-shrink: 0;
    width: 80px;
}
.pax-berth {
    width: 50px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pax-health-files {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
    font-size: 12px;
    width: 150px;
    justify-content: flex-end;
}
.pax-health-files .text-muted {
    font-size: 11px;
}
.pax-detail-row {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #e2e8f0;
    font-size: 12px;
    color: #64748b;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.pax-detail-row .d-label {
    color: #94a3b8;
}

/* 价格摘要条 */
.price-summary-bar {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.price-item {
    background: #f8fafc;
    border-radius: 8px;
    padding: 10px 14px;
    min-width: 100px;
    flex: 1;
}
.price-item .pi-label {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 2px;
}
.price-item .pi-value {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}
.price-item .pi-hint {
    font-size: 11px;
    margin-top: 2px;
}

/* 价格摘要条颜色变体 */
.price-item-gray { background: #f1f5f9; }
.price-item-amber { background: #fffbeb; border: 1px solid #fde68a; }
.price-item-info { background: #eff6ff; border: 1px solid #bfdbfe; }

/* 信息卡片行 - 保险/合同/销售人员 */
.info-card-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.info-card-item {
    background: #f8fafc;
    border-radius: 8px;
    padding: 10px 14px;
    min-width: 100px;
    flex: 1;
    min-height: 70px;
}
.info-card-item .ic-label {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.info-card-item .ic-label span {
    display: inline-flex;
    align-items: center;
}
.info-card-item .ic-label-extra {
    font-size: 11px;
}
.info-card-item .ic-content {
    font-size: 13px;
}
.info-card-item .ic-text {
    font-size: 13px;
    line-height: 1.4;
}
.info-card-item .ic-muted {
    color: #94a3b8;
    font-size: 13px;
}
.info-card-item .ic-amount {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}
.info-card-item .ic-link {
    display: inline-block;
    font-size: 12px;
    color: #3b82f6;
    text-decoration: none;
}
.info-card-item .ic-link:hover {
    text-decoration: underline;
    color: #2563eb;
}
.info-card-item .ic-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.btn-change-mini {
    padding: 0 4px !important;
    font-size: 10px !important;
    line-height: 1.2 !important;
    border-radius: 4px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 18px;
}

/* 紧凑卡片 */
.card-compact .card-header {
    padding: 12px 16px;
    font-weight: 600;
    font-size: 14px;
}
.card-compact .card-body {
    padding: 12px 16px;
}

/* 席位展示 */
.seat-status-display {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
}
.seat-icon-box {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
}
.seat-icon-box.confirmed {
    background: #dcfce7;
    color: #16a34a;
}
.seat-icon-box.pending {
    background: #fef3c7;
    color: #d97706;
}

@media (max-width: 992px) {
    .detail-two-col {
        flex-direction: column;
    }
    .detail-left, .detail-right {
        flex: 1 1 100%;
        min-width: 0;
    }
}

@media (max-width: 768px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
    .pax-list-item {
        flex-wrap: wrap;
    }
}

/* 开关样式增强 */
.form-switch-lg {
    padding-left: 3em;
}

.form-switch-lg .form-check-input {
    width: 3em;
    height: 1.5em;
    margin-left: -3em;
}

/* 出行状态标签 - 出行中（橙色） */
.badge-trip-ing { background: #fd7e14; color: #fff; }

/* ===== 统一金融数据颜色方案 ===== */
/* 利润：绿色 */
.profit-positive {
    color: #198754;
    font-weight: 700;
}
.profit-negative {
    color: #ef4444;
    font-weight: 700;
}

/* 成本（售价−返利/应付供应商）：橙红色 */
.cost-text {
    color: #f97316;
    font-weight: 600;
}
.cost-bg {
    background: #fff7ed;
}

/* 收入（客户付款/收款）：蓝色 */
.income-text {
    color: #2563eb;
    font-weight: 600;
}
.income-bg {
    background: #eff6ff;
}

/* 支出（供应商付款）：红色 */
.expense-text {
    color: #dc2626;
    font-weight: 600;
}
.expense-bg {
    background: #fef2f2;
}

/* 返利（利润来源）：绿色 */
.rebate-text {
    color: #059669;
    font-weight: 600;
}

/* 优惠/折扣（利润扣减）：红色 */
.discount-text {
    color: #ef4444;
}

/* 现金流：正=绿色，负=红色 */
.cashflow-positive {
    color: #16a34a;
}
.cashflow-negative {
    color: #dc2626;
}

/* 增长/下降/持平指示 */
.trend-up {
    color: #16a34a;
}
.trend-down {
    color: #dc2626;
}
.trend-flat {
    color: #1e293b;
}

/* 状态徽章 */
.badge-lg {
    font-size: 0.85rem;
    padding: 6px 12px;
}

/* 门户产品卡片 */
.product-card {
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.product-card .card-body {
    display: flex;
    flex-direction: column;
}

.product-card .price {
    font-size: 24px;
    font-weight: 700;
    color: #ef4444;
}

/* 门户订单卡片 */
.order-card {
    border-radius: 12px;
    overflow: hidden;
}

.order-card .card-body {
    padding: 20px;
}

.order-card .product-title {
    font-size: 18px;
    font-weight: 700;
}

/* 打印/PDF优化 */
@media print {
    .sidebar, .btn, .no-print {
        display: none !important;
    }
    .main-content {
        margin-left: 0;
    }
}

/* 弹窗关闭按钮定位到右上角 */
.modal-header {
    position: relative;
}
.modal-header .btn-close {
    position: absolute;
    top: 12px;
    right: 12px;
    margin: 0;
    z-index: 1;
}

/* 数据大屏全屏状态 */
body.db-fullscreen .sidebar { display: none !important; }
body.db-fullscreen .main-content { 
    margin-left: 0 !important; 
    width: 100% !important;
}

/* 响应式 */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

/* 保险记录卡片 */
.insurance-row {
    background: #f8fafc;
    border-color: #e2e8f0 !important;
    transition: border-color 0.15s;
}
.insurance-row:hover {
    border-color: #0d6efd !important;
}

/* 单据文件项 */
.doc-file-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.15s;
}
.doc-file-item:hover {
    border-color: #94a3b8;
}

/* 合同生成区域 */
.generate-contract-box {
    background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
    border: 2px dashed #93c5fd;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
}

/* 文档类型标题 */
.doc-type-header {
    padding: 6px 0;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 10px;
}

/* 文件上传预览区 */
.upload-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.upload-dropzone:hover {
    border-color: #0d6efd;
    background: #eff6ff;
}
