/* ============================================================
   판매사 발주 포털 — ERP 원본(main.css) 디자인 이식판
   디자인 톤 동일: 슬레이트 톤 — 검은 헤더 + 다크 사이드바 + 청록 액센트
   폰트: Inter + Noto Sans KR (원본과 동일)
   ERP CSS와 파일은 분리 (호스팅 이전 대비 자립형)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Noto+Sans+KR:wght@300;400;500;600;700&display=swap');

:root {
  --bg-main:        #F4F6F8;
  --bg-elevated:    #FFFFFF;
  --bg-sidebar:     #1F2937;
  --bg-hover:       #EDF1F4;
  --bg-active:      #3F6E8E;
  --bg-input:       #FFFFFF;

  --text-main:      #2A3540;
  --text-sub:       #4F5D6B;
  --text-muted:     #8492A1;
  --text-on-active: #FFFFFF;

  --border:         #DDE3E8;
  --border-strong:  #C5CDD5;
  --accent:         #3F6E8E;
  --accent-soft:    #E6F1FB;
  --danger:         #B3261E;

  --radius-sm:      8px;
  --radius:         12px;

  --font-sans:      'Inter', 'Noto Sans KR', -apple-system, 'Segoe UI', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;

  --sidebar-w:      280px;
  --header-h:       76px;
}

/* ---- 리셋 (원본 동일) ---- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-main);
  background: var(--bg-main);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; font-size: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: inherit; color: var(--text-main); }

/* ---- 레이아웃: 검은 헤더 고정 + 다크 사이드바 (원본 .app 구조) ---- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  grid-template-rows: var(--header-h) auto;
  min-height: 100vh;
  width: 100%;
}
.app__header {
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
  background: #000000;
  border-bottom: 1px solid #000000;
  position: sticky;
  top: 0;
  z-index: 30;
  color: #FFFFFF;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand__logo { height: 34px; width: auto; display: block; }
.brand__name { font-size: 19px; font-weight: 700; color: #FFFFFF; letter-spacing: 0; }
.brand__sub { font-size: 12.5px; color: #D1D5DB; font-weight: 500; }

/* 기능 메뉴 (발주 / 매출&지출) — 원본 mode-switch--fn 스타일 */
.mode-switch {
  display: flex;
  align-items: center;
  gap: 0;
}
.mode-btn {
  border-radius: 7px;
  padding: 11px 20px;
  margin: 0 2px;
  position: relative;
  color: #D1D5DB;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.mode-btn svg { width: 15px; height: 15px; }
.mode-btn + .mode-btn::before {
  content: "";
  position: absolute;
  left: -2px; top: 25%; bottom: 25%;
  width: 1px;
  background: #2A2A2A;
}
.mode-btn:hover:not(.is-active) { background: #1A1A1A; color: #FFFFFF; }
.mode-btn.is-active { background: var(--accent); color: #FFFFFF; font-weight: 700; }
.mode-btn.is-active::before, .mode-btn.is-active + .mode-btn::before { display: none; }

.header__spacer { flex: 1; }
.header__seller {
  display: inline-flex; align-items: center; gap: 8px;
  background: #111827; border: 1px solid #374151; border-radius: 999px;
  padding: 7px 16px; font-size: 13px; font-weight: 700; color: #FFFFFF;
}
.header__seller svg { width: 14px; height: 14px; color: #9CA3AF; }
.btn-logout {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border: 1px solid #374151; border-radius: 8px;
  background: transparent; color: #D1D5DB; font-size: 13px; font-weight: 600;
}
.btn-logout:hover { background: #1A1A1A; color: #FFFFFF; }

/* ---- 다크 사이드바 (원본 .app__sidebar + po-sidebar) ---- */
.app__sidebar {
  grid-column: 1;
  grid-row: 2;
  background: var(--bg-sidebar);
  color: #D1D5DB;
  padding: 18px 0 30px;
  min-width: 0;
}
.side-section__title {
  display: flex; align-items: center; gap: 8px;
  padding: 0 16px 10px;
  font-size: 13.5px; font-weight: 700; color: #FFFFFF;
}
.side-section__icon { width: 15px; height: 15px; color: #7FB6DA; flex: 0 0 auto; }
.side-section__count {
  margin-left: auto;
  background: transparent; color: #E5E7EB;
  border: 1px solid #4B5563; border-radius: 999px;
  padding: 0 8px; font-size: 11px; font-weight: 600;
}
.side-action {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin: 8px 12px 16px;
  padding: 12px;
  border: 1px dashed #4B5563;
  border-radius: var(--radius);
  font-size: 14px; font-weight: 600; color: #D1D5DB;
  transition: all 0.15s;
}
.side-action:hover { border-color: var(--accent); color: #FFFFFF; border-style: solid; background: #374151; }

/* 발주서 그룹 (원본 po-group) */
.po-group { margin: 0 10px 14px; border-radius: 10px; overflow: hidden; background: #1B2635; border: 1px solid rgba(255,255,255,0.07); }
.po-group__head {
  padding: 9px 11px;
  background: #28394C;
  font-size: 13px; font-weight: 700; color: #EEF3F8;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  display: flex; justify-content: space-between; align-items: center;
}
.po-group__count {
  color: #C8D3DF; font-size: 11px; font-weight: 600;
  background: rgba(255,255,255,0.08); border-radius: 999px; padding: 1px 8px;
}
.po-group__list { list-style: none; }
.po-row {
  display: flex; align-items: center; gap: 6px;
  width: 100%;
  text-align: left;
  padding: 9px 11px;
  border-bottom: 1px solid rgba(255,255,255,0.09);
  cursor: pointer;
  font-size: 12.5px;
  color: #D1D5DB;
}
.po-row:last-child { border-bottom: 0; }
.po-row:hover { background: #243245; }
.po-row.is-active {
  background: linear-gradient(90deg, #3F6E8E 0%, #4E84A8 100%);
  box-shadow: 0 1px 4px rgba(63,110,142,0.4);
}
.po-row.is-active .po-row__label { color: #FFFFFF; }
.po-row.is-active .po-row__meta  { color: rgba(255,255,255,0.82); }
.po-row__main { flex: 1; overflow: hidden; }
.po-row__label { font-weight: 600; color: #E8EDF3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.po-row__meta { font-size: 10.5px; color: #9FB0C0; margin-top: 2px; }
.po-row__amount { flex: 0 0 auto; font-size: 12px; font-weight: 700; color: #E8EDF3; font-variant-numeric: tabular-nums; }
.po-row__del {
  width: 18px; height: 18px; padding: 0; border-radius: 50%;
  background: transparent; border: 0; color: #9FB0C0;
  cursor: pointer; font-size: 12px; line-height: 1; opacity: 0;
  transition: opacity 0.12s; flex: 0 0 auto;
}
.po-row:hover .po-row__del { opacity: 1; }
.po-row__del:hover { background: #d32f2f; color: #fff; }
@media (hover: none) { .po-row__del { opacity: 1; } }
.po-row__badge {
  display: inline-block; border-radius: 8px; padding: 0 7px;
  font-size: 9.5px; font-weight: 700; margin-left: 6px; vertical-align: 1px;
}
.po-row__badge--new { background: #4b5563; color: #F3F4F6; }
.po-row__badge--exported { background: #1e7a3e; color: #E8F5E9; }
.side-empty {
  margin: 4px 16px; padding: 22px 10px;
  border: 1px dashed #4B5563; border-radius: 10px;
  color: #9CA3AF; font-size: 12.5px; text-align: center; line-height: 1.7;
}

/* ---- 본문 ---- */
.app__main {
  grid-column: 2;
  grid-row: 2;
  padding: 28px 32px 60px;
  min-width: 0;
}
.page-title {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  display: flex; align-items: center; gap: 11px;
}
.page-title__icon { width: 27px; height: 27px; flex: 0 0 auto; color: var(--accent); }
.page-sub { font-size: 14px; color: var(--text-sub); margin-bottom: 28px; }

/* 메시지 */
.sp-msg { display: none; border-radius: 8px; padding: 10px 14px; font-size: 13.5px; margin: 0 0 14px; max-width: 1080px; }
.sp-msg.is-ok { display: block; background: #e8f5e9; color: #1e7a3e; border: 1px solid #bfe4c8; }
.sp-msg.is-err { display: block; background: #ffebee; color: #c62828; border: 1px solid #f3c1c6; }

/* ---- 발주서 레터헤드 (원본 .order-header) ---- */
.order-header {
  max-width: 1080px;
  margin: 16px 0 20px;
  display: flex;
  gap: 18px;
  align-items: stretch;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
}
.order-header__brand { flex: 0 0 240px; display: flex; flex-direction: column; justify-content: center; }
.order-header__title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 10px;
  color: var(--accent);
}
.order-header__sub { font-size: 12px; color: var(--text-sub); margin-top: 6px; }
.order-header__info { flex: 1; border-collapse: collapse; font-size: 12px; }
.order-header__info th, .order-header__info td {
  border: 1px solid var(--border);
  padding: 5px 10px;
  vertical-align: middle;
}
.order-header__info th {
  background: var(--bg-main);
  width: 90px;
  text-align: center;
  font-weight: 600;
  color: var(--text-sub);
}

/* ---- 발주 폼 (원본 .order-form / .of-*) ---- */
.order-form { max-width: 1080px; margin: 20px 0 40px; }
.of-section {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 20px 18px;
  margin: 0 0 16px;
  background: var(--bg-elevated);
}
.of-section > legend {
  padding: 2px 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  background: var(--bg-elevated);
  border-radius: 4px;
}
.of-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
.of-row { display: flex; flex-direction: column; gap: 4px; }
.of-row > label { font-size: 12px; font-weight: 600; color: var(--text-sub); }
.of-row > label .req { color: #d32f2f; }
.of-row input[type="text"],
.of-row input[type="number"],
.of-row input[type="date"],
.of-row select,
.of-row textarea {
  width: 100%;
  padding: 7px 10px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #fff;
  color: var(--text-main);
}
.of-row input:focus, .of-row select:focus, .of-row textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}
.of-row--full { grid-column: 1 / -1; }
.of-row .hint { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.of-input--accent { color: #d32f2f !important; font-weight: 700; }

/* 수신 공급사 박스 (고정 선택 상태) */
.of-supplier-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-main);
}
.of-supplier-box__val { flex: 1; font-size: 13px; color: var(--text-main); font-weight: 700; }
.of-supplier-box__fixed {
  font-size: 11px; font-weight: 700; color: var(--accent);
  background: var(--accent-soft); border-radius: 10px; padding: 2px 10px;
}

/* 품목 표 (원본 .of-items) */
.of-items-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.btn-add-item {
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 700;
  background: var(--accent);
  color: var(--text-on-active);
  border: 0;
  border-radius: 5px;
}
.btn-add-item:hover { filter: brightness(1.08); }
.of-items-total { margin-left: auto; font-size: 13px; color: var(--text-sub); }
.of-items-total b { color: #d32f2f; font-size: 15px; }
.of-items-total small { color: var(--text-muted); font-size: 10px; }
.of-items-scroll { overflow-x: auto; }
.of-items {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  background: var(--bg-main);
  table-layout: fixed;
  min-width: 720px;
}
.of-items thead th:nth-child(1) { width: 40px; }   /* NO */
.of-items thead th:nth-child(3) { width: 84px; }   /* 수량 */
.of-items thead th:nth-child(4) { width: 150px; }  /* 공급가 */
.of-items thead th:nth-child(5) { width: 150px; }  /* 판매가 */
.of-items thead th:nth-child(6) { width: 150px; }  /* 비고 */
.of-items thead th:nth-child(7) { width: 46px; }   /* 삭제 */
.of-items th, .of-items td {
  border: 1px solid var(--border);
  padding: 6px 8px;
  vertical-align: middle;
}
.of-items thead th {
  background: var(--bg-main);
  font-weight: 600;
  text-align: center;
  color: var(--text-sub);
}
.of-items tbody tr { background: #fff; }
.of-items td.num { text-align: center; color: var(--text-muted); }
.of-items td.model { font-family: Consolas, monospace; }
.of-items td.model b { font-size: 14px; }
.of-items__code { display: inline; color: var(--text-muted); font-size: 13px; margin-left: 8px; font-family: inherit; }
.of-items td.price { text-align: right; font-variant-numeric: tabular-nums; }
.of-items td.price b { color: #d32f2f; font-size: 13px; }
.of-items td.price small { display: block; color: var(--text-muted); font-size: 10px; font-weight: 400; }
.of-items td.del { text-align: center; }
.of-items td input {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 7px 10px;
  font-size: 13px;
}
.of-qty { width: 64px; text-align: center; display: block; margin: 0 auto; padding: 7px 6px; }
.of-note { width: 100%; }
.of-sale-price { width: 100%; text-align: right; font-weight: 700; color: #d32f2f; }
.of-option { display: block; width: 100%; margin-top: 5px; font-size: 12px; padding: 6px 10px; }
.of-items td input::placeholder { color: #9aa5b1; }
.of-items td input:focus {
  background: #FFFFFF;
  border-color: var(--bg-active);
  outline: none;
  box-shadow: 0 0 0 2px rgba(63,110,142,0.18);
}
.of-items__empty td {
  text-align: center;
  padding: 22px;
  color: var(--text-muted);
  font-style: italic;
  background: #fafafa;
}
.btn-row-del {
  width: 22px; height: 22px; padding: 0; border-radius: 50%;
  background: #fff; border: 1px solid var(--border); color: var(--text-muted);
  font-size: 13px; line-height: 1;
}
.btn-row-del:hover { background: #d32f2f; color: #fff; border-color: #d32f2f; }

/* 고객 슬롯 (원본 .of-customer) */
.of-customer {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px 16px;
  margin-bottom: 10px;
  background: var(--bg-main);
}
.of-customer__head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.of-customer__num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: var(--text-on-active);
  font-weight: 700; font-size: 11px;
}
.of-customer__title { font-size: 13px; font-weight: 600; color: var(--text-sub); }

/* 제출 줄 (원본 .form-actions) */
.form-actions {
  margin-top: 4px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}
.btn-submit {
  padding: 10px 22px;
  font-size: 13px;
  font-weight: 700;
  background: var(--accent);
  color: var(--text-on-active);
  border: 0;
  border-radius: 6px;
}
.btn-submit:hover:not(:disabled) { filter: brightness(1.08); }
.btn-submit:disabled { background: #ccc; color: #fff; cursor: not-allowed; }
.btn-cancel {
  padding: 10px 18px;
  font-size: 13px;
  background: var(--bg-main);
  color: var(--text-sub);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.btn-cancel:hover { background: var(--bg-hover); }

/* ---- 모달 (원본 .of-modal) ---- */
.of-modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.45); z-index: 2000;
  align-items: center; justify-content: center;
}
.of-modal-overlay.show { display: flex; }
.of-modal {
  background: #fff;
  border-radius: 10px;
  padding: 22px 24px;
  width: 640px;
  max-width: 92vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.of-modal h3 { margin: 0 0 4px; font-size: 16px; }
.of-modal__sub { color: var(--text-muted); font-size: 12px; margin-bottom: 12px; }
.of-modal__search {
  width: 100%;
  padding: 9px 12px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 10px;
}
.of-modal__search:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.of-modal__results {
  flex: 1;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fafafa;
  min-height: 120px;
}
.of-modal__empty { padding: 32px 16px; text-align: center; color: var(--text-muted); font-size: 12px; }
.of-modal__row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid #ececec;
  cursor: pointer;
  background: #fff;
}
.of-modal__row:hover { background: #fff8e1; }
.of-modal__row:last-child { border-bottom: 0; }
.of-modal__row-main { flex: 1; }
.of-modal__row-main b { font-size: 13px; }
.of-modal__row-main small {
  display: block; color: var(--text-muted); font-size: 10px; margin-top: 2px;
  font-family: Consolas, monospace;
}
.of-modal__row-price { text-align: right; font-variant-numeric: tabular-nums; }
.of-modal__row-price b { color: #d32f2f; font-size: 13px; }
.of-modal__row-price small { display: block; color: var(--text-muted); font-size: 10px; }
.of-modal__actions { margin-top: 12px; text-align: right; display: flex; justify-content: flex-end; gap: 8px; }
.of-modal__actions .btn-cancel { padding: 7px 16px; font-size: 12px; }

/* 상세 모달 내부 표 */
.dt-info { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-bottom: 12px; background: #fff; }
.dt-info th, .dt-info td { border: 1px solid var(--border); padding: 6px 10px; }
.dt-info th { background: var(--bg-main); width: 90px; text-align: center; font-weight: 600; color: var(--text-sub); }
.dt-items { width: 100%; border-collapse: collapse; font-size: 12.5px; background: #fff; }
.dt-items th, .dt-items td { border: 1px solid var(--border); padding: 6px 10px; }
.dt-items thead th { background: var(--bg-main); text-align: center; font-weight: 600; color: var(--text-sub); }
.dt-items td.price { text-align: right; font-variant-numeric: tabular-nums; }
.dt-items td.num { text-align: center; color: var(--text-muted); }
.dt-items tfoot td { font-weight: 700; background: #fafafa; }
.dt-items tfoot td.price b { color: #d32f2f; }

/* ---- 매출&지출 ---- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  max-width: 1080px;
  margin-bottom: 18px;
}
.stat-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
}
.stat-card__label { font-size: 12px; font-weight: 600; color: var(--text-sub); margin-bottom: 6px; }
.stat-card__value { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-card__value small { font-size: 12px; color: var(--text-muted); font-weight: 400; }
.stat-card--sale .stat-card__value { color: var(--accent); }
.stat-card--supply .stat-card__value { color: #b26b00; }
.stat-card--margin .stat-card__value { color: #1e7a3e; }

.sales-toolbar {
  max-width: 1080px;
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.sales-toolbar label { font-size: 12.5px; font-weight: 600; color: var(--text-sub); }
.sales-toolbar select {
  padding: 7px 12px; font-size: 13px;
  border: 1px solid var(--border); border-radius: 6px; background: #fff;
}
.sales-toolbar .hint { font-size: 12px; color: var(--text-muted); }

.sales-table-wrap { max-width: 1080px; overflow-x: auto; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.sales-table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 1000px; }
.sales-table th, .sales-table td { border: 1px solid var(--border); padding: 7px 10px; }
.sales-table thead th { background: var(--bg-main); text-align: center; font-weight: 600; color: var(--text-sub); }
.sales-table tbody tr { background: #fff; }
.sales-table td.price { text-align: right; font-variant-numeric: tabular-nums; }
.sales-table td.num { text-align: center; }
.sales-table td.plus { color: #1e7a3e; font-weight: 700; }
.sales-table td.minus { color: #c62828; font-weight: 700; }
.sales-table tfoot td { font-weight: 700; background: #fafafa; }
.sales-table .empty td { text-align: center; padding: 26px; color: var(--text-muted); font-style: italic; background: #fafafa; }
.status-pill { display: inline-block; padding: 1px 10px; border-radius: 10px; font-size: 11px; font-weight: 700; }
.status-pill--new { background: #fff8e1; color: #a16207; }
.status-pill--exported { background: #e8f5e9; color: #1e7a3e; }

/* ---- 발주서 캡쳐 카드 (원본 po-print 이식) ---- */
.po-print {
  position: fixed; top: 0; left: -10000px;
  width: 690px;
  padding: 18px 24px 16px;
  background: #FFFFFF;
  color: var(--text-main);
  border: 1px solid #E2E8EF;
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 11px;
  line-height: 1.35;
  letter-spacing: 0;
}
.po-print__header {
  position: relative;
  display: flex;
  align-items: center;
  height: 58px;
  margin: 0 0 18px;
  padding: 10px 18px;
  background: #050505;
  border-radius: 8px;
}
.po-print__logo-area { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.po-print__logo-img { height: 38px; width: auto; display: block; }
.po-print__brand-text { color: #FFFFFF; font-size: 18px; font-weight: 700; }
.po-print__title-area { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.po-print__title { padding-left: 18px; color: #FFFFFF; font-size: 26px; font-weight: 700; line-height: 1; letter-spacing: 18px; }
.po-print__card {
  position: relative;
  margin: 0 0 20px;
  padding: 20px 14px 16px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.po-print__card--meta { padding: 8px 14px; }
.po-print__legend {
  position: absolute; top: -13px; left: 10px;
  height: 26px; min-width: 94px;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 0 10px 0 8px;
  background: #FFFFFF; border: 1px solid var(--border); border-radius: 5px;
  color: var(--accent); font-size: 13px; font-weight: 700;
}
.po-print__legend span {
  width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--accent); color: #FFFFFF; font-size: 11px; line-height: 1;
}
.po-print__dual { display: flex; gap: 22px; align-items: stretch; }
.po-print__recv-box {
  flex: 0 0 235px; min-height: 112px;
  display: flex; align-items: center; justify-content: center;
  padding: 12px; background: #FFFFFF; border: 1px solid var(--border-strong);
}
.po-print__recv-row { display: inline-flex; align-items: baseline; gap: 10px; }
.po-print__recv-name {
  color: var(--text-main); border-bottom: 3px solid #19B8B0; padding-bottom: 3px;
  font-size: 18px; font-weight: 700; line-height: 1.1;
}
.po-print__recv-suffix { color: var(--text-sub); font-size: 13px; font-weight: 500; }
.po-print table { border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.po-print__info { flex: 1 1 auto; width: 0; font-size: 10px; border-top: 1px solid var(--border-strong); border-left: 1px solid var(--border-strong); }
.po-print__meta, .po-print__items, .po-print__cust {
  width: 100%; font-size: 10px;
  border-top: 1px solid var(--border-strong); border-left: 1px solid var(--border-strong);
}
.po-print th, .po-print td {
  border: 0 solid var(--border-strong);
  border-right: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
  vertical-align: middle;
  white-space: nowrap;
}
.po-print th { background: var(--bg-main); color: var(--text-sub); text-align: center; font-weight: 600; }
.po-print td { background: #FFFFFF; color: var(--text-main); font-weight: 400; }
.po-print__info th { width: 72px; }
.po-print__info th, .po-print__info td { height: 18px; padding: 2px 8px; }
.po-print__meta th { width: 78px; }
.po-print__meta th, .po-print__meta td { height: 28px; padding: 4px 8px; }
.po-print__ship {
  min-height: 52px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 0 20px; padding: 10px 16px;
  background: #FFF8E1; border: 2px solid #F9A825; border-radius: 8px;
  color: #E65100; font-size: 15px; font-weight: 700; line-height: 1.35;
}
.po-print__ship:empty { display: none; }
.po-print__items th { height: 28px; padding: 4px 8px; }
.po-print__items td { height: 38px; padding: 4px 8px; }
.po-print__items td.num, .po-print__cust td.num { text-align: center; color: var(--text-muted); font-weight: 600; }
.po-print__items td.model { color: var(--text-main); font-size: 13px; font-weight: 700; }
.po-print__items td.qty, .po-print__total-qty {
  text-align: center; color: var(--text-main); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.po-print__items td.price, .po-print__total-price {
  text-align: right; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.po-print__items td.price { color: var(--text-main); }
.po-print td.po-print__total-price, .po-print td.po-print__total-price span { color: #D32F2F; }
.po-print__items td.price small, .po-print__total-price small {
  display: block; margin-top: 2px; color: var(--text-muted); font-size: 9px; font-weight: 400;
}
.po-print__items .note-row td { border-top: none; }
.po-print__items .note-cell { height: auto; padding: 3px 8px 6px; color: var(--text-sub); font-size: 10px; white-space: normal; }
.po-print__total-label { text-align: center; color: var(--text-main); font-size: 12px; font-weight: 700; }
.po-print__cust th, .po-print__cust td { height: 28px; padding: 4px 8px; }
.po-print__cust .cust-label { width: 70px; background: var(--bg-main); color: var(--text-main); text-align: center; font-weight: 600; }
.po-print__cust td:not(.cust-label):not(.num):not(.cust-memo) { white-space: normal; }
.po-print__cust .cust-memo { color: #FF4B4B; font-weight: 700; white-space: pre-wrap; }
.po-print__sign { margin-top: 24px; text-align: right; color: var(--text-main); font-size: 13px; font-weight: 400; }
.po-print__footer { margin-top: 18px; padding-top: 10px; border-top: 1px solid var(--border); text-align: center; color: var(--text-muted); font-size: 10px; }

/* 복사/다운로드 버튼 그룹 (원본) */
.po-download-row {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 14px;
  border-top: 1px dashed var(--border);
}
.po-download-row__label { font-size: 12px; font-weight: 700; color: var(--text-sub); align-self: center; margin-right: 6px; }
.btn-dl {
  padding: 7px 14px; font-size: 12px; font-weight: 600;
  background: var(--bg-main); color: var(--text-main);
  border: 1px solid var(--border); border-radius: 5px;
}
.btn-dl:hover { background: var(--bg-hover); border-color: var(--accent); color: var(--accent); }
.btn-dl:disabled { background: #f0f0f0; color: #aaa; cursor: not-allowed; border-color: #e0e0e0; }
.btn-dl--copy { background: #fff5e5; border-color: #f0a020; color: #875c00; font-weight: 700; }
.btn-dl--copy:hover { background: #f0a020; color: #fff; border-color: #f0a020; }

/* ---- 품목관리 ---- */
.items-toolbar {
  max-width: 1080px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.items-toolbar input[type="text"] {
  flex: 1; min-width: 200px; max-width: 360px;
  padding: 8px 12px; font-size: 13px;
  border: 1px solid var(--border); border-radius: 6px; background: #fff;
}
.items-toolbar input[type="text"]:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 6px 14px; font-size: 12px; font-weight: 600;
  background: var(--bg-elevated); color: var(--text-sub);
  border: 1px solid var(--border); border-radius: 999px;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.items-table-wrap { max-width: 1080px; overflow-x: auto; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.items-table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 760px; }
.items-table th, .items-table td { border: 1px solid var(--border); padding: 7px 10px; }
.items-table thead th { background: var(--bg-main); text-align: center; font-weight: 600; color: var(--text-sub); }
.items-table tbody tr { background: #fff; }
.items-table td.model { font-weight: 700; }
.items-table td.model small { display: block; color: var(--text-muted); font-weight: 400; font-family: Consolas, monospace; font-size: 10.5px; }
.items-table td.price { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; color: #d32f2f; }
.items-table td.spec { color: var(--text-sub); font-size: 11.5px; white-space: normal; }
.items-table .empty td { text-align: center; padding: 26px; color: var(--text-muted); font-style: italic; background: #fafafa; }
.btn-order-item {
  padding: 5px 12px; font-size: 11.5px; font-weight: 700;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid var(--accent); border-radius: 5px; white-space: nowrap;
}
.btn-order-item:hover { background: var(--accent); color: #fff; }

/* ---- 로그인 (톤 동일 카드) ---- */
.login-body {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: var(--bg-main);
}
.login-card {
  width: 100%; max-width: 400px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,.10);
  overflow: hidden;
}
.login-card__head {
  display: flex; align-items: center; gap: 12px;
  background: #000; padding: 20px 26px;
}
.login-card__head img { height: 34px; }
.login-card__head b { color: #fff; font-size: 19px; font-weight: 700; }
.login-card__head span { color: #D1D5DB; font-size: 13px; }
.login-card__body { padding: 26px; }
.login-sub { color: var(--text-sub); font-size: 13.5px; line-height: 1.6; margin-bottom: 18px; }
.login-error {
  background: #ffebee; color: #c62828; border: 1px solid #f3c1c6;
  border-radius: 8px; padding: 9px 12px; font-size: 13px; margin-bottom: 14px;
}
.login-form label { display: block; font-size: 12px; font-weight: 600; color: var(--text-sub); margin-bottom: 14px; }
.login-form input {
  width: 100%; margin-top: 5px; padding: 10px 12px; font-size: 14px;
  border: 1px solid var(--border); border-radius: 6px; background: #fff;
}
.login-form input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.login-form .btn-submit { width: 100%; padding: 12px; font-size: 14px; margin-top: 4px; }
.login-foot { color: var(--text-muted); font-size: 12px; margin-top: 16px; text-align: center; }

/* ---- 모바일 ---- */
@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .app__sidebar { grid-column: 1; grid-row: 3; padding-top: 14px; }
  .app__main { grid-column: 1; grid-row: 2; padding: 20px 14px 40px; }
  .order-header { flex-direction: column; gap: 10px; }
  .order-header__brand { flex: none; }
  .brand__sub { display: none; }
}
@media (max-width: 640px) {
  :root { --header-h: 60px; }
  .app__header { gap: 10px; padding: 0 12px; }
  .mode-btn { padding: 9px 12px; font-size: 13px; }
  .header__seller { padding: 5px 10px; font-size: 12px; }
  .btn-logout { padding: 7px 10px; font-size: 12px; }
  .of-grid { grid-template-columns: 1fr; }
  .page-title { font-size: 24px; }
  .of-section { padding: 12px 12px 14px; }
}

/* ── 공지사항 (ERP → 포털 단방향) — 2026-08-27 ── */
.sp-notices {
  margin: 0 0 16px; padding: 12px 16px;
  background: #FDF9EE; border: 1px solid #E4D6AC; border-radius: 8px;
}
.sp-notices__title { font-size: 13.5px; font-weight: 800; color: #7A6420; margin-bottom: 6px; }
.sp-notice { border-top: 1px dashed #E4D6AC; }
.sp-notice:first-of-type { border-top: 0; }
.sp-notice summary {
  cursor: pointer; padding: 7px 2px; font-size: 13.5px; color: #3D3423;
  display: flex; align-items: center; gap: 8px; list-style: none;
}
.sp-notice summary::-webkit-details-marker { display: none; }
.sp-notice__badge {
  flex: 0 0 auto; font-size: 10.5px; font-weight: 700; padding: 1px 7px;
  border-radius: 9px; background: #EADFBE; color: #7A6420;
}
.sp-notice__badge--mine { background: #DCE9DC; color: #2E5626; }
.sp-notice__date { margin-left: auto; font-size: 11.5px; color: #A5987A; }
.sp-notice__body {
  padding: 2px 2px 10px 34px; font-size: 13px; color: #55503F;
  white-space: pre-wrap; line-height: 1.55;
}

/* 품목별 공지/비고 칸 */
.sp-item-notice { font-size: 12.5px; color: #7A6420; white-space: pre-wrap; }
