:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-strong: #eef3f7;
  --ink: #18212b;
  --muted: #657383;
  --line: #dce4ec;
  --brand: #0f8ea8;
  --brand-dark: #0b6173;
  --accent: #e66c32;
  --success: #1a8f5a;
  --danger: #c83c3c;
  --shadow: 0 18px 50px rgba(24, 33, 43, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", "Noto Sans KR", Arial, sans-serif;
}

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

button {
  cursor: pointer;
}

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

.sidebar {
  background: #10202c;
  color: #f7fbff;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  font-weight: 800;
}

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

.brand span {
  color: #9fb2c0;
  font-size: 13px;
  margin-top: 2px;
}

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

.nav-item {
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #d9e4eb;
  min-height: 42px;
  text-align: left;
  padding: 0 12px;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.sidebar-note {
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-note span,
.sidebar-note strong {
  display: block;
}

.sidebar-note span {
  color: #9fb2c0;
  font-size: 13px;
}

.sidebar-note strong {
  margin-top: 6px;
  font-size: 26px;
}

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

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

.eyebrow {
  margin: 0 0 6px;
  color: var(--brand-dark);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
}

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

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

h2 {
  font-size: 19px;
  margin-bottom: 14px;
}

.top-actions,
.hero-actions,
.dialog-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.auth-panel {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.auth-panel span {
  color: var(--muted);
  font-size: 13px;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hidden {
  display: none !important;
}

.primary-button,
.secondary-button,
.ghost-button,
.text-button,
.icon-button {
  border: 0;
  border-radius: 8px;
  min-height: 40px;
  padding: 0 14px;
}

.primary-button {
  background: var(--brand);
  color: #ffffff;
  font-weight: 700;
}

.primary-button:hover {
  background: var(--brand-dark);
}

.secondary-button {
  background: var(--surface-strong);
  color: var(--ink);
}

.ghost-button {
  background: transparent;
  color: var(--brand-dark);
  border: 1px solid var(--line);
}

.text-button {
  background: transparent;
  color: var(--brand-dark);
  padding: 0 4px;
  min-height: 28px;
}

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

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero {
  min-height: 260px;
  border-radius: 8px;
  padding: 28px;
  background:
    linear-gradient(120deg, rgba(16, 32, 44, 0.92), rgba(15, 142, 168, 0.78)),
    radial-gradient(circle at 80% 20%, rgba(230, 108, 50, 0.55), transparent 32%),
    #10202c;
  color: #ffffff;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  align-items: end;
  box-shadow: var(--shadow);
}

.hero-copy p {
  max-width: 640px;
  font-size: 21px;
  line-height: 1.55;
  color: #e7f3f8;
}

.hero-panel {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.hero-panel div {
  padding: 18px 14px;
  border-right: 1px solid rgba(255, 255, 255, 0.18);
}

.hero-panel div:last-child {
  border-right: 0;
}

.hero-panel span,
.hero-panel strong {
  display: block;
}

.hero-panel span {
  color: #cfe2eb;
  font-size: 13px;
}

.hero-panel strong {
  font-size: 30px;
  margin-top: 5px;
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.sales-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.sales-strip div {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
}

.sales-strip strong,
.sales-strip span {
  display: block;
}

.sales-strip strong {
  margin-bottom: 5px;
}

.sales-strip span {
  color: var(--muted);
  font-size: 14px;
}

.admin-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.admin-summary div {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(24, 33, 43, 0.06);
}

.admin-summary span,
.admin-summary strong {
  display: block;
}

.admin-summary span {
  color: var(--muted);
  font-size: 14px;
}

.admin-summary strong {
  margin-top: 6px;
  font-size: 32px;
}

.admin-note-panel {
  margin-top: 16px;
}

.note-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 10px;
  margin-bottom: 14px;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 700;
  background: #edf6ee;
  color: #246c3f;
}

.status.pending {
  background: #fff0e8;
  color: #9a4019;
}

.panel,
.post-card,
.person-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(24, 33, 43, 0.06);
}

.panel {
  padding: 18px;
}

.panel-header,
.card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

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

.mini-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdff;
}

.mini-item strong,
.mini-item span {
  display: block;
}

.mini-item span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 10px;
  margin-bottom: 16px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  min-height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 110px;
  padding-top: 10px;
  resize: vertical;
}

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

.post-card,
.person-card {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  background: #e7f5f8;
  color: var(--brand-dark);
}

.badge.request {
  background: #fff0e8;
  color: #9a4019;
}

.badge.notice {
  background: #edf6ee;
  color: #246c3f;
}

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

.meta {
  font-size: 13px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  background: var(--surface-strong);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  color: #425263;
}

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.person-avatar {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  font-weight: 800;
}

.person-head {
  display: flex;
  gap: 12px;
}

.template-box {
  display: grid;
  gap: 10px;
}

.template-box p {
  margin-bottom: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdff;
}

dialog {
  width: min(620px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(16, 32, 44, 0.45);
}

.dialog-form {
  padding: 18px;
  display: grid;
  gap: 12px;
}

.dialog-form label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.dialog-header h2 {
  margin: 0;
}

.icon-button {
  width: 36px;
  min-height: 36px;
  padding: 0;
  font-size: 25px;
  line-height: 1;
  background: var(--surface-strong);
}

#toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: 320px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #10202c;
  color: #ffffff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: 0.2s ease;
}

#toast.show {
  opacity: 1;
  transform: translateY(0);
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
}

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 14px;
  }

  .brand,
  .sidebar-note {
    display: none;
  }

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

  .nav-item {
    text-align: center;
    padding: 0 6px;
  }

  .main {
    padding: 18px;
  }

  .hero,
  .sales-strip,
  .admin-summary,
  .section-grid,
  .card-grid,
  .people-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .topbar {
    display: grid;
  }

  h1 {
    font-size: 25px;
  }

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

  .hero {
    padding: 20px;
  }

  .hero-panel {
    grid-template-columns: 1fr;
  }

  .hero-panel div {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  }

  .hero-panel div:last-child {
    border-bottom: 0;
  }

  .nav {
    overflow-x: auto;
    grid-template-columns: repeat(6, minmax(78px, 1fr));
  }

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