:root {
  --bg: #07090f;
  --panel: #101522;
  --panel-2: #151b2b;
  --line: rgba(148, 163, 184, .14);
  --line-strong: rgba(148, 163, 184, .26);
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-2: #64748b;
  --accent: #ef1717;
  --accent-2: #b90f1a;
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
  --radius: 16px;
  --sidebar-w: 268px;
  --shadow: 0 22px 70px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, rgba(239, 23, 23, .16), transparent 28rem),
    radial-gradient(circle at 90% 10%, rgba(59, 130, 246, .10), transparent 24rem),
    linear-gradient(180deg, #07090f 0%, #090d15 100%);
}
button, input { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: .88rem; }
.text-danger { color: #fca5a5 !important; }
.mono { font-family: Consolas, "SF Mono", ui-monospace, monospace; font-size: .82rem; word-break: break-all; }

.boot-screen { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 50; }
.spinner { width: 42px; height: 42px; border: 3px solid rgba(148,163,184,.18); border-top-color: var(--accent); border-radius: 50%; animation: spin .85s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Login */
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; }
.login-card {
  width: min(420px, 100%);
  padding: 32px;
  background: linear-gradient(180deg, rgba(16,21,34,.94), rgba(10,14,23,.94));
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.login-brand-wrap { min-height: 76px; display: grid; place-items: center; margin-bottom: 2px; }
.login-logo { display: block; width: auto; height: auto; max-width: min(250px, 82%); max-height: 92px; object-fit: contain; filter: drop-shadow(0 12px 28px rgba(0,0,0,.28)); }
.login-brand { font-size: 2rem; font-weight: 900; text-align: center; letter-spacing: -.04em; }
.login-brand::first-letter { color: var(--accent); }
.login-sub { margin: 6px 0 26px; text-align: center; color: var(--muted); }
.error-text { min-height: 1.2em; margin: 12px 0 0; color: #fecaca; text-align: center; font-size: .88rem; }

/* Shell */
.app-shell { min-height: 100vh; display: flex; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: var(--sidebar-w);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(16,21,34,.98), rgba(9,13,22,.98));
  border-right: 1px solid var(--line);
  box-shadow: 16px 0 60px rgba(0,0,0,.24);
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 24px;
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: -.03em;
}
.sidebar-brand small {
  display: block;
  margin-top: 1px;
  color: var(--muted-2);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.logo-dot {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #ff6b6b);
  box-shadow: 0 14px 34px rgba(239,23,23,.36);
}
.logo-dot::after { content: ""; display: block; width: 10px; height: 10px; margin: 12px; border-radius: 50%; background: #fff; opacity: .92; }
.nav { display: flex; flex-direction: column; gap: 7px; flex: 1; }
.nav-item {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 13px;
  padding: 12px 13px;
  display: flex;
  align-items: center;
  gap: 11px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  font-weight: 750;
}
.nav-item:hover { background: rgba(148,163,184,.08); color: var(--text); border-color: var(--line); }
.nav-item.active { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 14px 34px rgba(239, 23, 23, .22); }
.nav-ico {
  width: 34px;
  height: 28px;
  border-radius: 9px;
  display: inline-grid;
  place-items: center;
  background: rgba(255,255,255,.08);
  font-size: .62rem;
  font-weight: 900;
  letter-spacing: .06em;
}
.sidebar-foot { margin-top: auto; padding: 18px 4px 4px; }
.sidebar-credit { margin: 14px 0 0; text-align: center; color: var(--muted-2); font-size: .75rem; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 10px 8px 14px; margin-bottom: 8px; border-top: 1px solid var(--line); }
.user-chip strong, .user-chip small { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip strong { font-size: .86rem; }
.user-chip small { color: var(--muted-2); margin-top: 2px; font-size: .75rem; }
.user-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(34,197,94,.12); flex: none; }

.content { width: 100%; min-width: 0; margin-left: var(--sidebar-w); }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 74px;
  padding: 0 34px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(7,9,15,.76);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.topbar h1 { margin: 0; font-size: 1.35rem; letter-spacing: -.035em; }
.page-kicker { display: block; margin-bottom: 2px; color: var(--muted-2); font-size: .73rem; font-weight: 850; letter-spacing: .10em; text-transform: uppercase; }
.icon-btn { display: none; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; }
.section { display: none; max-width: 1220px; padding: 30px 34px 72px; }
.section.active { display: block; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Cards and forms */
.card {
  background: linear-gradient(180deg, rgba(16,21,34,.95), rgba(13,18,30,.95));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 16px 45px rgba(0,0,0,.18);
}
.card + .card { margin-top: 18px; }
.card-title { margin: 0 0 16px; font-size: 1.05rem; letter-spacing: -.025em; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card-head .card-title { margin: 0; }
.card-sub { margin: 4px 0 0; color: var(--muted-2); font-size: .82rem; }
.card-sub strong, .card-sub span { color: var(--text); font-weight: 800; }
.hint { margin: -6px 0 18px; color: var(--muted); font-size: .9rem; line-height: 1.65; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.reseller-form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.field { margin-bottom: 14px; }
.field-wide { grid-column: 1 / -1; }
.field-toggle { display: flex; flex-direction: column; justify-content: flex-end; }
label { display: block; margin-bottom: 7px; color: var(--muted); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
label span { text-transform: none; letter-spacing: 0; font-weight: 600; }
.input {
  width: 100%;
  min-height: 44px;
  padding: 11px 13px;
  color: var(--text);
  background: rgba(2,6,23,.42);
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease, opacity .15s ease;
}
.input:focus { border-color: rgba(239,23,23,.68); box-shadow: 0 0 0 4px rgba(239,23,23,.11); background: rgba(2,6,23,.56); }
.input::placeholder { color: #596579; }
.input[readonly] { color: #d8e1ed; background: rgba(2,6,23,.20); cursor: default; }
.input[readonly]:focus { border-color: var(--line); box-shadow: none; }
.toggle-line { min-height: 44px; margin: 0; display: flex; align-items: center; gap: 10px; padding: 0 4px; color: var(--text); text-transform: none; letter-spacing: 0; cursor: pointer; }
.toggle-line input { width: 18px; height: 18px; accent-color: var(--accent); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }

.btn { min-height: 42px; padding: 10px 16px; border: 1px solid transparent; border-radius: 12px; font-weight: 800; cursor: pointer; transition: transform .12s ease, border-color .12s ease, background .12s ease, opacity .12s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .48; cursor: not-allowed; transform: none; }
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 12px 28px rgba(239,23,23,.22); }
.btn-secondary { color: var(--text); background: rgba(148,163,184,.09); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--line-strong); background: rgba(148,163,184,.14); }
.btn-danger { color: #fecaca; background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.22); }
.btn-block { width: 100%; display: block; }
.btn-sm { min-height: 36px; padding: 7px 13px; font-size: .82rem; }
.btn-ico { display: inline-block; margin-right: 4px; font-weight: 900; }

/* Dashboard */
.dashboard-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.dashboard-heading h2 { margin: 4px 0 5px; font-size: 1.35rem; letter-spacing: -.035em; }
.dashboard-heading p { margin: 0; color: var(--muted); font-size: .88rem; }
.dashboard-eyebrow { color: var(--accent); font-size: .68rem; font-weight: 900; text-transform: uppercase; letter-spacing: .12em; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}
.stats-grid.admin-stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-card {
  --card-rgb: 148, 163, 184;
  position: relative;
  min-height: 190px;
  padding: 22px;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(var(--card-rgb), .23);
  background:
    radial-gradient(circle at 100% 0%, rgba(var(--card-rgb), .17), transparent 44%),
    linear-gradient(155deg, rgba(17,23,37,.98), rgba(8,12,20,.98));
  box-shadow: 0 18px 48px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.025);
  isolation: isolate;
}
.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, rgba(var(--card-rgb), 1), rgba(var(--card-rgb), .18));
}
.stat-card::after {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  right: -78px;
  bottom: -90px;
  border-radius: 50%;
  background: rgba(var(--card-rgb), .09);
  filter: blur(2px);
  pointer-events: none;
  z-index: -1;
}
.stat-card.tone-blue { --card-rgb: 59, 130, 246; }
.stat-card.tone-purple { --card-rgb: 168, 85, 247; }
.stat-card.tone-green { --card-rgb: 34, 197, 94; }
.stat-card.tone-warning { --card-rgb: 245, 158, 11; }
.stat-card.tone-neutral { --card-rgb: 148, 163, 184; }
.stat-card-head { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stat-icon {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 14px;
  border: 1px solid rgba(var(--card-rgb), .26);
  background: rgba(var(--card-rgb), .12);
  color: rgb(var(--card-rgb));
}
.stat-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.stat-badge {
  padding: 6px 9px;
  border-radius: 999px;
  border: 1px solid rgba(var(--card-rgb), .22);
  background: rgba(var(--card-rgb), .09);
  color: rgb(var(--card-rgb));
  font-size: .63rem;
  font-weight: 900;
  letter-spacing: .08em;
}
.stat-label {
  margin-top: 17px;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .085em;
}
.stat-value {
  margin-top: 8px;
  color: var(--text);
  font-size: clamp(2rem, 3vw, 2.8rem);
  line-height: 1;
  font-weight: 950;
  letter-spacing: -.055em;
  overflow-wrap: anywhere;
}
.stat-note {
  margin-top: 12px;
  min-height: 1.15em;
  color: var(--muted-2);
  font-size: .82rem;
  line-height: 1.4;
}
.stat-progress {
  width: 100%;
  height: 5px;
  margin-top: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148,163,184,.12);
}
.stat-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: rgb(var(--card-rgb));
  box-shadow: 0 0 18px rgba(var(--card-rgb), .28);
}
.dashboard-card { margin-top: 0 !important; }
.expiry-list { display: flex; flex-direction: column; gap: 8px; }
.expiry-item { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 13px; background: rgba(2,6,23,.24); }
.expiry-item strong, .expiry-item small { display: block; }
.expiry-item small { margin-top: 4px; color: var(--muted-2); font-size: .78rem; }
.expiry-right { text-align: right; }
.empty-compact { display: flex; align-items: center; gap: 12px; padding: 18px; border: 1px dashed var(--line-strong); border-radius: 14px; color: var(--muted); }
.empty-compact > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: rgba(34,197,94,.12); color: #86efac; font-weight: 900; }
.empty-compact strong, .empty-compact small { display: block; }
.empty-compact strong { color: var(--text); font-size: .9rem; }
.empty-compact small { margin-top: 3px; color: var(--muted-2); font-size: .78rem; }
.status-banner { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid rgba(34,197,94,.22); background: rgba(34,197,94,.07); border-radius: 14px; }
.status-banner p { margin: 4px 0 0; color: var(--muted); font-size: .86rem; }
.status-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 6px rgba(34,197,94,.12); }

/* DNS */
.add-server { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 14px; align-items: end; }
.add-server .field { margin-bottom: 0; }
.add-server .btn { height: 44px; white-space: nowrap; }
.server-list { display: flex; flex-direction: column; gap: 10px; }
.server-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 13px 14px; background: rgba(2,6,23,.30); border: 1px solid var(--line); border-radius: 14px; transition: border-color .15s ease, background .15s ease, opacity .2s ease, transform .2s ease; }
.server-item:hover { border-color: var(--line-strong); }
.server-item.editing { border-color: rgba(59,130,246,.35); background: rgba(15,31,54,.42); }
.server-item.saving { opacity: .7; }
.server-item.saved { border-color: rgba(34,197,94,.55); box-shadow: 0 0 0 3px rgba(34,197,94,.12); }
.server-item.removing { opacity: 0; transform: translateX(14px); }
.server-main { min-width: 0; }
.server-fields { display: grid; grid-template-columns: 1fr 1.65fr; gap: 10px; min-width: 0; }
.server-fields .input { min-height: 40px; }
.server-meta { min-height: 20px; margin-top: 7px; }
.owner-pill { display: inline-flex; padding: 3px 8px; border-radius: 999px; background: rgba(148,163,184,.09); color: var(--muted); font-size: .7rem; font-weight: 700; }
.server-actions { display: flex; align-items: center; gap: 6px; }
.icon-action, .icon-del { width: 38px; height: 38px; flex: none; border-radius: 10px; cursor: pointer; font-size: 1rem; transition: background .15s ease, border-color .15s ease, transform .12s ease; }
.icon-action { border: 1px solid rgba(148,163,184,.20); background: rgba(148,163,184,.08); color: #dbeafe; }
.icon-action:hover { border-color: rgba(148,163,184,.38); background: rgba(148,163,184,.14); transform: translateY(-1px); }
.icon-save { border-color: rgba(34,197,94,.25); background: rgba(34,197,94,.10); color: #86efac; }
.icon-del { border: 1px solid rgba(239,68,68,.22); background: rgba(239,68,68,.10); color: #fecaca; }
.icon-del:hover { background: rgba(239,68,68,.20); border-color: rgba(239,68,68,.4); transform: translateY(-1px); }
.switch { position: relative; display: inline-flex; width: 44px; height: 25px; cursor: pointer; flex: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track { position: absolute; inset: 0; background: rgba(148,163,184,.22); border-radius: 999px; transition: background .18s ease; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: #fff; transition: transform .18s ease; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.switch input:checked + .switch-track { background: linear-gradient(135deg, var(--success), #16a34a); }
.switch input:checked + .switch-track::after { transform: translateX(19px); }

/* Revendedores */
.reseller-list { display: flex; flex-direction: column; gap: 10px; }
.reseller-item { display: grid; grid-template-columns: minmax(180px, 1.35fr) .7fr 1fr auto auto; align-items: center; gap: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(2,6,23,.28); }
.reseller-item:hover { border-color: var(--line-strong); }
.reseller-identity { min-width: 0; display: flex; align-items: center; gap: 10px; }
.reseller-identity strong, .reseller-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reseller-identity small { margin-top: 3px; color: var(--muted-2); font-size: .76rem; }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(135deg, rgba(239,23,23,.28), rgba(185,15,26,.22)); border: 1px solid rgba(239,23,23,.25); font-weight: 900; }
.reseller-metric span, .reseller-metric strong { display: block; }
.reseller-metric span { color: var(--muted-2); font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.reseller-metric strong { margin-top: 4px; font-size: .86rem; }
.reseller-actions { display: flex; gap: 6px; justify-content: flex-end; }
.badge { width: fit-content; padding: 5px 10px; border-radius: 999px; background: rgba(148,163,184,.10); color: var(--muted); font-size: .72rem; font-weight: 850; white-space: nowrap; }
.badge.ok { background: rgba(34,197,94,.13); color: #86efac; }
.badge.err { background: rgba(239,68,68,.13); color: #fecaca; }
.badge.warn { background: rgba(245,158,11,.13); color: #fcd34d; }
.badge.neutral { background: rgba(148,163,184,.10); color: #cbd5e1; }

.empty-state { text-align: center; padding: 40px 16px; }
.empty-state .empty-ico { font-size: 2.4rem; margin-bottom: 10px; }
.empty-state p { margin: 0 0 4px; font-weight: 700; }

.footer { text-align: center; padding: 14px; font-size: .8rem; color: var(--muted-2); }
.footer b { color: var(--text); }
.footer-static { position: absolute; bottom: 12px; left: 0; right: 0; }

.panel-id { display: inline-flex; align-items: center; width: fit-content; margin-top: 4px; padding: 3px 7px; border-radius: 7px; border: 1px solid rgba(59,130,246,.22); background: rgba(59,130,246,.08); color: #93c5fd; font-size: .68rem; font-weight: 850; letter-spacing: .04em; }
.dns-filter-grid { display: grid; grid-template-columns: 1fr 1.2fr .8fr; gap: 14px; }
.integration-card { border-color: rgba(59,130,246,.22); background: linear-gradient(160deg, rgba(16,21,34,.98), rgba(11,25,46,.82)); }
.integration-empty { padding: 16px; border: 1px dashed var(--line-strong); border-radius: 12px; color: var(--muted); text-align: center; }
.integration-details { display: grid; gap: 12px; }
.integration-id-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(2,6,23,.28); }
.integration-id-line span { color: var(--muted); font-size: .78rem; font-weight: 750; }
.integration-id-line strong { color: #93c5fd; font-size: .9rem; letter-spacing: .05em; }
.integration-url-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; }
.reseller-dns-list { display: grid; gap: 10px; }
.reseller-dns-item { display: grid; grid-template-columns: minmax(190px, 1.15fr) minmax(280px, 1.65fr) auto auto; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(2,6,23,.28); }
.reseller-dns-item:hover { border-color: var(--line-strong); }
.reseller-dns-owner { min-width: 0; }
.reseller-dns-owner strong, .reseller-dns-server strong { display: block; color: var(--text); font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reseller-dns-owner small, .reseller-dns-server small { display: block; margin-top: 4px; color: var(--muted); font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reseller-dns-server { min-width: 0; }
.status-pair { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.reseller-panel-info { display: grid; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.reseller-panel-info-row { display: grid; grid-template-columns: 120px 1fr auto; gap: 10px; align-items: center; }
.reseller-panel-info-row span { color: var(--muted); font-size: .75rem; font-weight: 750; }
.reseller-panel-info-row code { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #bfdbfe; font-size: .76rem; }
.copy-mini { padding: 6px 9px; min-height: auto; }

.overlay { position: fixed; inset: 0; z-index: 25; background: rgba(0,0,0,.58); backdrop-filter: blur(4px); }

/* Toasts */
.toasts { position: fixed; z-index: 60; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; max-width: min(380px, calc(100vw - 40px)); }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 15px; border-radius: 13px; background: linear-gradient(180deg, rgba(21,27,43,.98), rgba(13,18,30,.98)); border: 1px solid var(--line-strong); box-shadow: var(--shadow); color: var(--text); font-size: .9rem; font-weight: 600; opacity: 0; transform: translateY(12px); transition: opacity .2s ease, transform .2s ease; }
.toast.show { opacity: 1; transform: none; }
.toast-ico { width: 24px; height: 24px; flex: none; display: grid; place-items: center; border-radius: 50%; font-size: .78rem; font-weight: 900; color: #fff; }
.toast-success .toast-ico { background: var(--success); }
.toast-error .toast-ico { background: var(--danger); }
.toast-info .toast-ico { background: #3b82f6; }
.toast-error { border-color: rgba(239,68,68,.4); }
.toast-success { border-color: rgba(34,197,94,.35); }


/* Login branding settings */
.branding-settings-card { overflow: hidden; }
.branding-grid { display: grid; grid-template-columns: minmax(260px, .9fr) minmax(320px, 1.1fr); gap: 26px; align-items: stretch; }
.branding-preview-panel { padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: rgba(8,12,20,.65); }
.branding-preview-label { display: block; margin-bottom: 10px; color: var(--muted-2); font-size: .7rem; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; }
.branding-preview-box { min-height: 190px; display: grid; place-items: center; padding: 24px; border-radius: 16px; border: 1px dashed var(--line-strong); background: radial-gradient(circle at 50% 0%, rgba(239,23,23,.11), transparent 62%), #07090f; }
.branding-preview-image { display: block; max-width: 100%; max-height: 130px; object-fit: contain; }
.branding-preview-fallback { font-size: 2rem; font-weight: 950; letter-spacing: -.05em; }
.branding-preview-fallback::first-letter { color: var(--accent); }
.branding-file-name { margin: 12px 0 0; color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.branding-controls { display: flex; flex-direction: column; justify-content: center; }
.file-input { padding: 9px; }
.file-input::file-selector-button { margin-right: 12px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: rgba(148,163,184,.10); color: var(--text); cursor: pointer; font-weight: 800; }
.branding-actions { margin-top: 18px; flex-wrap: wrap; }

@media (max-width: 1120px) {
  .stats-grid, .stats-grid.admin-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reseller-form-grid, .dns-filter-grid { grid-template-columns: repeat(2, 1fr); }
  .branding-grid { grid-template-columns: 1fr; }
  .reseller-item { grid-template-columns: minmax(180px, 1.4fr) .7fr 1fr auto; }
  .reseller-dns-item { grid-template-columns: 1fr 1.4fr auto; }
  .reseller-dns-item .status-pair { grid-column: 1 / -1; justify-content: flex-start; }
  .reseller-actions { grid-column: 1 / -1; padding-top: 6px; border-top: 1px solid var(--line); }
}

@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; }
  .sidebar.open { transform: none; }
  .content { margin-left: 0; }
  .icon-btn { display: inline-grid; place-items: center; }
  .topbar { height: 66px; padding: 0 16px; }
  .section { padding: 18px 14px 56px; }
  .card { padding: 18px; }
  .dashboard-heading { align-items: stretch; flex-direction: column; }
  .dashboard-heading .btn { align-self: flex-start; }
  .form-grid, .reseller-form-grid, .dns-filter-grid { grid-template-columns: 1fr; }
  .add-server { grid-template-columns: 1fr; }
  .add-server .btn { width: 100%; }
  .server-fields { grid-template-columns: 1fr; }
  .server-item { align-items: flex-start; }
  .server-actions { flex-direction: column; }
  .reseller-item { grid-template-columns: 1fr 1fr; }
  .integration-url-row { grid-template-columns: 1fr 1fr; }
  .integration-url-row .input { grid-column: 1 / -1; }
  .reseller-dns-item { grid-template-columns: 1fr 1fr; }
  .reseller-identity { grid-column: 1 / -1; }
  .reseller-actions { grid-column: 1 / -1; flex-wrap: wrap; }
  .expiry-item { align-items: flex-start; }
  .toasts { right: 12px; left: 12px; bottom: 12px; max-width: none; }
}

@media (max-width: 560px) {
  .stats-grid, .stats-grid.admin-stats-grid { grid-template-columns: 1fr; }
  .card-head { align-items: stretch; flex-direction: column; }
  .server-item { grid-template-columns: auto 1fr; }
  .server-actions { grid-column: 1 / -1; flex-direction: row; justify-content: flex-end; border-top: 1px solid var(--line); padding-top: 10px; }
  .reseller-item { grid-template-columns: 1fr; }
  .integration-url-row { grid-template-columns: 1fr; }
  .integration-url-row .input { grid-column: auto; }
  .reseller-dns-item { grid-template-columns: 1fr; }
  .reseller-panel-info-row { grid-template-columns: 1fr; }
  .reseller-identity, .reseller-actions { grid-column: auto; }
  .reseller-actions { justify-content: stretch; }
  .reseller-actions .btn { flex: 1; }
  .expiry-item { flex-direction: column; }
  .expiry-right { text-align: left; }
}
