.data-panel,
.settings-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 8px 28px rgba(44, 66, 112, 0.05);
}

.data-panel {
  overflow: hidden;
}

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

.pagination-actions {
  display: flex;
  justify-content: center;
  padding: 16px;
  border-top: 1px solid var(--line);
}

.pagination-actions:has(button[hidden]) {
  display: none;
}

table {
  width: 100%;
  min-width: 790px;
  border-collapse: collapse;
}

th,
td {
  padding: 15px 17px;
  border-bottom: 1px solid #edf0f5;
  text-align: left;
  white-space: nowrap;
}

th {
  color: #738096;
  background: #fbfcfe;
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

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

tbody tr:hover {
  background: #fbfcff;
}

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

.mono {
  color: #26344e;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
}

.muted,
.empty-row td {
  color: var(--muted);
}

.empty-row td {
  padding: 44px 20px;
  text-align: center;
}

.status-pill {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  color: var(--success);
  background: #ebf8f3;
  font-size: 10px;
  font-weight: 750;
}

.status-pill.inactive {
  color: var(--muted);
  background: #f1f4f8;
}

.link-button {
  display: inline-block;
  max-width: 190px;
  margin-right: 7px;
  overflow: hidden;
  color: var(--blue);
  font-weight: 700;
  text-overflow: ellipsis;
  text-decoration: none;
  vertical-align: middle;
}

.settings-panel {
  overflow: hidden;
}

.setting-group {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(150px, 0.65fr));
  gap: 18px;
  align-items: end;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.setting-group p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.setting-group label {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.setting-group input {
  width: 100%;
  margin-top: 7px;
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  padding: 18px 22px;
}

.message-state {
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid #cedafb;
  border-radius: 11px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 12px;
}

.message-state.error {
  border-color: #efc5c5;
  color: var(--danger);
  background: #fff4f4;
}

dialog {
  width: min(440px, calc(100% - 32px));
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(34, 46, 73, 0.24);
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

#membership-form {
  display: grid;
  gap: 14px;
}

#membership-form label {
  margin: 0;
}

#membership-form input,
#membership-form select {
  width: 100%;
  margin-top: 7px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10;
  max-width: 360px;
  padding: 12px 15px;
  border: 1px solid #cedafb;
  border-radius: 11px;
  color: #273655;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 12px;
}

.account-page-card {
  width: min(560px, 100%);
}

.account-page-form {
  display: grid;
  gap: 10px;
}

.account-page-form input {
  width: 100%;
}

.account-page-hint {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 900px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .side-nav {
    position: static;
    display: flex;
    overflow-x: auto;
  }

  .nav-item {
    flex: 0 0 auto;
    padding: 0 16px;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .setting-group {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .setting-group > div {
    grid-column: 1 / -1;
  }
}

@media (max-width: 580px) {
  .shell {
    width: min(100% - 24px, 1320px);
    padding-top: 12px;
  }

  .login-card {
    padding: 30px 22px;
    border-radius: 20px;
  }

  .token-row,
  .summary-grid,
  .setting-group {
    grid-template-columns: 1fr;
  }

  .topbar,
  .page-heading,
  .panel-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .header-actions,
  .panel-tools {
    flex-wrap: wrap;
  }

  .search-field,
  .search-field input,
  .filter-field,
  .filter-field select {
    width: 100%;
  }

  #last-updated {
    padding-top: 0;
  }

  .overview-note {
    align-items: flex-start;
    flex-direction: column;
  }

  .toast {
    right: 12px;
    bottom: 12px;
    left: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
