* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Malgun Gothic", "맑은 고딕", sans-serif;
    background: #f4f5f7;
    color: #222;
    font-size: 18px;
    line-height: 1.5;
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.box {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    padding: 40px 32px;
    width: 100%;
    max-width: 420px;
}

.box h1 {
    font-size: 26px;
    text-align: center;
    margin: 0 0 28px;
}

.field {
    margin-bottom: 18px;
}

.field label {
    display: block;
    font-size: 16px;
    margin-bottom: 8px;
    color: #444;
}

.field input[type="text"],
.field input[type="password"] {
    width: 100%;
    padding: 14px 16px;
    font-size: 18px;
    border: 2px solid #ccc;
    border-radius: 8px;
}

.field input[type="text"]:focus,
.field input[type="password"]:focus {
    outline: none;
    border-color: #2b6cb0;
}

.btn {
    width: 100%;
    padding: 16px;
    font-size: 19px;
    font-weight: bold;
    color: #fff;
    background: #2b6cb0;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.btn:hover {
    background: #1e4e80;
}

.btn-logout {
    background: #718096;
    max-width: 200px;
}

.msg-error {
    background: #fde8e8;
    color: #9b1c1c;
    border: 1px solid #f8b4b4;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 16px;
}

.notice-box {
    text-align: center;
}

.notice-box p {
    font-size: 20px;
    margin: 16px 0 32px;
}

footer {
    text-align: center;
    padding: 20px;
    font-size: 15px;
    color: #777;
}

@media (max-width: 480px) {
    body {
        font-size: 17px;
    }
    .box {
        padding: 28px 20px;
    }
    .box h1 {
        font-size: 22px;
    }
}

/* ===== 주문 화면 공통 (order_new.php 등) ===== */

.wrap {
    max-width: 760px;
    margin: 0 auto;
    padding: 20px 14px 80px;
}

.wrap h1 {
    font-size: 22px;
    margin: 6px 0 2px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 760px;
    margin: 0 auto;
    padding: 16px 14px 0;
}

.topbar a {
    color: #2b6cb0;
    text-decoration: none;
    font-size: 16px;
}

.order-nav {
    display: flex;
    gap: 8px;
    margin: 0 0 16px;
}

.order-nav button {
    flex: 1;
    padding: 16px 0;
    font-size: 17px;
    border: 1px solid #ccd;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    font-family: inherit;
}

.order-nav button.sel {
    background: #1a73e8;
    color: #fff;
    border-color: #1a73e8;
    font-weight: bold;
}

.order-tab {
    display: none;
}

.order-tab.on {
    display: block;
}

.sec {
    background: #fff;
    border: 1px solid #e2e4e8;
    border-radius: 12px;
    padding: 18px 18px;
    margin: 0 0 14px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}

.st {
    font-size: 17px;
    font-weight: bold;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
}

.num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #222;
    color: #fff;
    font-size: 14px;
    margin-right: 8px;
    flex: none;
}

.sub {
    font-size: 15.5px;
    font-weight: bold;
    margin: 16px 0 6px;
}

.lab {
    font-size: 14px;
    color: #777;
    margin: 12px 0 6px;
}

.chip {
    display: inline-block;
    padding: 12px 18px;
    border: 1.5px solid #c9ccd3;
    border-radius: 8px;
    font-size: 15.5px;
    margin: 0 8px 8px 0;
    color: #444;
    background: #fff;
    cursor: pointer;
    user-select: none;
}

.chip.sq {
    min-width: 48px;
    text-align: center;
    padding: 12px 0;
}

.chip.on {
    background: #e7f0fe;
    color: #1a56b0;
    border-color: #1a73e8;
    font-weight: bold;
}

.chip.ask {
    border-style: dashed;
    color: #b06000;
    border-color: #e0a030;
}

.chip.ask.on {
    background: #fdf3e0;
    color: #8a4b00;
    border-color: #e0a030;
}

.chip.disabled {
    opacity: .4;
    pointer-events: none;
    text-decoration: line-through;
}

.order-tab input[type=text],
.order-tab input[type=number],
.order-tab input[type=date],
.order-tab select,
.order-tab textarea {
    background: #fffbe8;
    border: 1.5px solid #c9ccd3;
    border-radius: 8px;
    padding: 11px 12px;
    font-size: 16px;
    font-family: inherit;
}

.order-tab textarea {
    width: 100%;
    min-height: 72px;
    resize: vertical;
}

.auto {
    background: #f2f6fd;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14.5px;
    margin-top: 8px;
}

.hint {
    font-size: 13.5px;
    color: #999;
    margin-top: 6px;
    display: block;
}

.dorow {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin: 0 0 6px;
}

.dolab {
    width: 56px;
    font-size: 15px;
    color: #555;
    flex: none;
}

/* ===== 작업05-3: 항목 라벨 왼쪽 고정폭 정렬 공통 행 패턴 ===== */
/* .frow: 라벨(.flab, 고정폭) + 컨트롤 영역(.fctl). 버튼이 줄바꿈돼도 .fctl 자체가
   flex-wrap 컨테이너라 둘째 줄 첫 버튼이 첫째 줄 첫 버튼과 자연히 왼쪽 정렬된다. */
.frow {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0 0 12px;
}

.flab {
    width: 100px;
    flex: none;
    font-size: 14.5px;
    color: #555;
    padding-top: 10px;
}

.fctl {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 0;
}

/* 도수·코팅처럼 전면/후면을 한 줄에 묶을 때 쓰는 하위 라벨 */
.fsub {
    font-size: 14px;
    color: #555;
    margin: 0 6px 0 0;
    flex: none;
}

.fsub + .chipbox {
    margin-right: 16px;
}

.chipbox {
    display: flex;
    flex-wrap: wrap;
}

.chip.chip-note {
    color: #999;
    font-style: italic;
}

.custom {
    display: none;
    margin: 6px 0 8px;
}

.askbadge {
    display: none;
    margin-top: 10px;
    background: #fdf3e0;
    color: #8a4b00;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14.5px;
}

.evenwarn {
    display: none;
    color: #c02020;
    font-size: 14px;
    margin-top: 8px;
}

.required-mark {
    font-size: 13.5px;
    color: #c92a2a;
    font-weight: bold;
}

.btn-wide {
    display: block;
    width: 100%;
    max-width: 760px;
    margin: 20px auto 0;
    padding: 18px;
    font-size: 19px;
    font-weight: bold;
    color: #fff;
    background: #1a73e8;
    border: none;
    border-radius: 10px;
    cursor: pointer;
}

.btn-wide:hover {
    background: #1558b0;
}

.btn-secondary {
    background: #718096;
}

.btn-secondary:hover {
    background: #576270;
}

.btn-row {
    display: flex;
    gap: 10px;
    max-width: 760px;
    margin: 20px auto 0;
}

.btn-row .btn-wide {
    margin: 0;
}

/* ===== 확인 화면 요약 테이블 ===== */

.summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.summary-table th,
.summary-table td {
    border: 1px solid #d8dade;
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
}

.summary-table th {
    width: 34%;
    background: #f7f8fa;
    color: #555;
    font-weight: bold;
}

/* ===== 주문 목록 / 상세 ===== */

.order-card {
    background: #fff;
    border: 1px solid #e2e4e8;
    border-radius: 12px;
    padding: 18px 20px;
    margin: 0 0 14px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
    display: block;
    text-decoration: none;
    color: inherit;
}

.order-card .order-no {
    font-size: 17px;
    font-weight: bold;
    color: #1a56b0;
}

.order-card .order-item {
    font-size: 15.5px;
    margin: 6px 0;
    color: #333;
}

.order-card .order-meta {
    font-size: 13.5px;
    color: #888;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: bold;
    background: #e7f0fe;
    color: #1a56b0;
}

.badge.status-received { background: #e7f0fe; color: #1a56b0; }
.badge.status-ctp { background: #f0e7fd; color: #6b1cb0; }
.badge.status-printing { background: #e6f7ea; color: #1c7c3c; }
.badge.status-finishing { background: #fdf3e0; color: #8a4b00; }
.badge.status-completed { background: #eef0f2; color: #444; }
.badge.status-on_hold { background: #fde8e8; color: #9b1c1c; }
.badge.status-cancelled { background: #eef0f2; color: #888; }

.empty-state {
    text-align: center;
    color: #888;
    padding: 60px 20px;
    font-size: 16px;
}

@media (max-width: 520px) {
    .chip {
        padding: 11px 13px;
        font-size: 15px;
    }
}

/* ===== 작업05-1: 주문화면 좌측 메뉴(PC) / 상단 탭(모바일) + 2열 그리드 ===== */

.order-layout {
    display: block;
}

.nav-label {
    display: block;
}

.nav-desc {
    display: none;
}

@media (min-width: 880px) {
    .wrap-order {
        max-width: 1200px;
        padding-top: 12px;
        padding-bottom: 20px;
    }

    .wrap-order h1 {
        margin: 4px 0 0;
    }

    .wrap-order .note {
        margin: 6px 0;
    }

    .wrap-order + footer {
        padding: 4px 20px;
        font-size: 13px;
    }

    .order-layout {
        display: flex;
        align-items: flex-start;
        gap: 24px;
    }

    .order-nav {
        flex: none;
        width: 230px;
        flex-direction: column;
        gap: 10px;
        margin: 0;
        position: sticky;
        top: 20px;
    }

    .order-nav button {
        text-align: left;
        padding: 14px 18px;
    }

    .nav-desc {
        display: block;
        font-size: 12.5px;
        font-weight: normal;
        color: #888;
        margin-top: 5px;
        line-height: 1.4;
    }

    .order-nav button.sel .nav-desc {
        color: #e6f1fb;
    }

    .order-content {
        flex: 1;
        min-width: 0;
    }

    /* 작업05-3 후속: 3열 그리드 제거 — 섹션 카드는 전체 폭 세로 1열로 쌓는다 */
    .order-tab.on .sec {
        width: 100%;
    }

    /* 데스크톱 압축 — 가독성은 유지하는 선에서만 */
    .order-tab .sec {
        padding: 14px 16px;
        margin: 0 0 14px;
    }

    .order-tab .st {
        font-size: 15.5px;
        margin-bottom: 8px;
    }

    .order-tab .lab {
        font-size: 13px;
        margin: 9px 0 5px;
    }

    .order-tab .sub {
        font-size: 14px;
        margin: 12px 0 5px;
    }

    .order-tab .chip {
        padding: 9px 14px;
        font-size: 14px;
        margin: 0 6px 6px 0;
    }

    .order-tab .frow {
        margin: 0 0 8px;
    }

    .order-tab .flab {
        width: 82px;
        font-size: 13px;
        padding-top: 7px;
    }

    #submitBtn {
        max-width: 1200px;
        margin-top: 12px;
    }
}

/* ===== 작업06: 관리자 작업보드 ===== */

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14.5px;
}

.admin-table th,
.admin-table td {
    border: 1px solid #e2e4e8;
    padding: 10px 12px;
    text-align: left;
    white-space: nowrap;
}

.admin-table th {
    background: #f7f8fa;
    color: #555;
    font-weight: bold;
}

.admin-table tbody tr:hover {
    background: #f7faff;
}

.admin-table a {
    color: #1a56b0;
    text-decoration: none;
    font-weight: bold;
}

.row-overdue {
    background: #fff5f5;
}

.row-overdue td {
    color: #9b1c1c;
}

.badge-inquiry {
    background: #fdf3e0;
    color: #8a4b00;
    margin-left: 6px;
}

.admin-detail-box {
    background: #fff;
    border: 1px solid #e2e4e8;
    border-radius: 12px;
    padding: 18px 20px;
    margin: 0 0 16px;
}

.admin-detail-box h2 {
    font-size: 16px;
    margin: 0 0 12px;
}

.status-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.status-history-table th,
.status-history-table td {
    border: 1px solid #e2e4e8;
    padding: 8px 10px;
    text-align: left;
}

.status-history-table th {
    background: #f7f8fa;
    color: #555;
}

/* ===== 작업06-3: 직원 메모 ===== */

.memo-item {
    padding: 8px 0;
    border-bottom: 1px dashed #d8dade;
    font-size: 14px;
    display: flex;
    gap: 10px;
}

.memo-item:last-child {
    border-bottom: none;
}

.memo-time {
    font-family: "Consolas", monospace;
    color: #888;
    min-width: 130px;
    font-size: 12.5px;
    flex: none;
}

/* ===== 작업06-2: 칸반 현황판 ===== */

.stat-row-kanban {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin: 16px 0;
}

.stat-card-k {
    background: #fff;
    border: 1px solid #e2e4e8;
    border-radius: 12px;
    padding: 14px 16px;
}

.stat-card-k.urgent {
    background: #fff5f5;
    border-color: #f3b4b4;
}

.stat-label-k {
    font-size: 12px;
    color: #888;
    font-weight: bold;
    letter-spacing: .3px;
}

.stat-value-k {
    font-family: "Consolas", monospace;
    font-size: 26px;
    font-weight: bold;
    margin-top: 2px;
}

.stat-card-k.urgent .stat-value-k {
    color: #9b1c1c;
}

/* 작업06-2 2.2절 — 라인별 2줄 배치(디지털/옵셋) + 보류·취소 1줄 */

.kanban-alert-band {
    background: #fff3cd;
    border: 1px solid #f0d98c;
    color: #7a5c00;
    padding: 10px 14px;
    border-radius: 8px;
    margin: 6px 0 14px;
}

.kanban-alert-band summary {
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    list-style: none;
}

.kanban-alert-band summary::-webkit-details-marker {
    display: none;
}

.kanban-alert-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.kanban-line-row {
    display: flex;
    background: #fff;
    border: 1px solid #e2e4e8;
    border-left: 6px solid #ccc;
    border-radius: 8px;
    margin-bottom: 14px;
    overflow: hidden;
}

.kanban-line-row.row-digital {
    border-left-color: #2c5282;
}

.kanban-line-row.row-offset {
    /* 작업09(2차): 빨강(#c0392b) → 진남색 — 빨강은 납기경과·긴급 표시에만 남긴다(김대표님 지시) */
    border-left-color: #1b2a4a;
}

.kanban-row-label {
    flex: 0 0 110px;
    padding: 12px;
    background: #f7f8fa;
    border-right: 1px solid #e2e4e8;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.kanban-row-label .row-title {
    font-weight: bold;
    font-size: 14px;
}

.kanban-row-label .row-total,
.kanban-holdcancel-label .row-total {
    font-size: 11px;
    color: #888;
    font-weight: normal;
}

.kanban-row-lanes {
    flex: 1;
    display: flex;
    overflow-x: auto;
}

.kanban-mini-lane {
    flex: 1;
    min-width: 150px;
    border-right: 1px dashed #e2e4e8;
    display: flex;
    flex-direction: column;
}

.kanban-mini-lane:last-child {
    border-right: none;
}

.kanban-mini-lane-head {
    padding: 6px 10px;
    font-size: 11.5px;
    font-weight: bold;
    color: #555;
    background: #fafbfc;
    border-bottom: 1px solid #e2e4e8;
    display: flex;
    justify-content: space-between;
}

.kanban-mini-lane-body {
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 70px;
}

.kanban-lane-count {
    background: #eef0f2;
    color: #222;
    border-radius: 10px;
    padding: 1px 8px;
    font-size: 11px;
    font-weight: bold;
}

.kanban-holdcancel-row {
    display: flex;
    background: #fdf9e6;
    border: 1px solid #f0d98c;
    border-left: 6px solid #b8860b;
    border-radius: 8px;
    padding: 12px;
    gap: 14px;
    align-items: flex-start;
    overflow-x: auto;
    margin-bottom: 14px;
}

.kanban-holdcancel-label {
    flex: 0 0 110px;
    font-weight: bold;
    font-size: 14px;
}

.kanban-holdcancel-cards {
    flex: 1;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.kanban-holdcancel-cards .kanban-card {
    min-width: 170px;
}

.kanban-hold-reason {
    font-size: 11px;
    color: #7a5c00;
    margin-top: 4px;
}

.kanban-card {
    background: #fff;
    border: 1px solid #e2e4e8;
    border-radius: 8px;
    padding: 8px 10px;
    text-decoration: none;
    color: inherit;
    display: block;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}

.kanban-card:hover {
    border-color: #1a73e8;
}

.kanban-card.card-overdue {
    border-left: 4px solid #c0392b;
}

.kanban-card .k-no {
    font-family: "Consolas", monospace;
    font-size: 11px;
    color: #888;
}

.kanban-card .k-client {
    font-weight: bold;
    font-size: 13px;
    margin-top: 1px;
}

.kanban-card .k-title {
    font-size: 12px;
    color: #555;
    margin-top: 1px;
}

.kanban-card .k-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed #e2e4e8;
    font-size: 11px;
    color: #888;
}

.dday { font-weight: bold; }
.dday-late { color: #c0392b; }
.dday-close { color: #b8860b; }
.dday-ok { color: #888; }

.kanban-empty {
    padding: 16px;
    text-align: center;
    color: #888;
    font-size: 12px;
}

/* ===== 작업06-4a: 거래처 진행 단계 바 ===== */

.progress-bar {
    display: flex;
    align-items: flex-start;
    margin: 10px 0 4px;
    overflow-x: auto;
}

.progress-step {
    flex: 1;
    min-width: 64px;
    text-align: center;
    position: relative;
}

.progress-step::before {
    content: '';
    position: absolute;
    top: 9px;
    left: -50%;
    width: 100%;
    height: 3px;
    background: #e2e4e8;
    z-index: 0;
}

.progress-step:first-child::before {
    display: none;
}

.progress-step.done::before {
    background: #1a73e8;
}

.progress-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e2e4e8;
    border: 3px solid #fff;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.progress-step.done .progress-dot {
    background: #1a73e8;
}

.progress-step.current .progress-dot {
    background: #1a73e8;
    box-shadow: 0 0 0 4px #d4e0ee;
}

.progress-label {
    font-size: 12px;
    color: #888;
    margin-top: 6px;
}

.progress-step.done .progress-label,
.progress-step.current .progress-label {
    color: #1a56b0;
    font-weight: bold;
}

/* ===== 작업07-2: PDF 업로드 ===== */

.upload-box {
    border: 1.5px dashed #c9ccd3;
    border-radius: 10px;
    padding: 16px;
    margin: 0 0 16px;
    background: #faf8f2;
    transition: border-color .15s, background .15s;
}

.upload-box.drag-over {
    border-color: #1a73e8;
    border-style: solid;
    background: #e7f0fe;
}

.upload-box h4 {
    margin: 0 0 10px;
    font-size: 15px;
}

.upload-file-input {
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
}

.upload-progress-wrap {
    margin-top: 12px;
    display: none;
}

.upload-progress-bar {
    background: #e2e4e8;
    border-radius: 6px;
    height: 10px;
    overflow: hidden;
}

.upload-progress-fill {
    background: #1a73e8;
    height: 100%;
    width: 0%;
    transition: width .2s;
}

.upload-status-text {
    font-size: 13px;
    color: #555;
    margin-top: 6px;
}

.file-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #e2e4e8;
    border-radius: 8px;
    margin-bottom: 8px;
    background: #fff;
}

.file-list-item .file-name {
    font-weight: bold;
    font-size: 14px;
    word-break: break-all;
}

.file-list-item .file-meta {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
}

.badge-nofile {
    background: #fde8e8;
    color: #9b1c1c;
}

.file-missing-notice {
    background: #fde8e8;
    color: #9b1c1c;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 14.5px;
    font-weight: bold;
    margin-bottom: 16px;
}

/* ===== 작업09 (2차): 주문 화면 견적 카드 — 인쇄 방식 선택 겸 접수 버튼 =====
   김대표님 지시: 빨간색 사용 금지. 디지털=파란(#2563eb), 옵셋=진남색(#1b2a4a). 금액 글씨는 검정 굵게. */

.quote-cards {
    display: flex;
    gap: 12px;
}

@media (max-width: 560px) {
    .quote-cards {
        flex-direction: column;
    }
}

.quote-card {
    flex: 1;
    border: 1.5px solid #e2e4e8;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}

.quote-card-head {
    padding: 12px 14px;
    text-align: center;
    font-weight: bold;
    font-size: 15px;
    color: #fff;
}

.quote-card-digital .quote-card-head {
    background: #2563eb;
}

.quote-card-offset .quote-card-head {
    background: #1b2a4a;
}

.quote-card-body {
    padding: 18px 14px;
    text-align: center;
}

.quote-card-amount {
    font-size: 15px;
    font-weight: bold;
    color: #111;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    line-height: 1.4;
}

.quote-card-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 15px;
    cursor: pointer;
    color: #fff;
    font-family: inherit;
}

.quote-card-digital .quote-card-btn {
    background: #2563eb;
}

.quote-card-digital .quote-card-btn:hover {
    background: #1d4ed8;
}

.quote-card-offset .quote-card-btn {
    background: #1b2a4a;
}

.quote-card-offset .quote-card-btn:hover {
    background: #141f38;
}
