/* 가수주 공통 ERP 스타일 */
body.gordr-body {
    font-family: 'Noto Sans KR', sans-serif;
    margin: 0;
    padding: 0;
    background: #e8ecf1;
    min-height: 100vh;
    color: #222;
}

.gordr-header {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.gordr-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
}

.gordr-logo {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 10px;
}

.gordr-logo img {
    height: 44px;
}

.gordr-logo span {
    color: #1a73e8;
    font-size: 18px;
    font-weight: 700;
}

.gordr-nav a {
    color: #1a73e8;
    text-decoration: none;
    margin-left: 20px;
    font-weight: 500;
}

.gordr-page-title {
    background: linear-gradient(90deg, #5a7a9a, #7a9aba);
    color: #fff;
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 600;
}

.gordr-toolbar {
    background: #f5f7fa;
    border-bottom: 1px solid #ccd6e0;
    padding: 10px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.gordr-toolbar label {
    font-size: 13px;
    font-weight: 500;
    margin-right: 4px;
}

.gordr-toolbar input,
.gordr-toolbar select {
    padding: 5px 8px;
    border: 1px solid #b0bec5;
    border-radius: 3px;
    font-size: 13px;
}

.gordr-toolbar .spacer {
    flex: 1;
}

.gordr-btn {
    padding: 6px 14px;
    border: 1px solid #90a4ae;
    border-radius: 3px;
    background: linear-gradient(180deg, #fff, #e8edf2);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

.gordr-btn:hover {
    background: #dfe6ec;
}

.gordr-btn-primary {
    background: linear-gradient(180deg, #4a90d9, #357abd);
    color: #fff;
    border-color: #2d6aa3;
}

.gordr-btn-primary:hover {
    background: #357abd;
}

.gordr-btn-danger {
    background: linear-gradient(180deg, #e57373, #d32f2f);
    color: #fff;
    border-color: #c62828;
}

.gordr-section {
    margin: 12px;
    background: #fff;
    border: 1px solid #b0bec5;
    border-radius: 2px;
}

.gordr-section-title {
    background: linear-gradient(180deg, #eef2f6, #dde4eb);
    border-bottom: 1px solid #b0bec5;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 700;
}

.gordr-detail-meta {
    margin-left: 12px;
    font-weight: 500;
    color: #37474f;
}

.gordr-detail-table-area {
    position: relative;
}

.gordr-detail-table-toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 6px 10px;
    border-bottom: 1px solid #cfd8dc;
    background: #f5f7fa;
}

.gordr-table-wrap {
    overflow: auto;
    max-height: 320px;
}

.gordr-master-wrap {
    max-height: 280px;
}

.gordr-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-top: 1px solid #cfd8dc;
    background: #f5f7fa;
    font-size: 13px;
}

.gordr-pagination-info {
    color: #455a64;
    font-weight: 500;
}

.gordr-pagination-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.gordr-pagination-controls label {
    margin-left: 8px;
    font-weight: 500;
}

.gordr-pagination-controls select {
    padding: 4px 6px;
    border: 1px solid #b0bec5;
    border-radius: 3px;
    font-size: 13px;
}

.gordr-pagination-page {
    min-width: 72px;
    text-align: center;
    font-weight: 600;
    color: #37474f;
}

.gordr-pagination .gordr-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.gordr-master-table {
    min-width: 1400px;
}

.gordr-master-table th.col-appr,
.gordr-master-table td.appr-wait {
    color: #c62828;
    font-weight: 700;
}

.gordr-master-table .col-check {
    width: 28px;
    text-align: center;
    padding: 2px;
}

.gordr-master-table .col-check input {
    cursor: pointer;
}

/* 목록 — 전표거래내역: 지정 컬럼 중앙정렬 (고객명 제외) */
.gordr-master-table thead th:nth-child(8),
.gordr-master-table tbody td:nth-child(8) {
    text-align: left;
}

.gordr-master-table thead th:nth-child(n+3):nth-child(-n+7),
.gordr-master-table thead th:nth-child(n+9):nth-child(-n+14),
.gordr-master-table tbody td:nth-child(n+3):nth-child(-n+7),
.gordr-master-table tbody td:nth-child(n+9):nth-child(-n+14),
.gordr-master-table tfoot td#sumQty {
    text-align: center;
}

.gordr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.gordr-table th,
.gordr-table td {
    border: 1px solid #cfd8dc;
    padding: 5px 8px;
    white-space: nowrap;
}

.gordr-table th {
    background: #eceff1;
    font-weight: 600;
    text-align: center;
    position: sticky;
    top: 0;
}

.gordr-table tbody tr {
    cursor: pointer;
}

.gordr-table tbody tr:hover {
    background: #e3f2fd;
}

.gordr-table tbody tr.selected {
    background: #bbdefb;
    font-weight: 600;
}

.gordr-table tfoot td {
    background: #fff9c4;
    font-weight: 700;
    text-align: right;
}

.gordr-table .num {
    text-align: right;
}

.gordr-edit-layout {
    display: flex;
    gap: 12px;
    padding: 12px;
    align-items: flex-start;
}

.gordr-edit-main {
    flex: 1;
    min-width: 0;
}

.gordr-edit-fax {
    width: 340px;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #b0bec5;
}

.gordr-edit-fax .fax-preview {
    min-height: 420px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background: #fafafa;
    padding: 10px;
    overflow: auto;
}

.gordr-edit-fax .fax-preview img,
.gordr-edit-fax .fax-preview .fax-preview-img {
    align-self: center;
    max-width: 100%;
    max-height: 280px;
    cursor: zoom-in;
    border: 1px solid #ddd;
}

.gordr-edit-fax .fax-preview img:hover,
.gordr-edit-fax .fax-preview .fax-preview-img:hover {
    border-color: #1976d2;
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.25);
}

.gordr-edit-fax .fax-filename {
    font-size: 12px;
    margin-top: 8px;
    text-align: center;
    color: #546e7a;
}

.gordr-edit-fax .fax-ocr-error {
    margin-top: 10px;
    border: 1px solid #ef9a9a;
    background: #ffebee;
    border-radius: 4px;
    padding: 8px;
}

.gordr-edit-fax .fax-ocr-error-title {
    font-size: 12px;
    font-weight: 700;
    color: #c62828;
    margin-bottom: 6px;
}

.gordr-edit-fax .fax-error-text {
    margin: 0;
    font-size: 11px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 200px;
    overflow: auto;
    color: #37474f;
}

.gordr-form-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 12px;
}

.gordr-form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 3px;
}

.gordr-form-group input,
.gordr-form-group select,
.gordr-form-group textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 5px 8px;
    border: 1px solid #b0bec5;
    border-radius: 3px;
    font-size: 13px;
}

.gordr-form-group input[type="date"] {
    min-height: 30px;
}

.gordr-form-group input.readonly,
.gordr-form-group input:read-only {
    background: #f5f5f5;
    color: #666;
    cursor: default;
}

.gordr-form-group.full {
    grid-column: 1 / -1;
}

.detail-table input[type="date"] {
    min-width: 120px;
    min-height: 28px;
}

.detail-table input,
.detail-table select {
    width: 100%;
    min-width: 52px;
    box-sizing: border-box;
    padding: 3px 5px;
    border: 1px solid #ccc;
    font-size: 12px;
}

.detail-table input.readonly {
    background: #f5f5f5;
    color: #666;
}

.detail-table td.spec-col-inactive input,
.detail-table input.spec-inactive {
    display: none;
}

.detail-table .spec-inputs {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
}

.detail-table .spec-inputs input.spec-input {
    flex: 1 1 0;
    min-width: 48px;
}

.detail-table .spec-sep {
    color: #888;
    flex: 0 0 auto;
    user-select: none;
}

.detail-table .spec-sep[hidden] {
    display: none;
}

.detail-table td.spec-cell {
    min-width: 140px;
}

.gordr-detail-table td.spec-cell {
    min-width: 120px;
}

.gordr-detail-table td.spec-cell.num {
    text-align: right;
}

.detail-table input.gordr-item-picker {
    background: #fffde7;
    color: #333;
    cursor: pointer;
}

.detail-table input.gordr-item-picker:hover {
    background: #fff9c4;
}

.detail-table input.gordr-color-picker {
    background: #fffde7;
    color: #333;
    cursor: pointer;
}

.detail-table input.gordr-color-picker:hover {
    background: #fff9c4;
}

.detail-table input.gordr-glass-picker {
    background: #fffde7;
    color: #333;
    cursor: pointer;
}

.detail-table input.gordr-glass-picker:hover {
    background: #fff9c4;
}

.gordr-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gordr-modal[hidden] {
    display: none;
}

.gordr-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.gordr-modal-dialog {
    position: relative;
    width: min(920px, 94vw);
    max-height: 86vh;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

.gordr-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #cfd8dc;
    font-weight: 700;
    font-size: 15px;
}

.gordr-modal-close {
    border: none;
    background: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #666;
}

.gordr-modal-toolbar {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    border-bottom: 1px solid #eceff1;
}

.gordr-modal-toolbar input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #b0bec5;
    border-radius: 3px;
    font-size: 13px;
}

.gordr-modal-body {
    overflow: auto;
    padding: 0;
    max-height: 60vh;
}

.gordr-modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    padding: 2px 12px 6px;
    border-top: 1px solid #eceff1;
    font-size: 10px;
    color: #d32f2f;
    text-align: right;
}

.gordr-picker-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.gordr-picker-table th,
.gordr-picker-table td {
    border: 1px solid #cfd8dc;
    padding: 6px 8px;
    white-space: nowrap;
}

.gordr-picker-table th {
    background: #eceff1;
    position: sticky;
    top: 0;
    z-index: 1;
}

.gordr-picker-table tbody tr.item-picker-row {
    cursor: pointer;
}

.gordr-picker-table tbody tr.item-picker-row:hover {
    background: #e3f2fd;
}

.gordr-picker-table tbody tr.color-picker-row {
    cursor: pointer;
}

.gordr-picker-table tbody tr.color-picker-row:hover {
    background: #e3f2fd;
}

.gordr-picker-table tbody tr.glass-picker-row {
    cursor: pointer;
}

.gordr-picker-table tbody tr.glass-picker-row:hover {
    background: #e3f2fd;
}

.gordr-picker-table td.non-spec {
    color: #1565c0;
    font-weight: 700;
}

.gordr-list-detail .gordr-table tbody tr {
    cursor: default;
}

.gordr-list-detail .gordr-table tbody tr:hover {
    background: transparent;
}

.gordr-list-detail .gordr-table td.non-spec {
    color: #1565c0;
    font-weight: 700;
}

/* 목록 — 전표상세내역: 비고·순번 제외 컬럼 중앙정렬 */
.gordr-list-detail .gordr-detail-table thead th:nth-child(n+2):nth-child(-n+15),
.gordr-list-detail .gordr-detail-table tbody td:nth-child(n+2):nth-child(-n+15) {
    text-align: center;
}

.gordr-list-detail .gordr-detail-table thead th:nth-child(16),
.gordr-list-detail .gordr-detail-table tbody td:nth-child(16) {
    text-align: left;
}

.gordr-detail-wrap {
    overflow-x: auto;
    max-height: 360px;
}

.gordr-detail-table {
    min-width: 1400px;
}

.gordr-detail-table td.non-spec,
.gordr-detail-table th.non-spec {
    color: #1565c0;
    font-weight: 700;
}

.gordr-detail-table td.spec-col-inactive {
    background: #fafafa;
    color: #ccc;
}

.detail-table td.spec-col-inactive {
    background: #fafafa;
}

.detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.detail-table th,
.detail-table td {
    border: 1px solid #cfd8dc;
    padding: 4px;
}

.detail-table th {
    background: #eceff1;
    font-weight: 600;
    white-space: nowrap;
}

.gordr-master-table th:first-child,
.gordr-master-table td:first-child,
.gordr-detail-table th:first-child,
.gordr-detail-table td:first-child {
    white-space: nowrap;
    text-align: center;
    width: 1%;
}

.btn-add-detail,
.btn-submit {
    margin: 10px 12px;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.btn-add-detail {
    background: #607d8b;
    color: #fff;
}

.btn-submit {
    background: #1a73e8;
    color: #fff;
    font-weight: 600;
}

.btn-ocr {
    margin: 10px;
    padding: 8px 12px;
    background: #4CAF50;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    width: calc(100% - 20px);
}

.fax-ocr-notice {
    margin: 0 10px 10px;
    padding: 8px 10px;
    font-size: 12px;
    line-height: 1.5;
    color: #c62828;
    background: #ffebee;
    border: 1px solid #ffcdd2;
    border-radius: 4px;
}

.no-data {
    padding: 24px;
    text-align: center;
    color: #78909c;
}

.toast {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    color: #fff;
    z-index: 9999;
    font-size: 14px;
}

.toast.success {
    background: #4CAF50;
}

.toast.error {
    background: #f44336;
}

.toast.info {
    background: #2196F3;
}

@media (max-width: 1024px) {
    .gordr-edit-layout {
        flex-direction: column;
    }

    .gordr-edit-fax {
        width: 100%;
    }

    .gordr-form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}