:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #eef3f0;
  --ink: #071323;
  --muted: #667085;
  --line: #d8dee6;
  --accent: #23c483;
  --accent-dark: #087a55;
  --blue: #2d65a3;
  --red: #bd3f43;
  --shadow: 0 18px 44px rgba(7, 19, 35, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter,
    "Noto Sans KR",
    "Apple SD Gothic Neo",
    "Malgun Gothic",
    system-ui,
    sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 40px;
  line-height: 1;
}

h2 {
  font-size: 28px;
  line-height: 1.25;
}

h3 {
  font-size: 19px;
  line-height: 1.3;
}

.eyebrow {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
  height: 100vh;
  padding: 28px 20px;
  background: var(--ink);
  color: #fff;
}

.brand {
  display: grid;
  gap: 8px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.brand p:last-child {
  color: rgba(255, 255, 255, 0.68);
  font-size: 14px;
}

.profile-mini,
.admin-wallet {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.profile-mini p,
.admin-wallet p {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
}

.status-dot {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--red);
}

.status-dot.is-ready {
  background: var(--accent);
}

.entry-nav {
  display: grid;
  gap: 10px;
}

.nav-button,
.ghost-button,
.primary-button {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 800;
}

.nav-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 0 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.68);
  text-align: left;
}

.nav-button span {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
  font-size: 12px;
}

.nav-button.is-active {
  background: #fff;
  color: var(--ink);
}

.nav-button.is-active span {
  background: var(--accent);
  color: var(--ink);
}

.side-note {
  display: grid;
  gap: 6px;
  margin-top: auto;
  padding: 14px;
  border-radius: 8px;
  background: rgba(35, 196, 131, 0.12);
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
}

.side-note strong {
  color: #fff;
}

.main-shell {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.topbar,
.hero-panel,
.section-heading,
.actions-row,
.info-list div {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  padding: 18px 0;
}

.topbar h2 {
  margin-top: 6px;
  max-width: 680px;
}

.top-actions,
.actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.workspace {
  display: grid;
  gap: 18px;
}

.is-hidden {
  display: none;
}

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

.hero-panel {
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  overflow: hidden;
}

.hero-panel p:not(.eyebrow) {
  margin-top: 8px;
  color: var(--muted);
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 10px;
}

.hero-metrics article {
  display: grid;
  gap: 7px;
  min-width: 130px;
  padding: 16px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.hero-metrics strong {
  font-size: 20px;
}

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

.admin-wallet {
  min-width: 230px;
  background: var(--ink);
}

.primary-button {
  padding: 0 16px;
  background: var(--accent-dark);
  color: #fff;
  border-color: var(--accent-dark);
}

.primary-button:not(:disabled):hover {
  background: #075f43;
}

.ghost-button {
  padding: 0 16px;
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

.primary-button:disabled,
.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.compact {
  min-height: 36px;
  padding: 0 12px;
}

.status-grid,
.task-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

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

.metric-card {
  padding: 18px;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
}

.task-panel,
.records-panel {
  padding: 22px;
}

.section-heading {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  background: #e8f1fb;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.badge.is-error {
  background: #fae8e8;
  color: var(--red);
}

.info-list {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
}

.info-list div {
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.info-list dt {
  color: var(--muted);
  font-size: 13px;
}

.info-list dd {
  margin: 0;
  font-weight: 800;
  text-align: right;
}

.full-width {
  width: 100%;
}

.task-panel > .full-width + .full-width {
  margin-top: 8px;
}

.file-drop {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 18px;
  border: 1px dashed #96b6a7;
  border-radius: 8px;
  background: #f5fbf8;
}

.file-drop span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.file-drop strong {
  align-self: end;
}

input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.field-label {
  display: block;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.text-input {
  width: 100%;
  min-height: 42px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

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

.review-detail {
  min-height: 104px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f5fbf8;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.review-detail strong {
  color: var(--ink);
}

.file-list {
  min-height: 48px;
  margin: 12px 0 16px;
  padding: 0;
  list-style: none;
}

.file-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

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

.records-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.compact-table {
  min-width: 520px;
}

.row-action {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.records-table th,
.records-table td {
  padding: 14px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.records-table th {
  color: var(--muted);
  font-size: 13px;
}

.empty-row {
  color: var(--muted);
  text-align: center;
}

.toast-area {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100% - 40px));
  z-index: 20;
}

.toast {
  border-left: 5px solid var(--blue);
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
}

.toast-success {
  border-left-color: var(--accent);
}

.toast-error {
  border-left-color: var(--red);
}

.toast-pending {
  border-left-color: var(--blue);
}

.toast strong {
  display: block;
  margin-bottom: 4px;
}

.toast p {
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
}

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

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

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

  .hero-panel,
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-metrics,
  .status-grid,
  .task-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .main-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 16px;
  }

  .sidebar {
    padding: 22px 16px;
  }

  .entry-nav,
  .hero-metrics,
  .status-grid,
  .task-grid,
  .top-actions,
  .actions-row {
    grid-template-columns: 1fr;
  }

  .top-actions,
  .actions-row {
    align-items: stretch;
    flex-direction: column;
  }

  h1 {
    font-size: 34px;
  }

  h2 {
    font-size: 23px;
  }
}
