:root {
  --bg: #f4f6f2;
  --paper: #ffffff;
  --ink: #202522;
  --muted: #65716c;
  --line: #dfe5de;
  --brand: #167c72;
  --brand-dark: #105950;
  --amber: #b8781d;
  --blue: #315f9c;
  --red: #a63d3d;
  --green: #3c7a42;
  --shadow: 0 10px 28px rgba(38, 51, 44, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 248px;
  padding: 22px 18px;
  background: #1c2d2a;
  color: #f5faf7;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-weight: 800;
}

.brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}

.nav {
  display: grid;
  gap: 6px;
  margin-top: 26px;
}

.nav a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 8px;
  color: #c7d6d1;
}

.nav a.active,
.nav a:hover {
  background: #284640;
  color: #fff;
}

.main {
  margin-left: 248px;
  padding: 32px;
}

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

.page-head h1 {
  margin: 4px 0 0;
  font-size: 30px;
  line-height: 1.2;
}

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

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

.button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
}

.button {
  padding: 0 14px;
}

.button.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

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

.panel,
.stat,
.calendar-shell {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.panel {
  padding: 18px;
  margin-bottom: 18px;
}

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

.panel-head h2 {
  margin: 0;
  font-size: 18px;
}

.panel-head a,
.panel-head span {
  color: var(--muted);
  font-size: 14px;
}

.stat-grid,
.grid.two {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

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

.stat {
  padding: 16px;
}

.stat span,
.meta-grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.stat strong {
  display: block;
  margin-top: 8px;
  color: var(--blue);
  font-size: 32px;
}

.stat.amber strong {
  color: var(--amber);
}

.stat.green strong {
  color: var(--green);
}

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

.list-row,
.timeline-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.list-row:last-child,
.timeline-item:last-child {
  border-bottom: 0;
}

.list-row div,
.timeline-item {
  min-width: 0;
}

.list-row strong,
.timeline-item strong {
  display: block;
  overflow-wrap: anywhere;
}

.list-row span,
.timeline-item span,
.timeline-item time {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

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

.timeline-item {
  align-items: flex-start;
  flex-direction: column;
}

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

.bar-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  background: #edf0ed;
  color: var(--ink);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.chip.high {
  background: #fff0da;
  color: #7a4b11;
}

.chip.urgent {
  background: #ffe5e1;
  color: #8f2f2a;
}

.chip.low {
  background: #e6effb;
  color: #274f87;
}

.chip.normal {
  background: #e7f2ee;
  color: #166053;
}

.filters,
.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filters input,
.filters select,
.inline-form select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 12px;
}

.filters input {
  flex: 1 1 280px;
}

.upload-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

label.wide {
  grid-column: 1 / -1;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 9px 11px;
}

textarea {
  resize: vertical;
}

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

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

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

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

td {
  overflow-wrap: anywhere;
}

td a {
  color: var(--brand-dark);
  font-weight: 800;
}

.player {
  width: 100%;
  margin-bottom: 14px;
}

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

.meta-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.meta-grid strong {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
}

.preline,
.transcript {
  margin: 0;
  line-height: 1.7;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.transcript {
  max-height: 460px;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.insight {
  display: grid;
  gap: 8px;
  margin: 0;
}

.insight dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.insight dd {
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}

.calendar-shell {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-bottom: 18px;
  background: var(--line);
}

.weekday,
.day {
  background: #fff;
}

.weekday {
  min-height: 38px;
  padding: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.day {
  min-height: 132px;
  padding: 10px;
}

.day strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.day.today strong {
  background: var(--brand);
  color: #fff;
}

.muted-day {
  background: #f7f8f5;
  color: #9aa39f;
}

.event-pill {
  display: block;
  margin-top: 7px;
  padding: 5px 7px;
  border-radius: 6px;
  background: #e8f2ee;
  color: #145f54;
  font-size: 12px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.more {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.empty {
  margin: 0;
  color: var(--muted);
}

.flash-stack {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.flash {
  border-radius: 8px;
  padding: 10px 12px;
  background: #e8f2ee;
  color: #145f54;
  font-weight: 700;
}

.flash.error {
  background: #ffe5e1;
  color: #8f2f2a;
}

.flash.warning {
  background: #fff0da;
  color: #7a4b11;
}

.flash.info {
  background: #e6effb;
  color: #274f87;
}

.code-block {
  overflow-x: auto;
  margin: 0;
  border-radius: 8px;
  background: #202522;
  color: #f6faf6;
  padding: 16px;
  line-height: 1.6;
}

@media (max-width: 980px) {
  .sidebar {
    position: static;
    width: auto;
  }

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

  .main {
    margin-left: 0;
    padding: 22px;
  }

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

@media (max-width: 640px) {
  .main {
    padding: 16px;
  }

  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-head h1 {
    font-size: 24px;
  }

  .stat-grid,
  .grid.two,
  .upload-form,
  .meta-grid {
    grid-template-columns: 1fr;
  }

  .calendar-shell {
    display: block;
    background: transparent;
  }

  .weekday {
    display: none;
  }

  .day {
    min-height: auto;
    margin-bottom: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
  }

  .muted-day {
    display: none;
  }
}

/* ── 인증 / 사용자 ─────────────────────────────── */
.nav-title {
  margin: 26px 12px 8px;
  color: #8fa8a1;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  margin-left: auto;
  padding: 0 7px;
  border-radius: 11px;
  background: var(--amber);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.sidebar-user {
  position: absolute;
  inset: auto 18px 22px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid #2f4a44;
}

.sidebar-user strong {
  display: block;
  font-size: 14px;
}

.sidebar-user small {
  color: #8fa8a1;
  font-size: 12px;
}

.link-button {
  padding: 6px 10px;
  border: 1px solid #2f4a44;
  border-radius: 8px;
  background: transparent;
  color: #c7d6d1;
  cursor: pointer;
}

.link-button:hover {
  background: #284640;
  color: #fff;
}

.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-page {
  width: 100%;
  max-width: 420px;
}

.auth-card {
  padding: 32px 30px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.auth-card h1 {
  margin: 4px 0 16px;
  font-size: 24px;
}

.auth-brand {
  margin-bottom: 20px;
  color: var(--ink);
}

.auth-brand img {
  border: 1px solid var(--line);
}

.auth-note {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.auth-form,
.stack-form {
  display: grid;
  gap: 12px;
}

.button.wide {
  width: 100%;
}

.button.danger {
  border-color: var(--red);
  color: var(--red);
}

.auth-foot {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.auth-foot a {
  color: var(--brand-dark);
  font-weight: 800;
}

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

.swagger-panel {
  padding: 0;
  overflow: hidden;
}

.swagger-panel .swagger-ui .topbar {
  display: none;
}

.copy-status {
  align-self: center;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.copy-status.error {
  color: var(--red);
}
