:root {
  --sidebar: #0b1f3a;
  --sidebar-2: #0e2748;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --bg: #f3f5f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --green: #16a34a;
  --red: #dc2626;
  --purple: #7c3aed;
  --orange: #ea580c;
  --shadow: 0 8px 24px rgba(15, 23, 42, .06);
  --radius: 16px;
  --font: "Plus Jakarta Sans", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.shell {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: linear-gradient(180deg, var(--sidebar) 0%, #071526 100%);
  color: #fff;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 10px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  position: relative;
}
.sidebar-close,
.menu-toggle {
  display: none;
  border: 0;
  cursor: pointer;
  background: transparent;
  color: inherit;
  padding: 0;
  align-items: center;
  justify-content: center;
}
.sidebar-close {
  margin-left: auto;
  width: 36px; height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,.08);
  color: #fff;
}
.sidebar-close .wl-ico { width: 18px; height: 18px; }
.menu-toggle {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  color: #0f172a;
  flex-shrink: 0;
}
.menu-toggle .wl-ico { width: 20px; height: 20px; }
.sidebar-overlay {
  display: none;
}
.topbar-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.topbar-text { min-width: 0; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #3b82f6, #1d4ed8);
  font-weight: 800; font-size: 18px;
}
.brand strong { display: block; font-size: 13px; letter-spacing: .2px; line-height: 1.25; }
.brand small { color: #93c5fd; font-size: 11px; }

.nav { display: grid; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 12px;
  color: #cbd5e1; font-weight: 600; font-size: 14px;
  transition: .15s ease;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: rgba(37,99,235,.28); color: #fff; }
.nav-ico {
  width: 22px; height: 22px;
  display: inline-grid; place-items: center;
  opacity: .95;
}
.wl-ico {
  width: 1.15em; height: 1.15em;
  display: inline-block;
  vertical-align: -0.15em;
  flex-shrink: 0;
}
.wl-ico.ico-sm { width: 16px; height: 16px; }
.wl-ico.ico-xs { width: 14px; height: 14px; }
.nav-ico .wl-ico { width: 18px; height: 18px; }
.bell .wl-ico { width: 18px; height: 18px; color: #334155; }
.support-ico .wl-ico,
.support-ico { color: #93c5fd; }
.support-ico { display: inline-grid; place-items: center; }
.support-btn .wl-ico { width: 16px; height: 16px; }

.sidebar-foot { display: grid; gap: 4px; margin-top: auto; }
.sidebar-support {
  margin-top: 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
  padding: 14px;
}
.support-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px;
}
.support-head strong { font-size: 14px; }
.support-ico { font-size: 18px; }
.sidebar-support p {
  margin: 0 0 12px;
  color: #93c5fd;
  font-size: 12px;
  line-height: 1.35;
}
.support-btn { width: 100%; }
.sidebar-version {
  margin-top: 10px;
  color: #64748b;
  font-size: 11px;
  padding: 0 6px;
}

.main { padding: 22px 24px 40px; min-width: 0; }
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; margin-bottom: 18px;
}
.topbar h1 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 800;
}
.topbar p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.top-right { display: flex; align-items: center; gap: 14px; }
.vps-ip-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 7px 10px;
  box-shadow: var(--shadow); max-width: 100%;
}
.vps-ip-label {
  font-size: 10px; font-weight: 800; letter-spacing: .06em;
  color: #64748b; text-transform: uppercase;
}
.vps-ip-chip strong {
  font-size: 13px; font-weight: 800; color: #1d4ed8;
  font-variant-numeric: tabular-nums;
}
.vps-ip-copy {
  width: 28px; height: 28px; border: 0; border-radius: 8px;
  background: #eff6ff; color: #2563eb; cursor: pointer;
  display: inline-grid; place-items: center; padding: 0;
}
.vps-ip-copy .wl-ico { width: 14px; height: 14px; }
.vps-ip-copy.copied { background: #dcfce7; color: #16a34a; }

.dns-ip-banner {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: linear-gradient(135deg, #eff6ff, #fff);
  border: 1px solid #bfdbfe; border-radius: 16px;
  padding: 14px 16px; margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.dns-ip-ico {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  background: #dbeafe; color: #2563eb; flex-shrink: 0;
}
.dns-ip-ico .wl-ico { width: 22px; height: 22px; }
.dns-ip-text { flex: 1; min-width: 200px; }
.dns-ip-text strong { display: block; font-size: 14px; margin-bottom: 2px; }
.dns-ip-text p { margin: 0; color: var(--muted); font-size: 13px; }
.dns-ip-value {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid #bfdbfe;
  border-radius: 12px; padding: 8px 10px;
}
.dns-ip-value code {
  font-size: 1.05rem; font-weight: 800; color: #1d4ed8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.bell {
  width: 40px; height: 40px; border-radius: 12px;
  background: #fff; border: 1px solid var(--line);
  display: grid; place-items: center; position: relative;
  box-shadow: var(--shadow);
}
.bell .dot {
  position: absolute; top: 8px; right: 8px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--red); color: #fff; font-size: 10px;
  display: grid; place-items: center; font-weight: 700;
}
.userbox {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--line);
  padding: 8px 12px; border-radius: 14px; box-shadow: var(--shadow);
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: #dbeafe; color: #1d4ed8;
  display: grid; place-items: center; font-weight: 800;
}
.userbox strong { display: block; font-size: 13px; }
.userbox small { color: var(--muted); font-size: 11px; }

.flash {
  margin-bottom: 14px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: #fff;
}
.flash-ok { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.flash-err { background: #fef2f2; color: #991b1b; border-color: #fecaca; }

.page-title {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 14px; font-size: 1.2rem; font-weight: 800;
}

.filters-bar {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-bottom: 16px;
}
.filters-bar input, .filters-bar select,
.side-filters input, .side-filters select {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  min-width: 160px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.kpi {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.kpi::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
}
.kpi.blue::before { background: var(--blue); }
.kpi.green::before { background: var(--green); }
.kpi.red::before { background: var(--red); }
.kpi.purple::before { background: var(--purple); }
.kpi.orange::before { background: var(--orange); }
.kpi span { display: block; color: var(--muted); font-size: 12px; font-weight: 600; margin-bottom: 8px; }
.kpi strong { display: block; font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; }
.kpi em {
  display: inline-flex; margin-top: 8px; font-style: normal;
  font-size: 12px; font-weight: 700; color: var(--green);
  background: #ecfdf5; padding: 3px 8px; border-radius: 999px;
}

.layout-main {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 14px;
  align-items: start;
}
.charts {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.card h3 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 800;
}
.chart-box { position: relative; height: 260px; }
.chart-box.donut { height: 240px; }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left; padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 13px; white-space: nowrap;
}
th {
  color: var(--muted); font-size: 11px; text-transform: uppercase;
  letter-spacing: .04em; font-weight: 700;
}
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700;
}
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-purple { background: #ede9fe; color: #6d28d9; }
.badge-ok { background: #dcfce7; color: #166534; }
.badge-off { background: #fee2e2; color: #991b1b; }
.badge-draft { background: #fef9c3; color: #854d0e; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 14px; border-radius: 10px; border: 1px solid transparent;
  cursor: pointer; font-weight: 700; font-size: 13px; transition: .15s ease;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--text); }
.btn-danger { background: #dc2626; color: #fff; }
.btn-wa { background: #16a34a; color: #fff; }
.btn-sm { padding: 7px 10px; font-size: 12px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff;
  display: inline-grid; place-items: center; cursor: pointer;
  color: #475569; transition: .15s ease;
}
.icon-btn .wl-ico { width: 16px; height: 16px; }
.icon-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.icon-btn.ico-view { color: #16a34a; background: #ecfdf5; border-color: #bbf7d0; }
.icon-btn.ico-edit { color: #ea580c; background: #fff7ed; border-color: #fed7aa; }
.icon-btn.ico-msg { color: #7c3aed; background: #f5f3ff; border-color: #ddd6fe; }
.icon-btn.ico-wa { color: #fff; background: #25d366; border-color: #1ebe57; }
.icon-btn.ico-wa:hover { filter: brightness(1.05); }
.icon-btn.ico-lock { color: #b45309; background: #fffbeb; border-color: #fde68a; }
.icon-btn.ico-unlock { color: #047857; background: #ecfdf5; border-color: #a7f3d0; }
.icon-btn.ico-del { color: #dc2626; background: #fef2f2; border-color: #fecaca; }
.icon-btn.ico-pdf { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.icon-btn.ico-more { color: #475569; background: #f8fafc; border-color: #e2e8f0; }

.more-wrap { position: relative; display: inline-flex; }
.more-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20;
  min-width: 190px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .12);
  padding: 6px;
  display: grid; gap: 2px;
}
.more-menu[hidden] { display: none !important; }
.more-menu a {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px; border-radius: 8px;
  font-size: 13px; font-weight: 600; color: var(--text);
}
.more-menu a:hover { background: #f1f5f9; }
.more-menu .wl-ico { width: 15px; height: 15px; color: #64748b; }

/* Cards de plataforma (Cadastrar Site) */
.plat-label {
  font-size: 12px; color: var(--muted); font-weight: 700;
  margin-bottom: 10px; letter-spacing: .02em;
}
.plat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.plat-card {
  position: relative;
  display: flex; gap: 12px; align-items: flex-start;
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 16px 14px;
  cursor: pointer;
  background: #fff;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease, transform .15s ease;
  box-shadow: var(--shadow);
}
.plat-card input {
  position: absolute; opacity: 0; pointer-events: none;
}
.plat-check {
  position: absolute; top: 10px; right: 10px;
  width: 22px; height: 22px; border-radius: 999px;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 800;
  background: #e2e8f0; color: #94a3b8;
  opacity: 0; transform: scale(.85);
  transition: .15s ease;
}
.plat-ico {
  width: 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center; flex-shrink: 0;
  background: #f1f5f9; color: #64748b;
}
.plat-ico .wl-ico { width: 22px; height: 22px; }
.plat-body { display: grid; gap: 2px; min-width: 0; padding-right: 18px; }
.plat-body strong { font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.plat-body small { color: var(--muted); font-size: 12px; font-weight: 600; }
.plat-body em {
  display: block; margin-top: 4px;
  font-style: normal; font-size: 11px; color: #94a3b8; line-height: 1.35;
}
.plat-card:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(15, 23, 42, .08); }
.plat-mega.is-selected {
  border-color: #2563eb;
  background: linear-gradient(160deg, #eff6ff, #fff);
  box-shadow: 0 10px 28px rgba(37, 99, 235, .12);
}
.plat-mega.is-selected .plat-ico { background: #dbeafe; color: #2563eb; }
.plat-mega.is-selected .plat-body strong { color: #1d4ed8; }
.plat-mega.is-selected .plat-check {
  opacity: 1; transform: scale(1);
  background: #2563eb; color: #fff;
}
.plat-imp.is-selected {
  border-color: #7c3aed;
  background: linear-gradient(160deg, #f5f3ff, #fff);
  box-shadow: 0 10px 28px rgba(124, 58, 237, .12);
}
.plat-imp.is-selected .plat-ico { background: #ede9fe; color: #7c3aed; }
.plat-imp.is-selected .plat-body strong { color: #6d28d9; }
.plat-imp.is-selected .plat-check {
  opacity: 1; transform: scale(1);
  background: #7c3aed; color: #fff;
}
@media (max-width: 700px) {
  .plat-grid { grid-template-columns: 1fr; }
}

.wl-modal[hidden] { display: none !important; }
.wl-modal {
  position: fixed; inset: 0; z-index: 120;
  display: grid; place-items: center;
  padding: 16px;
}
.wl-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, .5);
}
.wl-modal-card {
  position: relative; z-index: 1;
  width: min(560px, 100%);
  background: #fff;
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(15, 23, 42, .2);
  max-height: min(90vh, 720px);
  overflow: auto;
}
.wl-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.wl-modal-head h3 { margin: 0; font-size: 1.05rem; font-weight: 800; }
.wl-modal-body { padding: 16px 18px 18px; }
.wl-modal-actions {
  display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 8px; flex-wrap: wrap;
}
.icon-btn.pdf { color: #dc2626; }
.icon-btn.wa { color: #16a34a; }

.side-panel { display: grid; gap: 14px; }
.side-filters label, .form-grid label {
  display: grid; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 700;
  margin-bottom: 10px;
}
.side-filters .btn { width: 100%; margin-top: 4px; }
.summary-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px;
}
.summary-row:last-child { border-bottom: 0; }
.summary-row strong { font-weight: 800; }
.up { color: var(--green); }
.down { color: var(--red); }

.wa-strip {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.wa-card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 12px; box-shadow: var(--shadow);
}
.wa-card strong { display: block; font-size: 13px; margin-bottom: 2px; }
.wa-card small { color: var(--muted); display: block; margin-bottom: 10px; }
.wa-card .btn { width: 100%; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.form-grid .full { grid-column: 1 / -1; }
input, select, textarea {
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.muted { color: var(--muted); }
.card-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; margin-bottom: 12px;
}
.card-head h2, .card-head h3 { margin: 0; font-size: 15px; font-weight: 800; }

.stat-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.stat-mini {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 18px; box-shadow: var(--shadow);
}
.stat-mini span { color: var(--muted); font-size: 12px; font-weight: 700; }
.stat-mini strong { display: block; margin-top: 8px; font-size: 1.8rem; font-weight: 800; color: var(--blue); }

/* Dashboard cards */
.dash-head { margin-bottom: 14px; }
.dash-stats { margin-bottom: 14px; }
.dash-stat {
  display: flex; gap: 14px; align-items: flex-start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 16px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.dash-stat::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
}
.dash-stat-blue::before { background: var(--blue); }
.dash-stat-green::before { background: var(--green); }
.dash-stat-purple::before { background: var(--purple); }
.dash-stat-ico {
  width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center; flex-shrink: 0;
}
.dash-stat-ico .wl-ico { width: 22px; height: 22px; }
.dash-stat-blue .dash-stat-ico { background: #dbeafe; color: #2563eb; }
.dash-stat-green .dash-stat-ico { background: #dcfce7; color: #16a34a; }
.dash-stat-purple .dash-stat-ico { background: #ede9fe; color: #7c3aed; }
.dash-stat span {
  display: block; color: var(--muted);
  font-size: 12px; font-weight: 700; letter-spacing: .01em;
}
.dash-stat strong {
  display: block; margin-top: 6px;
  font-size: 1.75rem; font-weight: 800; letter-spacing: -.03em;
  color: var(--blue); line-height: 1.1;
}
.dash-stat-green strong { color: var(--green); }
.dash-stat-purple strong { color: var(--purple); }
.dash-stat .dash-money { font-size: 1.35rem; }
.dash-stat small {
  display: block; margin-top: 4px;
  color: #94a3b8; font-size: 11px; font-weight: 500;
}
.dash-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}
.dash-shortcuts { display: grid; gap: 10px; }
.dash-shortcuts .btn { justify-content: flex-start; }
.dash-recent { margin-top: 18px; }
.dash-recent h3 { margin: 0 0 10px; }

/* Login */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(800px 400px at 15% 10%, rgba(37,99,235,.18), transparent 55%),
    linear-gradient(160deg, #eff6ff, #f8fafc 50%, #e2e8f0);
}
.login-card {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 30px 28px;
  box-shadow: 0 20px 50px rgba(15,23,42,.1);
}
.login-card .logo {
  margin: 0 0 6px;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--sidebar);
}
.login-card .tag { margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.login-card form { display: grid; gap: 12px; }
.login-card .btn { width: 100%; padding: 12px; }
.login-error {
  padding: 10px 12px; border-radius: 10px;
  background: #fef2f2; color: #991b1b; font-size: 13px; border: 1px solid #fecaca;
}

/* Meus Sites */
.sites-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}
.sites-title { margin: 0 0 6px; font-size: 1.35rem; }
.title-ico {
  width: 38px; height: 38px; border-radius: 12px;
  display: inline-grid; place-items: center;
  background: #dbeafe; color: #2563eb; margin-right: 6px;
}
.title-ico .wl-ico { width: 20px; height: 20px; }
.sites-sub { margin: 0; color: var(--muted); font-size: 14px; max-width: 640px; }
.btn-cta { white-space: nowrap; padding: 12px 16px; border-radius: 12px; }

.sites-kpi { margin-bottom: 14px; }
.kpi-card {
  display: flex; gap: 12px; align-items: flex-start;
  background: #fff; border: 1px solid var(--line);
  border-radius: 16px; padding: 14px 14px 12px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.kpi-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
}
.kpi-blue::before { background: var(--blue); }
.kpi-green::before { background: var(--green); }
.kpi-purple::before { background: var(--purple); }
.kpi-orange::before { background: var(--orange); }
.kpi-red::before { background: var(--red); }
.kpi-ico {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center; flex-shrink: 0;
  background: #f1f5f9;
}
.kpi-ico .wl-ico { width: 22px; height: 22px; }
.kpi-blue .kpi-ico { background: #dbeafe; color: #2563eb; }
.kpi-green .kpi-ico { background: #dcfce7; color: #16a34a; }
.kpi-purple .kpi-ico { background: #ede9fe; color: #7c3aed; }
.kpi-orange .kpi-ico { background: #ffedd5; color: #ea580c; }
.kpi-red .kpi-ico { background: #fee2e2; color: #dc2626; }
.kpi-card span { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
.kpi-card strong {
  display: block; margin-top: 4px;
  font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.15;
}
.kpi-card small { display: block; margin-top: 4px; color: #94a3b8; font-size: 11px; }

.sites-filters {
  display: grid;
  grid-template-columns: 1.6fr 0.9fr 0.8fr 1.1fr auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}
.filter-actions {
  display: grid;
  gap: 8px;
  align-content: end;
}
.filter-actions .btn { width: 100%; white-space: nowrap; }
.filter-actions .btn-cta { padding: 11px 14px; }
.sites-filters label { margin: 0; display: grid; gap: 6px; }
.filt-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.search-wrap { position: relative; }
.search-wrap input { padding-left: 38px; }
.search-ico {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: #94a3b8; pointer-events: none; display: inline-grid;
}
.period-field {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 0 10px;
}
.period-field input { border: 0; box-shadow: none; padding-left: 0; }
.period-field input:focus { box-shadow: none; }

.sites-table-card { padding-bottom: 12px; }
.sites-table th { position: sticky; top: 0; background: #fff; z-index: 1; }
.site-id-cell { display: inline-flex; align-items: center; gap: 8px; }
.site-orb {
  width: 28px; height: 28px; border-radius: 8px;
  display: inline-grid; place-items: center;
  background: #dbeafe; color: #1d4ed8; font-size: 11px; font-weight: 800;
}
.topbar h1 { letter-spacing: -.02em; }
.wave { font-size: .9em; }
.plat-dot {
  width: 16px; height: 16px; border-radius: 50%;
  display: inline-grid; place-items: center;
  background: rgba(255,255,255,.55); font-size: 9px; font-weight: 800;
}
.act-row { display: inline-flex; gap: 6px; align-items: center; }
.act-row form { margin: 0; }
.empty-sites { text-align: center; padding: 36px 16px !important; white-space: normal; color: var(--muted); }

.sites-pager {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; padding-top: 12px; flex-wrap: wrap;
}
.pager-btns { display: inline-flex; gap: 6px; }
.pager-btn {
  min-width: 34px; height: 34px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff;
  display: inline-grid; place-items: center;
  font-weight: 700; font-size: 13px; color: var(--text);
}
.pager-btn.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.pager-btn.disabled { opacity: .4; pointer-events: none; }

.sites-banner {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 12px;
}
.sites-banner-main {
  display: flex; gap: 14px; align-items: flex-start;
  background: linear-gradient(135deg, #eff6ff, #fff);
  border: 1px solid #bfdbfe;
  border-radius: 16px; padding: 18px;
  box-shadow: var(--shadow);
}
.banner-ico {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center; background: #dbeafe; color: #2563eb; flex-shrink: 0;
}
.banner-ico .wl-ico { width: 22px; height: 22px; }
.feat-ico {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center; margin-bottom: 4px;
}
.feat-ico .wl-ico { width: 18px; height: 18px; }
.feat-blue { background: #dbeafe; color: #2563eb; }
.feat-green { background: #dcfce7; color: #16a34a; }
.feat-purple { background: #ede9fe; color: #7c3aed; }
.sites-banner-main strong { display: block; font-size: 15px; margin-bottom: 4px; }
.sites-banner-main p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.sites-banner-feats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px;
}
.sites-banner-feats > div {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 12px; box-shadow: var(--shadow);
  display: grid; gap: 4px; justify-items: start;
}
.sites-banner-feats span { font-size: 18px; }
.sites-banner-feats strong { font-size: 13px; }
.sites-banner-feats small { color: var(--muted); font-size: 11px; }

@media (max-width: 1280px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .layout-main { grid-template-columns: 1fr; }
  .wa-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sites-filters { grid-template-columns: 1fr 1fr; }
  .filter-actions { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
  .sites-banner { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
  body.nav-locked { overflow: hidden; }

  .shell { grid-template-columns: 1fr; }

  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }
  .shell.nav-open .sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar {
    position: fixed;
    top: 0; left: 0;
    width: min(300px, 86vw);
    height: 100vh;
    height: 100dvh;
    z-index: 100;
    transform: translateX(-105%);
    transition: transform .22s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 16px 0 40px rgba(0,0,0,.25);
  }
  .shell.nav-open .sidebar { transform: translateX(0); }

  .menu-toggle,
  .sidebar-close { display: inline-grid; }

  .main {
    padding: 14px 14px 28px;
    width: 100%;
  }

  .topbar {
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
    align-items: center;
  }
  .topbar h1 { font-size: 1.2rem; }
  .topbar p {
    font-size: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .top-right { margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
  .userbox { padding: 6px 10px; }
  .userbox-meta small { display: none; }
  .vps-ip-chip { order: 3; width: 100%; justify-content: space-between; }

  .charts,
  .kpi-grid,
  .stat-mini-grid,
  .form-grid { grid-template-columns: 1fr; }

  .dash-stats { grid-template-columns: 1fr; }
  .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-grid.sites-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-card strong { font-size: 1.15rem; word-break: break-word; }

  .sites-head { flex-direction: column; }
  .sites-filters { grid-template-columns: 1fr; }
  .filter-actions { grid-template-columns: 1fr; }

  .table-wrap {
    margin: 0 -4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .sites-table { min-width: 980px; }
  table { min-width: 640px; }

  .sites-banner { grid-template-columns: 1fr; }
  .sites-banner-feats { grid-template-columns: 1fr; }

  .card { padding: 14px; }
  .chart-box { height: 220px; }

  .login-card { padding: 24px 18px; }
}

@media (max-width: 560px) {
  .dash-kpis,
  .kpi-grid.sites-kpi { grid-template-columns: 1fr; }
  .topbar-text p { display: none; }
  .userbox-meta { display: none; }
  .bell { width: 38px; height: 38px; }
  .sites-title { font-size: 1.15rem; }
  .wa-strip { grid-template-columns: 1fr; }
  .sites-pager {
    flex-direction: column;
    align-items: stretch;
  }
  .pager-btns { justify-content: center; flex-wrap: wrap; }
}
