@font-face { font-family: "SungSans"; src: url("/static/fonts/SungSans-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "SungSans"; src: url("/static/fonts/SungSans-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #f6f7f9; --panel: #fff; --border: #e2e5ea; --border-strong: #cfd4dc;
  --text: #1b1f24; --muted: #687080; --faint: #9aa1ad;
  --accent: #2456c9; --accent-hover: #1d47a8; --accent-weak: #edf2fc;
  --ok: #1f7a4a; --ok-weak: #e8f5ee; --warn: #9a5b0b; --warn-weak: #fdf3e3; --err: #b42323; --err-weak: #fcecec;
  --radius: 8px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: "SungSans", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; font-size: 14px; color: var(--text);
  background: var(--bg); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 20px; margin: 0; font-weight: 700; }
h2 { font-size: 15px; margin: 0 0 12px; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

/* layout */
.shell { display: flex; min-height: 100vh; }
.side { width: 240px; flex: none; background: var(--panel); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { padding: 20px 20px 16px; border-bottom: 1px solid var(--border); }
.brand b { display: block; font-size: 15px; }
.brand span { font-size: 12px; color: var(--muted); }
.nav { padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; }
.nav a { display: block; padding: 8px 12px; border-radius: 6px; color: var(--text); font-weight: 400; }
.nav a:hover { background: var(--bg); text-decoration: none; }
.nav a.on { background: var(--accent-weak); color: var(--accent); font-weight: 700; }
.side-foot { margin-top: auto; padding: 16px 20px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; }
.main { flex: 1; min-width: 0; padding: 28px 32px 48px; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.head .sub { color: var(--muted); margin-top: 4px; }

.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.card-head h2 { margin: 0; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* forms */
label.f { display: block; font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.help { color: var(--muted); font-size: 12px; margin-top: 6px; }
.field { margin-bottom: 16px; }
input[type=text], input[type=password], input[type=number], input[type=email], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: #fff; border: 1px solid var(--border-strong); border-radius: 6px; padding: 8px 10px; transition: border-color .15s; }
textarea { resize: vertical; min-height: 96px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--accent); vertical-align: middle; }
.inline { display: flex; gap: 8px; align-items: center; }
.inline input[type=number] { width: 96px; }

.btn { font: inherit; font-weight: 700; border: 1px solid var(--border-strong); background: #fff; color: var(--text); border-radius: 6px; padding: 8px 14px; cursor: pointer; transition: background .15s, border-color .15s; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { background: var(--bg); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { color: var(--err); }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.block { width: 100%; justify-content: center; padding: 10px 14px; }

/* status */
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 4px; background: var(--bg); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.badge.running, .badge.sending { background: var(--accent-weak); color: var(--accent); border-color: #d3def7; }
.badge.done, .badge.sent { background: var(--ok-weak); color: var(--ok); border-color: #cfe8da; }
.badge.failed { background: var(--err-weak); color: var(--err); border-color: #f3d0d0; }
.badge.cancelled, .badge.skipped { background: var(--warn-weak); color: var(--warn); border-color: #f2e0c2; }
.grade { display: inline-block; min-width: 22px; text-align: center; font-weight: 700; font-size: 12px; border-radius: 4px; padding: 0 4px; margin-left: 6px; }
.grade.S { background: #fbe3b4; } .grade.A { background: #dbe8fa; } .grade.B { background: #e1f2df; } .grade.C { background: #eceef1; } .grade.D { background: #f6f7f9; color: var(--muted); }

.bar { height: 8px; background: var(--bg); border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.progress-big { margin: 12px 0 8px; }
.progress-big .bar { height: 12px; }
.stats { display: flex; gap: 28px; flex-wrap: wrap; }
.stat b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
th { font-size: 12px; color: var(--muted); font-weight: 700; background: #fafbfc; white-space: nowrap; position: sticky; top: 0; }
th.sort { cursor: pointer; user-select: none; }
th.sort:hover { color: var(--text); }
th.sorted { color: var(--accent); }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fafbfd; }
td { white-space: nowrap; }
td .title { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
td .sub { font-size: 12px; color: var(--muted); }
.empty { padding: 32px; text-align: center; color: var(--muted); }
.toolbar { display: flex; gap: 8px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.toolbar input[type=text] { width: 220px; }
.toolbar select { width: auto; min-width: 140px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 10px 16px; border-top: 1px solid var(--border); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font: inherit; font-size: 12px; border: 1px solid var(--border-strong); background: #fff; border-radius: 6px; padding: 3px 9px; cursor: pointer; }
.chip.on { background: var(--accent-weak); border-color: var(--accent); color: var(--accent); font-weight: 700; }
.kw { display: inline-block; background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 1px 7px; margin: 0 4px 2px 0; font-size: 12px; }

.notice { border: 1px solid var(--border); border-radius: 6px; padding: 12px 14px; background: var(--bg); color: var(--muted); font-size: 13px; }
.notice.lock { background: var(--warn-weak); border-color: #f2e0c2; color: var(--warn); }
.notice.err { background: var(--err-weak); border-color: #f3d0d0; color: var(--err); }
.notice.ok { background: var(--ok-weak); border-color: #cfe8da; color: var(--ok); }
.mailbox { border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.mailbox .mh { padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.mailbox .mh div { margin: 2px 0; }
.mailbox .mb { padding: 14px; white-space: pre-wrap; min-height: 140px; }
.scroll { max-height: 560px; overflow: auto; }
table.tight th, table.tight td { padding: 8px 8px; }
table.tight td:first-child, table.tight th:first-child { padding-left: 14px; }

.toast { position: fixed; right: 24px; bottom: 24px; background: var(--text); color: #fff; padding: 10px 16px; border-radius: 6px; font-size: 13px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 10; }
.toast.show { opacity: 1; }

/* login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login { width: 360px; }
.login h1 { margin-bottom: 4px; }
.login .sub { color: var(--muted); margin-bottom: 20px; }

@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .side { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; border-right: 0; border-bottom: 1px solid var(--border); }
  .brand { border-bottom: 0; padding: 12px 16px; }
  .nav { flex-direction: row; padding: 8px; overflow-x: auto; }
  .side-foot { display: none; }
  .main { padding: 20px 16px 40px; }
  .grid2 { grid-template-columns: 1fr; }
}
.badge.new { background: var(--ok-weak); color: var(--ok); border-color: #cfe8da; }
label.opt { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
label.opt b { font-weight: 700; }
.notice.summary b { font-size: 15px; color: var(--text); }

/* category buttons (order 7718465) */
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.cat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.cat.busy { border-color: #c9d7f5; background: #fbfcff; }
.catbtn { font: inherit; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; width: 100%; border: 1px solid var(--accent); background: var(--accent); color: #fff; border-radius: 6px; padding: 12px 14px; cursor: pointer; transition: background .15s; }
.catbtn b { font-size: 16px; }
.catbtn span { font-size: 12px; opacity: .85; }
.catbtn:hover { background: var(--accent-hover); }
.catbtn:disabled { background: var(--accent-weak); color: var(--accent); cursor: default; }
.kw.cat { background: var(--accent-weak); border-color: #d3def7; color: var(--accent); font-weight: 700; }
.stat.big b { font-size: 28px; color: var(--ok); }
.live { min-height: 32px; }
.live .chip { cursor: default; display: inline-flex; gap: 6px; align-items: center; margin: 0 4px 4px 0; }
.live .chip i { font-style: normal; color: var(--muted); font-size: 11px; }
.badge.top { background: var(--warn-weak); color: var(--warn); border-color: #f2e0c2; padding: 0 5px; font-size: 11px; }
.modal-bg { position: fixed; inset: 0; background: rgba(20, 24, 31, .35); display: flex; align-items: center; justify-content: center; z-index: 20; padding: 24px; }
.modal { width: 560px; max-width: 100%; margin: 0; }
.row.wrap { flex-wrap: wrap; }
