:root {
  color-scheme: dark;
  --bg: #0b1019;
  --surface: #131c2a;
  --line: #293449;
  --text: #eaf0f9;
  --muted: #a3b0c5;
  --accent: #54d7c1;
}
.module-grid {display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:20px}
.module-card {display:flex;flex-direction:column;gap:12px}
.module-link {color:var(--accent);text-underline-offset:4px}
.password-field {display:block;position:relative}
.password-field input {padding-right:52px}
.password-eye {position:absolute;right:5px;top:50%;transform:translateY(-50%);padding:8px;background:transparent;color:var(--muted);border:0;width:40px!important;height:40px}
.password-eye svg {width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.7}
.password-eye[aria-pressed="true"] {color:var(--accent)}
#forgot-message {margin-top:12px;font-size:14px;color:var(--muted)}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    16px/1.55 "Segoe UI",
    Arial,
    sans-serif;
}
button,
input,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  border-radius: 8px;
  padding: 10px 17px;
  border: 1px solid var(--line);
  font-weight: 600;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button:focus-visible,
a:focus-visible,
input:focus,
textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.primary {
  background: var(--accent);
  color: #09241f;
  border-color: var(--accent);
}
.quiet {
  background: #1b2739;
  color: var(--text);
}
.danger {
  background: transparent;
  color: #ffb2b2;
  border-color: #734447;
}
input,
textarea {
  display: block;
  width: 100%;
  background: #0d1522;
  border: 1px solid #3b4960;
  border-radius: 8px;
  padding: 11px 13px;
  color: var(--text);
  margin-top: 7px;
}
label {
  display: block;
  color: #cbd6e7;
  font-size: 15px;
}
h1 {
  font-size: 32px;
  line-height: 1.2;
  margin: 8px 0 12px;
  font-weight: 650;
  letter-spacing: -0.7px;
}
h2 {
  font-size: 20px;
  margin: 0 0 5px;
}
p {
  margin: 0 0 14px;
}
.muted {
  color: var(--muted);
}
.eyebrow {
  font-size: 13px;
  letter-spacing: 1.3px;
  color: var(--accent);
  font-weight: 650;
}
.footnote {
  font-size: 14px;
  color: var(--muted);
}
#login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 25px;
}
.login-card {
  width: min(460px, 100%);
  padding: 38px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 22px 80px #0004;
}
.logo {
  font-size: 35px;
  font-weight: 800;
  letter-spacing: -5px;
  margin-bottom: 28px;
}
.logo span {
  color: var(--accent);
}
#login-form {
  display: grid;
  gap: 17px;
  margin: 26px 0 8px;
}
.error {
  color: #ffb2b2;
  font-size: 15px;
  min-height: 22px;
  margin: 0;
}
#dashboard {
  display: flex;
  min-height: 100vh;
}
#dashboard[hidden],
#login-view[hidden] {
  display: none;
}
aside {
  width: 230px;
  position: fixed;
  inset: 0 auto 0 0;
  background: #101724;
  border-right: 1px solid var(--line);
  padding: 30px 22px;
}
.brand {
  font-size: 23px;
  font-weight: 750;
  letter-spacing: 0.4px;
}
.brand span {
  display: block;
  font-size: 14px;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0;
  margin-top: 3px;
}
nav {
  margin-top: 48px;
}
nav a {
  display: block;
  padding: 12px 14px;
  text-decoration: none;
  border-radius: 8px;
  color: var(--accent);
  background: #163532;
  border-left: 3px solid var(--accent);
}
.sidebar-bottom {
  position: absolute;
  bottom: 28px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.9;
}
.sidebar-bottom span {
  color: #7e8ca4;
}
.workspace {
  margin-left: 230px;
  width: calc(100% - 230px);
}
.topbar {
  min-height: 80px;
  padding: 16px 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.7px;
}
.topbar > div {
  display: flex;
  align-items: center;
  gap: 18px;
  letter-spacing: 0;
}
.content {
  max-width: 1350px;
  margin: auto;
  padding: 38px;
}
.heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.version {
  border: 1px solid var(--line);
  padding: 5px 12px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
}
.status-strip {
  display: flex;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 22px 0;
  margin-bottom: 30px;
  gap: 70px;
}
.status-strip span {
  display: block;
  color: var(--muted);
  font-size: 14px;
}
.status-strip strong {
  display: block;
  font-size: 24px;
  font-weight: 600;
  margin-top: 4px;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 24px;
}
.create-panel form {
  display: flex;
  align-items: end;
  gap: 16px;
  margin-top: 20px;
}
.create-panel label {
  flex: 1;
  max-width: 550px;
}
.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 18px;
  margin-bottom: 12px;
}
.panel-heading p {
  font-size: 14px;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  white-space: nowrap;
}
th {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 17px 14px;
  border-bottom: 1px solid #263247;
  font-size: 15px;
}
td:first-child {
  white-space: normal;
  min-width: 140px;
}
td small {
  display: block;
  color: var(--muted);
  font-size: 13px;
}
td code {
  font-size: 14px;
  color: #b5c8e1;
}
.pill {
  padding: 4px 9px;
  border-radius: 5px;
  background: #193b35;
  color: #83e4c9;
  font-size: 13px;
}
.pill.revoked {
  background: #342b35;
  color: #d4afbd;
}
.empty {
  text-align: center;
  padding: 35px;
  color: var(--muted);
}
dialog {
  width: min(590px, 95vw);
  background: var(--surface);
  color: var(--text);
  border: 1px solid #43546e;
  border-radius: 14px;
  padding: 30px;
}
dialog::backdrop {
  background: #000b;
}
dialog p {
  color: var(--muted);
}
#new-secret {
  font-family: Consolas, monospace;
  overflow-wrap: anywhere;
}
.dialog-actions {
  display: flex;
  gap: 12px;
  margin-top: 23px;
}
#notice {
  position: fixed;
  top: 18px;
  right: 20px;
  max-width: 480px;
  z-index: 20;
  background: #223c36;
  border: 1px solid #407267;
  color: var(--text);
  padding: 12px 18px;
  border-radius: 9px;
  display: none;
}
#notice.show {
  display: block;
}
#notice.bad {
  background: #4b2730;
  border-color: #865064;
}
@media (max-width: 900px) {
  aside {
    width: 180px;
    padding: 25px 15px;
  }
  .workspace {
    margin-left: 180px;
    width: calc(100% - 180px);
  }
  .brand {
    font-size: 19px;
  }
  .content {
    padding: 24px;
  }
  .topbar {
    padding: 16px 24px;
  }
  .status-strip {
    gap: 35px;
  }
  .create-panel form {
    flex-wrap: wrap;
  }
  .create-panel label {
    min-width: 100%;
  }
}
@media (max-width: 620px) {
  aside {
    position: static;
    width: 100%;
    border: 0;
    padding: 17px 22px;
  }
  .brand span,
  nav,
  .sidebar-bottom {
    display: none;
  }
  #dashboard {
    display: block;
  }
  .workspace {
    margin: 0;
    width: 100%;
  }
  .topbar {
    min-height: 65px;
  }
  .topbar > span {
    display: none;
  }
  .topbar > div {
    width: 100%;
    justify-content: space-between;
  }
  .content {
    padding: 22px 16px;
  }
  .status-strip {
    gap: 20px;
    flex-wrap: wrap;
  }
  .status-strip strong {
    font-size: 21px;
  }
  .panel {
    padding: 18px;
  }
  .login-card {
    padding: 26px;
  }
  h1 {
    font-size: 28px;
  }
  .dialog-actions {
    flex-wrap: wrap;
  }
}
[hidden] {
  display: none !important;
}
nav {
  display: grid;
  gap: 9px;
}
nav button {
  text-align: left;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  font-weight: 500;
}
nav button.active {
  background: #163532;
  color: var(--accent);
  border-left: 3px solid var(--accent);
}
.user-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 24px;
}
.user-form button {
  width: max-content;
}
select {
  width: 100%;
  font: inherit;
  background: #0d1522;
  color: var(--text);
  border: 1px solid #3b4c65;
  border-radius: 8px;
  padding: 11px;
  margin-top: 7px;
}
input,
textarea {
  background: #0d1522;
  color: var(--text);
  border: 1px solid #3b4c65;
  border-radius: 8px;
  padding: 11px;
  width: 100%;
  margin-top: 7px;
}
label {
  display: block;
  font-size: 14px;
}
td button + button {
  margin-left: 8px;
}
.profile-list {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 12px;
}
.profile-list dt {
  color: var(--muted);
}
.profile-list dd {
  margin: 0;
}
#reset-form {
  display: grid;
  gap: 16px;
}
#reset-dialog {
  max-width: 510px;
}
@media (max-width: 620px) {
  .user-form {
    grid-template-columns: 1fr;
  }
  nav {
    display: flex;
    flex-wrap: wrap;
    margin-top: 18px;
  }
  nav button {
    font-size: 14px;
    padding: 8px;
  }
  aside .brand span {
    display: none;
  }
}

.permission-box {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 18px;
  grid-column: 1/-1;
}
.permission-box legend {
  padding: 0 9px;
  color: var(--muted);
  font-size: 14px;
}
.check-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
}
.check-label input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}
.campaign-options {
  max-height: 240px;
  overflow: auto;
  border-top: 1px solid var(--line);
  margin-top: 15px;
  padding-top: 10px;
}
#access-dialog {
  width: min(690px, 96vw);
  max-height: 90vh;
  overflow: auto;
}
#access-form {
  display: grid;
  gap: 18px;
}
.scope-note {
  font-size: 13px;
  color: var(--muted);
  max-width: 310px;
  white-space: normal;
}
#my-campaigns p {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.signer-preview-box{background:white;width:min(100%,320px);text-align:center;margin:16px 0}#signer-preview{max-width:100%;height:120px;object-fit:contain}
