:root {
  color-scheme: light;
  font-family: "Segoe UI", "Noto Sans KR", system-ui, sans-serif;
  background: #f5f7f8;
  color: #17202a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

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

.nav {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 26px;
  padding: 24px;
  border-right: 1px solid #d9dee5;
  background: #ffffff;
}

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

.brand.large {
  margin-bottom: 28px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #0f766e;
  color: #ffffff;
  font-weight: 900;
}

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

.brand small {
  margin-top: 3px;
  color: #667085;
}

.nav nav {
  display: grid;
  align-content: start;
  gap: 8px;
}

.nav-link,
.text-button,
.link-button {
  border: 0;
  background: transparent;
  color: #334155;
}

.nav-link {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  text-align: left;
}

.nav-link:hover,
.nav-link:focus-visible {
  background: #edf7f6;
  color: #0f766e;
}

.nav-footer {
  display: grid;
  gap: 10px;
  color: #667085;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  font-weight: 700;
}

.content {
  min-width: 0;
  padding: 28px;
}

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

.page-header h1,
.login-panel h1,
.sign-panel h1 {
  margin: 0;
  line-height: 1.2;
  letter-spacing: 0;
}

.page-header p,
.login-panel p,
.sign-panel p {
  margin: 8px 0 0;
  color: #667085;
  line-height: 1.6;
}

.eyebrow {
  margin: 0 0 7px;
  color: #0f766e;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid #0f766e;
  border-radius: 8px;
  background: #0f766e;
  color: #ffffff;
  font-weight: 800;
}

.button.secondary {
  border-color: #cbd5e1;
  background: #ffffff;
  color: #334155;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat,
.panel,
.table-section,
.login-panel,
.sign-panel {
  border: 1px solid #d9dee5;
  border-radius: 8px;
  background: #ffffff;
}

.stat {
  padding: 18px;
}

.stat strong {
  display: block;
  font-size: 28px;
}

.stat span {
  color: #667085;
  font-size: 14px;
}

.table-section,
.panel {
  padding: 18px;
}

.section-title,
.panel h2 {
  margin: 0 0 14px;
}

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

.campaign-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 260px) auto;
  gap: 14px;
  align-items: center;
  width: 100%;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  text-align: left;
}

.campaign-row:hover {
  border-color: #0f766e;
}

.campaign-row strong,
.campaign-row span,
.data-row strong,
.data-row small {
  display: block;
}

.campaign-row span,
.data-row small {
  margin-top: 4px;
  color: #667085;
}

.progress-cell {
  min-width: 0;
}

.progress {
  height: 8px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.progress i {
  display: block;
  height: 100%;
  background: #0f766e;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #edf7f6;
  color: #0f766e;
  font-size: 13px;
  font-weight: 900;
}

.empty {
  padding: 28px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  color: #667085;
  text-align: center;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: #334155;
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 11px;
  background: #ffffff;
  color: #17202a;
}

textarea {
  resize: vertical;
}

.hint {
  color: #667085;
  font-size: 13px;
  line-height: 1.6;
}

.file-drop {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 96px;
  border: 1px dashed #94a3b8;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
}

.file-drop input {
  display: none;
}

.manual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.recipient-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.recipient-preview span {
  padding: 6px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  color: #475569;
  font-size: 13px;
}

.data-table {
  display: grid;
  gap: 8px;
}

.data-head,
.data-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(150px, 1fr) 110px 100px;
  gap: 12px;
  align-items: center;
}

.data-head {
  color: #667085;
  font-size: 13px;
  font-weight: 900;
}

.data-row {
  padding: 12px 0;
  border-top: 1px solid #e2e8f0;
}

.status {
  display: inline-flex;
  width: fit-content;
  min-height: 28px;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: #eef2f7;
  color: #334155;
  font-size: 13px;
  font-weight: 900;
}

.status.signed {
  background: #e9f8ef;
  color: #16803f;
}

.status.viewed {
  background: #fff7df;
  color: #9a6200;
}

.status.expired {
  background: #fff1f2;
  color: #be123c;
}

.link-button {
  padding: 0;
  color: #0f766e;
  font-weight: 900;
  text-align: left;
}

.login-screen,
.sign-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #f5f7f8;
}

.login-panel,
.sign-panel {
  width: min(100%, 520px);
  padding: 28px;
}

.sign-panel.wide {
  width: min(100%, 920px);
}

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

.document-body {
  min-height: 180px;
  margin: 18px 0;
  padding: 18px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fbfcfd;
  color: #1f2937;
  line-height: 1.75;
  white-space: pre-wrap;
}

.identity-box {
  display: grid;
  gap: 5px;
  padding: 12px;
  border-radius: 8px;
  background: #edf7f6;
}

.identity-box span {
  color: #475569;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
}

.check-row input {
  width: 18px;
  height: 18px;
}

.signature-box {
  position: relative;
  margin-bottom: 14px;
}

.signature-box canvas {
  display: block;
  width: 100%;
  height: 240px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  touch-action: none;
}

.sign-placeholder {
  position: absolute;
  top: 50%;
  left: 50%;
  color: #94a3b8;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.signature-box .text-button {
  margin-top: 8px;
}

.complete-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: #e9f8ef;
  color: #16803f;
}

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

  .nav {
    grid-template-rows: auto;
    border-right: 0;
    border-bottom: 1px solid #d9dee5;
  }

  .stats,
  .form-grid,
  .campaign-row,
  .data-head,
  .data-row {
    grid-template-columns: 1fr;
  }

  .page-header,
  .sign-header {
    display: grid;
  }

  .manual-grid {
    grid-template-columns: 1fr;
  }
}
