:root {
  --bg: #08090d;
  --panel: #12141b;
  --panel-2: #181b24;
  --soft: rgba(255,255,255,.045);
  --line: rgba(255,255,255,.1);
  --text: #f7f8fb;
  --muted: #9aa6b8;
  --orange: #ff5a13;
  --green: #00d09c;
  --blue: #4f8cff;
  --yellow: #f5b84b;
  --red: #ef4444;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 78% -10%, rgba(255,90,19,.18), transparent 34%),
    radial-gradient(circle at 14% 14%, rgba(79,140,255,.08), transparent 28%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, textarea, select { font: inherit; }
button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.025));
  color: var(--text);
  padding: 0 14px;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
button:hover { border-color: rgba(255,90,19,.45); transform: translateY(-1px); }
button svg, [data-icon] svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.primary { background: linear-gradient(135deg, var(--orange), #ff7a3d); border-color: rgba(255,90,19,.8); color: #fff; font-weight: 850; box-shadow: 0 18px 45px rgba(255,90,19,.18); }
.danger:hover { border-color: rgba(239,68,68,.55); color: #ffb4b4; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(470px, 100%);
  display: grid;
  gap: 16px;
  padding: 34px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 24px;
  background:
    radial-gradient(circle at 80% 0%, rgba(255,90,19,.16), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.025)),
    var(--panel);
  box-shadow: 0 34px 100px rgba(0,0,0,.36);
}
.login-mark, .brand { color: var(--orange); font-size: 30px; font-weight: 950; letter-spacing: -1px; }
.login-card h1 { margin: 2px 0 0; font-size: 28px; letter-spacing: -1px; }
.login-card p, .hero p { margin: 0; color: var(--muted); line-height: 1.6; }
label { display: grid; gap: 8px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
input, textarea, select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(8,9,13,.72);
  color: var(--text);
  padding: 12px 13px;
  outline: none;
}
input:focus, textarea:focus, select:focus { border-color: rgba(255,90,19,.55); box-shadow: 0 0 0 3px rgba(255,90,19,.1); }

.app { display: grid; grid-template-columns: 250px minmax(0,1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 26px 16px;
  border-right: 1px solid var(--line);
  background: rgba(10,12,17,.82);
  backdrop-filter: blur(18px);
}
.brand-wrap span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
nav { display: grid; gap: 8px; }
nav button { justify-content: flex-start; background: transparent; border-color: transparent; color: #cbd5e1; }
nav button.active {
  background: linear-gradient(135deg, rgba(255,90,19,.22), rgba(255,90,19,.08));
  border-color: rgba(255,90,19,.28);
  color: #fff;
}
.server-card {
  margin-top: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.035);
}
.server-card small, .server-card span { color: var(--muted); font-size: 12px; }
.server-card strong { display: block; margin: 5px 0; font-size: 15px; }
.logout { justify-content: flex-start; }
.content { padding: 30px; min-width: 0; }
.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(circle at 82% 12%, rgba(255,90,19,.14), transparent 36%),
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02)),
    rgba(18,20,27,.78);
}
.eyebrow { color: #ffb08a; font-size: 12px; font-weight: 850; text-transform: uppercase; letter-spacing: .12em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(32px, 5vw, 58px); line-height: .96; letter-spacing: -2px; }
h2 { font-size: 18px; margin-bottom: 0; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.overview { display: grid; grid-template-columns: minmax(0,1fr) 360px; gap: 16px; margin-bottom: 16px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.stat, .panel, .site-card, .health-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.018)), var(--panel);
  box-shadow: 0 20px 65px rgba(0,0,0,.2);
}
.stat { padding: 16px; min-height: 116px; }
.stat small, .health-panel small { color: var(--muted); font-size: 12px; }
.stat strong { display: block; margin-top: 8px; font-size: 26px; letter-spacing: -.5px; }
.stat span { display: block; margin-top: 10px; color: var(--muted); font-size: 12px; }
.health-panel { display: flex; align-items: center; gap: 18px; padding: 18px; }
.health-panel strong { display: block; margin: 6px 0; font-size: 18px; }
.health-panel p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.ring {
  --pct: 0%;
  width: 104px;
  height: 104px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--green) var(--pct), rgba(255,255,255,.08) 0);
  position: relative;
  flex-shrink: 0;
}
.ring::after { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: #11131a; }
.ring span { position: relative; z-index: 1; font-weight: 900; font-size: 21px; }
.toolbar {
  display: grid;
  grid-template-columns: minmax(260px,1fr) 190px 190px;
  gap: 10px;
  padding: 12px;
  margin-bottom: 16px;
}
.search-box { position: relative; }
.search-box [data-icon] { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box input { padding-left: 42px; }
.workbench { display: grid; grid-template-columns: minmax(0,1fr) 360px; gap: 16px; align-items: start; margin-bottom: 16px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.site-card {
  padding: 16px;
  display: grid;
  gap: 14px;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.site-card:hover, .site-card.active {
  transform: translateY(-2px);
  border-color: rgba(255,90,19,.42);
  background: linear-gradient(180deg, rgba(255,90,19,.08), rgba(255,255,255,.02)), var(--panel);
}
.site-card-head { display: flex; justify-content: space-between; gap: 12px; }
.site-card h3 { margin: 5px 0 4px; font-size: 20px; letter-spacing: -.3px; }
.site-card p { margin: 0; color: var(--muted); font-size: 13px; }
.site-kind { color: #ffb08a; font-size: 11px; font-weight: 850; text-transform: uppercase; letter-spacing: .09em; }
.pill { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; color: var(--muted); font-size: 12px; white-space: nowrap; height: fit-content; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.pill.ok::before { background: var(--green); }
.site-domain {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: #dce6f5;
  padding: 11px 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 13px;
  background: rgba(255,255,255,.035);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.checks { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; }
.checks span {
  min-height: 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255,255,255,.045);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.checks .ok { color: #9ff5df; background: rgba(0,208,156,.1); }
.checks .bad { color: #ffb3b3; background: rgba(239,68,68,.1); }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.card-actions button, .card-actions label button { width: 42px; padding: 0; }
.upload input { display: none; }
.details { position: sticky; top: 20px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head span { color: var(--muted); font-size: 12px; }
.detail-list { display: grid; gap: 9px; }
.detail-list div {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255,255,255,.03);
}
.detail-list small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.detail-list strong { display: block; margin-top: 4px; overflow-wrap: anywhere; }
.details-actions { display: grid; gap: 8px; margin-top: 14px; }
.details-actions button, .details-actions label button { width: 100%; }
.dns-help {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.dns-help b { color: #fff; }
.panel { padding: 18px; }
.events { display: grid; gap: 8px; max-height: 320px; overflow-y: auto; }
.event {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255,255,255,.03);
}
.event span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.event strong { font-size: 13px; }
.empty-state { min-height: 220px; display: grid; place-items: center; text-align: center; align-content: center; }
.empty-state p { color: var(--muted); }
dialog {
  width: min(590px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--text);
  background: #11131a;
  box-shadow: 0 30px 100px rgba(0,0,0,.45);
}
dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(3px); }
#siteForm { display: grid; gap: 14px; }
.actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
#toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: 380px;
  z-index: 5;
}
.toast {
  margin-top: 8px;
  padding: 12px 14px;
  border: 1px solid rgba(255,90,19,.28);
  border-radius: 13px;
  background: #181b23;
  box-shadow: 0 18px 48px rgba(0,0,0,.28);
  transform: translateY(8px);
  opacity: 0;
  animation: toastIn .18s ease forwards;
}
@keyframes toastIn { to { transform: translateY(0); opacity: 1; } }
@media (max-width: 1180px) {
  .overview, .workbench { grid-template-columns: 1fr; }
  .details { position: static; }
  .stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .content { padding: 18px; }
  .hero { align-items: flex-start; flex-direction: column; }
  .toolbar { grid-template-columns: 1fr; }
  .grid, .stats { grid-template-columns: 1fr; }
  .event { align-items: flex-start; flex-direction: column; }
}
