:root {
  color-scheme: dark;
  --background: #111417;
  --surface: #181c20;
  --surface-raised: #1e2328;
  --border: #343a40;
  --border-strong: #4a525a;
  --text: #e7e9eb;
  --muted: #9da5ad;
  --accent: #82a9cc;
  --accent-strong: #b6d2ea;
  --success: #77b68c;
  --warning: #c7a65a;
  --danger: #cb7878;
  --sidebar-width: 224px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--background);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

a {
  color: var(--accent-strong);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code {
  color: #c8d6e2;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.login-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: inline-flex;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid #6685a0;
  background: #202a33;
  color: #d7e6f2;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
}

.application-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 16px 18px;
  border-right: 1px solid var(--border);
  background: #14181b;
}

.sidebar nav {
  display: grid;
  gap: 4px;
}

.sidebar nav a {
  display: block;
  padding: 9px 12px;
  border-left: 2px solid transparent;
  color: #b6bdc4;
  font-weight: 500;
}

.sidebar nav a:hover {
  background: #1b2024;
  color: var(--text);
  text-decoration: none;
}

.sidebar nav a[aria-current="page"] {
  border-left-color: var(--accent);
  background: #20262b;
  color: #f1f3f5;
}

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.sidebar-footer dl {
  margin: 0 0 16px;
}

.sidebar-footer dl div {
  margin-bottom: 8px;
}

.sidebar-footer dt {
  color: #747e87;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.sidebar-footer dd {
  overflow: hidden;
  margin: 2px 0 0;
  color: #c2c8ce;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main-content {
  width: 100%;
  max-width: 1480px;
  grid-column: 2;
  padding: 34px 38px 28px;
}

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

.eyebrow {
  margin: 0 0 4px;
  color: #7f8992;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -.01em;
}

h2 {
  margin-bottom: 3px;
  font-size: 15px;
  font-weight: 650;
}

.button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 7px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.button:hover {
  text-decoration: none;
}

.button-primary {
  border-color: #789ab8;
  background: #789ab8;
  color: #10161b;
}

.button-primary:hover {
  border-color: #91afc9;
  background: #91afc9;
}

.button-secondary {
  background: #1b2024;
  color: #cbd1d6;
}

.button-secondary:hover {
  border-color: #626c75;
  background: #242a2f;
}

.button-block {
  width: 100%;
}

.stat-grid {
  display: grid;
  margin-bottom: 18px;
  gap: 1px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--border);
  background: var(--border);
}

.stat-box {
  min-height: 122px;
  padding: 18px 20px;
  background: var(--surface);
}

.stat-box span,
.stat-box strong,
.stat-box small {
  display: block;
}

.stat-box span {
  color: var(--muted);
  font-size: 12px;
}

.stat-box strong {
  margin: 7px 0 2px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  font-weight: 400;
}

.stat-box small {
  color: #737d85;
  font-size: 11px;
}

.notice-panel {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 15px 18px;
  border: 1px solid #5a4d31;
  background: #211e17;
}

.notice-panel strong {
  color: #dfc889;
}

.notice-panel p {
  max-width: 850px;
  margin: 3px 20px 0 0;
  color: #aaa38f;
  font-size: 12px;
}

.panel {
  margin-bottom: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.panel-header {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.panel-header p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
}

.panel-header > a {
  font-size: 12px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

th,
td {
  padding: 11px 14px;
  border-bottom: 1px solid #2c3237;
  text-align: left;
  vertical-align: middle;
}

th {
  background: #15191d;
  color: #858f97;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

td {
  color: #cbd0d4;
  font-size: 12px;
}

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

tbody tr:hover td {
  background: #1c2125;
}

td.empty {
  padding: 28px 16px;
  color: #79828a;
  text-align: center;
}

.policy-value {
  margin-bottom: 7px;
  color: #d8dce0;
}

.limit-form {
  display: flex;
  align-items: center;
  gap: 6px;
}

.limit-form input[type="number"] {
  width: 96px;
  height: 34px;
  padding: 6px 8px;
  border: 1px solid #454d54;
  border-radius: 2px;
  outline: none;
  background: #101316;
  color: var(--text);
  font: inherit;
}

.limit-form input[type="number"]:focus {
  border-color: #7fa2c0;
  box-shadow: 0 0 0 1px #7fa2c0;
}

.limit-form span {
  color: var(--muted);
  font-size: 11px;
}

.state {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid #505960;
  color: #aeb5bb;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .06em;
}

.state-ok {
  border-color: #4f765d;
  color: #91c29f;
}

.state-warning {
  border-color: #766438;
  color: #d0b66d;
}

.state-danger {
  border-color: #7c4747;
  color: #d68b8b;
}

.summary-line {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 18px;
  gap: 1px;
  border: 1px solid var(--border);
  background: var(--border);
}

.summary-line span {
  min-width: 180px;
  padding: 11px 15px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
}

.summary-line strong {
  margin-right: 3px;
  color: var(--text);
}

.pagination {
  display: grid;
  align-items: center;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  grid-template-columns: 1fr auto 1fr;
}

.pagination > :last-child {
  justify-self: end;
}

.narrow-panel,
.form-panel {
  max-width: 760px;
}

.definition-list {
  margin: 0;
}

.definition-list div {
  display: grid;
  padding: 12px 18px;
  border-bottom: 1px solid #2c3237;
  grid-template-columns: minmax(180px, 38%) 1fr;
}

.definition-list div:last-child {
  border-bottom: 0;
}

.definition-list dt {
  color: var(--muted);
}

.definition-list dd {
  margin: 0;
  color: #d8dce0;
}

.form-stack {
  display: grid;
  gap: 8px;
}

.form-panel .form-stack {
  max-width: 520px;
  padding: 22px 18px 26px;
}

.form-stack label {
  margin-top: 7px;
  color: #bdc4ca;
  font-size: 12px;
  font-weight: 650;
}

.form-stack input {
  width: 100%;
  height: 39px;
  padding: 8px 10px;
  border: 1px solid #454d54;
  border-radius: 2px;
  outline: none;
  background: #101316;
  color: var(--text);
  font: inherit;
}

.form-stack input:focus {
  border-color: #7fa2c0;
  box-shadow: 0 0 0 1px #7fa2c0;
}

.form-stack select,
.generator-output input,
.generator-output textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #454d54;
  border-radius: 2px;
  outline: none;
  background: #101316;
  color: var(--text);
  font: inherit;
}

.form-stack select,
.generator-output input {
  height: 39px;
}

.form-stack select:focus,
.generator-output input:focus,
.generator-output textarea:focus {
  border-color: #7fa2c0;
  box-shadow: 0 0 0 1px #7fa2c0;
}

.generator-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(380px, 1.2fr);
}

.generator-controls,
.generator-output {
  padding: 20px 18px 24px;
}

.generator-output {
  border-left: 1px solid var(--border);
}

.generator-output h3 {
  margin: 0 0 17px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 400;
}

.generator-output label {
  display: block;
  margin: 12px 0 6px;
  color: #bdc4ca;
  font-size: 12px;
  font-weight: 650;
}

.generator-output textarea {
  min-height: 154px;
  resize: vertical;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.generator-output .button {
  margin-top: 12px;
}

.copy-status {
  min-height: 18px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.field-help {
  margin: -2px 0 2px;
  color: #7e878f;
  font-size: 11px;
}

.form-actions {
  margin-top: 12px;
}

.generator-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.message {
  margin-bottom: 16px;
  padding: 10px 12px;
  border: 1px solid;
  font-size: 12px;
}

.message-error {
  border-color: #744747;
  background: #241919;
  color: #dea0a0;
}

.message-success {
  border-color: #42694f;
  background: #172019;
  color: #9bc3a7;
}

.page-footer {
  padding-top: 12px;
  color: #68727a;
  font-size: 11px;
}

.login-body {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: #101316;
}

.login-panel {
  width: min(100%, 410px);
  padding: 28px;
  border: 1px solid #3a4249;
  background: #181c20;
  box-shadow: 0 16px 50px rgb(0 0 0 / 28%);
}

.login-heading {
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.login-heading h1 {
  font-size: 23px;
}

.login-copy {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 12px;
}

.login-panel .button {
  margin-top: 15px;
}

.login-footnote {
  margin: 22px 0 0;
  color: #6f7880;
  font-size: 10px;
  text-align: center;
}

@media (max-width: 900px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .main-content {
    padding: 28px 24px;
  }

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

  .generator-output {
    border-top: 1px solid var(--border);
    border-left: 0;
  }
}

@media (max-width: 680px) {
  .application-shell {
    display: block;
  }

  .sidebar {
    position: static;
    width: 100%;
    padding: 8px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .sidebar nav {
    display: flex;
    overflow-x: auto;
  }

  .sidebar nav a {
    border-bottom: 2px solid transparent;
    border-left: 0;
    white-space: nowrap;
  }

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

  .sidebar-footer {
    margin-top: 8px;
    padding-top: 8px;
  }

  .sidebar-footer dl {
    display: none;
  }

  .main-content {
    padding: 22px 14px;
  }

  .page-heading {
    align-items: center;
  }

  h1 {
    font-size: 23px;
  }

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

  .notice-panel {
    display: block;
  }

  .notice-panel .state {
    margin-top: 10px;
  }

  .definition-list div {
    gap: 3px;
    grid-template-columns: 1fr;
  }
}
