:root {
  --bg: #f5f8fd;
  --panel: #ffffff;
  --panel-hover: #f8fbff;
  --text: #14213d;
  --text-muted: #53667d;
  --text-light: #8a9bb5;
  --border: #dbe7f6;
  --border-strong: #c8d8ed;
  --primary: #1684e5;
  --primary-hover: #0d6ec4;
  --primary-light: #eef6ff;
  --primary-text: #ffffff;
  --success: #10b981;
  --success-light: #ecfdf5;
  --success-text: #065f46;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --warning-text: #92400e;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --danger-text: #991b1b;
  --shadow: 0 4px 14px rgba(20, 33, 61, 0.06);
  --shadow-lg: 0 12px 32px rgba(20, 33, 61, 0.08);
  --shadow-sm: 0 1px 3px rgba(20, 33, 61, 0.05);
  --radius: 10px;
  --radius-lg: 14px;
  --radius-sm: 6px;
  --focus-ring: 0 0 0 3px rgba(22, 132, 229, 0.22);
  --transition: 140ms ease;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html { font-size: 15px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

button {
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  transition: background-color var(--transition), border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  white-space: nowrap;
}

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

.btn-primary {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
}

.btn-primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); }

.btn-primary:focus-visible { outline: none; box-shadow: var(--focus-ring); }

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

.btn-secondary:hover:not(:disabled) { background: var(--panel-hover); border-color: var(--border-strong); }

.btn-secondary:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.btn-ghost {
  background: transparent;
  color: var(--primary);
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) { background: var(--primary-light); }

.btn-ghost:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.btn-danger {
  background: var(--danger-light);
  color: var(--danger);
  border-color: var(--danger-light);
}

.btn-danger:hover:not(:disabled) { background: #fee2e2; border-color: #fecaca; }

.btn-sm { min-height: 34px; padding: 0 12px; font-size: 0.85rem; }

.btn-lg { min-height: 46px; padding: 0 22px; font-size: 1rem; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 4px; }

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

h1, h2, h3, h4, p { margin-top: 0; }

h1 { font-size: clamp(28px, 4.5vw, 44px); line-height: 1.15; letter-spacing: -0.02em; }
h2 { font-size: clamp(20px, 2.8vw, 26px); line-height: 1.25; letter-spacing: -0.01em; }
h3 { font-size: 1.05rem; font-weight: 600; }
h4 { font-size: 0.95rem; font-weight: 600; color: var(--text-muted); }

.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 6px;
}

.muted { color: var(--text-muted); }
.text-light { color: var(--text-light); }

label {
  display: grid;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

input, select, textarea {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}

input::placeholder, textarea::placeholder { color: var(--text-light); }

input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
}

input:disabled, select:disabled, textarea:disabled { opacity: 0.5; cursor: not-allowed; }

textarea { min-height: 90px; padding: 10px 12px; resize: vertical; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}

.panel-sm { padding: 16px; }

.notice {
  background: var(--warning-light);
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  color: var(--warning-text);
  padding: 12px 14px;
  margin-bottom: 18px;
  font-size: 0.9rem;
}

.notice-info { background: var(--primary-light); border-color: #bfdbfe; color: #1e40af; }
.notice-success { background: var(--success-light); border-color: #a7f3d0; color: var(--success-text); }
.notice-error { background: var(--danger-light); border-color: #fecaca; color: var(--danger-text); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat-card { background: var(--panel-hover); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.stat-card span { display: block; color: var(--text-light); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.stat-card strong { display: block; color: var(--text); font-size: 1.35rem; line-height: 1.2; margin-top: 4px; overflow-wrap: anywhere; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }

/* Navigation */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  position: sticky;
  top: 12px;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--primary);
  text-decoration: none;
}

.nav-brand:hover { text-decoration: none; color: var(--primary-hover); }

.nav-links { display: flex; align-items: center; gap: 6px; }

.nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}

.nav-links a:hover,
.nav-links a:focus-visible,
.nav-links a[aria-current="page"] {
  background: var(--primary-light);
  color: var(--primary);
  text-decoration: none;
}

.nav-user { display: flex; align-items: center; gap: 10px; }
.nav-user .user-email { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }

/* Public navigation (marketing pages) */
.public-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.public-nav .brand { font-weight: 800; font-size: 1.2rem; color: var(--primary); }
.public-nav-links { display: flex; align-items: center; gap: 8px; }
.public-nav-links a {
  padding: 8px 14px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.public-nav-links a:hover { background: var(--primary-light); color: var(--primary); }

/* Hero sections */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 32px;
  align-items: center;
  padding: clamp(28px, 5vw, 56px);
  background: linear-gradient(135deg, var(--primary) 0%, #2563eb 100%);
  border-radius: 20px;
  color: white;
  overflow: hidden;
  position: relative;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 80% -20%, rgba(255,255,255,0.12), transparent 60%);
  pointer-events: none;
}

.hero-content { position: relative; z-index: 1; max-width: 640px; }
.hero .eyebrow { color: rgba(255,255,255,0.85); }
.hero h1 { color: white; margin-bottom: 14px; }
.hero-copy { font-size: 1.1rem; line-height: 1.6; opacity: 0.95; max-width: 580px; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

.hero .btn-primary { background: white; color: var(--primary); border-color: white; }
.hero .btn-primary:hover { background: #f8fafc; }
.hero .btn-ghost { background: rgba(255,255,255,0.15); color: white; border-color: rgba(255,255,255,0.3); }
.hero .btn-ghost:hover { background: rgba(255,255,255,0.25); }

.hero-preview {
  position: relative;
  z-index: 1;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 14px;
  padding: 24px;
  min-height: 220px;
  display: grid;
  gap: 16px;
  font-family: var(--font-mono);
}

.hero-preview .server-name { font-weight: 700; font-size: 1.4rem; letter-spacing: -0.01em; }
.hero-preview .server-address { font-size: 0.95rem; opacity: 0.85; }
.hero-preview .server-meta { font-size: 0.85rem; opacity: 0.7; }
.hero-preview-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 8px; }
.hero-preview-actions span {
  background: rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Marketing sections */
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 24px; }
.feature-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.feature-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.feature-card h3 { margin-bottom: 8px; color: var(--text); }
.feature-card p { color: var(--text-muted); font-size: 0.95rem; line-height: 1.6; margin: 0; }

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 1fr);
  gap: 28px;
  align-items: center;
  padding: 32px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--primary);
}

.split-content h2 { margin-bottom: 10px; }
.split-content .muted { font-size: 1.05rem; line-height: 1.65; }

.check-list { display: grid; gap: 10px; padding-left: 0; list-style: none; }
.check-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.55;
}
.check-list li::before {
  content: "";
  flex: 0 0 20px;
  height: 20px;
  background: var(--success);
  border-radius: 4px;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") center/contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") center/contain no-repeat;
}

.cta-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 32px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.cta-content h2 { margin-bottom: 6px; }
.cta-content .muted { font-size: 1.05rem; }
.cta-content .btn { width: 100%; max-width: 280px; }

/* Status badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid currentColor;
}

.badge-online { background: var(--success-light); color: var(--success-text); border-color: #a7f3d0; }
.badge-offline { background: #f1f5f9; color: #64748b; border-color: #e2e8f0; }
.badge-failed { background: var(--danger-light); color: var(--danger-text); border-color: #fecaca; }
.badge-queued,
.badge-starting,
.badge-stopping { background: var(--warning-light); color: var(--warning-text); border-color: #fde68a; }

/* Tables */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: #f8fbff; color: var(--text-muted); font-weight: 700; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--panel-hover); }

/* Forms */
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

/* Auth pages */
.auth-shell { display: grid; grid-template-columns: 1fr; gap: 24px; max-width: 880px; margin: 0 auto; }
.auth-hero {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, var(--primary) 0%, #2563eb 100%);
  border-radius: 18px;
  padding: clamp(28px, 4vw, 48px);
  color: white;
  text-align: center;
}
.auth-hero .eyebrow { color: rgba(255,255,255,0.85); }
.auth-hero h1 { color: white; max-width: 600px; margin: 0 auto 14px; }
.auth-hero .hero-copy { opacity: 0.95; max-width: 580px; margin: 0 auto; }

.auth-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.auth-panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; }
.auth-panel h2 { margin-bottom: 4px; }
.auth-panel > p.muted { margin-bottom: 20px; }
.auth-form { display: grid; gap: 16px; }

/* Server cards */
.server-list { display: grid; gap: 16px; }
.server-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.server-card:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-1px); }

.server-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.server-head h3 { font-size: 1.15rem; margin: 0; }
.server-meta { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; }

.server-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 14px 0; padding: 14px; background: #f8fbff; border: 1px solid var(--border); border-radius: var(--radius); }
.server-details dt { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-light); }
.server-details dd { margin: 2px 0 0; font-weight: 600; color: var(--text); overflow-wrap: anywhere; font-size: 0.9rem; }

.server-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Empty state */
.empty-state {
  background: var(--panel);
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
}
.empty-state h3 { margin-bottom: 8px; }
.empty-state .muted { margin-bottom: 20px; max-width: 400px; margin-left: auto; margin-right: auto; }

/* Detail view */
.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}
.detail-title h2 { margin-bottom: 4px; }
.detail-meta { color: var(--text-muted); font-size: 0.95rem; }
.detail-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-top: 16px; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr); gap: 24px; }
.detail-main { display: grid; gap: 24px; }
.detail-sidebar { display: grid; gap: 24px; }

.detail-section { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.detail-section h3 { margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }

.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.settings-grid dt { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-light); }
.settings-grid dd { margin: 2px 0 0; font-weight: 500; color: var(--text); }

/* Logs & Console */
.log-box {
  background: #0b1220;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.55;
  padding: 14px;
  max-height: 360px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.console-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 12px; }
.console-form input { min-width: 0; }

/* Events / Activity */
.event-list { display: grid; gap: 8px; }
.event-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-left: 3px solid var(--border);
}
.event-item.error { border-left-color: var(--danger); }
.event-item time { color: var(--text-light); font-size: 0.8rem; white-space: nowrap; }
.event-item span { color: var(--text); font-size: 0.9rem; line-height: 1.5; }

/* Backups */
.backup-list { display: grid; gap: 8px; }
.backup-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.backup-item time { color: var(--text-muted); font-size: 0.85rem; white-space: nowrap; }
.backup-item .filename { font-weight: 500; color: var(--text); }
.backup-item .size { color: var(--text-muted); font-size: 0.85rem; }

/* Admin tables */
.admin-grid { display: grid; grid-template-columns: minmax(280px, 0.7fr) minmax(0, 1.3fr); gap: 24px; margin-top: 24px; }
.monitoring-stats { margin-top: 18px; }
.monitoring-grid { display: grid; grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1.25fr); gap: 18px; margin: 18px 0; }

/* Footer */
.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px 0 12px;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.footer a { color: var(--text-muted); }
.footer a:hover { color: var(--primary); }

.public-footer { margin-top: 16px; }
.public-footer span { font-weight: 700; color: var(--text); }

/* Ads and consent */
.ad-slot {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin: 18px 0;
  min-height: 96px;
  overflow: hidden;
  padding: 10px;
  position: relative;
}
.ad-slot-sidebar { margin: 0; min-height: 220px; }
.ad-placeholder {
  align-items: center;
  color: var(--text-light);
  display: grid;
  gap: 4px;
  justify-items: center;
  text-align: center;
}
.ad-placeholder span { color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.75rem; }
.ad-placeholder small { font-size: 0.8rem; }
.ad-test-label {
  background: var(--warning-light);
  border: 1px solid #fde68a;
  border-radius: 999px;
  color: var(--warning-text);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  position: absolute;
  right: 10px;
  text-transform: uppercase;
  top: 10px;
}
.consent-banner {
  align-items: center;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  bottom: 16px;
  box-shadow: var(--shadow-lg);
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) auto;
  left: 50%;
  max-width: min(960px, calc(100vw - 24px));
  padding: 16px;
  position: fixed;
  transform: translateX(-50%);
  width: 100%;
  z-index: 1000;
}
.consent-banner p { color: var(--text-muted); font-size: 0.9rem; margin: 4px 0 0; }
.consent-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

/* Legal pages */
.legal-page { max-width: 900px; margin: 0 auto; }
.legal-content { display: grid; gap: 20px; margin-top: 28px; }
.legal-content section { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; }
.legal-content h2 { font-size: 1.15rem; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.legal-content p { color: var(--text-muted); line-height: 1.7; margin: 0; }
.legal-content ul { margin: 10px 0 0; padding-left: 20px; color: var(--text-muted); line-height: 1.7; }
.legal-warning { background: var(--warning-light) !important; border-color: #fde68a !important; }
.legal-warning h2 { color: var(--warning-text); }

/* Modal / Dialog */
dialog {
  border: 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 0;
  max-width: 480px;
  width: calc(100vw - 32px);
}
dialog::backdrop { background: rgba(20, 33, 61, 0.35); backdrop-filter: blur(2px); }
.dialog-header { padding: 18px 24px; border-bottom: 1px solid var(--border); }
.dialog-header h3 { margin: 0; }
.dialog-body { padding: 24px; }
.dialog-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--border); }

/* Utilities */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.hidden { display: none !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.text-center { text-align: center; }
.w-full { width: 100%; }

/* Responsive */
@media (max-width: 960px) {
  .hero, .split-section, .cta-section, .detail-hero, .detail-grid, .admin-grid, .auth-grid {
    grid-template-columns: 1fr;
  }
  .hero { text-align: center; }
  .hero-content { max-width: 100%; }
  .hero-actions { justify-content: center; }
  .hero-preview { max-width: 420px; margin: 0 auto; }
  .detail-hero { text-align: center; }
  .detail-actions { justify-content: center; }
  .nav { flex-wrap: wrap; }
  .nav-links { order: 3; width: 100%; justify-content: center; margin-top: 10px; }
  .consent-banner { grid-template-columns: 1fr; }
  .consent-actions { justify-content: stretch; }
  .consent-actions .btn { flex: 1; }
}

@media (max-width: 640px) {
  .shell { padding: 20px 0 36px; width: calc(100vw - 20px); }
  .panel { padding: 18px; border-radius: var(--radius); }
  .nav { padding: 12px 14px; border-radius: var(--radius); }
  .hero { padding: 24px; border-radius: 14px; }
  .features { grid-template-columns: 1fr; }
  .server-details { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .auth-panel { padding: 20px; }
  .detail-stats { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .backup-item { grid-template-columns: 1fr; text-align: center; }
  .backup-item time { order: -1; margin-bottom: 4px; }
  table { font-size: 0.8rem; }
  th, td { padding: 10px 8px; }
}

@media (max-width: 480px) {
  .detail-stats { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr; }
  .hero-preview-actions { grid-template-columns: 1fr; }
}

/* Print */
@media print {
  .nav, .btn, .actions, .console-form, .detail-actions { display: none !important; }
  body { background: white; }
  .panel { box-shadow: none; border-color: #ccc; }
}
