/* REI TV — painel. Vidro escuro, laranja de destaque; TVs "acendem" quando abriram o app. */
@font-face { font-family: Barlow Condensed; font-weight: 500; font-display: swap; src: url(/static/fonts/barlow-condensed-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: Barlow Condensed; font-weight: 600; font-display: swap; src: url(/static/fonts/barlow-condensed-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: Barlow Condensed; font-weight: 700; font-display: swap; src: url(/static/fonts/barlow-condensed-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: Manrope; font-weight: 400; font-display: swap; src: url(/static/fonts/manrope-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: Manrope; font-weight: 500; font-display: swap; src: url(/static/fonts/manrope-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: Manrope; font-weight: 600; font-display: swap; src: url(/static/fonts/manrope-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: Manrope; font-weight: 700; font-display: swap; src: url(/static/fonts/manrope-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: Manrope; font-weight: 800; font-display: swap; src: url(/static/fonts/manrope-latin-800-normal.woff2) format('woff2'); }

:root {
  --night: #0A090C;                     /* fundo */
  --velvet: rgba(255, 255, 255, .06);   /* vidro (cartões) */
  --amethyst: rgba(255, 255, 255, .11); /* vidro em destaque / hover */
  --inset: rgba(10, 9, 12, .55);        /* campos e itens dentro dos cartões */
  --wire: rgba(255, 255, 255, .13);     /* linhas */
  --gold: #FF7A1A;                      /* cor de destaque (laranja) */
  --gold-soft: #FFB27A;                 /* destaque em texto sobre fundo escuro */
  --on-gold: #1B0F06;                   /* texto sobre o laranja */
  --text: #FFFFFF;
  --mist: rgba(255, 255, 255, .68);     /* texto secundário */
  --ok: #8AEDB0;
  --late: #FFD98A;
  --off: #FFA3B3;
  --glass: linear-gradient(160deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .04));
  --shadow: 0 20px 50px rgba(0, 0, 0, .35);
  --display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --body: Manrope, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: radial-gradient(640px 520px at 14% -6%, rgba(255, 122, 26, .30), transparent 70%),
    radial-gradient(760px 640px at 100% 100%, rgba(75, 63, 216, .24), transparent 70%),
    radial-gradient(520px 520px at -8% 62%, rgba(179, 38, 30, .16), transparent 70%), var(--night);
  background-attachment: fixed; color: var(--text); font: 15px/1.55 var(--body); -webkit-font-smoothing: antialiased; }
body.app { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 20px; padding: 20px; min-height: 100vh; }
a { color: var(--gold-soft); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2 { font-family: var(--display); font-weight: 600; letter-spacing: .005em; }
h1 { font-size: 52px; line-height: 1; margin: 0; }
h2 { font-size: 26px; line-height: 1.15; margin: 0 0 16px; }
code { font-size: 13px; background: var(--inset); border: 1px solid var(--wire); padding: 1px 7px; border-radius: 8px; word-break: break-all; color: #FFD2B0; }
.sub { color: var(--mist); }
.small { font-size: 13px; }
:focus-visible { outline: 2px solid var(--gold-soft); outline-offset: 2px; }
.ic { width: 22px; height: 22px; flex: none; }

/* vidro: todo cartão do painel */
.panel, .side, .row, .login-form, .pairform, .stat, .dnslist li, .pl, .appcard, .bulkbar {
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}

/* ------------------------------------------------ barra lateral */
.side { position: sticky; top: 20px; height: calc(100vh - 40px); display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 8px;
  background: var(--glass); border: 1px solid var(--wire); border-radius: 28px; box-shadow: var(--shadow); overflow-y: auto; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--text); margin-bottom: 14px; }
.brand:hover { text-decoration: none; }
.brand img { filter: drop-shadow(0 0 12px rgba(255, 122, 26, .55)); }
.brand b { display: block; font-family: var(--display); font-size: 19px; font-weight: 600; letter-spacing: .06em; line-height: 1; text-align: center; }
.brand small { display: none; }
.nav { display: grid; gap: 6px; width: 100%; }
.nav a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 2px; border-radius: 20px; color: rgba(255, 255, 255, .74);
  font-size: 11.5px; font-weight: 700; letter-spacing: .01em; text-align: center; line-height: 1.2; }
.nav a .ic { width: 24px; height: 24px; }
.nav a:hover { background: var(--amethyst); color: var(--text); text-decoration: none; }
.nav a.on { background: var(--gold); color: var(--on-gold); }
.logout { margin-top: auto; width: 100%; }
button.link { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; padding: 12px 2px; border-radius: 20px;
  background: none; border: 0; color: var(--mist); font: 700 11.5px var(--body); cursor: pointer; }
button.link:hover { background: var(--amethyst); color: var(--text); }

.main { padding: 6px 4px 72px; max-width: 1360px; width: 100%; min-width: 0; }

/* ------------------------------------------------ cabeçalho de página */
.phead { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 26px; }
.phead::before { content: "PAINEL REI TV"; flex: 1 0 100%; margin-bottom: -18px; font-size: 12px; font-weight: 800; letter-spacing: .16em; color: var(--gold); }
.phead .sub { margin: 8px 0 0; max-width: 62ch; font-size: 15px; }
.quick, .search { display: flex; align-items: center; gap: 10px; background: rgba(255, 255, 255, .08); border: 1px solid var(--wire);
  border-radius: 999px; padding: 0 8px 0 18px; color: var(--mist); backdrop-filter: blur(18px); }
.quick:focus-within, .search:focus-within { border-color: var(--gold-soft); }
.quick input, .search input { border: 0; background: transparent; margin: 0; padding: 13px 0; outline: none; min-width: 230px; }
.quick input { font-family: var(--display); font-weight: 600; font-size: 17px; letter-spacing: .12em; text-transform: uppercase; }
.quick input::placeholder { letter-spacing: normal; text-transform: none; font-family: var(--body); font-weight: 400; font-size: 14px; }
.search { max-width: 560px; margin-bottom: 22px; }
.search input { flex: 1; }

/* ------------------------------------------------ início */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat { display: flex; flex-direction: column; gap: 14px; padding: 20px; border-radius: 24px; background: var(--glass); border: 1px solid var(--wire); box-shadow: var(--shadow); }
.stat .ico { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: rgba(255, 122, 26, .18); color: var(--gold-soft); }
.stat:nth-child(2) .ico { background: rgba(53, 208, 186, .16); color: #6FE3D0; }
.stat:nth-child(3) .ico { background: rgba(124, 140, 255, .18); color: #AEB8FF; }
.stat:nth-child(4) .ico { background: rgba(255, 255, 255, .10); color: #fff; }
.stat b { display: block; font: 600 50px/1 var(--display); }
.stat span.lbl { display: block; margin-top: 4px; font-size: 13.5px; color: var(--mist); }

.dash { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.dash-main, .dash-side { display: grid; gap: 22px; min-width: 0; }
.dash .panel { margin: 0; }
.dash-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; }

.tvwall { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.tv { display: flex; flex-direction: column; gap: 12px; padding: 12px; border-radius: 20px; color: var(--text); background: var(--inset);
  border: 1px solid var(--wire); transition: transform .18s ease, border-color .18s ease; }
.tv:hover, .tv:focus-visible { text-decoration: none; transform: translateY(-3px); border-color: rgba(255, 255, 255, .28); }
.tv .screen { position: relative; width: 100%; aspect-ratio: 16 / 9; display: grid; place-items: center; align-content: center; gap: 6px;
  border-radius: 14px; background: linear-gradient(160deg, #1A1820, #0E0D12); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.tv .tvcode { font-family: var(--display); font-weight: 600; font-size: 32px; letter-spacing: .1em; color: rgba(255, 255, 255, .62); }
.tv .screen .pill { position: absolute; top: 8px; right: 8px; }
.tv .stand { display: none; }
.tv .tvname { padding: 0 4px; font-size: 15px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv .tvmeta { padding: 0 4px 4px; margin-top: -8px; color: var(--mist); font-size: 12.5px; }
.tv.lit .screen { background: linear-gradient(160deg, #2A1B10, #120D0A); box-shadow: inset 0 0 0 1px var(--gold), 0 0 28px rgba(255, 122, 26, .28); }
.tv.lit .tvcode { color: #fff; text-shadow: 0 0 18px rgba(255, 122, 26, .6); }
.tv.off .screen { background: repeating-linear-gradient(135deg, #1A1016 0 10px, #150C12 10px 20px); }
.tv.off .tvcode { color: rgba(255, 163, 179, .55); }
.tv.expired .tvcode { color: rgba(255, 217, 138, .5); }
.more { margin: 18px 0 0; }

.figures { display: flex; flex-wrap: wrap; gap: 14px 30px; margin: 0 0 14px; }
.figures div { flex: 0 1 auto; }
.figures b { display: block; font: 600 40px/1 var(--display); }
.figures span { color: var(--mist); font-size: 13px; }
.figures small { font-size: .55em; color: rgba(255, 255, 255, .55); font-weight: 600; }

/* ------------------------------------------------ blocos */
.panel { background: var(--glass); border: 1px solid var(--wire); border-radius: 28px; padding: 24px; margin-bottom: 22px; box-shadow: var(--shadow); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: stretch; }
.split > .panel { height: 100%; margin-bottom: 0; }
.split.wide-left { grid-template-columns: 1.5fr 1fr; }
.split + .panel { margin-top: 22px; }
.how .steps { margin: 0 0 14px; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 12px; }
.how .steps li { counter-increment: s; display: flex; gap: 12px; align-items: flex-start; }
.how .steps li::before { content: counter(s); flex: 0 0 28px; height: 28px; border-radius: 50%; background: var(--gold); color: var(--on-gold);
  font: 800 13px/28px var(--body); text-align: center; }
.empty { border: 1px dashed var(--wire); border-radius: 24px; padding: 36px; text-align: center; }
.empty p { margin: 4px 0; }
.empty.small { padding: 22px; }

/* ------------------------------------------------ lista de aparelhos */
.rows { display: grid; gap: 10px; }
.row { display: grid; grid-template-columns: 34px 120px 1fr 90px 100px 110px; align-items: center; gap: 16px;
  padding: 14px 16px; border-radius: 18px; background: var(--inset); border: 1px solid var(--wire); color: var(--text); }
.row:hover { text-decoration: none; border-color: rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .08); }
.mini { width: 30px; height: 20px; border-radius: 5px; border: 3px solid #0A0A0D; background: #1A1820; box-shadow: 0 0 0 1px var(--wire); }
.mini.lit { background: radial-gradient(#FFB27A, #B8500C); box-shadow: 0 0 0 1px var(--gold), 0 0 14px rgba(255, 122, 26, .55); }
.mini.off { background: #4A1F2A; }
.rcode { font: 600 21px var(--display); letter-spacing: .1em; }
.rname { display: grid; min-width: 0; }
.rname small { color: var(--mist); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rlists, .rseen { color: var(--mist); font-size: 14px; }
.rseen { text-align: right; }

/* ------------------------------------------------ aparelho */
.backlink { display: inline-flex; align-items: center; gap: 4px; color: var(--mist); margin-bottom: 18px; min-height: 44px; }
.backlink .ic { width: 18px; }
.devhead { display: flex; gap: 28px; align-items: center; margin-bottom: 26px; flex-wrap: wrap; }
.tv.big { width: 250px; }
.tv.big .tvcode { font-size: 38px; }
.devinfo { flex: 1; min-width: 260px; }
.devline { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin: 10px 0 6px; color: var(--mist); }

.pl { border: 1px solid var(--wire); border-radius: 18px; margin-bottom: 10px; background: var(--inset); }
.pl[open] { border-color: rgba(255, 122, 26, .55); }
.pl summary { padding: 14px 16px; cursor: pointer; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; list-style: none; min-height: 48px; }
.pl summary::-webkit-details-marker { display: none; }
.plsrc { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl form { padding: 4px 16px 16px; }

/* ------------------------------------------------ DNS */
.dnslist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.dnslist li { display: grid; grid-template-columns: 34px 1fr auto auto; gap: 14px; align-items: center;
  padding: 14px 16px; border-radius: 18px; background: var(--inset); border: 1px solid var(--wire); }
.dnslist li.disabled { opacity: .6; }
.order { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%;
  font: 700 17px var(--display); color: var(--on-gold); background: var(--gold); }
.disabled .order { background: var(--wire); color: var(--mist); }
.dnsname { display: grid; gap: 4px; min-width: 0; }
.dnsname code { justify-self: start; }
.dnsact { display: flex; gap: 6px; align-items: center; }

/* ------------------------------------------------ APK */
.downloader { display: grid; gap: 4px; padding: 18px; border-radius: 18px; margin-bottom: 18px;
  background: radial-gradient(140% 160% at 0% 0%, rgba(255, 122, 26, .28), var(--inset) 70%); border: 1px solid rgba(255, 122, 26, .5); }
.dl-url { font: 600 26px var(--display); color: var(--gold-soft); word-break: break-all; }
.drop { display: grid; gap: 12px; margin-bottom: 12px; }
.dropzone { display: flex; align-items: center; gap: 12px; padding: 18px; border: 1px dashed rgba(255, 255, 255, .28); border-radius: 18px;
  color: var(--text); font-size: 14px; cursor: pointer; }
.dropzone:hover, .dropzone:focus-within { border-color: var(--gold-soft); }
.dropzone .ic { color: var(--gold-soft); }
.dropzone input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.progress { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .10); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--gold); transition: width .2s; }

/* ------------------------------------------------ formulários */
label { display: block; font-size: 13.5px; color: var(--mist); font-weight: 700; }
input, select, textarea { width: 100%; margin-top: 8px; padding: 12px 14px; min-height: 46px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .07); color: var(--text); font: 15px var(--body); }
select option { background: #17151C; color: #fff; }
input::placeholder, textarea::placeholder { color: rgba(255, 255, 255, .4); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold-soft); box-shadow: 0 0 0 3px rgba(255, 122, 26, .25); }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; margin: 0; }
.stack { display: grid; gap: 16px; }
.stack.narrow { max-width: 560px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
[hidden] { display: none !important; }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 16px; background: var(--inset); border: 1px solid var(--wire); }
.seg label { margin: 0; cursor: pointer; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; text-align: center; padding: 11px; border-radius: 12px; color: var(--mist); font-size: 14px; font-weight: 700; }
.seg input:checked + span { background: var(--gold); color: var(--on-gold); }
.seg input:focus-visible + span { outline: 2px solid var(--gold-soft); }

.switch { display: flex; align-items: center; gap: 14px; color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer; position: relative; min-height: 44px; }
.switch input { position: absolute; opacity: 0; }
.track { width: 48px; height: 28px; border-radius: 99px; background: rgba(255, 255, 255, .22); position: relative; flex: none; transition: background .15s; }
.track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + .track { background: var(--gold); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 2px solid var(--gold-soft); outline-offset: 2px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px; min-height: 46px; border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .24); background: transparent; color: var(--text); font: 700 14.5px var(--body); cursor: pointer; }
.btn:hover { border-color: rgba(255, 255, 255, .5); text-decoration: none; background: rgba(255, 255, 255, .06); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--on-gold); font-weight: 800; }
.btn.gold:hover { filter: brightness(1.1); background: var(--gold); }
.btn.ghost { background: transparent; }
.btn.danger { background: transparent; color: var(--off); border-color: rgba(255, 107, 129, .45); }
.btn.danger:hover { border-color: var(--off); background: rgba(255, 107, 129, .08); }
.btn.sm { padding: 6px 14px; min-height: 36px; font-size: 13px; border-radius: 12px; }
.btn:disabled { opacity: .35; cursor: default; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .2);
  background: transparent; color: var(--text); cursor: pointer; }
.icon-btn:hover { background: rgba(255, 255, 255, .08); }
.icon-btn .ic { width: 16px; height: 16px; }
.icon-btn:disabled { opacity: .3; cursor: default; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; }

.pill { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 800; white-space: nowrap; }
.pill.ok { background: rgba(74, 222, 128, .16); color: var(--ok); }
.pill.expired { background: rgba(255, 107, 129, .18); color: var(--off); }
.pill.off { background: rgba(255, 255, 255, .10); color: rgba(255, 255, 255, .78); }
.pill.late { background: rgba(255, 200, 87, .18); color: var(--late); }
.pill.idle { background: rgba(255, 255, 255, .10); color: rgba(255, 255, 255, .78); }
.pill.m3u { background: rgba(124, 140, 255, .18); color: #B7C0FF; }
.pill.xtream { background: rgba(255, 122, 26, .18); color: var(--gold-soft); }

.err { color: var(--off); background: rgba(255, 107, 129, .10); border: 1px solid rgba(255, 107, 129, .4); padding: 12px 16px; border-radius: 14px; }
.flash { color: var(--ok); background: rgba(74, 222, 128, .10); border: 1px solid rgba(74, 222, 128, .35); padding: 12px 16px; border-radius: 14px; margin-bottom: 20px; }

/* ------------------------------------------------ entrar */
body.bare { display: grid; place-items: center; min-height: 100vh; }
body.bare .main { padding: 24px 16px; max-width: none; display: grid; place-items: center; }
.login { width: 100%; max-width: 380px; text-align: center; }
.login-crown { display: block; margin: 0 auto 6px; filter: drop-shadow(0 0 18px rgba(255, 122, 26, .55)); }
.login-title { font-size: 56px; }
.login .sub { margin: 4px 0 28px; }
.login-form { display: grid; gap: 16px; text-align: left; background: var(--glass); border: 1px solid var(--wire);
  border-radius: 28px; padding: 26px; box-shadow: var(--shadow); }
.login-form .btn { width: 100%; margin-top: 4px; }

@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  .login-crown { animation: rise .5s ease-out both; }
}
@media (prefers-reduced-motion: reduce) {
  .tv, .track, .track::after { transition: none; }
}

/* ajustes finos */
.quick input, .search input, .quick input:focus, .search input:focus { border: 0; margin: 0; min-height: 0; box-shadow: none; background: transparent; }
.dnsname code { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; word-break: normal; }
.stack > .btn { justify-self: start; }
.devmeta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; }

/* seleção na lista de aparelhos */
.rows.selectable .row { grid-template-columns: 26px 34px 120px 1fr 90px 100px 110px; }
.row a { color: var(--text); }
.row a:hover { text-decoration: none; }
.row .rcode:hover, .row .rname:hover { color: var(--gold-soft); }
.pick { position: relative; width: 24px; height: 24px; cursor: pointer; }
.pick input { position: absolute; opacity: 0; }
.pick span { position: absolute; inset: 0; border-radius: 8px; border: 1.5px solid rgba(255, 255, 255, .35); background: var(--inset); }
.pick input:checked + span { background: var(--gold); border-color: var(--gold); }
.pick input:checked + span::after { content: ""; position: absolute; left: 8px; top: 3px; width: 5px; height: 11px; border: solid var(--on-gold); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.pick input:focus-visible + span { outline: 2px solid var(--gold-soft); outline-offset: 2px; }
.bulkbar { position: sticky; bottom: 16px; margin-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 12px 12px 20px; border-radius: 20px; background: rgba(30, 24, 36, .92); border: 1px solid rgba(255, 122, 26, .55); box-shadow: 0 12px 40px rgba(0, 0, 0, .5); }

/* página pública do QR code */
.pair { width: 100%; max-width: 440px; text-align: center; }
.pair h1 { font-size: 40px; margin: 12px 0 6px; }
.pair > .sub { margin: 0 0 22px; }
.paircrown { filter: drop-shadow(0 0 18px rgba(255, 122, 26, .55)); }
.paircode { font-family: var(--display); letter-spacing: .12em; color: var(--gold-soft); }
.pairform { text-align: left; background: var(--glass); border: 1px solid var(--wire); border-radius: 28px; padding: 24px; box-shadow: var(--shadow); }
.pairform .btn { width: 100%; justify-self: stretch; }
.more-dns summary { cursor: pointer; color: var(--mist); font-size: 13px; margin-bottom: 8px; min-height: 36px; }
.pair .err { text-align: left; }

/* página pública de assinatura */
.assinar #code { text-transform: uppercase; letter-spacing: .18em; font-family: var(--display); text-align: center; font-size: 28px; }
.assinar .pixwrap { background: #fff; border-radius: 20px; padding: 12px; width: 260px; height: 260px; margin: 0 auto 16px; display: grid; place-items: center; }
.assinar .pixqr { width: 236px; height: 236px; image-rendering: pixelated; }
.assinar .pixcola { width: 100%; resize: none; font-size: 12px; color: var(--mist); background: var(--inset); border: 1px solid var(--wire); border-radius: 14px; padding: 10px; word-break: break-all; }
.assinar #copyBtn { width: 100%; margin-top: 10px; }
.assinar .paystatus { margin-top: 14px; color: var(--gold-soft); font-weight: 700; }
.assinar .okh { color: var(--gold-soft); font-size: 34px; margin: 8px 0; }
.assinar .sub.small { font-size: 12px; color: var(--mist); }

.hint { margin: -4px 0 14px; font-size: 13px; line-height: 1.5; color: var(--mist); font-weight: 400; }
.hint + .btn { margin-top: 4px; }
form.inline + .hint, .btn + .hint { margin-top: 14px; }
.webnow .figures { margin: 6px 0 12px; }
.usage { border-collapse: collapse; font-size: 14px; }
.usage td { padding: 6px 18px 6px 0; border-bottom: 1px solid var(--wire); }
.backups { list-style: none; padding: 0; margin: 0 0 14px; font-size: 14px; line-height: 1.9; }
.legal { max-width: 760px; margin: 40px auto; padding: 0 20px; line-height: 1.6; }
.legal h1 { font-size: 40px; }
.legal h2 { font-size: 24px; margin-top: 28px; }

/* Configurações: abas, uma coisa de cada vez */
.tabbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.tab { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .18);
  background: transparent; color: var(--text); font: 700 14.5px var(--body); cursor: pointer; }
.tab:hover { background: rgba(255, 255, 255, .07); }
.tab[aria-selected=true] { background: var(--gold); border-color: var(--gold); color: var(--on-gold); }
.tab .ic { width: 18px; height: 18px; }
.tabpanes { display: grid; gap: 22px; max-width: 920px; }
.tabpanes > .panel, .tabpanes > .panel-group { margin: 0; }
.tabpanes.tabs-on > [data-tab]:not(.on-tab) { display: none; }
.tabpanes > .panel-group { display: grid; gap: 22px; }
.tabpanes.tabs-on > .panel-group:not(.on-tab) { display: none; }
@media (max-width: 980px) { .tabpanes { max-width: none; } }

.flash-token { margin: 10px 0; word-break: break-all; }
.flash-token code { display: block; padding: 12px 14px; border-radius: 12px; background: var(--inset); border: 1px solid var(--gold); user-select: all; }

/* ------------------------------------------------ início: atenção e apps */
.attn { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.attn li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 14px; border-radius: 18px; background: var(--inset); border: 1px solid var(--wire); }
.attn .who { flex: 1 1 140px; min-width: 0; display: grid; order: 1; }
.attn .who b { font-size: 15px; }
.attn .who small { color: var(--mist); font-size: 12.5px; }
.attn li > .pill { order: 2; }
.attn li > .btn { order: 3; min-height: 44px; }
.attn li > .btn:not(.ghost) { background: var(--gold); border-color: var(--gold); color: var(--on-gold); font-weight: 800; }
.updline { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 0; border-top: 1px solid var(--wire); }
.updline:last-of-type { border-bottom: 0; }
.panel h2 .small { float: right; font-family: var(--body); font-weight: 700; font-size: 14px; line-height: 1.8; }
.panel h2 .pill { vertical-align: middle; margin-left: 6px; background: var(--gold); color: var(--on-gold); }

/* ------------------------------------------------ filtros de aparelhos */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 20px; }
.chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .18);
  color: var(--text); font-size: 14px; font-weight: 700; }
.chip:hover { text-decoration: none; background: rgba(255, 255, 255, .07); }
.chip.on { background: var(--gold); color: var(--on-gold); border-color: var(--gold); }
.chip b { margin-left: 8px; color: inherit; opacity: .75; font-weight: 600; }

/* ------------------------------------------------ apps e lojas */
.sec { font-size: 26px; margin: 0 0 14px; }
.appgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; margin-bottom: 22px; }
.appcard { margin: 0; }
.appcard .top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.appcard .ver { font: 600 38px/1.1 var(--display); margin: 12px 0 4px; }
.meta { list-style: none; margin: 14px 0 16px; padding: 0; display: grid; gap: 6px; font-size: 13px; color: var(--mist); }
.meta li { display: flex; justify-content: space-between; gap: 12px; }
.meta b { color: var(--text); font-weight: 600; }
.keycard { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.keycard > div { flex: 1 1 260px; }
.keycard h2 { margin: 0; }
.stores .store { display: grid; grid-template-columns: minmax(150px, 1fr) 130px minmax(150px, 1fr) minmax(200px, 2fr); gap: 16px; align-items: end;
  padding: 14px 0; border-bottom: 1px solid var(--wire); }
.stores .store > div { display: grid; }
.stores .store small { font-size: 12px; }
.stores .store label { display: grid; gap: 6px; font-size: 12px; color: var(--mist); }
.stores .btn { margin-top: 18px; }
.stores .store .pill { justify-self: start; align-self: center; }

/* ------------------------------------------------ telas menores */
@media (max-width: 1180px) {
  .dash { grid-template-columns: minmax(0, 1fr); }
  .dash-side { order: -1; }
}
@media (max-width: 980px) {
  .split, .split.wide-left { grid-template-columns: 1fr; }
  .row { grid-template-columns: 30px 100px 1fr 100px; }
  .rlists, .rseen { display: none; }
  .rows.selectable .row { grid-template-columns: 26px 30px 100px 1fr 100px; }
}
@media (max-width: 860px) { .stores .store { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) {
  body.app { grid-template-columns: 1fr; gap: 0; padding: 0; }
  .side { position: sticky; top: 0; height: auto; flex-direction: row; align-items: center; gap: 4px; padding: 8px 10px; overflow-x: auto; z-index: 5;
    border-radius: 0 0 22px 22px; border-top: 0; background: rgba(20, 17, 26, .88); }
  .brand { margin: 0 6px 0 0; flex: none; }
  .brand b { display: none; }
  .brand img { width: 34px; height: 34px; }
  .nav { display: flex; gap: 2px; width: auto; }
  .nav a { min-width: 78px; padding: 8px 6px; }
  .logout { margin: 0 0 0 auto; width: auto; }
  button.link { padding: 8px 10px; }
  .main { padding: 20px 16px 56px; }
  h1 { font-size: 40px; }
  .quick, .quick input { width: 100%; min-width: 0; }
  .pactions { width: 100%; }
  .tvwall { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .tv .tvcode { font-size: 22px; }
  .row { grid-template-columns: 28px 1fr auto; }
  .rname { display: none; }
  .rows.selectable .row { grid-template-columns: 24px 28px 1fr auto; }
  .dnslist li { grid-template-columns: 30px 1fr; }
  .dnslist .pill, .dnsact { grid-column: 2; }
  .row2 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat b { font-size: 40px; }
}
@media (max-width: 560px) { .stores .store { grid-template-columns: 1fr; } }

/* ------------------------------------------------ mensagens (chat da página inicial) */
.nav a { position: relative; }
.nav .nb { position: absolute; top: 6px; right: 14px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--gold); color: var(--on-gold);
  font: 800 12px/20px var(--body); font-style: normal; text-align: center; }
.nav a.on .nb { background: var(--on-gold); color: var(--gold); }
.chatsw .switch { margin: 0; }
.msgs { display: grid; grid-template-columns: minmax(280px, 400px) minmax(0, 1fr); gap: 20px; align-items: start; }
.mlist { padding: 8px; margin: 0; max-height: 70vh; overflow: auto; }
.mrow { display: flex; gap: 12px; padding: 14px; border-radius: 18px; color: var(--text); border: 1px solid transparent; }
.mrow:hover { text-decoration: none; background: var(--amethyst); }
.mrow.on { background: rgba(255, 122, 26, .12); border-color: rgba(255, 122, 26, .45); }
.mrow .dot { flex: none; width: 9px; height: 9px; margin-top: 8px; border-radius: 50%; background: transparent; }
.mrow.unread .dot { background: var(--gold); }
.mbody { flex: 1; min-width: 0; display: grid; gap: 4px; }
.mtop { display: flex; justify-content: space-between; gap: 8px; }
.mtop small { color: var(--mist); }
.mrow:not(.unread) .mtop b, .mrow:not(.unread) .mprev { color: var(--mist); }
.mprev { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.mtags { display: flex; gap: 6px; margin-top: 2px; }
.pill.st-new { background: rgba(255, 122, 26, .18); color: var(--gold-soft); }
.pill.st-answered, .pill.st-archived { background: rgba(255, 255, 255, .10); color: var(--mist); }
.mdetail { min-height: 420px; margin: 0; }
.mhead { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; padding-bottom: 16px; border-bottom: 1px solid var(--wire); }
.mhead h2 { margin: 0; }
.mhead .sub { margin: 4px 0 0; }
.mact { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.mact form { margin: 0; }
.mthread { display: grid; gap: 12px; padding: 20px 0; }
.bub { max-width: 560px; padding: 12px 14px; border-radius: 6px 18px 18px 18px; background: var(--inset); border: 1px solid var(--wire); }
.bub p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.bub small { display: block; margin-top: 6px; color: var(--mist); font-size: 12px; }
.bub.out { justify-self: end; border-radius: 18px 6px 18px 18px; background: rgba(255, 122, 26, .14); border-color: rgba(255, 122, 26, .4); }
.mreply { border-top: 1px solid var(--wire); padding-top: 16px; }
.mreply textarea { resize: vertical; }
.mtools { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; }
.mtpl { display: flex; flex-wrap: wrap; gap: 8px; }
.mtpl .chip { background: transparent; cursor: pointer; font-family: var(--body); min-height: 38px; padding: 0 14px; font-size: 13px; }
.mdel { margin: 18px 0 0; }
@media (max-width: 900px) { .msgs { grid-template-columns: 1fr; } .mlist { max-height: 320px; } }

/* ------------------------------------------------ duas etapas */
.login-step { margin: 0 0 4px; font-size: 24px; }
.login-back { display: block; text-align: center; margin-top: 14px; }
.twofa-steps { margin: 0 0 22px; padding-left: 22px; display: grid; gap: 8px; }
.twofa-qr { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; margin-bottom: 24px; }
.twofa-qr img { background: #fff; border-radius: 16px; padding: 8px; }
.twofa-key { display: block; padding: 12px 14px; border-radius: 12px; background: var(--inset); border: 1px solid var(--wire); font-size: 16px; letter-spacing: .06em; user-select: all; word-break: break-all; }
.twofa-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 28px; margin-top: 16px; }
.twofa-codes { list-style: none; margin: 18px 0 24px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.twofa-codes code { display: block; padding: 12px 14px; border-radius: 12px; background: var(--inset); border: 1px solid var(--gold); font-size: 17px; letter-spacing: .08em; text-align: center; user-select: all; }
