:root {
  --bg: #eef5ff;
  --bg-soft: #f7fbff;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --border: #dce7f7;
  --border-strong: #c8d8ef;
  --text: #071642;
  --muted: #64759d;
  --muted-strong: #40527b;
  --primary: #0b63f6;
  --primary-strong: #0838a8;
  --primary-dark: #051c77;
  --accent: #673ef4;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #2284ff;
  --shadow: 0 20px 60px rgba(7, 22, 66, 0.13);
  --shadow-soft: 0 10px 32px rgba(7, 22, 66, 0.08);
  --radius: 8px;
  --sidebar: linear-gradient(160deg, #0a49d7 0%, #041667 78%);
  --sidebar-width: 292px;
  --font: Inter, "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html,
body {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background: var(--bg-soft) !important;
  background-image: none !important;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font);
  background: var(--bg-soft) !important;
  background-image: none !important;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.portal-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  align-items: stretch;
  width: 100vw !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

body > .portal-shell {
  max-width: none !important;
  margin: 0 !important;
}

.portal-sidebar {
  position: relative;
  z-index: 40;
  width: var(--sidebar-width);
  min-height: 100vh;
  height: auto;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  overflow: visible;
  color: #fff;
  background: var(--sidebar);
  border-radius: 0;
  box-shadow: none;
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.45rem;
  min-width: 0;
}

.portal-brand > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 28px 18px 18px 28px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #fff;
  color: var(--primary);
  font-weight: 900;
  box-shadow: inset 0 -5px 0 rgba(11, 99, 246, 0.12);
}

.brand-logo {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
}

.sidebar-user {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 18px 28px 22px;
}

.avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(145deg, #9ec8ff, #0b63f6);
  border: 2px solid rgba(255,255,255,0.72);
  font-weight: 800;
}

.sidebar-user-name,
.sidebar-user-role {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-kicker {
  font-size: 0.72rem;
  color: #c7dcff;
}

.sidebar-user-name {
  font-size: 0.95rem;
  font-weight: 800;
}

.sidebar-user-role {
  margin-top: 2px;
  font-size: 0.75rem;
  color: #e6f0ff;
}

.portal-nav {
  flex: 1;
  min-height: 0;
  overflow: visible;
  padding: 8px 18px 18px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.48) transparent;
}

.nav-group {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
}

.nav-group-label {
  padding: 8px 12px 4px;
  color: #b9d4ff;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.portal-nav::-webkit-scrollbar {
  width: 8px;
}

.portal-nav::-webkit-scrollbar-track {
  background: transparent;
}

.portal-nav::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255,255,255,0.44);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  margin-bottom: 4px;
  padding: 10px 14px;
  border-radius: 8px;
  color: #eff6ff;
  font-size: 0.9rem;
  font-weight: 700;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}

.nav-link:hover,
.nav-link.is-active {
  background: rgba(38, 121, 255, 0.96);
  transform: translateX(2px);
}

.nav-icon {
  width: 22px;
  min-width: 22px;
  flex: 0 0 22px;
  display: inline-grid;
  place-items: center;
  text-align: center;
  font-size: 1rem;
  line-height: 1;
}

.sidebar-help {
  margin: 18px;
  padding: 13px 16px;
  border-radius: 8px;
  color: #eff6ff;
  background: rgba(255, 255, 255, 0.15);
  font-weight: 700;
}

.portal-main {
  grid-column: 2;
  min-width: 0;
  min-height: 100vh;
  width: 100%;
  max-width: none !important;
  background: var(--bg-soft);
  border: 0;
  border-left: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}

.portal-main,
.portal-content {
  background-image: none !important;
}

.portal-topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  min-height: 80px;
  display: grid;
  grid-template-columns: minmax(300px, 560px) minmax(220px, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 16px 30px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 8px 22px rgba(7, 22, 66, 0.035);
  backdrop-filter: none;
}

.portal-search {
  position: relative;
  z-index: 35;
}

.portal-search input {
  width: 100%;
  height: 44px;
  padding: 0 16px 0 42px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  outline: 0;
}

.quick-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  display: grid;
  gap: 4px;
  max-height: min(420px, calc(100vh - 120px));
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(7, 22, 66, 0.16);
}

.quick-search-results[hidden] {
  display: none;
}

.quick-search-item {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 8px;
}

.quick-search-item:hover,
.quick-search-item:focus {
  background: #eef5ff;
}

.quick-search-item strong {
  font-size: 0.9rem;
  font-weight: 850;
}

.quick-search-item span,
.quick-search-empty {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.quick-search-empty {
  padding: 12px;
}

.confirm-modal[hidden] {
  display: none;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
}

.confirm-modal__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(8, 20, 38, 0.48);
}

.confirm-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 440px);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
  box-shadow: 0 24px 70px rgba(7, 22, 66, 0.28);
}

.confirm-modal__icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #eef5ff;
  color: var(--primary-strong);
  font-weight: 900;
}

.confirm-modal.is-danger .confirm-modal__icon {
  background: #ffe8ec;
  color: #be123c;
}

.confirm-modal__copy {
  min-width: 0;
}

.confirm-modal__copy h2 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
}

.confirm-modal__copy p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.confirm-modal__actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.confirm-modal.is-danger [data-confirm-accept] {
  background: #be123c;
}

.bulk-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fbff;
}

.bulk-toolbar strong {
  margin-right: auto;
  font-size: 0.88rem;
}

.bulk-toolbar select {
  width: auto;
  min-width: 190px;
  padding: 9px 11px;
}

.select-column {
  width: 42px;
  text-align: center;
}

.select-column input[type='checkbox'] {
  width: 16px;
  height: 16px;
}

.dns-record-form {
  display: grid;
  grid-template-columns: minmax(90px, 0.7fr) minmax(120px, 1fr) minmax(220px, 2fr) minmax(120px, 1fr) minmax(110px, 0.8fr) max-content;
  gap: 12px;
  align-items: stretch;
}

.dns-record-form > * {
  min-width: 0;
}

.dns-record-form button {
  white-space: normal;
  min-width: 132px;
}

@media (max-width: 1180px) {
  .dns-record-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dns-record-value {
    grid-column: span 2;
  }
}

@media (max-width: 720px) {
  .dns-record-form {
    grid-template-columns: 1fr;
  }

  .dns-record-value {
    grid-column: auto;
  }
}

.row-edit {
  position: relative;
}

.row-edit > summary {
  list-style: none;
  cursor: pointer;
}

.row-edit > summary::-webkit-details-marker {
  display: none;
}

.row-edit-panel {
  position: static;
  width: min(520px, calc(100vw - 40px));
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 20px 50px rgba(7, 22, 66, 0.18);
}

.row-edit-panel label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.row-edit-panel label span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.row-edit-panel input,
.row-edit-panel select {
  width: 100%;
  padding: 9px 10px;
}

.row-edit-wide {
  grid-column: 1 / -1;
}

.row-edit-check {
  display: flex !important;
  align-items: center;
  grid-template-columns: auto 1fr !important;
}

.row-edit-check input {
  width: 16px;
  height: 16px;
}

.row-edit-panel button {
  justify-self: end;
}

.portal-search > span {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary-strong);
}

.topbar-title {
  min-width: 0;
  align-self: center;
}

.topbar-title p,
.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.topbar-title h1,
.page-title {
  margin: 0;
  color: var(--text);
  font-size: 1.45rem;
  line-height: 1.2;
  font-weight: 850;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.mobile-menu-button,
.mobile-menu-close,
.mobile-nav-backdrop {
  display: none !important;
}

.icon-button {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--primary-strong);
  background: #f2f7ff;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.icon-button:hover,
.topbar-avatar:hover {
  border-color: #b8d2ff;
  background: #e8f1ff;
  transform: translateY(-1px);
}

.topbar-icon {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar-icon path {
  fill: none;
  stroke: currentColor;
}

.topbar-avatar {
  width: 42px;
  height: 42px;
  text-decoration: none;
  border-color: rgba(255,255,255,0.72);
  transition: border-color .16s ease, transform .16s ease;
}

.notification-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--primary);
  font-size: 0.65rem;
  font-weight: 800;
}

.portal-content {
  padding: 26px 30px 32px;
  min-height: calc(100vh - 80px);
}

.portal-content > .stack,
.portal-content > section,
.portal-content > .page-heading,
.portal-content > .data-card,
.portal-content > .grid,
.portal-content > .panel-grid,
.portal-content > .two-grid,
.portal-content > .three-grid,
.portal-content > .stats-grid {
  max-width: 1680px;
  margin-left: auto;
  margin-right: auto;
}

.page-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.page-heading h2,
.section-title {
  margin: 0;
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1.25;
  font-weight: 850;
}

.page-heading p,
.section-subtitle {
  margin: 5px 0 0;
  color: var(--muted-strong);
  font-size: 0.9rem;
}

.period-select,
.theme-select {
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--text);
  background: #fff;
  font-weight: 750;
}

.stack {
  display: grid;
  gap: 18px;
}

.grid {
  display: grid;
  gap: 16px;
}

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

.stats-grid.six {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.stats-grid.five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 18px;
}

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

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

.card,
.metric-card,
.tool-card,
.data-card {
  background: rgba(255,255,255,0.94);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.card,
.data-card {
  padding: 18px;
}

.data-card > :first-child {
  margin-top: 0;
}

.data-card > :last-child {
  margin-bottom: 0;
}

.code-block {
  max-width: 100%;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: #f4f8ff;
  font: 0.82rem/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.upload-progress {
  width: min(220px, 100%);
  height: 12px;
  accent-color: var(--primary);
}

.upload-progress-label {
  min-width: 58px;
  color: var(--muted-strong);
  font-size: 0.82rem;
  font-weight: 800;
}

.metric-card {
  min-height: 112px;
  padding: 18px;
}

.metric-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.metric-label {
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 850;
}

.metric-value {
  margin-top: 10px;
  color: var(--text);
  font-size: 1.55rem;
  line-height: 1.1;
  font-weight: 900;
}

.metric-note {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.metric-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--primary);
  background: #eaf3ff;
  font-weight: 900;
}

.progress {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef8;
}

.progress > span,
.progress-bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #4b8dff);
}

.progress.is-accent > span,
.progress-bar.accent {
  background: linear-gradient(90deg, var(--accent), #8b6bff);
}

.progress.is-success > span,
.progress-bar.success {
  background: linear-gradient(90deg, var(--success), #72e6b4);
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #eef3fb;
}

.section-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 900;
}

.muted-link {
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 850;
}

.usage-chart {
  min-height: 210px;
  display: grid;
  align-items: end;
  padding: 18px 8px 8px;
  border-radius: 8px;
  background:
    linear-gradient(#e8eef8 1px, transparent 1px) 0 0 / 100% 25%,
    linear-gradient(180deg, rgba(255,255,255,0), rgba(16,185,129,0.12));
}

.sparkline {
  height: 130px;
  width: 100%;
}

.bar-list {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 1.1fr) 42px;
  gap: 12px;
  align-items: center;
  font-size: 0.82rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.tool-card {
  min-height: 86px;
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 14px 10px;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 850;
  text-align: center;
}

.tool-card:hover {
  border-color: #a9c8ff;
  box-shadow: 0 14px 34px rgba(11, 99, 246, 0.12);
}

.tool-icon {
  color: var(--primary);
  font-size: 1.85rem;
  line-height: 1;
}

.info-list,
.activity-list {
  display: grid;
  gap: 0;
}

.info-row,
.activity-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid #eef3fb;
  font-size: 0.84rem;
}

.info-row:last-child,
.activity-row:last-child {
  border-bottom: 0;
}

.info-row span:first-child,
.activity-meta {
  color: var(--muted);
}

.info-row strong {
  color: var(--primary-strong);
  font-weight: 850;
  text-align: right;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--primary-strong);
  background: #eaf3ff;
  font-size: 0.74rem;
  font-weight: 850;
}

.badge.success {
  color: #047857;
  background: #dcfce7;
}

.badge.warning {
  color: #a16207;
  background: #fef3c7;
}

.badge.danger {
  color: #be123c;
  background: #ffe4e6;
}

.status-dot {
  width: 9px;
  height: 9px;
  display: inline-block;
  border-radius: 999px;
  background: var(--success);
}

.status-dot.warning {
  background: var(--warning);
}

.status-dot.danger {
  background: var(--danger);
}

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

.table-wrap,
.responsive-table {
  border-radius: 8px;
}

.table-filter {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fbff;
}

.table-filter span {
  color: var(--primary-strong);
  font-weight: 900;
}

.table-filter input {
  min-height: 36px;
  border: 0;
  background: transparent;
}

.table-filter input:focus {
  box-shadow: none;
}

.table-filter strong {
  min-width: 34px;
  min-height: 24px;
  display: grid;
  place-items: center;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--primary-strong);
  background: #eaf3ff;
  font-size: 0.78rem;
}

.theme-table,
table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text);
  font-size: 0.86rem;
}

th {
  color: var(--muted);
  font-weight: 850;
  text-align: left;
  background: #f8fbff;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid #edf2fa;
}

tbody tr:hover {
  background: #f8fbff;
}

tr[hidden] {
  display: none !important;
}

.btn,
button,
.button {
  border: 0;
  cursor: pointer;
}

.btn,
a.btn,
button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #0750d4);
  font-weight: 850;
}

.btn.secondary {
  color: var(--primary-strong);
  background: #eef5ff;
}

.btn.ghost {
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
}

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

.field label,
label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted-strong);
  font-size: 0.84rem;
  font-weight: 750;
}

.field-hint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.field-hint.is-bad {
  color: #be123c;
}

.logo-upload-field input[type='file'] {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px;
}

.logo-upload-field input[type='file']::file-selector-button {
  height: 28px;
  margin: 0 10px 0 0;
  border: 0;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

.brand-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fbff;
}

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

.brand-preview .brand-logo {
  background: #fff;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-strong);
  font-size: 0.86rem;
  font-weight: 700;
}

.checkbox-line input {
  width: auto;
}

input,
select,
textarea {
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  outline: 0;
}

select {
  cursor: pointer;
}

input::placeholder,
textarea::placeholder {
  color: #8aa0c5;
}

input,
select {
  min-height: 40px;
  padding: 0 12px;
}

textarea {
  padding: 12px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #7dafff;
  box-shadow: 0 0 0 3px rgba(11, 99, 246, 0.12);
}

.prefixed-input {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: stretch;
}

.prefixed-input span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-right: 0;
  border-radius: 8px 0 0 8px;
  color: var(--muted-strong);
  background: #eaf3ff;
  font-weight: 850;
}

.prefixed-input input {
  border-radius: 0 8px 8px 0;
}

.backup-create-card {
  max-width: 860px;
}

.backup-target-field {
  position: relative;
}

.backup-target-results {
  position: absolute;
  z-index: 30;
  right: 0;
  left: 0;
  max-height: 300px;
  margin-top: 6px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.14);
}

.backup-target-option {
  width: 100%;
  display: grid;
  gap: 3px;
  padding: 11px 12px;
  border: 0;
  border-bottom: 1px solid #eef3fb;
  color: var(--text);
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.backup-target-option:last-child {
  border-bottom: 0;
}

.backup-target-option:hover,
.backup-target-option:focus {
  background: #f4f8ff;
}

.backup-target-option strong {
  font-size: 0.88rem;
  font-weight: 850;
}

.backup-target-option span,
.backup-target-empty {
  color: var(--muted);
  font-size: 0.78rem;
}

.backup-target-empty {
  padding: 12px;
}

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

.permission-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.permission-option span,
.permission-option small {
  display: block;
  margin: 0;
}

.permission-option small {
  color: var(--muted);
  font-size: 0.76rem;
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 9px 14px;
  border-radius: 8px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  transition: background .16s ease, border-color .16s ease, color .16s ease, opacity .16s ease, transform .16s ease;
}

.btn-primary {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 10px 22px rgba(11, 99, 246, 0.18);
}

.btn-primary:hover,
.btn-secondary:hover,
.btn:hover {
  transform: translateY(-1px);
}

button.is-loading,
.btn-primary.is-loading,
.btn-secondary.is-loading {
  cursor: wait;
  opacity: 0.7;
}

.btn-secondary {
  color: var(--primary-dark);
  background: #eef5ff;
  border: 1px solid #cfe0ff;
}

.btn-secondary.danger {
  color: #be123c;
  background: #fff1f2;
  border-color: #fecdd3;
}

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

.empty-state {
  padding: 18px;
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  color: var(--muted-strong);
  background: #f8fbff;
  text-align: center;
  font-weight: 750;
}

.help-box {
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid #cfe0ff;
  border-radius: 8px;
  color: var(--primary-dark);
  background: #eef5ff;
  font-size: 0.88rem;
  font-weight: 700;
}

.impersonation-banner {
  max-width: 1680px;
  margin: 0 auto 16px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  color: #92400e;
  background: #fffbeb;
  font-weight: 850;
}

.impersonation-banner button {
  color: #92400e;
  background: transparent;
  font-weight: 900;
}

.repair-card {
  min-height: 150px;
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.repair-card span {
  color: var(--muted);
  font-size: 0.82rem;
}

.notification-row,
.job-row {
  display: grid;
  grid-template-columns: auto minmax(0, .8fr) minmax(0, 1.2fr);
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid #eef3fb;
}

.notification-row:last-child,
.job-row:last-child {
  border-bottom: 0;
}

.queue-error {
  max-width: 420px;
  color: var(--muted-strong);
  font-size: 0.78rem;
  white-space: pre-wrap;
}

.log-source {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.log-source + .log-source {
  padding-top: 14px;
  border-top: 1px solid #eef3fb;
}

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

.permission-group {
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fbff;
}

.permission-group legend {
  padding: 0 6px;
  color: var(--muted-strong);
  font-size: 0.84rem;
  font-weight: 850;
}

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

.routing-choice {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fbff;
  cursor: pointer;
}

.routing-choice input {
  width: auto;
}

.routing-choice span {
  color: var(--text);
  font-weight: 850;
}

.routing-choice small {
  color: var(--muted);
  font-size: 0.8rem;
}

.mailbox-edit-form {
  display: contents;
}

.mailbox-edit-form input,
.mailbox-edit-form select,
.data-table input[form^="mailbox-form-"],
.data-table select[form^="mailbox-form-"] {
  min-height: 34px;
  padding: 7px 9px;
  font-size: 0.82rem;
}

.mailbox-edit-form input[type="number"],
.data-table input[type="number"][form^="mailbox-form-"] {
  width: 96px;
}

.mailbox-inline-check {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  color: var(--muted-strong);
  font-size: 0.82rem;
  font-weight: 750;
}

.mailbox-inline-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.php-extension-table th,
.php-extension-table td {
  min-width: 160px;
  vertical-align: top;
}

.php-extension-cell {
  display: grid;
  gap: 8px;
  align-items: start;
}

.wordpress-manager-row {
  align-items: flex-start;
}

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

.wizard-steps span {
  min-height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted-strong);
  background: #f8fbff;
  font-size: 0.82rem;
  font-weight: 850;
}

.wizard-steps span.is-active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.migration-page {
  max-width: 100%;
}

.migration-assistant {
  display: grid;
  gap: 14px;
}

.migration-steps span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  text-align: center;
}

.migration-steps strong {
  width: 22px;
  height: 22px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  background: rgba(7, 22, 66, 0.08);
  font-size: 0.78rem;
}

.migration-steps .is-active strong {
  color: var(--primary);
  background: #fff;
}

.migration-upload {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(260px, 1.2fr) auto;
  gap: 18px;
  align-items: end;
}

.migration-upload-copy {
  display: grid;
  gap: 5px;
}

.migration-upload-copy h3,
.migration-upload-copy p {
  margin: 0;
}

.migration-upload-copy p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.migration-file-picker {
  display: grid;
  gap: 7px;
}

.migration-file-picker span {
  color: var(--muted-strong);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.migration-file-picker input[type='file'] {
  width: 100%;
  min-height: 42px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.migration-upload-actions {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(48px, auto);
  gap: 8px 10px;
  align-items: center;
  justify-content: end;
}

.migration-upload-actions button {
  grid-column: 1 / -1;
  justify-self: end;
}

.data-card.is-flat {
  box-shadow: none;
  background: #f8fbff;
}

.quota-preview,
.summary-list {
  display: grid;
  gap: 10px;
}

.quota-preview div,
.summary-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #e8eef8;
}

.quota-preview div:last-child,
.summary-list div:last-child {
  border-bottom: 0;
}

.quota-preview span,
.summary-list span {
  color: var(--muted);
  font-weight: 750;
}

.muted-line.is-good {
  color: #047857;
}

.muted-line.is-bad {
  color: #be123c;
}

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

.nameserver-copy,
.onboarding-step {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

.nameserver-copy span,
.onboarding-step p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.onboarding-step.is-complete {
  border-color: #bbf7d0;
  background: #ecfdf5;
}

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

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.data-table th {
  padding: 12px 14px;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.data-table td {
  padding: 14px;
  border-top: 1px solid var(--border);
  vertical-align: top;
}

.muted-line {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill-list span {
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--primary-dark);
  background: #eef5ff;
  font-size: 0.76rem;
  font-weight: 800;
}

.empty-cell {
  color: var(--muted);
  text-align: center;
}

.back-link {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
}

.metric-value.is-small {
  margin-top: 8px;
  font-size: 1.05rem;
}

.metric-value.is-path {
  margin-top: 8px;
  font-size: 0.86rem;
  line-height: 1.35;
  word-break: break-all;
}

.compact-heading {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 850;
}

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

.package-limits div {
  padding: 11px 12px;
  border-radius: 8px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.package-limits dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.package-limits dd {
  margin: 4px 0 0;
  font-weight: 850;
}

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

.package-limit-control {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.package-limit-control span {
  font-size: 0.82rem;
  font-weight: 800;
}

.package-limit-control input[type="number"] {
  width: 100%;
}

.package-limit-control small {
  color: var(--muted);
  font-size: 0.76rem;
}

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

.domain-action-card,
.domain-type-button {
  display: grid;
  gap: 6px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  text-decoration: none;
}

.domain-action-card strong {
  color: var(--text);
  font-size: 0.98rem;
}

.domain-action-card span {
  color: var(--muted);
  font-size: 0.82rem;
}

.domain-action-card:hover,
.domain-type-button:hover,
.domain-type-button.is-active {
  border-color: var(--primary);
  background: #eef5ff;
  color: var(--primary-dark);
}

.domain-type-button {
  font-size: 0.88rem;
  font-weight: 850;
}

.btn-primary:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.flash {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  font-weight: 750;
}

.flash.success {
  border-color: #bbf7d0;
  color: #047857;
  background: #ecfdf5;
}

.flash.error {
  border-color: #fecdd3;
  color: #be123c;
  background: #fff1f2;
}

.first-run-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  width: 100vw;
  height: 100vh;
  padding: 24px;
  overflow: hidden;
}

.first-run-overlay[hidden] {
  display: none;
}

body.first-run-open {
  overflow: hidden;
}

.first-run-backdrop {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  cursor: default;
  background: rgba(7, 22, 66, 0.58);
  backdrop-filter: blur(5px);
}

.first-run-panel {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: calc(100vh - 48px);
  display: grid;
  gap: 20px;
  margin: auto;
  padding: 26px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 28px 90px rgba(7, 22, 66, 0.28);
}

.first-run-panel:focus {
  outline: none;
}

.first-run-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  padding-bottom: 16px;
  border-bottom: 1px solid #e6eefb;
}

.first-run-head h2,
.first-run-step h3 {
  margin: 8px 0 6px;
  color: var(--text);
  line-height: 1.16;
}

.first-run-head h2 {
  font-size: 1.55rem;
  letter-spacing: 0;
}

.first-run-step h3 {
  font-size: 1.08rem;
}

.first-run-head p,
.first-run-step p,
.first-run-count {
  color: var(--muted);
}

.first-run-head p,
.first-run-step p {
  max-width: 58ch;
  margin: 0;
  line-height: 1.55;
}

.first-run-progress {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.first-run-progress button {
  width: 100%;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #d7e4f7;
}

.first-run-progress button.is-active {
  background: var(--primary);
}

.first-run-step {
  display: grid;
  gap: 12px;
  min-height: 172px;
  align-content: start;
  padding: 18px;
  border: 1px solid #e1ebf8;
  border-radius: 8px;
  background: #fff;
}

.first-run-step[hidden] {
  display: none;
}

.first-run-count {
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0;
}

.first-run-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
  padding-top: 4px;
}

.first-run-actions form {
  margin: 0;
}

.nav-link.is-tour-highlight {
  outline: 3px solid rgba(99, 179, 237, 0.58);
  outline-offset: 2px;
  background: rgba(255, 255, 255, 0.12);
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 34px;
}

.login-card {
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: 1fr 0.9fr;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.login-hero {
  padding: 52px;
  color: #fff;
  background: var(--sidebar);
}

.login-form {
  padding: 52px;
}

/* Compatibility utilities for legacy views while markup migrates to theme components. */
.min-h-screen { min-height: 100vh; }
.lg\:flex { display: flex; }
.flex { display: flex; }
.block { display: block; }
.hidden { display: none; }
.grid { display: grid; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1 1 0%; }
.w-full { width: 100%; }
.w-fit { width: fit-content; }
.max-w-4xl { max-width: 56rem; }
.max-w-6xl { max-width: 72rem; }
.max-w-lg { max-width: 32rem; }
.max-w-3xl { max-width: 48rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mt-1 { margin-top: .25rem; }
.mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: .75rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-1 { margin-bottom: .25rem; }
.mb-2 { margin-bottom: .5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.p-12 { padding: 3rem; }
.px-3 { padding-left: .75rem; padding-right: .75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-1 { padding-top: .25rem; padding-bottom: .25rem; }
.py-2 { padding-top: .5rem; padding-bottom: .5rem; }
.py-3 { padding-top: .75rem; padding-bottom: .75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.pb-6 { padding-bottom: 1.5rem; }
.pt-2 { padding-top: .5rem; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.gap-6 { gap: 1.5rem; }
.space-y-1 > * + * { margin-top: .25rem; }
.space-y-3 > * + * { margin-top: .75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-5 > * + * { margin-top: 1.25rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-8 > * + * { margin-top: 2rem; }
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }
.rounded-xl,
.rounded-2xl,
.rounded-3xl,
.rounded-full { border-radius: 8px; }
.rounded-full { border-radius: 999px; }
.border,
.border-t,
.border-b,
.border-r { border-color: var(--border); }
.border { border: 1px solid var(--border); }
.border-t { border-top: 1px solid var(--border); }
.border-b { border-bottom: 1px solid var(--border); }
.border-r { border-right: 1px solid var(--border); }
.shadow-sm,
.shadow-2xl { box-shadow: var(--shadow-soft); }
.ring-1 { border: 1px solid var(--border); }
.bg-white,
.bg-white\/80 { background: #fff; }
.bg-slate-50,
.bg-slate-100 { background: var(--bg-soft); }
.bg-slate-950,
.bg-slate-900 { background: #071642; }
.bg-panel-900,
.bg-panel-700 { background: var(--primary-dark); }
.bg-panel-500 { background: var(--primary); }
.bg-emerald-50 { background: #ecfdf5; }
.bg-emerald-100 { background: #dcfce7; }
.bg-amber-50 { background: #fffbeb; }
.bg-amber-100 { background: #fef3c7; }
.bg-red-50,
.bg-rose-50 { background: #fff1f2; }
.bg-red-100,
.bg-rose-100 { background: #ffe4e6; }
.text-white { color: #fff; }
.text-slate-100 { color: #f1f5f9; }
.text-slate-400 { color: #94a3b8; }
.text-slate-500 { color: var(--muted); }
.text-slate-600 { color: var(--muted-strong); }
.text-slate-700 { color: #334155; }
.text-slate-800 { color: #1e293b; }
.text-slate-900,
.text-slate-950 { color: var(--text); }
.text-panel-100 { color: #dbeafe; }
.text-panel-300 { color: #9dc4ff; }
.text-emerald-700,
.text-emerald-800 { color: #047857; }
.text-amber-700,
.text-amber-900 { color: #a16207; }
.text-red-700,
.text-rose-700,
.text-rose-800 { color: #be123c; }
.text-xs { font-size: .75rem; }
.text-sm { font-size: .875rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.font-medium { font-weight: 650; }
.font-semibold { font-weight: 800; }
.font-bold { font-weight: 850; }
.uppercase { text-transform: uppercase; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.leading-5 { line-height: 1.25rem; }
.leading-6 { line-height: 1.5rem; }
.leading-tight { line-height: 1.15; }
.tracking-\[0\.2em\],
.tracking-\[0\.3em\],
.tracking-\[0\.4em\] { letter-spacing: 0; }
.whitespace-pre-line { white-space: pre-line; }
.min-w-full { min-width: 100%; }
.h-2 { height: .5rem; }
.h-full { height: 100%; }
.min-h-32 { min-height: 8rem; }
.divide-y > * + * { border-top: 1px solid var(--border); }
.hover\:border-panel-500:hover { border-color: var(--primary); }
.hover\:bg-panel-700:hover,
.hover\:bg-panel-900:hover { background: var(--primary); }
.outline-none { outline: 0; }
.transition { transition: all .16s ease; }
.backdrop-blur { backdrop-filter: blur(14px); }

@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md\:col-span-2 { grid-column: span 2 / span 2; }
  .md\:flex-row { flex-direction: row; }
  .md\:items-center { align-items: center; }
  .md\:justify-between { justify-content: space-between; }
}

@media (min-width: 1024px) {
  .lg\:block { display: block; }
  .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .lg\:col-span-2 { grid-column: span 2 / span 2; }
  .lg\:col-span-4 { grid-column: span 4 / span 4; }
  .lg\:p-8 { padding: 2rem; }
  .lg\:p-12 { padding: 3rem; }
}

@media (min-width: 1280px) {
  .xl\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .xl\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .xl\:flex-row { flex-direction: row; }
  .xl\:items-start { align-items: flex-start; }
  .xl\:justify-between { justify-content: space-between; }
}

@media (max-width: 1200px) {
  :root {
    --sidebar-width: 238px;
  }

  .portal-shell {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    padding: 0;
  }

  .stats-grid,
  .stats-grid.six,
  .feature-grid,
  .domain-action-grid,
  .package-limit-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stats-grid.five {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .stats-grid.five > .metric-card {
    grid-column: span 2;
  }

  .stats-grid.five > .metric-card:nth-child(n+4) {
    grid-column: span 3;
  }

  .panel-grid,
  .three-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  :root {
    --sidebar-width: 292px;
  }

  .portal-shell {
    display: block;
    width: 100% !important;
    padding: 0;
  }

  .portal-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    width: min(86vw, 320px);
    height: 100dvh;
    min-height: 100dvh;
    transform: translateX(-102%);
    transition: transform .22s ease;
    overflow: hidden;
    border-radius: 0;
    box-shadow: 22px 0 48px rgba(7, 22, 66, 0.28);
  }

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

  .portal-nav {
    display: block;
    max-height: none;
    overflow-x: hidden;
    overflow-y: auto;
    padding-bottom: 88px;
  }

  .nav-group {
    margin-bottom: 12px;
  }

  .portal-main {
    grid-column: auto;
    border: 0;
    border-radius: 0;
  }

  .portal-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    min-height: 64px;
    padding: 12px 14px;
  }

  .mobile-menu-button {
    width: 42px;
    height: 42px;
    display: grid !important;
    place-items: center;
    gap: 4px;
    padding: 9px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
  }

  .mobile-menu-button span {
    width: 18px;
    height: 2px;
    display: block;
    border-radius: 99px;
    background: var(--primary-dark);
  }

  .mobile-menu-close {
    width: 36px;
    height: 36px;
    display: grid !important;
    place-items: center;
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 8px;
    color: #fff;
    background: rgba(255,255,255,0.12);
    font-size: 1.3rem;
    line-height: 1;
  }

  .mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: block !important;
    pointer-events: none;
    opacity: 0;
    background: rgba(7, 22, 66, 0.42);
    backdrop-filter: blur(3px);
    transition: opacity .22s ease;
  }

  body.mobile-nav-open .mobile-nav-backdrop {
    pointer-events: auto;
    opacity: 1;
  }

  body.mobile-nav-open {
    overflow: hidden;
  }

  .portal-search {
    display: none;
  }

  .topbar-title p {
    display: none;
  }

  .topbar-title h1 {
    font-size: 1.05rem;
  }

  .topbar-actions {
    gap: 8px;
  }

  .topbar-actions .icon-button,
  .topbar-actions .topbar-avatar {
    width: 36px;
    height: 36px;
  }

  .portal-content {
    padding: 18px 14px 24px;
  }

  .stats-grid,
  .stats-grid.six,
  .stats-grid.five,
  .feature-grid,
  .domain-action-grid,
  .package-limit-grid,
  .package-limits,
  .two-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid.five > .metric-card {
    grid-column: auto;
  }

  .page-heading {
    display: grid;
  }

  .bar-row {
    grid-template-columns: 1fr;
  }

  .login-card {
    grid-template-columns: 1fr;
  }

  .login-hero {
    display: none;
  }

  .wizard-steps,
  .notification-row,
  .job-row,
  .role-permission-grid,
  .routing-choice-grid,
  .nameserver-grid,
  .onboarding-grid {
    grid-template-columns: 1fr;
  }

  .migration-upload {
    grid-template-columns: 1fr;
  }

  .migration-upload-actions {
    justify-content: stretch;
  }

  .migration-upload-actions button {
    justify-self: stretch;
  }

  .impersonation-banner {
    display: grid;
    align-items: start;
  }

  .first-run-overlay {
    padding: 14px;
    align-items: center;
  }

  .first-run-panel {
    gap: 16px;
    padding: 18px;
    width: min(100%, 560px);
  }

  .first-run-head {
    display: grid;
    gap: 14px;
  }

  .first-run-head h2 {
    font-size: 1.3rem;
  }

  .first-run-step {
    min-height: 0;
    padding: 14px;
  }

  .first-run-actions {
    justify-content: stretch;
  }

  .first-run-actions > button,
  .first-run-actions form,
  .first-run-actions form button {
    width: 100%;
  }
}

@media (max-width: 700px) {
  .responsive-table,
  .table-wrap {
    overflow: visible;
  }

  .responsive-table table,
  .table-wrap table,
  table.data-table {
    display: block;
  }

  .responsive-table thead,
  .table-wrap thead,
  table.data-table thead {
    display: none;
  }

  .responsive-table tbody,
  .table-wrap tbody,
  table.data-table tbody {
    display: grid;
    gap: 12px;
  }

  .responsive-table tr,
  .table-wrap tr,
  table.data-table tr {
    display: grid;
    gap: 0;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow-soft);
  }

  .responsive-table td,
  .table-wrap td,
  table.data-table td {
    display: grid;
    grid-template-columns: minmax(110px, 0.42fr) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 10px 0;
    border: 0;
    border-bottom: 1px solid #edf2fa;
  }

  .responsive-table td:last-child,
  .table-wrap td:last-child,
  table.data-table td:last-child {
    border-bottom: 0;
  }

  .responsive-table td::before,
  .table-wrap td::before,
  table.data-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 850;
    text-transform: uppercase;
  }
}
