:root {
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei UI', 'Microsoft YaHei',
    sans-serif;
  color: #282b32;
  background: #f5f6f7;
  font-size: 14px;
  font-synthesis: none;
  --green: #01c260;
  --line: #e8ebed;
  --muted: #68717b;
  --danger: #b84542;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
}
button:disabled {
  opacity: 0.48;
  cursor: default;
}
button,
input,
textarea {
  transition:
    background 0.15s,
    border-color 0.15s;
}
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid #258657;
  outline-offset: 3px;
}
::selection {
  background: #d5f5e4;
  color: #20242b;
}
input,
textarea {
  caret-color: #258657;
}
svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 26px;
  line-height: 1.45;
  font-weight: 650;
  letter-spacing: -0.5px;
}
h2 {
  font-size: 17px;
  font-weight: 650;
}
h3 {
  font-size: 14px;
  font-weight: 650;
}
p {
  line-height: 1.7;
}
.muted {
  color: var(--muted);
}
.hint {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}
.error {
  font-size: 13px;
  line-height: 1.6;
  color: var(--danger);
  white-space: pre-wrap;
}
.error:empty {
  display: none;
}
.primary,
.secondary {
  min-height: 38px;
  border-radius: 8px;
  padding: 0 15px;
  font-weight: 550;
}
.primary {
  background: var(--green);
  color: #15281e;
  border: 1px solid transparent;
}
.primary:hover:not(:disabled) {
  background: #00ad55;
}
.secondary {
  background: #fff;
  border: 1px solid #dfe4e7;
  color: #39414b;
}
.secondary:hover:not(:disabled) {
  background: #f1f4f3;
  border-color: #cbd3ce;
}
.danger {
  color: var(--danger);
}
.text-button {
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: #466457;
  font-size: 13px;
}
.text-button:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.icon-button {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 7px;
  padding: 6px;
}
.icon-button:hover {
  background: #f0f3f2;
}
.full {
  width: 100%;
}
label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  font-weight: 550;
}
input,
textarea {
  width: 100%;
  border: 1px solid #dfe4e7;
  background: #f8f9fb;
  border-radius: 8px;
  padding: 10px 11px;
  min-height: 40px;
  color: #282b32;
  outline: none;
}
input::placeholder,
textarea::placeholder {
  color: #737c85;
}
input:focus,
textarea:focus {
  border-color: #258657;
  background: white;
}
textarea {
  resize: vertical;
  line-height: 1.6;
}
form {
  display: flex;
  flex-direction: column;
  gap: 17px;
}
.loading {
  min-height: 100vh;
  display: grid;
  place-content: center;
  color: var(--muted);
}
[hidden] {
  display: none !important;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand strong {
  font-size: 21px;
  letter-spacing: -0.5px;
}
.brand img {
  border-radius: 10px;
}
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}
.login-panel {
  width: min(100%, 400px);
  padding: 34px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 40px #20242b0d;
}
.login h1 {
  margin: 30px 0 8px;
  font-size: 24px;
}
.login form {
  margin-top: 26px;
}
.login .primary {
  margin-top: 4px;
  height: 42px;
}
.workspace {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
}
.sidebar {
  background: #fff;
  padding: 28px 16px 20px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar .brand {
  padding: 0 12px;
  flex-wrap: wrap;
  gap: 9px;
}
.sidebar .brand span {
  flex-basis: 100%;
  font-size: 12px;
  color: var(--muted);
  margin: 2px 0 0 43px;
}
.sidebar nav {
  display: grid;
  gap: 7px;
  margin-top: 38px;
}
.nav-item {
  justify-content: flex-start;
  padding: 12px 16px;
  border: 0;
  background: transparent;
  border-radius: 9px;
  color: #68717b;
  font-weight: 550;
}
.nav-item:hover {
  background: #f5f7f6;
}
.nav-item.selected {
  background: #e5f8ed;
  color: #1d6442;
}
.sidebar-footer {
  margin-top: auto;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 9px;
  padding: 20px 12px 0;
  border-top: 1px solid var(--line);
}
#admin-name {
  font-weight: 600;
  margin-bottom: 3px;
}
.main {
  padding: 38px 40px 30px;
  min-width: 0;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 27px;
}
.page-heading p {
  margin-top: 6px;
  font-size: 13px;
}
.status-tabs {
  display: flex;
  gap: 25px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}
.status-tabs button {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  min-height: 44px;
  padding: 0 0 13px;
  color: #68717b;
  font-weight: 550;
}
.status-tabs button.selected {
  color: #226542;
  border-bottom-color: #01a954;
}
.status-tabs span {
  background: #e9edeb;
  color: #506158;
  font-size: 12px;
  padding: 1px 7px;
  min-width: 23px;
  border-radius: 5px;
  font-variant-numeric: tabular-nums;
}
.status-tabs .selected span {
  background: #d7f3e3;
  color: #225b3d;
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 17px;
}
.search {
  position: relative;
  max-width: 340px;
  width: 100%;
  font-weight: 400;
}
.search svg {
  position: absolute;
  top: 12px;
  left: 12px;
  color: #7d868e;
  width: 17px;
  height: 17px;
}
.search input {
  padding-left: 38px;
  background: #fff;
}
.toolbar .muted {
  font-size: 12px;
  margin-left: auto;
}
.account-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.account-layout.with-editor {
  grid-template-columns: minmax(520px, 1fr) 340px;
}
.table-panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  min-width: 0;
}
.table-scroll {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
  white-space: nowrap;
}
th {
  font-weight: 550;
  color: #6a737d;
  font-size: 12px;
  background: #fafbfb;
  border-bottom: 1px solid var(--line);
  padding: 14px 18px;
}
td {
  padding: 17px 18px;
  border-bottom: 1px solid #f0f2f3;
  vertical-align: middle;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: #fafcfb;
}
tbody tr.selected {
  background: #f0faf4;
}
.account-name {
  font-weight: 600;
  color: #282b32;
}
.account-note {
  color: #77818a;
  font-size: 12px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 5px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #426650;
}
.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  display: inline-block;
  border-radius: 50%;
  background: #01a954;
}
.badge.expired {
  color: #9b6a24;
}
.badge.expired::before {
  background: #b88434;
}
.badge.disabled {
  color: #80868d;
}
.badge.disabled::before {
  background: #959ca3;
}
.number {
  font-variant-numeric: tabular-nums;
}
.cell-muted {
  font-size: 12px;
  color: #77818a;
}
.manage-button {
  border: 0;
  background: transparent;
  padding: 4px;
  color: #258657;
  font-size: 13px;
}
.manage-button:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.empty {
  padding: 65px 25px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 13px;
  color: #68717b;
}
.empty h2 {
  color: #38424b;
  font-size: 17px;
}
.empty p {
  font-size: 13px;
}
.empty .primary {
  margin-top: 6px;
}
.pagination {
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}
.pagination > div {
  display: flex;
  gap: 8px;
}
.pagination .secondary {
  min-height: 32px;
  font-size: 12px;
  padding: 0 12px;
}
.editor {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  min-width: 0;
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow: auto;
}
.editor-heading {
  padding: 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.editor-heading h2 {
  overflow-wrap: anywhere;
  margin-bottom: 8px;
}
.editor-content {
  padding: 22px 20px;
}
.editor-content h3 {
  margin-bottom: 1px;
}
.editor-content form {
  gap: 15px;
}
.editor-section {
  padding-top: 24px;
  margin-top: 24px;
  border-top: 1px solid var(--line);
}
.field-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.field-pair label {
  min-width: 0;
}
.preset-days {
  display: flex;
  gap: 7px;
}
.preset-days button {
  border: 1px solid #dfe5e1;
  background: #fff;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 12px;
  flex: 1;
}
.preset-days button.selected {
  color: #226542;
  border-color: #a3d8bb;
  background: #edf9f2;
}
.inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
}
.inline-form > label {
  width: 90px;
}
.inline-form input {
  min-height: 36px;
  padding: 8px;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}
.device {
  padding: 12px 0;
  border-bottom: 1px solid #f0f2f3;
  font-size: 12px;
}
.device:last-child {
  border: 0;
}
.device-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
}
.device-id {
  font-variant-numeric: tabular-nums;
  color: #6a737d;
  overflow-wrap: anywhere;
  line-height: 1.8;
  font-size: 11px;
}
.device-footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  align-items: center;
}
.account-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.account-actions .secondary {
  font-size: 12px;
  padding: 0 11px;
  min-height: 34px;
}
dialog {
  width: min(520px, calc(100vw - 32px));
  border: 0;
  border-radius: 14px;
  padding: 27px;
  max-height: calc(100vh - 40px);
  box-shadow: 0 18px 70px #16221a2b;
  overflow: auto;
  color: #282b32;
}
dialog::backdrop {
  background: #18251f42;
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 4px;
}
.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 7px;
}
#create-fields {
  display: flex;
  flex-direction: column;
  gap: 17px;
}
.password-line {
  display: flex;
  gap: 7px;
}
.password-line input {
  min-width: 0;
  flex: 1;
}
.password-line .secondary {
  font-size: 12px;
  padding: 0 10px;
}
#confirm-dialog p {
  margin: 18px 0 24px;
  color: #68717b;
  font-size: 13px;
  white-space: pre-wrap;
}
#toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  border-radius: 9px;
  background: #25392d;
  color: white;
  font-size: 13px;
  box-shadow: 0 6px 24px #16221a24;
  max-width: calc(100vw - 32px);
  z-index: 20;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
#page-error:not(:empty) {
  margin-bottom: 16px;
}
#audit-view table td {
  white-space: normal;
  min-width: 100px;
}
#audit-view table td:nth-child(5) {
  min-width: 200px;
  max-width: 420px;
  line-height: 1.65;
}
@media (max-width: 1250px) {
  .main {
    padding: 30px 25px;
  }
  .workspace {
    grid-template-columns: 184px minmax(0, 1fr);
  }
  .account-layout.with-editor {
    grid-template-columns: minmax(400px, 1fr) 310px;
  }
  .sidebar {
    padding-left: 10px;
    padding-right: 10px;
  }
  .account-layout.with-editor td,
  .account-layout.with-editor th {
    padding-left: 13px;
    padding-right: 13px;
  }
  .table-scroll {
    scrollbar-width: thin;
  }
}
@media (max-width: 1050px) {
  .account-layout.with-editor {
    grid-template-columns: minmax(0, 1fr);
  }
  .editor {
    position: static;
    max-height: none;
  }
  .editor-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
  .editor-section {
    margin-top: 0;
    padding-top: 0;
    border: 0;
  }
  .editor-content form:first-child {
    grid-row: span 2;
  }
  .editor-content .editor-section:last-child {
    grid-column: 1/-1;
    border-top: 1px solid var(--line);
    padding-top: 20px;
  }
  .editor {
    grid-row: 1;
  }
}
@media (max-width: 680px) {
  .workspace {
    display: block;
  }
  .sidebar {
    position: static;
    height: auto;
    padding: 15px 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
  }
  .sidebar .brand {
    padding: 0;
  }
  .sidebar .brand span {
    display: none;
  }
  .sidebar .brand strong {
    font-size: 19px;
  }
  .sidebar nav {
    margin: 0;
    display: flex;
    gap: 3px;
    align-self: center;
  }
  .nav-item {
    font-size: 12px;
    padding: 9px;
    gap: 6px;
  }
  .nav-item svg {
    width: 15px;
  }
  .sidebar-footer {
    margin: 0;
    padding: 0;
    border: 0;
    grid-column: 1/-1;
    flex-direction: row;
    align-items: center;
    gap: 16px;
  }
  #admin-name {
    font-size: 12px;
    margin: 0;
  }
  .sidebar-footer .text-button {
    font-size: 11px;
  }
  .main {
    padding: 24px 16px;
  }
  h1 {
    font-size: 22px;
  }
  .page-heading {
    align-items: flex-start;
    margin-bottom: 22px;
    gap: 10px;
  }
  .page-heading p {
    max-width: 220px;
    font-size: 12px;
  }
  .page-heading > .primary {
    font-size: 12px;
    padding: 0 11px;
    min-height: 35px;
  }
  .status-tabs {
    gap: 20px;
    overflow: auto;
    white-space: nowrap;
  }
  .status-tabs button {
    font-size: 12px;
  }
  .toolbar {
    gap: 8px;
    flex-wrap: wrap;
  }
  .search {
    max-width: none;
    flex: 1;
    min-width: 180px;
  }
  .toolbar .muted {
    flex-basis: 100%;
    margin-left: 0;
  }
  .editor-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
  }
  .editor-content .editor-section {
    border-top: 1px solid var(--line);
    padding-top: 22px;
  }
  .table-panel table {
    min-width: 650px;
  }
  .login-panel {
    padding: 28px;
  }
  .password-line {
    flex-wrap: wrap;
  }
  .password-line input {
    flex-basis: 100%;
  }
  dialog {
    padding: 22px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
.credential-copy {
  margin: 18px 0;
}
.credential-copy input {
  margin-top: 0;
}
