:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #182230;
  background: #f4f7fb;
  line-height: 1.5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

main {
  width: min(900px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 64px;
}

header {
  margin-bottom: 28px;
}

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

h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.1;
}

h2 {
  margin-bottom: 4px;
  font-size: 1.25rem;
}

.eyebrow {
  margin-bottom: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #275dad;
}

.intro,
.section-heading p {
  color: #536273;
}

.panel {
  margin-bottom: 20px;
  padding: 24px;
  background: #ffffff;
  border: 1px solid #dbe3ec;
  border-radius: 14px;
  box-shadow: 0 8px 28px rgb(31 50 74 / 7%);
}

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

.badge {
  flex: 0 0 auto;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.badge-neutral {
  color: #4b5563;
  background: #edf1f5;
}

.badge-ok {
  color: #12613b;
  background: #dff5e8;
}

.details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 22px;
}

.details div {
  padding: 12px;
  background: #f6f8fb;
  border-radius: 9px;
}

.details dt {
  color: #687789;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
}

.details dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

form {
  display: grid;
  gap: 9px;
}

label {
  margin-top: 7px;
  font-weight: 650;
}

input {
  width: 100%;
  padding: 11px 12px;
  color: inherit;
  background: #fff;
  border: 1px solid #b9c6d4;
  border-radius: 8px;
  font: inherit;
}

input:focus {
  border-color: #1b69c9;
  outline: 3px solid rgb(27 105 201 / 16%);
}

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

button {
  padding: 10px 15px;
  color: #fff;
  background: #155bb1;
  border: 1px solid #155bb1;
  border-radius: 8px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button.secondary {
  color: #24354a;
  background: #fff;
  border-color: #b9c6d4;
}

button:disabled {
  opacity: 0.55;
  cursor: wait;
}

pre {
  min-height: 120px;
  max-height: 480px;
  margin: 20px 0 0;
  padding: 16px;
  overflow: auto;
  color: #eaf2fb;
  background: #172232;
  border-radius: 10px;
  font-size: 0.86rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message {
  padding: 14px 16px;
  border-radius: 9px;
  font-weight: 650;
}

.message-success {
  color: #12613b;
  background: #dff5e8;
}

.message-error {
  color: #8c1d27;
  background: #fde7e9;
}

.message-info {
  color: #27496f;
  background: #e7f0fa;
}

@media (max-width: 620px) {
  main {
    padding-top: 28px;
  }

  .panel {
    padding: 18px;
  }

  .section-heading {
    display: block;
  }

  .badge {
    display: inline-block;
    margin-top: 6px;
  }

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

.hint {
  margin: 2px 0 0;
  color: #687789;
  font-size: 0.88rem;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  overflow-wrap: anywhere;
}

.agent-management {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid #dbe3ec;
}

.compact-heading {
  margin-bottom: 12px;
}

.agent-list {
  display: grid;
  gap: 12px;
}

.agent-card {
  padding: 14px;
  background: #f6f8fb;
  border: 1px solid #dbe3ec;
  border-radius: 10px;
}

.agent-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.agent-card h3 {
  margin: 0;
  font-size: 1rem;
}

.agent-card p {
  margin: 5px 0 0;
  color: #687789;
  font-size: 0.88rem;
}

.agent-token-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 8px;
  margin-top: 12px;
}

.agent-token-row input {
  min-width: 0;
}

@media (max-width: 760px) {
  .agent-token-row {
    grid-template-columns: 1fr 1fr;
  }

  .agent-token-row input {
    grid-column: 1 / -1;
  }
}


.policy-details,
.agent-policy-details {
  margin-top: 12px;
}

.policy-details summary,
.agent-policy-details summary {
  cursor: pointer;
  font-weight: 700;
  color: #24354a;
}

.policy-details pre,
.agent-policy-details pre {
  min-height: 0;
  max-height: 320px;
  margin-top: 10px;
}

.agent-policy-details pre {
  font-size: 0.8rem;
}

.test-bundle-actions {
  margin-top: 18px;
  padding: 16px;
  background: #f6f8fb;
  border: 1px solid #dbe3ec;
  border-radius: 10px;
}

.test-bundle-actions h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

select,
textarea {
  width: 100%;
  padding: 11px 12px;
  color: inherit;
  background: #fff;
  border: 1px solid #b9c6d4;
  border-radius: 8px;
  font: inherit;
}

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

select:focus,
textarea:focus {
  border-color: #1b69c9;
  outline: 3px solid rgb(27 105 201 / 16%);
}

fieldset {
  min-width: 0;
  margin: 14px 0 0;
  padding: 14px;
  border: 1px solid #dbe3ec;
  border-radius: 9px;
}

legend {
  padding: 0 6px;
  font-weight: 700;
}

.object-rule {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(220px, 2fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  background: #fff;
  border: 1px solid #dbe3ec;
  border-radius: 9px;
}

.object-rule-operations {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  grid-column: 1 / -1;
}

button.danger {
  color: #8c1d27;
  background: #fff;
  border-color: #d48a91;
}

@media (max-width: 760px) {
  .object-rule {
    grid-template-columns: 1fr;
  }

  .object-rule-operations {
    grid-column: 1;
  }
}

.agent-config-panel {
  margin: 16px 0;
  padding: 16px;
  background: #f9fbfd;
  border: 1px solid #cfd9e5;
  border-radius: 10px;
}

.agent-config-panel[hidden] {
  display: none;
}

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

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
  font-weight: 650;
}

.checkbox-line input {
  width: auto;
  margin: 0;
}

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

.usage-access-grid {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) repeat(3, minmax(92px, auto));
  gap: 0;
  overflow: hidden;
  border: 1px solid #dbe3ec;
  border-radius: 9px;
  background: #fff;
}

.usage-access-cell {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 9px 12px;
  border-bottom: 1px solid #e7edf4;
}

.usage-access-cell:not(.usage-access-name) {
  justify-content: center;
}

.usage-access-header {
  min-height: 38px;
  font-size: 0.88rem;
  font-weight: 700;
  background: #f4f7fa;
}

.usage-access-name {
  font-weight: 650;
}

.usage-access-muted {
  color: #8b98a6;
}

.usage-access-grid > :nth-last-child(-n + 4) {
  border-bottom: 0;
}

.object-rule-list {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

@media (max-width: 760px) {
  .form-grid,
  .capability-grid {
    grid-template-columns: 1fr;
  }

  .usage-access-grid {
    grid-template-columns: minmax(145px, 1fr) repeat(3, minmax(64px, auto));
    font-size: 0.92rem;
  }

  .usage-access-cell {
    padding: 8px 7px;
  }
}

.login-shell {
  width: min(520px, calc(100% - 32px));
  min-height: 100vh;
  display: grid;
  align-content: center;
  padding: 32px 0;
}

.login-panel {
  margin: 0;
}
