:root {
  --bg: #06101d;
  --bg-soft: #091627;
  --sidebar: #071322;
  --panel: #0d1b2e;
  --panel-2: #10223a;
  --panel-3: #132943;
  --line: #203a59;
  --line-soft: rgba(113, 151, 194, .16);
  --text: #eef5ff;
  --muted: #8fa8c6;
  --muted-2: #6f89aa;
  --accent: #3f8cff;
  --accent-2: #5db7ff;
  --accent-soft: rgba(63, 140, 255, .14);
  --ok: #36d399;
  --warn: #f2b85b;
  --danger: #ff6b7d;
  --shadow: 0 20px 55px rgba(0, 0, 0, .28);
  --radius: 18px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font);
  background:
    radial-gradient(900px 520px at 72% -15%, rgba(45, 112, 208, .22), transparent 64%),
    radial-gradient(720px 460px at -8% 100%, rgba(20, 71, 133, .17), transparent 65%),
    linear-gradient(180deg, #071321 0%, var(--bg) 100%);
  -webkit-font-smoothing: antialiased;
}
body.sidebar-open { overflow: hidden; }

a { color: var(--accent-2); text-decoration: none; }
a:hover { color: #91d2ff; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
code, .mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: .88em;
  overflow-wrap: anywhere;
}

.shell { min-height: 100vh; }
.side {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: 272px;
  display: flex;
  flex-direction: column;
  padding: 20px 16px 16px;
  border-right: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(8, 22, 39, .98), rgba(5, 15, 27, .99));
  box-shadow: 14px 0 45px rgba(0, 0, 0, .16);
}
.side-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 2px 6px 18px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand.big { margin-bottom: 24px; }
.brand .mark {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(126, 190, 255, .38);
  border-radius: 14px;
  color: white;
  font-weight: 900;
  font-size: 1.05rem;
  letter-spacing: -.04em;
  background: linear-gradient(145deg, #4e9bff, #1c5fc2);
  box-shadow: 0 10px 26px rgba(24, 102, 211, .3), inset 0 1px 0 rgba(255,255,255,.24);
}
.brand strong { display: block; color: var(--text); font-size: 1rem; line-height: 1.25; white-space: nowrap; }
.brand small { display: block; margin-top: 2px; color: var(--muted-2); font-size: .72rem; white-space: nowrap; }
.side-close {
  display: none;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted);
  background: rgba(255,255,255,.03);
  cursor: pointer;
}

.side-nav { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 2px 14px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.nav-group { margin-bottom: 18px; }
.nav-title {
  display: block;
  padding: 0 11px 7px;
  color: #607d9f;
  font-size: .63rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.side-nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  margin: 3px 0;
  padding: 8px 11px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #aabdd5;
  font-size: .88rem;
  font-weight: 600;
  transition: .18s ease;
}
.side-nav a:hover { color: white; background: rgba(255,255,255,.045); border-color: rgba(130,170,215,.08); }
.side-nav a.on {
  color: #f5f9ff;
  border-color: rgba(78, 152, 255, .24);
  background: linear-gradient(90deg, rgba(47, 127, 238, .22), rgba(47, 127, 238, .07));
  box-shadow: inset 3px 0 0 var(--accent);
}
.nav-icon {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(131, 169, 212, .14);
  border-radius: 9px;
  color: #8fbaff;
  background: rgba(255,255,255,.035);
  font-size: .72rem;
  font-weight: 900;
}
.side-nav a.on .nav-icon { color: white; border-color: rgba(105,174,255,.35); background: rgba(55,139,255,.2); }
.side-bottom { display: grid; gap: 10px; }
.logout { margin: 0; }
.logout button {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  color: #a8bdd6;
  background: rgba(255,255,255,.025);
  cursor: pointer;
  transition: .18s ease;
}
.logout button:hover { color: white; border-color: rgba(255,107,125,.3); background: rgba(255,107,125,.08); }
.side-credit {
  padding: 12px;
  border: 1px solid rgba(58, 132, 229, .17);
  border-radius: 13px;
  text-align: center;
  background: linear-gradient(145deg, rgba(34, 101, 190, .1), rgba(255,255,255,.018));
}
.side-credit span, .side-credit small { display: block; color: var(--muted-2); font-size: .61rem; letter-spacing: .08em; }
.side-credit strong { display: block; margin: 3px 0; color: #a8d4ff; font-size: .78rem; letter-spacing: .08em; }

.main { min-height: 100vh; margin-left: 272px; padding: 22px clamp(22px, 3vw, 42px) 34px; }
.main-topbar {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
}
.main-topbar > div:first-child { display: grid; gap: 2px; }
.main-topbar strong { color: #dae9fb; font-size: .9rem; }
.topbar-kicker { color: var(--muted-2); font-size: .67rem; text-transform: uppercase; letter-spacing: .13em; font-weight: 800; }
.topbar-status { display: flex; align-items: center; gap: 8px; color: #9db5d1; font-size: .78rem; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 5px rgba(54,211,153,.09); }

.menu-toggle {
  display: none;
  position: fixed;
  z-index: 35;
  top: 14px;
  left: 14px;
  width: 42px;
  height: 42px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(11, 28, 48, .95);
  box-shadow: var(--shadow);
  cursor: pointer;
}
.menu-toggle span { display: block; height: 2px; margin: 4px 0; border-radius: 2px; background: #c6d8ed; }
.side-overlay { display: none; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 22px;
}
.page-head h1 { margin: 3px 0 6px; color: #f4f8ff; font-size: clamp(1.7rem, 2.5vw, 2.2rem); letter-spacing: -.035em; line-height: 1.12; }
.page-head p { max-width: 760px; margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.55; }
.eyebrow { color: #6eaaff; font-size: .65rem; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.page-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat {
  min-width: 0;
  display: grid;
  grid-template-columns: 45px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 124px;
  padding: 17px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  color: var(--text);
  background: linear-gradient(145deg, rgba(16, 35, 59, .97), rgba(10, 26, 45, .98));
  box-shadow: 0 12px 32px rgba(0, 0, 0, .13);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.stat:hover { color: var(--text); transform: translateY(-2px); border-color: rgba(72, 145, 241, .34); box-shadow: 0 18px 38px rgba(0,0,0,.2); }
.stat-icon { width: 45px; height: 45px; display: grid; place-items: center; border: 1px solid rgba(86,159,255,.25); border-radius: 14px; color: #a8d1ff; background: var(--accent-soft); font-weight: 900; }
.stat-icon.pulse { position: relative; }
.stat-icon.pulse::after { content: ""; position: absolute; inset: -4px; border: 1px solid rgba(54,211,153,.25); border-radius: 17px; }
.stat b { display: block; font-size: 1.8rem; letter-spacing: -.04em; line-height: 1; }
.stat div span { display: block; margin-top: 7px; color: #9bb0ca; font-size: .79rem; }
.stat small { grid-column: 1 / -1; color: #6985a5; font-size: .68rem; }
.stat.warn .stat-icon { color: #ffd595; border-color: rgba(242,184,91,.28); background: rgba(242,184,91,.1); }
.stat.warn b { color: #ffd18b; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr); gap: 16px; }
.card {
  margin-bottom: 16px;
  padding: 20px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: linear-gradient(155deg, rgba(14, 31, 53, .96), rgba(9, 24, 41, .97));
  box-shadow: 0 14px 38px rgba(0, 0, 0, .13);
  overflow-x: auto;
}
.card.tight { padding: 0; }
.card h2, .card h3 { margin: 0 0 14px; color: #eaf2fc; font-size: 1.02rem; letter-spacing: -.015em; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.card-head h2 { margin: 3px 0 0; }
.system-list { display: grid; gap: 2px; }
.system-list > div { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.system-list span { color: var(--muted); font-size: .78rem; }
.system-list strong { color: #dceaff; font-size: .8rem; }
.api-box { margin-top: 15px; padding: 13px; border: 1px solid rgba(73,143,235,.18); border-radius: 13px; background: rgba(25,76,145,.1); }
.api-box span { display: block; margin-bottom: 6px; color: var(--muted-2); font-size: .67rem; text-transform: uppercase; letter-spacing: .1em; }
.api-box code { color: #9fd0ff; }

.steps { margin: 0; padding-left: 20px; color: var(--muted); line-height: 1.7; }
.steps strong, .steps code { color: var(--text); }
.premium-steps { display: grid; gap: 12px; padding: 0; list-style: none; }
.premium-steps li { display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: start; padding: 13px; border: 1px solid var(--line-soft); border-radius: 14px; background: rgba(255,255,255,.018); }
.premium-steps li > span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: #a9d2ff; background: rgba(55,139,255,.13); font-size: .76rem; font-weight: 900; }
.premium-steps strong { display: block; margin-bottom: 3px; font-size: .83rem; }
.premium-steps small { display: block; color: var(--muted); font-size: .75rem; line-height: 1.5; }

label { display: flex; flex-direction: column; gap: 7px; color: #90a7c2; font-size: .76rem; font-weight: 650; }
label.check { min-height: 42px; flex-direction: row; align-items: center; gap: 9px; color: #c7d5e6; }
input, select, textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #223f61;
  border-radius: 11px;
  outline: none;
  color: #ecf4ff;
  background: #081625;
  padding: 10px 12px;
  transition: border-color .17s ease, box-shadow .17s ease, background .17s ease;
}
textarea { min-height: 92px; resize: vertical; line-height: 1.45; }
select option { color: #eaf2ff; background: #0b1a2d; }
input::placeholder, textarea::placeholder { color: #4f6d8f; }
input:focus, select:focus, textarea:focus { border-color: #4c96fa; background: #0a1a2c; box-shadow: 0 0 0 3px rgba(63,140,255,.11); }
input[type="checkbox"], input[type="radio"] { width: 17px; min-height: 17px; height: 17px; accent-color: var(--accent); }
input:disabled { opacity: .65; cursor: not-allowed; }

.btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 14px;
  border: 1px solid #28486c;
  border-radius: 11px;
  color: #d9e7f7;
  background: #112641;
  font-size: .78rem;
  font-weight: 750;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.btn:hover { color: white; transform: translateY(-1px); border-color: #4075ad; background: #173150; }
.btn.primary { border-color: transparent; color: white; background: linear-gradient(135deg, #438fff, #276fcf); box-shadow: 0 10px 24px rgba(35,108,210,.2); }
.btn.primary:hover { background: linear-gradient(135deg, #5a9dff, #327be0); box-shadow: 0 14px 29px rgba(35,108,210,.27); }
.btn.ghost { background: rgba(255,255,255,.025); }
.btn.danger { color: #ffbdc6; border-color: rgba(255,107,125,.28); background: rgba(255,107,125,.075); }
.btn.danger:hover { border-color: rgba(255,107,125,.48); background: rgba(255,107,125,.13); }
.btn:disabled { opacity: .38; cursor: not-allowed; transform: none; }

.row-form { display: flex; flex-wrap: wrap; align-items: end; gap: 11px; }
.row-form label { flex: 1 1 190px; }
.row-form.wrap label { min-width: 170px; }
.grid-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-form .full { grid-column: 1 / -1; }
.grid-form hr { grid-column: 1 / -1; width: 100%; margin: 2px 0; border: 0; border-top: 1px solid var(--line-soft); }

.muted { color: var(--muted); font-size: .76rem; line-height: 1.5; }
.flash { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 17px; padding: 13px 14px; border: 1px solid; border-radius: 13px; font-size: .82rem; }
.flash > span { width: 23px; height: 23px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 7px; font-weight: 900; }
.flash.ok { color: #b9f4dd; border-color: rgba(54,211,153,.24); background: rgba(54,211,153,.08); }
.flash.ok > span { background: rgba(54,211,153,.15); }
.flash.err { color: #ffc4cc; border-color: rgba(255,107,125,.26); background: rgba(255,107,125,.09); }
.flash.err > span { background: rgba(255,107,125,.16); }

.tag { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; font-size: .64rem; font-weight: 800; letter-spacing: .045em; text-transform: uppercase; }
.tag.ok { color: #aef0d5; border-color: rgba(54,211,153,.27); background: rgba(54,211,153,.09); }
.tag.warn { color: #ffd99c; border-color: rgba(242,184,91,.3); background: rgba(242,184,91,.09); }
.tag.off { color: #ffb8c1; border-color: rgba(255,107,125,.25); background: rgba(255,107,125,.075); }

/* Tables */
table { width: 100%; min-width: 720px; border-collapse: collapse; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; font-size: .78rem; }
th { color: #7592b4; background: rgba(3,13,24,.32); font-size: .65rem; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
td { color: #c9d7e8; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: rgba(62,136,231,.035); }
tbody tr:last-child td { border-bottom: 0; }
.row-warn { background: rgba(242,184,91,.035); }
.acts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.acts form { display: inline-flex; align-items: center; gap: 5px; margin: 0; }
.acts input[type="number"] { min-height: 36px; }

/* Tabs e personalização */
.tabs { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 15px; padding: 6px; border: 1px solid var(--line-soft); border-radius: 14px; background: rgba(8,23,40,.72); }
.tab { min-height: 38px; padding: 8px 13px; border: 1px solid transparent; border-radius: 10px; color: #809ab7; background: transparent; font-size: .76rem; font-weight: 750; cursor: pointer; }
.tab:hover { color: #d8e7f8; background: rgba(255,255,255,.035); }
.tab.on { color: white; border-color: rgba(77,151,250,.25); background: rgba(55,139,255,.16); }
.tab-panel { display: none; }
.tab-panel.on { display: block; }
.brand-form { margin-bottom: 9px; }
.upload-row { display: flex; flex-wrap: wrap; gap: 13px; align-items: flex-start; }
.upload-box { flex: 1 1 260px; display: flex; flex-direction: column; gap: 10px; padding: 15px; border: 1px solid var(--line-soft); border-radius: 14px; background: rgba(255,255,255,.018); }
.upload-box strong { color: #dceaff; font-size: .82rem; }
.preview-img { display: block; max-width: min(100%, 300px); max-height: 170px; object-fit: contain; padding: 6px; border: 1px solid var(--line-soft); border-radius: 13px; background: #06111e; }
.logo-toggle { padding: 13px 14px; border: 1px solid rgba(77,151,250,.2); border-radius: 13px; background: rgba(55,139,255,.07); }
.logo-preview-box { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--line-soft); border-radius: 14px; background: rgba(255,255,255,.018); }
.logo-preview-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.logo-preview-head strong { color: #dceaff; font-size: .82rem; }
.remove-logo-box { border-color: rgba(255,107,125,.18); background: rgba(255,107,125,.035); }

/* DNS */
.dns-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); gap: 13px; }
.dns-card { display: flex; flex-direction: column; gap: 11px; padding: 15px; border: 1px solid var(--line-soft); border-radius: 15px; background: rgba(6,17,30,.62); }
.dns-card.off { opacity: .67; border-style: dashed; }
.dns-card-head { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.dns-idx { color: #7592b2; font-size: .72rem; font-weight: 800; }
.dns-acts { margin-top: 3px; }
.hidden-form { display: none !important; }

/* Login e renovação */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-page::before { content: ""; position: fixed; inset: 0; pointer-events: none; background: radial-gradient(520px 320px at 50% 20%, rgba(56,132,235,.17), transparent 70%); }
.login-card { position: relative; z-index: 1; width: min(430px, 100%); padding: 29px; border: 1px solid rgba(89,143,204,.22); border-radius: 22px; background: linear-gradient(155deg, rgba(14,33,56,.97), rgba(7,20,35,.98)); box-shadow: 0 34px 95px rgba(0,0,0,.43); }
.login-card form { display: flex; flex-direction: column; gap: 13px; }
.login-card .btn { width: 100%; margin-top: 4px; }
.login-card .hint { margin: 15px 0 0; color: #718cab; font-size: .72rem; line-height: 1.55; text-align: center; }
.login-credit { margin-top: 21px; padding-top: 15px; border-top: 1px solid var(--line-soft); color: #66819f; font-size: .68rem; line-height: 1.45; text-align: center; }
.login-credit strong { display: block; margin: 3px 0; color: #9bcaff; font-size: .82rem; letter-spacing: .08em; }
.login-credit span { display: block; }

.panel-footer { display: flex; justify-content: space-between; gap: 16px; margin-top: 28px; padding-top: 17px; border-top: 1px solid var(--line-soft); color: #5d7897; font-size: .67rem; }

@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 880px) {
  .side { width: min(310px, 88vw); transform: translateX(-105%); transition: transform .22s ease; box-shadow: 24px 0 70px rgba(0,0,0,.45); }
  body.sidebar-open .side { transform: translateX(0); }
  .side-close { display: grid; place-items: center; }
  .side-overlay { position: fixed; inset: 0; z-index: 39; display: block; pointer-events: none; opacity: 0; background: rgba(1,8,15,.68); backdrop-filter: blur(3px); transition: opacity .2s ease; }
  body.sidebar-open .side-overlay { pointer-events: auto; opacity: 1; }
  .menu-toggle { display: block; }
  .main { margin-left: 0; padding: 78px 18px 28px; }
  .main-topbar { position: absolute; top: 14px; left: 70px; right: 18px; min-height: 42px; margin: 0; padding: 0 0 10px; }
  .topbar-status { display: none; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 14px; }
  .page-actions { justify-content: flex-start; }
}

@media (max-width: 620px) {
  .main { padding-left: 13px; padding-right: 13px; }
  .main-topbar { right: 13px; }
  .stats { grid-template-columns: 1fr; gap: 10px; }
  .stat { min-height: 105px; }
  .grid-form { grid-template-columns: 1fr; }
  .grid-form .full { grid-column: auto; }
  .card { padding: 16px; border-radius: 16px; }
  .card.tight { padding: 0; }
  .row-form { align-items: stretch; flex-direction: column; }
  .row-form label, .row-form.wrap label { width: 100%; min-width: 0; }
  .row-form .btn { width: 100%; }
  .dns-cards { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 1.65rem; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .panel-footer { flex-direction: column; text-align: center; }
  .login-card { padding: 23px 19px; }
}

/* Central de renovação */
.renewal-card{max-width:520px}
.renewal-copy{text-align:center;margin:18px 0 22px}
.renewal-copy h1{font-size:clamp(1.45rem,4vw,2rem);margin:15px 0 8px;letter-spacing:-.035em}
.renewal-copy p{margin:0;line-height:1.65}
.renewal-actions{display:flex;flex-direction:column;gap:10px}
.renewal-actions .btn{justify-content:center;min-height:48px}
.empty-state{display:flex;flex-direction:column;gap:6px;padding:18px;border:1px dashed var(--line);border-radius:14px;text-align:center;background:var(--panel-2)}
.empty-state span{color:var(--muted);font-size:.9rem}
