:root {
  --ink: #1b1f24;
  --muted: #6b7480;
  --line: #dfe3e8;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --brand: #1f3864;
  --brand-soft: #e8eef8;
  --warn: #b45309;
  --danger: #b91c1c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Pretendard", "Apple SD Gothic Neo", "맑은 고딕", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.55;
}

a { color: var(--brand); }

header.app {
  background: var(--brand);
  color: #fff;
  padding: 14px 28px;
  display: flex;
  align-items: baseline;
  gap: 16px;
}
header.app a { color: #fff; text-decoration: none; font-weight: 600; }
header.app .sub { color: #b9c6df; font-size: 12px; }

main { max-width: 1180px; margin: 24px auto 64px; padding: 0 20px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px 22px;
  margin-bottom: 20px;
}
.panel > h2 { margin: 0 0 4px; font-size: 17px; }
.panel > h2 + p.hint { margin-top: 0; }

h1 { font-size: 22px; margin: 0 0 6px; }
h3 { font-size: 14px; margin: 22px 0 8px; color: var(--brand); }
p.hint { color: var(--muted); font-size: 12.5px; margin: 4px 0 14px; }

table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { border: 1px solid var(--line); padding: 6px 9px; text-align: left; vertical-align: middle; }
th { background: var(--brand-soft); font-weight: 600; white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.c, th.c { text-align: center; }
tbody tr:nth-child(even) { background: #fbfcfd; }

.grid { display: grid; gap: 14px; }
.grid.k2 { grid-template-columns: repeat(2, 1fr); }
.grid.k3 { grid-template-columns: repeat(3, 1fr); }
.grid.k4 { grid-template-columns: repeat(4, 1fr); }

.kpi { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; background: #fff; }
.kpi .label { font-size: 12px; color: var(--muted); }
.kpi .value { font-size: 22px; font-weight: 700; margin-top: 2px; }
.kpi .note { font-size: 12px; color: var(--muted); }

label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 3px; }
input[type=text], input[type=number], input[type=date], input[type=file], textarea, select {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  background: #fff;
}
textarea { min-height: 84px; resize: vertical; }
.field { margin-bottom: 12px; }

.btn {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn.ghost { background: #fff; color: var(--brand); }
.btn.danger { background: #fff; color: var(--danger); border-color: #f0c8c8; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; }
.flash.notice { background: #e7f3ea; border: 1px solid #b7dcc2; }
.flash.alert { background: #fdecec; border: 1px solid #f2c2c2; color: var(--danger); }

.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.tag.g1 { background: #f4b183; }
.tag.g2 { background: #ffd966; }
.tag.g3 { background: #c6e0b4; }
.tag.g4 { background: #deebf7; }
.tag.g0 { background: #eceff2; color: var(--muted); }

.photos { display: flex; gap: 12px; flex-wrap: wrap; }
.photo { width: 150px; }
.photo img { width: 100%; border: 1px solid var(--line); border-radius: 6px; display: block; }
.photo input[type=text] { margin-top: 4px; font-size: 12px; }
.photo .rm { font-size: 12px; color: var(--danger); display: flex; gap: 4px; align-items: center; margin-top: 3px; }
.photo .rm input { width: auto; }

.empty { color: var(--muted); padding: 18px; text-align: center; border: 1px dashed var(--line); border-radius: 8px; }
.scroll { overflow-x: auto; }

/* ── 포털 첫 화면 ─────────────────────────────────────────────────────── */
header.app .brand { font-weight: 600; }
header.app .sep { color: #7f93bb; }
header.app .current { color: #cdd8ec; font-size: 13px; }

.hero { margin: 8px 0 22px; }
.hero h1 { font-size: 24px; margin: 0 0 4px; }
.hero p { color: var(--muted); margin: 0; }

.projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 16px;
}

.project {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px 22px;
  text-decoration: none;
  color: inherit;
  transition: border-color .12s, box-shadow .12s, transform .12s;
}
a.project:hover {
  border-color: var(--brand);
  box-shadow: 0 6px 18px rgba(31, 56, 100, .10);
  transform: translateY(-2px);
}
.project.is-planned { opacity: .6; }

.project-head { display: flex; align-items: flex-start; gap: 12px; }
.project-icon { font-size: 26px; line-height: 1.1; }
.project-head h2 { font-size: 16px; margin: 0; }
.project-legal { font-size: 11.5px; color: var(--muted); margin: 2px 0 0; }
.project-head .badge {
  margin-left: auto;
  background: #eceff2;
  color: var(--muted);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.project-summary { font-size: 13px; color: #4a525c; margin: 14px 0 10px; }
.project-details { margin: 0; padding-left: 17px; font-size: 12.5px; color: var(--muted); }
.project-details li { margin-bottom: 2px; }
.project-go { display: inline-block; margin-top: 14px; font-size: 13px; font-weight: 600; color: var(--brand); }
