/* 报价新增页面样式 */
.quotation-add-page {
    min-height: calc(100vh - 200px);
}

/* 子报价栏：位于报价主体上方，圆角矩形标签（宽窄屏与主内容对齐） */
.quotation-sheet-bar-wrap {
    position: relative;
    z-index: 1035;
    width: 100%;
    margin-bottom: 12px;
    padding: 0;
}

.quotation-add-page.narrow-mode .quotation-sheet-bar-wrap {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.quotation-add-page.wide-mode .quotation-sheet-bar-wrap {
    max-width: 100%;
}

.quotation-sheet-bar {
    display: flex;
    align-items: center;
    min-height: 44px;
    background-color: var(--brand, #0d1f44);
    border: 1px solid var(--brand-2, #123366);
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(13, 31, 68, 0.25);
    padding: 6px 8px;
    gap: 6px;
    user-select: none;
    width: 100%;
}

.quotation-sheet-bar .sheet-bar-group {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-shrink: 0;
    padding: 4px 10px;
    margin-right: 2px;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 100px;
    max-width: 150px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.08);
}

.quotation-sheet-bar .sheet-bar-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.1;
}

.quotation-sheet-bar .sheet-group-no {
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quotation-sheet-bar .sheet-scroll-btn {
    flex-shrink: 0;
    width: 26px;
    height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
}

.quotation-sheet-bar .sheet-scroll-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.55);
    color: #fff;
}

.quotation-sheet-bar .sheet-tabs-scroller {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
    align-items: center;
    scrollbar-width: none;
}

.quotation-sheet-bar .sheet-tabs-scroller::-webkit-scrollbar {
    display: none;
}

.quotation-sheet-bar .sheet-tabs {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 2px 4px;
    gap: 6px;
    flex-wrap: nowrap;
}

.quotation-sheet-bar .sheet-tab {
    flex-shrink: 0;
    margin: 0;
    padding: 0;
}

.quotation-sheet-bar .sheet-tab-inner {
    display: flex;
    align-items: center;
    position: relative;
    gap: 2px;
}

.quotation-sheet-bar .sheet-tab-btn {
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.92);
    font-size: 12px;
    line-height: 1.3;
    padding: 5px 14px;
    cursor: pointer;
    white-space: nowrap;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.quotation-sheet-bar .sheet-tab-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

.quotation-sheet-bar .sheet-tab.active .sheet-tab-btn {
    background: #fff;
    color: var(--brand, #0d1f44);
    font-weight: 700;
    border-color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.quotation-sheet-bar .sheet-tab-btn .sheet-tab-status {
    font-size: 10px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.65);
    margin-left: 4px;
}

.quotation-sheet-bar .sheet-tab.active .sheet-tab-btn .sheet-tab-status {
    color: #6c757d;
    font-weight: 500;
}

.quotation-sheet-bar .sheet-tab-close {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 5px;
    background: transparent;
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.12s ease, background 0.12s ease, color 0.12s ease;
}

.quotation-sheet-bar .sheet-tab:hover .sheet-tab-close,
.quotation-sheet-bar .sheet-tab.active .sheet-tab-close {
    opacity: 1;
}

.quotation-sheet-bar .sheet-tab.active .sheet-tab-close {
    color: #6c757d;
}

.quotation-sheet-bar .sheet-tab-close:hover {
    background: rgba(220, 53, 69, 0.35);
    color: #ffb3bc;
}

.quotation-sheet-bar .sheet-tab.active .sheet-tab-close:hover {
    background: rgba(220, 53, 69, 0.15);
    color: #c82333;
}

.quotation-sheet-bar .sheet-add-btn {
    flex-shrink: 0;
    width: 30px;
    height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 20px;
    font-weight: 300;
    line-height: 1;
    color: rgba(255, 255, 255, 0.92);
    cursor: pointer;
    padding: 0;
}

.quotation-sheet-bar .sheet-add-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.55);
}

.quotation-sheet-bar .sheet-more-menu {
    flex-shrink: 0;
    position: static;
}

/* 高于右侧工序明细 sticky（1020），低于顶部导航（1050） */
.quotation-sheet-bar .sheet-more-menu .dropdown-menu {
    z-index: 1045;
    font-size: 0.8125rem;
    min-width: 9.5rem;
}

.quotation-sheet-bar .sheet-more-menu .dropdown-item {
    font-size: 0.8125rem;
    padding: 0.35rem 0.75rem;
}

.quotation-sheet-bar .sheet-more-btn {
    width: 30px;
    height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 14px;
    color: rgba(255, 255, 255, 0.92);
    cursor: pointer;
    padding: 0;
}

.quotation-sheet-bar .sheet-more-btn::after {
    display: none;
}

.quotation-sheet-bar .sheet-more-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.55);
    color: #fff;
}

.quotation-sheet-bar .sheet-tabs-empty {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
    padding: 6px 12px;
    white-space: nowrap;
    border: 1px dashed rgba(255, 255, 255, 0.35);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.08);
}

/* 工序明细：成本眼睛图标（米黄色） */
.quotation-price-area .btn-quotation-cost-eye {
    color: #e8d4a8 !important;
    text-decoration: none;
}
.quotation-price-area .btn-quotation-cost-eye:hover,
.quotation-price-area .btn-quotation-cost-eye:focus {
    color: #f5e6c8 !important;
}
.quotation-price-area .price-cost-unit-cell {
    font-size: 0.8125rem;
    font-weight: 500;
    vertical-align: middle;
}
.quotation-price-area .price-foot-cost-cell {
    line-height: 1.25;
}
.quotation-price-area .price-foot-cost-cell .price-cost-unit-cell {
    margin-top: 0.125rem;
}

/* 客户报价列：可手填 */
.quotation-price-area .price-custom-quote-input,
.quotation-price-area .price-custom-profit-input {
    width: 76px;
    min-width: 64px;
    max-width: 100%;
    padding: 0.15rem 0.35rem;
    font-size: 0.8125rem;
    display: inline-block;
}

.quotation-price-area .price-foot-custom-cell {
    line-height: 1.25;
    vertical-align: middle;
}

.quotation-price-area .custom-quote-profit-row {
    font-size: 0.8125rem;
}

.quotation-price-area .custom-quote-profit-row .price-custom-profit-input {
    width: 76px;
}

/* 宽窄屏切换样式 */
.quotation-add-page.narrow-mode #quotation-container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 992px) {
    .quotation-add-page.narrow-mode #quotation-container > .col-lg-7 {
        flex: 0 0 calc(58.33333333% - 100px);
        max-width: calc(58.33333333% - 100px);
    }
    .quotation-add-page.narrow-mode #quotation-container > .col-lg-3 {
        flex: 0 0 calc(25% + 100px);
        max-width: calc(25% + 100px);
    }
}

.quotation-add-page.wide-mode #quotation-container {
    max-width: 100%;
}

/* 配置模块样式 */
.config-module {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.config-module:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.config-module-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #dee2e6;
    transition: background 0.2s ease;
}

.config-module-header:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

.config-module-header[aria-expanded="true"] .collapse-icon {
    transform: rotate(180deg);
}

.collapse-icon {
    transition: transform 0.3s ease;
    color: #6c757d;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: 2px solid #6c757d;
    background: transparent;
    color: #6c757d;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 500;
    margin-right: 2px;
}

/* 工序标题字号调小 */
.config-module-header h6 {
    font-size: 0.9rem;
    font-weight: 500;
}

/* 已配置完成的工序 - 使用绿色打勾圆圈 */
.step-number.completed {
    border-color: #28a745;
    background: #28a745;
    color: #fff;
}

.step-number.completed::after {
    content: '✓';
    font-size: 0.9rem;
    font-weight: bold;
}

/* 部分配置的工序 - 使用黄色圆圈 */
.step-number.partial {
    border-color: #ffc107;
    background: #ffc107;
    color: #fff;
}

.config-module-body {
    padding: 20px;
    background: #fff;
}

/* 价格显示区样式 */
.quotation-price-area {
    position: sticky;
    z-index: 1020;
}

.quotation-price-area .card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.quotation-price-area .card-header {
    border-radius: 8px 8px 0 0;
    padding: 12px 16px;
}

.quotation-price-area .price-name-cell {
    vertical-align: middle;
}
.quotation-price-area .price-row-tip {
    margin-left: 4px;
    cursor: help;
    font-size: 0.875rem;
    vertical-align: -1px;
}
.tooltip.qa-price-row-tip .tooltip-inner {
    white-space: pre-line;
    text-align: left;
    max-width: 280px;
}

/* 工序控制台样式 */
.process-control-panel {
    z-index: 1020 !important;
}

.process-control-panel .card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.process-control-item {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
}

.process-control-item label {
    cursor: pointer;
    font-size: 0.9rem;
    margin-bottom: 0;
    user-select: none;
}

.process-control-item:has(.form-check-input:not(.process-sub-toggle)) {
    align-items: center;
}

.process-control-item .form-check-input:checked {
    background-color: #0D1F44;
    border-color: #0D1F44;
}

.process-control-item .form-check-input:focus {
    border-color: #0D1F44;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 31, 68, 0.25);
}

.process-sub-control-list {
    margin-top: 8px;
    margin-left: 26px;
    width: calc(100% - 26px);
}

.process-main-label {
    font-weight: 500;
    color: #495057;
    display: flex;
    align-items: center;
    flex: 1;
}

.process-checkbox-placeholder {
    width: 18px;
    height: 18px;
    display: inline-block;
    margin-right: 8px;
    flex-shrink: 0;
}

.process-control-item:has(.process-main-label) {
    align-items: flex-start;
    flex-wrap: wrap;
}

.process-control-item:has(.process-main-label) > .process-main-label {
    width: calc(100% - 26px);
    margin-bottom: 0;
}

.process-toggle-icon {
    color: #6c757d;
    cursor: pointer;
}

.process-sub-modules {
    border-left: 3px solid #e9ecef;
    padding-left: 15px;
    margin-left: 10px;
}

.price-item {
    transition: all 0.2s ease;
}

.price-item:hover {
    background: #f8f9fa;
    padding-left: 8px;
    padding-right: 8px;
    margin-left: -8px;
    margin-right: -8px;
    border-radius: 4px;
}

.price-summary table {
    font-size: 0.85rem;
    margin-bottom: 0;
}

.price-summary table thead th {
    background-color: #f8f9fa;
    font-weight: 600;
    padding: 8px;
    border-bottom: 2px solid #dee2e6;
}

.price-summary table thead th:first-child {
    background-color: #fff3cd;
}

.price-summary table thead th:nth-child(2),
.price-summary table thead th:nth-child(3) {
    background-color: #d1ecf1;
}

.price-summary table tbody td {
    padding: 6px 8px;
    vertical-align: middle;
}

.price-summary table tbody td:first-child {
    background-color: #fffbf0;
}

.price-summary table tbody td:nth-child(2),
.price-summary table tbody td:nth-child(3) {
    background-color: #e7f3f5;
}

.price-summary table tbody tr:hover td {
    background-color: #f0f0f0 !important;
}

.price-summary table tfoot th {
    padding: 10px 8px;
    border-top: 2px solid #dee2e6;
    background-color: #f8f9fa;
}

.quotation-info {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 6px;
}

.info-item {
    font-size: 0.9rem;
}

@media (max-width: 991.98px) {
    .quotation-price-area {
        position: relative;
        margin-top: 20px;
    }

    .quotation-price-area.sticky-top {
        position: relative !important;
        top: 0 !important;
    }
}

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

.form-control-sm, .form-select-sm {
    font-size: 0.875rem;
}

.config-module.completed .config-module-header {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
}

.config-module.completed .step-number {
    border-color: #28a745;
    background: #28a745;
    color: #fff;
}

.config-module.completed .step-number::after {
    content: '✓';
    font-size: 0.9rem;
    font-weight: bold;
}

.config-module.partial .step-number {
    border-color: #ffc107;
    background: #ffc107;
    color: #fff;
}

.back-printing-section {
    border-top: 1px solid #dee2e6;
    padding-top: 0.5rem;
    margin-top: 1rem;
}

.multiple-printing-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.multiple-printing-item > * {
    flex-shrink: 0;
}
