@charset "UTF-8";
/* =========================================================
   관리자 화면 (A-01 ~ A-06)
   레이아웃: 왼쪽 사이드바 + 본문. 1024px 이하에서는 사이드바가 서랍 메뉴로 바뀐다
   ========================================================= */

:root {
  --side-w: 248px;
  --side-bg: #1b2746;
  --side-fg: #ffffff;
  --side-sub: rgba(255, 255, 255, .62);
  --side-muted: rgba(255, 255, 255, .4);
  --side-hover: rgba(255, 255, 255, .07);
  --side-active: rgba(255, 255, 255, .12);
  --side-line: rgba(255, 255, 255, .08);
  --memo-bg: #fff9e8; --memo-line: #f6e3a8;
}
:root[data-mode="dark"] { --side-bg: #12161a; --side-line: rgba(255, 255, 255, .06); --memo-bg: rgba(255, 200, 60, .08); --memo-line: rgba(255, 200, 60, .2); }
@media (prefers-color-scheme: dark) {
  :root:not([data-mode="light"]) { --side-bg: #12161a; --side-line: rgba(255, 255, 255, .06); --memo-bg: rgba(255, 200, 60, .08); --memo-line: rgba(255, 200, 60, .2); }
}

/* ---------- 상단 헤더 (고객 헤더 구조 재사용, 네이비 바탕으로 구분) ---------- */
.header.is-admin { background: var(--side-bg); border-bottom-color: var(--side-line); backdrop-filter: none; color: var(--side-fg); }
.header.is-admin .container { max-width: 1440px; padding: 0 36px; gap: 36px; }
.is-admin .logo { white-space: nowrap; }
.is-admin .logo-mark { background: rgba(255, 255, 255, .14); }
.logo-tag { margin-left: 4px; padding: 2px 7px; border-radius: 6px; font-size: 11.5px; font-weight: 700; letter-spacing: 0; color: var(--side-fg); background: rgba(255, 255, 255, .14); }
.is-admin .gnb { align-items: center; }
.is-admin .gnb a { display: inline-flex; align-items: center; gap: 6px; color: var(--side-sub); white-space: nowrap; }
.is-admin .gnb a:hover { background: var(--side-hover); color: var(--side-fg); }
.is-admin .gnb a.is-active { background: var(--side-active); color: var(--side-fg); }
.gnb-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 800; background: var(--cta); color: #fff; }
.gnb-sep { width: 1px; height: 18px; margin: 0 8px; background: rgba(255, 255, 255, .18); }
.is-admin .user-btn:hover, .is-admin .user-menu.is-open .user-btn { background: var(--side-hover); }
.is-admin .user-btn .avatar { background: rgba(255, 255, 255, .14); color: #fff; }
.is-admin .user-text .company, .is-admin .user-btn .chevron { color: var(--side-muted); }
.is-admin .user-text .name { color: var(--side-fg); }
.is-admin .user-dropdown { color: var(--text); }
.is-admin .menu-toggle { color: var(--side-fg); }

/* ---------- 푸터 (관리자: 한 줄로 가볍게) ---------- */
.adm-footer { border-top: 1px solid var(--border); }
.adm-footer-in { max-width: 1440px; margin: 0 auto; padding: 18px 36px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-muted); }
.adm-footer nav { display: flex; gap: 16px; }
.adm-footer a:hover { color: var(--text); }
@media (max-width: 768px) { .adm-footer-in { padding: 16px; flex-direction: column; } }

/* ---------- 본문 ---------- */
.adm-content { flex: 1; width: 100%; max-width: 1440px; margin: 0 auto; padding: 28px 36px 48px; }
.adm-content .page-head { margin-bottom: 20px; }
.adm-content .page-head h1 { font-size: 24px; }
.head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.updated { font-size: 12.5px; color: var(--text-muted); }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 12px; }
.panel-head h2 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.panel-head h2 .num { font-size: 13px; font-weight: 700; color: var(--text-muted); }
.panel-body { padding: 4px 22px 20px; }

/* ---------- A-01 대시보드 ---------- */
/* 대시보드 지표: 두 묶음 카드, 안쪽은 구분선 */
.dash-head { align-items: center; }
/* 대시보드 인사 영역 (고객 C-01 hero와 같은 톤) */
.dash-hero {
  position: relative; overflow: hidden; margin-bottom: 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 30px 36px; border-radius: 24px;
  background: radial-gradient(600px 240px at 100% 0%, var(--hero-glow), transparent 60%), var(--hero-grad);
  border: 1px solid var(--primary-line);
}
.dh-eyebrow { font-size: 14px; font-weight: 600; color: var(--primary); margin-bottom: 6px; }
.dash-hero h1 { font-size: 26px; font-weight: 800; line-height: 1.35; letter-spacing: -.03em; }
.dash-hero h1 em { font-style: normal; color: var(--cta); }
.dh-sub { margin-top: 8px; font-size: 14.5px; color: var(--text-sub); }
.dh-scope { margin-top: 4px; font-size: 13px; color: var(--text-muted); }
.dh-side { display: flex; flex-direction: column; align-items: flex-end; gap: 14px; }
.dh-side .btn-lg { gap: 6px; box-shadow: 0 8px 20px rgba(var(--cta-rgb), .28); }
.dh-side .head-actions { gap: 14px; }
.dh-side .segment { background: color-mix(in srgb, var(--surface) 70%, transparent); }
.dash-head .head-actions { gap: 14px; }
.refresh { display: flex; align-items: center; gap: 10px; padding-left: 14px; border-left: 1px solid var(--border); }
.segment-sm span { height: 34px !important; padding: 0 14px !important; font-size: 13.5px !important; }
.switch-sm { font-size: 13px; color: var(--text-sub); }
.kpi-band { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 3fr); gap: 16px; margin-bottom: 20px; }
.kpi-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.kpi-group > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 20px 0; }
.kpi-group h2 { font-size: 14px; font-weight: 700; }
.kpi-group > header span { font-size: 12.5px; color: var(--text-muted); }
.kpi-group > header a { display: inline-flex; align-items: center; gap: 2px; font-size: 12.5px; color: var(--text-muted); }
.kpi-group > header a:hover { color: var(--primary); }
.kpi-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); padding: 6px 8px 8px; }
.kpi { position: relative; display: block; padding: 12px 12px 12px; border-radius: 12px; color: var(--text); }
.kpi + .kpi::before { content: ""; position: absolute; left: -1px; top: 16px; bottom: 16px; width: 1px; background: var(--border); }
.kpi:hover { background: var(--bg); }
.kpi:hover::before, .kpi:hover + .kpi::before { opacity: 0; }
.kpi-label { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--text-sub); white-space: nowrap; }
.kpi-label i { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--text-muted)); }
.kpi-value { margin-top: 6px; font-size: 28px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; font-feature-settings: "tnum"; }
.kpi-value small { font-size: 13px; font-weight: 600; color: var(--text-muted); margin-left: 2px; }
.kpi-sub { margin-top: 4px; font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.st-10 { --c: var(--st-10); } .kpi.st-20 { --c: var(--st-20); } .kpi.st-30 { --c: var(--st-30); } .kpi.st-40 { --c: var(--st-40); }
.kpi.is-today { --c: var(--cta); }
.kpi.is-danger { --c: var(--st-90); }
.kpi.is-danger .kpi-value { color: var(--st-90); }
.kpi.is-mine { --c: var(--primary); }
.kpi.is-mine .kpi-value { color: var(--primary); }
.kpi-group.is-alert { background: linear-gradient(180deg, color-mix(in srgb, var(--st-90) 4%, var(--surface)), var(--surface) 60%); }

.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }  /* 아래 2단과 세로 경계를 맞춘다 */
.mini-list li + li { border-top: 1px solid var(--border); }
.mini-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 12px 10px; margin: 0 -10px; border-radius: 10px; cursor: pointer; transition: background .12s; }
.mini-item:hover { background: var(--primary-softer); }
.mini-meta { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-muted); min-width: 0; }
.mini-meta .co { font-weight: 600; color: var(--text-sub); }
.mini-title { grid-column: 1; font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-item.is-new .mini-title::before { content: "NEW"; display: inline-block; margin-right: 6px; padding: 0 5px; border-radius: 4px; font-size: 10.5px; font-weight: 800; line-height: 18px; vertical-align: 1px; color: #fff; background: var(--cta); }
.mini-side { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 12.5px; color: var(--text-muted); white-space: nowrap; }
.dday { font-size: 12px; font-weight: 800; color: var(--st-90); background: var(--st-90-bg); padding: 2px 7px; border-radius: 6px; }

.load-bar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--bg); min-width: 120px; }
.load-bar span { display: block; height: 100%; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 8px; height: 8px; border-radius: 2px; }

/* ---------- 데이터 표 (관리자 공통) ---------- */
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th {
  padding: 10px 12px; text-align: left; white-space: nowrap;
  font-size: 12.5px; font-weight: 600; color: var(--text-muted);
  background: var(--bg); border-bottom: 1px solid var(--border);
}
.data-table th.num, .data-table td.num { text-align: right; }
.data-table th.ctr, .data-table td.ctr { text-align: center; }
.data-table th:first-child, .data-table td:first-child { padding-left: 22px; }
.data-table th:last-child, .data-table td:last-child { padding-right: 22px; }
.data-table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr[data-href] { cursor: pointer; }
.data-table tbody tr:hover { background: var(--primary-softer); }
.data-table .t-title { white-space: normal; min-width: 200px; font-weight: 600; color: var(--text); }
.data-table .t-sub { color: var(--text-sub); }
.data-table .t-mute { color: var(--text-muted); font-size: 12.5px; font-feature-settings: "tnum"; }
.data-table .t-late { color: var(--st-90); font-weight: 700; }
.data-table a.t-link { font-weight: 700; color: var(--text); }
.data-table a.t-link:hover { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.data-table a.t-num { display: inline-block; min-width: 28px; padding: 2px 8px; border-radius: 6px; font-weight: 700; color: var(--text); font-feature-settings: "tnum"; }
.data-table a.t-num:hover { background: var(--primary-soft); color: var(--primary); }
.data-table a.t-num.is-zero { color: var(--text-disabled); }
.data-table a.t-num.is-danger { color: var(--st-90); }
.data-table tr.is-unread td { background: color-mix(in srgb, var(--cta) 5%, transparent); }
.data-table tr.is-unread .t-title::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--cta); vertical-align: 2px; }
.table-scroll { overflow-x: auto; }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 22px; border-top: 1px solid var(--border); }
.table-foot .pagination { margin: 0; }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; font-weight: 700; letter-spacing: .02em; padding: 2px 7px; border-radius: 6px; background: var(--bg); color: var(--text-sub); }
.yn { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; }
.yn::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--st-50); }
.yn.is-n { color: var(--text-muted); }
.yn.is-n::before { background: var(--text-disabled); }
.role { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 6px; font-size: 12px; font-weight: 700; }
.role.r-01 { color: var(--text-sub); background: var(--bg); }
.role.r-02 { color: var(--st-30); background: var(--st-30-bg); }
.role.r-03 { color: #fff; background: var(--primary); }
.lock { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 700; color: var(--st-90); }
.mgr-parts { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--text-sub); }
.mgr-parts > div { display: inline-flex; align-items: center; gap: 6px; }
.mgr-names { display: inline-flex; gap: 6px; }
.mgr-names .is-def { display: inline-flex; align-items: center; gap: 2px; font-weight: 700; color: var(--text); }
.mgr-names .is-def svg { color: var(--st-40); }
.th-help { margin-left: 4px; font-weight: 500; color: var(--st-40); }
.com-table { table-layout: fixed; min-width: 980px; }
.com-table td, .com-table th { overflow: hidden; text-overflow: ellipsis; }
.data-table th.t-c, .data-table td.t-c { text-align: center; }
/* A-05 사용자 표: 이름(굵게)+아이디 / 짧은 값 가운데 */
.user-table { table-layout: fixed; min-width: 900px; }
.user-table .t-user { display: flex; flex-direction: column; gap: 2px; }
.user-table .t-user a { font-weight: 700; }
.user-table .t-user small { font-size: 12.5px; color: var(--text-muted); font-feature-settings: "tnum"; }
.user-table td.t-c .role { min-width: 56px; justify-content: center; }
.user-table td .chip { min-width: 52px; justify-content: center; }
.user-table td.t-mute { font-feature-settings: "tnum"; }
.th-part { white-space: nowrap; }
.th-part .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.dot.part-01 { background: var(--part-01); } .dot.part-02 { background: var(--part-02); } .dot.part-99 { background: var(--part-99); }
.mgr-def { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; color: var(--text); }
.mgr-def svg { color: var(--st-40); }
.mgr-more { margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--text-sub); background: var(--bg); border: 1px solid var(--border); cursor: help; }
.mgr-empty { font-size: 13px; color: var(--text-disabled, var(--text-muted)); }
.th-legend { font-size: 12.5px; color: var(--text-muted); }
.th-legend b { color: var(--st-40); font-weight: 700; }
.mgr-edit { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; }
.mgr-line { display: flex; align-items: center; gap: 10px; padding: 8px 12px; }
.mgr-line + .mgr-line { border-top: 1px solid var(--border); }
.mgr-line > .chip { flex: 0 0 52px; justify-content: center; }
.mgr-tags { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.mgr-tag { display: inline-flex; align-items: center; height: 32px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); }
.mgr-tag .mt-name { display: inline-flex; align-items: center; gap: 4px; height: 100%; padding: 0 4px 0 10px; border: 0; background: none; font: inherit; font-size: 13.5px; color: var(--text-sub); cursor: pointer; }
.mgr-tag .mt-name svg { color: var(--border-strong); }
.mgr-tag .mt-name:hover svg { color: var(--st-40); }
.mgr-tag.is-def { border-color: color-mix(in srgb, var(--st-40) 45%, transparent); background: var(--st-40-bg); }
.mgr-tag.is-def .mt-name { font-weight: 700; color: var(--text); cursor: default; }
.mgr-tag.is-def .mt-name svg { color: var(--st-40); }
.mgr-tag .mt-x { display: grid; place-items: center; width: 26px; height: 100%; border: 0; background: none; color: var(--text-muted); cursor: pointer; border-radius: 0 8px 8px 0; }
.mgr-tag .mt-x:hover { color: var(--st-90); }
.mgr-none { font-size: 13px; color: var(--text-muted); }
.mgr-add { flex: 0 0 104px; }
.mgr-chips { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; color: var(--text-sub); }
.mgr-chips span { display: inline-flex; align-items: center; gap: 4px; }
.mgr-chips .empty-v { color: var(--text-disabled); }

/* ---------- 필터 ---------- */
.filter { padding: 16px 22px; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; align-items: end; }
.filter .f-wide { grid-column: span 2; }
.filter .f-label { display: block; margin-bottom: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.filter .date-range .input { width: 100%; }
.filter-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 22px; border-top: 1px solid var(--border); background: var(--bg); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.filter-foot .checks { display: flex; gap: 18px; flex-wrap: wrap; }
.filter-foot .btns { display: flex; gap: 8px; }
.filter-toggle-m { display: none; }
/* 검색어 입력 즉시 걸러지는 간단 필터: 한 줄, 왼쪽 정렬 */
.filter.is-inline { display: flex; flex-wrap: wrap; align-items: flex-end; }
.filter.is-inline > * { flex: 0 0 170px; }
.filter.is-inline > .f-wide { flex: 0 1 380px; min-width: 240px; }
.filter.is-inline .f-btns { flex: 0 0 auto; display: flex; gap: 6px; margin-left: auto; }  /* 검색 버튼은 항상 오른쪽 끝 */
.f-btns .btn { height: 40px; }
.f-btns .f-reset { width: 40px; padding: 0; flex-shrink: 0; }
.f-btns .f-go { padding: 0 22px; }
.filter.is-inline .f-wide { grid-column: auto; }

/* ---------- 탭(밑줄형) ---------- */
.utabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); padding: 0 22px; overflow-x: auto; scrollbar-width: none; }
.utabs::-webkit-scrollbar { display: none; }
.utab { position: relative; height: 48px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.utab:hover { color: var(--text); }
.utab.is-active { color: var(--text); }
.utab.is-active::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--primary); }
.utab .cnt { font-size: 12px; color: var(--text-muted); font-weight: 700; }

/* ---------- A-03 처리 패널 ---------- */
.proc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.proc-side { position: sticky; top: calc(var(--header-h) + 16px); display: flex; flex-direction: column; gap: 16px; }
.status-now { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.status-now span:first-child { font-size: 13px; color: var(--text-muted); }
.next-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.next-btns .btn { height: 46px; font-size: 14.5px; }
.next-btns .btn:only-child { grid-column: span 2; }
.btn-danger-line { background: var(--surface); border: 1px solid var(--st-90-bg); color: var(--st-90); }
.btn-danger-line:hover { background: var(--st-90-bg); }
.next-help { margin-top: 10px; font-size: 12.5px; color: var(--text-muted); }
.proc-form .field + .field { margin-top: 14px; }
.proc-form .label { font-size: 13px; }
.proc-form .row-2 > .field + .field, .modal-body .row-2 > .field + .field { margin-top: 0; }
.proc-form .row-2 + .field, .proc-form .field + .row-2, .proc-form .row-2 + .row-2 { margin-top: 14px; }
/* 표 첫 칸(m-head)의 칩·뱃지는 모바일 카드에서만 */
.data-table td.m-head > :not(:first-child) { display: none; }
.proc-form .btn-save { width: 100%; height: 44px; margin-top: 16px; }
.input-unit { position: relative; }
.input-unit .input { padding-right: 44px; }
.input-unit span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 13px; color: var(--text-muted); }
.kv { display: grid; grid-template-columns: 76px 1fr; gap: 8px 12px; font-size: 13.5px; }
.kv dt { color: var(--text-muted); }
.kv dd { font-weight: 600; }
.kv dd a { color: var(--primary); }

.memo { padding: 12px 14px; border-radius: 12px; background: var(--memo-bg); border: 1px solid var(--memo-line); }
.memo + .memo { margin-top: 10px; }
.memo .comment-meta b { font-size: 13.5px; }
.memo .comment-text { margin-top: 4px; font-size: 14px; }
.memo-note { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; font-size: 12.5px; color: var(--text-muted); }

/* ---------- A-06 코드 관리 ---------- */
.code-table td { padding-top: 8px; padding-bottom: 8px; vertical-align: middle; }
.code-table .check { vertical-align: middle; }
.code-table .input, .code-table .select { height: 38px; font-size: 13.5px; border-radius: 9px; }
.code-table .c-code { width: 110px; }
.code-table .c-ord { width: 100px; }
.code-table tr.is-new td { background: color-mix(in srgb, var(--st-50) 6%, transparent); }
.code-table tr.is-changed td:first-child { box-shadow: inset 3px 0 0 var(--cta); }
.code-table tr.is-off td:not(:last-child) { opacity: .5; }
.save-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 22px; border-top: 1px solid var(--border); }
.save-bar .changed { font-size: 13px; color: var(--text-muted); }
.save-bar .changed b { color: var(--cta); }
.add-row { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; height: 44px; border-top: 1px dashed var(--border-strong); font-size: 14px; font-weight: 600; color: var(--text-sub); }
.add-row:hover { color: var(--primary); background: var(--primary-softer); }

.dash-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.mini-side .wait { font-weight: 700; color: var(--st-40); }
.panel-note { margin: 10px 0 2px; padding: 10px 12px; border-radius: 10px; font-size: 12.5px; line-height: 1.55; color: var(--text-muted); background: var(--bg); }

/* A-02 상태 탭 + 빠른 토글 */
.tab-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.tab-line .tabs { margin: 0; }
.quick-toggles { display: flex; gap: 6px; flex-shrink: 0; }
.qt { position: relative; }
.qt input { position: absolute; opacity: 0; pointer-events: none; }
.qt span { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 13.5px; font-weight: 600; color: var(--text-sub); cursor: pointer; }
.qt span::before { content: ""; width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid var(--border-strong); box-sizing: border-box; }
.qt input:checked + span { border-color: var(--primary); color: var(--primary); background: var(--primary-softer); }
.qt input:checked + span::before { border-color: var(--primary); background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 10px no-repeat; }
.qt input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

/* A-02 검색 줄 */
.filter-bar { margin-bottom: 16px; padding: 12px; }
.fb-line { display: flex; align-items: center; gap: 8px; }
.fb-kw { flex: 1 1 200px; min-width: 160px; }
.fb-sel { flex: 0 0 124px; }
.fb-date { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; }
.fb-date .input { width: 152px; }
.fb-more { flex-shrink: 0; height: 40px; gap: 4px; }
.fb-more.is-on { border-color: var(--primary); color: var(--primary); }
.fb-cnt { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; font-size: 11px; color: #fff; background: var(--primary); }
.fb-go { flex-shrink: 0; height: 40px; padding: 0 20px; }
.fb-detail { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.fb-reset { margin-left: auto; height: 38px; color: var(--text-muted); }
@media (max-width: 1400px) {
  .fb-line { flex-wrap: wrap; }
  .fb-kw { flex-basis: 260px; }
  .tab-line { flex-wrap: wrap; }
}
@media (max-width: 1200px) {
  .dash-head { flex-direction: column; align-items: flex-start; }
}

/* A-02 요청 표: 고객사+번호 / 파트 / 제목+부가정보 / 짧은 값은 가운데 정렬 */
.req-grid { table-layout: fixed; min-width: 1080px; }
.req-grid td { vertical-align: middle; }
.req-grid .t-no { display: flex; flex-direction: column; gap: 3px; }
.req-grid .t-no small { order: -1; font-size: 14px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.req-grid .t-no span { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-muted); font-feature-settings: "tnum"; letter-spacing: .01em; }
.req-grid tr.is-unread .t-no span::before { content: "NEW"; padding: 0 4px; border-radius: 4px; font-size: 9.5px; font-weight: 800; line-height: 15px; letter-spacing: .02em; color: #fff; background: var(--cta); }
.req-grid .tt { display: flex; align-items: center; gap: 6px; min-width: 0; }
.req-grid .tt b { font-size: 14.5px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.req-grid .tt .chip { display: none; }  /* PC는 파트 열에 따로 */
.req-grid .tt .tag-urgent { flex-shrink: 0; margin: 0; }
.req-grid .t-meta { display: flex; gap: 10px; margin-top: 5px; font-size: 12.5px; font-weight: 400; color: var(--text-muted); }
.req-grid .t-meta .ic { display: inline-flex; align-items: center; gap: 3px; }
.req-grid tr.is-unread .t-title::before { display: none; }
.req-grid .t-date { font-size: 13px; color: var(--text-sub); font-feature-settings: "tnum"; }
.req-grid .t-date small { display: block; margin-top: 2px; font-size: 11.5px; color: var(--text-muted); }
.req-grid td.t-c { font-size: 13.5px; }
.req-grid td.t-late .tag-late { display: table; margin: 3px auto 0; }  /* D+N은 날짜 아래에 두어 열 가운데가 흔들리지 않게 */
.req-grid td.t-c .badge { min-width: 76px; justify-content: center; }  /* 상태 배지 폭 통일 */
.req-grid td.t-c .chip { min-width: 52px; justify-content: center; }
.t-none { font-size: 13px; color: var(--text-disabled, var(--text-muted)); }

/* A-06 코드 그룹 */
.code-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.code-layout > * { min-width: 0; }
.code-groups { position: sticky; top: calc(var(--header-h) + 16px); }
.grp-list { list-style: none; margin: 0; padding: 0 10px 12px; }
.grp-list button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 12px;
  border: 0; border-radius: 10px; background: none; cursor: pointer;
  font: inherit; font-size: 14px; color: var(--text-sub); text-align: left;
}
.grp-list button:hover { background: var(--bg); color: var(--text); }
.grp-list button.is-active { background: var(--primary-softer); color: var(--primary); font-weight: 700; }
.grp-list .mono { font-size: 11.5px; }
.input.mono { padding: 0 12px; border-radius: 10px; background: var(--surface); color: var(--text); font-weight: 600; }  /* 입력칸에 붙은 mono는 글꼴만 */
.grp-list .n { margin-left: auto; font-size: 12px; color: var(--text-muted); font-weight: 500; }
.code-table .grip { color: var(--text-disabled); cursor: grab; text-align: center; }
.icon-btn { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--text-muted); cursor: pointer; }
.icon-btn:hover { background: var(--bg); color: var(--st-90); }
.add-row { border-left: 0; border-right: 0; border-bottom: 0; background: none; cursor: pointer; }

.code-groups .panel-head { display: flex; align-items: center; justify-content: space-between; }
.grp-add { height: 32px; padding: 0 10px; gap: 4px; font-size: 13px; }
.grp-list .off { font-size: 11px; font-weight: 600; color: var(--text-muted); border: 1px solid var(--border); border-radius: 5px; padding: 0 5px; }
.grp-edit { display: inline-grid; width: 30px; height: 30px; margin-left: 2px; vertical-align: middle; }
.grp-edit:hover { color: var(--primary); }
#grpOff { margin-left: 6px; font-size: 12px; vertical-align: middle; }
.code-empty { padding: 28px 22px; text-align: center; font-size: 14px; color: var(--text-muted); }

/* 모달 폼 */
.modal-lg .modal-box { max-width: 680px; }
.row-3 { display: grid; grid-template-columns: 1.3fr 1fr 1.2fr; gap: 12px; }
.row-3 > .field + .field, .modal-body .row-3 > .field + .field { margin-top: 0; }
.modal-body .row-3 + .field { margin-top: 16px; }
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.label-link { font-size: 12.5px; font-weight: 600; color: var(--primary); white-space: nowrap; }
.label-link:hover { text-decoration: underline; }
.foot-switch { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.foot-switch b { display: block; font-size: 14px; }
.foot-switch small { display: block; font-size: 12px; color: var(--text-muted); }
.modal-body .row-2 + .row-2, .modal-body .row-2 + .field, .modal-body .field + .row-2 { margin-top: 16px; }
.modal-body .field + .field { margin-top: 16px; }
.input-with-btn { display: flex; gap: 8px; }
.input-with-btn .input { flex: 1; }
.input-with-btn .btn { height: 48px; flex-shrink: 0; }
.ok-msg { font-size: 13px; color: var(--st-50); }
.modal-foot.is-split { justify-content: space-between; }
.modal-foot.is-split .left { display: flex; gap: 8px; }
.modal-foot.is-split .btn { flex: 0 0 auto; padding: 0 18px; }

/* ---------- 반응형 ---------- */
@media (max-width: 1400px) {
  .kpi-band { grid-template-columns: 1fr; }
}
@media (max-width: 1200px) {
  .proc-layout { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 1180px) {
  .header.is-admin .container { gap: 20px; padding: 0 20px; }
  .is-admin .user-text { display: none; }
  .is-admin .gnb a { padding: 8px 10px; }
}
@media (max-width: 1024px) {
  .adm-content { padding: 24px 20px 40px; }
  .dash-grid, .proc-layout { grid-template-columns: 1fr; }
  .proc-side { position: static; }
  /* 모바일·태블릿: 제목 → 상태 처리 → 처리 정보 → 요청 내용 순 */
  .proc-layout { display: flex; flex-direction: column; align-items: stretch; gap: 16px; }
  .proc-layout > .detail-main, .proc-layout > .proc-side { display: contents; }
  .proc-layout .detail-head { order: -3; }
  .proc-side > .panel:nth-child(1) { order: -2; }
  .proc-side > .panel:nth-child(2) { order: -1; }
}
@media (max-width: 768px) {
  .header.is-admin .container { padding: 0 16px; }
  .is-admin .header-panel { color: var(--text); }
  .is-admin .gnb { align-items: stretch; }
  .is-admin .gnb a { color: var(--text-sub); padding: 12px; }
  .is-admin .gnb a:hover { background: var(--bg); color: var(--text); }
  .is-admin .gnb a.is-active { background: var(--primary-softer); color: var(--primary); }
  .gnb-sep { width: auto; height: 1px; margin: 6px 0; background: var(--border); }
  .is-admin .gnb a .gnb-count { margin-left: auto; }
  .adm-content { padding: 18px 16px 32px; }
  .dash-head .head-actions { flex-direction: column; align-items: stretch; gap: 10px; }
  .dash-head { align-items: stretch; }
  .dash-hero { flex-direction: column; align-items: stretch; padding: 24px 20px; border-radius: 20px; }
  .dash-hero h1 { font-size: 21px; }
  .dh-side { align-items: stretch; }
  .dh-side .btn-lg { justify-content: center; }
  .dh-side .head-actions { flex-direction: column; align-items: stretch; gap: 10px; }
  .dh-side .segment { display: flex; width: 100%; } .dh-side .segment label { flex: 1; } .dh-side .segment span { width: 100%; justify-content: center; }
  .dash-head .segment { display: flex; width: 100%; } .dash-head .segment label { flex: 1; } .dash-head .segment span { width: 100%; justify-content: center; }
  .refresh { border-left: 0; padding-left: 0; justify-content: space-between; }
  .kpi-row { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-group.is-alert .kpi-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi { padding: 10px; }
  .kpi + .kpi::before { display: none; }
  .kpi-value { font-size: 22px; }
  .kpi-label { font-size: 12.5px; }
  .panel-head { padding: 16px 16px 10px; }
  .panel-body { padding: 4px 16px 16px; }
  .utabs { padding: 0 8px; }

  /* 필터: 키워드 + 필터 버튼, 나머지는 펼쳐서 */
  .filter { grid-template-columns: 1fr; padding: 14px 16px; }
  .filter .f-wide { grid-column: auto; }
  .filter.is-inline { display: grid; grid-template-columns: 1fr 1fr; }
  .filter.is-inline > .f-wide { min-width: 0; }
  .filter.is-inline .f-btns { grid-column: 1 / -1; }
  .f-btns .f-go { flex: 1; }
  .filter.is-inline .f-wide { grid-column: 1 / -1; }
  .filter .f-more { display: none; }
  .filter.is-open .f-more { display: block; }
  .filter-toggle-m { display: inline-flex; }
  .filter-foot { padding: 12px 16px; }
  .filter-foot .btns { width: 100%; }
  .filter-foot .btns .btn { flex: 1; }

  /* 검색 줄: 검색어 + 상세 + 검색, 나머지는 상세를 누르면 펼침 */
  .tab-line { flex-direction: column; align-items: stretch; min-width: 0; }
  .tab-line > * { min-width: 0; max-width: 100%; }
  .tab-line .tabs { overflow-x: auto; flex-wrap: nowrap; }
  .quick-toggles .qt { flex: 1 1 0; display: flex; min-width: 0; } .qt span { width: 100%; justify-content: center; }
  .fb-date .cdate { flex: 1; min-width: 0; }
  .fb-line { flex-wrap: wrap; }
  .fb-kw { flex: 1 1 calc(100% - 170px); min-width: 0; order: 0; }
  .fb-more { order: 1; padding: 0 10px; }
  .fb-go { order: 2; padding: 0 14px; }
  .fb-line .fb-m { order: 3; display: none; }
  .filter-bar.is-open .fb-line .fb-m { display: flex; }
  .filter-bar.is-open .fb-sel.fb-m { display: block; flex: 1 1 calc(50% - 4px); }
  .filter-bar.is-open .fb-date { flex: 1 1 100%; }
  .fb-date .input { flex: 1; width: auto; min-width: 0; }
  .fb-detail { flex-wrap: wrap; }
  .fb-detail .fb-sel { flex: 1 1 calc(50% - 4px); }
  .fb-reset { width: 100%; margin: 0; }
  /* 표 → 카드: td의 data-label을 왼쪽 제목으로 */
  .data-table thead { display: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; }
  .data-table tr { padding: 14px 16px; border-bottom: 1px solid var(--border); }
  .data-table tbody tr:last-child { border-bottom: 0; }
  .data-table td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0 !important; border: 0; white-space: normal; text-align: right !important; }
  .data-table td[data-label] { justify-content: flex-end; }
  .data-table td[data-label]::before { margin-right: auto; content: attr(data-label); flex-shrink: 0; font-size: 12.5px; color: var(--text-muted); text-align: left; }
  .data-table td.m-head { display: flex; justify-content: flex-start; gap: 8px; flex-wrap: wrap; text-align: left !important; }
  .data-table td.m-head::before { display: none; }
  .data-table td.m-head > :not(:first-child) { display: inline-flex; }
  .data-table td.m-head > .badge { margin-left: auto; }
  .req-grid .t-no small { font-size: 13px; }
  .req-grid { min-width: 0; table-layout: auto; }
  .req-grid colgroup { display: none; }
  .req-grid .tt .chip { display: inline-flex; }
  .req-grid .t-date small { display: inline; margin: 0 0 0 4px; }
  .req-grid .t-no { flex-direction: row; }
  .req-grid .t-no small { order: 0; }
  .req-grid .t-title { min-width: 0; }
  .req-grid .tt { flex-wrap: wrap; }
  .req-grid .tt b { white-space: normal; flex-basis: 100%; font-size: 15px; }
  .req-grid tr { display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; }
  .req-grid td.m-head, .req-grid td.t-title { grid-column: 1 / -1; }
  .req-grid td[data-label] { font-size: 13px; }
  .proc-form .row-2 > .field + .field, .modal-body .row-2 > .field + .field { margin-top: 14px; }
  .data-table td.t-title { display: block; min-width: 0; padding: 4px 0 8px !important; font-size: 15px; text-align: left !important; }
  .data-table td.t-title::before { display: none; }
  .data-table td.m-hide { display: none; }
  .data-table tr.is-unread td { background: none; }
  .table-foot { flex-direction: column; padding: 14px 16px; }
  /* 코드 표는 카드로 바꾸지 않고 가로 스크롤 */
  .data-table.code-table { display: table; min-width: 560px; }
  .data-table.code-table thead { display: table-header-group; }
  .data-table.code-table tbody { display: table-row-group; }
  .data-table.code-table tr { display: table-row; padding: 0; }
  .data-table.code-table td { display: table-cell; padding: 8px 10px !important; text-align: left !important; border-bottom: 1px solid var(--border); }
  .code-layout { grid-template-columns: minmax(0, 1fr); }
  .code-groups { position: static; }
  .code-layout .panel-head { flex-wrap: wrap; }
  #grpRmk { flex-basis: 100%; }
  .grp-list { display: flex; overflow-x: auto; gap: 6px; padding: 0 16px 14px; max-width: 100%; scrollbar-width: none; }
  .grp-list li { flex-shrink: 0; }
  .grp-list button { white-space: nowrap; width: auto; border: 1px solid var(--border); }
  .grp-list button .n { display: none; }
  .mgr-line { flex-wrap: wrap; }
  .mgr-add { flex: 1 1 100%; }
  .com-table { min-width: 0; table-layout: auto; }
  .user-table { min-width: 0; table-layout: auto; }
  .user-table colgroup { display: none; }
  .user-table .t-user { flex-direction: row; align-items: baseline; gap: 8px; }
  .com-table td { overflow: visible; }
  .com-table colgroup { display: none; }
  .panel-head:has(.th-legend) { flex-wrap: wrap; }
  .th-legend { flex-basis: 100%; }
  .row-3 { grid-template-columns: 1fr 1fr; gap: 14px 12px; }
  .row-3 > .field:first-child { grid-column: 1 / -1; }
  .modal-foot.is-split .foot-switch { order: 1; padding-bottom: 4px; }  /* 세로로 쌓일 때 버튼 위로 */
  .mgr-parts { flex-direction: column; align-items: flex-end; }

  .next-btns .btn { height: 50px; }
  .modal-foot.is-split { flex-direction: column-reverse; }
  .modal-foot.is-split .left { width: 100%; }
  .modal-foot.is-split .left .btn, .modal-foot.is-split > .btn { flex: 1; width: 100%; }
  .input-with-btn .btn { height: 48px; }
}
