/* UBF Annual Report — a tool the office uses once a year.
   Nobody will remember it between years, so the three steps are on the page. */

:root {
  --ink: #17212b;
  --ink-soft: #5a6b7b;
  --ink-faint: #8697a6;
  --ground: #f6f7f9;
  --card: #ffffff;
  --line: #dfe4ea;
  --line-soft: #eceff3;
  --accent: #1f4e79;
  --accent-soft: #eaf1f8;
  --accent-ink: #163a5a;
  --ok: #1d7a4c;
  --ok-soft: #e6f4ec;
  --warn: #9a6708;
  --warn-soft: #fdf3de;
  --bad: #9c2d2d;
  --bad-soft: #fbeaea;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(23,33,43,.06), 0 6px 20px rgba(23,33,43,.05);
  --mono: "SFMono-Regular", Menlo, Consolas, "D2Coding", monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 15px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic",
        "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px 80px; }
.narrow { max-width: 460px; }

/* ---------- header ---------- */
header.top {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}
header.top .wrap {
  display: flex; align-items: center; gap: 16px;
  padding-top: 14px; padding-bottom: 14px;
}
.brand { font-weight: 700; font-size: 16px; color: var(--ink); letter-spacing: -.2px; }
.brand span { color: var(--accent); }
.top nav { margin-left: auto; display: flex; align-items: center; gap: 18px; font-size: 14px; }
.top nav .who { color: var(--ink-faint); }

/* ---------- headings ---------- */
h1 { font-size: 26px; letter-spacing: -.4px; margin: 0 0 6px; }
h2 { font-size: 18px; letter-spacing: -.2px; margin: 0; }
.lede { color: var(--ink-soft); margin: 0 0 26px; }

/* ---------- cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px; margin-bottom: 20px;
}
.card > header {
  display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px;
}
.card > header .hint { color: var(--ink-faint); font-size: 13px; margin-left: auto; }

/* ---------- step markers ---------- */
.step { display: flex; align-items: center; gap: 12px; }
.step .n {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-size: 13px; font-weight: 700;
  display: grid; place-items: center;
}
.step.muted .n { background: var(--line); color: var(--ink-faint); }
.step .sub { color: var(--ink-faint); font-size: 13px; font-weight: 400; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--accent); background: var(--accent); color: #fff;
  padding: 9px 16px; border-radius: 8px; font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--accent-ink); border-color: var(--accent-ink); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.quiet { background: transparent; border-color: var(--line); color: var(--ink-soft); }
.btn.quiet:hover { background: var(--ground); border-color: var(--ink-faint); }
.btn.big { padding: 13px 26px; font-size: 15px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.danger { border-color: var(--bad); color: var(--bad); background: transparent; }
.btn.danger:hover { background: var(--bad-soft); }

/* ---------- forms ---------- */
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 13px; color: var(--ink-soft); margin-bottom: 5px; }
input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 9px 11px; font: inherit;
  border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { font-family: var(--mono); font-size: 13px; line-height: 1.6; resize: vertical; }
select { appearance: none; background-image:
  url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M0 0l5 6 5-6z' fill='%238697a6'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }

/* ---------- drop zones ---------- */
.zones { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.zone {
  border: 1.5px dashed var(--line); border-radius: var(--radius);
  padding: 16px; background: #fcfdfe; transition: border-color .15s, background .15s;
  display: flex; flex-direction: column; min-height: 190px; min-width: 0;
}
.zone.over { border-color: var(--accent); background: var(--accent-soft); }
.zone h3 { margin: 0 0 2px; font-size: 15px; }
.zone .what { color: var(--ink-faint); font-size: 12.5px; margin-bottom: 12px; line-height: 1.5; }
.zone .files {
  flex: 1; overflow-y: auto; max-height: 210px; margin: 0 -6px 10px;
  font-size: 13px;
}
.zone .files .row {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 6px; border-radius: 5px;
}
.zone .files .row:hover { background: var(--ground); }
.zone .files .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
                   min-width: 0; flex: 1; }
.zone .files .sz { margin-left: auto; color: var(--ink-faint); font-size: 12px; flex: none; }
.zone .files .x {
  flex: none; border: 0; background: none; color: var(--ink-faint);
  cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px; visibility: hidden;
}
.zone .files .row:hover .x { visibility: visible; }
.zone .files .x:hover { color: var(--bad); }
.zone .empty { color: var(--ink-faint); font-size: 13px; padding: 6px; }
.zone .acts { display: flex; gap: 8px; align-items: center; }
.zone .count { margin-left: auto; font-size: 12px; color: var(--ink-faint); }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left; font-weight: 600; color: var(--ink-soft); font-size: 12px;
  letter-spacing: .3px; padding: 8px 10px; border-bottom: 1.5px solid var(--line);
  white-space: nowrap;
}
td { padding: 7px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tr:hover td { background: #fbfcfd; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
td select { padding: 5px 8px; font-size: 13px; width: 100%; }

/* The check table: fixed columns so the dropdowns are not squeezed, with the
   reasoning column taking whatever is left. */
#diagTable { table-layout: fixed; min-width: 1000px; }
#diagTable th:nth-child(1), #diagTable td:nth-child(1) { width: 22%; }
#diagTable th:nth-child(2), #diagTable td:nth-child(2) { width: 62px; }
#diagTable th:nth-child(3), #diagTable td:nth-child(3) { width: 15%; }
#diagTable th:nth-child(4), #diagTable td:nth-child(4) { width: 15%; }
#diagTable th:nth-child(5), #diagTable td:nth-child(5) { width: 10%; }
#diagTable th:nth-child(6), #diagTable td:nth-child(6) { width: 68px; }
#diagTable td:nth-child(1) { word-break: break-word; }
.fname { font-size: 13px; }
.fname small { display: block; color: var(--ink-faint); font-size: 11.5px; }

/* ---------- badges ---------- */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.badge.high { background: var(--ok-soft); color: var(--ok); }
.badge.medium { background: var(--warn-soft); color: var(--warn); }
.badge.low { background: var(--bad-soft); color: var(--bad); }
.badge.plain { background: var(--ground); color: var(--ink-soft); }

/* ---------- notes ---------- */
.note {
  border-left: 3px solid var(--accent); background: var(--accent-soft);
  padding: 11px 14px; border-radius: 0 7px 7px 0; font-size: 13.5px;
  margin: 14px 0; color: var(--accent-ink);
}
.note.warn { border-color: var(--warn); background: var(--warn-soft); color: var(--warn); }
.note.bad { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
.note.ok { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.why { color: var(--ink-faint); font-size: 12px; }

/* ---------- progress ---------- */
.bar { height: 7px; background: var(--line-soft); border-radius: 20px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); width: 0;
           transition: width .4s ease; border-radius: 20px; }
.progress-line { display: flex; gap: 10px; align-items: baseline; font-size: 13.5px;
                 margin-bottom: 8px; }
.progress-line .pct { margin-left: auto; color: var(--ink-faint);
                      font-variant-numeric: tabular-nums; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px,1fr)); gap: 1px;
         background: var(--line-soft); border: 1px solid var(--line-soft);
         border-radius: 8px; overflow: hidden; margin-bottom: 16px; }
.stats div { background: var(--card); padding: 12px 14px; }
.stats .k { font-size: 12px; color: var(--ink-faint); }
.stats .v { font-size: 20px; font-weight: 650; letter-spacing: -.4px;
            font-variant-numeric: tabular-nums; }
.stats .v small { font-size: 12px; font-weight: 400; color: var(--ink-faint); }

/* ---------- year cards ---------- */
.years { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px,1fr)); gap: 16px; }
.ycard { display: block; background: var(--card); border: 1px solid var(--line);
         border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
         color: inherit; transition: border-color .12s, transform .12s; }
.ycard:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.ycard .y { font-size: 24px; font-weight: 700; letter-spacing: -.5px; }
.ycard .y span { font-size: 14px; font-weight: 400; color: var(--ink-faint); }
.ycard .meta { color: var(--ink-soft); font-size: 13px; margin-top: 8px; }

/* ---------- results ---------- */
.files-out { list-style: none; padding: 0; margin: 0; }
.files-out li { display: flex; align-items: center; gap: 10px; padding: 9px 2px;
                border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.files-out li:last-child { border-bottom: 0; }
.files-out .sz { margin-left: auto; color: var(--ink-faint); font-size: 12.5px; }

.rowline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--ink-faint); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.hide { display: none !important; }
.scroll { overflow-x: auto; }

@media (max-width: 820px) {
  .zones { grid-template-columns: 1fr; }
  .wrap { padding: 0 14px 60px; }
}
