:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --ink: #0f172a;
  --muted: #64748b;
  --soft: #f1f5f9;
  --brand: #4f46e5;
  --brand-dark: #3730a3;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --success: #16a34a;
  --warning: #d97706;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

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

button {
  cursor: pointer;
}

.boot,
.center-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(460px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 18px 60px rgba(15, 23, 42, 0.08);
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  margin-bottom: 16px;
}

.auth-card h1,
.page-title h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0;
}

.auth-card p,
.page-title p,
.empty,
.muted {
  color: var(--muted);
}

.form-stack {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}

.field input,
.field textarea,
.field select,
.search-input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 12px 13px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.search-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.primary-btn,
.ghost-btn,
.danger-btn,
.text-btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 800;
}

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

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

.ghost-btn {
  background: var(--soft);
  color: var(--ink);
}

.danger-btn {
  background: var(--danger-soft);
  color: var(--danger);
}

.text-btn {
  background: transparent;
  color: var(--brand);
  padding-inline: 6px;
}

.error-box,
.notice-box {
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 14px;
}

.error-box {
  background: var(--danger-soft);
  color: #991b1b;
}

.notice-box {
  background: #eef2ff;
  color: #312e81;
}

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

.sidebar {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 22px;
  font-weight: 900;
  font-size: 18px;
}

.sidebar-brand span {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
}

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

.nav button {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  border-radius: 12px;
  padding: 11px 12px;
  font-weight: 750;
  color: #475569;
}

.nav button.active,
.nav button:hover {
  background: #eef2ff;
  color: var(--brand-dark);
}

.main {
  min-width: 0;
}

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

.admin-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 700;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--soft);
}

.content {
  padding: 28px;
}

.page-title {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 22px;
}

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

.metric-card,
.panel,
.detail-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.metric-card {
  padding: 18px;
}

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

.metric-value {
  font-size: 32px;
  font-weight: 900;
  margin-top: 8px;
}

.panel {
  overflow: hidden;
}

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

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

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

.search-input {
  min-width: min(320px, 100%);
}

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

th,
td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: #fafafa;
}

tr:hover td {
  background: #fcfcfd;
}

.user-cell,
.content-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.thumb {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--soft);
  flex: 0 0 auto;
}

.name {
  font-weight: 850;
}

.sub {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 850;
  background: var(--soft);
  color: #475569;
}

.status-active,
.status-published,
.status-open {
  background: #ecfdf5;
  color: #047857;
}

.status-suspended,
.status-cancelled,
.status-dismissed {
  background: #fff7ed;
  color: #c2410c;
}

.status-deleted,
.status-resolved {
  background: var(--danger-soft);
  color: var(--danger);
}

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

.drawer {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.36);
  display: flex;
  justify-content: flex-end;
  z-index: 50;
}

.drawer-panel {
  width: min(620px, 100%);
  height: 100%;
  background: #fff;
  overflow: auto;
  box-shadow: -18px 0 40px rgba(15, 23, 42, 0.15);
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.drawer-head h2 {
  margin: 0;
}

.drawer-body {
  padding: 22px;
  display: grid;
  gap: 16px;
}

.detail-card {
  padding: 16px;
}

.detail-card h3 {
  margin: 0 0 12px;
}

.kv {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 9px;
  margin: 7px 0;
}

.kv span:first-child {
  color: var(--muted);
  font-weight: 750;
}

.hero-image {
  width: 100%;
  max-height: 280px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--soft);
}

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

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

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

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

@media (max-width: 640px) {
  .content,
  .topbar {
    padding-inline: 16px;
  }

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

  .metric-grid,
  .financial-grid {
    grid-template-columns: 1fr;
  }

  .page-title,
  .panel-head {
    display: grid;
  }

  table {
    min-width: 780px;
  }

  .panel {
    overflow-x: auto;
  }
}
