:root {
  --bg: #f6f7fb;
  --panel: #ffffff;
  --panel-subtle: #f9fafc;
  --text: #172033;
  --muted: #667085;
  --soft: #98a2b3;
  --border: #dfe3ea;
  --border-strong: #c8d0dc;
  --brand: #2563eb;
  --brand-strong: #1d4ed8;
  --teal: #0f766e;
  --green: #15803d;
  --amber: #b45309;
  --red: #b42318;
  --sidebar: #111827;
  --sidebar-muted: #a8b3c7;
  --shadow: 0 10px 28px rgba(23, 32, 51, 0.08);
  --shadow-soft: 0 4px 14px rgba(23, 32, 51, 0.06);
  --radius: 8px;
  --topbar-height: 72px;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0f141b;
  --panel: #161d27;
  --panel-subtle: #111821;
  --text: #e5e7eb;
  --muted: #aeb8c7;
  --soft: #7d8a9d;
  --border: #2a3442;
  --border-strong: #3d4a5b;
  --brand: #60a5fa;
  --brand-strong: #93c5fd;
  --sidebar: #0a0f16;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.32);
  --shadow-soft: 0 4px 14px rgba(0, 0, 0, 0.24);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

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

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

a:hover {
  color: var(--brand-strong);
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 16px;
  z-index: 2000;
  transform: translateY(-140%);
  border-radius: var(--radius);
  background: var(--brand);
  color: #fff;
  padding: 10px 14px;
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
  color: #fff;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--sidebar);
  color: #fff;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 1000;
}

.brand-lockup {
  padding: 22px 20px;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
}

.brand-mark:hover {
  color: #fff;
}

.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  background: #2563eb;
  color: #fff;
  font-weight: 800;
}

.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: var(--radius);
  background: #fff;
}

.brand-name,
.brand-subtitle {
  display: block;
}

.brand-name {
  font-size: 17px;
  font-weight: 780;
}

.brand-subtitle {
  color: var(--sidebar-muted);
  font-size: 12px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 4px 14px 18px;
}

.nav-group {
  margin-top: 18px;
}

.nav-group-label {
  margin: 0 8px 8px;
  color: var(--sidebar-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-link-ui {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  margin: 3px 0;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: #d7deea;
  font-weight: 650;
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}

.nav-link-ui i {
  width: 18px;
  color: var(--sidebar-muted);
}

.nav-link-ui:hover,
.nav-link-ui.is-active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.nav-link-ui.is-active i {
  color: #8ec5ff;
}

.sidebar-footer {
  padding: 16px 18px 20px;
}

.mini-status {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  padding: 11px 12px;
  color: #d7deea;
  font-size: 13px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.16);
}

.main-panel {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: var(--topbar-height);
  padding: 0 28px;
  background: rgba(246, 247, 251, 0.88);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

[data-theme="dark"] .topbar {
  background: rgba(15, 20, 27, 0.88);
}

.icon-button.sidebar-toggle {
  display: none;
}

.breadcrumbs {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
}

.breadcrumbs a {
  color: var(--muted);
}

.breadcrumbs span:last-child {
  color: var(--text);
  font-weight: 700;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  transition: border 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.icon-button:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-soft);
}

.icon-button:focus-visible,
.button-primary:focus-visible,
.button-secondary:focus-visible,
.danger-button:focus-visible,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  outline: 3px solid rgba(37, 99, 235, 0.24);
  outline-offset: 2px;
  box-shadow: none;
}

.account-menu {
  position: relative;
}

.account-menu summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 4px 8px 4px 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  cursor: pointer;
  list-style: none;
}

.account-menu summary::-webkit-details-marker {
  display: none;
}

.avatar {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: #e0f2fe;
  color: #075985;
  font-size: 12px;
  font-weight: 800;
}

.account-copy {
  display: grid;
  line-height: 1.15;
}

.account-name {
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
}

.account-role {
  color: var(--muted);
  font-size: 11px;
}

.account-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 230px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 8px;
  z-index: 1200;
}

.account-popover-header {
  display: grid;
  gap: 2px;
  padding: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}

.account-popover-header span {
  color: var(--muted);
  font-size: 12px;
}

.account-popover a,
.account-popover button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  padding: 9px 10px;
  text-align: left;
}

.account-popover a:hover,
.account-popover button:hover {
  background: var(--panel-subtle);
}

.content-shell {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 28px;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.page-kicker {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-title {
  margin: 0;
  color: var(--text);
  font-size: 28px;
  font-weight: 820;
}

.page-subtitle {
  max-width: 780px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.button-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.button-primary,
.button-secondary,
.danger-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border-radius: var(--radius);
  padding: 9px 14px;
  border: 1px solid transparent;
  font-weight: 750;
  transition: background 140ms ease, border 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.button-primary {
  background: var(--brand);
  color: #fff;
}

.button-primary:hover {
  background: var(--brand-strong);
  color: #fff;
  box-shadow: var(--shadow-soft);
}

.button-secondary {
  border-color: var(--border);
  background: var(--panel);
  color: var(--text);
}

.button-secondary:hover {
  border-color: var(--border-strong);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.ghost-button {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.ghost-button:hover {
  background: var(--panel-subtle);
  color: var(--text);
}

.danger-button {
  background: var(--red);
  color: #fff;
}

.danger-button:hover {
  background: #8f1b13;
  color: #fff;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.stat-card,
.panel,
.table-shell,
.form-panel,
.empty-state,
.auth-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.stat-card {
  display: grid;
  gap: 14px;
  min-height: 138px;
  padding: 18px;
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stat-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: #eef4ff;
  color: var(--brand);
}

.stat-label {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.stat-value {
  margin: 0;
  color: var(--text);
  font-size: 30px;
  font-weight: 840;
}

.stat-value-small {
  font-size: 20px;
  line-height: 1.25;
}

.stat-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
  gap: 18px;
  margin-top: 18px;
}

.panel {
  padding: 18px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
}

.panel-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.upgrade-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  border: 1px solid #fcd34d;
  border-radius: var(--radius);
  background: #fffbeb;
  color: #92400e;
  padding: 16px;
}

.upgrade-banner p {
  margin: 4px 0 0;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.pricing-card {
  display: grid;
  gap: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  padding: 22px;
}

.pricing-card.is-current {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.pricing-card h2 {
  margin: 0;
  font-size: 36px;
  font-weight: 850;
}

.pricing-card h2 span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.pricing-card p {
  color: var(--muted);
}

.pricing-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

.quick-action {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
}

.quick-action:hover {
  border-color: var(--brand);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.quick-action i {
  color: var(--brand);
}

.quick-action strong,
.quick-action span {
  display: block;
}

.quick-action span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.activity-list,
.health-list,
.tenant-rank-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.activity-item,
.health-item,
.tenant-rank {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-subtle);
}

.activity-main,
.tenant-rank-main {
  min-width: 0;
}

.activity-type,
.tenant-rank-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.activity-label,
.tenant-rank-name {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-weight: 780;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-meta {
  color: var(--muted);
  font-size: 13px;
}

.health-left {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  min-width: 0;
}

.health-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 50%;
}

.health-ok .health-icon,
.dns-ok .dns-status-icon {
  background: #dcfce7;
  color: var(--green);
}

.health-warning .health-icon,
.dns-warning .dns-status-icon {
  background: #fef3c7;
  color: var(--amber);
}

.health-error .health-icon,
.dns-error .dns-status-icon {
  background: #fee4e2;
  color: var(--red);
}

.health-label {
  margin: 0;
  font-weight: 800;
}

.health-summary,
.health-detail {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.table-shell {
  overflow: hidden;
}

.table-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(4, minmax(140px, auto));
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

.table-toolbar .form-control,
.table-toolbar .form-select {
  min-height: 40px;
}

.search-field {
  position: relative;
}

.search-field i {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--soft);
}

.search-field input {
  padding-left: 38px;
}

.bulk-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: #eef4ff;
}

.bulk-bar.is-visible {
  display: flex;
}

.bulk-summary {
  color: #1d4ed8;
  font-weight: 750;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table th {
  background: var(--panel-subtle);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table tbody tr:hover {
  background: var(--panel-subtle);
}

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

.sortable {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: inherit;
}

.sortable.is-active {
  color: var(--brand);
}

.entity-cell {
  display: grid;
  min-width: 0;
}

.entity-title {
  color: var(--text);
  font-weight: 800;
}

.entity-meta {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
}

.status-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.status-active {
  background: #dcfce7;
  color: #166534;
}

.status-active::before {
  background: #16a34a;
}

.status-disabled {
  background: #f2f4f7;
  color: #475467;
}

.status-disabled::before {
  background: #98a2b3;
}

.dns-status-verified {
  background: #dcfce7;
  color: #166534;
}

.dns-status-verified::before {
  background: #16a34a;
}

.dns-status-partial {
  background: #fef3c7;
  color: #92400e;
}

.dns-status-partial::before {
  background: #d97706;
}

.dns-status-pending {
  background: #eef2ff;
  color: #3730a3;
}

.dns-status-pending::before {
  background: #6366f1;
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}

.action-button {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--muted);
}

.action-button:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.action-button.is-danger:hover {
  border-color: var(--red);
  color: var(--red);
}

.code-value {
  display: inline-flex;
  max-width: 360px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-subtle);
  color: var(--text);
  padding: 4px 7px;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}

.pagination-ui {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pagination-ui a,
.pagination-ui span {
  min-width: 34px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  padding: 6px 10px;
}

.pagination-ui .is-active span {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.pagination-ui .is-disabled span {
  color: var(--soft);
}

.form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  align-items: start;
}

.form-panel {
  padding: 22px;
}

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

.form-field.field-notes,
.form-field.field-domain,
.form-field.field-local_part,
.form-field.field-password {
  grid-column: 1 / -1;
}

.form-label {
  color: var(--text);
  font-weight: 760;
}

.required-mark {
  color: var(--red);
}

.help-text {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.invalid-feedback {
  display: block;
}

.form-check-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-subtle);
}

.form-check-card .help-text {
  display: block;
  margin-top: 3px;
}

.password-control {
  position: relative;
}

.password-control .form-control {
  padding-right: 46px;
}

.password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  width: 34px;
  height: 34px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}

.password-toggle:hover {
  background: var(--panel-subtle);
  color: var(--text);
}

.password-meter {
  height: 6px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--border);
}

.password-meter span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--red);
  transition: width 160ms ease, background 160ms ease;
}

.password-meter[data-strength="medium"] span {
  width: 66%;
  background: var(--amber);
}

.password-meter[data-strength="strong"] span {
  width: 100%;
  background: var(--green);
}

.password-meter[data-strength="weak"] span {
  width: 33%;
}

.validation-summary {
  margin-bottom: 18px;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  background: #fff1f2;
  color: var(--red);
  padding: 14px 16px;
}

.validation-summary strong {
  display: block;
  margin-bottom: 6px;
}

.domain-warning {
  margin-bottom: 18px;
  border: 1px solid #fcd34d;
  border-radius: var(--radius);
  background: #fffbeb;
  color: #92400e;
  padding: 14px 16px;
}

.domain-warning[hidden] {
  display: none;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.side-guidance {
  display: grid;
  gap: 12px;
}

.guidance-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 15px;
}

.guidance-item i {
  color: var(--teal);
}

.guidance-item strong {
  display: block;
  margin-top: 8px;
}

.guidance-item p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.dns-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.dns-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 16px;
  box-shadow: var(--shadow-soft);
}

.dns-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.dns-status-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.dns-records {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.dns-record {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-subtle);
  padding: 9px 10px;
}

.dns-record code {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  white-space: normal;
}

.dns-value {
  display: block;
  max-width: 560px;
  overflow-wrap: anywhere;
  white-space: normal;
}

.dns-expectation {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.dns-expectation code {
  display: block;
  margin-top: 3px;
  color: var(--text);
  overflow-wrap: anywhere;
  white-space: normal;
}

.copy-button {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--muted);
  padding: 6px 8px;
}

.copy-button:hover {
  color: var(--brand);
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 260px;
  padding: 28px;
  text-align: center;
}

.empty-state i {
  color: var(--brand);
  font-size: 36px;
}

.empty-state h2,
.empty-state h3 {
  margin: 14px 0 6px;
  font-size: 20px;
}

.empty-state p {
  max-width: 520px;
  margin: 0 auto 16px;
  color: var(--muted);
}

.confirm-panel {
  max-width: 720px;
  margin: 0 auto;
}

.danger-callout {
  display: flex;
  gap: 14px;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  background: #fff1f2;
  color: #7f1d1d;
  padding: 16px;
}

.danger-callout i {
  font-size: 24px;
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px;
  background: var(--bg);
}

.auth-card {
  width: min(100%, 440px);
  padding: 28px;
}

.auth-card .empty-state {
  min-height: auto;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.auth-card input[type="text"],
.auth-card input[type="password"],
.auth-card input[type="email"] {
  display: block;
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  padding: 9px 12px;
}

.auth-card input[type="text"]:focus,
.auth-card input[type="password"]:focus,
.auth-card input[type="email"]:focus {
  border-color: var(--brand);
  outline: 3px solid rgba(37, 99, 235, 0.24);
  outline-offset: 2px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.auth-title {
  margin: 0;
  font-size: 25px;
  font-weight: 840;
}

.auth-subtitle {
  margin: 7px 0 22px;
  color: var(--muted);
  line-height: 1.5;
}

.auth-footer {
  margin-top: 18px;
  text-align: center;
}

.toast-stack {
  position: fixed;
  right: 20px;
  top: 88px;
  z-index: 1800;
  display: grid;
  gap: 10px;
  width: min(420px, calc(100vw - 32px));
}

.app-toast {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 12px;
}

.toast-success {
  border-left-color: var(--green);
}

.toast-error {
  border-left-color: var(--red);
}

.toast-warning {
  border-left-color: var(--amber);
}

.toast-icon {
  color: var(--brand);
}

.toast-success .toast-icon {
  color: var(--green);
}

.toast-error .toast-icon {
  color: var(--red);
}

.toast-warning .toast-icon {
  color: var(--amber);
}

.toast-body {
  display: grid;
  gap: 2px;
  line-height: 1.35;
}

.toast-body span {
  color: var(--muted);
}

.toast-close {
  border: 0;
  background: transparent;
  color: var(--muted);
}

.is-loading .data-table tbody {
  opacity: 0.45;
}

.is-submitting {
  pointer-events: none;
  opacity: 0.72;
}

.sidebar-backdrop {
  display: none;
}

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

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

  .quick-action-grid,
  .dns-grid,
  .pricing-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .icon-button.sidebar-toggle {
    display: inline-flex;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 950;
    background: rgba(15, 23, 42, 0.38);
  }

  body.sidebar-open .sidebar-backdrop {
    display: block;
  }

  .topbar {
    padding: 0 16px;
  }

  .content-shell {
    padding: 22px 16px;
  }

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

@media (max-width: 720px) {
  .page-heading,
  .table-footer,
  .bulk-bar,
  .upgrade-banner,
  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .page-title {
    font-size: 24px;
  }

  .metric-grid,
  .form-grid,
  .table-toolbar {
    grid-template-columns: 1fr;
  }

  .button-row,
  .form-actions {
    width: 100%;
  }

  .button-primary,
  .button-secondary,
  .danger-button,
  .ghost-button {
    width: 100%;
  }

  .account-copy,
  .breadcrumbs span:not(:last-child),
  .breadcrumbs a {
    display: none;
  }

  .data-table th,
  .data-table td {
    padding: 12px;
  }
}
