:root {
  color-scheme: light;
  --bg: #f5f7f6;
  --surface: #ffffff;
  --surface-2: #eef3f2;
  --ink: #20272b;
  --muted: #667075;
  --line: #dfe6e4;
  --line-strong: #c8d5d2;
  --teal: #0b7772;
  --teal-soft: #e3f2f0;
  --coral: #c85f4c;
  --coral-soft: #fbeae5;
  --amber: #b87a18;
  --amber-soft: #f8edda;
  --green: #2f855a;
  --green-soft: #e4f2e9;
  --violet: #665f91;
  --shadow: 0 18px 50px rgba(32, 39, 43, 0.08);
  --radius: 8px;
  --sidebar: 256px;
  --font: Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
}

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

button {
  cursor: pointer;
}

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

.sidebar {
  min-width: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  background: #ffffff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  min-height: 44px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--teal);
  color: #ffffff;
  font-weight: 800;
}

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

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

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

.nav-link {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  text-decoration: none;
}

.nav-link svg,
.icon-button svg,
.button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.nav-link[aria-current="page"] {
  background: var(--teal-soft);
  color: var(--teal);
  font-weight: 700;
}

.nav-link:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.sidebar-note {
  margin-top: auto;
  padding: 14px;
  border-radius: 8px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.sidebar-note strong {
  color: var(--teal);
}

.main-shell {
  min-width: 0;
  padding: 24px 28px 40px;
}

.topbar {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--teal);
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 28px;
  line-height: 1.2;
}

h2 {
  font-size: 20px;
  line-height: 1.3;
  margin-bottom: 14px;
}

h3 {
  font-size: 16px;
  margin-bottom: 10px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.search-box {
  width: min(360px, 34vw);
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-box input {
  border: 0;
  outline: 0;
  background: transparent;
  min-width: 0;
  width: 100%;
  color: var(--ink);
}

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

.hero {
  min-width: 0;
  min-height: 238px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  background: #dfe9e7;
  box-shadow: var(--shadow);
}

.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0.92) 0%, rgba(255,255,255,0.72) 42%, rgba(255,255,255,0.08) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(620px, 72%);
  padding: 30px;
  min-width: 0;
}

.hero h2 {
  font-size: 30px;
  margin-bottom: 10px;
  overflow-wrap: anywhere;
}

.hero p {
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 18px;
  overflow-wrap: anywhere;
}

.hero-actions,
.form-actions,
.section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.button,
.icon-button,
.chip-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  text-decoration: none;
  white-space: nowrap;
}

.button.primary {
  border-color: var(--teal);
  background: var(--teal);
  color: #ffffff;
}

.button.coral {
  border-color: var(--coral);
  background: var(--coral);
  color: #ffffff;
}

.button.ghost {
  background: transparent;
}

.icon-button {
  width: 38px;
  padding: 0;
}

.icon-button.danger {
  color: var(--coral);
}

.button:hover,
.icon-button:hover,
.chip-button:hover {
  border-color: var(--line-strong);
  box-shadow: 0 5px 18px rgba(32, 39, 43, 0.07);
}

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

.grid > * {
  min-width: 0;
}

.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 {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 12px 35px rgba(32, 39, 43, 0.04);
}

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

.panel-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.metric {
  min-height: 116px;
  display: grid;
  align-content: space-between;
  gap: 12px;
}

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

.metric strong {
  font-size: 32px;
  line-height: 1;
}

.metric .metric-foot {
  min-height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.metric .metric-foot i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.metric.warn .metric-foot i {
  background: var(--amber);
}

.metric.hot .metric-foot i {
  background: var(--coral);
}

.task-list {
  display: grid;
  gap: 8px;
}

.task-row {
  min-height: 58px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.task-row.is-done {
  background: #f8faf9;
  color: var(--muted);
}

.task-row.is-overdue {
  border-color: #edb6aa;
  background: #fff8f6;
}

.check {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  display: grid;
  place-items: center;
  background: var(--surface);
}

.check input {
  width: 16px;
  height: 16px;
  accent-color: var(--teal);
}

.task-main {
  min-width: 0;
}

.task-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.task-title-line strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-meta {
  margin-top: 5px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.pill.high {
  background: var(--coral-soft);
  color: var(--coral);
}

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

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

.tabs,
.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tab,
.segment {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
}

.tab.is-active,
.segment.is-active {
  border-color: var(--teal);
  color: var(--teal);
  background: var(--teal-soft);
  font-weight: 800;
}

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

.field {
  display: grid;
  gap: 6px;
}

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

.field label,
.table-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.field input,
.field select,
.field textarea,
.cell-input,
.cell-select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 10px;
  outline: none;
}

.field textarea {
  min-height: 98px;
  resize: vertical;
  padding: 10px;
  line-height: 1.5;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.cell-input:focus,
.cell-select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(11, 119, 114, 0.12);
}

.salary-card {
  min-height: 118px;
  border-radius: 8px;
  background: var(--teal-soft);
  color: var(--teal);
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 18px;
  margin-bottom: 12px;
}

.salary-card span,
.salary-card p,
.salary-option small {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.salary-card strong {
  color: var(--ink);
  font-size: 30px;
  line-height: 1;
}

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

.salary-option {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 4px;
  background: #ffffff;
}

.salary-option.is-active {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.salary-option span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.salary-option strong {
  font-size: 16px;
  line-height: 1.2;
}

.info-list {
  display: grid;
  gap: 8px;
}

.info-list div {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

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

.info-list span {
  color: var(--ink);
  line-height: 1.45;
}

.table-wrap {
  min-width: 0;
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

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

th {
  color: var(--muted);
  font-size: 12px;
  background: #f9fbfa;
  position: sticky;
  top: 0;
  z-index: 1;
}

td strong {
  display: block;
}

.cell-input.number {
  max-width: 92px;
}

.cell-input.money {
  max-width: 118px;
}

.cell-select {
  max-width: 132px;
}

.empty-state {
  min-height: 140px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  padding: 24px;
}

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

.check-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
}

.check-items {
  display: grid;
  gap: 8px;
}

.check-item {
  min-height: 34px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  color: var(--ink);
  line-height: 1.45;
}

.check-item input {
  margin-top: 3px;
  accent-color: var(--teal);
}

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

.timeline-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.timeline-date {
  min-height: 34px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--teal);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12px;
}

.template-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px 100px;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.template-row:last-child {
  border-bottom: 0;
}

.switch {
  display: inline-grid;
  grid-template-columns: 44px auto;
  align-items: center;
  gap: 8px;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch span:first-of-type {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #cbd6d3;
  position: relative;
  transition: background 0.2s ease;
}

.switch span:first-of-type::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 0.2s ease;
}

.switch input:checked + span:first-of-type {
  background: var(--teal);
}

.switch input:checked + span:first-of-type::after {
  transform: translateX(20px);
}

.progress {
  height: 10px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.progress i {
  display: block;
  height: 100%;
  background: var(--teal);
  border-radius: inherit;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(360px, calc(100vw - 44px));
  padding: 12px 14px;
  border-radius: 8px;
  background: #20272b;
  color: #ffffff;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 20;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

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

.right {
  text-align: right;
}

.nowrap {
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .grid.cols-4,
  .grid.cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .sidebar {
    position: static;
    height: auto;
    padding: 14px;
    gap: 12px;
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
  }

  .brand {
    min-height: 40px;
  }

  .nav-list {
    width: 100%;
    max-width: 100%;
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .nav-link {
    width: auto;
    flex: 0 0 auto;
  }

  .sidebar-note {
    display: none;
  }

  .main-shell {
    padding: 18px 14px 32px;
  }

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

  .topbar-actions {
    width: 100%;
  }

  .search-box {
    width: 100%;
  }

  .hero {
    min-height: 300px;
  }

  .hero::after {
    background: linear-gradient(180deg, rgba(255,255,255,0.94) 0%, rgba(255,255,255,0.74) 55%, rgba(255,255,255,0.16) 100%);
  }

  .hero-content {
    width: 100%;
    padding: 22px;
  }

  .hero h2 {
    font-size: 24px;
  }

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

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

  .info-list div {
    grid-template-columns: 1fr;
  }

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

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

  .task-row .section-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

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