/* ── Reset & base ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #080b12;
  --bg-2:        #0d1117;
  --surface:     #111827;
  --surface-2:   #1a2235;
  --border:      rgba(255,255,255,0.07);
  --border-2:    rgba(255,255,255,0.12);
  --text:        #f1f5f9;
  --text-2:      #94a3b8;
  --text-3:      #64748b;
  --accent:      #1DE9B6;
  --accent-dim:  rgba(29,233,182,0.12);
  --blue:        #3b82f6;
  --blue-dim:    rgba(59,130,246,0.12);
  --violet:      #8b5cf6;
  --violet-dim:  rgba(139,92,246,0.12);
  --amber:       #f59e0b;
  --amber-dim:   rgba(245,158,11,0.12);
  --red:         #ef4444;
  --red-dim:     rgba(239,68,68,0.12);
  --green:       #22c55e;
  --green-dim:   rgba(34,197,94,0.12);
  --sidebar-w:   240px;
  --topbar-h:    56px;
  --radius:      12px;
  --radius-sm:   8px;
  --shadow:      0 1px 3px rgba(0,0,0,0.4), 0 4px 16px rgba(0,0,0,0.3);
  --font:        'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html { font-size: 14px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── LOGIN PAGE ──────────────────────────────────────────────────────────── */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 60% at 20% 40%, rgba(29,233,182,0.04) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 60%, rgba(59,130,246,0.04) 0%, transparent 60%);
  overflow: hidden;
  position: relative;
}

.login-wrap { position: relative; z-index: 1; }

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  width: 400px;
  box-shadow: var(--shadow), 0 0 0 1px rgba(29,233,182,0.05);
}

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

.login-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-dim);
  border: 1px solid rgba(29,233,182,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.login-brand-name { font-size: 15px; font-weight: 700; color: var(--text); }
.login-brand-sub  { font-size: 11px; color: var(--text-3); letter-spacing: 0.03em; }

.login-title { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.login-desc  { font-size: 13px; color: var(--text-2); margin-bottom: 28px; }

.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  font-size: 11px;
  color: var(--text-3);
}
.login-server { color: var(--accent); }
.login-dot { opacity: 0.4; }

.login-bg-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(80px);
  opacity: 0.3;
}
.orb-1 { width: 400px; height: 400px; background: radial-gradient(var(--accent), transparent); top: -100px; right: -100px; }
.orb-2 { width: 300px; height: 300px; background: radial-gradient(var(--blue), transparent); bottom: -80px; left: -80px; }

/* ── APP LAYOUT ─────────────────────────────────────────────────────────── */
.app-body { display: flex; min-height: 100vh; overflow: hidden; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  scrollbar-width: none;
  transition: transform 0.25s ease;
  z-index: 100;
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar-header {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--accent-dim);
  border: 1px solid rgba(29,233,182,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-brand { font-size: 14px; font-weight: 700; color: var(--text); }
.sidebar-domain { font-size: 11px; color: var(--accent); letter-spacing: 0.02em; }

.sidebar-nav { flex: 1; padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; }

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 12px 8px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 450;
  text-decoration: none;
  transition: all 0.15s;
  cursor: pointer;
  position: relative;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
}
.nav-item.active .nav-icon { color: var(--accent); }

.nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: inherit;
}

.nav-badge {
  margin-left: auto;
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 20px;
  min-width: 18px;
  text-align: center;
}
.nav-badge-warn { background: var(--amber-dim); color: var(--amber); }
.nav-tag-new {
  margin-left: auto;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 20px;
  letter-spacing: 0.04em;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-user { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.sidebar-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--blue-dim);
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sidebar-user-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 10px; color: var(--text-3); }

.sidebar-logout {
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: all 0.15s;
  flex-shrink: 0;
}
.sidebar-logout:hover { background: var(--red-dim); color: var(--red); }

/* Mobile sidebar */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99;
}
.sidebar-overlay.visible { display: block; }

/* ── Main area ────────────────────────────────────────────────────────────── */
.main-wrap { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }

/* Topbar */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-menu {
  display: none;
  background: none;
  border: none;
  color: var(--text-2);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
}
.topbar-menu:hover { background: var(--surface-2); }

.topbar-breadcrumb {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.topbar-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-3);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot-ok { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-dot-warn { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.status-dot-loading { background: var(--text-3); animation: pulse 1.5s infinite; }

@keyframes pulse { 0%,100%{opacity:0.4} 50%{opacity:1} }

.content {
  flex: 1;
  overflow-y: auto;
  padding: 28px 28px 48px;
}

/* ── Page layout ─────────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.page-title  { font-size: 22px; font-weight: 700; line-height: 1.2; }
.page-subtitle { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.page-actions { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }

.page-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 2.5px solid var(--border-2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.page-error {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-2);
}
.page-error-icon { font-size: 36px; margin-bottom: 12px; }
.page-error h2   { font-size: 16px; margin-bottom: 8px; }
.page-error p    { font-size: 13px; margin-bottom: 20px; color: var(--text-3); }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card + .card { margin-top: 16px; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}
.card-title svg { color: var(--text-3); }
.card-desc { font-size: 12px; color: var(--text-3); }

.card-footer-actions {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
}

/* ── Stat cards ──────────────────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: border-color 0.2s;
}
.stat-card:hover { border-color: var(--border-2); }
.stat-card-warn  { border-color: rgba(245,158,11,0.2); }

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon-blue   { background: var(--blue-dim); color: var(--blue); }
.stat-icon-violet { background: var(--violet-dim); color: var(--violet); }
.stat-icon-emerald{ background: var(--green-dim); color: var(--green); }
.stat-icon-amber  { background: var(--amber-dim); color: var(--amber); }
.stat-icon-slate  { background: var(--surface-2); color: var(--text-3); }

.stat-label { font-size: 11px; color: var(--text-3); font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 3px; }
.stat-value { font-size: 26px; font-weight: 700; line-height: 1; color: var(--text); }
.stat-sub   { font-size: 11px; color: var(--text-3); margin-top: 3px; }

/* ── Dashboard grids ────────────────────────────────────────────────────── */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.svc-list { padding: 4px 0; }
.svc-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.svc-item:last-child { border-bottom: none; }
.svc-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.svc-dot-ok   { background: var(--green); box-shadow: 0 0 6px rgba(34,197,94,0.5); }
.svc-dot-warn { background: var(--amber); box-shadow: 0 0 6px rgba(245,158,11,0.5); }
.svc-name  { flex: 1; font-weight: 500; }
.svc-state { font-size: 11px; }
.svc-ok    { color: var(--green); }
.svc-warn  { color: var(--amber); }

.info-list { padding: 4px 0; }
.info-row  { display: flex; align-items: center; padding: 9px 20px; border-bottom: 1px solid var(--border); gap: 12px; font-size: 13px; }
.info-row:last-child { border-bottom: none; }
.info-label { width: 100px; color: var(--text-3); flex-shrink: 0; font-size: 12px; }
.info-val   { flex: 1; }

/* ── Tables ──────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th {
  text-align: left;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
  white-space: nowrap;
}
.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(255,255,255,0.015); }

.col-actions { text-align: right; width: 1px; white-space: nowrap; }
.empty-cell  { color: var(--text-3); text-align: center; padding: 40px !important; font-size: 13px; }

/* ── Entity cell ─────────────────────────────────────────────────────────── */
.entity-cell { display: flex; align-items: center; gap: 10px; }
.entity-name { font-weight: 500; }
.entity-sub  { font-size: 11px; color: var(--text-3); }

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--blue-dim);
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.domain-icon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--violet-dim);
  color: var(--violet);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Badges ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.badge-green { background: var(--green-dim); color: var(--green); }
.badge-red   { background: var(--red-dim); color: var(--red); }
.badge-amber { background: var(--amber-dim); color: var(--amber); }

.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  background: var(--surface-2);
  color: var(--text-2);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  font-family: var(--font);
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: #0a1612;
  font-weight: 600;
}
.btn-primary:hover:not(:disabled) { background: #26ffcb; }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border-2);
}
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(239,68,68,0.2);
}
.btn-danger:hover:not(:disabled) { background: rgba(239,68,68,0.2); }

.btn-full { width: 100%; justify-content: center; padding: 11px; }

.btn-sm { padding: 5px 10px; font-size: 12px; }

.btn-ghost.btn-sm { border-color: transparent; }
.btn-ghost.btn-sm:hover { border-color: var(--border-2); }

.btn-ghost.btn-danger { background: transparent; }
.btn-ghost.btn-danger:hover { background: var(--red-dim); color: var(--red); }

.btn-ghost.btn-sm.btn-danger { border: none; }

.btn-copy {
  background: none;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--text-3);
  cursor: pointer;
  padding: 3px 5px;
  transition: all 0.15s;
  flex-shrink: 0;
}
.btn-copy:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-2); }

/* Action group */
.action-group {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
}

/* ── Form elements ───────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }

.field-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
}
.field-label-hint { color: var(--text-3); font-weight: 400; }

.field-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 9px 12px;
  font-size: 13px;
  font-family: var(--font);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.field-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29,233,182,0.1);
}
.field-input::placeholder { color: var(--text-3); }

.field-input-wrap { position: relative; display: flex; align-items: center; }
.field-input-wrap .field-input { padding-left: 36px; }
.field-icon {
  position: absolute;
  left: 11px;
  color: var(--text-3);
  pointer-events: none;
  flex-shrink: 0;
}
.field-toggle {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
}
.field-toggle:hover { color: var(--text); }

.field-domain-wrap {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field-domain-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29,233,182,0.1);
}
.field-domain-wrap .field-input {
  border: none;
  box-shadow: none;
  border-radius: 0;
  flex: 1;
}
.field-domain-wrap .field-input:focus { box-shadow: none; }
.field-domain-suffix {
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text-3);
  background: var(--surface-2);
  border-left: 1px solid var(--border);
  white-space: nowrap;
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 10px;
  color: var(--text-3);
  pointer-events: none;
}
.search-input {
  background: var(--bg);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 7px 12px 7px 32px;
  font-size: 13px;
  font-family: var(--font);
  outline: none;
  width: 220px;
  transition: all 0.15s;
}
.search-input:focus {
  border-color: var(--accent);
  width: 280px;
  box-shadow: 0 0 0 3px rgba(29,233,182,0.08);
}
.search-input::placeholder { color: var(--text-3); }

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.5;
}
.alert svg { flex-shrink: 0; margin-top: 1px; }
.alert-error { background: var(--red-dim); color: var(--red); border: 1px solid rgba(239,68,68,0.2); }
.alert-warn  { background: var(--amber-dim); color: var(--amber); border: 1px solid rgba(245,158,11,0.2); }
.alert-info  { background: var(--blue-dim); color: var(--blue); border: 1px solid rgba(59,130,246,0.2); }
.alert-success { background: var(--green-dim); color: var(--green); border: 1px solid rgba(34,197,94,0.2); }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 200;
  backdrop-filter: blur(2px);
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 201;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 16px;
  width: 480px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 64px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 15px; font-weight: 700; }
.modal-close {
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: all 0.15s;
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }

.modal-body {
  padding: 18px 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.modal-desc { font-size: 13px; color: var(--text-2); }

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ── Toast ───────────────────────────────────────────────────────────────── */
.toast-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  transform: translateX(120%);
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
  min-width: 240px;
  max-width: 360px;
}
.toast-show { transform: translateX(0); }
.toast-success svg { color: var(--green); }
.toast-error   { border-color: rgba(239,68,68,0.3); }
.toast-error svg { color: var(--red); }

/* ── DNS records ─────────────────────────────────────────────────────────── */
.dns-list { padding: 0; }

.dns-record {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.dns-record:last-child { border-bottom: none; }
.dns-record:hover { background: rgba(255,255,255,0.015); }

.dns-record-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.dns-record-type {
  font-size: 11px;
  font-weight: 700;
  color: var(--blue);
  background: var(--blue-dim);
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.dns-record-host { font-size: 13px; font-weight: 500; }
.dns-record-value {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}
.dns-value-label { font-size: 11px; color: var(--text-3); margin-top: 4px; flex-shrink: 0; min-width: 36px; }
.dns-value-wrap  { display: flex; align-items: flex-start; gap: 6px; flex: 1; }
.dns-value {
  font-size: 12px;
  word-break: break-all;
  line-height: 1.6;
}
.dns-record-desc { font-size: 12px; color: var(--text-3); }

.dns-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}
.dns-tag-required    { background: rgba(239,68,68,0.12); color: var(--red); }
.dns-tag-recommended { background: var(--amber-dim); color: var(--amber); }
.dns-tag-optional    { background: var(--surface-2); color: var(--text-3); }
.dns-tag-error       { background: var(--red-dim); color: var(--red); }

/* Client settings */
.client-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}
.client-card {
  padding: 16px 20px;
  border-right: 1px solid var(--border);
}
.client-card:last-child { border-right: none; }
.client-card-title { font-size: 12px; font-weight: 700; color: var(--text-2); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.client-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 12px; gap: 8px; }
.client-row:last-child { border-bottom: none; }
.client-row span:first-child { color: var(--text-3); }

/* ── Mail queue ──────────────────────────────────────────────────────────── */
.queue-list { padding: 4px 0; }
.queue-item {
  padding: 8px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  line-height: 1.5;
}
.queue-item:last-child { border-bottom: none; }
.queue-more { padding: 12px 20px; font-size: 12px; color: var(--text-3); text-align: center; }

/* ── Empty state ──────────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  text-align: center;
  color: var(--text-3);
}
.empty-state-icon { margin-bottom: 16px; opacity: 0.3; }
.empty-state h2 { font-size: 16px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.empty-state p  { font-size: 13px; }

/* ── Shared utilities ─────────────────────────────────────────────────────── */
.code {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 12px;
}
.text-muted { color: var(--text-3); }
.btn-ghost-icon { background: none; border: 1px solid transparent; border-radius: 6px; color: var(--text-3); cursor: pointer; padding: 5px; display: flex; align-items: center; }
.btn-ghost-icon:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .client-settings-grid { grid-template-columns: 1fr; }
  .client-card { border-right: none; border-bottom: 1px solid var(--border); }
  .client-card:last-child { border-bottom: none; }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    box-shadow: 4px 0 32px rgba(0,0,0,0.5);
  }
  .sidebar.sidebar-open { transform: translateX(0); }
  .topbar-menu { display: flex; }
  .main-wrap { width: 100%; }
  .content { padding: 16px 16px 48px; }
  .hide-sm { display: none; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .action-group { flex-wrap: wrap; gap: 2px; }
  .modal { width: calc(100vw - 24px); }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: stretch; }
  .page-actions { justify-content: flex-end; }
}
