/* ==========================================================================
   AKP One — 화면 스타일
   같은 의미는 어느 화면에서나 같은 색: 선적항=navy, 하역항=ochre, 예측=gray
   ========================================================================== */
:root {
  --bg: #F4F4F1;
  --surface: #FFFFFF;
  --surface-2: #F8F8F6;
  --ink: #17212C;
  --ink-2: #47525E;
  --muted: #69717C;     /* 흰 바탕 대비 4.8:1 (예전 #858D97은 3.4:1로 흐림) */
  --line: #E3E3DE;
  --line-2: #D2D2CB;
  --head: #14202E;
  --head-2: #1E2D3F;
  --head-ink: #E8ECF1;
  --head-muted: #8E9BAB;

  --load: #1C3557;      /* 선적항 · 실적 */
  --dis: #B8862F;       /* 하역항 */
  --pred: #9AA3AD;      /* 예측 */
  --plan: #CDD2D8;      /* 계획 */
  --neg: #A63A32;       /* 음수 · 이탈 */
  --pos: #2F6F4F;       /* OK */
  --lim: #B8862F;       /* Limonite */
  --sap: #4E7A5A;       /* Saprolite */
  --accent: #1C3557;

  --r: 6px;
  --font: "Pretendard Variable", Pretendard, "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 14px/1.5 var(--font); letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
.num, td.n, .kpi-v { font-variant-numeric: tabular-nums; }

/* ---------- 상단 ---------- */
.top { background: var(--head); color: var(--head-ink); position: sticky; top: 0; z-index: 20; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 56px; padding: 0 20px 0 24px; }
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; min-width: 0; }
.mark { width: 20px; height: 20px; color: #E9C987; align-self: center; flex: none; }
.brand-name { font-weight: 650; font-size: 16px; letter-spacing: -0.01em; white-space: nowrap; }
.top-tools { display: flex; align-items: center; gap: 6px; }
.source { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; font-size: 12.5px; color: var(--ink); min-width: 0; padding: 4px 0; }
.source[hidden] { display: none; }
.top-tools { min-width: 0; }
.source #stock-name, .source #source-name { flex: 1 1 200px; min-width: 0; word-break: break-all; }
.source-time { color: var(--muted); white-space: nowrap; }
.src-tag { font-size: 12px; color: var(--muted); font-weight: 600; min-width: 28px; }
.panel code { font-size: 12px; background: var(--surface-2); padding: 0 4px; border-radius: 3px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #6FAE86; flex: none; }
.dot.upload { background: #E9C987; }
.dot.err { background: #E07A6F; }
.lang { display: inline-flex; border: 1px solid #2C3D52; border-radius: 999px; padding: 2px; margin: 0 2px; }
.lang button { height: 24px; min-width: 32px; padding: 0 8px; border: 0; border-radius: 999px; background: transparent;
  color: var(--head-muted); font-size: 12px; font-weight: 650; letter-spacing: .04em; cursor: pointer; }
.lang button:hover { color: var(--head-ink); }
.lang button.on { background: var(--head-ink); color: var(--head); }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r);
  border: 0; background: transparent; color: var(--head-ink); cursor: pointer; }
.icon-btn:hover { background: var(--head-2); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.sm { width: 28px; height: 28px; color: var(--ink-2); }
.icon-btn.sm:hover { background: var(--surface-2); }
.icon-btn.spin svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 왼쪽 메뉴 ---------- */
.shell { display: grid; grid-template-columns: 216px minmax(0, 1fr); align-items: start; }
.side { position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto; padding: 14px 12px 24px;
  background: var(--surface); border-right: 1px solid var(--line); }
.side-grp { padding: 14px 12px 6px; font-size: 12px; font-weight: 650; color: var(--muted); letter-spacing: .02em; }
.side-grp:first-child { padding-top: 4px; }
.side a { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; margin: 1px 0; border-radius: 8px;
  color: var(--ink-2); text-decoration: none; font-size: 14.5px; font-weight: 550; white-space: nowrap; }
.side a[hidden] { display: none; }
.side a svg { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.side a:hover { background: var(--surface-2); color: var(--ink); }
.side a.on { background: var(--accent); color: #fff; font-weight: 650; }
/* 하위 메뉴 (선적 계획 → 선적 계획 입력) */
.side a.sub { height: 34px; margin-left: 22px; padding-left: 10px; font-size: 13px; position: relative; }
.side a.sub::before { content: ""; position: absolute; left: -10px; top: -6px; width: 9px; height: 23px;
  border-left: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); border-bottom-left-radius: 4px; }
.side a.sub svg { width: 16px; height: 16px; }
.side a .lock-ic { width: 14px; height: 14px; margin-left: auto; opacity: .7; }
.side a .tab-badge { margin-left: auto; }
.link { border: 0; background: none; padding: 0; font: inherit; font-size: 12px; color: var(--accent); cursor: pointer; text-decoration: underline; }
.panel-lock { padding: 0 18px; color: var(--neg); }
.tab-badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 999px;
  background: var(--neg); color: #fff; font-size: 11px; font-weight: 600; line-height: 17px; text-align: center; }

/* ---------- 설정 패널 ---------- */
.panel { position: fixed; top: 58px; right: max(16px, calc((100vw - 1480px) / 2 + 24px)); z-index: 30;
  width: min(460px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 8px; box-shadow: 0 12px 32px rgba(20, 32, 46, .18); }
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px 4px 18px; }
.panel-head h3 { margin: 0; font-size: 14px; font-weight: 650; }
.panel-sec { padding: 10px 18px 16px; }
.panel-sec + .panel-sec { border-top: 1px solid var(--line); padding-top: 14px; }
.lbl { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.hint { margin: 2px 0 8px; font-size: 12px; color: var(--muted); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.input { flex: 1; min-width: 0; height: 34px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--surface); font-size: 12.5px; }
.input:focus, select:focus, .btn:focus-visible { outline: 2px solid #9DB4D3; outline-offset: 1px; }
.msg { margin: 6px 0 0; font-size: 12px; min-height: 1em; }
.msg.err { color: var(--neg); } .msg.ok { color: var(--pos); }
.btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: var(--r);
  border: 1px solid var(--line-2); background: var(--surface); font-size: 13px; font-weight: 550; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #234169; }
.btn.ghost { border-color: transparent; color: var(--ink-2); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }

/* ---------- 본문 ---------- */
.page { max-width: 1600px; width: 100%; margin: 0 auto; padding: 26px 32px 64px; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.page-head .lead { margin: 6px 0 0; color: var(--ink); font-size: 14px; }
.page-head p.sub { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
.head-actions { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.toolbar { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .field > span { font-size: 12px; color: var(--muted); font-weight: 550; }

/* 접는 선택 상자 (제련소 등) */
details.dd { position: relative; }
details.dd > summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); font-size: 13px; cursor: pointer; }
details.dd > summary::-webkit-details-marker { display: none; }
details.dd > summary::after { content: ""; width: 7px; height: 7px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg) translateY(-2px); }
details.dd[open] > summary { border-color: var(--accent); }
.dd-body { position: absolute; z-index: 15; top: 38px; left: 0; width: min(520px, 80vw); padding: 12px; background: var(--surface);
  border: 1px solid var(--line-2); border-radius: 8px; box-shadow: 0 10px 28px rgba(20, 32, 46, .14); }
.dd-body .dd-links { margin-bottom: 8px; font-size: 12px; color: var(--muted); }

/* KPI 더 보기 */
details.more { margin-top: 10px; }
details.more > summary { cursor: pointer; font-size: 13px; color: var(--accent); font-weight: 600; list-style: none; padding: 4px 0; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "＋ "; }
details.more[open] > summary::before { content: "－ "; }

.filters { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { font-size: 12px; color: var(--muted); font-weight: 550; }
.ax-pick { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.ax-pick .field { flex-direction: row; align-items: center; gap: 8px; }
.ax-pick .field > span { min-width: 30px; }
.ax-pick .chip { height: 24px; padding: 0 9px; font-size: 12px; }
select, .num-input { height: 32px; padding: 0 28px 0 10px; border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%23858D97' stroke-width='1.4'/%3E%3C/svg%3E") no-repeat right 8px center / 12px;
  appearance: none; font-size: 13px; }
.num-input { width: 96px; padding-right: 10px; background-image: none; }
.range-sep { color: var(--muted); padding-bottom: 6px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface);
  font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.seg button { height: 32px; padding: 0 14px; border: 0; background: transparent; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button.on { background: var(--ink); color: #fff; font-weight: 600; }
.pill.hide { color: #5B4A7A; border-color: #D5CCE6; background: #F6F3FB; }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: 1.15fr 1fr 1fr; }
.g-3-2 { grid-template-columns: 3fr 2fr; }
.g-7-5 { grid-template-columns: 7fr 5fr; }
.mt { margin-top: 16px; } .mt-l { margin-top: 28px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); min-width: 0; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 12px 18px 0; min-height: 32px; }
.card-head h2 { margin-right: auto !important; }
.card-head h2 { margin: 0; font-size: 14px; font-weight: 650; letter-spacing: -0.01em; }
.card-head .aside { font-size: 12px; color: var(--muted); white-space: nowrap; }
.card-body { padding: 10px 18px 16px; }
.card-body.flush { padding: 6px 0 2px; }
.chart { height: 300px; }
.chart.sm { height: 240px; }
.note { font-size: 12px; color: var(--muted); margin: 10px 0 0; }
.section-title { display: flex; align-items: baseline; gap: 10px; margin: 30px 0 12px; }
.section-title h2 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -0.015em; }
.section-title span { font-size: 12.5px; color: var(--muted); }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(var(--n, 6), minmax(0, 1fr)); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r); }
.kpi { padding: 14px 18px 15px; min-width: 0; }
.kpi + .kpi { border-left: 1px solid var(--line); }
.kpi-l { font-size: 12px; color: var(--muted); font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-v { margin-top: 4px; font-size: 24px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.15; white-space: nowrap; }
.kpi-v small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.kpi-s { margin-top: 3px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.neg { color: var(--neg); } .pos { color: var(--pos); }

/* ---------- 표 ---------- */
.tbl-wrap { overflow-x: auto; }
/* 표: 머리글 눌러 정렬 · 넓은 표는 열 접기 · 긴 표는 일부만 보이고 전체 보기 */
.t th[data-c] { cursor: pointer; user-select: none; }
.t th[data-c]:hover { color: var(--ink); }
.t th[data-dir="asc"]::after { content: " ▲"; font-size: 9px; color: var(--accent); }
.t th[data-dir="desc"]::after { content: " ▼"; font-size: 9px; color: var(--accent); }
.t th[data-dir="asc"], .t th[data-dir="desc"] { color: var(--ink); }
.t .hid { display: none; }
.tbl-tools { position: relative; }
.tbl-tools.in-head { display: inline-flex; padding: 0; margin-left: 4px; }
.layer-name .tbl-tools.in-head { margin-left: auto; padding-right: 0; }
.col-btn { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 550; cursor: pointer; white-space: nowrap; }
.col-btn:hover { color: var(--ink); border-color: var(--line-2); }
.col-btn svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.col-pick { position: absolute; top: 100%; right: 0; z-index: 20; margin-top: 4px; padding: 8px 4px; min-width: 180px; max-height: min(70vh, 520px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: 0 6px 20px rgba(20, 32, 46, .12); }
.col-pick label { display: flex; align-items: center; gap: 8px; padding: 5px 12px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.col-pick label:hover { background: var(--surface-2); }
.t tr.more { display: none; }
.tbl > .tbl-tools { display: flex; justify-content: flex-end; padding: 6px 18px 0; }
.tbl-more { display: block; width: 100%; padding: 10px; border: 0; border-top: 1px solid var(--line); background: var(--surface-2); color: var(--accent); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.tbl-more:hover { background: #EEF0F2; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.t th { position: sticky; top: 0; z-index: 1; background: var(--surface); text-align: left; font-weight: 600; font-size: 12px;
  color: var(--muted); padding: 7px 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.t td { padding: 5px 12px; line-height: 1.45; border-bottom: 1px solid var(--line); white-space: nowrap; }
.t th.n, .t td.n { text-align: right; }
.t tbody tr:hover td { background: #FAFAF7; }
.t td.nil { color: #C2C6CC; }
.t tr.total td { font-weight: 650; background: var(--surface-2); border-top: 1px solid var(--line-2); }
.t tr.grand td { font-weight: 700; background: #EEF0F2; border-top: 1.5px solid var(--ink); }
.t tr:last-child td { border-bottom: 0; }
.t td:first-child, .t th:first-child { padding-left: 18px; }
.t td:last-child, .t th:last-child { padding-right: 18px; }
.t tr.click { cursor: pointer; }
.t tr.done td { color: var(--muted); }
.t .id { font-weight: 550; }
.t.compact { font-size: 12.5px; }
.t.compact th, .t.compact td { padding: 5px 8px; }
.t.compact td:first-child, .t.compact th:first-child { padding-left: 16px; }
.t.compact td:last-child, .t.compact th:last-child { padding-right: 16px; }
.t.fixed { table-layout: fixed; }
.t.fixed th:first-child { width: 124px; }
.t.fixed th:nth-child(2) { width: 92px; }
.t.fixed td { overflow: hidden; text-overflow: ellipsis; }

.pill { display: inline-block; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 18px;
  border: 1px solid var(--line-2); color: var(--ink-2); background: var(--surface); }
.pill.ok { color: var(--pos); border-color: #BCD6C6; background: #F1F7F3; }
.pill.ng { color: var(--neg); border-color: #E3BDB9; background: #FBF2F1; }
.pill.lim { color: #8A6420; border-color: #E6D2AB; background: #FBF6EC; }
.pill.sap { color: #3D6248; border-color: #C3D6C8; background: #F2F7F3; }
.pill.tc { color: #234169; border-color: #B9CBE2; background: #EEF3FA; }
.pill.spot { color: #8A5A10; border-color: #EBCB94; background: #FDF5E7; }
.pill.buyer { color: #3D6248; border-color: #C3D6C8; background: #F2F7F3; }
.pill.run { color: #fff; border-color: var(--load); background: var(--load); }
.pill.wait { color: #8A5A10; border-color: #EBCB94; background: #FDF5E7; }
.muted { color: var(--muted); font-size: 12px; }
.bar-row { display: grid; grid-template-columns: 64px 1fr 120px; gap: 10px; align-items: center; padding: 8px 18px; font-size: 13px; }
.bar-row .track { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar-row .track i { display: block; height: 100%; border-radius: 999px; }
.bar-row .v { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }

/* ---------- 재고 요약 ---------- */
.ctr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); min-width: 0; }
.ctr-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.ctr-name { font-size: 18px; font-weight: 750; letter-spacing: -0.02em; }
.ctr-stats { display: flex; gap: 22px; }
.ctr-stats div { text-align: right; }
.ctr-stats b { display: block; font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; }
.ctr-stats span { font-size: 12px; color: var(--muted); }
.layer { padding: 12px 0 6px; }
.layer + .layer { border-top: 1px solid var(--line); }
.layer-name { display: flex; align-items: center; gap: 8px; padding: 0 18px 4px; font-size: 12.5px; font-weight: 650; }
.layer-name::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.ctr-foot { display: flex; justify-content: space-between; padding: 10px 18px; border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-2); background: var(--surface-2); border-radius: 0 0 var(--r) var(--r); }

/* ---------- 알림 ---------- */
.callout { display: flex; gap: 12px; padding: 12px 16px; border-radius: var(--r); border: 1px solid #E6D2AB;
  background: #FBF6EC; color: #5E4718; font-size: 13px; margin-bottom: 16px; }
.callout.info { border-color: #C9D6E6; background: #F2F6FA; color: #2A4566; }
.callout.err { border-color: #E3BDB9; background: #FBF2F1; color: #7A2B25; }
.callout b { font-weight: 650; }
.callout code { font-size: 12px; background: rgba(0,0,0,.05); padding: 1px 5px; border-radius: 4px; }
.callout details { margin-top: 6px; }
.callout summary { cursor: pointer; font-weight: 600; }

.empty { padding: 48px 20px; text-align: center; color: var(--muted); font-size: 13px; }
.skeleton { height: 140px; border-radius: var(--r); background: linear-gradient(90deg, #ECECE8 0%, #F4F4F1 50%, #ECECE8 100%);
  background-size: 200% 100%; animation: sk 1.2s ease-in-out infinite; }
@keyframes sk { to { background-position: -200% 0; } }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 40; background: var(--ink); color: #fff;
  padding: 9px 16px; border-radius: var(--r); font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.18); }

/* 선적 상세 */
.ship-meta { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 12.5px; color: var(--ink-2); }
.ship-meta b { color: var(--ink); font-weight: 600; margin-left: 4px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* 시뮬레이터 */
.sim-row { display: grid; grid-template-columns: 1fr 120px 110px 28px; gap: 8px; align-items: center; padding: 6px 18px; border-bottom: 1px solid var(--line); }
.sim-row.head { font-size: 12px; color: var(--muted); font-weight: 600; padding-top: 0; }
.sim-row select, .sim-row input { width: 100%; height: 30px; }
.sim-row input { border: 1px solid var(--line-2); border-radius: var(--r); padding: 0 8px; text-align: right; font-size: 13px; }
.sim-row .rem { text-align: right; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sim-row.over input { border-color: var(--neg); color: var(--neg); }

/* 데이터 점검 */
.check { border-bottom: 1px solid var(--line); }
.check:last-child { border-bottom: 0; }
.check > summary { display: flex; justify-content: space-between; align-items: center; padding: 11px 18px; cursor: pointer; list-style: none; font-size: 13.5px; }
.check > summary::-webkit-details-marker { display: none; }
.check.okc > summary { cursor: default; color: var(--ink-2); }
.check .res { font-size: 12.5px; font-weight: 600; }
.check-body { padding: 0 0 10px; background: var(--surface-2); }

@media (max-width: 1240px) { #source { display: none; } }
@media (max-width: 1100px) {
  .g2, .g3, .g-3-2, .g-7-5 { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi:nth-child(3n+1) { border-left: 0; }
  .kpi:nth-child(n+4) { border-top: 1px solid var(--line); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: sticky; top: 56px; z-index: 18; height: auto; display: flex; gap: 4px; overflow-x: auto; padding: 8px 12px;
    border-right: 0; border-bottom: 1px solid var(--line); scrollbar-width: none; }
  .side-grp { display: none; }
  .side a { height: 36px; font-size: 13.5px; flex: none; }
  .side a.sub { margin-left: 0; height: 36px; }
  .side a.sub::before { display: none; }
}
@media (max-width: 640px) {
  .top-row { padding: 0 12px 0 16px; }
  .page { padding: 18px 16px 48px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(n) { border-left: 0; border-top: 1px solid var(--line); }
  .kpi:nth-child(2n) { border-left: 1px solid var(--line); }
  .kpi:nth-child(-n+2) { border-top: 0; }
}
@media print {
  .top, .side, .panel, .filters, .toolbar, .head-actions, .toast { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
  .page { padding: 0; max-width: none; }
  .card, .ctr, .kpis { break-inside: avoid; }
}

/* 자동 추천 */
/* 선적 일정 — 적재 중은 진행 막대 한 줄, 비고는 한 줄로 줄이고 마우스를 올리면 전체 */
.ld { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 650; color: var(--load); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ld-bar { width: 52px; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--load) 16%, transparent); overflow: hidden; }
.ld-bar i { display: block; height: 100%; background: var(--load); border-radius: 3px; }
.t tr.live td { background: color-mix(in srgb, var(--load) 6%, transparent); }
.t td.wrapc { max-width: 320px; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; color: var(--ink-2); }   /* 비고·설명처럼 긴 글은 한 줄로 자르고 마우스를 올리면 전체 */
.g-stack { grid-template-columns: minmax(0, 1fr); }

/* 시뮬레이터 — 목표 톤수 칸 (맨 위, 눈에 띄게) */
.target-bar { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; text-align: left; align-items: center; padding: 16px 20px; margin-bottom: 16px; border-left: 4px solid var(--accent); }
.target-bar .tb-in { display: grid; gap: 6px; }
.target-bar .tb-in span { font-size: 13px; font-weight: 650; color: var(--ink); }
.target-bar input { height: 44px; width: 100%; padding: 0 12px; border: 1.5px solid var(--line-2); border-radius: var(--r); font: inherit; font-size: 22px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; background: var(--surface); color: var(--ink); }
.target-bar input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.target-bar input::placeholder { font-size: 15px; font-weight: 500; color: var(--muted); }
.target-bar.empty { border-left-color: var(--dis); background: color-mix(in srgb, var(--dis) 7%, var(--surface)); }
.target-bar.empty input { border-color: var(--dis); }
.tb-txt { font-size: 14px; color: var(--ink-2); margin-bottom: 8px; }
.tb-txt b { color: var(--ink); font-variant-numeric: tabular-nums; }
.target-bar.empty .tb-track { display: none; }
.tb-track { height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.tb-track i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 5px; transition: width .25s; }
.target-bar.over .tb-track i { background: var(--neg); }
@media (max-width: 760px) { .target-bar { grid-template-columns: minmax(0, 1fr); gap: 12px; } }
.spec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 12px; }
.spec-cell { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.spec-cell span { grid-column: 1 / -1; font-size: 12px; color: var(--muted); font-weight: 600; }
.spec-cell input { width: 100%; height: 30px; border: 1px solid var(--line-2); border-radius: var(--r); padding: 0 8px; text-align: right; font-size: 13px; background: transparent; color: inherit; }
.spec-cell.one { grid-template-columns: 1fr; }
.t td.hl { background: var(--surface-2); font-weight: 650; }
.opt-opts { margin-top: 12px; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.opt-detail { border-top: 1px solid var(--line); padding: 8px 0; }
.opt-detail summary { cursor: pointer; font-size: 13px; font-weight: 600; padding: 2px 0 8px; }

/* 선적 상세: 왼쪽 목록 + 오른쪽 상세 */
.ship-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.ship-list { position: sticky; top: 12px; background: var(--surface, #fff); border: 1px solid var(--line); border-radius: var(--r-lg, 10px); display: flex; flex-direction: column; max-height: calc(100vh - 140px); overflow: hidden; }
.sl-head { padding: 12px; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.sl-head .input { width: 100%; }
.sl-body { overflow-y: auto; }
.sl-month { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 6px; width: 100%; border: 0; border-bottom: 1px solid var(--line); background: var(--surface-2, #F4F5F7);
  font: inherit; font-size: 12px; font-weight: 600; color: var(--ink); padding: 7px 12px; cursor: pointer; text-align: left; }
.sl-month .caret { display: inline-block; color: var(--muted); transition: transform .15s; }
.sl-month.open .caret { transform: rotate(90deg); }
.sl-month .sl-cnt { margin-left: auto; font-weight: 500; color: var(--muted); }
.sl-item { display: grid; gap: 1px; padding: 7px 12px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; border-left: 3px solid transparent; }
.sl-item:hover { background: var(--surface-2, #F4F5F7); }
.sl-item.on { background: var(--surface-2, #EEF3FA); border-left-color: var(--load, #1C3557); }
.sl-l1 { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.sl-l1 .pill { margin-left: auto; }
.sl-barge { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sl-l2 { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sl-ni { white-space: nowrap; color: var(--ink); }
.sl-ni .muted { color: var(--muted); }
.ship-detail { min-width: 0; }
.sd-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 10px; }
.sd-head h1 { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0; font-size: 22px; }
.sd-head h1 .pill { font-size: 12px; }
.sd-barge { font-weight: 500; color: var(--muted); font-size: 16px; margin-right: 4px; }
/* 기본 정보: 라벨 위 · 값 아래, 4칸 격자 */
.sd-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.sd-meta > div { padding: 8px 14px; min-width: 0; border-left: 1px solid var(--line); }
.sd-meta > div:nth-child(4n+1) { border-left: 0; }
.sd-meta > div:nth-child(n+5) { border-top: 1px solid var(--line); }
.sd-meta dt { font-size: 11.5px; color: var(--muted); font-weight: 550; }
.sd-meta dd { margin: 1px 0 0; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 품위 표 + 오른쪽 칸(계획 → LP → DP → 정산 흐름, 차이 요약) */
.sd-grid { display: grid; grid-template-columns: minmax(0, 1fr) 272px; gap: 14px; align-items: start; }
.sd-rail { display: grid; gap: 8px; }
.flow.v { grid-template-columns: minmax(0, 1fr); gap: 8px; }
.flow.v .flow-arrow { display: none; }
.flow.v .flow-step, .flow.v .flow-step.skip { padding: 9px 12px; }
.flow.v .fs-ni { font-size: 20px; margin: 2px 0 0; }
.flow.v .fs-wait { margin-top: 4px; }
.flow.v .basis-tag { margin: 2px 0 0; }
.sd-xs { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 4px 0; }
.sd-x { display: flex; justify-content: space-between; gap: 8px; padding: 5px 12px; font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.sd-x b { color: var(--ink); font-weight: 600; } .sd-x b.neg { color: var(--neg); }
.sd-x small { color: var(--muted); }
.t .hl { background: color-mix(in srgb, var(--load) 5%, transparent); }
.t th.hl { color: var(--load); }
.t tr.sep td { border-top: 1px solid var(--line-2); }
.sd-nav { display: flex; gap: 6px; flex: none; }
.sd-nav a[aria-disabled] { opacity: .4; pointer-events: none; }
.flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; align-items: stretch; gap: 6px; }
.flow-step { background: var(--surface, #fff); border: 1px solid var(--line); border-top: 3px solid var(--c); border-radius: var(--r-lg, 10px); padding: 12px 14px; min-width: 0; }
.flow-step.empty { border-top-color: var(--line-2, #DDE1E6); background: transparent; }
.fs-l { font-size: 12px; font-weight: 600; color: var(--muted); display: flex; justify-content: space-between; gap: 6px; }
.fs-l span { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs-ni { font-size: 24px; font-weight: 700; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.fs-ni small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.fs-sub { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.fs-wait { margin-top: 10px; font-size: 13px; color: var(--muted); }
.flow-arrow { align-self: center; color: var(--muted); font-size: 18px; }
details.hist summary { cursor: pointer; padding: 12px 18px; font-weight: 600; font-size: 14px; display: flex; justify-content: space-between; }
@media (max-width: 1280px) {
  .sd-grid { grid-template-columns: minmax(0, 1fr); }
  .flow.v { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sd-rail { order: -1; }
}
@media (max-width: 1000px) {
  .sd-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sd-meta > div { border-left: 0; border-top: 1px solid var(--line); }
  .sd-meta > div:nth-child(2n) { border-left: 1px solid var(--line); }
  .sd-meta > div:nth-child(-n+2) { border-top: 0; }
  .flow.v { grid-template-columns: 1fr 1fr; }
  .ship-layout { grid-template-columns: 1fr; }
  .ship-list { position: static; max-height: 320px; }
  .flow { grid-template-columns: 1fr 1fr; }
  .flow-arrow { display: none; }
}

.flow-step.basis { box-shadow: 0 0 0 1px var(--c) inset; }
.flow-step.skip { border: 1px dashed var(--line-2, #DDE1E6); background: transparent; padding: 12px 14px; border-radius: var(--r-lg, 10px); }
.basis-tag { display: inline-block; margin-top: 4px; font-size: 11.5px; font-weight: 600; color: var(--c); border: 1px solid var(--c); border-radius: 999px; padding: 0 6px; }

/* ---------- 인허가 현황 ---------- */
.warn { color: #9A6A0A; }
.t tr.flagged td { background: #FFF8EC; }
.t td .wrap { white-space: normal; display: inline-block; max-width: 340px; font-size: 12px; color: var(--ink-2); }
.t td b { font-weight: 600; }
.t td .muted { font-size: 12px; white-space: normal; max-width: 360px; }
.gantt { padding: 6px 0 10px; overflow-x: auto; }
.g-row { display: grid; grid-template-columns: 340px minmax(560px, 1fr); align-items: center; gap: 10px; padding: 3px 16px; }
.g-head { position: sticky; top: 0; background: var(--surface); font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.g-cells { display: grid; gap: 1px; height: 14px; }
.g-head .g-cells { height: auto; }
.g-head .g-cells span { border-left: 1px solid var(--line); padding-left: 3px; white-space: nowrap; overflow: hidden; }
.g-cells i { display: block; background: #F3F3F0; border-radius: 1px; }
.g-cells i.now { box-shadow: inset 0 0 0 1.5px #D11; }
.g-name { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
details.g-item { border-top: 1px solid var(--line); }
details.g-item > summary { list-style: none; cursor: pointer; padding-top: 7px; padding-bottom: 7px; }
details.g-item > summary::-webkit-details-marker { display: none; }
details.g-item > summary .g-name::before { content: "▸ "; color: var(--muted); }
details.g-item[open] > summary .g-name::before { content: "▾ "; }
.g-step .g-name { padding-left: 18px; color: var(--ink-2); font-size: 12px; }
.g-step .g-cells { height: 10px; }
.g-note { padding: 0 16px 8px 34px; font-size: 12.5px; color: #9A6A0A; }

/* 인허가 원본 문서 */
.doc-btn { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border: 1px solid #B9CBE2; border-radius: var(--r);
  background: #EEF3FA; color: var(--accent); font-size: 12.5px; font-weight: 650; text-decoration: none; white-space: nowrap; }
.doc-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.doc-btn small { font-weight: 500; opacity: .8; }
.doc-add { font-size: 12px; color: var(--muted); }
.t tr.click:hover .doc-add { color: var(--accent); }
.doc-btn svg, .pd-doc > svg, .lost-row svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.3; flex: none; }
dialog.pd { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 64px); padding: 0; border: 1px solid var(--line-2); border-radius: 10px;
  box-shadow: 0 18px 48px rgba(20, 32, 46, .25); color: var(--ink); background: var(--surface); }
dialog.pd::backdrop { background: rgba(20, 32, 46, .35); }
.pd-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 16px 18px 10px; border-bottom: 1px solid var(--line); }
.pd-head h3 { margin: 0 0 2px; font-size: 16px; font-weight: 700; }
.pd-info { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; margin: 0; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.pd-info dt { font-size: 11.5px; color: var(--muted); font-weight: 550; }
.pd-info dd { margin: 1px 0 0; font-size: 13px; }
.pd-docs { padding: 12px 18px 16px; }
.pd-sub { font-size: 12.5px; font-weight: 650; margin-bottom: 6px; }
.pd-doc { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); color: var(--accent); }
.pd-name { flex: 1; min-width: 0; display: grid; }
.pd-name a { color: var(--ink); font-size: 13px; font-weight: 550; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-name a:hover { text-decoration: underline; }
.pd-name small { font-size: 11.5px; color: var(--muted); }
.pd-doc .btn { text-decoration: none; color: var(--ink); }
details.pd-more { position: relative; }
details.pd-more > summary { list-style: none; font-size: 15px; letter-spacing: 1px; }
details.pd-more > summary::-webkit-details-marker { display: none; }
.pd-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; min-width: 180px; padding: 4px; display: grid; background: var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: 0 8px 22px rgba(20, 32, 46, .16); }
.pd-menu button, .pd-menu label { display: block; padding: 7px 10px; border: 0; border-radius: 4px; background: none; font: inherit; font-size: 13px;
  color: var(--ink); text-align: left; cursor: pointer; white-space: nowrap; }
.pd-menu button:hover, .pd-menu label:hover { background: var(--surface-2); }
.pd-menu .neg { color: var(--neg); }
.pd-move { display: flex; gap: 6px; align-items: center; padding: 8px 0 10px 22px; border-bottom: 1px solid var(--line); }
.pd-move[hidden] { display: none; }
.pd-move select { flex: 1; min-width: 0; }
.pd-none { padding: 10px 0; font-size: 13px; color: var(--muted); }
.pd-drop { display: grid; gap: 2px; margin-top: 12px; padding: 16px; border: 1.5px dashed var(--line-2); border-radius: 8px; text-align: center; cursor: pointer; }
.pd-drop b { font-size: 13px; color: var(--accent); }
.pd-drop span { font-size: 12px; color: var(--muted); }
.pd-drop:hover, .pd-drop.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 5%, transparent); }
.lost-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 18px; border-bottom: 1px solid var(--line); font-size: 13px; }
.lost-row:last-child { border-bottom: 0; }
.lost-row > span:first-child { display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; }
.lost-row small { color: var(--muted); font-size: 12px; }
.lost-row select { max-width: 320px; }

/* ---------- 광구 지도 ---------- */
.map-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.map-card { overflow: hidden; }
#map { height: 640px; background: #1d2a1f; }
.map-side { position: sticky; top: 72px; }
.map-legend { padding: 10px 6px 4px; }
.lg-row { display: grid; grid-template-columns: 18px 22px 1fr; gap: 8px; align-items: start; padding: 8px; border-radius: 6px; cursor: pointer; font-size: 13px; line-height: 1.4; }
.lg-row:hover { background: var(--surface-2); }
.lg-sw { width: 20px; height: 14px; margin-top: 2px; border: 2.5px solid var(--c); border-radius: 2px; background: color-mix(in srgb, var(--c) 18%, transparent); }
.lg-sw.img { border: 0; background: linear-gradient(135deg, #3c6b2f, #b5652d); }
.lg-sw.line { height: 0; border-width: 0; border-top: 2.5px dashed var(--c); margin-top: 9px; background: none; }
.gal-block h3 { margin: 18px 0 10px; font-size: 14px; font-weight: 650; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.ph { display: block; padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); cursor: zoom-in; text-align: left; }
.ph img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.ph span { display: block; padding: 7px 10px; font-size: 12.5px; font-weight: 550; color: var(--ink); }
.ph:hover { border-color: var(--accent); }
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(10, 15, 20, .86); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: min(1500px, 94vw); max-height: 84vh; border-radius: 6px; }
#lb-cap { color: #fff; margin-top: 12px; font-size: 14px; }
.lb-x { position: absolute; top: 14px; right: 20px; font-size: 32px; color: #fff; background: none; border: 0; cursor: pointer; }
.pin-ic i { display: block; width: 14px; height: 14px; margin: 2px; border: 2px solid #fff; border-radius: 50%; background: #E9C987; box-shadow: 0 1px 4px rgba(0, 0, 0, .5); transition: transform .12s; }
.pin-ic:hover i, .pin-ic.hi i { transform: scale(1.5); background: #FFB020; }
.leaflet-tooltip.ph-tip { padding: 6px; border-radius: 8px; border: 0; box-shadow: 0 6px 20px rgba(0, 0, 0, .35); white-space: normal; }
.ph-tip-in { width: 300px; display: grid; gap: 2px; font-size: 12.5px; line-height: 1.4; }
.ph-tip-in img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; margin-bottom: 4px; background: #ddd; }
#map.placing, #map.placing .leaflet-interactive { cursor: crosshair; }
.pin-edit { padding: 4px 14px 14px; border-top: 1px solid var(--line); }
.pin-edit #pin-mode { width: 100%; justify-content: center; margin-top: 10px; }
.pin-help { margin: 10px 0 8px; font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }
.pin-list { max-height: 330px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; }
.pin-row { display: grid; grid-template-columns: 1fr auto 18px; gap: 6px; width: 100%; padding: 6px 8px; border: 0; border-bottom: 1px solid var(--line); background: none; font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; }
.pin-row:last-child { border-bottom: 0; }
.pin-row:hover { background: var(--surface-2); }
.pin-row.on { background: color-mix(in srgb, var(--accent) 12%, transparent); font-weight: 600; }
@media (max-width: 1100px) { .map-wrap { grid-template-columns: minmax(0, 1fr); } .map-side { position: static; } #map { height: 480px; } }

/* ---------- 로그인 · 계정 ---------- */
.me { display: flex; align-items: center; gap: 4px; margin-right: 6px; }
.me[hidden] { display: none; }
.me-name { font-size: 12.5px; color: var(--head-ink); margin-right: 4px; white-space: nowrap; }
.me-name small { color: var(--head-muted); margin-left: 4px; font-size: 11.5px; }
.btn.ghost-dark { background: transparent; border-color: #2C3D52; color: var(--head-muted); }
.btn.ghost-dark:hover { background: var(--head-2); color: var(--head-ink); }
.auth { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: var(--head); overflow: auto; }
.auth[hidden], .auth-card[hidden] { display: none; }
.auth-card { width: 100%; max-width: 360px; background: var(--surface); border-radius: 10px; padding: 26px 26px 22px;
  display: flex; flex-direction: column; gap: 12px; box-shadow: 0 10px 40px rgba(0, 0, 0, .25); }
.auth-brand { display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 13px; color: var(--ink-2); }
.auth-brand .mark { color: var(--dis); }
.auth-card h1 { margin: 4px 0 0; font-size: 20px; letter-spacing: -0.02em; }
.auth-sub { margin: -6px 0 4px; font-size: 12.5px; color: var(--muted); }
.auth-card label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.auth-card .input { flex: none; height: 38px; }
.auth-card .btn.primary { height: 38px; justify-content: center; }
.auth-card .row .btn { flex: 1; justify-content: center; }
.auth-card .msg { margin: 0; }
.auth-card .hint { margin: -4px 0 0; }
.users-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 8px; align-items: end; }
.users-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.users-form .input, .users-form select { flex: none; width: 100%; }
@media (max-width: 900px) { .users-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.pw-box { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pw-box code { font-size: 16px; font-weight: 700; letter-spacing: .06em; background: var(--surface); border: 1px solid var(--line-2);
  padding: 4px 10px; border-radius: var(--r); user-select: all; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; }
.switch input { width: 36px; height: 20px; appearance: none; border-radius: 999px; background: var(--line-2); position: relative; cursor: pointer; transition: background .15s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch input:checked { background: var(--pos); }
.switch input:checked::after { left: 18px; }
.act { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.bars { display: flex; flex-direction: column; gap: 5px; }
.bars .bar-row { display: grid; grid-template-columns: 78px minmax(0, 1fr) 24px; align-items: center; gap: 8px; font-size: 12px; }
.bars .bar-row span { color: var(--muted); white-space: nowrap; }
.bars .bar-row i { display: block; height: 10px; min-width: 2px; border-radius: 2px; background: var(--load); }
.bars .bar-row b { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.auth-foot { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); text-align: center; }
.auth-foot a { color: var(--accent); font-weight: 600; }
.me-name b { font-weight: 650; }
@media (max-width: 760px) { .me-name { display: none; } }

/* 데이터 입력 화면 */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 12px; }
.form-grid .field span { font-size: 12px; color: var(--ink-3, #6b7280); }
.form-grid .input { width: 100%; flex: none; }
label.chk { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; cursor: pointer; }
.in-bar { margin: -6px 0 12px; }
table.fit td, table.fit th { white-space: normal; }   /* 좁은 화면에서는 줄바꿈해서 한 화면 너비에 */
table.fit td .pill, table.fit td .nowrap { white-space: nowrap; }
.cell2 { display: flex; flex-direction: column; line-height: 1.25; }
.cell2 b { font-weight: 600; }
.cell2 span { font-size: 11.5px; color: var(--ink-3); }
.memo { font-size: 11px; padding: 0 5px; border: 1px solid var(--line-2); border-radius: 4px; color: var(--ink-3); cursor: help; }
.nowrap { white-space: nowrap; }
.perm { display: inline-flex; gap: 10px; }
.up-list { margin: 6px 0 0 18px; padding: 0; font-size: 13px; }
.up-list li { margin: 2px 0; }
