:root {
  --canvas: #faf8f5;
  --panel: #ffffff;
  --ink: #151012;
  --muted: #6e6062;
  --line: #eadfda;
  --primary: #d80f3f;
  --primary-soft: #fff0f5;
  --danger: #c80d2e;
  --warning: #a96c00;
  --success: #14814a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(480px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 24px;
  box-shadow: 0 18px 48px rgba(49, 25, 29, 0.08);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 8px;
  font-size: 32px;
  line-height: 1.05;
}

h2 {
  margin-bottom: 5px;
  font-size: 24px;
  line-height: 1.1;
}

.login-copy,
.workspace-header p,
.item-meta,
.empty-state,
.form-error {
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 13px;
  margin-top: 22px;
}

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

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

input:focus,
select:focus {
  border-color: var(--primary);
  outline: 2px solid rgba(216, 15, 63, 0.14);
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 900;
}

.primary-button {
  background: var(--primary);
  color: #ffffff;
}

.secondary-button,
.ghost-button {
  background: #ffffff;
  border-color: var(--line);
  color: var(--ink);
}

.danger-button {
  background: #fff0f2;
  color: var(--danger);
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--primary);
  font-weight: 900;
}

.form-error {
  min-height: 18px;
  margin: 0;
  font-size: 12px;
  font-weight: 800;
}

.admin-view {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 270px minmax(0, 1fr);
}

.sidebar {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: #ffffff;
  padding: 16px 12px;
}

.brand-block {
  padding: 0 4px 16px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  text-align: left;
  font-weight: 900;
}

.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.admin-account {
  display: grid;
  gap: 8px;
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 16px 4px 0;
}

.role-pill,
.status-pill,
.type-pill {
  width: fit-content;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.role-pill,
.type-pill {
  background: var(--primary-soft);
  color: var(--primary);
}

.status-pill.pending {
  background: #fff8e7;
  color: var(--warning);
}

.status-pill.approved,
.status-pill.live {
  background: #eaf8ef;
  color: var(--success);
}

.status-pill.rejected,
.status-pill.deleted {
  background: #fff0f2;
  color: var(--danger);
}

.ad-id-pill {
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.workspace {
  min-width: 0;
  padding: 20px 22px 36px;
}

.workspace-header {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.workspace-header > div:first-child {
  flex: 1 1 320px;
  min-width: 0;
}

.toolbar {
  display: flex;
  flex: 1 1 420px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.search-input {
  flex: 1 1 220px;
  min-width: 180px;
  max-width: 300px;
}

.select-input {
  flex: 0 0 140px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

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

.summary-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.summary-value {
  margin-top: 5px;
  color: var(--ink);
  font-size: 23px;
  font-weight: 900;
}

.content-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.item-list {
  display: grid;
}

.list-item {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  padding: 13px;
  border-bottom: 1px solid var(--line);
}

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

.thumb {
  width: 76px;
  height: 58px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--canvas);
  object-fit: cover;
}

.thumb-placeholder {
  display: grid;
  place-items: center;
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
}

.item-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 5px;
}

.item-title {
  min-width: 0;
  font-size: 14px;
  font-weight: 900;
}

.item-meta {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin: 0;
  font-size: 12px;
  font-weight: 800;
}

.item-note {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 17px;
  font-weight: 750;
}

.item-actions {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-content: flex-start;
  gap: 7px;
  margin-top: 10px;
}

.promotion-select {
  min-height: 38px;
  width: 142px;
  font-size: 12px;
  font-weight: 900;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

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

th {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

td {
  color: var(--ink);
  font-weight: 800;
}

.ad-id-cell {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.empty-state,
.loading-state {
  padding: 28px 16px;
  text-align: center;
  font-weight: 850;
}

.loading-state {
  color: var(--ink);
}

@media (max-width: 900px) {
  .admin-view {
    grid-template-columns: 1fr;
  }

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

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

  .workspace-header,
  .toolbar {
    justify-content: flex-start;
  }
}
