:root {
  color-scheme: light;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: #f5f7fa;
  color: #172033;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
}

button,
input,
select {
  font: inherit;
}

.shell {
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

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

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

.login-panel form {
  width: min(360px, 100%);
  border: 1px solid #d9dfea;
  border-radius: 8px;
  background: #fff;
  padding: 22px;
}

.login-panel h1 {
  margin-bottom: 20px;
}

.login-panel button {
  width: 100%;
  margin-top: 14px;
}

#loginStatus {
  min-height: 22px;
  margin-top: 12px;
  color: #b42318;
  font-size: 0.9rem;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 10px 0 22px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 1.8rem;
  line-height: 1.1;
}

h2 {
  font-size: 1rem;
  line-height: 1.2;
}

#statusText {
  margin-top: 6px;
  color: #526074;
  font-size: 0.92rem;
}

.profile-control {
  width: min(320px, 100%);
}

label span {
  display: block;
  margin-bottom: 6px;
  color: #526074;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

input,
select {
  width: 100%;
  height: 40px;
  border: 1px solid #cfd6e3;
  border-radius: 6px;
  background: #fff;
  color: #172033;
  padding: 0 11px;
}

input:focus,
select:focus {
  border-color: #2d6cdf;
  box-shadow: 0 0 0 3px rgba(45, 108, 223, 0.14);
  outline: none;
}

button {
  height: 40px;
  border: 0;
  border-radius: 6px;
  background: #1f5fbf;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  padding: 0 16px;
}

button:hover {
  background: #194f9f;
}

.icon-button {
  width: 36px;
  padding: 0;
}

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

.panel {
  border: 1px solid #d9dfea;
  border-radius: 8px;
  background: #fff;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  border-bottom: 1px solid #e5e9f0;
  padding: 0 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(150px, 0.6fr) minmax(220px, 1fr) auto;
  align-items: end;
  gap: 12px;
  padding: 16px;
}

.form-grid .wide {
  min-width: 0;
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  border-top: 1px solid #edf0f5;
  padding: 11px 16px;
  text-align: left;
  vertical-align: top;
}

th {
  color: #667386;
  font-size: 0.75rem;
  text-transform: uppercase;
}

td {
  color: #243149;
  font-size: 0.92rem;
}

td:last-child,
th:last-child {
  text-align: right;
}

.delete-button {
  width: 34px;
  height: 34px;
  border: 1px solid #d7deea;
  background: #fff;
  color: #b42318;
  padding: 0;
}

.delete-button:hover {
  background: #fff1f0;
}

.action-row {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.action-row button {
  height: 32px;
  border: 1px solid #d7deea;
  background: #fff;
  color: #1f5fbf;
  padding: 0 10px;
}

.action-row button:hover {
  background: #eef5ff;
}

.empty {
  color: #667386;
}

.policy-panel {
  grid-column: 1 / -1;
}

pre {
  min-height: 180px;
  margin: 0;
  overflow: auto;
  padding: 16px;
  color: #172033;
  font-size: 0.88rem;
  line-height: 1.5;
}

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

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

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