﻿* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", "Malgun Gothic", sans-serif;
  color: #1f2430;
  background: #f4f5f7;
}
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  background: #1f2430; color: #fff; padding: 10px 18px;
}
.topbar .brand { font-weight: 700; }
.topbar .user { display: flex; gap: 12px; align-items: center; font-size: 14px; }
.inline { display: inline; margin: 0; }
button.link { background: none; border: none; color: #9cc2ff; cursor: pointer; }

.layout { display: flex; min-height: calc(100vh - 44px); }
.sidebar {
  width: 200px; background: #fff; border-right: 1px solid #e3e6ea;
  display: flex; flex-direction: column; padding: 12px 0;
}
.sidebar a { padding: 10px 18px; color: #1f2430; }
.sidebar a:hover { background: #eef2ff; text-decoration: none; }

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

.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 12px; }
.flash.error { background: #fdecec; color: #b42318; border: 1px solid #f3c0bb; }
.flash.info  { background: #eaf2ff; color: #1d4ed8; border: 1px solid #bcd4ff; }
.flash.success { background: #e7f6ec; color: #17643a; border: 1px solid #b3e0c4; }

.login-box, .error-box {
  background: #fff; padding: 28px; border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,.06); width: 320px;
}
.login-box h1 { margin-top: 0; font-size: 20px; }
.login-box label { display: block; margin-bottom: 14px; font-size: 14px; }
.login-box input {
  width: 100%; padding: 9px 10px; margin-top: 4px;
  border: 1px solid #cbd2dc; border-radius: 6px;
}
button[type=submit] {
  background: #2563eb; color: #fff; border: none; border-radius: 6px;
  padding: 9px 16px; cursor: pointer; font-size: 14px;
}
button[type=submit]:hover { background: #1d4ed8; }

table { border-collapse: collapse; width: 100%; background: #fff; }
th, td { border: 1px solid #e3e6ea; padding: 8px 10px; text-align: left; font-size: 14px; }
th { background: #f0f2f5; }
.filters { margin-bottom: 14px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters input, .filters select { padding: 6px 8px; border: 1px solid #cbd2dc; border-radius: 5px; }
textarea { width: 100%; min-height: 140px; border: 1px solid #cbd2dc; border-radius: 6px; padding: 8px; }
.muted { color: #6b7280; font-size: 13px; }
.badge { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 12px; background: #eef2ff; color: #1d4ed8; }
.badge.busy { background: #fff1e6; color: #b45309; }
.badge.wait { background: #e7f6ec; color: #17643a; }
.badge.idle { background: #f0f2f5; color: #6b7280; }
.badge.warn { background: #fdecec; color: #b42318; }
.badge.ok   { background: #e0f2fe; color: #075985; }

/* ?? 怨듯넻 ?뚯씠釉??⑦꽩 (3-A) ??????????????????????????????? */
.toolbar {
  position: sticky; top: 0; z-index: 5;
  background: #f4f5f7; padding: 10px 0 8px; margin-bottom: 8px;
  display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center;
  border-bottom: 1px solid #e3e6ea;
}
.toolbar .sep { flex-basis: 100%; height: 0; }
.toolbar input[type=text], .toolbar input[type=search], .toolbar input[type=number], .toolbar select {
  padding: 6px 8px; border: 1px solid #cbd2dc; border-radius: 5px; background: #fff;
}
.toolbar .right { margin-left: auto; display: flex; gap: 10px; align-items: center; }
button.btn, a.btn {
  background: #fff; border: 1px solid #cbd2dc; border-radius: 6px; padding: 6px 12px;
  cursor: pointer; font-size: 13px; color: #1f2430; text-decoration: none; display: inline-block;
}
button.btn:hover { background: #eef2ff; }
button.btn.primary { background: #2563eb; color: #fff; border-color: #2563eb; }
button.btn.danger { color: #b42318; border-color: #f3c0bb; }
button.btn:disabled { opacity: .45; cursor: not-allowed; }
.selection-bar {
  background: #eaf2ff; border: 1px solid #bcd4ff; color: #1d4ed8; border-radius: 6px;
  padding: 6px 10px; margin-bottom: 8px; display: flex; gap: 14px; align-items: center; font-size: 13px;
}
.selection-bar .scope-all { font-weight: 600; }
.pager { display: flex; gap: 14px; align-items: center; margin-top: 10px; font-size: 13px; flex-wrap: wrap; }
.pager .pages a, .pager .pages strong { margin: 0 3px; }
.pager .per select { padding: 3px 6px; margin-left: 4px; }
table[data-table] th.col-check, table[data-table] td.col-check { width: 32px; text-align: center; }
table[data-table] tbody tr.dirty { background: #fffbe6; }
/* 설정이 켜져 있는데 값이 비어 실제로는 동작하지 않는 행 (예: 공급참여 ON + 도매가 0) */
table[data-table] tbody tr.row-warn { background: #fef6e0; }
table[data-table] input[data-field].dirty { border-color: #f59e0b; background: #fff8e1; }
table[data-table] input[data-field] { padding: 3px 6px; border: 1px solid #cbd2dc; border-radius: 4px; }
table[data-table] tr.flash-row { animation: rowflash .8s ease-out; }
@keyframes rowflash { from { background: #dbeafe; } to { background: transparent; } }
tr.empty td { text-align: center; color: #6b7280; padding: 26px; }
.copyable { cursor: pointer; border-bottom: 1px dashed #9ca3af; }
.copyable:hover { color: #1d4ed8; }
details.paste { margin-left: 4px; }
details.paste summary { cursor: pointer; }
details.paste .box { position: absolute; z-index: 6; background: #fff; border: 1px solid #cbd2dc; border-radius: 8px; padding: 10px; width: 340px; box-shadow: 0 6px 24px rgba(0,0,0,.1); }
details.paste textarea { min-height: 110px; }
tr.expand-row td { background: #fafbfc; color: #4b5563; font-size: 13px; }

/* ?좎뒪??*/
.toast-box { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: #1f2430; color: #fff; padding: 9px 14px; border-radius: 6px; font-size: 13px; opacity: 0; transform: translateY(8px); transition: all .25s; }
.toast.show { opacity: 1; transform: none; }
.toast.success { background: #17643a; }
.toast.error { background: #b42318; }

/* ??쒕낫??移대뱶 */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 18px; }
.card { background: #fff; border: 1px solid #e3e6ea; border-radius: 8px; padding: 14px 16px; }
.card .num { font-size: 26px; font-weight: 700; }
.card .num a { color: inherit; }
.card .lbl { color: #6b7280; font-size: 13px; }
.stat-section { margin-top: 22px; }
.stat-section h2 { font-size: 16px; margin-bottom: 8px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
