:root {
  color-scheme: dark;
  --bg: #061018;
  --bg-strong: #0a1823;
  --surface: #0b1722;
  --surface-soft: #0f202d;
  --surface-tint: #0c2a2c;
  --ink: #d9f2f4;
  --ink-soft: #b9d7df;
  --muted: #82a4b5;
  --line: #22384a;
  --line-strong: #31566d;
  --brand: #20e6a4;
  --brand-strong: #62ffd0;
  --brand-soft: rgba(32, 230, 164, 0.12);
  --blue: #22d3ee;
  --blue-soft: rgba(34, 211, 238, 0.12);
  --amber: #f6b84a;
  --amber-soft: rgba(246, 184, 74, 0.12);
  --red: #ff4d4d;
  --red-soft: rgba(255, 77, 77, 0.12);
  --sidebar: #07131e;
  --sidebar-2: #112b3b;
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.36);
  --shadow-soft: 0 16px 34px rgba(0, 0, 0, 0.24);
}

@font-face {
  font-family: "FireDNSPersian";
  src:
    url("/assets/fonts/IRANYekanX-Medium.woff") format("woff"),
    local("IRANYekanX"),
    local("IRANYekanWeb"),
    local("Vazirmatn"),
    local("IRANSans");
  font-display: swap;
}

@font-face {
  font-family: "FireDNSLatin";
  src:
    local("Inter"),
    local("Segoe UI");
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(34, 211, 238, 0.055) 1px, transparent 1px),
    linear-gradient(rgba(32, 230, 164, 0.04) 1px, transparent 1px),
    radial-gradient(circle at 14% 0%, rgba(255, 77, 77, 0.11), transparent 28%),
    linear-gradient(135deg, #061018, #0a1722 48%, #071018),
    var(--bg);
  background-size: 44px 44px, 44px 44px, auto, auto;
  color: var(--ink);
  font-family: "FireDNSPersian", "FireDNSLatin", Tahoma, Arial, sans-serif;
  font-size: 14px;
  overflow-x: hidden;
}

body:has(#auth-view:not(.hidden)) {
  background: #07111d;
}

button,
input,
select {
  font: inherit;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  padding: 0;
  accent-color: var(--brand);
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 7px;
  padding: 0 15px;
  background: linear-gradient(135deg, var(--brand), #168fbd);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0;
  transition: background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

@media (hover: hover) {
  button:hover {
    background: var(--brand-strong);
    box-shadow: 0 8px 18px rgba(15, 143, 131, 0.18);
    transform: translateY(-1px);
  }
}

button:active {
  transform: translateY(0);
}

button:disabled,
button:disabled:hover {
  cursor: not-allowed;
  opacity: 0.56;
  box-shadow: none;
  transform: none;
}

button.secondary {
  background: var(--blue);
}

button.secondary:hover {
  background: #1b57ad;
  box-shadow: 0 8px 18px rgba(35, 103, 199, 0.18);
}

button.icon-btn {
  min-height: unset;
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

button.icon-btn .ui-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

button.icon-btn .ui-icon svg {
  width: 100%;
  height: 100%;
}

button.ghost {
  background: rgba(5, 13, 20, 0.72);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  box-shadow: none;
}

button.ghost:hover {
  background: rgba(15, 32, 45, 0.92);
  border-color: var(--line-strong);
  color: var(--ink);
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 11px;
  background: #07131e;
  color: var(--ink);
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

input,
select {
  height: 42px;
}

textarea {
  resize: vertical;
  line-height: 1.6;
}

input::placeholder,
textarea::placeholder {
  color: #607f91;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 143, 131, 0.14);
}

.auth-form input {
  background: rgba(255, 255, 255, 0.92);
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 13px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}

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

.hidden {
  display: none !important;
}

.auth-shell {
  --auth-night: #08131f;
  --auth-panel: #0d1d2d;
  --auth-panel-2: #13283a;
  --auth-jade: #28d3b0;
  --auth-copper: #d79248;
  --auth-indigo: #6687ff;
  --auth-mist: #eef5f6;
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(400px, 440px) minmax(320px, 420px);
  grid-template-areas: "auth-command auth-form";
  gap: clamp(22px, 3vw, 44px);
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 0;
  padding: clamp(28px, 5vh, 54px) clamp(22px, 4vw, 58px);
  background:
    radial-gradient(circle at 68% 28%, rgba(40, 211, 176, 0.20), transparent 22%),
    radial-gradient(circle at 22% 74%, rgba(215, 146, 72, 0.18), transparent 26%),
    linear-gradient(135deg, #07111d 0%, #0b1826 42%, #101f30 100%);
  overflow: hidden;
}

.auth-shell::before,
.auth-shell::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
}

.auth-shell::before {
  width: min(1220px, calc(100% - 56px));
  height: min(680px, calc(100vh - 92px));
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 28px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  background-size: 44px 44px, 44px 44px, auto;
  box-shadow:
    0 34px 120px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.auth-shell::after {
  width: min(1180px, calc(100% - 92px));
  height: 2px;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  border: 0;
  background:
    linear-gradient(90deg, transparent, rgba(40, 211, 176, 0.38), rgba(215, 146, 72, 0.38), transparent);
  box-shadow:
    0 -180px 0 rgba(40, 211, 176, 0.10),
    0 180px 0 rgba(102, 135, 255, 0.08);
}

.auth-shell.registration-mode {
  grid-template-columns: minmax(0, 760px);
  grid-template-areas: "auth-form";
  justify-content: center;
  align-items: center;
}

.auth-shell.registration-mode .auth-brand {
  display: none;
}

.auth-shell.registration-mode .auth-command-center {
  display: none;
}

.auth-shell .auth-brand {
  display: none;
}

.auth-brand {
  position: relative;
  grid-area: auth-brand;
  min-height: 560px;
  display: grid;
  align-content: center;
  justify-items: start;
  padding: clamp(34px, 4vw, 54px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  background:
    radial-gradient(circle at 16% 22%, rgba(40, 211, 176, 0.18), transparent 24%),
    radial-gradient(circle at 86% 80%, rgba(102, 135, 255, 0.18), transparent 25%),
    linear-gradient(145deg, rgba(19, 40, 58, 0.92), rgba(8, 19, 31, 0.78)),
    linear-gradient(90deg, rgba(40, 211, 176, 0.09) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: auto, 42px 42px, 42px 42px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.30);
  animation: auth-enter 0.62s cubic-bezier(0.2, 0.82, 0.24, 1) both;
}

.auth-command-center {
  position: relative;
  grid-area: auth-command;
  align-self: center;
  min-height: 560px;
  display: grid;
  grid-template-rows: auto minmax(220px, 1fr) auto auto;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.035)),
    rgba(7, 17, 29, 0.44);
  box-shadow:
    0 26px 68px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(22px);
  animation: card-enter 0.64s cubic-bezier(0.2, 0.82, 0.24, 1) 0.1s both;
}

.auth-command-center::after {
  content: "";
  position: absolute;
  top: 44px;
  bottom: 44px;
  width: clamp(18px, 2vw, 34px);
  border-top: 1px solid rgba(40, 211, 176, 0.34);
  border-bottom: 1px solid rgba(102, 135, 255, 0.24);
  pointer-events: none;
}

.auth-command-center::after {
  inset-inline-end: calc(100% - 2px);
  border-inline-start: 1px solid rgba(215, 146, 72, 0.24);
  border-radius: 18px 0 0 18px;
}

.command-head {
  display: flex;
  align-items: center;
  gap: 10px;
  direction: ltr;
  text-align: left;
}

.command-head strong,
.command-head small {
  display: block;
}

.command-head strong {
  color: #f6fbff;
  font-size: 15px;
}

.command-head small {
  margin-top: 3px;
  color: #8fa4b8;
  font-size: 12px;
}

.live-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--auth-jade);
  box-shadow: 0 0 0 6px rgba(40, 211, 176, 0.13), 0 0 26px rgba(40, 211, 176, 0.52);
  animation: node-pulse 2.2s ease-in-out infinite;
}

.route-board {
  position: relative;
  overflow: hidden;
  min-height: 248px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 16px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 50% 45%, rgba(40, 211, 176, 0.19), transparent 36%),
    rgba(10, 25, 38, 0.72);
  background-size: 28px 28px, 28px 28px, auto, auto;
}

.route-board::after {
  content: "";
  position: absolute;
  inset: -40%;
  background: conic-gradient(from 60deg, transparent, rgba(40, 211, 176, 0.12), transparent 32%);
  animation: orbit-rotate 16s linear infinite;
}

.route-node {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 76px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(9, 22, 35, 0.90);
  color: #f7fbff;
  direction: ltr;
  font-weight: 800;
  font-size: 12px;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.22);
}

.route-dns {
  width: 88px;
  height: 88px;
  inset: calc(50% - 44px) auto auto calc(50% - 44px);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--auth-jade), var(--auth-indigo));
}

.route-user {
  inset-inline-start: 16px;
  top: 22px;
}

.route-ir {
  inset-inline-end: 18px;
  top: 34px;
}

.route-eu {
  inset-inline-end: 28px;
  bottom: 34px;
  border-color: rgba(215, 146, 72, 0.34);
}

.route-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  direction: ltr;
}

.command-feed {
  display: grid;
  gap: 10px;
}

.command-feed div {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  column-gap: 10px;
  align-items: center;
  min-height: 64px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.055);
}

.command-feed span {
  grid-row: 1 / 3;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(40, 211, 176, 0.12);
  color: var(--auth-jade);
  direction: ltr;
  font-weight: 900;
}

.command-feed strong,
.command-feed small {
  display: block;
  min-width: 0;
  direction: rtl;
  text-align: right;
}

.command-feed strong {
  color: #f7fbff;
  font-size: 13px;
}

.command-feed small {
  margin-top: 4px;
  color: #90a5b8;
  font-size: 12px;
}

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

.trust-strip span {
  min-height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: #c8d7e4;
  direction: ltr;
  font-size: 12px;
  font-weight: 800;
}

.auth-brand::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 42px;
  bottom: 42px;
  width: 5px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--auth-jade), var(--auth-copper), var(--auth-indigo));
}

.brand-mark {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(40, 211, 176, 0.96), rgba(102, 135, 255, 0.90)),
    #0e2538;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: 0 18px 42px rgba(40, 211, 176, 0.24);
  animation: mark-pulse 4.2s ease-in-out infinite;
}

.brand-mark.small {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: none;
}

.eyebrow {
  margin: 22px 0 10px;
  color: var(--auth-copper);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.auth-brand h1 {
  margin-bottom: 16px;
  color: #f7fbff;
  font-size: clamp(48px, 5vw, 70px);
  line-height: 1.05;
}

.lead {
  max-width: 620px;
  color: #a9bac8;
  font-size: 17px;
  line-height: 1.95;
}

.auth-visual {
  position: relative;
  width: min(560px, 100%);
  height: 210px;
  margin-top: 34px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 14px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(40, 211, 176, 0.08));
  background-size: 34px 34px, 34px 34px, auto;
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.24);
}

.auth-visual::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px dashed rgba(40, 211, 176, 0.24);
  border-radius: 18px;
  animation: orbit-rotate 18s linear infinite;
}

.auth-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 12%, rgba(255, 255, 255, 0.52) 45%, transparent 70%);
  transform: translateX(90%);
  animation: scan-line 4.8s ease-in-out infinite;
}

.signal-core,
.signal-node {
  position: absolute;
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.signal-core {
  z-index: 2;
  width: 76px;
  height: 76px;
  inset-inline-start: calc(50% - 38px);
  top: 66px;
  background: linear-gradient(135deg, var(--auth-jade), var(--auth-indigo));
  color: #fff;
  font-weight: 900;
  direction: ltr;
  box-shadow: 0 18px 46px rgba(40, 211, 176, 0.28);
}

.signal-node {
  z-index: 2;
  width: 18px;
  height: 18px;
  background: var(--auth-night);
  border: 4px solid var(--auth-jade);
  box-shadow: 0 0 0 7px rgba(40, 211, 176, 0.15);
  animation: node-pulse 2.6s ease-in-out infinite;
}

.node-a {
  inset-inline-start: 16%;
  top: 42px;
}

.node-b {
  inset-inline-end: 18%;
  top: 38px;
  animation-delay: 0.4s;
}

.node-c {
  inset-inline-start: 26%;
  bottom: 34px;
  border-color: var(--auth-copper);
  box-shadow: 0 0 0 7px rgba(215, 146, 72, 0.16);
  animation-delay: 0.8s;
}

.signal-line {
  position: absolute;
  z-index: 1;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(102, 135, 255, 0.42), rgba(40, 211, 176, 0.48), transparent);
  transform-origin: center;
  animation: data-flow 2.8s ease-in-out infinite;
}

.line-a {
  width: 210px;
  inset-inline-start: 19%;
  top: 76px;
  transform: rotate(14deg);
}

.line-b {
  width: 190px;
  inset-inline-end: 22%;
  top: 77px;
  transform: rotate(-16deg);
  animation-delay: 0.55s;
}

.line-c {
  width: 170px;
  inset-inline-start: 30%;
  bottom: 68px;
  transform: rotate(-22deg);
  animation-delay: 1.1s;
}

.auth-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: min(560px, 100%);
  margin-top: 26px;
}

.auth-metrics div,
.ops-grid div,
.stat-card {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
  box-shadow: var(--shadow-soft);
}

.auth-metrics div {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(14px);
  animation: metric-rise 0.54s cubic-bezier(0.2, 0.82, 0.24, 1) both;
}

.auth-metrics div:nth-child(2) {
  animation-delay: 0.08s;
}

.auth-metrics div:nth-child(3) {
  animation-delay: 0.16s;
}

.auth-metrics span {
  display: block;
  color: #8ca2b5;
  font-size: 12px;
}

.auth-metrics strong {
  display: block;
  margin-top: 8px;
  color: #f7fbff;
  font-size: 18px;
  direction: ltr;
  text-align: right;
}

.ops-grid span,
.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.ops-grid strong,
.stat-card strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 18px;
  direction: ltr;
  text-align: right;
}

.auth-card,
.panel {
  background:
    linear-gradient(180deg, rgba(34, 211, 238, 0.045), transparent 38%),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-card {
  position: relative;
  grid-area: auth-form;
  overflow: hidden;
  width: min(440px, 100%);
  justify-self: center;
  padding: 26px;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(135deg, rgba(40, 211, 176, 0.74), rgba(215, 146, 72, 0.62), rgba(102, 135, 255, 0.60)) border-box;
  border: 1px solid transparent;
  border-radius: 20px;
  backdrop-filter: blur(18px);
  animation: card-enter 0.58s cubic-bezier(0.2, 0.82, 0.24, 1) 0.05s both;
  box-shadow: 0 32px 80px rgba(8, 19, 31, 0.16);
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(40, 211, 176, 0.10), transparent 34%),
    linear-gradient(0deg, rgba(102, 135, 255, 0.055), transparent 46%);
}

.auth-card::after {
  content: "";
  position: absolute;
  inset-inline-start: 20px;
  top: 0;
  width: 126px;
  height: 4px;
  border-radius: 0 0 999px 999px;
  background: linear-gradient(90deg, var(--auth-jade), var(--auth-copper), var(--auth-indigo));
  box-shadow: 0 0 24px rgba(40, 211, 176, 0.34);
}

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

.auth-card.hidden {
  display: none;
}

.auth-form {
  color: #152235 !important;
}

.security-ribbon {
  margin-bottom: 16px;
  padding: 10px 12px;
  border: 1px solid rgba(40, 211, 176, 0.20);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(225, 248, 243, 0.92), rgba(255, 248, 238, 0.76));
  color: #28475a !important;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.7;
}

.auth-switch,
.switch {
  display: none;
}

.auth-form h2 {
  margin-bottom: 20px;
  color: #152235 !important;
  font-size: 24px;
  line-height: 1.35;
}

.auth-form label {
  color: #28475a !important;
  font-weight: 900;
}

.auth-form input,
.auth-form select,
.auth-form textarea {
  background: #f4f8fb !important;
  border-color: #7f95aa !important;
  color: #122132 !important;
  -webkit-text-fill-color: #122132 !important;
  caret-color: #122132;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62) !important;
}

.auth-form input::placeholder,
.auth-form textarea::placeholder {
  color: #667f94 !important;
  opacity: 1;
}

.auth-form input:focus,
.auth-form select:focus,
.auth-form textarea:focus {
  background: #ffffff !important;
  border-color: #148d7e !important;
  box-shadow: 0 0 0 3px rgba(40, 211, 176, 0.22) !important;
}

.auth-form input:-webkit-autofill,
.auth-form input:-webkit-autofill:hover,
.auth-form input:-webkit-autofill:focus {
  border-color: #7f95aa !important;
  -webkit-text-fill-color: #122132 !important;
  caret-color: #122132;
  box-shadow: 0 0 0 1000px #f4f8fb inset !important;
  transition: background-color 9999s ease-out;
}

.captcha-box {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(94px, 118px) 44px;
  gap: 9px;
  align-items: center;
  margin: 2px 0 14px;
  padding: 10px;
  border: 1px solid rgba(102, 135, 255, 0.20);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(247, 250, 251, 0.96), rgba(238, 244, 255, 0.76));
}

.captcha-box div {
  min-width: 0;
}

.captcha-box span {
  display: block;
  color: #38576a !important;
  font-weight: 800;
  font-size: 12px;
}

.captcha-question {
  display: block;
  margin-top: 3px;
  color: #112438 !important;
  -webkit-text-fill-color: #112438 !important;
  direction: ltr;
  text-align: right;
  font-size: 16px;
  font-weight: 900;
}

.captcha-box input {
  height: 40px;
  min-height: 40px;
  text-align: center;
  direction: ltr;
}

.captcha-box button {
  min-height: 40px;
  padding: 0;
  font-size: 18px;
}

.captcha-box.loading {
  opacity: 0.72;
}

.auth-inline-actions {
  display: grid;
  grid-template-columns: 1.06fr 0.94fr;
  gap: 10px;
  margin-top: 13px;
}

.auth-inline-actions button {
  width: 100%;
  min-width: 0;
}

.auth-inline-actions.register-actions {
  grid-template-columns: 1fr;
}

#register-form {
  grid-column: 1;
  width: 100%;
  max-height: min(760px, calc(100vh - 76px));
  overflow: auto;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(145deg, rgba(88, 215, 198, 0.88), rgba(35, 103, 199, 0.72), rgba(15, 143, 131, 0.76)) border-box;
  border: 1px solid transparent;
  box-shadow: 0 28px 70px rgba(18, 38, 63, 0.18);
}

#register-form::before {
  background:
    radial-gradient(circle at 88% 8%, rgba(35, 103, 199, 0.18), transparent 25%),
    radial-gradient(circle at 10% 92%, rgba(15, 143, 131, 0.18), transparent 28%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.68), rgba(228, 239, 255, 0.34));
}

#register-form h2 {
  margin-bottom: 16px;
  font-size: 24px;
}

#register-form .security-ribbon {
  border-color: rgba(35, 103, 199, 0.18);
  background: linear-gradient(135deg, rgba(228, 239, 255, 0.94), rgba(223, 245, 242, 0.94));
  color: #28475a !important;
}

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

.hint.hint-error {
  color: var(--red, #e55);
  font-weight: 500;
}

button.ghost.danger {
  color: var(--red, #e55);
  border-color: transparent;
}

button.ghost.danger:hover {
  background: color-mix(in srgb, var(--red, #e55) 12%, transparent);
  border-color: var(--red, #e55);
}

.muted-field {
  opacity: 0.58;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  width: 100%;
  transition: grid-template-columns 0.22s ease;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(32, 230, 164, 0.13), transparent 42%),
    linear-gradient(160deg, var(--sidebar), var(--sidebar-2));
  background-size: auto, auto;
  color: #fff;
  box-shadow:
    -18px 0 38px rgba(0, 0, 0, 0.34),
    inset 1px 0 0 rgba(32, 230, 164, 0.16);
  transition: padding 0.22s ease;
}

.side-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.side-brand strong,
.side-brand span {
  display: block;
}

.side-brand strong {
  font-size: 16px;
}

.side-brand span {
  margin-top: 3px;
  color: #b9c7d7;
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 2px;
  align-content: start;
  margin-top: 14px;
  flex: 1 1 0;
  overflow-y: auto;
  min-height: 0;
}

.nav-sep {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 10px 4px 2px;
  padding: 0 5px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(148, 187, 210, 0.40);
  pointer-events: none;
  user-select: none;
}

.nav-sep::before {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(32, 230, 164, 0.1);
  max-width: 10px;
}

.nav-sep::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(32, 230, 164, 0.1);
}

.sidebar-clock {
  margin-top: 16px;
  flex-shrink: 0;
  padding: 13px 12px;
  border: 1px solid rgba(32, 230, 164, 0.18);
  border-radius: 8px;
  background: rgba(5, 13, 20, 0.46);
  color: var(--ink-soft);
  text-align: center;
}

.sidebar-clock strong,
.sidebar-clock span {
  display: block;
}

.sidebar-clock strong {
  color: #fff;
  font-size: 18px;
  line-height: 1.3;
}

.nav-collapse-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 30px;
  padding: 0 9px;
  margin-top: 8px;
  flex-shrink: 0;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #9fc1cf;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.16s, border-color 0.16s, color 0.16s, width 0.22s ease, padding 0.22s ease;
  box-shadow: none;
}

.nav-collapse-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff;
  box-shadow: none;
  transform: none;
}

.nav-collapse-btn .nav-collapse-label {
  flex: 1;
  text-align: right;
  white-space: nowrap;
}

.nav-collapse-icon {
  flex-shrink: 0;
  transition: transform 0.22s ease;
}

.sidebar-clock span {
  margin-top: 4px;
  color: #9fc1cf;
  font-size: 11px;
  line-height: 1.55;
}

.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  justify-content: flex-start;
  width: 100%;
  min-height: 32px;
  padding: 0 9px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #c8d9e8;
  text-align: right;
  font-size: 12px;
  font-weight: 600;
  box-shadow: none;
}

.ui-icon {
  width: var(--icon-size, 18px);
  height: var(--icon-size, 18px);
  display: inline-block;
  flex: 0 0 auto;
  color: currentColor;
}

.ui-icon svg {
  width: 100%;
  height: 100%;
}

.icon-button-content {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.nav-item:hover {
  background: rgba(34, 211, 238, 0.07);
  border-color: rgba(32, 230, 164, 0.14);
  color: #e8f4ff;
  box-shadow: none;
}

.nav-item.active {
  background: rgba(32, 230, 164, 0.08);
  border-color: transparent;
  border-inline-start: 2px solid var(--brand);
  border-radius: 0 7px 7px 0;
  color: #20e6a4;
  box-shadow: none;
  font-weight: 700;
}

.nav-item.has-children {
  padding-inline-end: 10px;
}

.nav-disclosure {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-inline-start: auto;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  border-radius: 6px;
  transition: transform 0.16s ease;
}

.nav-disclosure:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-disclosure.open {
  transform: rotate(180deg);
}

.billing-plan-panel.hidden,
.plan-edit-grid.hidden {
  display: none;
}

#billing.billing-page {
  display: grid;
  gap: 22px;
  width: min(1180px, 100%);
  max-width: none;
  margin-inline: auto;
}

#billing .panel {
  border: 1px solid rgba(76, 111, 136, 0.40);
  background: #071722;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
}

#billing > .content-grid.wide-left.billing-wallet-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
  gap: 18px;
  width: 100%;
  max-width: none;
  margin: 0;
  align-items: start;
}

.billing-wallet-panel,
.billing-side-stack {
  min-width: 0;
}

.billing-side-stack {
  display: grid;
  gap: 14px;
}

.billing-plan-panel {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 22px;
  overflow: hidden;
}

.billing-plan-panel > h2 {
  margin: 0 0 16px;
  color: #effcff;
  font-size: 21px;
  line-height: 1.35;
}

.billing-plan-panel #plan-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid rgba(76, 111, 136, 0.34);
  border-radius: 8px;
  background: #0a1c29;
}

.billing-plan-panel #plan-form label,
.plan-card .plan-edit-grid label {
  display: grid;
  gap: 7px;
  margin: 0;
  color: #9db8c8;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.billing-plan-panel #plan-form input,
.billing-plan-panel #plan-form button,
.billing-plan-panel #plan-form .check-row {
  min-width: 0;
  min-height: 40px;
}

.billing-plan-panel #plan-form button {
  width: 100%;
}

.billing-plan-panel #plan-form .check-row {
  justify-content: center;
  padding-inline: 10px;
}

.plan-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  min-height: 374px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid rgba(76, 111, 136, 0.42);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(21, 42, 55, 0.92), rgba(8, 22, 33, 0.98)),
    #081621;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  transition: border-color 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

.plan-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--blue));
  opacity: 0.88;
}

.plan-card:hover {
  border-color: rgba(94, 234, 212, 0.32);
  background:
    linear-gradient(180deg, rgba(24, 49, 62, 0.96), rgba(8, 22, 33, 1)),
    #081621;
}

@media (hover: hover) {
  .plan-card:hover {
    transform: translateY(-1px);
  }
}

.plan-card-head,
.plan-card-actions,
.plan-price {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.plan-card-head > div {
  min-width: 0;
}

.plan-card-head strong {
  display: block;
  overflow: hidden;
  color: #f1fcff;
  font-size: 18px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-card-head small {
  display: block;
  margin-top: 4px;
  color: #8eacbc;
  direction: ltr;
  font-family: "FireDNSLatin", "FireDNSPersian", Tahoma, Arial, sans-serif;
  font-size: 12px;
  text-align: right;
}

.plan-card .badge {
  min-width: 76px;
  justify-content: center;
  border-color: rgba(94, 234, 212, 0.28);
  background: rgba(32, 230, 164, 0.10);
  color: #a7ffe1;
}

.plan-card .badge:not(:first-child) {
  white-space: nowrap;
}

.plan-price {
  align-items: center;
  min-height: 66px;
  padding: 10px 12px;
  border: 1px solid rgba(76, 111, 136, 0.34);
  border-radius: 8px;
  background: #0a1c29;
}

.plan-price span,
.plan-period-prices small,
.plan-feature-grid small,
.plan-feature-grid span {
  color: #8eacbc;
  font-size: 12px;
  font-weight: 800;
}

.plan-price strong {
  min-width: 0;
  color: #eefcff;
  font-size: 19px;
  line-height: 1.45;
  text-align: left;
}

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

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

.plan-period-prices > div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(76, 111, 136, 0.30);
  border-radius: 8px;
  background: rgba(5, 13, 20, 0.28);
}

.plan-period-prices strong {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: #f1fcff;
  font-size: 13px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-feature-grid > div {
  min-width: 0;
  min-height: 82px;
  padding: 10px 12px;
  border: 1px solid rgba(76, 111, 136, 0.30);
  border-radius: 8px;
  background: rgba(5, 13, 20, 0.34);
}

.plan-feature-grid strong {
  display: block;
  margin: 5px 0 3px;
  overflow: hidden;
  color: #f1fcff;
  font-size: 18px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.future-pricing {
  grid-column: 1 / -1;
  border-style: dashed !important;
  background: rgba(34, 211, 238, 0.045) !important;
}

.plan-description {
  min-height: 42px;
  margin: 0;
  color: #a8bfca;
  font-size: 13px;
  line-height: 1.75;
}

.plan-card-actions {
  align-items: center;
  margin-top: auto;
  padding-top: 2px;
}

.plan-card-actions button {
  flex: 1 1 0;
  min-width: 0;
  padding-inline: 12px;
}

.plan-card .plan-edit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 2px;
  padding-top: 14px;
  border-top: 1px solid rgba(76, 111, 136, 0.34);
}

.plan-card .plan-edit-grid input,
.plan-card .plan-edit-grid button,
.plan-card .plan-edit-grid .check-row {
  min-width: 0;
  min-height: 40px;
}

.plan-card .plan-edit-grid button,
.plan-card .plan-edit-grid .check-row {
  align-self: end;
}

.billing-wallet-panel {
  width: 100%;
  padding: 22px;
}

.billing-wallet-panel .panel-head {
  margin-bottom: 18px;
}

.billing-wallet-panel .ops-grid {
  grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.billing-wallet-panel .ops-grid div {
  min-height: 86px;
  padding: 14px;
  border-color: rgba(76, 111, 136, 0.32);
  background: #0a1c29;
}

.billing-wallet-panel .ops-grid div:first-child {
  background:
    linear-gradient(135deg, rgba(32, 230, 164, 0.13), rgba(34, 211, 238, 0.06)),
    #0a1c29;
}

.billing-wallet-panel .ops-grid div:first-child strong {
  color: #f1fcff;
  font-size: 24px;
}

.billing-wallet-panel #wallet-transaction-list {
  min-height: 130px;
  margin-top: 0;
}

.billing-wallet-panel #plan-invoice-list {
  margin-bottom: 12px;
}

.invoice-row {
  border-color: rgba(246, 184, 74, 0.26);
  background:
    linear-gradient(90deg, rgba(246, 184, 74, 0.08), transparent 44%),
    rgba(10, 28, 41, 0.92);
}

.invoice-row .row-actions {
  align-items: center;
}

.invoice-row .pay-invoice {
  min-width: 118px;
}

.billing-wallet-panel #finance-user-list {
  margin-top: 10px;
}

#wallet-transaction-list .row,
#finance-user-list .row {
  min-height: 62px;
  border-color: rgba(76, 111, 136, 0.30);
  background: rgba(10, 28, 41, 0.84);
}

#wallet-charge-form,
#zarinpal-settings-form {
  width: 100%;
  padding: 18px;
  background: #071722;
}

#wallet-charge-form h2,
#zarinpal-settings-form h2 {
  margin-bottom: 14px;
  font-size: 18px;
}

#users > .content-grid.wide-left {
  grid-template-columns: minmax(0, 1fr) minmax(310px, 360px);
  align-items: start;
}

#users .panel {
  border-color: rgba(76, 111, 136, 0.40);
}

#user-list {
  gap: 10px;
}

.user-row {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 14px;
  align-items: center;
  min-height: 74px;
  padding: 12px;
  background:
    linear-gradient(90deg, rgba(32, 230, 164, 0.035), transparent 42%),
    #0a1c29;
}

.user-summary {
  display: grid;
  grid-template-columns: 42px minmax(180px, 1.15fr) minmax(220px, 1fr) max-content;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.user-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(94, 234, 212, 0.22);
  border-radius: 8px;
  background: rgba(32, 230, 164, 0.10);
  color: #dffdf3;
  font-family: "FireDNSLatin", "FireDNSPersian", Tahoma, Arial, sans-serif;
  font-size: 13px;
  font-weight: 800;
}

.user-identity {
  min-width: 0;
}

.user-identity strong,
.user-identity small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-identity strong {
  color: #f1fcff;
  font-size: 14px;
  line-height: 1.45;
}

.user-identity small {
  margin-top: 3px;
  color: #8eacbc;
  direction: ltr;
  text-align: right;
}

.user-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.user-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid rgba(76, 111, 136, 0.30);
  border-radius: 999px;
  background: rgba(5, 13, 20, 0.30);
  color: #9db8c8;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.user-meta .badge {
  color: #a7ffe1;
}

.user-status {
  justify-self: end;
  min-width: 76px;
  padding: 6px 9px;
  border: 1px solid rgba(76, 111, 136, 0.30);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.user-status.is-active {
  border-color: rgba(94, 234, 212, 0.28);
  background: rgba(32, 230, 164, 0.10);
  color: #a7ffe1;
}

.user-status.is-inactive {
  border-color: rgba(246, 184, 74, 0.28);
  background: rgba(246, 184, 74, 0.10);
  color: #ffd995;
}

.user-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 7px;
  justify-content: flex-end;
}

.user-actions .icon-only {
  width: 38px;
  min-height: 38px;
}

.user-edit-panel {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(140px, 0.7fr) minmax(150px, 0.8fr) minmax(240px, 1.4fr) minmax(190px, 1fr) 112px;
  gap: 10px;
  align-items: end;
  padding-top: 12px;
  border-top: 1px solid rgba(76, 111, 136, 0.34);
}

.user-profile-fields {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(76, 111, 136, 0.20);
}

.user-profile-fields label {
  flex: 1 1 0;
  min-width: 0;
}

.user-profile-fields button {
  flex-shrink: 0;
  min-height: 42px;
  padding: 0 18px;
  align-self: flex-end;
}

.user-edit-panel.hidden {
  display: none;
}

.user-edit-panel label {
  display: grid;
  gap: 7px;
  margin: 0;
  color: #9db8c8;
  font-size: 12px;
  font-weight: 800;
}

.user-edit-panel select,
.user-edit-panel textarea,
.user-edit-panel button {
  min-width: 0;
}

.user-edit-panel textarea {
  min-height: 42px;
  resize: vertical;
}

.user-edit-note {
  display: grid;
  gap: 4px;
  min-height: 42px;
  align-content: center;
  padding: 8px 10px;
  border: 1px solid rgba(76, 111, 136, 0.30);
  border-radius: 8px;
  background: rgba(5, 13, 20, 0.28);
}

.user-edit-note span {
  color: #f1fcff;
  font-size: 13px;
  font-weight: 800;
}

.user-edit-note small {
  color: #8eacbc;
  font-size: 12px;
}

.cluster-card {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid rgba(94, 234, 212, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(32, 230, 164, 0.09), rgba(34, 211, 238, 0.045)),
    #0a1c29;
}

.cluster-card.hidden {
  display: none;
}

.cluster-card-head,
.cluster-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.cluster-card h3 {
  margin: 3px 0 4px;
  color: #f1fcff;
  font-size: 19px;
}

.cluster-card p {
  margin: 0;
  color: #9db8c8;
  font-size: 13px;
  line-height: 1.7;
}

.cluster-state {
  min-width: 82px;
  padding: 6px 10px;
  border: 1px solid rgba(76, 111, 136, 0.34);
  border-radius: 999px;
  color: #9db8c8;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.cluster-state.is-active {
  border-color: rgba(94, 234, 212, 0.30);
  background: rgba(32, 230, 164, 0.11);
  color: #a7ffe1;
}

.cluster-state.is-inactive {
  border-color: rgba(246, 184, 74, 0.30);
  background: rgba(246, 184, 74, 0.10);
  color: #ffd995;
}

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

.cluster-metrics div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(76, 111, 136, 0.30);
  border-radius: 8px;
  background: rgba(5, 13, 20, 0.30);
}

.cluster-metrics span {
  display: block;
  margin-bottom: 5px;
  color: #8eacbc;
  font-size: 12px;
  font-weight: 800;
}

.cluster-metrics strong {
  display: block;
  overflow: hidden;
  color: #f1fcff;
  direction: ltr;
  font-size: 13px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cluster-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.workspace {
  min-width: 0;
  padding: 0 24px 24px;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.workspace-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 14px;
  margin-top: 28px;
  padding: 16px 0 4px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  border-top: 1px solid rgba(112, 132, 151, 0.18);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-inline: -24px;
  margin-bottom: 26px;
  padding: 0 24px;
  height: 60px;
  background: rgba(6, 13, 21, 0.96);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border-bottom: 1px solid rgba(34, 56, 74, 0.9);
  box-shadow: 0 1px 0 rgba(32, 230, 164, 0.07), 0 4px 16px rgba(0, 0, 0, 0.18);
}

.topbar-title {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
}

.topbar-page-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(32, 230, 164, 0.11), rgba(34, 211, 238, 0.07));
  border: 1px solid rgba(32, 230, 164, 0.16);
  color: var(--brand);
  flex-shrink: 0;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.topbar-page-icon .ui-icon {
  width: 16px;
  height: 16px;
}

.topbar h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  letter-spacing: -0.2px;
}

.session {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 10px;
}

.session-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(32, 230, 164, 0.13), rgba(34, 211, 238, 0.08));
  border: 1px solid rgba(32, 230, 164, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--brand);
  flex-shrink: 0;
  text-transform: uppercase;
  font-family: "FireDNSLatin", monospace;
}

.session-info {
  min-width: 0;
  max-width: 190px;
}

.session-info strong,
.session-info span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  direction: ltr;
}

.session-info strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.session-info span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.session-logout {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 6px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.dash-ssl-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dash-bottom-row {
  margin-top: 18px;
}

.stat-card {
  position: relative;
  overflow: hidden;
}

.stat-card .stat-icon {
  float: inline-end;
  opacity: 0.5;
  --icon-size: 22px;
}

.stat-card::after {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(var(--brand), var(--blue));
  box-shadow: 0 0 18px rgba(32, 230, 164, 0.30);
}

.stat-card.stat-brand::after { background: linear-gradient(var(--brand), var(--brand-strong)); box-shadow: 0 0 14px rgba(32,230,164,0.25); }
.stat-card.stat-blue::after  { background: var(--blue); box-shadow: none; }
.stat-card.stat-amber::after { background: var(--amber); box-shadow: none; }
.stat-card.stat-red::after   { background: var(--red); box-shadow: none; }

.stat-card.stat-amber-active { background: var(--amber-soft); }
.stat-card.stat-amber-active strong { color: var(--amber); }
.stat-card.stat-red-active { background: var(--red-soft); }
.stat-card.stat-red-active strong { color: var(--red); }

/* Audit log rows */
.audit-dash-row .badge-sm {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
}

/* System resource bars */
.dash-system-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 16px 0;
}

.sys-res-item {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sys-res-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  width: 48px;
  flex-shrink: 0;
}

.sys-resource {
  flex: 1;
}

.sys-resource-head {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--ink-soft);
}

.progress-bar {
  height: 8px;
  background: var(--line);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.progress-fill.ok     { background: linear-gradient(90deg, var(--brand), var(--blue)); }
.progress-fill.warn   { background: var(--amber); }
.progress-fill.danger { background: var(--red); }

/* ── Network monitoring panel ── */
.dash-net-panel {
  margin-top: 18px;
}

.net-iface-select {
  height: 32px;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 12px;
  cursor: pointer;
}

.dash-net-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 16px;
}

.net-kpi {
  padding: 14px 18px;
  border-inline-end: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.net-kpi:last-child,
.net-kpi:nth-child(4) {
  border-inline-end: none;
}

.net-kpi + .net-kpi:nth-child(5) {
  border-top: 1px solid var(--line);
}

.dash-net-kpis .net-kpi:nth-child(n+5) {
  border-top: 1px solid var(--line);
}

.net-kpi-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

.net-kpi strong {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.net-kpi-rx strong { color: var(--brand); }
.net-kpi-tx strong { color: var(--blue); }

/* Chart area */
.net-chart-wrap {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 8px;
}

.net-chart-yaxis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
  text-align: end;
  width: 60px;
  flex-shrink: 0;
  padding-bottom: 2px;
  font-variant-numeric: tabular-nums;
}

.dash-net-chart {
  flex: 1;
  background: var(--surface-soft);
  border-radius: 8px;
  overflow: hidden;
  height: 130px;
  display: flex;
  align-items: stretch;
}

.net-chart-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.dash-net-legend {
  display: flex;
  gap: 20px;
  justify-content: flex-end;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.net-legend-rx::before,
.net-legend-tx::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 2px;
  vertical-align: middle;
  margin-inline-end: 5px;
  border-radius: 1px;
}

.net-legend-rx::before { background: var(--brand); }
.net-legend-tx::before { background: var(--blue); }

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
  gap: 18px;
}

.content-grid.wide-left {
  grid-template-columns: minmax(0, 1.45fr) 390px;
  align-items: start;
}

#domains > .content-grid.wide-left {
  align-items: stretch;
  grid-template-rows: 1fr;
  height: calc(100vh - 90px);
  min-height: 340px;
  overflow: hidden;
}

#records-panel:not(.hidden),
#domain-ns-panel:not(.hidden) {
  min-height: calc(100vh - 116px);
}

#domains .form-panel {
  overflow-y: auto;
}

.settings-grid {
  grid-auto-flow: dense;
}

.panel {
  padding: 18px;
}

.embedded-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.embedded-section .panel-head {
  margin-bottom: 12px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 16px;
}

.panel-head > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.panel-head h2,
.form-panel h2 {
  margin-bottom: 5px;
  font-size: 20px;
}

.panel-head p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.form-panel h2 {
  margin-bottom: 16px;
}

.table-list {
  display: grid;
  gap: 10px;
}

.domain-directory-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.domain-list-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.domain-list-toolbar input {
  height: 40px;
}

.domain-list-scroll {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  padding-inline-end: 4px;
}

.domain-list {
  padding-bottom: 2px;
}

.domain-row {
  min-height: 58px;
}

.domain-row.selected {
  border-color: rgba(32, 230, 164, 0.55);
  background:
    linear-gradient(90deg, rgba(32, 230, 164, 0.14), transparent 46%),
    #122535;
}

.domain-row .row-title > div {
  min-width: 0;
}

.domain-row strong,
.domain-row small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.domain-row-actions {
  flex-wrap: nowrap;
  gap: 6px;
}

.tooltip-button {
  position: relative;
}

.tooltip-button::after {
  content: attr(data-tooltip);
  position: absolute;
  inset-inline-end: 50%;
  top: calc(100% + 6px);
  z-index: 50;
  width: max-content;
  max-width: 190px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #071522;
  color: #fff;
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateX(50%) translateY(-4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.tooltip-button:hover::after,
.tooltip-button:focus-visible::after {
  opacity: 1;
  transform: translateX(50%) translateY(0);
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 62px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(32, 230, 164, 0.035), transparent 36%),
    var(--surface-soft);
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.row:hover {
  background:
    linear-gradient(90deg, rgba(34, 211, 238, 0.075), transparent 42%),
    #122535;
  border-color: var(--line-strong);
}

@media (hover: hover) {
  .row:hover {
    transform: translateY(-1px);
  }
}

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

.row-title > div {
  min-width: 0;
  overflow: hidden;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.danger-text {
  color: #ffb4aa;
}

.danger-text:hover {
  color: #ffd7d2;
  border-color: rgba(196, 56, 42, 0.5);
}

.ip-rule-inline {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 8px;
  align-items: start;
  width: min(460px, 100%);
}

.ip-rule-inline textarea {
  min-height: 64px;
}

.check-row,
.ns-check-row,
.toggle-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-line {
  margin: 0;
  white-space: nowrap;
}

.ns-check-row {
  margin-bottom: 0;
  cursor: pointer;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  border: 1px solid rgba(32, 230, 164, 0.22);
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 800;
  direction: ltr;
}

.row strong,
.row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row small {
  margin-top: 4px;
  color: var(--muted);
  direction: ltr;
  text-align: right;
}

.node-output {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 96px;
  max-height: 320px;
  margin: 2px 0 0;
}

.node-output.danger {
  border-color: rgba(255, 105, 92, 0.7);
  color: #ffe4df;
}

.node-output.hidden {
  display: none;
}

.empty {
  min-height: 130px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: rgba(5, 13, 20, 0.42);
  color: var(--muted);
  text-align: center;
  padding: 20px;
}

.record-grid,
.record-dynamic-grid,
.geo-grid,
.policy-grid,
.target-grid {
  display: grid;
  grid-template-columns: minmax(120px, 0.9fr) 108px minmax(260px, 2.4fr) 86px 92px 132px;
  gap: 10px;
  margin-bottom: 14px;
}

.record-dynamic-grid {
  grid-template-columns: 150px minmax(190px, 1fr) minmax(220px, 1.5fr) 100px 100px 130px;
}

#records-panel,
#record-dynamic-panel,
#domain-ns-panel {
  margin-top: 14px;
}

#records-panel .panel-head,
#record-dynamic-panel .panel-head,
#domain-ns-panel .panel-head {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.record-grid,
.record-dynamic-grid {
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.record-host-wrap {
  display: flex;
  align-items: center;
  min-width: 0;
}
.record-host-wrap input {
  flex: 1;
  min-width: 0;
}
.record-host-suffix {
  font-size: 11px;
  color: var(--muted);
  padding: 0 4px 0 2px;
  white-space: nowrap;
  direction: ltr;
  pointer-events: none;
  user-select: none;
}

.record-row,
.dynamic-rule-row,
.ns-check-row {
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 58px;
  background: #fff;
}

.records-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px max-content;
  gap: 10px;
  align-items: center;
  margin: 6px 0 10px;
}

.records-toolbar input,
.records-toolbar select {
  height: 40px;
}

.records-count {
  color: var(--muted);
  font-size: 0.86rem;
  white-space: nowrap;
}

.record-table {
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.record-table-header,
.record-table .record-row {
  display: grid;
  grid-template-columns: 76px minmax(100px, 1.5fr) minmax(180px, 3fr) 52px 148px;
  gap: 10px;
  align-items: center;
}

.record-table-header {
  min-height: 42px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  background: rgba(5, 13, 20, 0.54);
  border-bottom: 1px solid var(--line);
}

.record-table .record-row {
  min-height: 50px;
  padding: 8px 12px;
  border-width: 0 0 1px;
  border-radius: 0;
  background: var(--surface-soft);
  transform: none;
}

.record-table .record-row:last-child {
  border-bottom: 0;
}

.record-table .record-row:hover {
  transform: none;
}

/* monospace for technical data */
.mono,
.record-name strong,
.record-content,
.record-ttl,
.anx-domain-name,
.zone-preview-line {
  font-family: "Cascadia Code", "Fira Code", "JetBrains Mono", ui-monospace, "Courier New", monospace;
  letter-spacing: 0;
}

.record-cell,
.record-name strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-content {
  direction: ltr;
  text-align: left;
  color: var(--text);
}

.muted-content {
  color: var(--muted);
  font-style: italic;
}

.record-ttl,
.record-details {
  color: var(--muted);
  font-size: 0.85rem;
}

.record-table .badge {
  width: max-content;
  min-width: 42px;
}

.dynamic-record-row {
  border-color: rgba(34, 211, 238, 0.28);
  background: rgba(34, 211, 238, 0.08);
}

.dynamic-record-row .badge {
  min-width: 74px;
  background: var(--blue-soft);
  color: var(--blue);
}

.record-row .row-title,
.dynamic-rule-row .row-title {
  display: flex;
  min-width: 0;
}

.record-row .row-actions,
.dynamic-rule-row .row-actions {
  flex-wrap: nowrap;
}

.record-table .row-actions {
  justify-content: flex-end;
  gap: 6px;
}

.record-table .manage-record {
  min-width: 68px;
  padding-inline: 10px;
}

.rec-del-btn {
  color: var(--danger, #e05b5b);
  border: 1px solid rgba(224, 91, 91, 0.35);
  padding-inline: 10px;
  min-width: 52px;
}

.rec-del-btn:hover {
  background: rgba(224, 91, 91, 0.1);
  border-color: rgba(224, 91, 91, 0.6);
}

/* ── Record row: more-menu dropdown ──────────────────────────────────────── */
.rec-more {
  position: relative;
}

.rec-more-btn {
  font-size: 18px;
  line-height: 1;
  padding: 4px 8px;
  letter-spacing: 1px;
}

.rec-more-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 130px;
  background: var(--surface2, var(--surface));
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  z-index: 200;
  overflow: hidden;
}

.rec-more-menu.open {
  display: block;
}

.rec-menu-del {
  display: block;
  width: 100%;
  padding: 9px 14px;
  background: none;
  border: none;
  text-align: right;
  cursor: pointer;
  font-size: 13px;
  color: var(--danger, #e05b5b);
  white-space: nowrap;
}

.rec-menu-del:hover {
  background: color-mix(in srgb, var(--danger, #e05b5b) 12%, transparent);
}

.record-editor {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  width: 100%;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.zone-preview-wrap {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--surface2, color-mix(in srgb, var(--surface) 60%, transparent));
  border: 1px solid var(--line);
  overflow-x: auto;
}

.zone-preview-lbl {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.zone-preview-line {
  font-size: 13px;
  color: var(--text);
  white-space: pre;
}

.record-editor-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.record-editor-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.record-editor-title strong,
.record-editor-title small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-editor-title small {
  color: var(--muted);
  font-size: 0.82rem;
}

.record-editor-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.dynamic-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}

.dynamic-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.dynamic-switch-track {
  position: relative;
  width: 38px;
  height: 20px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #d8e4ec;
  transition: background 0.16s ease;
}

.dynamic-switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(5, 13, 20, 0.18);
  transition: transform 0.16s ease;
}

.dynamic-switch:has(input:checked) {
  border-color: rgba(20, 141, 126, 0.42);
  color: var(--brand);
  background: rgba(20, 141, 126, 0.08);
}

.dynamic-switch input:checked + .dynamic-switch-track {
  background: var(--brand);
}

.dynamic-switch input:checked + .dynamic-switch-track::after {
  transform: translateX(18px);
}

.record-edit-grid {
  display: grid;
  grid-template-columns: minmax(120px, 0.9fr) 108px minmax(300px, 2.5fr) 86px 92px 132px;
  gap: 10px;
  align-items: center;
}

.dynamic-record-edit-grid {
  grid-template-columns: minmax(160px, 1fr) 120px 92px 132px;
}

.mx-priority-field {
  min-width: 72px;
  max-width: 92px;
  text-align: center;
}

.record-dynamic-inline {
  display: grid;
  gap: 12px;
}

.dynamic-rule-editor {
  grid-column: 1 / -1;
  width: 100%;
  margin-top: 8px;
  border-color: var(--line-strong);
  background: #fff;
}

.inline-dynamic-list {
  margin-top: 0;
}

.record-editor .hidden {
  display: none;
}

#record-dynamic-list,
#domain-nameserver-list {
  margin-top: 12px;
}

.dyn-fallback-warn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: 10px;
  border-radius: 6px;
  font-size: 13px;
  background: color-mix(in srgb, #f5a623 14%, transparent);
  border: 1px solid color-mix(in srgb, #f5a623 40%, transparent);
  color: #a86a00;
}

[data-theme="nova"] .dyn-fallback-warn {
  color: #f5c842;
  background: color-mix(in srgb, #f5a623 12%, transparent);
  border-color: color-mix(in srgb, #f5a623 30%, transparent);
}

.dyn-fallback-warn::before {
  content: "⚠";
  flex-shrink: 0;
  font-size: 15px;
}

#record-dynamic-form select,
#record-dynamic-form input,
#record-form select,
#record-form input {
  height: 44px;
}

#record-dynamic-form input:disabled {
  background: #eef4f8;
  color: var(--muted);
}

.geo-grid {
  grid-template-columns: 100px minmax(180px, 1fr) minmax(160px, 1fr) 130px;
}

.policy-grid {
  grid-template-columns: minmax(170px, 1.2fr) 130px 140px minmax(120px, 1fr) 100px 130px;
}

.target-grid {
  grid-template-columns: minmax(150px, 1fr) minmax(160px, 1fr) 110px 90px minmax(210px, 1.4fr) 130px;
}

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

.compact .row {
  min-height: 54px;
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline div {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.timeline strong {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-strong);
}

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

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

.ops-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}

.edge-push-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(180px, 0.9fr) minmax(220px, 1fr) minmax(150px, 0.7fr) 150px;
  gap: 10px;
  margin: 0 0 18px;
  align-items: end;
}

.push-progress {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.push-progress > div {
  height: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
}

.push-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
  transition: width 180ms ease;
}

.push-progress small {
  color: var(--muted);
  direction: ltr;
  text-align: left;
}

.push-progress.danger span {
  background: var(--danger);
}

.dns-lookup-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) minmax(240px, 1.3fr) 110px 90px 130px;
  gap: 10px;
  margin: 0 0 18px;
}

.terminal {
  min-height: 140px;
  max-height: 360px;
  overflow: auto;
  direction: ltr;
  text-align: left;
  white-space: pre-wrap;
  background: #102033;
  color: #d7fff8;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 14px;
  line-height: 1.65;
}

.chart-panel {
  display: grid;
  gap: 10px;
}

.bar-chart {
  display: grid;
  gap: 8px;
}

.chart-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 72px;
  align-items: center;
  gap: 10px;
  direction: ltr;
}

.chart-label {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-track {
  height: 12px;
  border-radius: 999px;
  background: var(--blue-soft);
  overflow: hidden;
}

.chart-bar {
  height: 100%;
  min-width: 3px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--blue));
}

.chart-value {
  text-align: right;
  font-weight: 800;
  color: var(--ink);
}

.analytics-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.8fr);
  gap: 16px;
}

.analytics-main-chart,
.analytics-side-chart {
  min-height: 340px;
}

.analytics-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.analytics-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: #10b981;
  letter-spacing: 0.04em;
}

.analytics-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  animation: analytics-pulse 1.8s ease-in-out infinite;
}

@keyframes analytics-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.75); }
}

.analytics-last-updated {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.analytics-controls select {
  height: 38px;
  min-width: 90px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  background: var(--surface);
  color: var(--ink);
}

.analytics-line-chart {
  display: grid;
  gap: 12px;
  min-height: 250px;
}

.analytics-chart-stage {
  position: relative;
  min-height: 220px;
  border-radius: 8px;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.analytics-chart-stage.is-live {
  transform: translateY(-2px);
  filter: drop-shadow(0 16px 26px rgba(15, 143, 131, 0.12));
}

.analytics-line-chart svg {
  width: 100%;
  min-height: 220px;
  overflow: visible;
  touch-action: none;
}

.analytics-grid-line {
  stroke: rgba(100, 116, 139, 0.22);
  stroke-dasharray: 4 6;
}

.analytics-line {
  fill: none;
  stroke: var(--brand);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 8px 12px rgba(15, 143, 131, 0.18));
}

.analytics-chart-stage.is-live .analytics-line {
  stroke-width: 5;
  filter: drop-shadow(0 12px 20px rgba(15, 143, 131, 0.25));
}

.analytics-dot {
  fill: var(--surface);
  stroke: var(--brand);
  stroke-width: 3;
  opacity: 0.82;
  transition: r 0.16s ease, opacity 0.16s ease, fill 0.16s ease, stroke-width 0.16s ease;
}

.analytics-dot.active {
  fill: #eafff8;
  opacity: 1;
  r: 6;
  stroke-width: 4;
}

.analytics-active-dot {
  fill: rgba(15, 143, 131, 0.16);
  stroke: var(--brand);
  stroke-width: 3;
  pointer-events: none;
  filter: drop-shadow(0 6px 14px rgba(15, 143, 131, 0.28));
  transition: cx 0.12s ease, cy 0.12s ease;
}

.analytics-cursor-line {
  stroke: rgba(15, 143, 131, 0.34);
  stroke-width: 2;
  stroke-dasharray: 5 7;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.16s ease, x1 0.12s ease, x2 0.12s ease;
}

.analytics-chart-stage.is-live .analytics-cursor-line {
  opacity: 1;
}

.analytics-hit-zone {
  fill: transparent;
  cursor: crosshair;
}

.analytics-float-tooltip {
  position: absolute;
  z-index: 2;
  display: grid;
  gap: 3px;
  min-width: 128px;
  padding: 9px 11px;
  border: 1px solid rgba(15, 143, 131, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 34px rgba(16, 32, 51, 0.18);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 8px) scale(0.98);
  transition: opacity 0.14s ease, transform 0.14s ease, left 0.10s ease, top 0.10s ease;
  backdrop-filter: blur(10px);
}

.analytics-chart-stage.is-live .analytics-float-tooltip {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.analytics-float-tooltip span {
  color: var(--muted);
  font-size: 11px;
  direction: ltr;
  text-align: left;
}

.analytics-float-tooltip strong {
  color: var(--ink);
  font-size: 14px;
  direction: ltr;
  text-align: left;
}

.analytics-chart-caption {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  align-items: center;
}

.analytics-chart-caption span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--surface-soft);
}

.anx-zoom-range { direction: ltr; }

.anx-zoom-btns {
  display: flex;
  gap: 4px;
  margin-right: auto;
}

.anx-zoom-btn {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  padding: 3px 10px;
  font-family: inherit;
}

.anx-zoom-btn:hover { color: var(--ink); border-color: var(--brand); }
.anx-zoom-reset { font-size: 11px; font-weight: 400; }

.analytics-donut-wrap {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.analytics-donut {
  position: relative;
  width: 150px;
  height: 150px;
}

.analytics-donut svg {
  width: 150px;
  height: 150px;
  transform: rotate(-90deg);
}

.donut-base,
.donut-segment {
  fill: none;
  stroke-width: 18;
}

.donut-base {
  stroke: var(--blue-soft);
}

.donut-segment {
  stroke-linecap: round;
  transition: stroke-width 0.18s ease, filter 0.18s ease, opacity 0.18s ease;
}

.analytics-donut:hover .donut-segment {
  stroke-width: 20;
  filter: drop-shadow(0 6px 10px rgba(16, 32, 51, 0.12));
}

.donut-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}

.donut-center strong {
  font-size: 24px;
  line-height: 1;
}

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

.donut-legend {
  display: grid;
  gap: 9px;
}

.donut-legend div {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 7px;
  transition: background 0.16s ease, transform 0.16s ease;
}

.donut-legend div:hover {
  background: var(--surface-soft);
  transform: translateX(-3px);
}

.donut-legend div > span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.donut-legend small {
  color: var(--muted);
}

.analytics-domain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}

.analytics-domain-card {
  --analytics-card-ink: #102033;
  --analytics-card-muted: #42657a;
  --analytics-card-line: rgba(30, 64, 91, 0.16);
  --analytics-card-track: #d8eef3;
  display: grid;
  gap: 13px;
  min-height: 250px;
  padding: 15px;
  border: 1px solid rgba(125, 171, 190, 0.42);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(234, 243, 247, 0.98)),
    #f4f9fb;
  color: var(--analytics-card-ink);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.analytics-domain-card:hover {
  transform: translateY(-4px);
  border-color: rgba(15, 143, 131, 0.32);
  box-shadow: 0 18px 36px rgba(16, 32, 51, 0.12);
}

.analytics-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.analytics-card-head strong {
  display: block;
  color: var(--analytics-card-ink);
  font-size: 17px;
  line-height: 1.35;
}

.analytics-card-head span {
  color: var(--analytics-card-muted);
  font-size: 12px;
  font-weight: 700;
}

.analytics-share-ring {
  --value: 0;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: conic-gradient(var(--brand) calc(var(--value) * 1%), #c8e8ef 0);
  box-shadow: 0 8px 18px rgba(16, 32, 51, 0.10);
}

.analytics-share-ring span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ecfbf7;
  color: #0f6f64;
  font-size: 11px;
  font-weight: 800;
}

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

.sparkline polyline {
  fill: none;
  stroke: #12bdda;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke-width 0.16s ease, filter 0.16s ease;
}

.analytics-domain-card:hover .sparkline polyline {
  stroke-width: 5;
  filter: drop-shadow(0 6px 10px rgba(47, 111, 163, 0.24));
}

.analytics-meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--analytics-card-track);
}

.analytics-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--blue));
  transition: filter 0.16s ease;
}

.analytics-domain-card:hover .analytics-meter span {
  filter: saturate(1.2) drop-shadow(0 4px 8px rgba(15, 143, 131, 0.22));
}

.analytics-card-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  direction: ltr;
  text-align: left;
}

.analytics-card-split h3 {
  margin: 0 0 7px;
  font-size: 12px;
  color: #57798c;
  text-transform: uppercase;
  font-weight: 900;
}

.analytics-card-split p {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--analytics-card-ink);
}

.analytics-card-split b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #173148;
  font-weight: 900;
}

.analytics-card-split p span {
  color: var(--analytics-card-muted);
  font-weight: 800;
}

.analytics-record-table {
  display: grid;
  gap: 9px;
}

.analytics-record-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(180px, 1fr) 80px;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.analytics-record-row strong,
.analytics-record-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-record-row span {
  color: var(--muted);
  font-size: 12px;
}

.analytics-record-row > div:last-child {
  text-align: left;
  font-weight: 800;
}

.analytics-record-row > div:last-child span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.analytics-record-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--blue-soft);
}

.analytics-record-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f59e0b, var(--brand));
}

/* NOC-style analytics surface */
#analytics {
  max-width: 1440px;
  margin-inline: auto;
}

#analytics .stat-card,
#analytics .panel {
  background:
    linear-gradient(180deg, rgba(47, 111, 163, 0.08), transparent 42%),
    #07141f;
  border-color: rgba(73, 114, 143, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

#analytics .stat-card::after {
  background: linear-gradient(#22d3ee, #22c55e);
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.18);
}

#analytics .panel-head h2,
#analytics .stat-card strong {
  color: #d8f3ff;
}

#analytics .panel-head p,
#analytics .stat-card span {
  color: #88a9bc;
}

#analytics .analytics-line {
  stroke: #22c55e;
  filter: drop-shadow(0 8px 12px rgba(34, 197, 94, 0.18));
}

#analytics .analytics-dot {
  fill: #07141f;
  stroke: #22c55e;
}

#analytics .analytics-active-dot {
  fill: rgba(34, 197, 94, 0.14);
  stroke: #5eead4;
}

#analytics .analytics-grid-line {
  stroke: rgba(136, 169, 188, 0.18);
}

#analytics .analytics-chart-caption span,
#analytics .analytics-float-tooltip {
  border-color: rgba(73, 114, 143, 0.52);
  background: rgba(7, 20, 31, 0.95);
  color: #d8f3ff;
}

#analytics .analytics-float-tooltip span,
#analytics .analytics-chart-caption {
  color: #88a9bc;
}

#analytics .analytics-float-tooltip strong {
  color: #e7fbff;
}

.analytics-domain-grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
}

.analytics-domain-card {
  --analytics-card-ink: #d8f3ff;
  --analytics-card-muted: #8fb0c2;
  --analytics-card-line: rgba(73, 114, 143, 0.45);
  --analytics-card-track: rgba(136, 169, 188, 0.16);
  position: relative;
  gap: 11px;
  min-height: 238px;
  padding: 14px;
  border-color: var(--analytics-card-line);
  background:
    linear-gradient(180deg, rgba(34, 211, 238, 0.055), transparent 38%),
    linear-gradient(90deg, rgba(34, 197, 94, 0.045), transparent 48%),
    #07141f;
  color: var(--analytics-card-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.analytics-domain-card::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(#22c55e, #22d3ee);
  opacity: 0.72;
}

.analytics-domain-card:hover {
  transform: translateY(-2px);
  border-color: rgba(94, 234, 212, 0.48);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    0 14px 28px rgba(0, 0, 0, 0.20);
}

.analytics-card-head {
  align-items: center;
}

.analytics-card-head strong {
  color: #e7fbff;
  font-size: 16px;
}

.analytics-card-head span {
  color: #8fb0c2;
}

.analytics-share-ring {
  width: 48px;
  height: 48px;
  background: conic-gradient(#22c55e calc(var(--value) * 1%), rgba(136, 169, 188, 0.18) 0);
  box-shadow: 0 0 0 1px rgba(94, 234, 212, 0.12), 0 8px 16px rgba(0, 0, 0, 0.16);
}

.analytics-share-ring span {
  width: 34px;
  height: 34px;
  background: #0b1b28;
  color: #86efac;
}

.sparkline {
  height: 48px;
}

.sparkline polyline {
  stroke: #38bdf8;
  stroke-width: 3;
  filter: none;
}

.analytics-domain-card:hover .sparkline polyline {
  stroke-width: 4;
  filter: drop-shadow(0 6px 10px rgba(56, 189, 248, 0.18));
}

.analytics-meter {
  height: 7px;
  background: rgba(136, 169, 188, 0.14);
}

.analytics-meter span {
  background: linear-gradient(90deg, #22c55e, #38bdf8);
}

.analytics-card-split {
  gap: 10px;
}

.analytics-card-split h3 {
  color: #7ea1b5;
  letter-spacing: 0.02em;
}

.analytics-card-split p {
  color: #d8f3ff;
}

.analytics-card-split b {
  color: #e7fbff;
}

.analytics-card-split p span {
  color: #8fb0c2;
}

.analytics-record-row {
  border-color: rgba(73, 114, 143, 0.42);
  background: #07141f;
}

.analytics-record-row strong {
  color: #d8f3ff;
}

.analytics-record-row span {
  color: #8fb0c2;
}

.analytics-record-bar {
  background: rgba(136, 169, 188, 0.14);
}

.analytics-record-bar span {
  background: linear-gradient(90deg, #f59e0b, #22c55e);
}

.ssl-request-row {
  align-items: start;
}

/* ── SSL expiry pill ───────────────────────────────────────────────────── */
.ssl-expiry-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1.6;
}

.ssl-expiry-pill.ok {
  background: rgba(32, 230, 164, 0.1);
  color: #20e6a4;
  border: 1px solid rgba(32, 230, 164, 0.22);
}

.ssl-expiry-pill.warn {
  background: rgba(251, 191, 36, 0.1);
  color: #f59e0b;
  border: 1px solid rgba(251, 191, 36, 0.22);
}

.ssl-expiry-pill.critical {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.22);
}

.ssl-expiry-pill.expired {
  background: rgba(107, 114, 128, 0.1);
  color: #9ca3af;
  border: 1px solid rgba(107, 114, 128, 0.22);
}

/* ── SSL domain card ──────────────────────────────────────────────────── */
.ssl-card-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.ssl-domain-card .row-title,
.ssl-request-row .row-title {
  align-items: flex-start;
}

.ssl-card-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
}

.ssl-card-expiry {
  opacity: 0.75;
}

.ssl-card-expiry::before {
  content: "·";
  margin-inline-end: 6px;
  opacity: 0.5;
}

/* ── SSL layout ───────────────────────────────────────────────────────── */
.ssl-layout {
  --ssl-card-height: 430px;
  align-items: stretch;
}

.ssl-domain-panel,
#ssl-domain-form {
  height: var(--ssl-card-height);
}

.ssl-domain-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.ssl-domain-panel .panel-head {
  margin-bottom: 12px;
}

.ssl-domain-panel .panel-head > div {
  display: none;
}

.ssl-scroll-list {
  min-height: 0;
  overflow: hidden auto;
  align-content: start;
  padding-inline-end: 4px;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(32, 230, 164, 0.75) rgba(5, 13, 20, 0.32);
}

.ssl-scroll-list::-webkit-scrollbar {
  width: 9px;
}

.ssl-scroll-list::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(5, 13, 20, 0.32);
}

.ssl-scroll-list::-webkit-scrollbar-thumb {
  border: 2px solid rgba(5, 13, 20, 0.32);
  border-radius: 999px;
  background: rgba(32, 230, 164, 0.72);
}

#ssl-domain-form {
  align-self: stretch;
  overflow: hidden auto;
}

.ssl-detail-body {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.ssl-detail-body.hidden {
  display: none;
}

.ssl-output-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}

.ssl-output-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  direction: ltr;
  text-align: left;
}

.ssl-output-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ssl-output-head span {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  font-family: "FireDNSLatin", monospace;
}

.ssl-output-item textarea {
  min-height: 170px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
  direction: ltr;
  text-align: left;
  resize: vertical;
  margin: 0;
}

.toggle-ssl-detail .ui-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.toggle-ssl-detail.expanded .ui-icon {
  transform: rotate(180deg);
}

.copy-ssl-value {
  padding: 3px 6px;
  min-height: unset;
  opacity: 0.6;
  transition: opacity 0.15s ease;
}

.copy-ssl-value:hover {
  opacity: 1;
}

.copy-ssl-value .ui-icon {
  display: flex;
  width: 14px;
  height: 14px;
}

.app-shell .ssl-output-grid,
.app-shell .ssl-output-item,
.app-shell .ssl-output-item textarea {
  direction: ltr !important;
  text-align: left !important;
}

.ssl-install-tools {
  width: 100%;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.ssl-install-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.brand-install {
  border: 1px solid #d86b1f;
  background: #ff8a22;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: 0 8px 18px rgba(216, 107, 31, 0.22);
}

.brand-install:hover,
.brand-install.active {
  background: #d86b1f;
}

.cpanel-install-form,
.whm-install-form {
  width: 100%;
}

.compact-head {
  margin-bottom: 12px;
}

.compact-head h3 {
  margin: 0;
  font-size: 15px;
}

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

.cpanel-install-grid label {
  margin: 0;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.inline-check input {
  width: auto;
}

.cpanel-install-output {
  margin-top: 12px;
}

body:has(#audit:not(.hidden)) {
  --audit-bg: #071018;
  --audit-panel: #0b1722;
  --audit-panel-2: #101f2c;
  --audit-line: #22384a;
  --audit-line-hot: #6e2a2a;
  --audit-text: #d9f2f4;
  --audit-muted: #83a4b4;
  --audit-green: #25f2a4;
  --audit-cyan: #22d3ee;
  --audit-amber: #f6b84a;
  --audit-red: #ff4d4d;
  background:
    linear-gradient(90deg, rgba(34, 211, 238, 0.07) 1px, transparent 1px),
    linear-gradient(rgba(37, 242, 164, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 18% 0%, rgba(255, 77, 77, 0.14), transparent 28%),
    linear-gradient(135deg, #06101a, #0a1722 45%, #071018);
  background-size: 44px 44px, 44px 44px, auto, auto;
}

body.audit-page .topbar-title,
body:has(#audit:not(.hidden)) .topbar > div:not(.session) {
  display: none !important;
}

body.audit-page .topbar {
  justify-content: flex-start;
  margin-bottom: 18px;
  direction: ltr;
}

body.audit-page .session {
  margin-left: 0;
  margin-right: auto;
  border-color: rgba(37, 242, 164, 0.34);
  background: rgba(5, 13, 20, 0.78);
  color: var(--audit-text);
  direction: ltr;
}

body.audit-page .session span {
  color: var(--audit-muted);
}

#audit {
  min-height: calc(100vh - 154px);
}

#audit > .panel {
  min-height: calc(100vh - 194px);
  overflow: hidden;
  border: 1px solid var(--audit-line);
  background:
    linear-gradient(180deg, rgba(34, 211, 238, 0.06), transparent 34%),
    var(--audit-panel);
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

#audit .panel-head {
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--audit-line);
}

#audit .panel-head h2 {
  color: var(--audit-text);
  text-shadow: 0 0 22px rgba(34, 211, 238, 0.16);
}

#audit .panel-head p {
  color: var(--audit-muted);
}

#audit button,
#audit button.secondary,
#audit button.ghost {
  border: 1px solid rgba(37, 242, 164, 0.38);
  background: linear-gradient(135deg, #0f2e35, #123d34);
  color: #dffff2;
  box-shadow: 0 0 0 1px rgba(37, 242, 164, 0.08), 0 10px 28px rgba(0, 0, 0, 0.24);
}

#audit button:hover {
  border-color: rgba(37, 242, 164, 0.72);
  background: linear-gradient(135deg, #143f46, #185142);
}

.audit-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.audit-stats div {
  min-height: 76px;
  padding: 14px 15px;
  border: 1px solid var(--audit-line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
}

.audit-stats span,
.audit-meta-grid b {
  display: block;
  color: var(--audit-muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.audit-stats strong {
  display: block;
  margin-top: 7px;
  color: var(--audit-green);
  font: 900 30px/1 "FireDNSLatin", Consolas, monospace;
}

.audit-stats .audit-hot strong {
  color: var(--audit-red);
}

.audit-console {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  margin-top: 0;
  direction: ltr;
}

.audit-search-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(150px, 190px) minmax(150px, 180px) auto;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--audit-line);
  border-radius: 8px;
  background: rgba(5, 13, 20, 0.72);
}

.audit-search-grid input,
.audit-search-grid select {
  border-color: #264255;
  background: #07131e;
  color: var(--audit-text);
  direction: rtl;
}

.audit-search-grid input::placeholder {
  color: #607f91;
}

.audit-list {
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 390px);
  min-height: 440px;
  overflow: auto;
  padding: 5px 8px 5px 4px;
  scrollbar-color: var(--audit-green) #0a1520;
}

.audit-row {
  position: relative;
  display: grid;
  grid-template-rows: auto auto;
  gap: 13px;
  min-height: 168px;
  margin: 3px 8px 8px 0;
  padding: 26px 26px 30px;
  overflow: visible;
  border: 1px solid var(--audit-line);
  border-inline-start-width: 6px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(37, 242, 164, 0.055), transparent 36%),
    var(--audit-panel-2);
  color: var(--audit-text);
  direction: ltr;
  transform: none;
}

.audit-row:hover {
  border-color: #386077;
  background:
    linear-gradient(90deg, rgba(34, 211, 238, 0.08), transparent 42%),
    #122535;
  transform: none;
}

.audit-severity-high {
  border-inline-start-color: var(--audit-red);
}

.audit-severity-medium {
  border-inline-start-color: var(--audit-amber);
}

.audit-severity-low {
  border-inline-start-color: var(--audit-green);
  padding-block: 28px 32px;
}

.audit-event-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 34px;
}

.audit-event-action {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 11px;
}

.audit-severity-dot {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--audit-green);
  box-shadow: 0 0 18px currentColor;
}

.audit-severity-high .audit-severity-dot {
  background: var(--audit-red);
}

.audit-severity-medium .audit-severity-dot {
  background: var(--audit-amber);
}

.audit-action {
  max-width: 340px;
  min-height: 29px;
  padding: 7px 10px;
  overflow: hidden;
  border: 1px solid rgba(34, 211, 238, 0.26);
  border-radius: 6px;
  background: rgba(34, 211, 238, 0.08);
  color: var(--audit-cyan);
  font: 900 12px/1.2 "FireDNSLatin", Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-event-action strong {
  min-width: 0;
  overflow: hidden;
  color: #f4fbff;
  font: 900 16px/1.35 "FireDNSLatin", Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-event-main time {
  color: var(--audit-muted);
  font: 800 13px/1 "FireDNSLatin", Consolas, monospace;
  white-space: nowrap;
}

.audit-meta-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.15fr) 130px 190px minmax(280px, 1fr);
  gap: 10px;
}

.audit-meta-grid span {
  min-width: 0;
  min-height: 62px;
  padding: 11px 12px;
  overflow: hidden;
  border: 1px solid rgba(131, 164, 180, 0.20);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.18);
  color: #cde6ec;
  font: 800 13px/1.45 "FireDNSLatin", Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-detail-panel {
  display: grid;
  gap: 10px;
  min-width: 0;
  min-height: 24px;
}

.audit-payload-btn {
  width: max-content;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(246, 184, 74, 0.32);
  background: rgba(246, 184, 74, 0.08);
  color: var(--audit-amber);
  font: 900 12px/1 "FireDNSLatin", Consolas, monospace;
}

.audit-payload-btn:hover {
  border-color: rgba(246, 184, 74, 0.72);
  background: rgba(246, 184, 74, 0.14);
}

.audit-payload-modal pre {
  max-width: 100%;
  max-height: min(70vh, 720px);
  overflow: auto;
  margin: 0;
  padding: 14px;
  border: 1px solid rgba(34, 211, 238, 0.22);
  border-radius: 8px;
  background: #050b11;
  color: #b7ffe4;
  direction: ltr;
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.audit-change {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid rgba(246, 184, 74, 0.26);
  border-radius: 8px;
  background: rgba(246, 184, 74, 0.08);
}

.audit-change b {
  color: var(--audit-amber);
  font: 900 12px/1.2 "FireDNSLatin", Consolas, monospace;
}

.audit-change small,
.audit-empty-detail {
  min-width: 0;
  color: #f6d89a;
  direction: ltr;
  text-align: left;
  overflow-wrap: anywhere;
  font: 700 12px/1.5 "FireDNSLatin", Consolas, monospace;
}

#service-dns-output {
  min-height: 96px;
  margin-bottom: 0;
}

.ssl-error-output {
  width: 100%;
  margin: 10px 0 0;
  color: #ffd0d0;
}

.ssl-progress {
  width: 100%;
  margin-top: 10px;
}

.ssl-progress strong {
  display: block;
  margin-bottom: 6px;
}

.ssl-progress pre {
  max-height: 220px;
  margin: 0;
  overflow: auto;
}

/* ── SSL manual challenge ─────────────────────────────────────────────── */
.ssl-manual-challenge {
  width: 100%;
  margin-top: 12px;
  padding: 14px 16px;
  background: rgba(32, 230, 164, 0.05);
  border: 1px solid rgba(32, 230, 164, 0.18);
  border-radius: 8px;
}

.ssl-manual-title {
  margin: 0 0 10px;
  font-size: 13px;
  opacity: 0.85;
}

.ssl-manual-record {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

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

.ssl-manual-label {
  font-size: 11px;
  opacity: 0.6;
  min-width: 90px;
}

.ssl-manual-value {
  font-family: monospace;
  font-size: 13px;
  background: rgba(0, 0, 0, 0.25);
  padding: 3px 8px;
  border-radius: 4px;
  word-break: break-all;
  flex: 1;
}

.ssl-manual-actions {
  margin-top: 8px;
  justify-content: flex-start;
}

.ssl-manual-confirmed {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--accent);
  opacity: 0.85;
}

.danger-button {
  background: var(--red);
}

.danger-button:hover {
  background: #a82e23;
  box-shadow: 0 8px 18px rgba(196, 56, 42, 0.16);
}

.select-role {
  width: 130px;
}

.toast {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 20;
  max-width: 460px;
  background: var(--sidebar);
  color: #fff;
  padding: 13px 15px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.toast.danger {
  background: var(--red);
}

.brand-mark.has-logo {
  overflow: hidden;
  background: var(--surface);
}

.brand-mark.has-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sidebar-toggle {
  display: none;
}

.sidebar-scrim {
  display: none;
}

.panel,
.stat-card,
.table-list,
.content-grid,
.record-grid,
.record-edit-grid,
.record-dynamic-grid,
.geo-grid,
.policy-grid,
.target-grid,
.edge-push-grid,
.dns-lookup-grid,
.analytics-hero,
.analytics-card,
.audit-event,
.modal-panel {
  min-width: 0;
}

.app-shell .panel,
.app-shell .stat-card,
.app-shell .modal-panel {
  background:
    linear-gradient(180deg, rgba(34, 211, 238, 0.045), transparent 38%),
    var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

.app-shell .row,
.app-shell .record-row,
.app-shell .dynamic-rule-row,
.app-shell .ns-check-row,
.app-shell .analytics-record-row,
.app-shell .ops-grid div,
.app-shell .modal-preview,
.app-shell .record-grid,
.app-shell .record-dynamic-grid {
  background:
    linear-gradient(90deg, rgba(32, 230, 164, 0.035), transparent 36%),
    var(--surface-soft);
  border-color: var(--line);
}

.app-shell .row:hover,
.app-shell .record-row:hover,
.app-shell .dynamic-rule-row:hover,
.app-shell .ns-check-row:hover,
.app-shell .analytics-record-row:hover,
.app-shell .ops-grid div:hover {
  background:
    linear-gradient(90deg, rgba(34, 211, 238, 0.075), transparent 42%),
    #122535;
  border-color: var(--line-strong);
}

.app-shell .table-list,
.app-shell .compact-user-list {
  scrollbar-color: var(--brand) #0a1520;
}

.app-shell .badge,
.app-shell .analytics-share-ring span {
  background: rgba(32, 230, 164, 0.11);
  border: 1px solid rgba(32, 230, 164, 0.24);
  color: var(--brand-strong);
}

.app-shell .chart-track,
.app-shell .analytics-record-bar,
.app-shell .analytics-meter {
  background: rgba(34, 211, 238, 0.10);
}

.app-shell .terminal,
.app-shell pre,
.app-shell code {
  background: #050b11;
  color: #b7ffe4;
  border-color: rgba(34, 211, 238, 0.18);
}

.app-shell input,
.app-shell select,
.app-shell textarea {
  background: #07131e;
  border-color: #264255;
  color: var(--ink);
}

.app-shell input:focus,
.app-shell select:focus,
.app-shell textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(32, 230, 164, 0.13);
}

.app-shell button.ghost {
  background: rgba(5, 13, 20, 0.72);
  border-color: var(--line);
  color: var(--ink-soft);
}

.app-shell button.ghost:hover {
  background: rgba(15, 32, 45, 0.92);
  border-color: var(--line-strong);
  color: var(--ink);
}

body.nav-collapsed .app-shell {
  grid-template-columns: 72px minmax(0, 1fr);
}

body.nav-collapsed .sidebar {
  padding-inline: 15px;
}

body.nav-collapsed .side-brand {
  justify-content: center;
}

body.nav-collapsed .side-brand div:not(.brand-mark),
body.nav-collapsed .nav-item span:not(.ui-icon),
body.nav-collapsed .nav-item:not(:has(.ui-icon)),
body.nav-collapsed .nav-sep {
  display: none;
}

body.nav-collapsed .nav-item {
  justify-content: center;
  padding: 0;
  width: 42px;
}

body.nav-collapsed .sidebar-clock {
  display: none;
}

body.nav-collapsed .nav-collapse-btn {
  justify-content: center;
  padding: 0;
  width: 42px;
}

body.nav-collapsed .nav-collapse-icon {
  transform: rotate(180deg);
}

body.nav-collapsed .nav-collapse-label {
  display: none;
}

body.nav-collapsed .theme-toggle-btn {
  justify-content: center;
  padding: 0;
  width: 42px;
}

body.nav-collapsed .theme-toggle-label {
  display: none;
}

.settings-child-nav {
  padding-inline-start: 28px;
  font-size: 11px;
  font-weight: 500;
  color: rgba(200, 217, 232, 0.75);
  min-height: 28px;
}

.branding-logo-preview {
  min-height: 78px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--surface-soft);
}

.branding-logo-preview img {
  max-width: 170px;
  max-height: 64px;
}

.settings-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.settings-menu-panel {
  grid-column: 1 / -1;
}

.settings-menu-panel .panel-head {
  align-items: center;
}

.menu-editor-actions {
  flex: 0 0 auto;
}

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

.menu-root-drop {
  padding: 12px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  background: rgba(8, 18, 28, 0.64);
}

.menu-editor-rows {
  display: grid;
  gap: 10px;
}

.menu-editor-row {
  display: grid;
  grid-template-columns: 34px 30px minmax(260px, 1fr) 118px auto;
  gap: 10px;
  align-items: center;
  margin-inline-start: calc(var(--menu-level, 0) * 26px);
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(32, 230, 164, 0.035), transparent 38%),
    var(--surface-soft);
}

.menu-editor-row.dragging {
  opacity: 0.55;
}

.drag-handle {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(3, 10, 16, 0.36);
  color: var(--muted);
  cursor: grab;
  text-align: center;
}

.menu-title-field {
  display: grid;
  gap: 5px;
  margin: 0;
}

.menu-title-field span,
.menu-icon-field span,
.menu-size-field span,
.menu-open-field span,
.menu-url-field span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
}

.menu-title-field input,
.menu-icon-field select,
.menu-size-field input,
.menu-open-field select,
.menu-url-field input {
  min-width: 0;
  height: 36px;
}

.menu-icon-field,
.menu-size-field,
.menu-open-field,
.menu-url-field {
  display: grid;
  gap: 5px;
  margin: 0;
}

.menu-advanced-fields {
  grid-column: 3 / -1;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 86px 110px minmax(180px, 1.2fr);
  gap: 10px;
  align-items: end;
  padding-top: 2px;
}

.menu-tab-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(2, 9, 15, 0.30);
  direction: ltr;
  color: var(--muted);
  font-size: 11px;
}

.menu-child-drop {
  min-height: 34px;
  padding: 0 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  box-shadow: none;
}

.menu-child-drop:hover {
  color: var(--ink);
  border-color: var(--brand);
  background: rgba(32, 230, 164, 0.08);
}

.menu-row-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.menu-delete-item {
  min-height: 34px;
  padding-inline: 10px;
  color: #ffb4aa;
}

.menu-child-placeholder {
  min-height: 1px;
}

.fresh-highlight {
  position: relative;
  animation: fresh-pulse 1.8s ease both;
}

.fresh-highlight::after {
  content: "";
  position: absolute;
  inset: -2px;
  pointer-events: none;
  border-radius: 10px;
  border: 2px solid var(--brand);
  animation: fresh-ring 1.8s ease both;
}

@keyframes fresh-pulse {
  0% { background: var(--brand-soft); }
  100% { background: var(--surface); }
}

@keyframes fresh-ring {
  0% { opacity: 1; transform: scale(0.98); }
  100% { opacity: 0; transform: scale(1.03); }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(16, 32, 51, 0.52);
  backdrop-filter: blur(8px);
}

.live-modal-backdrop {
  background:
    linear-gradient(135deg, rgba(16, 32, 51, 0.68), rgba(7, 17, 29, 0.58)),
    rgba(16, 32, 51, 0.38);
}

.live-modal-backdrop.closing {
  opacity: 0;
  transition: opacity 0.14s ease;
}

.modal-panel {
  width: min(680px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 28px 70px rgba(16, 32, 51, 0.28);
  padding: 20px;
  animation: card-enter 0.18s ease both;
}

.action-modal-panel,
.delete-user-modal-panel,
.domain-owner-modal-panel {
  position: relative;
  overflow: hidden auto;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(145deg, rgba(32, 230, 164, 0.62), rgba(34, 211, 238, 0.48), rgba(246, 184, 74, 0.28)) border-box;
  border: 1px solid transparent;
}

.action-modal-panel::before,
.delete-user-modal-panel::before,
.domain-owner-modal-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(32, 230, 164, 0.08), transparent 38%),
    linear-gradient(0deg, rgba(34, 211, 238, 0.06), transparent 50%);
}

.action-modal-panel > *,
.delete-user-modal-panel > *,
.domain-owner-modal-panel > * {
  position: relative;
}

.action-modal-panel {
  width: min(520px, 100%);
}

.delete-user-modal-panel {
  width: min(760px, 100%);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.modal-head h2 {
  margin-bottom: 5px;
  font-size: 22px;
}

.modal-head p:last-child {
  color: var(--muted);
  margin: 0;
  direction: ltr;
  text-align: right;
}

.modal-form {
  display: grid;
  gap: 13px;
}

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

.modal-preview {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

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

.modal-preview strong {
  direction: ltr;
  text-align: left;
  overflow-wrap: anywhere;
}

.modal-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 3px;
}

.password-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
  align-items: center;
}

.password-input-row .icon-only {
  height: 42px;
}

.password-input-row svg {
  width: 18px;
  height: 18px;
}

.password-generator-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.generated-password-preview {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(18, 135, 125, 0.24);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(223, 244, 240, 0.88), rgba(227, 238, 247, 0.70));
}

.generated-password-preview span {
  color: var(--muted);
  font-size: 12px;
}

.generated-password-preview strong {
  direction: ltr;
  text-align: left;
  overflow-wrap: anywhere;
  font-family: "FireDNSLatin", Consolas, monospace;
  letter-spacing: 0;
}

.owner-search-shell {
  position: relative;
  margin-bottom: 12px;
}

.owner-search-shell::before {
  content: "";
  position: absolute;
  inset-inline-start: 13px;
  top: 50%;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  border: 2px solid var(--muted);
  border-radius: 50%;
  opacity: 0.72;
}

.owner-search-shell::after {
  content: "";
  position: absolute;
  inset-inline-start: 27px;
  top: 27px;
  width: 8px;
  height: 2px;
  transform: rotate(45deg);
  border-radius: 999px;
  background: var(--muted);
  opacity: 0.72;
}

.owner-search-shell input {
  padding-inline-start: 42px;
}

.owner-selected-box,
.danger-summary {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(32, 230, 164, 0.22);
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--ink);
}

.owner-selected-box {
  display: grid;
  gap: 4px;
}

.owner-selected-box span,
.danger-summary small,
.owner-user-main small,
.owner-user-meta small,
.soft-preview small {
  color: var(--muted);
  font-size: 12px;
}

.danger-summary {
  border-color: rgba(196, 56, 42, 0.30);
  background: rgba(196, 56, 42, 0.12);
}

.owner-user-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  padding: 2px 2px 8px;
}

.compact-user-list {
  max-height: 260px;
}

.owner-user-option {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  width: 100%;
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  text-align: right;
  box-shadow: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.owner-user-option:hover,
.owner-user-option.selected {
  border-color: var(--brand);
  background: rgba(32, 230, 164, 0.10);
  color: var(--ink);
  box-shadow: 0 4px 16px rgba(32, 230, 164, 0.12);
}

.owner-user-option.selected {
  border-color: rgba(32, 230, 164, 0.55);
  background: rgba(32, 230, 164, 0.14);
}

.owner-avatar {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--blue));
  color: #fff;
  font-weight: 800;
}

.owner-user-main,
.owner-user-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.owner-user-main strong,
.owner-user-main small,
.owner-user-meta b,
.owner-user-meta small {
  overflow-wrap: anywhere;
}

.owner-user-meta {
  justify-items: end;
  color: var(--ink-soft);
}

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

.segmented-choice label {
  position: relative;
  display: block;
  margin: 0;
  cursor: pointer;
}

.segmented-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-choice span {
  display: grid;
  place-items: center;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink-soft);
  text-align: center;
}

.segmented-choice input:checked + span {
  border-color: rgba(18, 135, 125, 0.45);
  background: var(--brand-soft);
  color: var(--brand-strong);
  box-shadow: inset 0 0 0 1px rgba(18, 135, 125, 0.14);
}

.transfer-user-section.hidden {
  display: none;
}

.icon-only {
  width: 42px;
  padding: 0;
}

@keyframes auth-enter {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes metric-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slow-drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(22px, 18px, 0) scale(1.04);
  }
}

@keyframes mark-pulse {
  0%,
  100% {
    box-shadow: 0 16px 34px rgba(15, 143, 131, 0.24);
  }
  50% {
    box-shadow: 0 20px 42px rgba(35, 103, 199, 0.26);
  }
}

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

@keyframes scan-line {
  0%,
  35% {
    transform: translateX(90%);
  }
  70%,
  100% {
    transform: translateX(-90%);
  }
}

@keyframes node-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.18);
  }
}

@keyframes data-flow {
  0%,
  100% {
    opacity: 0.36;
    background-position: -120px 0;
  }
  50% {
    opacity: 1;
    background-position: 120px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 1380px) {
  .auth-shell {
    grid-template-columns: minmax(370px, 420px) minmax(300px, 400px);
  }

  .auth-brand {
    padding: clamp(28px, 3vw, 42px);
  }

  .auth-brand h1 {
    font-size: clamp(44px, 4vw, 62px);
  }
}

@media (max-width: 1080px) {
  .content-grid,
  .content-grid.wide-left {
    grid-template-columns: 1fr;
  }

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

  #billing > .content-grid.wide-left,
  #billing > .content-grid.wide-left.billing-wallet-grid,
  .billing-wallet-panel .ops-grid {
    grid-template-columns: 1fr;
  }

  .billing-plan-panel #plan-form,
  .plan-list,
  .plan-period-prices,
  .plan-card .plan-edit-grid,
  #users > .content-grid.wide-left,
  .user-edit-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .user-summary {
    grid-template-columns: 42px minmax(0, 1fr) max-content;
  }

  .user-meta {
    grid-column: 2 / -1;
  }

  .billing-plan-panel #plan-form button {
    grid-column: span 2;
  }

  .plan-feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .billing-plan-panel,
  .billing-wallet-panel,
  #wallet-charge-form,
  #zarinpal-settings-form {
    padding: 16px;
  }

  .billing-plan-panel #plan-form,
  .plan-list,
  .plan-feature-grid,
  .plan-period-prices,
  .plan-card .plan-edit-grid,
  .billing-wallet-panel .ops-grid,
  .user-row,
  .user-summary,
  .user-edit-panel,
  .cluster-metrics {
    grid-template-columns: 1fr;
  }

  .billing-plan-panel #plan-form button,
  .future-pricing {
    grid-column: auto;
  }

  .plan-card-actions,
  .plan-price {
    flex-direction: column;
    align-items: stretch;
  }

  .plan-price strong {
    text-align: right;
  }

  .user-actions,
  .user-status {
    justify-self: stretch;
  }

  .user-actions .icon-only {
    flex: 1 1 0;
  }

  .user-meta {
    grid-column: auto;
  }

  .cluster-card-head {
    flex-direction: column;
  }
}

@media (max-width: 980px) {
  .sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
  }

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

  .auth-shell {
    grid-template-areas:
      "auth-command"
      "auth-form";
    background:
      linear-gradient(180deg, rgba(8, 19, 31, 0.98), rgba(19, 40, 58, 0.94) 42%, rgba(238, 245, 246, 0.98) 42%),
      var(--auth-night);
    gap: 24px;
    width: min(560px, calc(100% - 28px));
    margin-inline: auto;
    padding: 28px 0;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .auth-brand {
    min-height: auto;
    padding: 26px;
    text-align: center;
    justify-items: center;
  }

  .auth-brand .brand-mark {
    margin: 0 auto;
  }

  .auth-brand h1 {
    font-size: 42px;
  }

  .lead {
    font-size: 15px;
  }

  .auth-visual,
  .auth-metrics {
    display: none;
  }

  .auth-command-center {
    width: 100%;
    min-height: 360px;
  }

  .auth-card {
    width: 100%;
  }

  .auth-command-center::after {
    display: none;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    width: min(84vw, 320px);
    height: 100dvh;
    overflow-y: auto;
    transform: translateX(-104%);
    transition: transform 0.18s ease;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar-clock {
    margin-top: 18px;
  }

  [dir="rtl"] .sidebar,
  html[dir="rtl"] .sidebar,
  body[dir="rtl"] .sidebar {
    inset: 0 0 0 auto;
    transform: translateX(104%);
  }

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

  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: block;
    pointer-events: none;
    background: rgba(3, 9, 14, 0);
    transition: background 0.18s ease;
  }

  body.nav-open .sidebar-scrim {
    pointer-events: auto;
    background: rgba(3, 9, 14, 0.62);
  }

  body.nav-collapsed .sidebar {
    display: none;
  }

  body.nav-collapsed .workspace {
    margin-inline-start: 0;
  }

  .nav {
    grid-template-columns: 1fr;
  }

  .settings-child-nav {
    padding-inline-start: 34px;
  }

  .record-grid,
  .record-edit-grid,
  .record-dynamic-grid,
  .geo-grid,
  .policy-grid,
  .target-grid,
  .edge-push-grid,
  .dns-lookup-grid,
  .split-inputs,
  .analytics-hero,
  .analytics-donut-wrap,
  .analytics-card-split,
  .analytics-record-row,
  .ssl-output-grid,
  .cpanel-install-grid {
    grid-template-columns: 1fr;
  }

  .records-toolbar {
    grid-template-columns: minmax(0, 1fr) max-content;
  }

  .ssl-domain-panel {
    height: auto;
  }

  .ssl-scroll-list {
    max-height: 58svh;
  }

  #ssl-domain-form {
    height: auto;
  }

  .analytics-record-row > div:last-child {
    text-align: right;
  }

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

  .audit-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  body:has(#auth-view:not(.hidden)) {
    min-height: 100svh;
    min-height: 100dvh;
    overflow-x: hidden;
  }

  .auth-shell {
    min-height: 100svh;
    min-height: 100dvh;
    width: 100%;
    grid-template-areas: "auth-form";
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: max(14px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    background:
      radial-gradient(circle at 72% 0%, rgba(40, 211, 176, 0.18), transparent 34%),
      radial-gradient(circle at 0% 100%, rgba(102, 135, 255, 0.14), transparent 30%),
      linear-gradient(180deg, #07111d 0%, #0b1826 48%, #0f2030 100%);
  }

  .auth-shell::before {
    width: calc(100% - 22px);
    height: calc(100% - 28px);
    border-radius: 18px;
    opacity: 0.52;
  }

  .auth-shell::after {
    display: none;
  }

  .auth-brand {
    padding: 8px;
  }

  .auth-command-center {
    display: none;
  }

  .auth-card {
    width: min(100%, 430px);
    max-height: calc(100svh - 28px);
    max-height: calc(100dvh - 28px);
    overflow: auto;
    padding: 18px;
    border-radius: 16px;
    box-shadow: 0 22px 54px rgba(0, 0, 0, 0.30);
    -webkit-overflow-scrolling: touch;
  }

  .auth-form h2 {
    margin-bottom: 14px;
    font-size: 21px;
  }

  .security-ribbon {
    margin-bottom: 12px;
    padding: 9px 10px;
    font-size: 12px;
    line-height: 1.65;
  }

  .auth-form label {
    gap: 6px;
    margin-bottom: 10px;
    font-size: 12px;
  }

  .auth-form input,
  .auth-form select,
  .auth-form button {
    min-height: 46px;
    height: 46px;
    font-size: 16px;
  }

  .auth-inline-actions {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 10px;
  }

  .route-board {
    min-height: 190px;
  }

  .route-node {
    width: 64px;
    height: 36px;
    font-size: 11px;
  }

  .route-dns {
    width: 72px;
    height: 72px;
    inset: calc(50% - 36px) auto auto calc(50% - 36px);
  }

  .auth-brand h1 {
    font-size: 40px;
  }

  .auth-visual {
    height: 150px;
  }

  .signal-core {
    width: 62px;
    height: 62px;
    inset-inline-start: calc(50% - 31px);
    top: 44px;
  }

  .auth-metrics {
    grid-template-columns: 1fr;
  }

  .captcha-box {
    grid-template-columns: minmax(0, 1fr) 84px 42px;
    gap: 7px;
    padding: 8px;
  }

  .captcha-box input {
    min-height: 42px;
    height: 42px;
    font-size: 16px;
  }

  .captcha-box button {
    min-height: 42px;
    height: 42px;
  }

  .workspace {
    padding: 16px;
    height: 100dvh;
  }

  .panel {
    padding: 14px;
  }

  .ops-actions {
    flex-direction: column;
  }

  .ops-actions button {
    width: 100%;
  }

  .panel-head,
  .row {
    display: grid;
  }

  .topbar {
    height: auto;
    min-height: 56px;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: -16px;
    margin-inline: -16px;
    padding: 10px 16px;
  }

  .topbar-title {
    min-width: 0;
    flex: 1 1 auto;
  }

  .topbar h1 {
    font-size: 18px;
    overflow-wrap: anywhere;
  }

  .session {
    order: -1;
    width: 100%;
    justify-content: space-between;
  }

  .session-info {
    max-width: none;
    flex: 1 1 auto;
  }

  .row-actions {
    justify-content: stretch;
  }

  .row-actions button,
  .row-actions select {
    width: 100%;
  }

  .menu-editor-row {
    grid-template-columns: 34px minmax(0, 1fr);
    margin-inline-start: 0;
  }

  .menu-editor-row .ui-icon,
  .menu-title-field,
  .menu-icon-field,
  .menu-size-field,
  .menu-open-field,
  .menu-url-field,
  .menu-tab-key,
  .menu-advanced-fields,
  .menu-row-tools {
    grid-column: 2;
  }

  .menu-advanced-fields {
    grid-template-columns: 1fr;
  }

  .menu-row-tools {
    justify-content: stretch;
    flex-wrap: wrap;
  }

  .ip-rule-inline {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .analytics-controls,
  .analytics-card-head {
    display: grid;
  }

  .analytics-controls select,
  .analytics-controls button {
    width: 100%;
  }

  .analytics-domain-grid {
    grid-template-columns: 1fr;
  }

  .audit-search-grid {
    grid-template-columns: 1fr;
  }

  .audit-stats,
  .audit-event-main,
  .audit-meta-grid,
  .audit-change {
    grid-template-columns: 1fr;
  }

  .audit-event-main time {
    white-space: normal;
  }

  .modal-backdrop {
    padding: 12px;
    align-items: end;
  }

  .modal-panel {
    max-height: calc(100vh - 24px);
    padding: 16px;
  }

  .modal-head,
  .modal-actions,
  .password-generator-bar,
  .owner-user-option {
    display: grid;
  }

  .modal-actions button {
    width: 100%;
  }

  .owner-user-option {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .owner-user-meta {
    grid-column: 2;
    justify-items: start;
  }

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

  #register-form {
    max-height: calc(100svh - 28px);
    max-height: calc(100dvh - 28px);
  }
}

@media (max-width: 390px) {
  .auth-shell {
    padding-inline: max(9px, env(safe-area-inset-left));
  }

  .auth-card {
    padding: 15px;
    border-radius: 14px;
  }

  .captcha-box {
    grid-template-columns: minmax(0, 1fr) 42px;
  }

  .captcha-box div {
    grid-column: 1 / -1;
  }

  .captcha-box input {
    min-width: 0;
  }

  .security-ribbon {
    font-size: 11.5px;
  }
}

@media (max-height: 560px) and (max-width: 760px) {
  .auth-shell {
    align-items: start;
  }

  .auth-card {
    max-height: none;
  }
}

/* ── Ticketing ────────────────────────────────────────────────────────────── */

/* ── Shared: Status badges & dept tags ──────────────────────────────────── */
.ticket-status-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.status-open    { background: rgba(32,230,164,0.14); color: #20e6a4; }
.status-pending { background: rgba(246,184,74,0.14); color: #f6b84a; }
.status-resolved{ background: rgba(34,211,238,0.14); color: #22d3ee; }
.status-closed  { background: rgba(130,164,181,0.14); color: var(--muted); }

.ticket-dept-tag {
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 20px;
  background: var(--brand-soft);
  color: var(--brand);
  white-space: nowrap;
}

.compact-select {
  font-size: 12.5px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink);
  cursor: pointer;
}

.panel-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ── Ticket new button ───────────────────────────────────────────────────── */
.ticket-new-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  font-size: 13.5px;
  font-weight: 700;
  border-radius: 8px;
  background: var(--brand);
  color: #061018;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, opacity 0.15s;
  flex-shrink: 0;
}

.ticket-new-btn:hover {
  background: var(--brand-strong);
}

/* ── Ticket toolbar ──────────────────────────────────────────────────────── */
.ticket-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0 12px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.ticket-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ticket-toolbar-end {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ticket-toolbar-end button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

/* ── View 1: Ticket Table ────────────────────────────────────────────────── */
.ticket-table {
  margin-top: 0;
}

.ticket-table-head,
.ticket-table-row {
  display: grid;
  grid-template-columns: 52px 1fr 140px 100px 148px;
  align-items: center;
  gap: 0 12px;
  padding: 10px 16px;
}

.ticket-table-head {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.ticket-table-row {
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.12s;
  border-radius: 0;
  font-size: 13.5px;
}

.ticket-table-row:hover {
  background: var(--surface-soft);
}

.ticket-table-row:last-child {
  border-bottom: none;
}

.tcol-id {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.tcol-subject {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tcol-user {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tcol-date {
  font-family: 'Courier New', monospace;
  font-size: 11.5px;
  color: var(--muted);
  text-align: end;
}

/* Staff mode (operator): 6 columns */
#tickets[data-staff-mode] .ticket-table-head,
#tickets[data-staff-mode] .ticket-table-row {
  grid-template-columns: 52px 1fr 130px 160px 100px 148px;
}

/* Admin mode: 7 columns — adds actions column */
#tickets[data-admin-mode] .ticket-table-head,
#tickets[data-admin-mode] .ticket-table-row {
  grid-template-columns: 52px 1fr 130px 160px 100px 148px 36px;
}

.tcol-actions {
  display: flex;
  align-items: center;
  justify-content: center;
}

.ticket-row-delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  padding: 0;
}

.ticket-row-delete-btn:hover {
  background: rgba(255, 77, 77, 0.12);
  border-color: rgba(255, 77, 77, 0.4);
  color: #ff4d4d;
}

.ticket-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 56px 24px;
  color: var(--muted);
  text-align: center;
}

.ticket-empty p {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  color: var(--ink-soft);
}

.ticket-empty span {
  font-size: 13px;
}

/* ── View 2: Ticket Detail ───────────────────────────────────────────────── */
.ticket-detail-panel {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.ticket-detail-topbar {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.ticket-back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  flex-shrink: 0;
  padding: 6px 10px;
  margin-top: 2px;
}

.ticket-detail-header {
  flex: 1;
  min-width: 0;
}

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

.ticket-detail-title-row h2 {
  font-size: 18px;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-detail-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ticket-id-tag {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.ticket-detail-badges .ticket-dept-badge {
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 20px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--ink-soft);
}

.ticket-meta-line {
  font-size: 12px;
  color: var(--muted);
  margin: 6px 0 0;
}

.ticket-staff-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.staff-quick-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.staff-status-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.staff-status-label {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.danger-btn {
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 7px;
  border: 1px solid rgba(255, 77, 77, 0.4);
  background: rgba(255, 77, 77, 0.10);
  color: var(--red);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.danger-btn:hover {
  background: rgba(255, 77, 77, 0.20);
  border-color: var(--red);
}

/* ── Thread messages ─────────────────────────────────────────────────────── */
.ticket-thread-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: min(52vh, 520px);
  scrollbar-gutter: stable;
}

.ticket-thread-messages {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ticket-no-msgs {
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  padding: 32px;
}

.tmsg {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.tmsg-staff {
  flex-direction: row-reverse;
}

.tmsg-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tmsg-avatar-staff {
  background: var(--brand-soft);
  color: var(--brand);
  border: 1px solid rgba(32,230,164,0.3);
}

.tmsg-avatar-user {
  background: var(--blue-soft);
  color: var(--blue);
  border: 1px solid rgba(34,211,238,0.3);
}

.tmsg-bubble {
  flex: 1;
  max-width: 80%;
  border-radius: 12px;
  padding: 12px 16px;
  border: 1px solid var(--line);
}

.tmsg-user .tmsg-bubble {
  background: var(--surface-soft);
  border-color: var(--line);
  border-top-right-radius: 4px;
}

.tmsg-staff .tmsg-bubble {
  background: var(--surface-tint);
  border-color: rgba(32,230,164,0.22);
  border-top-left-radius: 4px;
}

.tmsg-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.tmsg-name {
  font-size: 13px;
  color: var(--ink);
}

.tmsg-role-tag {
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
}

.tag-staff {
  background: var(--brand-soft);
  color: var(--brand);
}

.tag-user {
  background: var(--blue-soft);
  color: var(--blue);
}

.tmsg-time {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: var(--muted);
  margin-inline-start: auto;
}

.tmsg-body {
  font-size: 13.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink);
}

/* ── Reply area ──────────────────────────────────────────────────────────── */
.ticket-reply-area {
  border-top: 1px solid var(--line);
  padding: 16px 24px 20px;
  background: var(--surface-soft);
}

.ticket-reply-area form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reply-composer-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ticket-reply-area textarea {
  width: 100%;
  resize: vertical;
  min-height: 80px;
  font-size: 13.5px;
  line-height: 1.55;
}

.reply-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.ticket-closed-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  padding: 14px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
}

/* ── New ticket modal ────────────────────────────────────────────────────── */
.ticket-modal-panel {
  width: min(600px, 100%);
}

/* ── Dept management modal ───────────────────────────────────────────────── */
.dept-modal-panel {
  width: min(560px, 100%);
}

.dept-modal-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
  max-height: 320px;
  overflow-y: auto;
}

.dept-modal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.dept-modal-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.dept-modal-info strong {
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dept-modal-desc {
  font-size: 12px;
  color: var(--muted);
}

.dept-modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.dept-modal-empty {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 24px;
}

.dept-add-form {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 4px;
}

.dept-add-form h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Util ────────────────────────────────────────────────────────────────── */
.empty-state {
  color: var(--muted);
  font-size: 13px;
  padding: 16px 0;
  text-align: center;
}
/* ─────────────────────────────────────────────────────────────────────────── */

/* ===========================================================================
   cPanel Sync — Enterprise UI  (cp-* namespace)
   =========================================================================== */

/* ── Root & page header ──────────────────────────────────────────────────── */
#cp-root {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 32px;
}
.cp-page-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.cp-page-hd-info { display: flex; align-items: center; gap: 14px; }
.cp-page-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
  flex-shrink: 0;
}
.cp-page-title { font-size: 20px; font-weight: 700; color: var(--ink); margin: 0 0 2px; }
.cp-page-sub   { font-size: 13px; color: var(--muted); margin: 0; }
.cp-page-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ── Stats row ───────────────────────────────────────────────────────────── */
.cp-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
@media (max-width: 900px) { .cp-stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .cp-stats { grid-template-columns: 1fr 1fr; } }
.cp-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color 0.15s;
}
.cp-stat:hover { border-color: var(--line-strong); }
.cp-stat-warn { border-color: rgba(246,184,74,0.25); }
.cp-stat-err  { border-color: rgba(255,77,77,0.20); }
.cp-stat-icon {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0;
}
.cp-stat-icon-server  { background: var(--blue-soft);  color: var(--blue); }
.cp-stat-icon-domain  { background: var(--brand-soft); color: var(--brand); }
.cp-stat-icon-conflict{ background: var(--amber-soft); color: var(--amber); }
.cp-stat-icon-failed  { background: var(--red-soft);   color: var(--red); }
.cp-stat-icon-sync    { background: var(--brand-soft); color: var(--brand); }
.cp-stat-body { min-width: 0; }
.cp-stat-val { font-size: 22px; font-weight: 700; color: var(--ink); line-height: 1.1; }
.cp-stat-lbl { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ── Section wrapper ─────────────────────────────────────────────────────── */
.cp-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.cp-section-hd {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.cp-section-title { font-size: 13px; font-weight: 700; color: var(--ink); }

/* ── Server cards grid ───────────────────────────────────────────────────── */
.cp-server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  padding: 16px;
}
.cp-srv-card {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.cp-srv-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-soft); }
.cp-srv-card-hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cp-srv-card-name { font-size: 14px; font-weight: 700; color: var(--ink); }
.cp-srv-card-meta { display: flex; gap: 12px; font-size: 12px; flex-wrap: wrap; }
.cp-srv-card-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.cp-badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.cp-badge-synced   { background: rgba(20,184,166,0.15); color: #2dd4bf; border: 1px solid rgba(20,184,166,0.25); }
.cp-badge-conflict { background: rgba(245,158,11,0.15); color: #fbbf24; border: 1px solid rgba(245,158,11,0.30); }
.cp-badge-failed   { background: rgba(239,68,68,0.15);  color: #f87171; border: 1px solid rgba(239,68,68,0.25); }
.cp-badge-pending  { background: rgba(99,102,241,0.15); color: #a5b4fc; border: 1px solid rgba(99,102,241,0.25); }
.cp-badge-running  { background: rgba(34,211,238,0.15); color: var(--blue); border: 1px solid rgba(34,211,238,0.25); }
.cp-badge-disabled { background: rgba(130,164,181,0.10); color: var(--muted); border: 1px solid rgba(130,164,181,0.18); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.cp-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 13px; font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer; white-space: nowrap;
  transition: background 0.13s, border-color 0.13s, opacity 0.13s;
  font-family: inherit;
}
.cp-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.cp-btn-sm  { padding: 5px 11px; font-size: 12px; }
.cp-btn-primary  { background: var(--brand); color: #021810; border-color: var(--brand); }
.cp-btn-primary:hover:not(:disabled)  { background: var(--brand-strong); border-color: var(--brand-strong); }
.cp-btn-secondary{ background: var(--surface-soft); color: var(--ink); border-color: var(--line-strong); }
.cp-btn-secondary:hover:not(:disabled){ background: var(--line); border-color: var(--brand); }
.cp-btn-ghost    { background: transparent; color: var(--muted); border-color: var(--line); }
.cp-btn-ghost:hover:not(:disabled)    { color: var(--ink); border-color: var(--line-strong); }
.cp-btn-danger   { background: var(--red-soft); color: var(--red); border-color: rgba(255,77,77,0.30); }
.cp-btn-danger:hover:not(:disabled)   { background: rgba(255,77,77,0.22); }

/* ── Domain drawer ───────────────────────────────────────────────────────── */
.cp-drawer {
  background: var(--surface);
  border: 1px solid var(--brand);
  border-radius: 12px;
  overflow: hidden;
}
.cp-drawer-hd {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px;
  background: var(--brand-soft);
  border-bottom: 1px solid rgba(32,230,164,0.18);
  flex-wrap: wrap;
}
.cp-drawer-title { font-size: 14px; font-weight: 700; color: var(--brand-strong); }
.cp-drawer-sub   { font-size: 12px; color: var(--brand); opacity: 0.7; margin-top: 2px; }
.cp-drawer-body  { overflow-x: auto; }

/* ── Read-only alert ─────────────────────────────────────────────────────── */
.cp-ro-alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 18px;
  background: rgba(99,102,241,0.07);
  border-bottom: 1px solid rgba(99,102,241,0.16);
  color: var(--muted); font-size: 12px; line-height: 1.55;
}
.cp-ro-alert strong { color: var(--ink); }

/* ── Filter bar ──────────────────────────────────────────────────────────── */
.cp-filter-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 9px 18px; border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}
.cp-filter-search {
  flex: 1; min-width: 150px; max-width: 260px;
  padding: 5px 9px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 6px; color: var(--ink); font-size: 12px; font-family: inherit;
  outline: none; transition: border-color 0.13s;
}
.cp-filter-search:focus { border-color: var(--brand); }
.cp-filter-select {
  padding: 5px 9px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 6px; color: var(--ink); font-size: 12px; font-family: inherit;
  outline: none; cursor: pointer; transition: border-color 0.13s;
}
.cp-filter-select:focus { border-color: var(--brand); }
.cp-filter-chk { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.cp-filter-chk input { accent-color: var(--brand); cursor: pointer; }
.cp-filter-count { font-size: 11px; color: var(--brand); margin-right: auto; white-space: nowrap; }

/* ── Domain table ────────────────────────────────────────────────────────── */
/* col: domain | type | user | status | count | date | auto | btn          */
/* table-layout:auto sizes by content then distributes extra space evenly  */
/* — prevents the domain column from absorbing all remaining space.        */
.cp-domain-table {
  width: 100%; border-collapse: collapse; font-size: 12.5px;
}
.cp-domain-table thead th:nth-child(1) { min-width: 160px; }
.cp-domain-table thead th:nth-child(2) { width: 62px;  text-align: center; white-space: nowrap; }
.cp-domain-table thead th:nth-child(3) { width: 88px;  white-space: nowrap; }
.cp-domain-table thead th:nth-child(4) { width: 108px; white-space: nowrap; }
.cp-domain-table thead th:nth-child(5) { width: 52px;  text-align: center; white-space: nowrap; }
.cp-domain-table thead th:nth-child(6) { width: 108px; white-space: nowrap; }
.cp-domain-table thead th:nth-child(7) { width: 48px;  text-align: center; white-space: nowrap; }
.cp-domain-table thead th:nth-child(8) { width: 52px;  text-align: center; white-space: nowrap; }
.cp-domain-table thead th {
  padding: 7px 12px;
  text-align: right; font-size: 11px; font-weight: 700;
  color: var(--muted); background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
}
.cp-domain-table tbody td {
  padding: 7px 12px; border-bottom: 1px solid var(--line); vertical-align: middle;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* per-column alignment overrides */
.cp-domain-table tbody td:nth-child(2) { text-align: center; overflow: visible; }
.cp-domain-table tbody td:nth-child(5) { text-align: center; }
.cp-domain-table tbody td:nth-child(7) { text-align: center; overflow: visible; }
.cp-domain-table tbody td:nth-child(8) {
  text-align: center; overflow: visible;
  padding-right: 10px; padding-left: 10px;
}
.cp-domain-table tbody tr:last-child td { border-bottom: none; }
.cp-domain-table tbody tr:hover td { background: rgba(32,230,164,0.04); }
.cp-domain-name { font-size: 13px; font-weight: 600; color: var(--ink); }
.cp-domain-user { font-size: 12px; }
.cp-date-cell   { font-size: 11.5px; }
.cp-rec-count-cell { font-size: 12px; }
.cp-toggle { width: 15px; height: 15px; cursor: pointer; accent-color: var(--brand); vertical-align: middle; }
.cp-toggle:disabled { opacity: 0.3; cursor: not-allowed; }
.cp-managed-badge { font-size: 10px !important; padding: 1px 5px !important; margin-right: 5px; vertical-align: middle; }
.cp-row-firedns-managed .cp-domain-name { opacity: 0.7; }
.cp-status-cell { display: inline-flex; align-items: center; gap: 5px; }
.cp-ro-lock { color: var(--muted); opacity: 0.4; flex-shrink: 0; display: flex; }
.cp-rec-btn-icon { padding: 5px 10px !important; min-width: 32px; display: inline-flex; align-items: center; justify-content: center; }
.cp-row-expanded > td { background: rgba(32,230,164,0.05) !important; border-bottom: none; }
.cp-row-expanded .cp-domain-name { color: var(--brand); }
.cp-row-expanded .cp-rec-btn { color: var(--brand) !important; border-color: var(--brand) !important; }

/* ── Expand row ──────────────────────────────────────────────────────────── */
.cp-rec-expand > td { background: var(--bg); }
.cp-rec-expand-td { padding: 0 !important; }

/* ── DNS record header ───────────────────────────────────────────────────── */
.cp-dns-hd {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; flex-wrap: wrap;
  border-top: 2px solid rgba(32,230,164,0.35);
  border-bottom: 1px solid var(--line); background: var(--bg);
}
.cp-dns-hd-left  { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.cp-dns-hd-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.cp-dns-hd-name {
  font-size: 13px; font-weight: 700; color: var(--ink);
  font-family: "Cascadia Code","Fira Code","JetBrains Mono",ui-monospace,"Courier New",monospace;
  white-space: nowrap;
}
.cp-dns-hd-count { font-size: 11px; color: var(--muted); }
.cp-dns-hd-sync  { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* ── DNS records grid — Cloudflare-style ─────────────────────────────────── */
/* col: Type | Name | Content | TTL | Status (5 cols, no scroll) */
.cp-dns-table-wrap { background: var(--bg); }
.cp-dns-table-hd,
.cp-dns-row {
  display: grid;
  grid-template-columns: 62px minmax(100px, 1fr) minmax(160px, 2.5fr) 58px 86px;
  align-items: center;
  gap: 0;
}
.cp-dns-table-hd {
  padding: 0 16px; min-height: 34px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--muted);
  background: rgba(5,13,20,0.48); border-bottom: 1px solid var(--line);
}
.cp-dns-row {
  padding: 0 16px; min-height: 40px;
  background: var(--surface-soft); border-bottom: 1px solid rgba(255,255,255,0.04);
}
.cp-dns-row:last-child { border-bottom: none; }
.cp-dns-row:hover { background: rgba(32,230,164,0.035); }
.cp-dns-row:hover .cp-copy-btn { opacity: 1; }
.cp-dns-table-hd > span:nth-child(1) { text-align: center; }
.cp-dns-table-hd > span:nth-child(4),
.cp-dns-table-hd > span:nth-child(5) { text-align: center; }
.cp-dns-row > div:nth-child(1) { display: flex; justify-content: center; align-items: center; }
.cp-dns-row > div:nth-child(2),
.cp-dns-row > div:nth-child(3) { min-width: 0; padding: 2px 6px 2px 0; }
.cp-dns-row > div:nth-child(4),
.cp-dns-row > div:nth-child(5) { display: flex; justify-content: center; align-items: center; }
.cp-dns-ttl {
  font-family: "Cascadia Code","Fira Code","JetBrains Mono",ui-monospace,"Courier New",monospace;
  font-size: 12px; color: var(--muted);
}
.cp-cell-text {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12.5px;
}
.cp-badge-sm { font-size: 10px; padding: 1px 6px; }
.cp-rec-loading { padding: 14px 18px; color: var(--muted); font-size: 13px; }

/* ── Cell copy ───────────────────────────────────────────────────────────── */
.cp-cell-copy { display: flex; align-items: center; gap: 4px; min-width: 0; }
.cp-cell-copy .ltr, .cp-cell-copy .cp-cell-text { min-width: 0; flex: 1; }
.cp-copy-btn {
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 4px;
  background: transparent; border: 1px solid transparent;
  color: var(--muted); cursor: pointer; opacity: 0; transition: opacity 0.13s, background 0.13s;
}
tr:hover .cp-copy-btn, .cp-copy-btn:focus { opacity: 1; }
.cp-copy-btn:hover { background: var(--surface-soft); border-color: var(--line); color: var(--ink); opacity: 1; }

/* ── Type badges ─────────────────────────────────────────────────────────── */
.cp-type-badge {
  display: inline-block; padding: 2px 6px; border-radius: 4px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.05em; font-family: monospace;
}
.cp-type-a    { background: rgba(34,197,94,0.14);   color: #4ade80; }
.cp-type-aaaa { background: rgba(59,130,246,0.14);  color: #60a5fa; }
.cp-type-cname{ background: rgba(168,85,247,0.14);  color: #c084fc; }
.cp-type-mx   { background: rgba(249,115,22,0.14);  color: #fb923c; }
.cp-type-txt  { background: rgba(148,163,184,0.10); color: #94a3b8; border: 1px solid rgba(148,163,184,0.18); }
.cp-type-ns   { background: rgba(20,184,166,0.14);  color: #2dd4bf; }
.cp-type-srv  { background: rgba(234,179,8,0.14);   color: #facc15; }
.cp-type-caa  { background: rgba(236,72,153,0.12);  color: #f472b6; }
.cp-type-ptr  { background: rgba(99,102,241,0.12);  color: #a5b4fc; }
.cp-type-other{ background: rgba(148,163,184,0.10); color: var(--muted); }

/* ── Extra badges ────────────────────────────────────────────────────────── */
.cp-badge-readonly { background: rgba(100,116,139,0.12); color: #64748b; border: 1px solid rgba(100,116,139,0.22); display: inline-flex; align-items: center; gap: 4px; }
.cp-badge-cpanel   { background: rgba(20,184,166,0.12); color: #2dd4bf; border: 1px solid rgba(20,184,166,0.22); }
.cp-badge-firedns  { background: rgba(32,230,164,0.10); color: var(--brand); border: 1px solid rgba(32,230,164,0.22); }

/* ── Empty / Error states ────────────────────────────────────────────────── */
.cp-rec-empty-card, .cp-rec-err-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 32px 18px; text-align: center;
}
.cp-rec-empty-msg, .cp-rec-err-msg  { font-size: 14px; font-weight: 600; color: var(--ink); }
.cp-rec-empty-sub, .cp-rec-err-detail { font-size: 12px; color: var(--muted); }
.cp-rec-err-msg  { color: var(--red); }

/* ── Conflict center ─────────────────────────────────────────────────────── */
.cp-conflict-ok {
  display: flex; align-items: center; gap: 8px;
  padding: 20px 18px;
  color: var(--brand); font-size: 13px;
}
.cp-conflict-row {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.cp-conflict-row:last-child { border-bottom: none; }
.cp-conflict-hd {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}
.cp-conflict-identity { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cp-conflict-key { font-size: 14px; font-weight: 700; color: var(--ink); }
.cp-conflict-key em { font-style: normal; color: var(--muted); font-weight: 500; }
.cp-conflict-actions { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }

/* ── Side-by-side compare ────────────────────────────────────────────────── */
.cp-compare {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  font-size: 13px;
}
.cp-compare-side { padding: 12px 14px; }
.cp-cp-side { background: rgba(34,211,238,0.05); }
.cp-fd-side { background: rgba(32,230,164,0.05); }
.cp-compare-vs {
  display: flex; align-items: center; justify-content: center;
  padding: 0 8px; font-size: 10px; font-weight: 800;
  color: var(--muted); background: var(--surface-soft);
  border-inline: 1px solid var(--line);
}
.cp-compare-lbl {
  display: flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.cp-compare-val  { font-family: monospace; font-size: 13px; color: var(--ink); word-break: break-all; }
.cp-compare-meta { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ── Sync history log table ──────────────────────────────────────────────── */
.cp-log-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cp-log-table thead th {
  padding: 10px 14px; text-align: right;
  font-size: 11px; font-weight: 700; color: var(--muted);
  background: var(--surface-soft); border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.cp-log-table tbody td { padding: 9px 14px; border-bottom: 1px solid var(--line); }
.cp-log-table tbody tr:last-child td { border-bottom: none; }
.cp-log-table tbody tr:hover td { background: rgba(32,230,164,0.04); }
.cp-log-c-ok   { color: #2dd4bf; }
.cp-log-c-push { color: var(--blue); }
.cp-log-c-warn { color: var(--amber); }
.cp-log-c-err  { color: var(--red); }

/* ── Add/Edit server modal ───────────────────────────────────────────────── */
.cp-modal-overlay {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(6,16,24,0.75); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.cp-modal {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  width: 100%; max-width: 520px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  max-height: 90vh; overflow: hidden;
}
.cp-modal-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}
.cp-modal-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.cp-modal-ft {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 20px 16px;
  border-top: 1px solid var(--line);
}

/* ── Step navigation ─────────────────────────────────────────────────────── */
.cp-step-nav {
  display: flex; gap: 0;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.cp-step-btn {
  flex: 1; padding: 10px 8px;
  font-size: 11px; font-weight: 600;
  color: var(--muted); background: none; border: none; cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap; transition: color 0.13s, border-color 0.13s;
  font-family: inherit;
}
.cp-step-btn.active    { color: var(--brand); border-bottom-color: var(--brand); }
.cp-step-btn.cp-step-done { color: #2dd4bf; }
.cp-step-body          { display: none; }
.cp-step-body.active   { display: block; }

/* ── Form fields ─────────────────────────────────────────────────────────── */
.cp-fields {
  display: flex; flex-direction: column; gap: 14px;
  padding: 20px; overflow-y: auto;
}
.cp-lbl { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: var(--muted); }
.cp-inp {
  background: var(--bg-strong);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 12px;
  color: var(--ink); font-size: 13px; font-family: inherit;
  width: 100%; box-sizing: border-box;
  transition: border-color 0.13s;
}
.cp-inp:focus { outline: none; border-color: var(--brand); }
.cp-inp::placeholder { color: var(--muted); }
.cp-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .cp-row2 { grid-template-columns: 1fr; } }
.cp-check-row { display: flex; align-items: center; gap: 6px; padding: 8px 0; font-size: 13px; color: var(--ink); font-weight: 400; }
.cp-check-row input[type=checkbox] { accent-color: var(--brand); width: 15px; height: 15px; }
.cp-eye-btn {
  position: absolute; inset-inline-end: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 15px; opacity: 0.5;
  padding: 4px; transition: opacity 0.13s;
}
.cp-eye-btn:hover { opacity: 1; }
.cp-conn-area { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cp-conn-msg { font-size: 12px; padding: 4px 0; }
.cp-conn-ok  { color: var(--brand); }
.cp-conn-err { color: var(--red); }
.cp-conn-info{ color: var(--muted); }
.cp-confirm-msg {
  text-align: center; padding: 28px 24px;
  font-size: 13px; color: var(--muted); line-height: 1.7;
}

/* ── Utility ─────────────────────────────────────────────────────────────── */
.cp-mono   { font-family: monospace; font-size: 12px; }
.cp-muted  { color: var(--muted); }
.cp-placeholder {
  padding: 24px 18px; text-align: center;
  color: var(--muted); font-size: 13px;
}
.cp-placeholder.cp-err { color: var(--red); }
.ltr { direction: ltr; text-align: left; unicode-bidi: isolate; }

/* ══════════════════════════════════════════════════════════════════════════ */
/* SSL Operations Center  (sop-*)                                            */
/* ══════════════════════════════════════════════════════════════════════════ */

.sop-page { display: flex; flex-direction: column; gap: 16px; padding-bottom: 32px; }

/* ── Page header ────────────────────────────────────────────────────────── */
.sop-hd { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 4px 0 8px; flex-wrap: wrap; }
.sop-hd-info { display: flex; flex-direction: column; gap: 4px; }
.sop-hd-title { font-size: 20px; font-weight: 700; color: var(--ink); margin: 0; }
.sop-hd-sub   { font-size: 13px; color: var(--muted); margin: 0; }
.sop-hd-btns  { display: flex; gap: 8px; flex-shrink: 0; }

/* ── Stat cards ─────────────────────────────────────────────────────────── */
.sop-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.sop-stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 16px 20px;
  display: flex; flex-direction: column; gap: 6px;
  transition: border-color 0.15s;
}
.sop-stat:hover { border-color: var(--brand-soft); }
.sop-stat-val { font-size: 30px; font-weight: 700; line-height: 1; color: var(--ink); }
.sop-stat-lbl { font-size: 12px; color: var(--muted); }
.sop-stat.sop-stat-warn   .sop-stat-val { color: #F59E0B; }
.sop-stat.sop-stat-danger .sop-stat-val { color: var(--red); }
.sop-stat.sop-stat-info   .sop-stat-val { color: #60A5FA; }

/* ── Shared toolbar bar ─────────────────────────────────────────────────── */
.sop-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; flex-wrap: wrap; }
.sop-bar-bordered { border-bottom: 1px solid var(--line); }
.sop-bar-start { display: flex; flex-direction: column; gap: 2px; }
.sop-bar-end   { display: flex; gap: 8px; align-items: center; }
.sop-section-title { font-size: 14px; font-weight: 600; color: var(--ink); margin: 0; }
.sop-section-sub   { font-size: 12px; color: var(--muted); margin: 0; }

.sop-search-input {
  background: var(--surface-soft); border: 1px solid var(--line);
  border-radius: 8px; color: var(--ink); padding: 6px 12px;
  font-size: 13px; outline: none; width: 180px;
}
.sop-search-input:focus { border-color: var(--brand); }

.sop-filter-select {
  background: var(--surface-soft); border: 1px solid var(--line);
  border-radius: 8px; color: var(--ink); padding: 6px 10px;
  font-size: 13px; outline: none; cursor: pointer;
}
.sop-filter-select:focus { border-color: var(--brand); }

/* ── Domain table ───────────────────────────────────────────────────────── */
.sop-table-card { padding: 0; overflow: hidden; }
.sop-table-wrap { overflow-x: auto; }

.sop-table { width: 100%; border-collapse: collapse; direction: ltr; table-layout: auto; }
.sop-table th {
  padding: 10px 14px; font-size: 11px; font-weight: 600;
  color: var(--muted); text-align: right; white-space: nowrap;
  background: color-mix(in srgb, var(--surface-soft) 80%, transparent);
  border-bottom: 1px solid var(--line);
}
.sop-table td { padding: 9px 14px; border-bottom: 1px solid rgba(255,255,255,0.04); vertical-align: middle; }
.sop-table tbody tr:hover td { background: rgba(255,255,255,0.02); }
.sop-table tbody tr:last-child td { border-bottom: none; }
.sop-table th { text-align: center; }
.sop-th-act { text-align: center !important; }
.sop-td-status { text-align: center; }
.sop-empty { text-align: center !important; color: var(--muted); font-size: 13px; padding: 36px !important; }

.sop-domain-name  { display: block; font-size: 13px; font-weight: 600; color: var(--ink); letter-spacing: 0.01em; }
.sop-domain-email { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.sop-td-expiry    { font-size: 12px; white-space: nowrap; }
.sop-expiry-date  { color: var(--muted); margin-left: 5px; }
.sop-expiry-none  { color: var(--muted); }

/* ── SSL / Request status badges ────────────────────────────────────────── */
.sop-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600; white-space: nowrap; letter-spacing: 0.02em;
}
.sop-badge::before { content: "●"; font-size: 7px; line-height: 1; }
.sop-badge-issued   { background: rgba(16,185,129,0.12); color: #10B981; border: 1px solid rgba(16,185,129,0.25); }
.sop-badge-expiring { background: rgba(245,158,11,0.12); color: #F59E0B; border: 1px solid rgba(245,158,11,0.25); }
.sop-badge-expired  { background: rgba(127,29,29,0.20);  color: #FCA5A5; border: 1px solid rgba(239,68,68,0.25); }
.sop-badge-failed   { background: rgba(239,68,68,0.12);  color: #EF4444; border: 1px solid rgba(239,68,68,0.25); }
.sop-badge-pending  { background: rgba(59,130,246,0.12); color: #60A5FA; border: 1px solid rgba(59,130,246,0.25); }
.sop-badge-dns      { background: rgba(245,158,11,0.12); color: #FBBF24; border: 1px solid rgba(245,158,11,0.25); }
.sop-badge-none     { background: rgba(100,116,139,0.10); color: #64748B; border: 1px solid rgba(100,116,139,0.20); }

/* ── DNS status text ────────────────────────────────────────────────────── */
.sop-dns-ready   { font-size: 12px; color: #10B981; }
.sop-dns-pending { font-size: 12px; color: #F59E0B; }
.sop-dns-unknown { font-size: 12px; color: var(--muted); }
.sop-dns-blocked { font-size: 12px; color: #60A5FA; }

/* ── Days remaining pill ────────────────────────────────────────────────── */
.sop-days { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.sop-days-ok       { background: rgba(16,185,129,0.10); color: #10B981; }
.sop-days-warn     { background: rgba(245,158,11,0.10); color: #F59E0B; }
.sop-days-critical { background: rgba(239,68,68,0.10);  color: #EF4444; }
.sop-days-expired  { background: rgba(127,29,29,0.15);  color: #FCA5A5; font-size: 11px; }

/* ── Filter chips ────────────────────────────────────────────────────────── */
.sop-filter-chips {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 8px 16px 10px; border-bottom: 1px solid var(--line);
}
.sop-chip {
  display: inline-flex; align-items: center; padding: 3px 12px;
  border-radius: 20px; font-size: 11px; font-weight: 500;
  border: 1px solid var(--line); background: transparent;
  color: var(--muted); cursor: pointer; transition: all 0.15s;
  font-family: inherit; white-space: nowrap;
}
.sop-chip:hover { border-color: var(--muted); color: var(--ink); }
.sop-chip.active { background: rgba(32,230,164,0.12); border-color: rgba(32,230,164,0.4); color: var(--brand); }
.sop-chip-green.active  { background: rgba(16,185,129,0.12); border-color: rgba(16,185,129,0.4); color: #10B981; }
.sop-chip-warn.active   { background: rgba(245,158,11,0.12); border-color: rgba(245,158,11,0.4); color: #F59E0B; }
.sop-chip-danger.active { background: rgba(239,68,68,0.12);  border-color: rgba(239,68,68,0.4);  color: #EF4444; }
.sop-chip-info.active   { background: rgba(59,130,246,0.12); border-color: rgba(59,130,246,0.4); color: #60A5FA; }

/* ── Table action buttons ───────────────────────────────────────────────── */
.sop-td-actions {
  white-space: nowrap;
  display: flex; align-items: center; gap: 4px;
}
.sop-act-btn {
  display: inline-flex; align-items: center; padding: 4px 10px;
  border-radius: 6px; font-size: 11px; font-weight: 500;
  border: 1px solid transparent; cursor: pointer;
  transition: background 0.12s, color 0.12s; white-space: nowrap;
  font-family: inherit;
}
.sop-td-actions .sop-act-btn:not(.sop-exp-toggle):not(.sop-kebab-btn) { min-width: 90px; justify-content: center; }
.sop-exp-toggle { margin-inline-start: auto !important; }
.sop-act-check   { background: rgba(20,184,166,0.10); color: #2dd4bf; border-color: rgba(20,184,166,0.25); }
.sop-act-check:hover { background: rgba(20,184,166,0.20); }
.sop-act-primary { background: var(--brand); color: #021810; border-color: var(--brand); font-weight: 600; }
.sop-act-primary:hover:not(:disabled) { filter: brightness(1.1); }
.sop-act-primary:disabled { opacity: 0.35; cursor: not-allowed; }
.sop-act-ghost   { background: transparent; color: var(--muted); border-color: var(--line); }
.sop-act-ghost:hover:not(:disabled) { color: var(--ink); border-color: var(--muted); }
.sop-act-ghost:disabled  { opacity: 0.45; cursor: not-allowed; }
.sop-act-danger  { background: transparent; color: var(--red); border-color: rgba(239,68,68,0.30); }
.sop-act-danger:hover:not(:disabled) { background: rgba(239,68,68,0.08); }
.sop-act-danger:disabled { opacity: 0.35; cursor: not-allowed; }
.sop-inprog { border-color: rgba(59,130,246,0.20) !important; color: #60A5FA !important; }

/* ── Kebab dropdown menu ─────────────────────────────────────────────────── */
.sop-kebab-wrap { position: relative; }
.sop-kebab-btn  { padding: 4px 8px !important; min-width: unset !important; }
.sop-kebab-menu {
  position: absolute; top: calc(100% + 4px); right: 0; z-index: 200;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; padding: 4px; min-width: 130px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.sop-kebab-menu[hidden] { display: none; }
.sop-kebab-item {
  display: block; width: 100%; text-align: right; padding: 7px 12px;
  border-radius: 5px; font-size: 12px; font-weight: 500;
  background: none; border: none; color: var(--ink); cursor: pointer;
  font-family: inherit; transition: background 0.12s;
}
.sop-kebab-item:hover { background: rgba(255,255,255,0.06); }
.sop-kebab-danger { color: var(--red) !important; }
.sop-kebab-danger:hover { background: rgba(239,68,68,0.08) !important; }
.sop-kebab-sep { height: 1px; background: var(--line); margin: 4px 0; }

/* ── SSL cert modal ──────────────────────────────────────────────────────── */
.ssl-cm-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: flex-start; justify-content: flex-end;
  pointer-events: all;
}
.ssl-cm-overlay.hidden { display: none; }
.ssl-cm-bd {
  position: absolute; inset: 0; background: rgba(0,0,0,0.55);
  backdrop-filter: blur(2px);
}
.ssl-cm-panel {
  position: relative; z-index: 1; width: 560px; max-width: 95vw;
  height: 100vh; background: var(--surface); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; overflow: hidden;
  animation: ssl-cm-slide 0.22s ease;
}
@keyframes ssl-cm-slide { from { transform: translateX(100%); } to { transform: translateX(0); } }
.ssl-cm-hd {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.ssl-cm-title { font-size: 16px; font-weight: 700; color: var(--ink); margin: 0; direction: ltr; text-align: left; }
.ssl-cm-meta  { font-size: 12px; color: var(--muted); margin: 4px 0 0; }
.ssl-cm-body  { flex: 1; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 18px; }
.ssl-cm-pem-section { display: flex; flex-direction: column; gap: 0; }
.ssl-cm-pem.ssl-output-grid { grid-template-columns: 1fr; gap: 14px; }
.ssl-cm-pem .ssl-output-item textarea { min-height: 150px; }
.ssl-cm-install-section { border-top: 1px solid var(--line); padding-top: 14px; }
.ssl-cm-install-hd { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 10px; }
.ssl-output-head-btns { display: flex; gap: 4px; align-items: center; }
.sop-key-toggle { font-size: 11px; padding: 1px 8px !important; border: 1px solid var(--line) !important; border-radius: 4px; color: var(--muted); background: none; cursor: pointer; font-family: inherit; }
.sop-key-toggle:hover { color: var(--ink); border-color: var(--muted) !important; }

/* ── SSL PEM upload section ─────────────────────────────────────────────── */
.sop-upload-section { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; }
.sop-upload-toggle { font-size: 12px; color: var(--muted); background: none; border: 1px dashed var(--line); border-radius: 6px; padding: 4px 12px; cursor: pointer; }
.sop-upload-toggle:hover { color: var(--ink); border-color: var(--muted); }
.sop-upload-form { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.sop-upload-note { font-size: 12px; color: var(--muted); }
.sop-upload-label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.sop-upload-ta { font-family: "FireDNSLatin", monospace; font-size: 11px; background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; resize: vertical; direction: ltr; text-align: left; }
.sop-upload-output { margin-top: 6px; }

/* ── SSL inline expand row ──────────────────────────────────────────────── */
.sop-expand-row { background: var(--bg); }
.sop-expand-row.hidden { display: none; }
.sop-expand-td { padding: 0 !important; border-top: none !important; }
.sop-expand-body {
  padding: 14px 18px;
  border-top: 2px solid rgba(32,230,164,0.22);
}
.sop-exp-hd { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.sop-exp-meta { font-size: 11px; color: var(--muted); }
.sop-exp-log { max-height: 220px; overflow-y: auto; margin: 0 0 10px; font-size: 12px; }
.sop-exp-issued { display: flex; align-items: center; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.sop-exp-actions { margin-top: 10px; }
.sop-exp-empty { color: var(--muted); font-size: 13px; font-style: italic; margin: 0; }
.sop-exp-toggle {
  background: none !important;
  border-color: rgba(100,116,139,0.25) !important;
  color: var(--muted) !important;
  padding: 3px 7px !important;
}
.sop-exp-toggle:hover { color: var(--ink) !important; border-color: var(--line-strong) !important; }
.sop-exp-toggle svg { transition: transform 0.2s ease; display: block; }
.sop-exp-toggle.open svg { transform: rotate(180deg); }

/* ── Request card section ───────────────────────────────────────────────── */
.sop-req-card { padding: 0; overflow: hidden; }

/* ── Buttons (page-level) ───────────────────────────────────────────────── */
.sop-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px; border-radius: 8px;
  font-size: 13px; font-weight: 500; border: 1px solid transparent;
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
  font-family: inherit;
}
.sop-btn-primary { background: var(--brand); color: #021810; border-color: var(--brand); }
.sop-btn-primary:hover { filter: brightness(1.08); }
.sop-btn-ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.sop-btn-ghost:hover { color: var(--ink); border-color: var(--muted); }

/* ── Drawer ─────────────────────────────────────────────────────────────── */
.sop-drawer {
  position: fixed; inset: 0; z-index: 600;
  pointer-events: none;
}
.sop-drawer[aria-hidden="false"] { pointer-events: all; }
.sop-drawer-bd {
  position: absolute; inset: 0; background: rgba(0,0,0,0.55);
  opacity: 0; transition: opacity 0.25s;
}
.sop-drawer[aria-hidden="false"] .sop-drawer-bd { opacity: 1; }
.sop-drawer-panel {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 380px; max-width: 90vw;
  background: #0f1923; border-right: 1px solid #263244;
  display: flex; flex-direction: column;
  transform: translateX(-100%); transition: transform 0.25s cubic-bezier(.4,0,.2,1);
  overflow-y: auto;
}
.sop-drawer[aria-hidden="false"] .sop-drawer-panel { transform: translateX(0); }
.sop-drawer-hd {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 20px; border-bottom: 1px solid #263244; flex-shrink: 0;
}
.sop-drawer-hd h2 { margin: 0; font-size: 16px; font-weight: 600; color: var(--ink); }
.sop-drawer-hd p  { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.sop-close-btn {
  background: transparent; border: 1px solid var(--line);
  border-radius: 6px; color: var(--muted);
  padding: 4px 9px; cursor: pointer; font-size: 14px; line-height: 1;
  flex-shrink: 0; transition: color 0.12s, border-color 0.12s;
}
.sop-close-btn:hover { color: var(--ink); border-color: var(--muted); }
.sop-drawer-form { padding: 20px; display: flex; flex-direction: column; gap: 16px; flex: 1; }
.sop-drawer-footer { display: flex; gap: 8px; padding-top: 4px; margin-top: auto; border-top: 1px solid var(--line); padding-top: 16px; }

/* ── Drawer form controls ───────────────────────────────────────────────── */
.sop-label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.sop-label span { font-weight: 500; color: var(--ink); font-size: 13px; }
.sop-input {
  background: var(--surface-soft); border: 1px solid var(--line);
  border-radius: 8px; color: var(--ink); padding: 8px 12px;
  font-size: 14px; outline: none; width: 100%; box-sizing: border-box;
  font-family: inherit; transition: border-color 0.15s;
}
.sop-input:focus { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(32,230,164,0.08); }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1100px) { .sop-stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px)  { .sop-stats { grid-template-columns: repeat(2, 1fr); } }

/* Tablet: hide days column, compact actions */
@media (max-width: 900px) {
  .sop-td-days, .sop-table thead th:nth-child(5) { display: none; }
  .sop-td-expiry, .sop-table thead th:nth-child(4) { display: none; }
  .sop-search-input { width: 130px; }
  .sop-act-btn { padding: 3px 7px; font-size: 11px; }
}

/* Mobile: switch table rows to card layout */
@media (max-width: 600px) {
  .sop-hd { gap: 10px; }
  .sop-hd-title { font-size: 16px; }
  .sop-hd-btns { gap: 6px; }
  .sop-btn { padding: 6px 12px; font-size: 12px; }

  .sop-bar { padding: 12px 14px; gap: 8px; }
  .sop-bar-end { flex-wrap: wrap; }
  .sop-search-input { width: 100%; }

  .sop-table-wrap { overflow-x: hidden; }
  .sop-table, .sop-table tbody { display: block; }
  .sop-table thead { display: none; }

  .sop-domain-row {
    display: flex; flex-wrap: wrap; align-items: flex-start;
    gap: 6px 10px; padding: 12px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  .sop-td-domain  { flex: 1 1 55%; padding: 0; border: none; }
  .sop-td-status  { flex: 0 0 auto; padding: 0; border: none; align-self: center; }
  .sop-td-dns     { flex: 1 1 100%; padding: 0; border: none; font-size: 11px; }
  .sop-td-expiry, .sop-td-days { display: none; }
  .sop-td-actions {
    flex: 1 1 100%; padding: 0; border: none;
    display: flex; flex-wrap: wrap; gap: 5px;
  }
  .sop-act-btn { font-size: 11px; padding: 5px 9px; }

  .sop-drawer-panel { width: 100%; max-width: 100%; }
}

/* ── Analytics Pro (anx-*) ──────────────────────────────────────────────── */
.anx-page {
  display: grid;
  gap: 16px;
}

/* Toolbar */
.anx-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 11px 14px;
  border: 1px solid rgba(73, 114, 143, 0.32);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(47, 111, 163, 0.07), transparent 55%), #07141f;
}

.anx-tf-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.anx-tf {
  padding: 6px 13px;
  border: 1px solid rgba(73, 114, 143, 0.38);
  border-radius: 6px;
  background: transparent;
  color: #88a9bc;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.anx-tf:hover {
  background: rgba(73, 114, 143, 0.12);
  color: #c8e8f8;
}

.anx-tf.active {
  background: rgba(34, 211, 238, 0.10);
  border-color: rgba(34, 211, 238, 0.42);
  color: #22d3ee;
}

.anx-toolbar-end {
  display: flex;
  align-items: center;
  gap: 10px;
}

.anx-auto-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid rgba(73, 114, 143, 0.38);
  border-radius: 6px;
  background: transparent;
  color: #88a9bc;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.anx-auto-btn.active {
  background: rgba(34, 197, 94, 0.09);
  border-color: rgba(34, 197, 94, 0.36);
  color: #4ade80;
}

.anx-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #22c55e;
}

.anx-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  animation: anx-pulse 1.8s ease-in-out infinite;
}

@keyframes anx-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.72); }
}

.anx-ts {
  font-size: 11px;
  color: #5a7d94;
  white-space: nowrap;
}

/* KPI row */
.anx-kpi-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 11px;
}

.anx-kpi {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  border: 1px solid rgba(73, 114, 143, 0.36);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(47, 111, 163, 0.08), transparent 55%), #07141f;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.anx-kpi:hover {
  transform: translateY(-2px);
  border-color: rgba(34, 211, 238, 0.26);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.anx-kpi .ui-icon {
  color: #22d3ee;
  opacity: 0.8;
  flex-shrink: 0;
}

.anx-kpi-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.anx-kpi-body span {
  color: #7a9db4;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.anx-kpi-body strong {
  color: #d8f3ff;
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

/* Chart grid */
.anx-chart-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(250px, 0.8fr);
  gap: 14px;
}

.anx-chart-main,
.anx-chart-side {
  min-height: 320px;
}

/* Metric tabs */
.anx-metric-tabs {
  display: flex;
  gap: 4px;
}

.anx-mt {
  padding: 6px 12px;
  border: 1px solid rgba(73, 114, 143, 0.36);
  border-radius: 6px;
  background: transparent;
  color: #88a9bc;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.anx-mt.active {
  background: rgba(34, 211, 238, 0.09);
  border-color: rgba(34, 211, 238, 0.36);
  color: #22d3ee;
}

/* Domain table */
.anx-table-card,
.anx-records-card {
  overflow: hidden;
}

.anx-tbl-ctrl {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.anx-search-inp {
  height: 34px;
  min-width: 160px;
  padding: 0 11px;
  border: 1px solid rgba(73, 114, 143, 0.4);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
  color: #d8f3ff;
  font-size: 13px;
  font-family: inherit;
}

.anx-search-inp::placeholder { color: #5a7d94; }

.anx-search-inp:focus {
  outline: none;
  border-color: rgba(34, 211, 238, 0.4);
  background: rgba(34, 211, 238, 0.04);
}

.anx-sort-sel {
  height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(73, 114, 143, 0.4);
  border-radius: 7px;
  background: #0b1b28;
  color: #88a9bc;
  font-size: 13px;
  font-family: inherit;
}

.anx-table-scroll {
  overflow-x: auto;
  margin-inline: -16px;
  padding-inline: 16px;
}

.anx-table {
  width: 100%;
  border-collapse: collapse;
}

.anx-table thead th {
  padding: 9px 12px;
  border-bottom: 1px solid rgba(73, 114, 143, 0.22);
  color: #5a7d94;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: start;
  white-space: nowrap;
}

.anx-col-rank { width: 36px; text-align: center !important; }
.anx-col-num  { text-align: end !important; }
.anx-col-spark { width: 110px; }

.anx-tr {
  border-bottom: 1px solid rgba(73, 114, 143, 0.10);
  transition: background 0.13s ease;
}

.anx-tr:last-child { border-bottom: none; }
.anx-tr:hover { background: rgba(34, 211, 238, 0.03); }

.anx-tr td {
  padding: 10px 12px;
  font-size: 13px;
  color: #aed0e8;
  vertical-align: middle;
  white-space: nowrap;
}

.anx-rank {
  text-align: center !important;
  color: #5a7d94 !important;
  font-size: 12px;
  font-weight: 700;
}

.anx-tr td.anx-col-num {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #c8e8f8;
}

.anx-domain-name {
  color: #d8f3ff;
  font-weight: 700;
  font-size: 13px;
}

.anx-col-spark .sparkline {
  width: 100px;
  height: 28px;
}

.anx-empty {
  text-align: center;
  color: #5a7d94;
  padding: 28px 12px;
  font-size: 13px;
}

/* Record list */
.anx-record-list {
  display: grid;
  gap: 6px;
}

.anx-record-row {
  display: grid;
  grid-template-columns: 28px minmax(180px, 1.4fr) minmax(100px, 1fr) 82px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(73, 114, 143, 0.20);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.018);
  transition: background 0.13s ease, border-color 0.13s ease;
}

.anx-record-row:hover {
  background: rgba(34, 211, 238, 0.04);
  border-color: rgba(34, 211, 238, 0.18);
}

.anx-rec-rank {
  color: #5a7d94;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.anx-rec-info strong {
  display: block;
  color: #d8f3ff;
  font-size: 13px;
  font-weight: 700;
}

.anx-rec-info strong em {
  color: #22d3ee;
  font-style: normal;
  margin-inline-start: 5px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.anx-rec-info > span {
  display: block;
  color: #5a7d94;
  font-size: 11px;
  margin-top: 2px;
}

.anx-rec-bar {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(136, 169, 188, 0.10);
}

.anx-rec-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22c55e, #22d3ee);
}

.anx-rec-stat { text-align: end; }

.anx-rec-stat strong {
  display: block;
  color: #d8f3ff;
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.anx-rec-stat span {
  color: #5a7d94;
  font-size: 11px;
}

/* Loading */
.anx-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
}

.anx-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(34, 211, 238, 0.12);
  border-top-color: #22d3ee;
  border-radius: 50%;
  animation: anx-spin 0.75s linear infinite;
}

.anx-spinner-sm {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(34, 211, 238, 0.12);
  border-top-color: #22d3ee;
  border-radius: 50%;
  animation: anx-spin 0.75s linear infinite;
  vertical-align: middle;
}

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

/* Responsive */
@media (max-width: 1024px) {
  .anx-kpi-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .anx-chart-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .anx-kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .anx-kpi-body strong { font-size: 17px; }
  .anx-record-row { grid-template-columns: 24px minmax(0, 1fr) 70px; }
  .anx-rec-bar { display: none; }
  .anx-toolbar { flex-direction: column; align-items: flex-start; }
  .anx-tf { padding: 5px 9px; font-size: 12px; }
  .anx-toolbar-end { flex-wrap: wrap; gap: 7px; }
  .anx-table thead th:nth-child(4),
  .anx-table thead th:nth-child(5),
  .anx-tr td:nth-child(4),
  .anx-tr td:nth-child(5) { display: none; }
}
/* ─────────────────────────────────────────────────────────────────────────── */
