:root {
  --bg: #f3ede3;
  --bg-accent: rgba(157, 111, 71, 0.1);
  --paper: #fffdf8;
  --paper-soft: #faf3e8;
  --line: #ddd0bf;
  --line-strong: #cbb69a;
  --ink: #2f2821;
  --muted: #74695d;
  --muted-strong: #61564a;
  --accent: #9d6f47;
  --accent-soft: #f3e4d2;
  --sage: #5f8067;
  --sage-soft: #e8f0e7;
  --amber: #b07b37;
  --amber-soft: #fff4e3;
  --rose: #a75b51;
  --rose-soft: #fbedeb;
  font-family: Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", ui-sans-serif, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% -5%, var(--bg-accent), transparent 30rem),
    radial-gradient(circle at 12% 100%, rgba(95, 128, 103, 0.1), transparent 28rem),
    var(--bg);
}

body.login-active {
  overflow: hidden;
}

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

button,
input {
  font: inherit;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 16px;
  border-right: 1px solid var(--line);
  background: rgba(249, 244, 236, 0.92);
  box-shadow: 10px 0 30px rgba(73, 55, 35, 0.06);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 24px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid #dcc8af;
  border-radius: 10px;
  overflow: hidden;
  background: #f8efe4;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand b {
  display: block;
  font-size: 14px;
  letter-spacing: -0.03em;
}

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

.nav-label {
  margin: 18px 8px 8px;
  color: #8d7863;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.sidebar nav {
  display: grid;
  gap: 3px;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border-radius: 10px;
  color: #675d52;
  font-size: 13px;
}

.sidebar nav a:hover,
.sidebar nav a.active {
  background: #eadfce;
  color: #463a2f;
}

.sidebar .icon {
  width: 18px;
  color: #8d7761;
  text-align: center;
}

.side-card {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 24px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #faf4ea;
}

.side-card b {
  display: block;
  font-size: 11px;
}

.side-card span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

main {
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: 34px 40px 60px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 26px;
}

.eyebrow {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1 {
  margin: 8px 0;
  font-size: clamp(30px, 3vw, 42px);
  letter-spacing: -0.055em;
  line-height: 1.05;
}

.sub {
  margin: 0;
  max-width: 50rem;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

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

.mode,
.ghost,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffaf3;
  color: var(--muted-strong);
  font-size: 12px;
}

.mode i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(176, 123, 55, 0.12);
}

.mode.live i {
  background: var(--sage);
  box-shadow: 0 0 0 4px rgba(95, 128, 103, 0.12);
}

.ghost {
  cursor: pointer;
}

.ghost:hover {
  border-color: var(--line-strong);
  background: #f4ebde;
}

.section {
  margin-top: 28px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-head h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.03em;
}

.section-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.count {
  flex: none;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffaf3;
  color: #7b6755;
  font-size: 10px;
  font-weight: 800;
}

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

.metric,
.panel,
.detail,
.login-panel,
.login-card,
.board-row,
.placeholder-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(145deg, #fffefa, #faf4ea);
  box-shadow: 0 8px 24px rgba(73, 55, 35, 0.05);
}

.metric {
  padding: 18px;
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
}

.metric-value {
  margin-top: 14px;
  font-size: 28px;
  font-weight: 760;
  letter-spacing: -0.05em;
}

.metric-note {
  margin-top: 5px;
  color: #7b7064;
  font-size: 11px;
  line-height: 1.5;
}

.panel {
  padding: 18px;
}

.panel h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: -0.02em;
}

.panel p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

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

.board-row {
  overflow: hidden;
}

.board-trigger {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border: 0;
  color: inherit;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.board-row:hover .board-trigger,
.board-row.is-open .board-trigger {
  background: #f8efe3;
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  padding: 6px 9px;
  border: 1px solid #d5c0a7;
  border-radius: 999px;
  background: #fff7ee;
  color: #78593f;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.row-copy {
  min-width: 0;
}

.row-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 760;
  letter-spacing: -0.02em;
}

.row-note {
  margin-top: 4px;
  color: #6d6359;
  font-size: 12px;
  line-height: 1.5;
}

.row-meta {
  color: #695d51;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  padding: 6px 8px;
  border: 1px solid #d9c9b7;
  border-radius: 999px;
  background: #fffaf3;
  color: #66594c;
  font-size: 10px;
  font-weight: 800;
  text-align: center;
  line-height: 1.2;
}

.badge.approval {
  border-color: #ddc092;
  background: var(--amber-soft);
  color: #87552d;
}

.badge.progress {
  border-color: #b6cab8;
  background: var(--sage-soft);
  color: #486a50;
}

.badge.hold {
  border-color: #d7aaa2;
  background: var(--rose-soft);
  color: #844943;
}

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

.action {
  padding: 9px 12px;
  border: 1px solid #ccb18f;
  border-radius: 10px;
  background: #f7eadb;
  color: #5f412b;
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
}

.action:hover {
  background: #eedac6;
}

.action.secondary {
  border-color: #d5c6b4;
  background: #f7f1e8;
  color: #63584d;
}

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

.detail {
  margin-top: 12px;
  padding: 18px;
}

.detail[hidden] {
  display: none;
}

.detail h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.03em;
}

.detail p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.detail-stack {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.step-box {
  padding: 14px 12px;
  border: 1px solid #e0d3c3;
  border-radius: 14px;
  background: #fffdf9;
}

.step-box strong {
  display: block;
  font-size: 12px;
}

.step-box span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.step-box.is-complete {
  border-color: #c6d9c8;
  background: #f3f8f3;
}

.step-box.is-current {
  border-color: #d9c09f;
  background: #fff5e9;
}

.step-box.is-blocked {
  border-color: #d9b0a9;
  background: #fff1ef;
}

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

.info-card {
  padding: 14px;
  border: 1px solid #e4d8c8;
  border-radius: 12px;
  background: #fffdf9;
}

.info-card h4 {
  margin: 0 0 10px;
  color: #815f44;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.info-item + .info-item {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #eee4d7;
}

.info-item b {
  display: block;
  color: #886648;
  font-size: 11px;
}

.info-item span {
  display: block;
  margin-top: 5px;
  color: #564c42;
  font-size: 12px;
  line-height: 1.55;
}

.inline-note {
  margin-top: 10px;
  color: #6b6258;
  font-size: 11px;
  line-height: 1.6;
}

.empty,
.placeholder-copy {
  padding: 18px;
  border: 1px dashed #dacdbd;
  border-radius: 12px;
  background: #fffaf4;
  color: #73685d;
  font-size: 12px;
  line-height: 1.65;
}

.placeholder-card {
  padding: 20px;
}

.placeholder-card h3 {
  margin: 0;
  font-size: 18px;
}

.placeholder-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: clamp(14px, 4vw, 24px);
  background:
    linear-gradient(135deg, rgba(244, 239, 230, 0.94), rgba(244, 236, 224, 0.88)),
    radial-gradient(circle at 18% 14%, rgba(95, 128, 103, 0.16), transparent 22rem),
    radial-gradient(circle at 88% 18%, rgba(157, 111, 71, 0.18), transparent 24rem);
  backdrop-filter: blur(16px);
}

.login-screen[hidden] {
  display: none;
}

.login-shell {
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 420px);
  gap: 18px;
  align-items: start;
}

.login-panel,
.login-card {
  padding: 28px;
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(255, 254, 250, 0.96), rgba(246, 238, 228, 0.94));
  box-shadow: 0 24px 80px rgba(73, 55, 35, 0.14);
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
}

.login-title {
  margin: 10px 0 0;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.08;
  letter-spacing: -0.05em;
}

.login-copy {
  margin: 14px 0 0;
  max-width: 42rem;
  color: #605549;
  font-size: 15px;
  line-height: 1.7;
}

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

.login-highlight {
  padding: 16px;
  border: 1px solid #e2d6c7;
  border-radius: 16px;
  background: rgba(255, 251, 245, 0.78);
}

.login-highlight strong {
  display: block;
  font-size: 12px;
}

.login-highlight span {
  display: block;
  margin-top: 6px;
  color: #6b6157;
  font-size: 12px;
  line-height: 1.6;
}

.login-card h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.login-card p {
  margin: 8px 0 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.login-card label {
  display: block;
  margin-bottom: 7px;
  color: #75685a;
  font-size: 12px;
}

.login-card input {
  width: 100%;
  padding: 12px;
  border: 1px solid #d5c6b4;
  border-radius: 11px;
  background: #fffdf8;
  color: var(--ink);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.login-card input:focus {
  outline: none;
  border-color: #b98c66;
  box-shadow: 0 0 0 4px rgba(185, 140, 102, 0.14);
}

.login-card button {
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(135deg, #d7b08a, #b47f5d);
  color: #2b1e15;
  font-weight: 800;
  cursor: pointer;
}

.login-card button:disabled {
  opacity: 0.7;
  cursor: wait;
}

.login-error {
  min-height: 18px;
  margin-top: 9px;
  color: var(--rose);
  font-size: 11px;
}

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

  .sidebar {
    position: relative;
    height: auto;
    padding: 16px;
  }

  .nav-label,
  .side-card {
    display: none;
  }

  .sidebar nav {
    display: flex;
    overflow: auto;
    gap: 4px;
  }

  .sidebar nav a {
    white-space: nowrap;
  }

  main {
    padding: 24px 18px 48px;
  }

  .summary,
  .info-grid,
  .login-highlights,
  .login-shell,
  .pipeline {
    grid-template-columns: 1fr;
  }

  .login-card {
    order: -1;
  }
}

@media (max-width: 720px) {
  .topbar {
    display: block;
  }

  .top-actions {
    margin-top: 16px;
  }

  .board-trigger {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .row-title {
    white-space: normal;
  }
}
