:root {
  --bg: #0b1210;
  --panel: #121a17;
  --line: #1e2a25;
  --text: #e8f0ec;
  --muted: #8aa297;
  --accent: #10b981;
  --warn: #e5a34a;
  --danger: #e25555;
  --ok: #10b981;
  --font: "Segoe UI", "Trebuchet MS", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background:
  radial-gradient(1200px 600px at 10% -10%, #143528 0%, transparent 55%),
  radial-gradient(900px 500px at 100% 0%, #1a2430 0%, transparent 50%),
  var(--bg);
  color: var(--text); font-family: var(--font); }
a { color: var(--accent); text-decoration: none; }
code, .mono { font-family: ui-monospace, Consolas, monospace; font-size: .9em; }

.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { border-right: 1px solid var(--line); background: rgba(8,14,12,.72); padding: 22px 16px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; }
.brand { display: flex; gap: 12px; align-items: center; }
.brand.big { margin-bottom: 18px; }
.brand .mark { width: 42px; height: 42px; border-radius: 12px; background: linear-gradient(145deg, #14d49a, #0a7f5a); display: grid; place-items: center; font-weight: 800; color: #04231a; }
.brand strong { display: block; font-size: 1.05rem; }
.brand small { color: var(--muted); }
.side nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.side nav a { padding: 10px 12px; border-radius: 10px; color: var(--text); }
.side nav a.on, .side nav a:hover { background: rgba(16,185,129,.12); color: #9ff0cf; }
.logout button { width: 100%; background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 10px; padding: 10px; cursor: pointer; }
.side-credit {
  margin-top: 8px;
  padding: 12px 10px;
  border-radius: 12px;
  border: 1px solid rgba(16,185,129,.22);
  background: linear-gradient(160deg, rgba(16,185,129,.10), rgba(8,14,12,.4));
  text-align: center;
  font-size: .72rem;
  color: var(--muted);
  letter-spacing: .04em;
  line-height: 1.35;
}
.side-credit strong {
  display: block;
  margin-top: 2px;
  color: #9ff0cf;
  font-size: .95rem;
  letter-spacing: .08em;
  font-weight: 800;
}
.side-credit span {
  display: block;
  margin-top: 2px;
  font-size: .68rem;
  opacity: .85;
}
.panel-footer {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .82rem;
  text-align: center;
}
.panel-footer strong { color: #9ff0cf; letter-spacing: .04em; }
.login-credit {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.4;
}
.login-credit strong {
  display: block;
  margin-top: 2px;
  color: #9ff0cf;
  font-size: 1rem;
  letter-spacing: .08em;
  font-weight: 800;
}
.login-credit span {
  display: block;
  margin-top: 2px;
  font-size: .72rem;
  opacity: .85;
}
.main { padding: 28px 32px 48px; }
.page-head h1 { margin: 0 0 6px; font-size: 1.7rem; letter-spacing: -.02em; }
.page-head p { margin: 0 0 18px; color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.stat b { display: block; font-size: 1.8rem; }
.stat span { color: var(--muted); font-size: .9rem; }
.stat.warn b { color: var(--warn); }

.card { background: rgba(18,26,23,.92); border: 1px solid var(--line); border-radius: 18px; padding: 20px; margin-bottom: 16px; }
.card.tight { padding: 0; overflow: hidden; }
.card h2, .card h3 { margin: 0 0 12px; font-size: 1.05rem; }
.steps { margin: 0; padding-left: 18px; color: var(--muted); line-height: 1.7; }
.steps strong, .steps code { color: var(--text); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: .92rem; }
th { color: var(--muted); font-weight: 600; background: rgba(0,0,0,.18); }
.row-warn { background: rgba(229,163,74,.06); }
.muted { color: var(--muted); font-size: .82rem; }
.acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.acts form { display: inline-flex; gap: 4px; align-items: center; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .75rem; border: 1px solid var(--line); }
.tag.ok { color: #9ff0cf; border-color: rgba(16,185,129,.35); background: rgba(16,185,129,.12); }
.tag.warn { color: #ffd9a8; border-color: rgba(229,163,74,.4); background: rgba(229,163,74,.12); }
.tag.off { color: #ffb4b4; border-color: rgba(226,85,85,.35); background: rgba(226,85,85,.1); }

label { display: flex; flex-direction: column; gap: 6px; font-size: .86rem; color: var(--muted); }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
input, select, textarea, button { font: inherit; }
input, select, textarea { background: #0a100e; border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 10px 12px; }
.btn { border: 1px solid var(--line); background: #18221e; color: var(--text); border-radius: 10px; padding: 9px 14px; cursor: pointer; display: inline-block; }
.btn.primary { background: linear-gradient(145deg, #14d49a, #0b8f65); color: #04231a; border: 0; font-weight: 700; }
.btn.ghost { background: transparent; }
.btn.danger { border-color: rgba(226,85,85,.4); color: #ffb4b4; }

.row-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.row-form.wrap label { min-width: 140px; }
.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-form .full { grid-column: 1 / -1; }
.grid-form hr { grid-column: 1 / -1; border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

.flash { padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; border: 1px solid var(--line); }
.flash.ok { background: rgba(16,185,129,.12); color: #b7f5d9; }
.flash.err { background: rgba(226,85,85,.12); color: #ffc2c2; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(420px, 100%); background: rgba(18,26,23,.95); border: 1px solid var(--line); border-radius: 20px; padding: 28px; box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.login-card form { display: flex; flex-direction: column; gap: 12px; }
.login-card .hint { color: var(--muted); font-size: .82rem; margin-top: 14px; }

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: relative; height: auto; }
  .stats { grid-template-columns: 1fr 1fr; }
  .grid-form { grid-template-columns: 1fr; }
}

/* Tabs (branding) */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
  padding: 6px;
  background: rgba(18,26,23,.7);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font: inherit;
}
.tab:hover { color: var(--text); background: rgba(16,185,129,.08); }
.tab.on {
  color: #04231a;
  background: linear-gradient(145deg, #14d49a, #0b8f65);
  font-weight: 700;
}
.tab-panel { display: none; }
.tab-panel.on { display: block; }

/* DNS cards */
.dns-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.dns-card {
  background: #0a100e;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dns-card.off { opacity: .72; border-style: dashed; }
.dns-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.dns-idx { color: var(--muted); font-size: .85rem; font-weight: 600; }
.dns-acts { margin-top: 4px; }
.dns-list .hidden-form { display: none; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* Uploads / preview */
.upload-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-start;
}
.upload-box {
  flex: 1;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: #0a100e;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.upload-box strong { color: var(--text); font-size: .92rem; }
.preview-img {
  max-width: 220px;
  max-height: 120px;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #0a100e;
  padding: 6px;
}
.brand-form { margin-bottom: 8px; }
