/* ════════════════════════════════════════════════════════════════
   총무팀 발주 시스템 — Airtable editorial 톤 (DESIGN.md 기반)
   - near-black ink primary
   - 흰 캔버스
   - hairline outline secondary
   - signature surface card는 voltage moment에만
   ════════════════════════════════════════════════════════════════ */

@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

/* ── Design tokens ──────────────────────────────────────────── */
:root {
    /* Color · Brand & Ink */
    --c-primary:        #181d26;
    --c-primary-active: #0d1218;
    --c-ink:            #181d26;
    --c-body:           #333840;
    --c-muted:          #41454d;
    --c-soft-text:      #6b7280;
    --c-on-primary:     #ffffff;

    /* Color · Surface */
    --c-canvas:          #ffffff;
    --c-surface-soft:    #f8fafc;
    --c-surface-softer:  #fbfcfd;
    --c-surface-strong:  #e0e2e6;
    --c-surface-dark:    #181d26;
    --c-surface-dark-2:  #1d1f25;

    /* Color · Hairlines */
    --c-hairline:        #dddddd;
    --c-hairline-soft:   #ececee;
    --c-border-strong:   #9297a0;

    /* Color · Signature surfaces */
    --c-coral:    #aa2d00;
    --c-forest:   #0a2e0e;
    --c-cream:    #f5e9d4;
    --c-peach:    #fcab79;
    --c-mint:     #a8d8c4;
    --c-yellow:   #f4d35e;
    --c-mustard:  #d9a441;

    /* Color · Semantic */
    --c-link:           #1b61c9;
    --c-link-active:    #1a3866;
    --c-info:           #254fad;
    --c-info-border:    #458fff;
    --c-success:        #006400;
    --c-success-bg:     #e6f4e8;
    --c-warning:        #b45309;
    --c-warning-bg:     #fef3c7;
    --c-danger:         #b42318;
    --c-danger-bg:      #fef0ee;

    /* Type · stack */
    --font-display: 'Inter', 'Pretendard', -apple-system, BlinkMacSystemFont,
                    'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-body:    'Pretendard', 'Inter', -apple-system, BlinkMacSystemFont,
                    'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-mono:    'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, monospace;

    /* Spacing · base 4px */
    --sp-xxs: 4px;
    --sp-xs:  8px;
    --sp-sm:  12px;
    --sp-md:  16px;
    --sp-lg:  24px;
    --sp-xl:  32px;
    --sp-xxl: 48px;
    --sp-section: 96px;

    /* Radius */
    --r-xs: 2px;
    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 12px;
    --r-full: 9999px;

    /* Elevation (color-block first, shadow second) */
    --shadow-card:   0 1px 2px rgba(24, 29, 38, 0.04);
    --shadow-card-2: 0 1px 2px rgba(24, 29, 38, 0.04), 0 8px 24px rgba(24, 29, 38, 0.05);
    --shadow-fab:    0 8px 24px rgba(24, 29, 38, 0.18);
}

/* ── Reset / base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* header position:fixed + scrollbar-gutter 로 페이지 전환 시 폭 변동 차단 */
html { scrollbar-gutter: stable; }
/* overflow-x: clip 사용 — `hidden` 은 자식 position:sticky 를 깨므로 */
html, body { overflow-x: clip; max-width: 100%; }
html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-body);
    background: var(--c-canvas);
    color: var(--c-body);
    line-height: 1.6;
    font-size: 16px;
    font-weight: 400;
    word-break: keep-all;       /* 한글 어절 단위 줄바꿈 — 영문은 정상 */
    overflow-wrap: anywhere;    /* 너무 긴 토큰은 강제로 끊음 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* grid/flex item 폭 폭주 방지 안전망 */
main, .pipeline, .pipeline-col, .pipeline-body, .pipeline-card,
.shop-grid, .shop-card, .shop-row, .card { min-width: 0; }
.shop-row > *:last-child { min-width: 0; word-break: break-all; }

a { color: var(--c-link); text-decoration: none; }
a:hover { color: var(--c-link-active); }

button { font-family: inherit; }

/* ── Top nav (white, ink, hairline bottom) ──────────────────── */
/* position: fixed — 부모 overflow 영향 없이 항상 화면 상단 고정 */
header {
    background: var(--c-canvas);
    color: var(--c-ink);
    border-bottom: 1px solid var(--c-hairline-soft);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
}
.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--sp-xxl);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: var(--sp-lg);
}
.logo {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 500;
    letter-spacing: -0.3px;
    color: var(--c-ink);
}
nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    row-gap: 6px;
}
nav a {
    color: var(--c-body);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.25;
    padding: 8px 14px;
    border-radius: var(--r-sm);
    transition: background-color 0.15s, color 0.15s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
}
nav a:hover { color: var(--c-ink); background: var(--c-surface-soft); }

/* shop 직링크는 작은 색칩 (좌측 점) */
nav .nav-shop {
    gap: 8px;
}
nav .nav-shop::before {
    content: "";
    width: 8px; height: 8px;
    border-radius: var(--r-full);
}
nav .nav-shop.anna::before  { background: #e84a8a; }
nav .nav-shop.harim::before { background: #2f9e63; }
nav .nav-shop.neo::before   { background: #4361ee; }

.nav-user {
    margin-left: var(--sp-xs);
    padding: 4px 10px;
    background: var(--c-surface-soft);
    color: var(--c-muted);
    font-size: 12px;
    border-radius: var(--r-full);
    font-weight: 500;
    letter-spacing: 0.16px;
    white-space: nowrap;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-logout {
    margin-left: 4px;
    background: transparent;
    color: var(--c-body);
    border: 1px solid var(--c-hairline);
    padding: 6px 14px;
    border-radius: var(--r-lg);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}
.nav-logout:hover { color: var(--c-ink); border-color: var(--c-ink); }

/* ── Main canvas ────────────────────────────────────────────── */
/* padding-top: 64(header) + sp-xl(여백) — header fixed 라 본문이 그 아래로 */
main {
    max-width: 1280px;
    margin: 0 auto;
    padding: calc(64px + var(--sp-xl)) var(--sp-xxl) var(--sp-xxl);
}

/* ── Cards ──────────────────────────────────────────────────── */
.card {
    background: var(--c-canvas);
    border: 1px solid var(--c-hairline-soft);
    border-radius: var(--r-lg);
    padding: var(--sp-xl);
    box-shadow: var(--shadow-card);
}

.card-eyebrow {
    font-size: 11px;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--c-link);
    font-weight: 600;
    margin-bottom: 10px;
}

.card h2 {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 500;
    letter-spacing: -0.3px;
    color: var(--c-ink);
    margin-bottom: var(--sp-lg);
    line-height: 1.3;
}

/* ── Section heading helper ─────────────────────────────────── */
.section-title {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 500;
    letter-spacing: -0.5px;
    color: var(--c-ink);
    margin: 0 0 var(--sp-md);
    line-height: 1.2;
}
.section-sub {
    color: var(--c-muted);
    font-size: 15px;
    margin-bottom: var(--sp-xl);
}

/* ── Form ───────────────────────────────────────────────────── */
fieldset {
    border: 1px solid var(--c-hairline-soft);
    border-radius: var(--r-md);
    padding: var(--sp-lg) var(--sp-lg) var(--sp-md);
    margin-bottom: var(--sp-lg);
    background: var(--c-canvas);
}
legend {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    color: var(--c-ink);
    padding: 0 10px;
    letter-spacing: -0.3px;
    line-height: 1.3;
}
fieldset.nested {
    background: var(--c-surface-soft);
    border-color: var(--c-hairline-soft);
}
fieldset.nested > legend {
    background: var(--c-canvas);
    border: 1px solid var(--c-hairline-soft);
    border-radius: var(--r-sm);
    padding: 2px 10px;
    color: var(--c-ink);
    font-weight: 600;
}

.form-group { margin-bottom: var(--sp-md); }
.form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-sm);
}

.label {
    display: block;
    font-size: 15px;
    font-weight: 500;
    color: var(--c-ink);
    margin-bottom: 8px;
    letter-spacing: 0;
}
/* 페이지 안 '큰' 섹션 라벨 (구분, 발송 명의, 거래처) — fieldset legend 와 같은 위계 */
.label.section {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    color: var(--c-ink);
    margin-bottom: 14px;
    letter-spacing: -0.3px;
}
.required { color: var(--c-danger); }

input[type="text"],
input[type="email"],
input[type="url"],
input[type="number"],
input[type="password"],
input[type="file"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--c-hairline);
    border-radius: var(--r-sm);
    font-size: 16px;
    color: var(--c-ink);
    background: var(--c-canvas);
    font-family: inherit;
    line-height: 1.5;
    transition: border-color 0.15s, box-shadow 0.15s;
    min-height: 48px;
}
input[type="file"] { padding: 10px 12px; }
textarea { min-height: 64px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #a0a4ad; }

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--c-info-border);
    box-shadow: 0 0 0 3px rgba(69, 143, 255, 0.18);
}

.form-help {
    font-size: 12px;
    color: var(--c-muted);
    margin-top: 4px;
    line-height: 1.5;
}

/* fieldset legend 바로 아래에 들어가는 보조 설명 (자동입력 안내 등) */
.fieldset-hint {
    font-size: 13px;
    color: var(--c-muted);
    margin: -4px 0 var(--sp-md);
    line-height: 1.55;
    padding: 8px 12px;
    background: var(--c-surface-soft);
    border-radius: var(--r-sm);
    border-left: 3px solid var(--c-hairline);
}

/* 라벨 우측 보조 안내 ('명함에 인쇄됨', '층수까지' 등) */
.label-hint {
    font-size: 11px;
    color: var(--c-muted);
    font-weight: 400;
    letter-spacing: 0.16px;
    margin-left: 4px;
    padding: 2px 8px;
    background: var(--c-surface-soft);
    border-radius: var(--r-full);
}

/* ? 아이콘 + hover 툴팁 (data-tip 속성에 텍스트) */
.hint-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: var(--r-full);
    background: var(--c-surface-soft);
    color: var(--c-muted);
    font-size: 11px;
    font-weight: 700;
    cursor: help;
    position: relative;
    margin-left: 6px;
    border: 1px solid var(--c-hairline-soft);
    vertical-align: middle;
    line-height: 1;
}
.hint-tip:hover { background: var(--c-ink); color: var(--c-on-primary); border-color: var(--c-ink); }
.hint-tip:hover::after,
.hint-tip:focus::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--c-ink);
    color: var(--c-on-primary);
    font-size: 12px;
    font-weight: 400;
    padding: 8px 12px;
    border-radius: var(--r-sm);
    white-space: normal;
    width: max-content;
    max-width: 280px;
    line-height: 1.55;
    z-index: 100;
    pointer-events: none;
    box-shadow: 0 6px 16px rgba(24,29,38,0.15);
    text-align: left;
}
.hint-tip:hover::before,
.hint-tip:focus::before {
    content: "";
    position: absolute;
    bottom: calc(100% + 3px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--c-ink);
    pointer-events: none;
}

/* ── Radio group as chip ────────────────────────────────────── */
.radio-group {
    display: flex;
    gap: var(--sp-xs);
    flex-wrap: wrap;
}
.radio-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 15px;
    color: var(--c-body);
    padding: 10px 18px;
    border: 1px solid var(--c-hairline);
    border-radius: var(--r-full);
    background: var(--c-canvas);
    transition: border-color 0.15s, background-color 0.15s, color 0.15s;
    font-weight: 500;
    letter-spacing: 0;
    line-height: 1.25;
}
.radio-label:has(input:checked) {
    border-color: var(--c-ink);
    background: var(--c-ink);
    color: var(--c-on-primary);
}
.radio-label input[type="radio"] { display: none; }

/* ── Buttons (system) ───────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 22px;
    border: none;
    border-radius: var(--r-lg);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.25;
    cursor: pointer;
    text-decoration: none;
    font-family: var(--font-body);
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
    min-height: 48px;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
    background: var(--c-primary);
    color: var(--c-on-primary);
}
.btn-primary:hover:not(:disabled) { background: var(--c-primary-active); color: var(--c-on-primary); }
.btn-primary:active { background: var(--c-primary-active); }

.btn-secondary {
    background: var(--c-canvas);
    color: var(--c-ink);
    border: 1px solid var(--c-hairline);
}
.btn-secondary:hover { border-color: var(--c-ink); color: var(--c-ink); }

.btn-sm {
    padding: 7px 14px;
    font-size: 13px;
    min-height: 32px;
    border-radius: var(--r-sm);
}
.btn-full { width: 100%; }

/* 시그니처 액션들 — 시각적 위계 유지 */
.btn-approve  { background: var(--c-ink); color: var(--c-on-primary); }
.btn-complete { background: var(--c-ink); color: var(--c-on-primary); }
.btn-advance  { background: var(--c-canvas); color: var(--c-ink); border: 1px solid var(--c-ink); }
.btn-photo    { background: var(--c-canvas); color: var(--c-ink); border: 1px solid var(--c-hairline); }
.btn-kakao    { background: #fee500; color: #3c1e1e; }
.btn-edit     { background: var(--c-canvas); color: var(--c-ink); border: 1px solid var(--c-hairline); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn-edit:hover { border-color: var(--c-ink); }
.btn-del      { background: var(--c-canvas); color: #b91c1c; border: 1px solid var(--c-hairline); }
.btn-del:hover { border-color: #b91c1c; }
.btn-restore  { background: var(--c-canvas); color: var(--c-ink); border: 1px solid var(--c-ink); }
.btn-restore:hover { background: var(--c-ink); color: var(--c-on-primary); }

/* history 테이블의 작업 컬럼 */
.actions-cell { white-space: nowrap; }
.actions-cell .btn-sm { margin-right: 4px; }

/* ── 관리자 취소(soft delete) 표시 ─────────────────────────────── */
.badge-cancel {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

/* 업체 화면 — 취소된 카드 */
.shop-card.cancelled {
    opacity: 0.7;
    background: repeating-linear-gradient(
        45deg,
        var(--c-canvas),
        var(--c-canvas) 12px,
        #fafafa 12px,
        #fafafa 24px
    );
}
.shop-card.cancelled .shop-row,
.shop-card.cancelled .shop-order-info {
    text-decoration: line-through;
    text-decoration-color: #b91c1c;
    text-decoration-thickness: 1px;
    color: var(--c-ink-tertiary, #888);
}
.shop-card.cancelled .badge-cancel { text-decoration: none; }

.cancel-notice {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: var(--r-sm);
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

/* 이력 테이블 — 취소된 행 */
.row-cancelled td {
    color: #999;
}
.row-cancelled td:not(.actions-cell):not(:first-child) {
    text-decoration: line-through;
    text-decoration-color: #b91c1c;
    text-decoration-thickness: 1px;
}

/* ── Badges (subtle, no shadow) ─────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--r-full);
    font-size: 12px;
    font-weight: 500;
    background: var(--c-surface-soft);
    color: var(--c-ink);
    border: 1px solid var(--c-hairline-soft);
    letter-spacing: 0;
    white-space: nowrap;
    flex-shrink: 0;
}
.badge-hw { background: #fef6e1; color: #7a4f0a; border-color: #f4d35e; }
.badge-jh { background: #f1ebff; color: #4a3580; border-color: #c9b8f0; }
.badge-cd { background: #e6efff; color: #1a3866; border-color: #aac6f5; }
.badge-cn { background: #e6f4e8; color: #1f5128; border-color: #b6d9bd; }
.badge-fl { background: #fde7ed; color: #7e1f3c; border-color: #f4b5c8; }

.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--r-full);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.16px;
    white-space: nowrap;
}
.status-badge.status-신청접수 { background: var(--c-danger-bg);  color: var(--c-danger); }
.status-badge.status-승인     { background: var(--c-warning-bg); color: var(--c-warning); }
.status-badge.status-발주완료 { background: #e6efff;             color: var(--c-info); }
.status-badge.status-배송완료 { background: var(--c-success-bg); color: var(--c-success); }

.text-success { color: var(--c-success); font-weight: 600; font-size: 12px; }
.text-muted   { color: var(--c-muted); font-size: 13px; }

/* ── Alerts ─────────────────────────────────────────────────── */
.alert {
    padding: 14px 18px;
    border-radius: var(--r-md);
    margin-bottom: var(--sp-md);
    font-size: 14px;
    line-height: 1.55;
}
.alert-error {
    background: var(--c-danger-bg);
    border: 1px solid #f3b2a8;
    color: var(--c-danger);
}

/* ── Success page ───────────────────────────────────────────── */
.text-center { text-align: center; }

.success-icon {
    width: 56px;
    height: 56px;
    background: var(--c-success-bg);
    color: var(--c-success);
    border-radius: var(--r-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 600;
    margin-bottom: var(--sp-md);
}

.order-summary {
    margin: var(--sp-lg) auto;
    max-width: 560px;
    text-align: left;
}
.summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.summary-table th, .summary-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--c-hairline-soft);
    vertical-align: top;
}
.summary-table th {
    width: 130px;
    color: var(--c-muted);
    font-weight: 500;
    text-align: left;
}
.summary-table td { color: var(--c-ink); }

.info-box {
    background: var(--c-surface-soft);
    border: 1px solid var(--c-hairline-soft);
    border-radius: var(--r-md);
    padding: 14px 18px;
    font-size: 14px;
    color: var(--c-body);
    margin: var(--sp-lg) 0;
    text-align: left;
}

/* ── Admin table ────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

.admin-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    border: 1px solid var(--c-hairline-soft);
    border-radius: var(--r-md);
    overflow: hidden;
    table-layout: auto;
    word-break: keep-all;       /* 한글 어절 단위 줄바꿈 */
}
.admin-table th {
    background: var(--c-surface-soft);
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    color: var(--c-ink);
    border-bottom: 1px solid var(--c-hairline-soft);
    white-space: nowrap;
    font-size: 12px;
    letter-spacing: 0.16px;
    text-transform: uppercase;
}
.admin-table td {
    padding: 14px 14px;
    border-bottom: 1px solid var(--c-hairline-soft);
    vertical-align: top;
    color: var(--c-ink);
    line-height: 1.5;
}
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: var(--c-surface-softer); }
.admin-table small { color: var(--c-muted); font-size: 12px; display: block; }

/* 이력 테이블 컬럼 폭 가이드 — 번호/구분/상태/일자/트래킹은 폭 보장 */
.history-table th:nth-child(1), .history-table td:nth-child(1) { width: 56px; white-space: nowrap; }
.history-table th:nth-child(2), .history-table td:nth-child(2) { width: 96px; }
.history-table th:nth-child(3), .history-table td:nth-child(3) { width: 180px; }
.history-table th:nth-child(4), .history-table td:nth-child(4) { width: 200px; }
.history-table th:nth-child(6), .history-table td:nth-child(6) { width: 110px; white-space: nowrap; }
.history-table th:nth-child(7), .history-table td:nth-child(7) { width: 88px;  white-space: nowrap; }
.history-table th:nth-child(8), .history-table td:nth-child(8) { width: 220px; }

.my-table th:nth-child(1), .my-table td:nth-child(1) { width: 56px;  white-space: nowrap; }
.my-table th:nth-child(2), .my-table td:nth-child(2) { width: 110px; }
.my-table th:nth-child(4), .my-table td:nth-child(4) { width: 120px; white-space: nowrap; }
.my-table th:nth-child(5), .my-table td:nth-child(5) { width: 240px; }
.my-table th:nth-child(6), .my-table td:nth-child(6) { width: 72px;  white-space: nowrap; }

/* ── Pipeline (kanban) ──────────────────────────────────────── */
.pipeline {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--sp-md);
    min-height: 60vh;
}
.pipeline-col {
    background: var(--c-surface-soft);
    border: 1px solid var(--c-hairline-soft);
    border-radius: var(--r-md);
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.pipeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--c-hairline-soft);
    color: var(--c-ink);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.16px;
    text-transform: uppercase;
}
.pipeline-header.status-color-1::before { content:""; width:8px;height:8px;border-radius:50%;background:var(--c-danger);  margin-right:8px; }
.pipeline-header.status-color-2::before { content:""; width:8px;height:8px;border-radius:50%;background:var(--c-warning); margin-right:8px; }
.pipeline-header.status-color-3::before { content:""; width:8px;height:8px;border-radius:50%;background:var(--c-info);    margin-right:8px; }
.pipeline-header.status-color-4::before { content:""; width:8px;height:8px;border-radius:50%;background:var(--c-success); margin-right:8px; }
.pipeline-header > .pipeline-title { flex: 1; }
.pipeline-count {
    background: var(--c-canvas);
    border: 1px solid var(--c-hairline);
    color: var(--c-ink);
    padding: 1px 10px;
    border-radius: var(--r-full);
    font-size: 12px;
    font-weight: 500;
}
.pipeline-body {
    flex: 1;
    padding: var(--sp-sm);
    display: flex;
    flex-direction: column;
    gap: var(--sp-xs);
    overflow-y: auto;
}
.pipeline-card {
    background: var(--c-canvas);
    border: 1px solid var(--c-hairline-soft);
    border-left: 3px solid var(--c-hairline);
    border-radius: var(--r-md);
    padding: 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.pipeline-card:hover { box-shadow: var(--shadow-card-2); }
.pipeline-card.type-hw { border-left-color: var(--c-yellow); }
.pipeline-card.type-jh { border-left-color: #805ad5; }
.pipeline-card.type-cd { border-left-color: var(--c-link); }
.pipeline-card.type-cn { border-left-color: var(--c-success); }
.pipeline-card.type-fl { border-left-color: #e84a8a; }

.card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--sp-xs);
    gap: 8px;
}
.card-id { font-size: 12px; color: var(--c-muted); font-weight: 500; }
.card-sender {
    font-size: 13px;
    font-weight: 500;
    color: var(--c-ink);
    margin-bottom: 4px;
}
.card-shop {
    font-size: 11px;
    color: var(--c-muted);
    font-weight: 500;
    margin-bottom: 6px;
    letter-spacing: 0.16px;
    text-transform: uppercase;
}
.card-detail {
    font-size: 13px;
    color: var(--c-body);
    line-height: 1.55;
    margin-bottom: var(--sp-xs);
}
.card-detail small {
    display: block;
    color: var(--c-muted);
    font-size: 12px;
}
.card-requester {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--c-muted);
    padding-top: var(--sp-xs);
    border-top: 1px solid var(--c-hairline-soft);
    margin-bottom: var(--sp-xs);
}
.card-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.card-actions .btn-sm { flex: 1; min-width: 0; text-align: center; }

.pipeline-empty {
    text-align: center;
    padding: var(--sp-xl) 0;
    color: var(--c-soft-text);
    font-size: 13px;
}

/* ── History header ─────────────────────────────────────────── */
.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--sp-lg);
}
.history-header h2 { margin-bottom: 0; }
.history-total {
    font-size: 14px;
    color: var(--c-muted);
    font-weight: 500;
}
.filter-bar {
    display: flex;
    gap: var(--sp-xs);
    margin-bottom: var(--sp-lg);
    flex-wrap: wrap;
    align-items: center;
}
.filter-input {
    flex: 1;
    min-width: 220px;
}
.filter-select {
    min-width: 140px;
}

/* ── Tracking bar ───────────────────────────────────────────── */
.tracking-bar {
    display: flex;
    align-items: flex-start;
    gap: 2px;
    min-width: 220px;
}
.tracking-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
    flex: 1;
}
.tracking-dot {
    width: 11px;
    height: 11px;
    border-radius: var(--r-full);
    background: var(--c-canvas);
    border: 2px solid var(--c-hairline);
    z-index: 1;
}
.tracking-step.done .tracking-dot {
    background: var(--c-ink);
    border-color: var(--c-ink);
}
.tracking-step.current .tracking-dot {
    background: var(--c-canvas);
    border-color: var(--c-ink);
    box-shadow: 0 0 0 3px rgba(24, 29, 38, 0.12);
}
.tracking-step small {
    font-size: 10px;
    color: var(--c-soft-text);
    white-space: nowrap;
    letter-spacing: 0.1px;
    font-weight: 500;
    line-height: 1.2;
}
.tracking-step.done small    { color: var(--c-ink); }
.tracking-step.current small { color: var(--c-ink); font-weight: 700; }
.tracking-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: var(--c-hairline);
    z-index: 0;
}
.tracking-step.done:not(:last-child)::after { background: var(--c-ink); }

/* 좁은 셀에선 라벨 가리고 dot 만 노출 — 호버/현재 단계만 텍스트 */
.tracking-bar.compact { min-width: 120px; }
.tracking-bar.compact .tracking-step small { display: none; }
.tracking-bar.compact .tracking-step.current small {
    display: inline-block;
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--c-ink);
    color: var(--c-on-primary);
    padding: 2px 8px;
    border-radius: var(--r-full);
    font-size: 10px;
}

/* ── Pagination ─────────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: var(--sp-lg);
}
.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: var(--r-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--c-body);
    background: var(--c-canvas);
    border: 1px solid var(--c-hairline);
    text-decoration: none;
}
.page-link:hover { border-color: var(--c-ink); color: var(--c-ink); }
.page-link.active {
    background: var(--c-ink);
    color: var(--c-on-primary);
    border-color: var(--c-ink);
}
.page-dots { padding: 0 4px; color: var(--c-soft-text); }

/* ── Shop ───────────────────────────────────────────────────── */
.shop-section { margin-bottom: var(--sp-lg); }
.shop-header {
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
    margin-bottom: var(--sp-lg);
}
.shop-header h2 { margin-bottom: 0; }
.shop-badge {
    padding: 3px 12px;
    border-radius: var(--r-full);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.16px;
}
.shop-badge.new     { background: var(--c-danger-bg); color: var(--c-danger); }
.shop-badge.ordered { background: #e6efff;           color: var(--c-info); }

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
    gap: var(--sp-md);
}
.shop-card {
    background: var(--c-canvas);
    border: 1px solid var(--c-hairline-soft);
    border-radius: var(--r-md);
    padding: var(--sp-lg);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.shop-card.new     { border-top: 3px solid var(--c-danger); }
.shop-card.ordered { border-top: 3px solid var(--c-info); }
.shop-card.done    { border-top: 3px solid var(--c-success); opacity: 0.85; }

.shop-order-info { margin: var(--sp-sm) 0 var(--sp-md); }
.shop-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 6px 0;
    border-bottom: 1px solid var(--c-hairline-soft);
    font-size: 13px;
    gap: var(--sp-md);
}
.shop-row:last-child { border-bottom: none; }
.shop-label {
    color: var(--c-muted);
    font-weight: 500;
    min-width: 80px;
    letter-spacing: 0.16px;
}
.shop-row > span:last-child,
.shop-row > a:last-child { color: var(--c-ink); text-align: right; }

/* Photo upload */
.photo-upload { margin-top: var(--sp-sm); }
.photo-label { display: block; cursor: pointer; }
.photo-input { position: absolute; opacity: 0; width: 0; height: 0; }
.photo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: var(--sp-lg);
    border: 1px dashed var(--c-hairline);
    border-radius: var(--r-md);
    color: var(--c-muted);
    font-size: 13px;
    transition: border-color 0.15s, color 0.15s;
    background: var(--c-surface-soft);
}
.photo-placeholder:hover { border-color: var(--c-ink); color: var(--c-ink); }
.photo-icon { font-size: 24px; }
.photo-preview { width: 100%; border-radius: var(--r-md); max-height: 200px; object-fit: cover; }
.done-photo { width: 100%; border-radius: var(--r-md); margin-top: 8px; max-height: 150px; object-fit: cover; }

/* ── Passenger row (flight) ─────────────────────────────────── */
.passenger-row {
    display: grid;
    grid-template-columns: 28px 1fr 2fr auto;
    align-items: center;
    gap: var(--sp-xs);
    margin-bottom: 8px;
}
.passenger-index {
    text-align: center;
    color: var(--c-ink);
    font-weight: 600;
    background: var(--c-surface-soft);
    border: 1px solid var(--c-hairline-soft);
    border-radius: var(--r-full);
    height: 28px;
    line-height: 26px;
    font-size: 11px;
}
.passenger-input { padding: 8px 12px; min-height: 40px; font-size: 13px; }
.passenger-del {
    background: var(--c-canvas);
    border: 1px solid var(--c-hairline);
    color: var(--c-muted);
    padding: 8px 14px;
    border-radius: var(--r-sm);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    min-height: 40px;
}
.passenger-del:hover { border-color: var(--c-danger); color: var(--c-danger); }
@media (max-width: 640px) {
    .passenger-row { grid-template-columns: 28px 1fr; grid-template-rows: auto auto auto; }
    .passenger-row .passenger-del { grid-column: 1 / -1; }
}

/* ── Login screen ───────────────────────────────────────────── */
.login-body {
    background: var(--c-canvas);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-main {
    width: 100%;
    max-width: 420px;
    padding: var(--sp-xl);
}
.login-card {
    background: var(--c-canvas);
    border: 1px solid var(--c-hairline-soft);
    border-radius: var(--r-lg);
    padding: var(--sp-xxl) var(--sp-xl);
    box-shadow: var(--shadow-card);
}
.login-logo {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 500;
    color: var(--c-ink);
    margin-bottom: 6px;
    text-align: center;
    letter-spacing: -0.4px;
}
.login-sub {
    text-align: center;
    color: var(--c-muted);
    font-size: 13px;
    margin-bottom: var(--sp-xl);
}
.login-help {
    margin-top: var(--sp-lg);
    padding: 14px 16px;
    background: var(--c-surface-soft);
    border-radius: var(--r-md);
    font-size: 12px;
    color: var(--c-body);
    line-height: 1.7;
}

/* ══════════════════════════════════════════════════════════════
   Manual — editorial sidebar + body
   ══════════════════════════════════════════════════════════════ */
.manual-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: var(--sp-xxl);
    max-width: 1280px;
    margin: 0 auto;
    align-items: start;
}
.manual-sidebar {
    position: sticky;
    top: 88px;
    max-height: calc(100vh - 108px);
    overflow-y: auto;
    font-size: 13px;
    padding-right: var(--sp-xs);
}
.manual-sidebar::-webkit-scrollbar { width: 6px; }
.manual-sidebar::-webkit-scrollbar-thumb { background: var(--c-hairline); border-radius: 3px; }

.manual-audience {
    margin-bottom: var(--sp-lg);
    padding-bottom: var(--sp-md);
    border-bottom: 1px solid var(--c-hairline-soft);
}
.manual-audience-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--c-soft-text);
    margin-bottom: 10px;
    font-weight: 600;
}
.manual-audience-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.manual-audience-tab {
    padding: 6px 12px;
    background: var(--c-canvas);
    border: 1px solid var(--c-hairline);
    border-radius: var(--r-full);
    color: var(--c-body);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
}
.manual-audience-tab:hover { border-color: var(--c-ink); color: var(--c-ink); }
.manual-audience-tab.active {
    background: var(--c-ink);
    border-color: var(--c-ink);
    color: var(--c-on-primary);
}

.manual-toc-title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--c-soft-text);
    margin-bottom: var(--sp-sm);
    font-weight: 600;
}
.manual-toc ul { list-style: none; padding: 0; margin: 0; }
.manual-toc a {
    display: block;
    padding: 6px 12px;
    color: var(--c-body);
    text-decoration: none;
    border-left: 2px solid transparent;
    font-size: 13px;
    line-height: 1.5;
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.manual-toc a:hover { color: var(--c-ink); background: var(--c-surface-soft); }
.manual-toc a.active {
    color: var(--c-ink);
    border-left-color: var(--c-ink);
    background: var(--c-surface-soft);
    font-weight: 600;
}
.manual-toc ul ul a {
    padding-left: 28px;
    font-size: 12px;
    color: var(--c-muted);
}

.manual-footer-meta {
    margin-top: var(--sp-lg);
    padding-top: var(--sp-md);
    border-top: 1px solid var(--c-hairline-soft);
    color: var(--c-soft-text);
    font-size: 12px;
}

.manual-article {
    background: var(--c-canvas);
    border: 1px solid var(--c-hairline-soft);
    border-radius: var(--r-lg);
    padding: var(--sp-xxl) var(--sp-xxl);
    box-shadow: var(--shadow-card);
}

.manual-hero {
    margin-bottom: var(--sp-xl);
    padding-bottom: var(--sp-lg);
    border-bottom: 1px solid var(--c-hairline-soft);
}
.manual-hero-eyebrow {
    font-family: var(--font-display);
    font-size: 11px;
    letter-spacing: 2.5px;
    color: var(--c-link);
    font-weight: 600;
    margin-bottom: 10px;
    text-transform: uppercase;
}
.manual-hero-title {
    font-family: var(--font-display);
    font-size: 40px;
    font-weight: 400;
    color: var(--c-ink);
    letter-spacing: -0.8px;
    line-height: 1.15;
    margin-bottom: 10px;
}
.manual-hero-sub {
    font-size: 15px;
    color: var(--c-muted);
    margin: 0;
}

.manual-content { font-size: 15px; line-height: 1.75; color: var(--c-body); }
.manual-content > h1:first-child { display: none; }
.manual-content h1 {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 500;
    color: var(--c-ink);
    margin: var(--sp-xl) 0 var(--sp-sm);
    padding-bottom: var(--sp-xs);
    border-bottom: 1px solid var(--c-hairline);
    letter-spacing: -0.4px;
}
.manual-content h2 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 500;
    color: var(--c-ink);
    margin: var(--sp-xl) 0 var(--sp-sm);
    scroll-margin-top: 88px;
    letter-spacing: -0.3px;
}
.manual-content h3 {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 500;
    color: var(--c-ink);
    margin: var(--sp-lg) 0 var(--sp-xs);
    scroll-margin-top: 88px;
}
.manual-content p { margin: 0 0 14px; }
.manual-content strong { color: var(--c-ink); font-weight: 600; }
.manual-content a {
    color: var(--c-link);
    text-decoration: none;
    border-bottom: 1px solid #c7d2fe;
}
.manual-content a:hover { border-bottom-color: var(--c-link); }

.manual-content ul, .manual-content ol { margin: 0 0 var(--sp-md) 4px; padding-left: 22px; }
.manual-content li { margin-bottom: 6px; }
.manual-content li::marker { color: var(--c-link); }

.manual-content table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: var(--sp-md) 0;
    font-size: 14px;
    border: 1px solid var(--c-hairline-soft);
    border-radius: var(--r-md);
    overflow: hidden;
}
.manual-content thead th {
    background: var(--c-surface-soft);
    color: var(--c-ink);
    font-weight: 600;
    text-align: left;
    padding: 11px 14px;
    border-bottom: 1px solid var(--c-hairline-soft);
    font-size: 13px;
    letter-spacing: 0.16px;
    text-transform: uppercase;
}
.manual-content tbody td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--c-hairline-soft);
    color: var(--c-ink);
}
.manual-content tbody tr:last-child td { border-bottom: none; }
.manual-content tbody tr:hover { background: var(--c-surface-softer); }

.manual-content code {
    background: var(--c-surface-soft);
    color: var(--c-ink);
    padding: 2px 7px;
    border-radius: var(--r-sm);
    font-size: 0.9em;
    font-family: var(--font-mono);
    border: 1px solid var(--c-hairline-soft);
}
.manual-content pre {
    background: var(--c-surface-dark);
    color: var(--c-on-primary);
    padding: 16px 18px;
    border-radius: var(--r-md);
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.65;
    margin: var(--sp-md) 0;
    border: 1px solid var(--c-surface-dark-2);
}
.manual-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    border: none;
    font-size: inherit;
}
.manual-content blockquote {
    margin: var(--sp-md) 0;
    padding: 14px 18px;
    background: var(--c-surface-soft);
    border-left: 3px solid var(--c-ink);
    border-radius: 0 var(--r-md) var(--r-md) 0;
    color: var(--c-body);
}
.manual-content blockquote p:last-child { margin-bottom: 0; }
.manual-content hr {
    border: none;
    height: 1px;
    background: var(--c-hairline-soft);
    margin: var(--sp-xl) 0;
}

/* 매뉴얼 안 이미지 — 카드 톤 */
.manual-content img {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--c-hairline);
    border-radius: var(--r-md);
    margin: 16px 0;
    display: block;
}

/* Admonition (Note / Tip / Warning / Danger / Info) */
.manual-content .admonition {
    margin: 20px 0;
    padding: 14px 18px 14px 16px;
    border-left: 4px solid var(--c-link);
    border-radius: var(--r-sm);
    background: var(--c-surface-soft);
}
.manual-content .admonition > p:last-child { margin-bottom: 0; }
.manual-content .admonition-title {
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 8px;
    color: var(--c-ink);
}
.manual-content .admonition.tip      { border-left-color: #006400; background: #f0f9f4; }
.manual-content .admonition.note,
.manual-content .admonition.info     { border-left-color: var(--c-link); background: #eef4fc; }
.manual-content .admonition.warning  { border-left-color: #b87f00; background: #fdf6e7; }
.manual-content .admonition.danger,
.manual-content .admonition.caution  { border-left-color: #b91c1c; background: #fef2f2; }

/* Back to top FAB */
.manual-back-to-top {
    position: fixed;
    right: 28px;
    bottom: 28px;
    width: 44px;
    height: 44px;
    border-radius: var(--r-full);
    background: var(--c-ink);
    color: var(--c-on-primary);
    text-align: center;
    line-height: 44px;
    text-decoration: none;
    font-size: 18px;
    font-weight: 600;
    box-shadow: var(--shadow-fab);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s, transform 0.2s, background-color 0.15s;
    pointer-events: none;
    z-index: 100;
}
.manual-back-to-top.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.manual-back-to-top:hover { background: var(--c-primary-active); color: var(--c-on-primary); }

@media (max-width: 1024px) {
    .manual-shell { grid-template-columns: 1fr; gap: var(--sp-lg); }
    .manual-sidebar {
        position: static;
        max-height: none;
        padding: var(--sp-md);
        background: var(--c-canvas);
        border: 1px solid var(--c-hairline-soft);
        border-radius: var(--r-md);
    }
    .manual-article { padding: var(--sp-xl) var(--sp-lg); }
    .manual-hero-title { font-size: 28px; }
}

/* ── Empty state ────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: var(--sp-xxl) 0;
    color: var(--c-muted);
    font-size: 14px;
}

/* ── Stats ──────────────────────────────────────────────────── */
.stats-row { display: flex; gap: var(--sp-md); margin-bottom: var(--sp-lg); }
.stat {
    flex: 1;
    background: var(--c-canvas);
    border: 1px solid var(--c-hairline-soft);
    border-radius: var(--r-md);
    padding: var(--sp-md);
    text-align: center;
}
.stat-num {
    display: block;
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 500;
    color: var(--c-ink);
    letter-spacing: -0.4px;
}
.stat-label { font-size: 12px; color: var(--c-muted); letter-spacing: 0.16px; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
    main { padding: calc(64px + var(--sp-md)) var(--sp-lg) var(--sp-xl); }
    .header-inner { padding: 0 var(--sp-lg); }
    .pipeline { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    body { font-size: 15px; }
    .section-title { font-size: 24px; }
    legend { font-size: 16px; }
    .label.section { font-size: 16px; }
    .label { font-size: 14px; }
    nav a { font-size: 14px; padding: 6px 10px; }
    main { padding: calc(60px + var(--sp-md)) var(--sp-md) var(--sp-xl); }
    .form-row { grid-template-columns: 1fr; }
    .radio-group { flex-direction: column; align-items: stretch; }
    .radio-label { justify-content: center; }
    .pipeline { grid-template-columns: 1fr; }
    .filter-bar { flex-direction: column; align-items: stretch; }
    .admin-table { font-size: 13px; }
    .tracking-step small { font-size: 11px; }
    .nav-user { display: none; }
    .header-inner { height: 60px; }
}
