:root {
  --bg: #0E0F13; --panel: #16181F; --panel-2: #1D2029; --line: #2A2E3A; --text: #ECEEF3; --muted: #8C93A5;
  --accent: #5B8CFF; --accent-2: #3E6FE6; --ok: #2FBF71; --warn: #F2A93B; --danger: #EF4B5B; --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 22px; } h3 { font-size: 15px; margin-bottom: 12px; } h1 { font-size: 20px; margin-top: 14px; }
a { color: var(--accent); }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
code { background: var(--panel-2); padding: 1px 6px; border-radius: 5px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.muted { color: var(--muted); margin: 4px 0 0; } .small { font-size: 12.5px; } .center { text-align: center; }
.mt { margin-top: 20px; } .r { text-align: right; } .nowrap { white-space: nowrap; } .break { word-break: break-all; }
.grow { flex: 1; min-width: 0; }

/* formulários */
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
label small { font-size: 12px; opacity: .85; }
input, select, textarea { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; outline: none; width: 100%; }
input[type=file] { padding: 8px; font-size: 13px; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
input[type=color] { width: 44px; height: 40px; padding: 2px; flex: none; cursor: pointer; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input[readonly] { color: var(--muted); }
.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); cursor: pointer; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 16px; }
.checks .check { margin-bottom: 6px; }
.color-row { display: flex; gap: 8px; }
.code-input { font-family: var(--mono); font-size: 22px; letter-spacing: 6px; text-align: center; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 16px; }
.grid-form .span2 { grid-column: span 2; }
.row-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.row-form label { margin-bottom: 0; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.form-foot { grid-column: 1 / -1; }
.tag { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; background: rgba(91,140,255,.15); color: var(--accent); padding: 1px 6px; border-radius: 5px; vertical-align: middle; }

/* botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 550; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 9px 14px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #3a4050; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 10px; font-size: 13px; }
.btn.lg { padding: 13px 22px; font-size: 15px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.link { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; padding: 0; }
.link:hover { color: var(--text); }

/* estrutura */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: var(--panel); border-right: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 16px; }
.brand-text { min-width: 0; } .brand-text b, .brand-text small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-text small { color: var(--muted); font-size: 11.5px; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, var(--accent), #8B5BFF); display: grid; place-items: center; color: #fff; font-weight: 800; flex: none; }
.brand-mark.lg { width: 46px; height: 46px; font-size: 20px; border-radius: 12px; }
.ctx { margin: 0 4px 14px; } .ctx-label { margin: 0 0 4px; font-size: 11.5px; } .ctx select { padding: 7px 10px; font-size: 13px; }
nav { display: flex; flex-direction: column; gap: 1px; flex: 1; }
nav a, .me a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 550; }
nav a:hover, .me a:hover { background: var(--panel-2); color: var(--text); }
nav a.active, .me a.active { background: var(--panel-2); color: var(--text); }
nav a.active .ico { color: var(--accent); }
.ico { width: 18px; text-align: center; flex: none; }
.nav-sep { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 16px 10px 6px; }
.me { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; display: flex; align-items: center; justify-content: space-between; }
.me form { padding-right: 10px; }
.content { padding: 28px 32px 80px; max-width: 1150px; width: 100%; }
.head { margin-bottom: 20px; }
.menu-btn { display: none; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.card.narrow { max-width: 520px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h3 { margin: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.grid2 > .card { margin-bottom: 0; }
.grid2 + * { margin-top: 16px; }
.danger-zone { border-color: rgba(239,75,91,.35); }

.banner { padding: 10px 14px; border-radius: 9px; margin-bottom: 14px; font-size: 13.5px; border: 1px solid; }
.banner.ok { background: rgba(47,191,113,.1); color: #7fe0aa; border-color: rgba(47,191,113,.3); }
.banner.err { background: rgba(239,75,91,.1); color: #ff9aa5; border-color: rgba(239,75,91,.3); }
.banner.warn { background: rgba(242,169,59,.1); color: #f6c67c; border-color: rgba(242,169,59,.3); }
.banner.info { background: rgba(91,140,255,.1); color: #a9c1ff; border-color: rgba(91,140,255,.3); }
.banner a { color: inherit; font-weight: 600; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat span { display: block; color: var(--muted); font-size: 12.5px; }
.stat b { font-size: 26px; } .stat b.sm { font-size: 15px; }

.pill { display: inline-block; font-size: 11.5px; padding: 1px 8px; border-radius: 20px; background: var(--panel-2); color: var(--muted); font-weight: 600; vertical-align: middle; }
.pill.ok { color: var(--ok); background: rgba(47,191,113,.12); }
.pill.bad { color: var(--danger); background: rgba(239,75,91,.12); }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; border: 1px solid var(--line); }

/* listas */
.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; gap: 12px; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.item.off, tr.off { opacity: .55; }
.item .acts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.item .order { display: flex; flex-direction: column; }
.item .order button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 11px; padding: 0 4px; line-height: 1.3; }
.item .order button:hover { color: var(--text); } .item .order button:disabled { opacity: .2; cursor: default; }
.urls { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.test-out:empty { display: none; }
.test-out { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.test-out .ok { color: var(--ok); } .test-out .bad { color: var(--danger); }
.empty { color: var(--muted); text-align: center; padding: 22px; border: 1px dashed var(--line); border-radius: 10px; }
ol.plain, ul.plain { margin: 0; padding-left: 20px; } ul.plain { list-style: none; padding: 0; }
ol.plain li { margin-bottom: 4px; }

.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.ellipsis { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 16px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.seg a { color: var(--muted); text-decoration: none; padding: 5px 12px; border-radius: 6px; font-size: 13px; }
.seg a.on { background: var(--panel-2); color: var(--text); }
.copy-row { display: flex; gap: 8px; margin-bottom: 12px; } .copy-row input { flex: 1; font-family: var(--mono); font-size: 12.5px; }
.json { white-space: pre-wrap; word-break: break-all; font-family: var(--mono); font-size: 12.5px; color: #cfd6e6; max-height: 70vh; overflow: auto; }
details summary { cursor: pointer; color: var(--muted); font-weight: 600; }

.app-id { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.app-icon { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; flex: none; }
.app-icon.empty { display: grid; place-items: center; background: var(--panel-2); color: var(--muted); font-size: 24px; }
.asset { display: flex; gap: 16px; align-items: center; margin-bottom: 8px; }
.thumb { width: 96px; height: 96px; border-radius: 12px; object-fit: contain; flex: none; background: repeating-conic-gradient(#20232c 0% 25%, #191b22 0% 50%) 50% / 14px 14px; border: 1px solid var(--line); }
.thumb.wide { width: 170px; height: 80px; }
.thumb.empty { display: grid; place-items: center; color: var(--muted); font-size: 12px; text-align: center; }
.qr { display: flex; justify-content: center; margin: 8px 0; }
.qr img, .qr svg { background: #fff; padding: 10px; border-radius: 10px; width: 190px; height: 190px; }

.bars { display: flex; align-items: flex-end; gap: 3px; height: 160px; padding-top: 18px; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; }
.bar span { display: block; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; }
.bar i { position: absolute; top: -16px; left: 0; right: 0; text-align: center; font-style: normal; font-size: 10px; color: var(--muted); }
.bars-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 11.5px; margin-top: 6px; }

/* login */
.login-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; }
.login-wrap .banner { width: 100%; max-width: 380px; }
.login-card { width: 100%; max-width: 380px; padding: 30px 26px; }
.login-card > p.muted { margin-bottom: 20px; }

@media (max-width: 1000px) { .grid2 { grid-template-columns: 1fr; } .stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 270px; z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.6); }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-flex; background: var(--panel); border: 1px solid var(--line); color: var(--text); border-radius: 9px; padding: 6px 12px; font-size: 18px; margin-bottom: 14px; cursor: pointer; }
  .content { padding: 16px 14px 60px; }
  .grid-form .span2 { grid-column: auto; }
  .item { flex-wrap: wrap; } .item .acts { width: 100%; justify-content: flex-start; }
  .table { display: block; overflow-x: auto; white-space: nowrap; }
}
