:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-soft: #eef2f5;
  --ink: #111827;
  --muted: #647083;
  --line: #dce3ea;
  --court: #00a651;
  --court-dark: #007a3d;
  --amber: #f4b400;
  --danger: #d92d20;
  --blue: #2563eb;
  --shadow: 0 20px 60px rgba(15, 23, 42, 0.11);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

a {
  color: var(--court-dark);
  font-weight: 800;
}

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

button {
  border: 0;
  border-radius: 8px;
  background: var(--court);
  color: white;
  cursor: pointer;
  font-weight: 800;
  min-height: 42px;
  padding: 0 16px;
}

button:hover {
  background: var(--court-dark);
}

button:disabled {
  background: #b9c2cc;
  cursor: not-allowed;
}

button.secondary {
  background: var(--panel-soft);
  color: var(--ink);
}

button.secondary:hover {
  background: #dde6ed;
}

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

button.danger:hover {
  background: #ffd9d6;
}

.compact {
  min-height: 34px;
  padding: 0 10px;
}

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

.sidebar {
  background: #111827;
  color: white;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

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

.brand p,
.brand strong,
.eyebrow {
  margin: 0;
}

.brand p,
.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand strong {
  display: block;
  font-size: 24px;
}

.brand-ball {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, #ffff85 0 22%, transparent 24%),
    linear-gradient(135deg, #d8ff3f, #00c45a);
  border: 3px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 8px 20px rgba(0, 196, 90, 0.35);
}

.table-nav {
  display: grid;
  gap: 8px;
  overflow: auto;
  padding-right: 4px;
}

.table-nav button {
  align-items: center;
  background: transparent;
  color: #d7dde7;
  display: flex;
  justify-content: space-between;
  min-height: 44px;
  padding: 0 12px;
  text-align: left;
}

.table-nav button:hover,
.table-nav button.active {
  background: rgba(255, 255, 255, 0.1);
}

.table-nav strong {
  color: #b7ff62;
}

.logout-form {
  margin-top: auto;
}

.logout-form button {
  background: rgba(255, 255, 255, 0.1);
  width: 100%;
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.topbar {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 20px;
}

.topbar h1 {
  font-size: 34px;
  line-height: 1.1;
  margin: 4px 0 0;
}

.topbar-actions {
  display: flex;
  gap: 10px;
}

.summary-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 18px;
}

.summary-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

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

.summary-card strong {
  display: block;
  font-size: 30px;
  line-height: 1;
  margin-top: 8px;
}

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

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

.panel-toolbar h2,
.panel-toolbar p {
  margin: 0;
}

.panel-toolbar p {
  color: var(--muted);
  margin-top: 4px;
}

.search-field {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 800;
  gap: 6px;
  min-width: 280px;
  text-transform: uppercase;
}

input,
select,
textarea {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  min-height: 42px;
  padding: 9px 11px;
  width: 100%;
}

textarea {
  min-height: 86px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--court);
  box-shadow: 0 0 0 3px rgba(0, 166, 81, 0.16);
  outline: none;
}

.status-message {
  color: var(--muted);
  min-height: 22px;
  padding: 10px 18px;
}

.status-message.error,
.form-error {
  color: var(--danger);
  font-weight: 800;
}

.table-wrap {
  overflow: auto;
}

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

th,
td {
  border-top: 1px solid var(--line);
  max-width: 260px;
  padding: 13px 14px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  position: sticky;
  text-transform: uppercase;
  top: 0;
  z-index: 1;
}

td {
  color: #1f2937;
  font-size: 14px;
}

.actions-col {
  min-width: 104px;
  text-align: right;
}

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

.pill {
  background: #edf1f7;
  border-radius: 999px;
  color: #445064;
  display: inline-block;
  font-size: 12px;
  font-weight: 900;
  padding: 4px 8px;
}

.pill.success {
  background: #ddfbe9;
  color: #006d3a;
}

.empty-state {
  color: var(--muted);
  padding: 36px;
  text-align: center;
}

.row-dialog {
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
  max-width: 820px;
  padding: 0;
  width: min(820px, calc(100vw - 28px));
}

.row-dialog::backdrop {
  background: rgba(15, 23, 42, 0.5);
}

.row-dialog form {
  padding: 20px;
}

.dialog-head,
.dialog-actions {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr auto;
}

.dialog-head h2 {
  margin: 4px 0 0;
}

.icon-button {
  background: var(--panel-soft);
  color: var(--ink);
  min-height: 36px;
  padding: 0;
  width: 36px;
}

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

.field {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 900;
  gap: 7px;
  text-transform: uppercase;
}

.field-long_text,
.field-json,
.field-text_array,
.field-uuid_array,
.field-enum_array {
  grid-column: 1 / -1;
}

.field small {
  color: #7b8796;
  font-weight: 700;
  text-transform: none;
}

.upload-box {
  background: var(--panel-soft);
  border: 1px dashed var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 10px;
}

.upload-box input {
  background: var(--panel);
}

.checkbox-row {
  align-items: center;
  display: flex;
  gap: 10px;
}

.checkbox-row input {
  min-height: 18px;
  width: 18px;
}

.dialog-actions {
  border-top: 1px solid var(--line);
  grid-template-columns: auto 1fr auto auto;
  padding-top: 16px;
}

.login-body {
  align-items: center;
  display: flex;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  max-width: 420px;
  padding: 28px;
  width: 100%;
}

.login-card h1 {
  font-size: 34px;
  margin: 6px 0 10px;
}

.login-copy {
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 20px;
}

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

.login-form label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 900;
  gap: 7px;
  text-transform: uppercase;
}

.public-body {
  background: #f7f4ef;
  padding: 28px;
}

.public-page {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin: 0 auto;
  max-width: 880px;
  padding: 28px;
}

.public-header {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: flex-end;
  margin-bottom: 32px;
}

.public-page h1 {
  font-size: 42px;
  line-height: 1.08;
  margin: 8px 0 12px;
}

.public-page h2 {
  font-size: 20px;
  margin: 0 0 8px;
}

.public-page p,
.public-page li {
  color: #273244;
  line-height: 1.65;
}

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

.public-section {
  border-top: 1px solid var(--line);
  margin-top: 22px;
  padding-top: 22px;
}

.public-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.public-form label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 900;
  gap: 7px;
  text-transform: uppercase;
}

.bot-field {
  display: none;
}

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

  .sidebar {
    height: auto;
    position: static;
  }

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

  .workspace {
    padding: 18px;
  }

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

  .topbar,
  .panel-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .search-field {
    min-width: 0;
  }
}

@media (max-width: 620px) {
  .table-nav,
  .summary-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .topbar-actions,
  .dialog-actions {
    grid-template-columns: 1fr;
    display: grid;
  }
}
