:root {
  color-scheme: light;
  --ink: #17212b;
  --muted: #5d6872;
  --line: #d9dee3;
  --surface: #ffffff;
  --surface-subtle: #f5f7f8;
  --accent: #086f75;
  --accent-hover: #05565b;
  --accent-soft: #e5f3f2;
  --danger: #b42318;
  --danger-hover: #8f1b13;
  --warning: #8a4b08;
  --success: #1f6b3b;
  --focus: #e0a126;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--surface-subtle);
  font-size: 15px;
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-hover);
}

button,
input,
select {
  font: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.site-header {
  min-height: 64px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.brand-mark,
.login-brand {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  color: #ffffff;
  background: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

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

.account form {
  margin: 0;
}

.page-shell {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.platform-nav {
  display: flex;
  gap: 28px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--line);
}

.platform-nav a {
  padding: 0 2px 12px;
  color: var(--muted);
  font-weight: 650;
  text-decoration: none;
  border-bottom: 3px solid transparent;
}

.platform-nav a[aria-current="page"] {
  color: var(--accent);
  border-color: var(--accent);
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 24px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.platform-card {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.platform-card p {
  color: var(--muted);
  margin-bottom: 24px;
}

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

h1 {
  margin-bottom: 6px;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
  letter-spacing: 0;
}

.eyebrow {
  margin-bottom: 7px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

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

.supporting-text {
  margin-bottom: 0;
}

.button {
  min-height: 40px;
  padding: 9px 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
}

.button-primary {
  color: #ffffff;
  background: var(--accent);
}

.button-primary:hover {
  color: #ffffff;
  background: var(--accent-hover);
}

.button-secondary,
.button-quiet {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}

.button-secondary:hover,
.button-quiet:hover {
  color: var(--ink);
  background: var(--surface-subtle);
}

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

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

.button-full {
  width: 100%;
}

.add-menu {
  position: relative;
  flex: 0 0 auto;
}

.add-menu summary {
  list-style: none;
}

.add-menu summary::-webkit-details-marker {
  display: none;
}

.add-menu-items {
  position: absolute;
  z-index: 2;
  top: calc(100% + 6px);
  right: 0;
  width: 190px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 8px 22px rgb(23 33 43 / 12%);
}

.add-menu-items a {
  display: block;
  padding: 9px 10px;
  border-radius: 4px;
  color: var(--ink);
  text-decoration: none;
}

.add-menu-items a:hover {
  background: var(--accent-soft);
}

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

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

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

th {
  color: var(--muted);
  background: #fafbfb;
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
  white-space: nowrap;
}

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

.numeric {
  font-variant-numeric: tabular-nums;
}

.configuration-name {
  min-width: 150px;
  font-weight: 700;
}

.settings-summary {
  min-width: 260px;
  color: var(--muted);
}

.type-label {
  display: inline-block;
  padding: 3px 7px;
  color: #31525a;
  background: #e7f0f1;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  white-space: nowrap;
}

.danger-link {
  color: var(--danger);
}

.empty-state,
.confirm-panel {
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.empty-state p,
.confirm-panel p {
  color: var(--muted);
}

.messages {
  margin-bottom: 20px;
}

.message,
.form-alert {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
}

.message-success {
  color: var(--success);
  border-color: #abd5bb;
  background: #eef8f1;
}

.message-error,
.form-alert {
  color: var(--danger);
  border-color: #efb2ad;
  background: #fff4f2;
}

.form-alert {
  margin-bottom: 20px;
}

.form-alert .errorlist {
  margin: 0;
}

.form-page {
  max-width: 780px;
}

.back-link {
  display: inline-block;
  margin-bottom: 22px;
}

.form-heading {
  margin-bottom: 28px;
}

.configuration-form {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
}

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

.field {
  min-width: 0;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
}

.field input,
.field select {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid #aeb7bf;
  border-radius: 4px;
}

.field input:focus,
.field select:focus {
  border-color: var(--accent);
}

.field-error input,
.field-error select {
  border-color: var(--danger);
}

.help-text {
  margin: 5px 0 0;
  font-size: 13px;
}

.errorlist {
  margin: 6px 0 0;
  padding: 0;
  color: var(--danger);
  font-size: 13px;
  list-style: none;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.warning-text {
  color: var(--warning) !important;
  font-weight: 700;
}

.login-page {
  background: #edf2f2;
}

.login-page .page-shell {
  min-height: 100vh;
  padding: 48px 0;
  display: grid;
  place-items: center;
}

.login-panel {
  width: min(420px, 100%);
  padding: 36px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: 0 14px 34px rgb(23 33 43 / 10%);
}

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

.login-panel h1 {
  font-size: 24px;
}

.form-stack {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

  .platform-card {
    padding: 22px;
  }

  body {
    overflow-x: hidden;
  }

  .site-header {
    padding: 0 16px;
  }

  .brand > span:last-child,
  .account > span {
    display: none;
  }

  .page-shell {
    width: min(100% - 28px, 1180px);
    padding-top: 20px;
  }

  .page-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 18px;
  }

  .add-menu,
  .add-menu summary {
    width: 100%;
  }

  .add-menu-items {
    left: 0;
    right: auto;
    width: 100%;
  }

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

  .table-wrap {
    overflow: visible;
  }

  table,
  tbody {
    display: block;
    width: 100%;
  }

  thead {
    display: none;
  }

  tbody tr {
    display: block;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
  }

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

  tbody td {
    min-width: 0;
    padding: 7px 0;
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 12px;
    border: 0;
  }

  tbody td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    text-transform: uppercase;
  }

  .settings-summary {
    min-width: 0;
  }

  .row-actions {
    justify-content: flex-start;
  }

  .configuration-form,
  .confirm-panel,
  .login-panel {
    padding: 22px;
  }

  h1 {
    font-size: 24px;
  }
}
