:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --text: #172033;
  --muted: #687386;
  --line: #dce2ea;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --danger: #dc2626;
  --danger-dark: #b91c1c;
  --ok-bg: #e8f7ee;
  --radius: 8px;
  --shadow: 0 12px 32px rgba(23, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

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

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 42px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.brand {
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--muted);
}

.topnav form,
.inline {
  display: inline;
}

.page {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 4vw, 42px);
}

.center-panel {
  min-height: calc(100vh - 140px);
  display: grid;
  place-items: center;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(18px, 3vw, 28px);
}

.compact {
  width: min(460px, 100%);
}

.grid {
  display: grid;
  gap: 18px;
  margin-bottom: 22px;
}

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

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

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

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

h1 {
  margin-bottom: 8px;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.12;
}

h2 {
  margin-bottom: 14px;
  font-size: 18px;
}

.eyebrow {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

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

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

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

input[type="text"],
input[type="password"],
input[type="file"] {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  font: inherit;
}

input[type="file"] {
  padding: 9px 10px;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

button:hover,
.button:hover {
  text-decoration: none;
}

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

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

.secondary {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--line);
}

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

.danger:hover {
  background: var(--danger-dark);
}

.small {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 14px;
}

.link-button {
  min-height: 0;
  padding: 0;
  background: none;
  color: var(--brand);
  border: 0;
  font-weight: 600;
}

.alert {
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: #fff1f2;
  color: #9f1239;
  border: 1px solid #fecdd3;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.breadcrumbs a::after {
  content: "/";
  margin-left: 8px;
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

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

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

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

tr:last-child td {
  border-bottom: 0;
}

.actions {
  text-align: right;
  white-space: nowrap;
}

.actions > * {
  margin-left: 6px;
}

.item-name {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  color: var(--text);
  font-weight: 700;
}

.icon {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--brand);
  font-size: 13px;
}

.code-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 10px;
  border-radius: var(--radius);
  background: var(--ok-bg);
  color: #166534;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 800;
  letter-spacing: 0;
}

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

.menu {
  position: relative;
  display: inline-block;
}

.menu summary {
  cursor: pointer;
  color: var(--brand);
  font-weight: 700;
}

.menu[open] {
  min-width: 220px;
}

.menu form,
.menu .button {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

code {
  white-space: pre-wrap;
  color: #334155;
}

@media (max-width: 760px) {
  .topbar,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topnav,
  .toolbar-actions {
    justify-content: space-between;
  }

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

  .inline-form {
    grid-template-columns: 1fr;
  }

  button,
  .button {
    width: 100%;
  }

  .actions {
    text-align: left;
  }

  .actions > * {
    margin: 4px 0;
  }

  table {
    min-width: 620px;
  }
}

