:root {
  --bg: #f5f5f5;
  --panel: #ffffff;
  --line: #e0dfde;
  --line-strong: #b8b7b6;
  --text: #111111;
  --muted: #797775;
  --muted-strong: #969492;
  --brand: #fddb00;
  --brand-soft: rgba(253, 219, 0, 0.10);
  --brand-soft-hover: rgba(253, 219, 0, 0.18);
  --success: #008442;
  --error: #f13131;
  --info: #005fff;
  --warn: #fddb00;
  --on-brand: #111111;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(17, 17, 17, 0.06);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px 1fr;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: var(--panel);
  padding: 20px 14px;
}

.brand {
  font-weight: 700;
  font-size: 18px;
  margin: 4px 8px 18px;
}

.nav-title {
  color: var(--muted);
  font-size: 12px;
  margin: 18px 8px 8px;
}

.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-list a {
  display: block;
  text-decoration: none;
  color: var(--text);
  border-radius: 8px;
  padding: 9px 12px;
  margin: 2px 0;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
}

.nav-list a:hover {
  background: var(--brand-soft);
  color: var(--text);
  text-decoration: none;
}

.nav-list a.active {
  background: var(--brand-soft);
  color: var(--text);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--brand);
}

a {
  color: var(--info);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.main {
  padding: 24px;
}

.page-head {
  height: 64px;
  border-bottom: 1px solid var(--line);
  margin: -24px -24px 24px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 10;
}

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

.page-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.page-head.detail {
  height: auto;
  align-items: flex-start;
  padding-top: 14px;
  padding-bottom: 14px;
}

.page-crumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 8px;
  list-style: none;
  padding: 0;
  margin-top: 0;
}

.page-crumb a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.12s;
}

.page-crumb a:hover {
  color: var(--text);
}

.page-crumb-sep {
  color: var(--line);
  font-size: 14px;
  user-select: none;
}

.page-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-back {
  background: none;
  border: none;
  padding: 2px 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.12s, color 0.12s;
  margin-right: 2px;
}

.btn-back:hover {
  background: var(--bg);
  color: var(--text);
}

.btn {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--on-brand);
}

.btn.success {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.btn.danger {
  background: var(--error);
  border-color: var(--error);
  color: #fff;
}

.btn:hover {
  background: #efefef;
}

.btn.primary:hover {
  background: var(--brand);
  filter: brightness(0.93);
}

.btn.success:hover {
  background: var(--success);
  filter: brightness(0.88);
}

.btn.danger:hover {
  background: var(--error);
  filter: brightness(0.88);
}

.icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
}

.icon-btn:hover {
  background: var(--brand-soft);
  color: var(--text);
}

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

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}

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

.card .value {
  font-size: 26px;
  font-weight: 700;
  margin-top: 8px;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.stat-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--muted);
}

.delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
}

.delta.success { color: var(--success); }
.delta.error { color: var(--error); }
.delta.info { color: var(--info); }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

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

.input {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  min-width: 220px;
  color: var(--text);
  background: var(--panel);
}

.input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(253, 219, 0, 0.35);
}

.input.full {
  width: 100%;
}

textarea.input {
  resize: vertical;
}

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

th, td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

th {
  background: #f5f5f5;
  font-size: 12px;
  color: var(--muted);
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 999px;
  background: #efefef;
  color: var(--muted);
}

.badge.success {
  background: rgba(0, 132, 66, 0.12);
  color: var(--success);
}

.badge.info {
  background: rgba(0, 95, 255, 0.12);
  color: var(--info);
}

.badge.error {
  background: rgba(241, 49, 49, 0.12);
  color: var(--error);
}

.badge.warn {
  background: rgba(253, 219, 0, 0.2);
  color: var(--text);
}

.badge-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.meta-row {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f5f5f5;
}

.meta-row .k {
  font-size: 12px;
  color: var(--muted);
}

.meta-row .v {
  margin-top: 4px;
  font-weight: 600;
}

.preview {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 14px;
}

.thumb {
  background: #efefef;
  border-radius: 10px;
  min-height: 240px;
  display: grid;
  place-items: center;
  color: var(--muted-strong);
  font-size: 14px;
}

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

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chip-btn {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.chip-btn:hover {
  background: var(--brand-soft);
}

.header-search {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  background: #efefef;
  border-radius: 8px;
  padding: 6px 10px;
  min-width: 280px;
  gap: 8px;
}

.header-search input {
  border: 0;
  background: transparent;
  width: 100%;
  color: var(--text);
  font-size: 14px;
}

.header-search input:focus {
  outline: none;
}

.top-nav {
  height: 64px;
  border-bottom: 1px solid var(--line);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-divider {
  width: 1px;
  height: 22px;
  background: var(--line);
  margin: 0 4px;
}

.notification-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--error);
  position: absolute;
  top: 8px;
  right: 8px;
  border: 2px solid #fff;
}

.dashboard-wrap {
  padding: 24px;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
  display: grid;
  gap: 16px;
}

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

.table-actions {
  display: inline-flex;
  justify-content: flex-end;
  gap: 4px;
}

.avatar-dot {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #efefef;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  margin-right: 8px;
}

.thumb-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.icon {
  font-family: "Material Symbols Outlined";
  font-weight: 400;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  display: inline-block;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  font-feature-settings: "liga";
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 20;
  -webkit-font-smoothing: antialiased;
}

.icon.sm { font-size: 16px; }
.icon.lg { font-size: 24px; }

.log-box {
  background: #111111;
  color: #efefef;
  border-radius: 10px;
  padding: 12px;
  min-height: 160px;
  font-family: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  font-size: 12px;
  overflow: auto;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, 0.54);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal.open { display: flex; }

.modal-card {
  background: #fff;
  width: min(900px, 100%);
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.modal-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body {
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 1024px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .grid, .grid.grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .preview { grid-template-columns: 1fr; }
  .meta { grid-template-columns: 1fr; }
  .modal-body { grid-template-columns: 1fr; }
  .top-nav { padding: 0 14px; }
  .header-search { min-width: 180px; }
}

@media (max-width: 768px) {
  .grid, .grid.grid-3 { grid-template-columns: 1fr; }
  .page-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
}
