:root {
  --bg: #f4f4f1;
  --panel: #ffffff;
  --panel-soft: #ededeb;
  --text: #111111;
  --muted: #6f6f68;
  --line: #deded8;
  --accent: #111111;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, Arial, sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 40px;
  border-right: 1px solid var(--line);
  background: #090909;
  color: #ffffff;
  padding: 32px 22px;
}

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

.admin-brand span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: #ffffff;
  color: #090909;
  font-weight: 800;
}

.admin-brand strong {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

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

.sidebar-nav a {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 15px;
  font-weight: 600;
  transition: background 160ms ease, color 160ms ease;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: #ffffff;
  color: #090909;
}

.sidebar-nav span {
  width: 22px;
  text-align: center;
  font-size: 18px;
  line-height: 1;
}

.admin-main {
  min-width: 0;
  padding: 32px clamp(22px, 4vw, 64px) 72px;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.admin-header p,
.section-head p,
.metrics span {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-header h1 {
  margin: 8px 0 0;
  font-size: clamp(32px, 5vw, 58px);
  line-height: 1;
}

.store-link,
.section-head button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--text);
  background: var(--text);
  color: #ffffff;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.metrics article,
.table-card,
.empty-state,
.settings-grid {
  border: 1px solid var(--line);
  background: var(--panel);
}

.metrics article {
  padding: 22px;
}

.metrics strong {
  display: block;
  margin-top: 18px;
  font-size: 46px;
  line-height: 1;
}

.metrics p {
  margin: 10px 0 0;
  color: var(--muted);
}

.admin-section {
  margin-top: 28px;
  scroll-margin-top: 32px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.section-head h2 {
  margin: 6px 0 0;
  font-size: 28px;
  line-height: 1.1;
}

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

.table-row {
  min-width: 720px;
  display: grid;
  grid-template-columns: 2fr 1.2fr 0.8fr 1fr;
  gap: 18px;
  align-items: center;
  padding: 18px 20px;
  border-top: 1px solid var(--line);
  font-weight: 600;
}

.table-row:first-child {
  border-top: 0;
}

.table-row-head {
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

mark {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  background: #f0efe8;
  color: #4f4a3a;
  padding: 0 10px;
  font-weight: 700;
}

.empty-state {
  padding: 36px;
}

.empty-state strong {
  display: block;
  font-size: 22px;
}

.empty-state p {
  max-width: 560px;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding: 20px;
}

.settings-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.settings-grid input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  padding: 0 12px;
  font-size: 15px;
  font-weight: 600;
}

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

  .sidebar {
    position: static;
    height: auto;
    gap: 24px;
  }

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

  .sidebar-nav a {
    justify-content: center;
  }

  .metrics,
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .admin-main {
    padding-inline: 18px;
  }

  .admin-header,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .sidebar-nav {
    grid-template-columns: 1fr;
  }

  .store-link,
  .section-head button {
    width: 100%;
  }
}
