/* Red and black theme. One dark palette for every page. */
:root {
  --bg: #070707;
  --bg-raised: #0d0d0d;
  --surface: #121212;
  --surface-2: #181818;
  --surface-3: #202020;
  --border: #262626;
  --border-strong: #3a3a3a;
  --text: #f5f5f5;
  --muted: #a1a1a1;
  --faint: #6b6b6b;
  --red: #ef233c;
  --red-strong: #d90429;
  --red-deep: #7f0a17;
  --red-soft: rgba(239, 35, 60, 0.12);
  --red-glow: rgba(239, 35, 60, 0.35);
  --ring: rgba(239, 35, 60, 0.45);
  --ok: #22c55e;
  --ok-soft: rgba(34, 197, 94, 0.12);
  --warning: #f59e0b;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 18px 40px rgba(0, 0, 0, 0.5);
  --radius: 14px;
  --sidebar: 264px;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

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

h1,
h2,
h3,
p {
  margin: 0;
}

a {
  color: inherit;
}

code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
}

[hidden] {
  display: none !important;
}

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

.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
}

/* Icons: SVG masks, so they take the text colour ---------------------------- */

.icon {
  display: inline-block;
  flex: none;
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}

.icon-dashboard {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='9' rx='1'/%3E%3Crect x='14' y='3' width='7' height='5' rx='1'/%3E%3Crect x='14' y='12' width='7' height='9' rx='1'/%3E%3Crect x='3' y='16' width='7' height='5' rx='1'/%3E%3C/svg%3E");
}

.icon-server {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='3' width='20' height='8' rx='2'/%3E%3Crect x='2' y='13' width='20' height='8' rx='2'/%3E%3Cpath d='M6 7h.01M6 17h.01'/%3E%3C/svg%3E");
}

.icon-plus {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E");
}

.icon-logout {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/%3E%3Cpath d='m16 17 5-5-5-5'/%3E%3Cpath d='M21 12H9'/%3E%3C/svg%3E");
}

.icon-menu {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 6h16M4 12h16M4 18h16'/%3E%3C/svg%3E");
}

/* Brand ------------------------------------------------------------------ */

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 16px;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--red), var(--red-deep));
  color: #fff;
  font-weight: 900;
  box-shadow: 0 6px 18px var(--red-glow);
}

/* Buttons ----------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.05s;
}

.btn:active {
  transform: translateY(1px);
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--red), var(--red-strong));
  color: #fff;
  box-shadow: 0 8px 22px rgba(217, 4, 41, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #ff3b52, var(--red));
}

.btn-secondary {
  border-color: var(--border-strong);
  background: var(--surface-3);
  color: var(--text);
}

.btn-secondary:hover {
  border-color: var(--red);
}

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

.btn-ghost:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.btn-danger {
  border-color: rgba(239, 35, 60, 0.4);
  background: transparent;
  color: var(--red);
}

.btn-danger:hover {
  background: var(--red-soft);
  border-color: var(--red);
}

.btn-block {
  width: 100%;
}

.btn[aria-busy="true"] {
  opacity: 0.75;
  cursor: progress;
}

.btn[aria-busy="true"]::before {
  content: "";
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* Alerts ------------------------------------------------------------------ */

.alert {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: 10px;
  background: var(--surface);
  font-size: 14px;
  animation: rise 0.25s ease-out both;
}

.alert-error {
  border-color: rgba(239, 35, 60, 0.45);
  border-left-color: var(--red);
  background: var(--red-soft);
  color: #ff8a98;
}

.alert-success {
  border-color: rgba(34, 197, 94, 0.35);
  border-left-color: var(--ok);
  background: var(--ok-soft);
  color: #86efac;
}

.alert-info {
  border-left-color: var(--muted);
  color: var(--text);
}

/* Form fields ------------------------------------------------------------- */

.field {
  display: grid;
  gap: 7px;
}

.field label {
  font-size: 13px;
  font-weight: 650;
}

.field input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-raised);
  color: var(--text);
  font: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input::placeholder {
  color: var(--faint);
}

.field input:hover {
  border-color: var(--border-strong);
}

.field input:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 4px var(--ring);
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 76px;
}

.reveal {
  position: absolute;
  top: 50%;
  right: 6px;
  height: 32px;
  padding: 0 12px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--red);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.reveal:hover {
  background: var(--red-soft);
}

.reveal:focus-visible {
  outline: 2px solid var(--red);
}

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

.hint-warning {
  color: var(--warning);
  font-weight: 650;
}

/* Sign-in page ------------------------------------------------------------ */

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

.auth-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
  padding: 48px 56px;
  overflow: hidden;
  border-right: 1px solid var(--border);
  background:
    radial-gradient(circle at 18% 22%, rgba(239, 35, 60, 0.35), transparent 42%),
    radial-gradient(circle at 90% 85%, rgba(127, 10, 23, 0.55), transparent 48%),
    linear-gradient(160deg, #0b0b0b, #000);
}

.auth-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 36px 36px;
  -webkit-mask-image: radial-gradient(circle at 30% 40%, #000, transparent 75%);
  mask-image: radial-gradient(circle at 30% 40%, #000, transparent 75%);
  pointer-events: none;
}

.auth-brand > * {
  position: relative;
}

.brand-copy {
  max-width: 460px;
}

.brand-copy h1 {
  margin: 12px 0 14px;
  font-size: clamp(28px, 3.2vw, 42px);
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.brand-copy p {
  font-size: 16px;
  color: var(--muted);
}

.brand-points {
  display: grid;
  gap: 12px;
  max-width: 460px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.brand-points li {
  position: relative;
  padding: 12px 14px 12px 42px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 14px;
}

.brand-points li::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 16px;
  width: 10px;
  height: 10px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 4px var(--red-soft), 0 0 14px var(--red-glow);
}

.brand-foot {
  font-size: 13px;
  color: var(--faint);
}

.auth-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 48px 24px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 36px;
  border: 1px solid var(--border);
  border-top: 3px solid var(--red);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: rise 0.4s ease-out both;
}

.auth-card h2 {
  font-size: 26px;
  letter-spacing: -0.015em;
}

.auth-card > .muted {
  margin: 6px 0 24px;
}

.auth-card .alert {
  margin-bottom: 18px;
}

.brand-compact {
  display: none;
  margin-bottom: 24px;
}

.auth-form {
  display: grid;
  gap: 18px;
}

.auth-form .btn-primary {
  width: 100%;
  height: 46px;
  margin-top: 4px;
}

.auth-help {
  margin-top: 22px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

.auth-legal {
  font-size: 12px;
  color: var(--faint);
}

/* App shell: sidebar + content -------------------------------------------- */

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, #0c0c0c, #050505);
}

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

.sidebar-nav {
  display: grid;
  align-content: start;
  gap: 2px;
  flex: 1;
  padding: 14px 12px;
  overflow-y: auto;
}

.nav-section {
  padding: 14px 12px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.nav-link:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-link:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: -2px;
}

.nav-link.is-active {
  background: linear-gradient(90deg, var(--red-soft), transparent);
  color: #fff;
}

.nav-link.is-active::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: -12px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--red);
  box-shadow: 0 0 12px var(--red-glow);
}

.nav-link.is-active .icon {
  color: var(--red);
}

.nav-count {
  margin-left: auto;
  min-width: 24px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text);
  font-size: 12px;
  text-align: center;
}

.sidebar-foot {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-top: 1px solid var(--border);
}

.sidebar-foot form {
  margin: 0;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(239, 35, 60, 0.4);
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red);
  font-weight: 800;
}

.user-meta {
  display: grid;
  min-width: 0;
  line-height: 1.3;
}

.user-meta strong,
.user-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-meta span {
  font-size: 12px;
  color: var(--muted);
}

.app-content {
  min-width: 0;
}

.mobile-bar,
.sidebar-backdrop {
  display: none;
}

.app-main {
  display: grid;
  gap: 24px;
  max-width: 1180px;
  padding: 36px 40px 64px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.page-head h1 {
  margin: 6px 0;
  font-size: 30px;
  letter-spacing: -0.025em;
}

.back-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}

.back-link:hover {
  color: var(--red);
}

/* Cards ------------------------------------------------------------------- */

.panel,
.stat {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel {
  padding: 24px;
}

.panel h2 {
  font-size: 17px;
}

.panel-head {
  margin-bottom: 14px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
}

.stat {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 20px;
  overflow: hidden;
  text-decoration: none;
}

.stat::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--border-strong), transparent);
}

.stat-link {
  transition: border-color 0.15s, transform 0.15s;
}

.stat-link:hover {
  border-color: var(--red);
  transform: translateY(-2px);
}

.stat-link::after,
.stat-alert::after {
  background: linear-gradient(90deg, var(--red), transparent);
}

.stat-ok::after {
  background: linear-gradient(90deg, var(--ok), transparent);
}

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

.stat-value {
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.stat-alert .stat-value {
  color: var(--red);
}

.stat-foot {
  font-size: 12px;
  color: var(--faint);
}

.stat-grid-compact .stat {
  padding: 16px 20px;
}

.stat-grid-compact .stat-value {
  font-size: 24px;
}

/* Activity list ----------------------------------------------------------- */

.activity {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.activity-item {
  display: grid;
  grid-template-columns: 12px minmax(120px, 1fr) minmax(120px, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 4px;
  border-top: 1px solid var(--border);
  font-size: 14px;
}

.activity-item:first-child {
  border-top: 0;
}

.activity-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ok);
}

.is-failed .activity-dot {
  background: var(--red);
  box-shadow: 0 0 10px var(--red-glow);
}

.is-failed .activity-label {
  color: var(--red);
}

.activity-ip {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 13px;
  color: var(--muted);
}

.activity-when {
  color: var(--muted);
  text-align: right;
}

/* Servers ------------------------------------------------------------------ */

.server-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.server-card {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: border-color 0.15s;
  animation: rise 0.3s ease-out both;
}

.server-card:hover {
  border-color: var(--border-strong);
}

.server-card.is-failed {
  border-color: rgba(239, 35, 60, 0.45);
}

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

.server-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.server-identity h3 {
  font-size: 16px;
}

.server-icon,
.empty-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface-3);
  color: var(--red);
}

.server-address {
  font-size: 13px;
  color: var(--muted);
  word-break: break-all;
}

.status-pill {
  flex: none;
  padding: 3px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.status-pill.is-online {
  border-color: rgba(34, 197, 94, 0.4);
  background: var(--ok-soft);
  color: var(--ok);
}

.status-pill.is-failed {
  border-color: rgba(239, 35, 60, 0.5);
  background: var(--red-soft);
  color: var(--red);
}

.server-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-raised);
  font-size: 12px;
  color: var(--muted);
}

.tag.panel-cpanel,
.tag.panel-plesk {
  border-color: rgba(239, 35, 60, 0.35);
  color: #ff8a98;
}

.server-message {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--red-soft);
  color: #ff8a98;
  font-size: 13px;
}

.server-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.server-actions form {
  margin: 0;
}

.server-actions .btn {
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
}

.server-actions form:last-child {
  margin-left: auto;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 56px 24px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: radial-gradient(circle at 50% 0%, var(--red-soft), transparent 60%), var(--surface);
  text-align: center;
}

.empty-state .empty-icon {
  width: 56px;
  height: 56px;
  margin-bottom: 6px;
  border-radius: 14px;
}

.empty-state .empty-icon .icon {
  width: 26px;
  height: 26px;
}

.empty-state p {
  max-width: 420px;
  margin-bottom: 8px;
}

/* Server form --------------------------------------------------------------- */

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

.server-form {
  display: grid;
  gap: 28px;
}

.form-section {
  display: grid;
  gap: 16px;
}

.form-section h2 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.field-row {
  display: flex;
  gap: 14px;
}

.field-grow {
  flex: 1;
}

.field-port {
  width: 120px;
}

.panel-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.choice,
.check {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-raised);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.choice:hover,
.check:hover {
  border-color: var(--border-strong);
}

.choice:has(input:checked) {
  border-color: var(--red);
  background: var(--red-soft);
  box-shadow: 0 0 0 1px var(--red) inset;
}

.choice:has(input:focus-visible),
.check:has(input:focus-visible) {
  box-shadow: 0 0 0 4px var(--ring);
}

.choice input,
.check input {
  margin: 3px 0 0;
  accent-color: var(--red);
}

.choice-body,
.check-body {
  display: grid;
  gap: 2px;
}

.choice-body span,
.check-body span {
  font-size: 13px;
  color: var(--muted);
}

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

.help-panel {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 18px;
}

.help-block {
  display: grid;
  gap: 8px;
}

.help-block h3 {
  font-size: 14px;
  color: var(--red);
}

.help-block ol {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--muted);
}

/* Motion ------------------------------------------------------------------ */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Responsive -------------------------------------------------------------- */

@media (max-width: 1100px) {
  .form-layout {
    grid-template-columns: 1fr;
  }

  .help-panel {
    position: static;
  }
}

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

  .auth-brand {
    display: none;
  }

  .brand-compact {
    display: flex;
  }

  .auth-panel {
    min-height: 100vh;
    padding: 32px 16px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    z-index: 40;
    top: 0;
    left: 0;
    width: min(var(--sidebar), 84vw);
    transform: translateX(-100%);
    transition: transform 0.22s ease;
  }

  .nav-open .sidebar {
    transform: none;
    box-shadow: 20px 0 60px rgba(0, 0, 0, 0.6);
  }

  .nav-open .sidebar-backdrop {
    position: fixed;
    z-index: 30;
    inset: 0;
    display: block;
    background: rgba(0, 0, 0, 0.6);
  }

  .mobile-bar {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: rgba(7, 7, 7, 0.9);
    backdrop-filter: blur(10px);
  }

  .menu-toggle {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
  }

  .app-main {
    padding: 24px 16px 48px;
  }
}

@media (max-width: 560px) {
  .auth-card {
    padding: 26px 20px;
  }

  .panel {
    padding: 18px;
  }

  .page-head h1 {
    font-size: 24px;
  }

  .server-list {
    grid-template-columns: 1fr;
  }

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

  .field-row {
    flex-direction: column;
  }

  .field-port {
    width: 100%;
  }

  .activity-item {
    grid-template-columns: 12px 1fr;
    gap: 4px 12px;
  }

  .activity-ip,
  .activity-when {
    grid-column: 2;
    text-align: left;
  }
}
.security-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.security-checks { display:grid; gap:12px; margin:20px 0; }
.security-actions { display:flex; flex-wrap:wrap; gap:12px; margin:18px 0; }
.app-main > .panel { margin-bottom:24px; }
.security-settings select,.security-settings textarea { width:100%; padding:12px; border:1px solid var(--border); background:var(--surface); color:var(--text); border-radius:8px; font:inherit; }
.security-settings summary { cursor:pointer; font-weight:700; margin:18px 0; }
.account-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:12px; max-height:400px; overflow:auto; }
.account-item { display:flex; flex-direction:column; padding:12px; border:1px solid var(--border); border-radius:8px; }
.table-scroll { overflow-x:auto; }
.security-table { width:100%; border-collapse:collapse; text-align:left; font-size:13px; }
.security-table .table-row { display:grid; grid-template-columns:60px 100px 90px 100px 80px 100px 100px; min-width:650px; }
.security-table.accounts-table .table-row { grid-template-columns:1fr 1.5fr 1fr 110px; }
.security-table .table-cell,.security-table .table-heading { padding:12px; border-bottom:1px solid var(--border); }
.security-table .table-heading { font-weight:700; }
.security-table a { color:#ff516d; }
.path-cell { overflow-wrap:anywhere; word-break:break-word; }
.terminal-output { display:block; padding:18px; background:#050806; color:#91f2b5; border:1px solid var(--border); border-radius:8px; white-space:pre-wrap; overflow-wrap:anywhere; max-height:480px; overflow:auto; }
.findings-list { display:grid; gap:12px; }
.finding { display:grid; gap:8px; padding:16px; border:1px solid var(--border); border-radius:10px; }
.severity { width:max-content; border-radius:5px; padding:3px 8px; text-transform:uppercase; font-size:11px; font-weight:700; background:#333; }
.severity-critical,.severity-high { color:#ff8b9e; background:#45101a; }
.severity-medium { color:#f7cd82; background:#403114; }
.severity-info { color:#a9cfff; background:#162a41; }
@media(max-width:680px) { .security-grid { grid-template-columns:1fr; } .server-actions { flex-wrap:wrap; } }
.server-nav-group { margin:8px 12px 14px; padding:12px 0 0 12px; border-left:1px solid var(--border); }
.server-nav-title { display:block; margin-bottom:8px; color:var(--text); font-weight:600; font-size:12px; overflow-wrap:anywhere; }
.server-nav-link { display:block; padding:7px 0; font-size:12px; color:var(--muted); text-decoration:none; }
.server-nav-link:hover { color:#ff516d; }
.sidebar-nav { overflow-y:auto; min-height:0; }
.workspace-tabs { display:flex; gap:6px; flex-wrap:wrap; padding:6px; margin-bottom:24px; border:1px solid var(--border); border-radius:12px; background:var(--surface); }
.tab { padding:10px 15px; color:var(--muted); text-decoration:none; border-radius:8px; font-size:13px; }
.tab.is-active,.tab:hover { color:#fff; background:#681326; }
.account-filters { display:grid; grid-template-columns:1fr 2fr 1fr auto; gap:14px; align-items:end; }
.account-filters select { width:100%; padding:12px; border:1px solid var(--border); border-radius:8px; background:var(--surface); color:var(--text); font:inherit; }
.account-filters .field { margin-bottom:0; }
.list-heading { display:flex; justify-content:space-between; align-items:center; gap:16px; margin:24px 0 16px; }
.accounts-list { display:grid; gap:14px; }
.account-card { padding:20px; border:1px solid var(--border); border-radius:12px; background:rgba(255,255,255,.015); }
.account-primary { display:flex; align-items:center; gap:14px; }
.account-primary h3 { margin:0 0 5px; font-size:16px; overflow-wrap:anywhere; }
.account-primary .status-pill { margin-left:auto; }
.account-primary code { font-size:12px; color:var(--muted); }
.account-avatar { display:grid; place-items:center; width:42px; height:42px; flex-shrink:0; color:#ff516d; background:#301019; border:1px solid #692335; border-radius:11px; font-weight:700; }
.account-metadata { display:flex; flex-wrap:wrap; gap:10px 22px; margin:18px 0; color:var(--muted); font-size:12px; }
.account-card .security-actions { margin-bottom:0; }
.reports-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(300px,1fr)); gap:20px; }
.report-card .list-heading { margin-top:0; }
@media(max-width:850px) { .account-filters { grid-template-columns:1fr 1fr; } }
@media(max-width:560px) { .account-filters { grid-template-columns:1fr; } .account-primary { flex-wrap:wrap; } .account-card { padding:14px; } }
/* Interior workspace layout shared by every authenticated page. */
:root { --sidebar:248px; --bg:#090a0d; --surface:#121419; --surface-2:#191c23; --border:#272b34; --muted:#a2a8b5; --shadow:0 8px 24px rgba(0,0,0,.14); }
.app-body { background:radial-gradient(ellipse at 85% 0,rgba(153,31,54,.055),transparent 48%),var(--bg); }
.app-main { max-width:1560px; width:100%; margin:0 auto; padding:28px 36px 64px; gap:22px; grid-template-columns:minmax(0,1fr); }
.app-main > * { min-width:0; }
.workspace-topbar { display:flex; justify-content:space-between; align-items:center; min-height:56px; padding:0 36px; border-bottom:1px solid var(--border); background:rgba(18,20,25,.5); }
.console-label { font-size:12px; color:var(--muted); letter-spacing:.04em; }
.workspace-private { display:flex; align-items:center; gap:8px; font-size:11px; color:var(--muted); }
.workspace-private::before { content:""; width:6px; height:6px; border-radius:50%; background:#63d79a; }
.page-head { padding:6px 0 4px; align-items:center; }
.page-head h1 { font-size:32px; font-weight:700; letter-spacing:-.035em; margin:6px 0 9px; }
.page-head p { max-width:740px; font-size:13px; line-height:1.7; margin:0; }
.eyebrow { font-size:10px; letter-spacing:.13em; }
.panel,.stat,.server-card { background:linear-gradient(145deg,rgba(255,255,255,.016),transparent),var(--surface); box-shadow:var(--shadow); border-color:var(--border); }
.app-main > .panel { margin-bottom:0; }
.panel { padding:24px; }
.panel h2 { font-size:17px; letter-spacing:-.02em; margin:0 0 12px; }
.panel h3 { font-size:14px; }
.panel p { line-height:1.7; }
.stat-grid { gap:16px; }
.stat { padding:20px 22px; min-height:110px; border-top:1px solid var(--border); }
.stat-value { font-size:30px; letter-spacing:-.04em; margin-top:10px; }
.stat-label { font-size:12px; }
.stat-foot { margin-top:10px; font-size:11px; }
.stat-ok { border-top:2px solid #278356; }
.stat-alert { border-top:2px solid #8f2941; }
.btn { min-height:38px; padding:10px 15px; font-size:12px; border-radius:8px; box-shadow:none; }
.btn-primary { box-shadow:0 4px 12px rgba(217,4,41,.14); }
.btn-ghost { background:transparent; }
.btn:hover { transform:translateY(-1px); }
.server-list { grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; }
.server-card { padding:24px; border-radius:14px; }
.server-top { align-items:flex-start; gap:14px; }
.server-identity,.server-identity > div { min-width:0; }
.server-identity h3 { font-size:17px; margin:0 0 7px; }
.server-address { display:block; font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:100%; }
.server-icon { width:46px; height:46px; background:rgba(239,35,60,.08); border-color:rgba(239,35,60,.18); }
.server-tags { gap:7px; margin:20px 0; }
.tag { padding:5px 8px; font-size:10px; background:rgba(0,0,0,.12); }
.server-actions { display:flex; flex-wrap:wrap; justify-content:flex-start; gap:8px; padding-top:18px; border-color:var(--border); }
.server-actions form:last-child { margin-left:auto; }
.status-pill { white-space:nowrap; font-size:10px; font-weight:600; letter-spacing:.015em; }
.sidebar { background:#0d0f13; border-color:var(--border); }
.sidebar-head { padding:20px 18px; }
.brand-name { font-size:13px; letter-spacing:-.025em; }
.sidebar-nav { padding:12px 10px; }
.nav-section { font-size:9px; padding-left:12px; letter-spacing:.13em; }
.nav-link { font-size:12px; padding:12px; margin:3px 0; border-radius:8px; }
.server-nav-group { padding-left:12px; margin:10px 12px 17px; }
.server-nav-title { color:#d8dce5; font-size:11px; }
.server-nav-link { font-size:11px; text-decoration:none; line-height:1.5; }
.server-nav-link.is-current { color:#ff8b9b; font-weight:600; }
.sidebar-foot { padding:16px 14px; }
.workspace-tabs { margin-bottom:0; padding:5px; width:max-content; max-width:100%; gap:4px; background:rgba(18,20,25,.85); }
.tab { font-size:12px; padding:10px 15px; }
.tab.is-active { background:rgba(239,35,60,.14); color:#ff8b9b; }
.account-filters { padding-bottom:22px; border-bottom:1px solid var(--border); gap:16px; }
.field label { font-size:11px; color:#c9ced8; margin-bottom:8px; }
input,select,textarea,.account-filters select,.security-settings select,.security-settings textarea { background:#0d0f14; border-color:#303540; border-radius:8px; color:var(--text); font-size:12px; min-height:42px; }
input:focus,select:focus,textarea:focus { outline:2px solid rgba(239,35,60,.35); outline-offset:2px; }
.list-heading { margin-top:22px; }
.list-heading h2 { margin-bottom:6px; }
.hint { font-size:11px; line-height:1.7; color:#929baa; }
.accounts-list { gap:0; }
.account-card { border:0; border-bottom:1px solid var(--border); border-radius:0; padding:20px 0; background:none; }
.account-card:last-child { border-bottom:0; }
.account-primary h3 { font-size:15px; font-weight:600; }
.account-avatar { width:38px; height:38px; border-radius:9px; background:#24151d; }
.account-metadata { margin:13px 0; font-size:11px; }
.account-card .security-actions { margin:12px 0 0 52px; gap:8px; }
.account-card .btn { min-height:32px; padding:8px 12px; font-size:11px; }
.pagination { display:flex; justify-content:space-between; align-items:center; gap:16px; border-top:1px solid var(--border); margin-top:12px; padding-top:16px; }
.pagination .security-actions { margin:0; }
.report-toolbar { display:flex; justify-content:space-between; align-items:end; gap:20px; }
.report-toolbar .field { width:360px; max-width:100%; margin:0; }
.reports-grid { grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; }
.report-card { margin-bottom:0; }
.report-card .list-heading { margin:0 0 16px; align-items:flex-start; }
.report-metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; padding:18px 0; margin:18px 0 12px; border-top:1px solid var(--border); border-bottom:1px solid var(--border); }
.report-metrics > div { display:flex; flex-direction:column; gap:7px; }
.report-metrics strong { font-size:19px; font-weight:600; overflow-wrap:anywhere; }
.report-metrics span { color:var(--muted); font-size:10px; }
.scan-status-queued,.scan-status-running { color:#f4ce86; border-color:#684a20; background:#2d2314; }
.scan-status-completed { color:#72dea0; border-color:#225b3a; background:#13291d; }
.scan-status-failed,.scan-status-partial { color:#ff93a4; border-color:#743143; background:#311923; }
.section-jumps { display:flex; gap:8px; flex-wrap:wrap; }
.section-jumps a { color:var(--muted); font-size:11px; text-decoration:none; padding:8px 12px; border:1px solid var(--border); border-radius:7px; }
.section-jumps a:hover { color:#fff; background:var(--surface-2); }
[id] { scroll-margin-top:20px; }
.security-intro { border-left:3px solid #8b2437; }
.security-grid { gap:20px; }
.security-settings .form-section { border-top:1px solid var(--border); margin-top:26px; padding-top:24px; }
.security-settings .check { padding:10px 12px; background:#101218; border:1px solid var(--border); border-radius:8px; }
.security-checks { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.security-table .table-heading { color:var(--muted); font-size:10px; text-transform:uppercase; letter-spacing:.05em; background:#101218; }
.security-table .table-cell { font-size:12px; padding:15px 12px; }
.finding { background:#101218; padding:18px; }
.finding code { font-size:11px; color:#c3cbd8; }
.app-main p,.app-main .alert,.finding strong { overflow-wrap:anywhere; }
.findings-list,.finding { min-width:0; }
.table-scroll { max-width:100%; min-width:0; }
.form-layout { align-items:start; gap:24px; }
.help-panel { position:sticky; top:24px; }
.help-panel li { margin-bottom:10px; line-height:1.7; font-size:12px; color:var(--muted); }
.alert { font-size:12px; line-height:1.7; border-radius:9px; }
@media(min-width:1650px) { .account-card { display:grid; grid-template-columns:minmax(240px,1fr) minmax(220px,1fr); gap:0 20px; } .account-card .account-metadata { align-content:center; margin:0; } .account-card .security-actions { grid-column:1/-1; } }
@media(max-width:1100px) { .server-list,.reports-grid { grid-template-columns:1fr; } .server-actions form:last-child { margin-left:0; } }
@media(max-width:900px) { .workspace-topbar { display:none; } .app-main { padding:24px 20px 48px; } .mobile-bar { background:#0d0f13; } }
@media(max-width:600px) { .app-main { padding:20px 14px 40px; gap:18px; } .page-head h1 { font-size:27px; } .panel,.server-card { padding:18px; } .stat { padding:17px 18px; min-height:95px; } .stat-value { font-size:27px; } .security-checks { grid-template-columns:1fr; } .account-card .security-actions { margin-left:0; } .workspace-tabs { width:100%; } .tab { padding:9px 11px; font-size:11px; } .report-toolbar,.pagination { align-items:stretch; flex-direction:column; } .report-toolbar .field { width:100%; } .report-metrics { gap:10px; } .report-metrics strong { font-size:16px; } .help-panel { position:static; } .server-top { flex-wrap:wrap; } }
.topbar-controls { display:flex; gap:20px; align-items:center; }
.theme-toggle { color:var(--text); background:var(--surface); border:1px solid var(--border); min-height:32px; font-size:11px; cursor:pointer; }
.auth-theme-toggle { position:fixed; top:20px; right:20px; z-index:50; }
.mobile-bar .brand { min-width:0; flex:1; }
.mobile-bar .brand-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mobile-bar .theme-toggle { flex-shrink:0; padding:8px 10px; }
html[data-theme="light"] { --bg:#f4f6fa; --bg-raised:#fff; --surface:#fff; --surface-2:#f0f2f7; --surface-3:#e9edf4; --border:#dfe4ed; --border-strong:#c6cedb; --text:#1d2636; --muted:#606d80; --faint:#7b8798; --red:#d51f3b; --red-strong:#bf1733; --red-soft:rgba(213,31,59,.07); --shadow:0 4px 18px rgba(26,43,72,.045); color-scheme:light; }
html[data-theme="light"] .app-body { background:radial-gradient(ellipse at 90% 0,rgba(217,31,59,.035),transparent 45%),var(--bg); }
html[data-theme="light"] .sidebar,html[data-theme="light"] .mobile-bar { background:#fff; }
html[data-theme="light"] .workspace-topbar { background:rgba(255,255,255,.8); }
html[data-theme="light"] .panel,html[data-theme="light"] .stat,html[data-theme="light"] .server-card { background:#fff; }
html[data-theme="light"] .nav-link.is-active { background:#fff0f3; color:#b81934; }
html[data-theme="light"] .server-nav-title { color:#344157; }
html[data-theme="light"] .server-nav-link.is-current { color:#bc1c37; }
html[data-theme="light"] .workspace-tabs { background:#fff; }
html[data-theme="light"] .tab.is-active { background:#fff0f3; color:#b81934; }
html[data-theme="light"] .tab:hover { background:#f2f4f8; color:#26354c; }
html[data-theme="light"] input,html[data-theme="light"] select,html[data-theme="light"] textarea { background:#fff; color:#1d2636; border-color:#cdd5e1; }
html[data-theme="light"] input::placeholder,html[data-theme="light"] textarea::placeholder { color:#8993a3; }
html[data-theme="light"] .field label { color:#43516a; }
html[data-theme="light"] .btn-secondary,html[data-theme="light"] .btn-ghost { background:#fff; color:#3e4c63; border-color:#d3dae5; }
html[data-theme="light"] .btn-secondary:hover,html[data-theme="light"] .btn-ghost:hover { background:#f1f4f8; border-color:#b4bfd0; }
html[data-theme="light"] .btn-primary { color:#fff; }
html[data-theme="light"] .btn-danger { background:#fff8f9; color:#c3223e; border-color:#efc5ce; }
html[data-theme="light"] .tag { background:#f7f8fb; color:#536178; }
html[data-theme="light"] .panel-cpanel { color:#b41c36; border-color:#ebbdc7; }
html[data-theme="light"] .status-pill.is-online { color:#167249; border-color:#b5dec9; background:#edf9f2; }
html[data-theme="light"] .status-pill.is-failed { color:#a8233d; border-color:#f0bdc8; background:#fff0f3; }
html[data-theme="light"] .account-avatar { color:#c1223e; background:#fff2f5; border-color:#f1c9d2; }
html[data-theme="light"] .security-settings .check,html[data-theme="light"] .finding,html[data-theme="light"] .security-table .table-heading { background:#f7f9fc; }
html[data-theme="light"] .finding code { color:#42536d; }
html[data-theme="light"] .hint { color:#66758b; }
html[data-theme="light"] .section-jumps a:hover { background:#eaf0f8; color:#2c3f5a; }
html[data-theme="light"] .scan-status-queued,html[data-theme="light"] .scan-status-running { background:#fff7e7; color:#896111; border-color:#eddaaa; }
html[data-theme="light"] .scan-status-completed { background:#eaf8f0; color:#176f45; border-color:#b7dec9; }
html[data-theme="light"] .scan-status-failed,html[data-theme="light"] .scan-status-partial { background:#fff0f3; color:#a92340; border-color:#efbeca; }
html[data-theme="light"] .severity-critical,html[data-theme="light"] .severity-high { background:#ffe9ee; color:#b21a36; }
html[data-theme="light"] .severity-medium { background:#fff1d5; color:#855a0b; }
html[data-theme="light"] .severity-info { background:#eaf1ff; color:#285da6; }
html[data-theme="light"] .terminal-output { background:#f0f6f2; color:#226341; }
html[data-theme="light"] .auth-body { background:radial-gradient(ellipse at 50% 5%,#ffeaf0,transparent 55%),#f4f6fa; }
html[data-theme="light"] .auth-card { background:#fff; box-shadow:0 16px 60px rgba(29,44,70,.07); }
html[data-theme="light"] .alert-error { background:#fff0f3; color:#9e2340; border-color:#efc3ce; }
html[data-theme="light"] .alert-success { background:#edf9f2; color:#226641; border-color:#bfdfcd; }
html[data-theme="light"] .alert-info { background:#eff4ff; color:#395779; border-color:#ccd9ee; }
.pdf-export select { width:100%; padding:12px; font:inherit; font-size:12px; }
.pdf-export .panel-head { margin-bottom:22px; }
.pdf-export .form-actions { flex-wrap:wrap; }
.brand-logo { object-fit:contain; display:block; max-width:100%; height:auto; }
.brand-logo-light { display:none; }
html[data-theme="light"] .brand-logo-dark { display:none; }
html[data-theme="light"] .brand-logo-light { display:block; }
.sidebar-head .brand { justify-content:center; }
.sidebar-head { padding:8px 16px 12px; }
.sidebar-head .brand-logo { width:132px; height:132px; }
.brand-symbol { object-fit:contain; flex-shrink:0; background:#fff; border-radius:7px; padding:2px; }
.auth-brand > .brand { justify-content:flex-start; margin-bottom:18px; }
.auth-brand > .brand .brand-logo { width:184px; height:184px; }
.auth-card .brand-compact { display:flex; justify-content:center; margin-bottom:16px; }
.auth-card .brand-compact .brand-logo { width:114px; height:114px; }
.dashboard-brand-banner { display:flex; align-items:center; gap:30px; }
.dashboard-logo { flex-shrink:0; }
.dashboard-logo .brand-logo { width:120px; height:120px; }
.dashboard-brand-banner .security-actions { margin-bottom:0; }
@media(max-width:600px) { .dashboard-brand-banner { flex-direction:column; align-items:flex-start; gap:12px; } .dashboard-logo .brand-logo { width:100px; height:100px; } .sidebar-head .brand-logo { width:112px; height:112px; } .auth-card .brand-compact .brand-logo { width:100px; height:100px; } }
