:root {
  --ink: #0b4651;
  --ink-2: #123c44;
  --accent: #e5ff2a;
  --bg: #f3f7f6;
  --card: #fff;
  --muted: #617278;
  --line: #dce6e4;
  --danger: #b42318;
  --warning: #a15c00;
  --radius: 16px;
  --shadow: 0 12px 38px rgba(11, 70, 81, 0.09);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #132f35;
  background: var(--bg);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
}
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--ink);
  color: #fff;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 8px 26px;
}
.brand span:last-child {
  display: grid;
}
.brand small,
.admin-button small {
  color: #a9c2c6;
  font-size: 12px;
  margin-top: 3px;
}
.brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: var(--accent);
  color: var(--ink);
  display: grid;
  place-items: center;
  font-weight: 900;
  letter-spacing: -2px;
  font-size: 22px;
}
.brand-mark.small {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 17px;
}
.sidebar nav {
  display: grid;
  gap: 6px;
}
.sidebar nav button {
  border: 0;
  background: transparent;
  color: #c8d9db;
  text-align: left;
  padding: 12px 14px;
  border-radius: 11px;
  font-weight: 650;
}
.sidebar nav button:hover,
.sidebar nav button.active {
  background: rgba(229, 255, 42, 0.12);
  color: var(--accent);
}
.admin-button {
  margin-top: auto;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border-radius: 14px;
  padding: 11px;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 9px;
  align-items: center;
  text-align: left;
}
.admin-button span:nth-child(2) {
  min-width: 0;
  display: grid;
}
.admin-button strong,
.admin-button small {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--ink);
  display: grid;
  place-items: center;
  font-weight: 900;
}
.main {
  min-width: 0;
}
.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 25px 34px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar div {
  flex: 1;
}
.topbar h1 {
  margin: 2px 0 0;
  font-size: 25px;
  color: var(--ink);
}
.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-size: 10px;
  font-weight: 800;
  color: #6a8185;
}
.content {
  padding: 28px 34px 54px;
  max-width: 1500px;
  margin: auto;
}
.button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  min-height: 40px;
  padding: 9px 15px;
  border-radius: 11px;
  font-weight: 750;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.button:hover {
  filter: brightness(0.97);
}
.button.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.button.accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink);
}
.button.danger {
  color: var(--danger);
  border-color: #f1b9b4;
}
.button.small {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
}
.button.ghost {
  background: transparent;
  border-color: transparent;
}
.icon-button {
  display: none;
  border: 0;
  background: transparent;
  font-size: 24px;
  color: var(--ink);
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.stat-card,
.panel,
.item-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(11, 70, 81, 0.035);
}
.stat-card {
  padding: 20px;
}
.stat-card strong {
  display: block;
  font-size: 30px;
  color: var(--ink);
}
.stat-card span {
  font-size: 13px;
  color: var(--muted);
}
.grid-2 {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 18px;
  margin-top: 18px;
}
.panel {
  padding: 20px;
}
.panel-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.panel h2 {
  font-size: 17px;
  margin: 0;
  color: var(--ink);
}
.muted {
  color: var(--muted);
}
.empty {
  padding: 42px 20px;
  text-align: center;
  color: var(--muted);
}
.list {
  display: grid;
  gap: 10px;
}
.item-card {
  padding: 15px;
  display: flex;
  align-items: center;
  gap: 13px;
}
.item-card .grow {
  flex: 1;
  min-width: 0;
}
.item-card h3,
.item-card p {
  margin: 0;
}
.item-card h3 {
  font-size: 14px;
  color: var(--ink);
}
.item-card p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  background: #eaf1ef;
  color: #466066;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge.active,
.badge.published,
.badge.approved,
.badge.linked {
  background: #eaf8d8;
  color: #376112;
}
.badge.pending,
.badge.draft {
  background: #fff2cf;
  color: #855400;
}
.badge.disabled,
.badge.rejected,
.badge.unlinked {
  background: #fde8e6;
  color: #96251c;
}
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}
.toolbar input {
  max-width: 360px;
}
.table-wrap {
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 720px;
}
th,
td {
  padding: 13px 15px;
  border-bottom: 1px solid #eaf0ef;
  text-align: left;
  font-size: 13px;
}
th {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: #f8faf9;
}
tr:last-child td {
  border: 0;
}
td strong {
  color: var(--ink);
}
label {
  display: grid;
  gap: 7px;
  font-size: 12px;
  font-weight: 750;
  color: var(--ink);
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid #cbd9d7;
  background: #fff;
  color: #17343a;
  border-radius: 10px;
  padding: 10px 11px;
  outline: none;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(11, 70, 81, 0.1);
}
textarea {
  min-height: 90px;
  resize: vertical;
}
small {
  font-weight: 400;
  color: var(--muted);
}
.stack {
  display: grid;
  gap: 14px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-grid h2,
.form-grid .wide {
  grid-column: 1/-1;
}
.form-grid h2 {
  font-size: 14px;
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.switch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.switch-row label {
  display: flex;
  gap: 8px;
  align-items: center;
}
.switch-row input {
  width: 18px;
  height: 18px;
}
.auth-page {
  background: linear-gradient(145deg, var(--ink), #072f37);
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-card {
  width: min(430px, 100%);
  background: #fff;
  padding: 34px;
  border-radius: 24px;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.25);
}
.auth-card.install-card {
  width: min(680px, 100%);
}
.auth-card h1 {
  margin: 10px 0 4px;
  color: var(--ink);
}
.auth-card > .muted {
  margin: 0 0 22px;
}
.alert {
  padding: 11px 13px;
  border-radius: 10px;
  margin: 14px 0;
  font-size: 13px;
}
.alert.error {
  background: #fde8e6;
  color: #8a2119;
}
.alert.success {
  background: #eefbd7;
  color: #365a17;
}
#flash {
  position: fixed;
  right: 24px;
  top: 92px;
  z-index: 30;
}
.toast {
  background: var(--ink);
  color: #fff;
  padding: 12px 16px;
  border-radius: 11px;
  box-shadow: var(--shadow);
  margin-top: 8px;
}
.toast.error {
  background: var(--danger);
}
dialog {
  border: 0;
  padding: 0;
  background: transparent;
  width: min(720px, calc(100% - 28px));
  max-width: none;
}
dialog::backdrop {
  background: rgba(6, 30, 35, 0.55);
  backdrop-filter: blur(3px);
}
.modal-card {
  background: #fff;
  border-radius: 20px;
  padding: 25px;
  max-height: 90vh;
  overflow: auto;
  position: relative;
}
.modal-card h2 {
  margin: 0 34px 5px 0;
  color: var(--ink);
}
.modal-close {
  position: absolute;
  right: 16px;
  top: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: #eef3f2;
  color: var(--ink);
  font-size: 22px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 19px;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: 0.07em;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 16px 0;
}
.metric {
  padding: 12px;
  background: #f4f8f7;
  border-radius: 11px;
}
.metric strong {
  display: block;
  color: var(--ink);
}
.metric span {
  font-size: 11px;
  color: var(--muted);
}
.profile {
  height: 180px;
  width: 100%;
  background: #f4f8f7;
  border-radius: 12px;
  overflow: hidden;
}
.profile svg {
  width: 100%;
  height: 100%;
}
.profile polyline {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
}
.profile polygon {
  fill: rgba(229, 255, 42, 0.55);
}
.notice {
  padding: 13px;
  border: 1px solid #f2c780;
  background: #fff8e8;
  color: #734500;
  border-radius: 11px;
  font-size: 12px;
  margin: 12px 0;
}
.requirements {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin: 16px 0;
}
.requirements span {
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 750;
}
.requirements .pass {
  background: #eefbd7;
  color: #365a17;
}
.requirements .fail {
  background: #fde8e6;
  color: #8a2119;
}
.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.loading {
  padding: 50px;
  text-align: center;
  color: var(--muted);
}
@media (max-width: 980px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    left: -280px;
    width: 260px;
    z-index: 40;
    transition: left 0.2s;
  }
  .sidebar.open {
    left: 0;
  }
  .icon-button {
    display: block;
  }
  .topbar {
    padding: 20px;
  }
  .content {
    padding: 20px;
  }
}
@media (max-width: 620px) {
  .stats,
  .form-grid,
  .metrics {
    grid-template-columns: 1fr;
  }
  .form-grid h2,
  .form-grid .wide {
    grid-column: auto;
  }
  .topbar {
    gap: 10px;
  }
  .topbar .button.accent {
    font-size: 0;
    width: 42px;
    padding: 0;
  }
  .topbar .button.accent::after {
    content: "+";
    font-size: 24px;
  }
  .content {
    padding: 15px;
  }
  .item-card {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .modal-card {
    padding: 20px;
  }
  .auth-card {
    padding: 25px;
  }
}
