:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #f2f6f3;
  --ink: #1f2523;
  --muted: #68716d;
  --line: #dfe4df;
  --green: #1d6b54;
  --green-soft: #dcebe4;
  --blue: #235f85;
  --blue-soft: #ddeaf2;
  --amber: #9d651b;
  --amber-soft: #f4ead9;
  --red: #a9443f;
  --red-soft: #f6dfdc;
  --shadow: 0 14px 34px rgba(31, 37, 35, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    "Inter", "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui,
    sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  background: #17211e;
  color: #f8faf8;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f4d36f;
  color: #17211e;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: #b9c6c0;
  font-size: 12px;
  margin-top: 2px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-list a {
  padding: 11px 12px;
  border-radius: 8px;
  color: #dbe6e1;
}

.nav-list a.active,
.nav-list a:hover {
  background: rgba(255, 255, 255, 0.11);
  color: #ffffff;
}

.sidebar-note {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.sidebar-note p {
  margin: 6px 0 0;
  color: #cdd8d3;
  font-size: 13px;
}

.main {
  min-width: 0;
  padding: 32px;
}

.page {
  max-width: 1180px;
  margin: 0 auto;
}

.app-shell.public-view {
  grid-template-columns: minmax(0, 1fr);
}

.public-view .sidebar {
  display: none;
}

.public-view .page {
  max-width: 920px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 34px;
  line-height: 1.18;
}

h2 {
  font-size: 22px;
}

h3 {
  font-size: 17px;
}

.subtle {
  color: var(--muted);
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 14px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
}

.btn.primary {
  background: var(--green);
  color: #ffffff;
}

.btn.secondary {
  border-color: var(--line);
}

.btn.blue {
  background: var(--blue);
  color: #ffffff;
}

.btn.danger {
  background: var(--red-soft);
  color: var(--red);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.panel,
.card,
.form-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 20px;
}

.card {
  padding: 16px;
}

.metric {
  display: grid;
  gap: 4px;
}

.metric strong {
  font-size: 30px;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.table-wrap {
  overflow-x: auto;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(180px, 0.8fr) auto auto;
  align-items: end;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-count {
  margin: 0;
  align-self: center;
  text-align: right;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status.green {
  background: var(--green-soft);
  color: var(--green);
}

.status.amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.status.red {
  background: var(--red-soft);
  color: var(--red);
}

.form-card {
  padding: 22px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  min-width: 0;
}

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  font-size: 13px;
  font-weight: 800;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 11px 12px;
  min-height: 42px;
}

.field textarea {
  min-height: 110px;
  resize: vertical;
}

.check-list {
  display: grid;
  gap: 10px;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
}

.check input {
  margin-top: 4px;
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  flex: 0 0 18px;
}

.split {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.4fr);
  gap: 18px;
  align-items: start;
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.tab {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
}

.tab.active {
  background: var(--ink);
  color: #ffffff;
}

.photo-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.upload-field {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px;
  border: 1px dashed #b8c5bd;
  border-radius: 8px;
  background: var(--surface-2);
  min-width: 0;
  overflow: hidden;
}

.upload-field input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 6px;
  background: transparent;
  border: 0;
}

.photo-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.photo-preview-item {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.photo-preview-item img,
.photo-asset img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
}

.photo-preview-item span,
.photo-asset figcaption {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-tile {
  min-height: 86px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(35, 95, 133, 0.18), transparent),
    #e8ede9;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 8px;
}

.photo-asset {
  display: block;
  margin: 0;
  padding: 6px;
  background: #eef2ef;
}

.question-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.question-no {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 900;
}

.question-item textarea {
  min-height: 70px;
}

.stack {
  display: grid;
  gap: 14px;
}

.task-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.task-row p {
  margin: 3px 0 0;
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline-item {
  padding-left: 14px;
  border-left: 3px solid var(--green-soft);
}

.timeline-item p {
  margin: 3px 0 0;
}

.article-preview {
  white-space: pre-wrap;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 18px;
}

.template-box {
  width: 100%;
  min-height: 230px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  padding: 14px;
  resize: vertical;
}

.empty {
  padding: 28px;
  border: 1px dashed #c9d2cc;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #17211e;
  color: #ffffff;
  box-shadow: var(--shadow);
  transform: translateY(120px);
  transition: transform 180ms ease;
  z-index: 20;
}

.toast.show {
  transform: translateY(0);
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .main {
    padding: 22px;
  }

  .public-view .main {
    padding: 18px;
  }

  .page-header,
  .split {
    grid-template-columns: 1fr;
    display: grid;
  }

  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4,
  .form-grid,
  .filter-bar {
    grid-template-columns: 1fr;
  }

  .filter-count {
    text-align: left;
  }
}
