:root {
  --bg: #050708;
  --bg-2: #080c0d;
  --panel: #0c1112;
  --panel-2: #101718;
  --panel-3: #141d1e;
  --line: #1f2a2c;
  --line-soft: #172022;
  --text: #e9f2ec;
  --muted: #8b9c94;
  --muted-2: #63736c;
  --accent: #b6ff3b;
  --accent-soft: rgba(182, 255, 59, .12);
  --orange: #ff8a3d;
  --cyan: #4ee1c1;
  --danger: #ff5c6c;
  --warn: #ffc857;
  --sidebar: 248px;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 20px 50px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Inter, system-ui, -apple-system, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(182, 255, 59, .028) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(182, 255, 59, .028) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at 60% 0%, #000 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; }
h1, h2, h3, h4, p { margin: 0; }
img { max-width: 100%; }

.app-loading {
  min-height: 100vh;
  display: grid;
  place-items: center;
  gap: 12px;
  color: var(--muted);
}
.boot-mark {
  width: 54px; height: 54px;
  border-radius: 16px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--accent), #67bd19);
  color: #071006; font-weight: 900; font-size: 23px;
  box-shadow: 0 0 40px rgba(182, 255, 59, .25);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse { 50% { transform: scale(.94); opacity: .8; } }

.shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ── sidebar ────────────────────────────────────────────────────── */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: linear-gradient(180deg, rgba(11, 16, 17, .98), rgba(6, 9, 10, .99));
  border-right: 1px solid var(--line);
  padding: 22px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  z-index: 40;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px;
  text-decoration: none;
}
.brand-mark {
  width: 38px; height: 38px;
  border-radius: 11px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--accent), #6dc21c);
  color: #081006;
  font-weight: 900;
  font-size: 18px;
  letter-spacing: -.05em;
  box-shadow: 0 0 24px rgba(182, 255, 59, .24);
  flex: none;
}
.brand-text { display: grid; line-height: 1.05; }
.brand-text strong { font-size: 15.5px; letter-spacing: -.035em; }
.brand-text span {
  color: var(--accent);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .18em;
  margin-top: 4px;
}

.nav { display: grid; gap: 4px; overflow-y: auto; padding-right: 2px; }
.nav-label {
  color: var(--muted-2);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 12px 10px 6px;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: 10px;
  color: #a8b7b0;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background .14s, color .14s, border-color .14s;
}
.nav a:hover { background: rgba(255,255,255,.035); color: var(--text); }
.nav a.active {
  background: var(--accent-soft);
  border-color: rgba(182, 255, 59, .22);
  color: var(--accent);
  font-weight: 650;
}
.nav a .ico { flex: none; opacity: .9; }
.nav a .nav-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 800;
  background: rgba(255, 92, 108, .16);
  color: #ff9aa5;
  padding: 2px 7px;
  border-radius: 20px;
}
.sidebar-foot {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: grid;
  gap: 10px;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 6px;
  min-width: 0;
}
.sidebar-user .who { min-width: 0; }
.sidebar-user .who strong {
  display: block;
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user .who span {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.sidebar-actions { display: flex; gap: 6px; }
.version { color: var(--muted-2); font-size: 10.5px; padding: 0 8px; }

/* ── topbar ─────────────────────────────────────────────────────── */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 66px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 26px;
  background: rgba(5, 8, 9, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.page-title { display: grid; gap: 1px; min-width: 0; }
.page-title strong { font-size: 16px; letter-spacing: -.02em; }
.page-title span { color: var(--muted); font-size: 11.5px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 11px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  background: rgba(255,255,255,.02);
  white-space: nowrap;
}
.live-pill .live-dot { width: 7px; height: 7px; }
.live-pill.on { color: #d8ffac; border-color: rgba(182, 255, 59, .25); background: rgba(182, 255, 59, .07); }
.live-pill.off { color: #ffb8c0; border-color: rgba(255, 92, 108, .28); background: rgba(255, 92, 108, .06); }
.live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(182, 255, 59, .12), 0 0 10px rgba(182,255,59,.75);
  flex: none;
}
.live-dot.off { background: var(--danger); box-shadow: 0 0 0 3px rgba(255,92,108,.12); }
.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.025);
  color: var(--text);
  border-radius: 999px;
  padding: 4px 11px 4px 4px;
  cursor: pointer;
}
.user-chip:hover { border-color: rgba(182,255,59,.3); }
.user-chip .nm { font-size: 12px; font-weight: 600; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .role { color: var(--muted); font-size: 9.5px; text-transform: uppercase; letter-spacing: .1em; }

.view { padding: 26px; display: grid; gap: 18px; max-width: 1500px; width: 100%; margin: 0 auto; }
.foot {
  margin: auto 26px 0;
  padding: 18px 0 22px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted-2);
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

/* ── primitives ─────────────────────────────────────────────────── */
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.spacer { margin-left: auto; }
.row.wrap { flex-wrap: wrap; }
.gap-sm { gap: 6px; }
.muted { color: var(--muted); }
.muted-2 { color: var(--muted-2); }
.accent-text { color: var(--accent); }
.danger-text { color: var(--danger); }
.ok-text { color: var(--accent); }
.orange-text { color: var(--orange); }
.mono { font-family: "Cascadia Mono", Consolas, ui-monospace, monospace; font-size: .92em; }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.right { text-align: right; }
.wrap-any { overflow-wrap: anywhere; }
.divider { height: 1px; background: var(--line-soft); margin: 4px 0; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 25px; letter-spacing: -.04em; font-weight: 750; }
.page-head p { color: var(--muted); font-size: 12.5px; margin-top: 4px; }

.card {
  background: linear-gradient(170deg, rgba(16, 23, 24, .92), rgba(9, 13, 14, .96));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.027);
  min-width: 0;
}
.card.tight { padding: 14px; }
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.card-title { font-size: 13.5px; font-weight: 700; letter-spacing: -.01em; }
.card-sub { color: var(--muted); font-size: 11.5px; margin-top: 3px; line-height: 1.5; }
.card-actions { display: flex; gap: 7px; flex-wrap: wrap; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }

/* ── badges / pills ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .02em;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255,255,255,.025);
  white-space: nowrap;
}
.badge.ok { color: #d5ffa6; border-color: rgba(182,255,59,.28); background: rgba(182,255,59,.08); }
.badge.warn { color: #ffe0a3; border-color: rgba(255,200,87,.28); background: rgba(255,200,87,.08); }
.badge.err { color: #ffbdc4; border-color: rgba(255,92,108,.3); background: rgba(255,92,108,.08); }
.badge.info { color: #b9fff1; border-color: rgba(78,225,193,.24); background: rgba(78,225,193,.07); }
.badge.muted { color: var(--muted); }
.badge.accent { color: var(--accent); border-color: rgba(182,255,59,.24); background: rgba(182,255,59,.07); }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted);
  font-size: 11px; background: rgba(255,255,255,.02);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.dot.off { background: var(--danger); }
.dot.warn { background: var(--warn); }

/* ── buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 13px;
  background: rgba(255,255,255,.03);
  color: #d7e3dd;
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: transform .12s, border-color .14s, background .14s, box-shadow .14s;
}
.btn:hover { border-color: rgba(182,255,59,.28); background: rgba(182,255,59,.05); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(180deg, var(--accent), #88d929);
  border-color: transparent;
  color: #071006;
  box-shadow: 0 8px 26px rgba(182, 255, 59, .14);
}
.btn.primary:hover { background: linear-gradient(180deg, #c2ff5e, #94e337); }
.btn.ghost { background: transparent; }
.btn.danger { color: #ffb7bf; border-color: rgba(255,92,108,.3); background: rgba(255,92,108,.07); }
.btn.danger:hover { background: rgba(255,92,108,.13); }
.btn.small { padding: 6px 10px; font-size: 11.5px; border-radius: 8px; }
.btn.icon { padding: 8px; width: 34px; height: 34px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: progress; transform: none; }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,.02);
  color: var(--text);
  cursor: pointer;
}
.icon-btn:hover { border-color: rgba(182,255,59,.3); }
.only-mobile { display: none !important; }

.ico { width: 17px; height: 17px; }
.ico-sm { width: 14px; height: 14px; }
.ico-lg { width: 22px; height: 22px; }

/* ── forms ──────────────────────────────────────────────────────── */
.field { display: grid; gap: 6px; min-width: 0; }
.field > span, .field > label {
  color: #a9b8b1;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .01em;
}
.input, .select, .textarea {
  width: 100%;
  background: #070b0c;
  border: 1px solid #243234;
  border-radius: 10px;
  color: var(--text);
  padding: 10px 11px;
  font-size: 13px;
  outline: none;
  transition: border-color .14s, box-shadow .14s;
}
.textarea { min-height: 96px; resize: vertical; font-family: inherit; }
.input:focus, .select:focus, .textarea:focus {
  border-color: rgba(182,255,59,.6);
  box-shadow: 0 0 0 3px rgba(182,255,59,.1);
}
.input::placeholder, .textarea::placeholder { color: #52625b; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #8b9c94 50%), linear-gradient(135deg, #8b9c94 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.helper { color: var(--muted-2); font-size: 11px; line-height: 1.45; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.check { display: flex; align-items: center; gap: 8px; color: #aebdb5; font-size: 12.5px; cursor: pointer; }
.check input { accent-color: var(--accent); width: 15px; height: 15px; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track {
  width: 36px; height: 20px; border-radius: 999px;
  background: #223032; border: 1px solid #2c3c3e;
  position: relative; transition: background .15s, border-color .15s;
  flex: none;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #83918a; transition: transform .16s, background .16s;
}
.switch input:checked + .track { background: rgba(182,255,59,.22); border-color: rgba(182,255,59,.5); }
.switch input:checked + .track::after { transform: translateX(16px); background: var(--accent); }
.switch span.sw-label { font-size: 12px; color: #b6c3bd; }

/* ── KPI ────────────────────────────────────────────────────────── */
.kpi {
  background: linear-gradient(160deg, rgba(18, 26, 27, .95), rgba(8, 12, 13, .96));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 16px;
  display: grid;
  gap: 7px;
  min-width: 0;
  position: relative;
  overflow: hidden;
}
.kpi::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(260px 90px at 100% 0%, rgba(182,255,59,.08), transparent 70%);
  pointer-events: none;
}
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-label { color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .13em; font-weight: 700; }
.kpi-value { font-size: 27px; font-weight: 780; letter-spacing: -.05em; line-height: 1.05; }
.kpi-value small { font-size: 13px; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.kpi-foot { color: var(--muted-2); font-size: 11px; display: flex; align-items: center; gap: 6px; }
.kpi-spark { margin-top: 2px; }

/* ── alerts ─────────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(255,255,255,.02);
}
.alert .alert-ico { flex: none; margin-top: 1px; }
.alert.warn { border-color: rgba(255,200,87,.24); background: rgba(255,200,87,.05); }
.alert.err { border-color: rgba(255,92,108,.26); background: rgba(255,92,108,.05); }
.alert.info { border-color: rgba(78,225,193,.2); background: rgba(78,225,193,.04); }
.alert.ok { border-color: rgba(182,255,59,.22); background: rgba(182,255,59,.04); }
.alert-body { flex: 1; min-width: 0; }
.alert-body strong { display: block; font-size: 12.5px; margin-bottom: 2px; }
.alert-body p { color: var(--muted); font-size: 11.5px; line-height: 1.5; }
.alert-action { flex: none; }

/* ── tables ─────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--line-soft); border-radius: 12px; }
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th {
  text-align: left;
  color: var(--muted-2);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 750;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.018);
  white-space: nowrap;
}
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: rgba(182,255,59,.025); }
.table .actions { display: flex; gap: 5px; justify-content: flex-end; flex-wrap: wrap; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .nowrap { white-space: nowrap; }
.thumb {
  width: 46px; height: 46px;
  border-radius: 9px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #0a0f10;
  flex: none;
}
.offer-cell { display: flex; align-items: center; gap: 10px; min-width: 260px; }
.offer-title { font-size: 12.5px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.offer-meta { color: var(--muted-2); font-size: 10.5px; margin-top: 3px; }
.price { font-weight: 750; letter-spacing: -.02em; }
.old-price { color: var(--muted-2); text-decoration: line-through; font-size: 10.5px; }
.discount { color: var(--accent); font-weight: 800; font-size: 11.5px; }
.table-actions { display: flex; justify-content: flex-end; gap: 6px; }

/* ── charts ─────────────────────────────────────────────────────── */
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-grid { stroke: #1a2426; stroke-width: 1; stroke-dasharray: 3 5; }
.chart-axis { fill: #6d7e77; font-size: 10px; font-family: "Segoe UI", sans-serif; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; color: var(--muted); font-size: 11px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: inline-block; flex: none; }
.donut-wrap { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 14px; align-items: center; }
.donut-svg { width: 100%; max-width: 190px; height: auto; }
.donut-total { fill: var(--text); font-size: 24px; font-weight: 800; letter-spacing: -.05em; }
.donut-sub { fill: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .12em; }
.donut-legend { display: grid; gap: 8px; }
.donut-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.donut-row strong { margin-left: auto; color: var(--text); font-variant-numeric: tabular-nums; }
.donut-nome { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bars { display: grid; gap: 11px; }
.bar-row { display: grid; gap: 5px; }
.bar-top { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; color: var(--muted); }
.bar-top strong { color: var(--text); font-weight: 650; }
.bar-track { height: 7px; border-radius: 99px; background: #162022; overflow: hidden; }
.bar-fill { height: 100%; width: 0; border-radius: 99px; background: var(--accent); transition: width .5s ease; }
.spark { width: 130px; height: 38px; display: block; }
.chart-big { min-height: 280px; }

/* ── activity / lists ──────────────────────────────────────────── */
.feed { display: grid; gap: 2px; }
.feed-item { display: flex; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--line-soft); }
.feed-item:last-child { border-bottom: 0; }
.feed-ico {
  width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center; flex: none;
  background: rgba(255,255,255,.035); border: 1px solid var(--line);
  color: var(--muted);
}
.feed-ico.ok { color: var(--accent); background: rgba(182,255,59,.06); border-color: rgba(182,255,59,.18); }
.feed-ico.err { color: var(--danger); background: rgba(255,92,108,.06); border-color: rgba(255,92,108,.18); }
.feed-body { min-width: 0; flex: 1; }
.feed-text { font-size: 12px; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.feed-meta { color: var(--muted-2); font-size: 10.5px; margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; }
.status-line { display: flex; align-items: center; gap: 9px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.status-line:last-child { border-bottom: 0; }
.status-line .nm { font-size: 12px; font-weight: 600; }
.status-line .mt { color: var(--muted-2); font-size: 10.5px; }
.status-line .spacer { margin-left: auto; }

/* ── channel / integration cards ───────────────────────────────── */
.channel-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(18,26,27,.8), rgba(8,12,13,.9));
  padding: 15px;
  display: grid;
  gap: 12px;
}
.channel-top { display: flex; align-items: center; gap: 9px; }
.channel-name { font-weight: 700; font-size: 14px; }
.channel-stats { display: flex; gap: 18px; }
.channel-stat strong { display: block; font-size: 18px; letter-spacing: -.03em; }
.channel-stat span { color: var(--muted-2); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.integration-card { display: grid; gap: 12px; }
.integration-head { display: flex; align-items: center; gap: 10px; }
.integration-logo {
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center; font-weight: 800; font-size: 14px;
  background: rgba(255,255,255,.04); border: 1px solid var(--line); flex: none;
}
.integration-logo.ml { color: #ffe600; }
.integration-logo.amazon { color: #ff9900; }
.integration-logo.shopee { color: #ee4d2d; }
.integration-logo.telegram { color: #6cc8ff; }
.integration-logo.ml { color: #ffe600; }

/* ── tabs ───────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 5px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 9px; }
.tab {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.tab:hover { color: var(--text); background: rgba(255,255,255,.03); }
.tab.active { color: var(--accent); background: rgba(182,255,59,.08); border-color: rgba(182,255,59,.18); }

/* ── logs ───────────────────────────────────────────────────────── */
.logbox {
  margin: 0;
  background: #060a0b;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  color: #a9c4b4;
  font-family: "Cascadia Mono", Consolas, ui-monospace, monospace;
  font-size: 11.5px;
  line-height: 1.55;
  max-height: 560px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.logbox .log-line { display: block; }
.log-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }

/* ── modal / toast ─────────────────────────────────────────────── */
dialog.modal {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  width: min(620px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
}
dialog.modal.wide { width: min(880px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(2, 5, 6, .78); backdrop-filter: blur(5px); }
.modal-card {
  background: linear-gradient(170deg, #121a1b, #080c0d);
  border: 1px solid #273638;
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 48px);
}
.modal-head { padding: 18px 20px 12px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; gap: 12px; }
.modal-head h3 { font-size: 17px; letter-spacing: -.03em; }
.modal-head p { color: var(--muted); font-size: 11.5px; margin-top: 3px; }
.modal-head .x { margin-left: auto; }
.modal-body { padding: 18px 20px; overflow: auto; }
.modal-actions { padding: 13px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; background: rgba(0,0,0,.15); }
.modal-note { color: var(--muted); font-size: 11.5px; line-height: 1.55; }

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100;
  max-width: min(420px, calc(100vw - 32px));
  background: #101718;
  border: 1px solid #2a3a3c;
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  padding: 12px 15px;
  color: #dce9e2;
  font-size: 12.5px;
  box-shadow: 0 18px 50px rgba(0,0,0,.5);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.err { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warn); }

/* ── empty / loading ───────────────────────────────────────────── */
.empty {
  border: 1px dashed #243234;
  border-radius: 12px;
  padding: 24px 16px;
  text-align: center;
  color: var(--muted-2);
  font-size: 12px;
  background: rgba(255,255,255,.012);
}
.loading { display: grid; place-items: center; gap: 10px; padding: 60px 20px; color: var(--muted); font-size: 12.5px; }
.spinner {
  width: 26px; height: 26px;
  border: 2px solid #243234;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: girar .8s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }
.skeleton {
  border-radius: 10px;
  background: linear-gradient(90deg, #0d1314 25%, #141c1d 50%, #0d1314 75%);
  background-size: 200% 100%;
  animation: brilho 1.4s infinite;
  height: 14px;
}
@keyframes brilho { to { background-position: -200% 0; } }

/* ── misc ──────────────────────────────────────────────────────── */
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(182,255,59,.12);
  border: 1px solid rgba(182,255,59,.26);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  flex: none;
  overflow: hidden;
}
.avatar.sm { width: 26px; height: 26px; font-size: 9px; }
.avatar.lg { width: 76px; height: 76px; font-size: 24px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.profile-head h2 { font-size: 22px; letter-spacing: -.04em; }
.profile-head .role { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; margin-top: 2px; }
.role-tag { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); }
.session {
  display: flex; gap: 10px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--line-soft);
}
.session:last-child { border-bottom: 0; }
.session .meta { min-width: 0; flex: 1; }
.session .meta strong { display: block; font-size: 12px; }
.session .meta span { display: block; color: var(--muted-2); font-size: 10.5px; overflow-wrap: anywhere; }
.qr-box { display: grid; place-items: center; gap: 12px; padding: 12px; background: #fff; border-radius: 12px; min-height: 220px; }
.qr-box img { width: 220px; height: 220px; object-fit: contain; }
.qr-code { font-family: "Cascadia Mono", monospace; font-size: 10px; color: #222; word-break: break-all; max-width: 100%; }
.progress { height: 7px; border-radius: 99px; background: #172123; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); }
.path { font-family: "Cascadia Mono", Consolas, monospace; font-size: 11px; color: #a8bdb3; overflow-wrap: anywhere; }
.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px 12px; font-size: 12px; }
.kv dt { color: var(--muted-2); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.note {
  border-left: 2px solid rgba(182,255,59,.5);
  background: rgba(182,255,59,.04);
  padding: 10px 12px;
  color: #b4c5bd;
  font-size: 11.5px;
  line-height: 1.55;
  border-radius: 0 8px 8px 0;
}
.split-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, .9fr); gap: 16px; }
.scroll-y { max-height: 380px; overflow: auto; }
.center { text-align: center; }
.hidden { display: none !important; }

/* ── responsive ────────────────────────────────────────────────── */
@media (max-width: 1240px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  :root { --sidebar: 224px; }
  .view { padding: 20px; }
  .split-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 264px;
    transform: translateX(-102%);
    transition: transform .2s ease;
    box-shadow: 30px 0 80px rgba(0,0,0,.55);
  }
  .sidebar.open { transform: translateX(0); }
  .only-mobile { display: inline-grid !important; }
  .topbar { padding: 0 16px; height: 60px; }
  .view { padding: 16px; }
  .foot { margin: auto 16px 0; flex-direction: column; }
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .donut-wrap { grid-template-columns: 1fr; justify-items: center; }
  .donut-legend { width: 100%; }
  .live-pill .live-label { display: none; }
}
@media (max-width: 560px) {
  .page-head h1 { font-size: 21px; }
  .kpi-value { font-size: 24px; }
  .card { padding: 14px; }
  .user-chip .nm, .user-chip .role { display: none; }
  .auth-metrics { display: none; }
}

/* -- Divulgação: estúdio de mídia e contas sociais ----------------- */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}
.media-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--panel-2);
  display: flex;
  flex-direction: column;
}
.media-preview {
  background: #05070c;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.media-preview video,
.media-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.media-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.media-body textarea { min-height: 78px; resize: vertical; }
.social-accounts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.social-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  font-size: 12px;
}
.icon-btn.tiny {
  width: 22px;
  height: 22px;
  min-width: 22px;
  padding: 0;
}

.stack { display: flex; flex-direction: column; gap: 8px; }
.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }
.mt-16 { margin-top: 16px; }
