
:root {
  --bg: #0f1117;
  --panel: #171a23;
  --panel-alt: #1e212c;
  --border: #2a2e3a;
  --text: #e8e9ed;
  --muted: #8b8fa3;
  --accent: #5b8cff;
  --green: #2ecc71;
  --red: #e74c3c;
  --yellow: #f1c40f;
  --radius: 10px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); font-size: 0.9em; }

.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 230px; background: var(--panel); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 20px 0; flex-shrink: 0;
}
.brand { font-size: 1.2em; font-weight: 700; padding: 0 20px 20px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar nav a {
  color: var(--text); padding: 10px 20px; border-left: 3px solid transparent;
}
.sidebar nav a:hover { background: var(--panel-alt); text-decoration: none; }
.sidebar nav a.active { background: var(--panel-alt); border-left-color: var(--accent); color: var(--accent); }
.sidebar-footer { padding: 20px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; font-size: 0.85em; }

.content { flex: 1; padding: 30px 40px; max-width: 1100px; }
h1 { font-size: 1.6em; margin: 0 0 20px; }

.stat-cards { display: flex; gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; flex: 1; text-align: center;
}
.stat-num { font-size: 2em; font-weight: 700; }
.stat-online .stat-num { color: var(--green); }
.stat-offline .stat-num { color: var(--red); }
.stat-unknown .stat-num { color: var(--yellow); }

.panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; margin-bottom: 24px;
}
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); }
.table th { color: var(--muted); font-weight: 600; font-size: 0.85em; text-transform: uppercase; }

.pill { padding: 3px 10px; border-radius: 20px; font-size: 0.8em; font-weight: 600; text-transform: capitalize; }
.pill-online { background: rgba(46,204,113,0.15); color: var(--green); }
.pill-offline { background: rgba(231,76,60,0.15); color: var(--red); }
.pill-unknown { background: rgba(241,196,15,0.15); color: var(--yellow); }

.btn-primary, .btn-sm {
  background: var(--accent); color: #fff; border: none; padding: 10px 16px;
  border-radius: var(--radius); cursor: pointer; font-size: 1em; display: inline-block;
}
.btn-primary:hover { opacity: 0.9; text-decoration: none; }
.btn-sm { padding: 7px 12px; font-size: 0.9em; }
.btn-group { display: flex; gap: 8px; }
.btn-link { background: none; border: none; color: var(--accent); cursor: pointer; padding: 0; font-size: 0.95em; }
.btn-danger { color: var(--red); }

form label { display: block; margin: 14px 0 4px; font-size: 0.9em; color: var(--muted); }
form input[type=text], form input[type=email], form input[type=password], form input[type=number], form select, form textarea {
  width: 100%; padding: 10px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--panel-alt); color: var(--text); font-size: 1em;
}
form textarea { min-height: 80px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 0.95em; color: var(--text); }
.checkbox-row input { width: auto; }

.flash-wrap { margin-bottom: 16px; }
.flash { padding: 10px 16px; border-radius: var(--radius); margin-bottom: 8px; }
.flash-success { background: rgba(46,204,113,0.15); color: var(--green); }
.flash-error { background: rgba(231,76,60,0.15); color: var(--red); }

.activity-list { list-style: none; padding: 0; margin: 0 0 10px; }
.activity-list li { padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 0.9em; }

.pagination { display: flex; justify-content: center; gap: 16px; margin-top: 14px; align-items: center; }

.logo-preview { display: flex; align-items: center; gap: 14px; margin: 8px 0; }
.logo-preview img { max-height: 50px; max-width: 150px; background: #fff; border-radius: 6px; padding: 4px; }

/* Auth pages */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.auth-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 36px; width: 380px;
}
.auth-card h1 { font-size: 1.4em; margin-bottom: 4px; }

/* Public status page */
.status-public { background: #0b0d12; }
.status-wrap { max-width: 640px; margin: 60px auto; padding: 0 20px; text-align: center; }
.status-logo { max-height: 60px; margin-bottom: 16px; }
.status-message { color: var(--muted); }
.status-banner {
  margin: 24px 0; padding: 14px; border-radius: var(--radius); font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.status-banner.ok { background: rgba(46,204,113,0.12); color: var(--green); }
.status-banner.bad { background: rgba(231,76,60,0.12); color: var(--red); }
.status-banner .dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.status-list { text-align: left; }
.status-row {
  display: flex; align-items: center; gap: 12px; padding: 14px; margin-bottom: 10px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
}
.status-pill { font-size: 0.8em; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.status-pill.ok { background: rgba(46,204,113,0.15); color: var(--green); }
.status-pill.bad { background: rgba(231,76,60,0.15); color: var(--red); }
.status-name { font-weight: 600; flex: 1; }
.status-uptime { font-size: 0.85em; color: var(--muted); }
.status-time { font-size: 0.8em; }


/* ===================== Add-on module styles (roles, uptime, maintenance, routing, monitoring, vpn, ssl/domain, reports) ===================== */
.page-header { margin-bottom: 20px; }
.page-header .subtitle { color: var(--muted); margin-top: 4px; }

.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 20px; overflow: hidden; }
.card-header { padding: 14px 20px; border-bottom: 1px solid var(--border); background: var(--panel-alt); }
.card-header h2 { margin: 0; font-size: 1.05em; }
.card-body { padding: 20px; }

.form-row { display: flex; gap: 12px; align-items: center; margin: 10px 0; flex-wrap: wrap; }
.form-row label { color: var(--muted); font-size: 0.9em; margin-right: 4px; }

.input {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: 6px; padding: 8px 10px; font-size: 0.95em; margin: 4px 0;
}
.input-sm { width: 110px; }
textarea.input { width: 100%; font-family: inherit; }

.btn-outline {
  background: transparent; border: 1px solid var(--accent); color: var(--accent);
  padding: 9px 15px; border-radius: var(--radius); cursor: pointer; font-size: 0.95em; display: inline-block;
}
.btn-outline:hover { background: rgba(91,140,255,0.1); text-decoration: none; }
.btn-block { width: 100%; text-align: center; }

.badge { padding: 3px 10px; border-radius: 20px; font-size: 0.78em; font-weight: 600; display: inline-block; }
.badge-success { background: rgba(46,204,113,0.15); color: var(--green); }
.badge-warning { background: rgba(241,196,15,0.15); color: var(--yellow); }
.badge-danger  { background: rgba(231,76,60,0.15); color: var(--red); }

.banner { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 14px; font-size: 0.92em; }
.banner-info    { background: rgba(91,140,255,0.1); border: 1px solid rgba(91,140,255,0.3); }
.banner-warning { background: rgba(241,196,15,0.1); border: 1px solid rgba(241,196,15,0.3); }

.link-small { font-size: 0.9em; margin-right: 6px; }
.hint { color: var(--muted); font-size: 0.85em; margin-top: 6px; }

.stat-big { font-size: 1.8em; font-weight: 700; margin: 6px 0 0; color: var(--accent); }
.stat-cards .card { flex: 1; text-align: center; }
.stat-cards { display: flex; gap: 16px; margin-bottom: 20px; }


.global-outage-banner {
  margin: 0 0 16px 0;
  padding: 12px 20px;
  background: rgba(241, 196, 15, 0.15);
  border: 1px solid rgba(241, 196, 15, 0.5);
  color: #b8860b;
  font-weight: 600;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.global-outage-banner .muted {
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--muted);
}


.build-footer {
  margin-top: 32px;
  padding-top: 12px;
  border-top: 1px solid var(--border, rgba(0,0,0,0.08));
  font-size: 0.75rem;
  color: var(--muted, #888);
  text-align: right;
}
.status-public .build-footer {
  text-align: center;
  margin-top: 20px;
}


/* ---- Add/Edit client form upgrade (sectioned layout, port presets, email chips) ---- */
.form-section-title {
  font-weight: 700; font-size: 1.05em; margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px; color: var(--text);
}
.form-section { margin-bottom: 20px; }
.form-actions { display: flex; align-items: center; gap: 16px; margin-top: 10px; margin-bottom: 40px; }

.port-row { display: flex; gap: 10px; align-items: center; }
.port-row select { flex: 0 0 200px; }
.port-row input[type=number] { flex: 1; }

.chip-input {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel-alt);
  padding: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 44px;
}
.chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.email-chip {
  background: rgba(91,140,255,0.15); color: var(--accent); border-radius: 20px;
  padding: 4px 6px 4px 12px; font-size: 0.9em; display: inline-flex; align-items: center; gap: 6px;
}
.email-chip button {
  background: none; border: none; color: var(--accent); cursor: pointer; font-size: 1.1em;
  line-height: 1; padding: 0 4px;
}
.email-chip button:hover { color: var(--red); }
#chip-text-input {
  border: none; background: transparent; color: var(--text); outline: none; flex: 1;
  min-width: 160px; font-size: 1em; padding: 6px;
}
.chip-input-error { outline: 1px solid var(--red) !important; }

.flash-warning { background: rgba(241,196,15,0.15); color: var(--yellow); }


/* ---- Impersonation / "View as support" (Stage 3) ---- */
.impersonation-banner {
  margin: 0 0 16px 0;
  padding: 12px 20px;
  background: rgba(155, 89, 182, 0.15);
  border: 1px solid rgba(155, 89, 182, 0.5);
  color: #8e44ad;
  font-weight: 600;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.impersonation-banner form { margin: 0; }
.impersonation-banner button {
  background: #8e44ad; color: #fff; border: none; border-radius: var(--radius);
  padding: 6px 14px; cursor: pointer; font-weight: 600; font-size: 0.9em;
}
.impersonation-banner button:hover { background: #76448a; }

.org-grid { display: flex; flex-direction: column; gap: 12px; }
.org-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.org-card .org-name { font-weight: 700; font-size: 1.05em; }
.org-card .org-meta { color: var(--muted); font-size: 0.85em; margin-top: 2px; }
.org-card .org-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.badge-suspended { background: rgba(231,76,60,0.15); color: var(--red); }
.badge-active { background: rgba(46,204,113,0.15); color: var(--green); }
.badge-pending { background: rgba(241,196,15,0.15); color: var(--yellow); }

.request-access-form { display: flex; gap: 8px; align-items: center; }
.request-access-form input[type=text] {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 10px;
  background: var(--panel-alt); color: var(--text); font-size: 0.9em; min-width: 220px;
}
.btn-small { padding: 6px 12px; font-size: 0.85em; border-radius: var(--radius); border: none; cursor: pointer; font-weight: 600; }
.btn-small.btn-danger { background: rgba(231,76,60,0.15); color: var(--red); }
.btn-small.btn-danger:hover { background: rgba(231,76,60,0.3); }
.btn-small.btn-success { background: rgba(46,204,113,0.15); color: var(--green); }
.btn-small.btn-success:hover { background: rgba(46,204,113,0.3); }
.btn-small.btn-accent { background: rgba(91,140,255,0.15); color: var(--accent); }
.btn-small.btn-accent:hover { background: rgba(91,140,255,0.3); }

.revoke-support-banner {
  margin: 0 0 16px 0; padding: 12px 20px; background: rgba(46,204,113,0.1);
  border: 1px solid rgba(46,204,113,0.4); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}


/* ===================== Marketing landing page ===================== */
.marketing-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 40px; border-bottom: 1px solid var(--border);
}
.marketing-nav .brand { font-size: 1.25em; font-weight: 700; padding: 0; }
.marketing-nav .nav-actions { display: flex; gap: 10px; align-items: center; }
.btn-ghost {
  color: var(--text); border: 1px solid var(--border); padding: 9px 16px;
  border-radius: var(--radius); font-size: 0.95em; display: inline-block;
}
.btn-ghost:hover { background: var(--panel-alt); text-decoration: none; }

.hero {
  max-width: 880px; margin: 0 auto; text-align: center; padding: 90px 20px 60px;
}
.hero .eyebrow {
  display: inline-block; color: var(--accent); background: rgba(91,140,255,0.12);
  padding: 6px 14px; border-radius: 20px; font-size: 0.85em; font-weight: 600; margin-bottom: 20px;
}
.hero h1 { font-size: 2.6em; line-height: 1.2; margin: 0 0 18px; }
.hero h1 span { color: var(--accent); }
.hero p.subhead { color: var(--muted); font-size: 1.15em; max-width: 620px; margin: 0 auto 32px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; margin-bottom: 14px; }
.btn-primary-lg { padding: 14px 28px; font-size: 1.05em; }
.hero .hint { font-size: 0.85em; color: var(--muted); }

.feature-grid {
  max-width: 1080px; margin: 60px auto; padding: 0 20px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px;
}
.feature-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; text-align: left;
}
.feature-card .icon { font-size: 1.8em; margin-bottom: 10px; display: block; }
.feature-card h3 { margin: 0 0 8px; font-size: 1.05em; }
.feature-card p { margin: 0; color: var(--muted); font-size: 0.92em; line-height: 1.5; }

.pricing-section { max-width: 920px; margin: 80px auto; padding: 0 20px; text-align: center; }
.pricing-section h2 { font-size: 1.9em; margin-bottom: 6px; }
.pricing-section .subtitle { color: var(--muted); margin-bottom: 40px; }
.pricing-cards { display: flex; gap: 24px; justify-content: center; flex-wrap: wrap; }
.pricing-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 34px 30px; width: 280px; text-align: left; position: relative;
}
.pricing-card.featured { border-color: var(--accent); background: var(--panel-alt); }
.pricing-badge {
  position: absolute; top: -12px; right: 20px; background: var(--accent); color: #fff;
  font-size: 0.75em; font-weight: 700; padding: 4px 12px; border-radius: 20px;
}
.pricing-card .plan-name { color: var(--muted); font-size: 0.9em; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 10px; }
.pricing-card .plan-price { font-size: 2.2em; font-weight: 700; margin-bottom: 4px; }
.pricing-card .plan-price .period { font-size: 0.45em; color: var(--muted); font-weight: 500; }
.pricing-card .plan-note { color: var(--green); font-size: 0.88em; margin-bottom: 18px; min-height: 1.3em; }
.pricing-card ul { list-style: none; padding: 0; margin: 0 0 24px; }
.pricing-card ul li { padding: 6px 0; font-size: 0.92em; color: var(--text); }
.pricing-card ul li:before { content: "✓ "; color: var(--green); font-weight: 700; }
.pricing-card .btn-primary, .pricing-card .btn-ghost { width: 100%; text-align: center; }

.cta-band {
  max-width: 760px; margin: 0 auto 80px; padding: 46px 30px; text-align: center;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
}
.cta-band h2 { margin: 0 0 10px; font-size: 1.5em; }
.cta-band p { color: var(--muted); margin: 0 0 22px; }

.marketing-footer {
  text-align: center; padding: 26px; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.85em;
}
