:root {
  color-scheme: light;
  --bg: #f4f5f8;
  --surface: #ffffff;
  --surface-alt: #f1f3f8;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #1e3a5f;
  --accent: #f5a623;
  --danger: #d64545;
  --border: #e2e8f0;
  --radius: 16px;
  --shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  background: radial-gradient(circle at top left, #eef2ff, transparent 55%),
    linear-gradient(145deg, #f8fafc, #eef2f7 60%);
  color: var(--text);
  min-height: 100vh;
}

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

.sidebar {
  background: #0f172a;
  color: #f8fafc;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.08);
}

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

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, #f59f0b, #f97316);
  display: grid;
  place-items: center;
  color: #0f172a;
  font-weight: 700;
  font-size: 20px;
}

.brand h1 {
  margin: 0;
  font-size: 20px;
}

.brand p {
  margin: 4px 0 0;
  color: rgba(248, 250, 252, 0.7);
  font-size: 14px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nav-item {
  background: transparent;
  border: 1px solid rgba(248, 250, 252, 0.2);
  color: #f8fafc;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 15px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(248, 250, 252, 0.12);
  border-color: rgba(248, 250, 252, 0.5);
}

.sidebar-footer {
  margin-top: auto;
}

.main {
  padding: 32px 40px 48px;
}

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

.header h2 {
  margin: 0;
  font-size: 28px;
}

.header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.api-config {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  padding: 8px 12px;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.api-config label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.api-config input {
  border: none;
  outline: none;
  font-size: 14px;
  width: 240px;
}

.panel {
  background: var(--surface);
  padding: 24px;
  border-radius: var(--radius);
  margin-top: 24px;
  box-shadow: var(--shadow);
}

.hidden {
  display: none !important;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.stat-card {
  background: var(--surface-alt);
  border-radius: 14px;
  padding: 16px;
}

.stat-card h4 {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-card strong {
  font-size: 24px;
}

.form {
  display: grid;
  gap: 16px;
  max-width: 360px;
}

.panel-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.panel-header h3 {
  margin: 0;
  font-size: 18px;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.small {
  font-size: 12px;
}

.mb-1 {
  margin-bottom: 8px;
}

.mt-2 {
  margin-top: 24px;
}

.form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.form input,
.form textarea,
.form select {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
  width: 100%;
}

.form textarea {
  resize: vertical;
}

button {
  font-family: inherit;
}

.primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 12px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
}

.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
}

.danger {
  background: #ef4444;
  color: #fff;
  border: none;
  padding: 12px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
}

.error {
  color: var(--danger);
  font-size: 13px;
}

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

.filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filters input,
.filters select {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 14px;
}

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

.table-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-alt);
}

.table-row.listing {
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto;
}

.table-row.header {
  background: transparent;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.badge {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.badge.active {
  background: #d1fae5;
  color: #047857;
}

.badge.inactive {
  background: #fee2e2;
  color: #b91c1c;
}

.badge.pending {
  background: #fef3c7;
  color: #b45309;
}

.badge.approved {
  background: #dcfce7;
  color: #166534;
}

.badge.rejected {
  background: #fee2e2;
  color: #b91c1c;
}

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

.actions button {
  padding: 8px 10px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
}

.actions .approve {
  background: #16a34a;
  color: #fff;
}

.actions .reject {
  background: #ef4444;
  color: #fff;
}

.actions .detail {
  background: #1e293b;
  color: #fff;
}

.pagination {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
}

.modal-content {
  background: var(--surface);
  border-radius: 20px;
  width: min(980px, 95vw);
  max-height: 90vh;
  overflow: auto;
  padding: 24px;
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
}

.modal-body {
  display: grid;
  gap: 20px;
  padding: 20px 0;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.gallery img {
  width: 100%;
  border-radius: 12px;
  object-fit: cover;
  height: 140px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.detail-card {
  background: var(--surface-alt);
  border-radius: 12px;
  padding: 12px;
}

.detail-card strong {
  display: block;
  margin-bottom: 4px;
}

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

  .sidebar {
    flex-direction: row;
    align-items: center;
  }

  .nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

@media (max-width: 720px) {
  .main {
    padding: 24px;
  }

  .table-row,
  .table-row.listing {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .header {
    align-items: flex-start;
  }

  .api-config {
    width: 100%;
    justify-content: space-between;
  }
}
