/* forwarder-quotation.css */

.fq-container {
    padding: 20px;
    height: 100%;
    overflow-y: auto;
}

/* 뷰 전환 */
.view-panel {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}
.view-panel.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 견적 에디터 레이아웃 */
.editor-body {
    background: var(--bg-primary);
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.edit-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
}
.edit-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.edit-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--text-primary);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.section-header-flex h3 {
    margin-bottom: 0;
}

/* 입력 그리드 */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* 환율 섹션 */
.exchange-rate-box {
    margin-top: 24px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}
.ex-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.ex-header h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1rem;
}
.ex-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.input-with-symbol {
    position: relative;
    display: flex;
    align-items: center;
}
.input-with-symbol span {
    position: absolute;
    left: 12px;
    color: var(--text-secondary);
}
.input-with-symbol input {
    padding-left: 28px;
    width: 100%;
}
.help-text {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-top: 10px;
}

/* 인코텀즈 칩 */
.incoterms-manager {
    display: flex;
    align-items: center;
    gap: 12px;
}
.chip-container {
    display: flex;
    gap: 8px;
}
.incoterm-chip {
    padding: 4px 12px;
    border-radius: 16px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: default;
}
.incoterm-chip.active {
    background: rgba(79, 70, 229, 0.1);
    color: var(--brand-color);
    border: 1px solid var(--brand-color);
}
.incoterm-chip .btn-remove {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}
.incoterm-chip .btn-remove:hover {
    color: var(--danger-color);
}

/* 포워더 탭 */
.forwarder-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.tab-btn {
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.tab-btn:hover {
    background: var(--bg-secondary);
}
.tab-btn.active {
    background: var(--brand-color);
    color: white;
    border-color: var(--brand-color);
}
.tab-btn.add-tab {
    background: transparent;
    border-style: dashed;
}
.tab-btn.add-tab:hover {
    background: var(--bg-secondary);
}

.forwarder-content {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}
.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-tertiary);
}

/* 체크박스 셀 */
.chk-cell {
    text-align: center;
}
.chk-cell input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* 툴팁 */
.tooltip-icon {
    color: var(--text-tertiary);
    cursor: help;
    position: relative;
    margin-left: 6px;
}
.tooltip-text {
    visibility: hidden;
    width: 250px;
    background-color: #333;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -125px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.8rem;
    font-family: var(--font-family);
    font-weight: normal;
    line-height: 1.4;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}
.tooltip-icon:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}
.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

/* 테이블 강제 스타일 (인코텀즈 등) */
.item-table th, .item-table td,
.cost-table th, .cost-table td,
.summary-table th, .summary-table td {
    padding: 10px;
    vertical-align: middle;
}
.item-table input,
.cost-table input {
    width: 100%;
    min-width: 80px;
}
.col-num {
    text-align: right;
}

.highlight-section {
    background: rgba(79, 70, 229, 0.03);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid rgba(79, 70, 229, 0.1);
}

.summary-table {
    width: 100%;
    border-collapse: collapse;
}
.summary-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    text-align: center;
    border: 1px solid var(--border-color);
}
.summary-table td {
    border: 1px solid var(--border-color);
    text-align: right;
}
.summary-table td:first-child {
    text-align: left;
    font-weight: 500;
    background: var(--bg-secondary);
}
.summary-table .total-row td {
    font-weight: 700;
    background: rgba(79, 70, 229, 0.05);
}
.summary-table .grand-total-row td {
    font-weight: 700;
    background: var(--brand-color);
    color: white;
}

.highlight-col {
    background: rgba(79, 70, 229, 0.1) !important;
    font-weight: 700;
}

.bottom-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 40px;
}
.btn-large {
    padding: 12px 24px;
    font-size: 1rem;
}
