:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #687386;
  --line: #e3e8f0;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #dc2626;
  --success: #15803d;
  --sidebar: #111827;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button,
input {
  font: inherit;
}

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

.sidebar {
  background: var(--sidebar);
  color: #fff;
  padding: 24px 18px;
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #2563eb;
  font-weight: 800;
}

.brand-title {
  font-weight: 800;
}

.brand-subtitle {
  color: #9ca3af;
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 6px;
  margin-top: 32px;
}

.nav-link {
  padding: 10px 12px;
  border-radius: 7px;
  color: #e5e7eb;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
}

.nav-link.muted {
  color: #6b7280;
}

.main {
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
}

.global-search input,
.filters input {
  width: min(520px, 48vw);
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.admin-menu {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
}

.ghost-button {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
}

.secondary-button,
.table-link {
  color: var(--primary);
  font-weight: 600;
}

.content {
  padding: 28px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 22px;
}

.page-header h1 {
  margin: 0 0 6px;
  font-size: 28px;
}

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

.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.stat-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stat-card {
  padding: 16px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: 26px;
}

.two-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.panel {
  overflow: hidden;
}

.section-gap {
  margin-top: 20px;
}

.panel-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

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

.filters {
  display: flex;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.filters button,
.login-form button,
.action-form button {
  border: 0;
  border-radius: 7px;
  background: var(--primary);
  color: #fff;
  padding: 11px 16px;
  cursor: pointer;
}

.filters button:hover,
.login-form button:hover,
.action-form button:hover {
  background: var(--primary-dark);
}

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

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

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

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  background: #eef2f7;
  color: #475569;
  font-size: 12px;
}

.badge.success {
  background: #dcfce7;
  color: var(--success);
}

.badge.danger {
  background: #fee2e2;
  color: var(--danger);
}

.muted-text,
.empty {
  color: var(--muted);
}

.login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
}

.login-card {
  width: min(420px, calc(100vw - 32px));
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}

.login-brand {
  margin-bottom: 24px;
}

.login-card h1 {
  margin: 0 0 8px;
}

.login-hint {
  margin: 0 0 24px;
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
}

.login-form input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
}

.alert {
  margin-bottom: 16px;
  padding: 12px;
  border-radius: 7px;
  background: #fee2e2;
  color: var(--danger);
}

.notice {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 7px;
}

.notice.success {
  background: #dcfce7;
  color: var(--success);
}

.notice.danger {
  background: #fee2e2;
  color: var(--danger);
}

.details-grid {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 12px 16px;
  padding: 18px;
}

.details-grid.compact {
  grid-template-columns: 140px 1fr;
}

.details-grid span,
.form-hint {
  color: var(--muted);
}

.details-grid strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.action-form {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.action-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
}

.action-form input,
.action-form select,
.action-form textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
}

.action-form textarea {
  resize: vertical;
  min-height: 160px;
  line-height: 1.45;
}

.form-hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

.block-empty {
  padding: 18px;
}

.details-cell {
  max-width: 520px;
  overflow-wrap: anywhere;
}

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

  .sidebar {
    display: none;
  }

  .stats-grid,
  .two-columns {
    grid-template-columns: 1fr;
  }
}
