/* ==========================================================================
   BRADOX PLAY — REDESIGN VISUAL V2 (Design System & Components)
   Baseado na entrega oficial em BRADOX_PLAY_REDESIGN_VISUAL
   ========================================================================== */

:root {
  --bx-ink: #0b0d10;
  --bx-side: #101318;
  --bx-panel: #161b21;
  --bx-panel2: #1b2027;
  --bx-panel3: #212730;
  --bx-line: #2c333b;
  --bx-line2: #252b33;
  --bx-border-modal: #42474a;
  --bx-text: #f6f4ef;
  --bx-muted: #a2aab3;
  --bx-dim: #78828d;
  --bx-gold: #ddb461;
  --bx-gold-light: #f1d18c;
  --bx-gold-deep: #aa7b28;
  --bx-gold-soft: rgba(221, 180, 97, 0.12);
  --bx-ok: #66c7a5;
  --bx-warn: #f1ce84;
  --bx-red: #f18d90;
  --bx-blue: #77b5d6;
  --bx-radius: 12px;
  --bx-radius2: 16px;
  --bx-sidebar-w: 260px;

  /* Sobrescreve tokens legados para compatibilidade global */
  --bg: var(--bx-ink);
  --bg-2: var(--bx-side);
  --surface: var(--bx-panel);
  --surface-2: var(--bx-panel2);
  --surface-hover: var(--bx-panel3);
  --border: var(--bx-line);
  --border-soft: var(--bx-line2);
  --text: var(--bx-text);
  --text-2: var(--bx-muted);
  --text-3: var(--bx-dim);
  --gold: var(--bx-gold);
  --gold-hi: var(--bx-gold-light);
  --gold-lo: var(--bx-gold-deep);
  --gold-soft: var(--bx-gold-soft);
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-brand: Inter, "Segoe UI", Arial, sans-serif;
  --font-mono: Consolas, "Cascadia Mono", ui-monospace, monospace;
}

/* Comunicação: avisos, badge do sino e conversas de suporte. */
.notif-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.notif-btn svg { display: block; width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.notif-count { position: absolute; top: -5px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; display: grid; place-items: center; border: 2px solid var(--bx-ink); border-radius: 99px; background: var(--bx-gold); color: #17130c; font-size: 10px; font-weight: 800; }
.communication-page { max-width: 1440px; margin-inline: auto; }
.communication-page .pagehead { align-items: end; }
.communication-compose { margin-bottom: 28px; }
.communication-compose h2,.communication-list-heading h2 { margin: 0 0 7px; font-size: 19px; }
.communication-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
input[type="file"][accept*="image"]:not([hidden]) {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 6px;
  overflow: hidden;
  border: 1px solid var(--bx-line);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(221,180,97,.07), transparent 46%), var(--bx-side);
  color: var(--bx-muted);
  font: 500 13px/1.4 var(--font);
  cursor: pointer;
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
input[type="file"][accept*="image"]:not([hidden]):hover { border-color: rgba(221,180,97,.65); }
input[type="file"][accept*="image"]:not([hidden]):focus-visible { outline: 2px solid var(--bx-gold); outline-offset: 2px; }
input[type="file"][accept*="image"]:not([hidden])::file-selector-button {
  min-height: 34px;
  margin-right: 12px;
  padding: 0 13px;
  border: 1px solid rgba(241,209,140,.75);
  border-radius: 7px;
  background: linear-gradient(180deg, var(--bx-gold-light), var(--bx-gold));
  color: #21190c;
  font: 700 12px/1 var(--font);
  cursor: pointer;
  transition: filter .15s, transform .15s;
}
input[type="file"][accept*="image"]:not([hidden])::file-selector-button:hover { filter: brightness(1.07); }
input[type="file"][accept*="image"]:not([hidden])::-webkit-file-upload-button {
  min-height: 34px;
  margin-right: 12px;
  padding: 0 13px;
  border: 1px solid rgba(241,209,140,.75);
  border-radius: 7px;
  background: linear-gradient(180deg, var(--bx-gold-light), var(--bx-gold));
  color: #21190c;
  font: 700 12px/1 var(--font);
  cursor: pointer;
}
.communication-options { display: flex !important; flex-wrap: wrap; gap: 18px; margin: 14px 0 18px; color: var(--bx-muted); font-size: 13px; }
.communication-options label { display: inline-flex; align-items: center; gap: 8px; }
.communication-list-heading { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin: 25px 0 14px; }
.communication-list-heading .hint { margin: 0; }
.communication-admin-list,.communication-ticket-list { display: grid; gap: 12px; }
.communication-admin-card { overflow: hidden; }
.communication-admin-card summary { display: flex; align-items: center; gap: 14px; padding: 16px 18px; cursor: pointer; list-style: none; }
.communication-admin-card summary::-webkit-details-marker { display: none; }
.communication-admin-title { display: grid; flex: 1; gap: 4px; min-width: 0; }
.communication-admin-title strong { overflow-wrap: anywhere; }
.communication-admin-title small,.communication-ticket small { color: var(--bx-dim); }
.communication-bell { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid var(--bx-line); border-radius: 10px; color: var(--bx-gold); font-size: 22px; }
.communication-edit { display: grid; grid-template-columns: minmax(0,240px) minmax(0,1fr); gap: 20px; padding: 18px; border-top: 1px solid var(--bx-line); }
.communication-thumb { width: 100%; max-height: 180px; object-fit: contain; background: var(--bx-ink); border-radius: 10px; }
.communication-notice-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.communication-notice-card { overflow: hidden; }
.communication-notice-card > img { display: block; width: 100%; max-height: 260px; object-fit: cover; background: var(--bx-ink); }
.communication-notice-card.unread,.communication-ticket.unread { border-color: var(--bx-gold-deep); box-shadow: 0 0 0 1px var(--bx-gold-soft); }
.communication-notice-copy { padding: 18px; }
.communication-notice-meta { display: flex; align-items: center; gap: 8px; }
.communication-notice-meta time,.communication-ticket time { margin-left: auto; color: var(--bx-dim); font-size: 12px; }
.communication-notice-copy h2 { margin: 12px 0 8px; font-size: 19px; }
.communication-notice-copy p { color: var(--bx-muted); line-height: 1.6; white-space: pre-line; }
.communication-dialog { width: min(760px,calc(100vw - 28px)); max-height: min(90dvh,900px); }
.communication-modal { width: 100%; max-width: none; max-height: min(90dvh,900px); overflow: auto; }
.communication-modal .modal-head { position: sticky; top: 0; z-index: 1; background: var(--bx-panel); }
.communication-modal .ttl h2 { margin: 6px 0 0; }
.communication-detail-image { display: block; max-width: 100%; max-height: 48vh; object-fit: contain; margin: 0 auto 18px; border-radius: 10px; }
.communication-message { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; }
.communication-thread { max-width: 1000px; margin-inline: auto; overflow: hidden; }
.communication-thread-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--bx-line); }
.communication-thread-head > div { display: flex; align-items: center; gap: 12px; }
.communication-messages { display: grid; gap: 12px; padding: 20px; max-height: min(58vh,680px); overflow: auto; }
.communication-message { max-width: min(82%,760px); padding: 13px 15px; border: 1px solid var(--bx-line); border-radius: 12px; background: var(--bx-side); }
.communication-message.mine { justify-self: end; border-color: rgba(221,180,97,.35); background: var(--bx-gold-soft); }
.communication-message > div { display: flex; align-items: center; gap: 14px; }
.communication-message time { margin-left: auto; color: var(--bx-dim); font-size: 11px; }
.communication-message p { margin: 10px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.communication-reply { padding: 18px 20px; border-top: 1px solid var(--bx-line); }
.communication-attachment-field { display: grid; gap: 8px; margin: 12px 0 16px; }
.communication-attachment-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.communication-attachment-row input[type="file"] { flex: 1 1 280px; max-width: 100%; color: var(--bx-muted); font-size: 13px; }
.communication-attachment-hint { color: var(--bx-dim); font-size: 12px; }
.communication-attachment-preview { display: flex; align-items: center; gap: 12px; color: var(--bx-muted); font-size: 12px; }
.communication-attachment-preview[hidden] { display: none; }
.communication-attachment-preview img { width: 96px; height: 72px; object-fit: contain; border: 1px solid var(--bx-line); border-radius: 8px; background: var(--bx-ink); }
.communication-message-image { display: block; max-width: min(100%,560px); max-height: 420px; margin-top: 12px; border: 1px solid var(--bx-line); border-radius: 10px; object-fit: contain; background: var(--bx-ink); }
.communication-ticket { display: block; padding: 17px 19px; color: inherit; text-decoration: none; }
.communication-ticket:hover { border-color: var(--bx-gold-deep); }
.communication-ticket-top { display: flex; align-items: center; gap: 12px; }
.communication-ticket-top strong { flex: 1; }
.communication-ticket > p { margin: 10px 0; color: var(--bx-muted); overflow-wrap: anywhere; }
.communication-ticket > time { display: block; }
@media (max-width: 760px) {
  .communication-form-grid,.communication-notice-grid,.communication-edit { grid-template-columns: 1fr; }
  .communication-list-heading { align-items: start; }
  .communication-message { max-width: 94%; }
  .communication-admin-card summary { padding: 13px; gap: 9px; }
  .communication-admin-card summary > .tag { display: none; }
}

body {
  font-family: var(--font);
  background: var(--bx-ink);
  color: var(--bx-text);
  -webkit-font-smoothing: antialiased;
}

/* ==================== BOTÕES V2 (DESIGN SYSTEM) ==================== */
.btn {
  height: 43px;
  border: 1px solid #414952;
  background: #21272e;
  color: #eef0f1;
  border-radius: 7px;
  padding: 0 16px;
  gap: 10px;
  font-size: 13px;
  font-weight: 680;
  letter-spacing: -0.12px;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
  transition: color 0.13s, background 0.13s, border-color 0.13s, transform 0.12s, filter 0.13s;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  background: #2c343d;
  border-color: #56616b;
  color: #ffffff;
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible,
.bx-close:focus-visible,
.bx-tab:focus-visible {
  outline: 2px solid #eac47e;
  outline-offset: 3px;
}

/* 01 / Ação Principal (Dourado BRADOX sólido) */
.btn.goldbtn,
.btn.btn-primary {
  background: #ddb461;
  border: 1px solid #f1d287;
  color: #1f170b;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.42), inset 0 -2px rgba(77, 47, 10, 0.15);
  font-weight: 760;
}

.btn.goldbtn:hover,
.btn.btn-primary:hover {
  background: #efc979;
  border-color: #ffdd99;
  color: #171107;
  filter: none;
}

.btn.goldbtn svg,
.btn.btn-primary svg {
  stroke-width: 2.15;
}

.btn.goldbtn:active,
.btn.btn-primary:active {
  background: #caa252;
}

/* 02 / Ação Secundária (Quiet / Grafite) */
.btn.quiet,
.btn.btn-ghost {
  background: #1b2025;
  border: 1px solid #414a52;
  color: #e3e7e9;
}

.btn.quiet:hover,
.btn.btn-ghost:hover {
  background: #282f36;
  border-color: #6a7177;
  color: #ffffff;
}

/* 03 / Ação de Risco (Destrutivo Contido) */
.btn.redbtn,
.btn.btn-danger {
  background: #2d1d22;
  color: #f5aab0;
  border: 1px solid #744046;
}

.btn.redbtn:hover,
.btn.btn-danger:hover {
  background: #49262c;
  border-color: #ba6871;
  color: #ffffff;
}

/* 04 / Ações Compactas / Tabela */
.btn.small,
.btn.btn-sm {
  height: 35px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: 6px;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.icon-btn,
.iconbtn {
  border-radius: 7px;
  height: 38px;
  width: 38px;
  display: inline-grid;
  place-items: center;
  background: #21272e;
  border: 1px solid #414952;
  color: #bbc4cb;
  cursor: pointer;
  transition: all 0.13s ease;
}

.icon-btn:hover,
.iconbtn:hover {
  background: #2c343d;
  border-color: #56616b;
  color: #ffffff;
}

/* ==================== BADGES & TAGS ==================== */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
  border: 1px solid #454b51;
  border-radius: 6px;
  padding: 4px 9px;
  background: #242a30;
  color: #bfc6cc;
}

.tag .dot {
  height: 6px;
  width: 6px;
  background: currentColor;
  border-radius: 50%;
}

.tag.ok,
.badge.ok {
  color: #8ad8b7;
  border-color: rgba(83, 203, 151, 0.22);
  background: rgba(83, 203, 151, 0.09);
}

.tag.warn,
.badge.warn,
.badge.expired {
  color: #f1ce84;
  border-color: rgba(225, 179, 74, 0.23);
  background: rgba(225, 179, 74, 0.09);
}

.tag.bad,
.badge.blocked,
.badge.danger {
  color: #ec9ca6;
  border-color: rgba(221, 103, 113, 0.22);
  background: rgba(221, 103, 113, 0.09);
}

.tag.blue,
.badge.info {
  color: #9bc9e7;
  border-color: rgba(107, 174, 210, 0.22);
  background: rgba(107, 174, 210, 0.09);
}

/* ==================== SHELL & SIDEBAR V2 ==================== */
.app {
  display: grid;
  grid-template-columns: var(--bx-sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 14px 16px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(155deg, #12171d 0%, #0e1116 55%, #0c0f13 100%);
  border-right: 1px solid var(--bx-line2);
  z-index: 9999 !important;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #2b333c transparent;
}

.brandrow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px 18px;
  border-bottom: 1px solid var(--bx-line2);
  text-decoration: none;
}

.brandrow img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 2px 10px rgba(236, 176, 45, 0.2));
}

.brandname {
  line-height: 1.0;
}

.brandname b {
  font-size: 20px;
  color: var(--bx-gold);
  letter-spacing: 1.3px;
  font-weight: 850;
  display: block;
}

.brandname span {
  display: block;
  color: #eae0cb;
  font-size: 10px;
  letter-spacing: 5.6px;
  padding-top: 6px;
  font-weight: 600;
}

.workspace {
  margin: 16px 4px 14px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #39382f;
  background: linear-gradient(110deg, #231f17, #171a1e);
  display: flex;
  gap: 10px;
  align-items: center;
}

.workspace-logo {
  width: 32px;
  height: 32px;
  border: 1px solid #51452c;
  border-radius: 8px;
  background: #312a1b;
  color: var(--bx-gold);
  display: grid;
  place-items: center;
  flex: none;
}

.workspace-label {
  flex: 1;
  min-width: 0;
}

.workspace-label small {
  display: block;
  color: #aeb3ad;
  font-size: 9.5px;
  letter-spacing: 0.8px;
  font-weight: 700;
  text-transform: uppercase;
}

.workspace-label b {
  font-size: 12px;
  color: #f2f5f6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.nav-section {
  font-size: 10px;
  letter-spacing: 1.8px;
  color: #77818b;
  text-transform: uppercase;
  padding: 14px 12px 6px;
  font-weight: 750;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 2px;
}

.nav-link {
  width: 100%;
  border: 0;
  background: transparent;
  color: #9ca6b0;
  border-radius: 8px;
  min-height: 40px;
  margin: 2px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 0 12px;
  font-size: 13.5px;
  font-weight: 550;
  position: relative;
  text-decoration: none;
  transition: all 0.15s ease;
}

.nav-link svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  flex: none;
}

.nav-link:hover {
  color: #ffffff;
  background: #1b2228;
}

.nav-link.active {
  background: linear-gradient(90deg, rgba(231, 187, 90, 0.15), rgba(231, 187, 90, 0.04));
  color: #f0d48b;
  border: 1px solid rgba(231, 187, 90, 0.19);
  font-weight: 650;
}

.nav-link.active::before {
  position: absolute;
  content: "";
  width: 3px;
  height: 20px;
  left: -5px;
  top: 10px;
  background: var(--bx-gold);
  border-radius: 3px;
}

.nav-count {
  margin-left: auto;
  font-size: 10px;
  background: #252c34;
  border: 1px solid #3c4652;
  border-radius: 6px;
  padding: 1px 6px;
  color: #b9c0c6;
  font-weight: 700;
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--bx-line2);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-security-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #161b20;
  border: 1px solid #2d353e;
  border-radius: 8px;
}

.sidebar-security-badge strong {
  font-size: 11.5px;
  color: #d1d8dc;
  display: block;
}

.sidebar-security-badge small {
  font-size: 10px;
  color: #7b8893;
  display: block;
}

.sidebar-user-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px;
}

.avatar-emblem {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #242930;
  border: 1px solid #3d4651;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: none;
}

.avatar-emblem img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.sidebar-user-footer .who {
  min-width: 0;
  flex: 1;
}

.sidebar-user-footer .who strong {
  display: block;
  color: var(--bx-text);
  font-size: 12.8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-footer .who small {
  display: block;
  color: var(--bx-dim);
  font-size: 10.5px;
}

/* ==================== TOPBAR V2 ==================== */
.topbar {
  height: 76px;
  border-bottom: 1px solid var(--bx-line2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 35px;
  gap: 18px;
  background: rgba(13, 16, 20, 0.96) !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 100 !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
}

.crumb {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--bx-dim);
  font-size: 12.5px;
}

.crumb svg {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}

.crumb b {
  color: #ccd1d3;
  font-weight: 600;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.top-search {
  min-width: 238px;
  color: #7a858c;
  background: #161b20;
  border: 1px solid #30363d;
  border-radius: 8px;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  font-size: 12.5px;
}

.top-search input {
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--bx-text);
  font-size: 12.5px;
  width: 100%;
}

.top-search input::placeholder {
  color: #64707a;
}

.kbd {
  margin-left: auto;
  color: #667079;
  border: 1px solid #3b4349;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 10px;
  white-space: nowrap;
}

.notif-btn {
  position: relative;
}

.notif-dot {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--bx-gold);
}

.top-user {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-user .mini {
  height: 34px;
  width: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #343021;
  color: var(--bx-gold);
  font-weight: 800;
  border: 1px solid #685733;
}

.top-user b {
  display: block;
  font-size: 12px;
  color: #eef1f2;
}

.top-user small {
  display: block;
  font-size: 10.5px;
  color: var(--bx-dim);
}

/* ==================== PAGEHEAD & STATS ==================== */
.content {
  max-width: 1550px;
  margin: 0 auto;
  padding: 32px 35px 70px;
}

.pagehead {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 27px;
  gap: 20px;
}

.eyebrow {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 750;
  color: var(--bx-gold);
  margin-bottom: 8px;
}

.pagehead h1 {
  font-size: 30px;
  letter-spacing: -0.9px;
  line-height: 1.15;
  font-weight: 760;
  color: #f7faf8;
}

.pagehead p {
  color: var(--bx-muted);
  margin-top: 8px;
  font-size: 13.5px;
}

.head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

/* Stats Cards */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 26px;
}

.stat {
  background: linear-gradient(135deg, #191e24 20%, #14191f);
  border: 1px solid #303842;
  border-radius: 12px;
  padding: 18px 20px;
  min-height: 138px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -40px;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, rgba(232, 187, 90, 0.08), transparent 70%);
  pointer-events: none;
}

.stat-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.stat-top > span {
  color: #a4abb2;
  font-size: 12.5px;
  font-weight: 600;
}

.stat-ico {
  height: 35px;
  width: 35px;
  display: grid;
  place-items: center;
  border: 1px solid #494535;
  background: rgba(224, 178, 83, 0.1);
  border-radius: 8px;
  color: var(--bx-gold);
}

.stat-ico svg {
  height: 18px;
  width: 18px;
}

.stat-value {
  font-size: 30px;
  letter-spacing: -1px;
  font-weight: 780;
  line-height: 1.1;
  color: #f7faf8;
  margin: 12px 0 4px;
  font-variant-numeric: tabular-nums;
}

.stat-foot {
  font-size: 11.5px;
  color: var(--bx-dim);
}

/* ==================== APPS SHOWCASE GRID ==================== */
.appcards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.appcard {
  overflow: hidden;
  border: 1px solid #343b43;
  border-radius: 12px;
  background: #181f25;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  position: relative;
}

.appcard:hover {
  transform: translateY(-2px);
  border-color: #55606d;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.appcover {
  height: 154px;
  background: radial-gradient(ellipse at 50% 25%, #2a3440, #0c1015 72%);
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-bottom: 1px solid #283038;
}

.appcover::before {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(235, 191, 89, 0.13);
  transform: rotate(35deg);
  border-radius: 25px;
  pointer-events: none;
}

.appcover .corner {
  position: absolute;
  top: 12px;
  left: 13px;
  z-index: 2;
}

.appcover .app-card-count {
  position: absolute;
  bottom: 10px;
  right: 12px;
  background: rgba(15, 20, 25, 0.85);
  border: 1px solid #3f4750;
  color: #ccd4da;
  font-size: 10.5px;
  padding: 3px 8px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  z-index: 2;
}

.appcover.has-cover::before {
  display: none;
}

.appcover.has-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(16, 19, 24, 0.82) 0%, rgba(16, 19, 24, 0.15) 55%, transparent 100%);
  z-index: 1;
  pointer-events: none;
}

.appcover img.appcover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  z-index: 1;
  transition: transform 0.28s ease;
}

.appcard:hover .appcover img.appcover-img { transform: none; }

.appcover img.appcover-emblem,
.appcover img:not(.appcover-img) {
  position: relative;
  max-width: 82px;
  max-height: 82px;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.7));
  z-index: 1;
}

.appcover-badge {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--bx-gold);
  z-index: 1;
}

.appcover-badge strong {
  font-size: 26px;
  letter-spacing: 2px;
  font-weight: 850;
  text-shadow: 0 4px 15px rgba(0, 0, 0, 0.8);
}

.appcard-content {
  padding: 16px 18px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.appcard-content h3 {
  font-size: 16px;
  font-weight: 700;
  color: #f6f4ef;
  margin-bottom: 6px;
}

.appcard-content .app-desc {
  font-size: 12.5px;
  color: var(--bx-muted);
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.appcard-footer {
  border-top: 1px solid #303841;
  margin-top: 14px;
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--bx-dim);
  font-size: 11.5px;
}

.appcard-footer .platform {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #929ea7;
}

/* ==================== MODAIS V2 (BX-MODAL) ==================== */
dialog {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--bx-text);
  max-height: 100dvh;
  max-width: 100vw;
  overflow: visible;
}

dialog::backdrop {
  z-index: 100;
  backdrop-filter: blur(7px);
  background: rgba(2, 4, 6, 0.83);
}

.bx-modal {
  position: relative;
  width: min(96vw, 1080px);
  max-height: min(94dvh, 960px);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  border-radius: 11px;
  border: 1px solid #42474a;
  background: #15191e;
  box-shadow: 0 45px 110px rgba(0, 0, 0, 0.75), 0 4px 15px rgba(0, 0, 0, 0.48);
  isolation: isolate;
  margin: auto;
}

.bx-modal::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 118px;
  height: 2px;
  background: #ddad4c;
  z-index: 10;
}

.bx-size-wide {
  width: min(96vw, 1080px);
}

.bx-size-medium {
  width: min(100%, 740px);
}

.bx-size-compact {
  width: min(100%, 590px);
}

.bx-dialog-head {
  position: relative;
  padding: 24px 32px 22px;
  border-bottom: 1px solid #323941;
  background: #191e23;
  flex: none;
}

.bx-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #dcc28a;
  letter-spacing: 1.3px;
  font-size: 10px;
  font-weight: 820;
  text-transform: uppercase;
}

.bx-mark {
  width: 16px;
  height: 2px;
  background: #dfb75e;
}

.bx-head-divider {
  color: #565f66;
}

.bx-mode {
  letter-spacing: 0.8px;
  color: #77838a;
  font-size: 9.5px;
  font-weight: 750;
}

.bx-close {
  position: absolute;
  right: 24px;
  top: 18px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid #3d454e;
  border-radius: 7px;
  background: #252b31;
  color: #bbc4cb;
  cursor: pointer;
  transition: all 0.12s ease;
}

.bx-close:hover {
  color: #fff;
  background: #333b43;
}

.bx-close svg {
  width: 16px;
  height: 16px;
}

.bx-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-top: 14px;
}

.bx-heading h2 {
  font-size: 26px;
  line-height: 1.15;
  font-weight: 770;
  letter-spacing: -0.9px;
  color: #f9faf8;
  margin: 0;
}

.bx-heading p {
  font-size: 12.8px;
  color: #a1adb6;
  margin-top: 6px;
  max-width: 615px;
  line-height: 1.5;
}

.bx-ref {
  border: 1px solid #55503f;
  color: #e6bc70;
  background: rgba(213, 170, 83, 0.095);
  border-radius: 5px;
  padding: 6px 10px;
  font-size: 10px;
  letter-spacing: 0.75px;
  font-weight: 780;
  white-space: nowrap;
}

.bx-dialog-main {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.bx-main-content {
  padding: 26px 32px 28px;
  flex: 1 1 auto;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

.bx-dialog-main.has-aside .bx-main-content {
  max-width: calc(100% - 266px);
}

.bx-aside {
  width: 266px;
  flex: none;
  background: #111519;
  border-left: 1px solid #323941;
  padding: 26px 20px;
  overflow-y: auto;
}

.bx-aside-heading {
  font-size: 10px;
  letter-spacing: 1.3px;
  color: #e3bd74;
  font-weight: 830;
  text-transform: uppercase;
}

.bx-aside-desc {
  font-size: 11.5px;
  color: #88949e;
  margin-top: 6px;
  line-height: 1.5;
}

.bx-dialog-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 16px 26px 16px 32px;
  background: #1b2025;
  border-top: 1px solid #363d44;
  min-height: 74px;
  flex: none;
}

.bx-foot-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  color: #8a959c;
  max-width: 50%;
  line-height: 1.4;
}

.bx-foot-meta svg {
  flex: none;
  stroke: #b99959;
  width: 16px;
  height: 16px;
}

.bx-footer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Tabs */
.bx-tabs {
  display: flex;
  gap: 0;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  border-bottom: 1px solid #383f46;
  margin: -4px 0 22px;
}

.bx-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px 12px;
  margin: 0 0 -1px;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: #909aa4;
  font-size: 12.8px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
  transition: all 0.12s ease;
}

.bx-tab:first-child {
  padding-left: 2px;
}

.bx-tab.is-active {
  color: #f2cf8c;
  border-bottom-color: #e0b35e;
}

.bx-tab:hover {
  color: #ffffff;
}

.bx-pane {
  display: none;
}

.bx-pane.is-active {
  display: block;
}

/* Sections & Form Grid */
.bx-sectionhead {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 4px 0 18px;
}

.bx-sectionnum {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: none;
  background: #292b28;
  border: 1px solid #6d5937;
  color: #e9c37a;
  border-radius: 5px;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 740;
}

.bx-sectionhead h3 {
  font-size: 15px;
  color: #f1f3f2;
  font-weight: 730;
  line-height: 1.3;
  margin: 0;
}

.bx-sectionhead p {
  font-size: 11.8px;
  color: #8997a0;
  margin: 4px 0 0;
}

.bx-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.bx-full {
  grid-column: 1 / -1;
}

.bx-field {
  min-width: 0;
}

.bx-field label {
  display: block;
  color: #d1d6da;
  font-size: 12px;
  font-weight: 680;
  margin-bottom: 7px;
}

.bx-field label em {
  font-size: 9.5px;
  color: #c5a15d;
  font-style: normal;
  font-weight: 600;
  margin-left: 5px;
}

.bx-input-wrap {
  min-height: 44px;
  border: 1px solid #424b54;
  border-radius: 6px;
  background: #10151a;
  display: flex;
  align-items: center;
  padding: 0 12px;
  transition: border-color 0.15s, background 0.15s;
}

.bx-input-wrap:focus-within {
  border-color: #cfad6a;
  background: #161c21;
  box-shadow: 0 0 0 3px rgba(221, 181, 100, 0.1);
}

.bx-input-wrap input,
.bx-input-wrap select,
.bx-input-wrap textarea {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  color: #f3f3f0;
  font-size: 13.4px;
  min-width: 0;
  width: 100%;
  font-family: inherit;
}

.bx-input-wrap input::placeholder,
.bx-input-wrap textarea::placeholder {
  color: #6a7680;
}

.bx-input-wrap select {
  cursor: pointer;
  appearance: auto;
}

.bx-note {
  display: flex;
  gap: 11px;
  padding: 13px 15px;
  margin-top: 14px;
  border: 1px solid #3c413f;
  background: #1c2326;
  color: #b2bfc6;
  border-radius: 6px;
  font-size: 11.5px;
  line-height: 1.5;
}

.bx-note svg {
  flex: none;
  stroke: #ddbd78;
  margin-top: 2px;
  width: 16px;
  height: 16px;
}

.bx-rail-card {
  background: #1a2025;
  border: 1px solid #3c4248;
  border-radius: 8px;
  padding: 15px 16px;
  margin: 16px 0;
}

.bx-rail-card > small {
  display: block;
  color: #9a9f9d;
  font-size: 9.5px;
  letter-spacing: 1.1px;
  font-weight: 800;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.bx-rail-device {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #f3f0e7;
}

.bx-rail-device strong {
  font-size: 16px;
  font-weight: 740;
}

.bx-info-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  padding: 11px 0;
  border-bottom: 1px solid #2b333a;
  font-size: 11.5px;
}

.bx-info-row span {
  color: #8e9aa3;
}

.bx-info-row strong {
  color: #eef0eb;
  font-weight: 700;
  min-width: 0;
  overflow-wrap: anywhere;
}

.bx-rail-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.bx-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #8ad8b7;
  font-size: 11px;
  font-weight: 700;
}

.bx-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.bx-status.draft {
  color: #f1ce84;
}

.bx-rail-status strong {
  color: #eef0eb;
  font-size: 12px;
}

.app-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 12px;
  margin: 14px 0;
}

.gallery-editor .app-thumb {
  width: auto;
  height: auto;
  min-width: 0;
}

.gallery-editor .gallery-alt {
  display: block;
  box-sizing: border-box;
  max-width: 100%;
}

.gallery-editor .gallery-item-tools {
  flex-wrap: wrap;
}

.bx-visual-preview {
  border-radius: 8px;
  background: radial-gradient(ellipse at 50% 40%, #313532, #0c1115 70%);
  height: 150px;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  position: relative;
  margin-top: 14px;
  border: 1px solid #373b34;
}

.bx-visual-preview img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.8));
}

.bx-visual-preview b {
  font-size: 15px;
  color: #e0bd76;
  letter-spacing: 1.4px;
  margin-top: 8px;
}

/* Upload zone */
.bx-upload-zone {
  border: 1px dashed #82704e;
  border-radius: 8px;
  background: #242720;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  min-height: 180px;
  cursor: pointer;
  text-align: center;
  padding: 20px;
  transition: border-color 0.15s, background 0.15s;
}

.bx-upload-zone:hover {
  border-color: #d1b16b;
  background: #2c3026;
}

.bx-upload-zone svg {
  color: #e0c27d;
  width: 32px;
  height: 32px;
}

.bx-upload-zone strong {
  font-size: 13px;
  color: #f5f4ef;
}

.bx-upload-zone span {
  color: #a7ab9b;
  font-size: 11.5px;
}

/* ==================== LOGIN SCREEN V2 ==================== */
.login-page {
  min-height: 100vh;
  background: radial-gradient(ellipse 48% 70% at 77% 42%, rgba(168, 110, 20, 0.14), transparent 77%), #0b0d10;
  display: grid;
  grid-template-columns: 1.06fr 0.94fr;
  overflow: hidden;
}

.login-left {
  padding: 60px 8% 40px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: radial-gradient(circle at 42% 45%, #222018 0%, #13161a 47%, #0c0e12 87%);
  border-right: 1px solid #343029;
}

.login-left::before {
  content: "";
  position: absolute;
  left: -180px;
  bottom: -420px;
  width: 740px;
  height: 740px;
  border: 1px solid rgba(230, 185, 75, 0.11);
  border-radius: 50%;
  box-shadow: 0 0 0 75px rgba(230, 185, 75, 0.024), 0 0 0 158px rgba(230, 185, 75, 0.018);
  pointer-events: none;
}

.login-slogan {
  z-index: 1;
  margin: 30px 0;
}

.login-slogan h1 {
  font-size: 46px;
  line-height: 1.12;
  letter-spacing: -1.7px;
  max-width: 540px;
  color: #f7faf8;
  margin: 0;
}

.login-slogan p {
  color: #a9b0b5;
  margin-top: 20px;
  font-size: 15px;
  max-width: 430px;
  line-height: 1.7;
}

.login-crest {
  position: relative;
  height: 340px;
  display: grid;
  place-items: center;
}

.login-crest img {
  height: 300px;
  object-fit: contain;
  filter: drop-shadow(0 20px 50px rgba(0, 0, 0, 0.7));
}

.login-trust {
  font-size: 11px;
  letter-spacing: 1.8px;
  color: #717b85;
  z-index: 1;
  text-transform: uppercase;
}

.login-right {
  display: grid;
  place-items: center;
  padding: 40px 24px;
}

.login-box {
  width: min(440px, 90%);
}

.login-box h2 {
  font-size: 32px;
  letter-spacing: -0.9px;
  margin-top: 10px;
  color: #f7faf8;
}

.login-box > p {
  color: #9da7ae;
  font-size: 13.5px;
  margin: 8px 0 26px;
}

.login-box .field {
  margin-bottom: 18px;
}

.login-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #9da7ae;
  font-size: 12px;
  margin-bottom: 24px;
}

.login-check {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}

.login-check input {
  accent-color: var(--bx-gold);
}

.login-copy {
  margin-top: 28px;
  border-top: 1px solid #292f36;
  padding-top: 20px;
  color: #68747e;
  font-size: 11.5px;
}

/* Planos e financeiro: hierarquia do painel comercial */
.billing-layout {
  width: min(100%, 1320px);
  margin-inline: auto;
  display: grid;
  gap: 24px;
}

.billing-page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.billing-page-heading h1 {
  margin: 7px 0 0;
  color: #f4f2ec;
  font-size: clamp(24px, 2.2vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.7px;
}

.billing-page-heading p,
.billing-card-heading p {
  margin: 7px 0 0;
  color: var(--bx-muted);
  font-size: 12.5px;
}

.billing-page-heading .section-kicker {
  color: var(--bx-gold);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .06em;
}

.billing-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.billing-metric {
  min-width: 0;
  min-height: 136px;
  padding: 17px 18px;
  border: 1px solid #303842;
  border-radius: 12px;
  background: #171c22;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.billing-metric > span {
  color: #b8c0c8;
  font-size: 12px;
}

.billing-metric strong {
  max-width: 100%;
  color: #f5f3ed;
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.billing-metric small {
  color: #808b97;
  font-size: 10.5px;
}

.billing-dashboard-grid,
.billing-settings-grid {
  display: grid;
  grid-template-columns: minmax(300px, .78fr) minmax(0, 1.22fr);
  align-items: stretch;
  gap: 18px;
}

.billing-dashboard-single,
.billing-settings-single { grid-template-columns: minmax(0, 1fr); }

.billing-dashboard-grid > .card,
.billing-side-stack > .card,
.billing-settings-grid > .card {
  min-width: 0;
  border: 1px solid #303842;
  border-radius: 12px;
  background: #171c22;
}

.billing-plan-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.billing-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}

.billing-card-heading > div { min-width: 0; }
.billing-card-heading h2 { margin: 0; color: #f1f0eb; font-size: 16px; }

.billing-plan-price {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 28px 6px 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(226, 180, 83, .38);
}

.billing-plan-price strong { color: var(--bx-gold); font-size: clamp(30px, 3vw, 42px); letter-spacing: -1px; }
.billing-plan-price span { color: #9ca5ae; font-size: 13px; }

.billing-plan-features {
  display: grid;
  gap: 18px;
  margin: 0 0 28px;
  padding: 0 6px;
  list-style: none;
  color: #d8dcde;
  font-size: 12px;
}

.billing-plan-features li { display: flex; align-items: center; gap: 11px; }
.billing-plan-features li::before { content: ''; width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #75d3b3; }

.billing-plan-footer {
  display: grid;
  gap: 12px;
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(226, 180, 83, .3);
  border-radius: 9px;
  background: rgba(226, 180, 83, .07);
  color: #d9c28b;
  font-size: 11px;
}

.billing-plan-footer .btn { width: fit-content; min-width: 180px; }
.billing-side-stack { display: grid; grid-template-rows: auto 1fr; min-width: 0; gap: 18px; }
.billing-coupons-card, .billing-referral-card { padding: 18px 20px; }

.billing-coupon-list { margin-top: 12px; }

.billing-coupon-row {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) minmax(100px, .8fr) auto auto;
  align-items: center;
  gap: 10px 14px;
  min-width: 0;
  padding: 12px 4px;
  border-bottom: 1px solid #303842;
  font-size: 11.5px;
}

.billing-coupon-row:last-child { border-bottom: 0; }
.billing-coupon-row > strong { overflow-wrap: anywhere; color: #f1f0eb; }
.billing-coupon-row > span:not(.badge) { color: #9da7b0; }
.billing-coupon-row .badge { white-space: nowrap; }
.billing-coupon-row form { margin: 0; }
.billing-coupon-row small { grid-column: 1 / -1; color: #798591; font-size: 10px; }

.billing-referral-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(226, 180, 83, .32);
  border-radius: 8px;
  background: rgba(226, 180, 83, .07);
  color: var(--bx-gold);
  font-size: 11.5px;
}

.billing-referral-link span { min-width: 0; overflow-wrap: anywhere; }
.billing-referral-link button { flex: 0 0 auto; }
.billing-mini-events { display: grid; }

.billing-mini-events > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #303842;
  color: #d8dcde;
  font-size: 11.5px;
}

.billing-mini-events > div:last-child { border-bottom: 0; }
.billing-mini-events > div span { overflow-wrap: anywhere; }
.billing-mini-events strong { color: #f1f0eb; white-space: nowrap; }
.billing-mini-events small { padding: 3px 8px; border: 1px solid #397860; border-radius: 20px; color: #82d9b8; white-space: nowrap; }
.billing-mini-events .muted { margin: 14px 0 0; font-size: 12px; }

.billing-settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.billing-settings-grid > .card { padding: 20px; }
.billing-settings-grid form { margin-top: 16px; }

.billing-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 14px;
}

.billing-form-grid .field { min-width: 0; }
.billing-form-grid .copy-row { min-width: 0; }
.billing-form-grid .copy-row input { min-width: 0; }
.billing-settings-grid .chk { margin: 4px 0 16px; }
.billing-referral-form .hint { margin: 8px 0 16px; line-height: 1.55; }
.billing-history-card .card-head { align-items: center; }
.billing-history-scroll {
  max-height: min(52vh, 440px);
  overflow: auto;
  overscroll-behavior: contain;
}
.billing-history-scroll thead th { position: sticky; top: 0; z-index: 2; }

/* ==================== RESPONSIVO ==================== */
@media (max-width: 1200px) {
  .appcards {
    grid-template-columns: repeat(2, 1fr);
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 70;
    width: 270px;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }
  body.drawer-open .sidebar {
    transform: translateX(0);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
  }
  .bx-aside {
    display: none;
  }
  .bx-dialog-main.has-aside .bx-main-content {
    max-width: none;
  }
  .top-search {
    display: none;
  }
}

@media (max-width: 980px) {
  .bx-aside {
    display: none;
  }
  .bx-dialog-main.has-aside .bx-main-content {
    max-width: none;
  }
  .bx-size-wide {
    width: min(96vw, 820px);
  }
}

@media (max-width: 600px) {
  .bx-modal,
  .bx-size-wide {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 8px;
  }
  .bx-dialog-head {
    padding: 18px 18px 16px;
  }
  .bx-main-content {
    padding: 18px 16px 22px;
  }
  .bx-dialog-foot {
    flex-wrap: wrap;
    padding: 12px 16px;
  }
  .bx-foot-meta,
  .bx-footer-actions {
    max-width: 100%;
    flex-wrap: wrap;
  }
  .bx-heading {
    align-items: flex-start;
  }
  .bx-heading h2 {
    overflow-wrap: anywhere;
  }
  .bx-tabs {
    margin-right: -16px;
    padding-right: 16px;
  }
  .appcards {
    grid-template-columns: 1fr;
  }
  .stats {
    grid-template-columns: 1fr;
  }
  .bx-form-grid {
    grid-template-columns: 1fr;
  }
  .bx-heading h2 {
    font-size: 22px;
  }
  .pagehead h1 {
    font-size: 24px;
  }
  .content {
    padding: 20px 16px 50px;
  }
}

@media (max-width: 1120px) {
  .billing-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .billing-dashboard-grid,
  .billing-settings-grid { grid-template-columns: 1fr; }
  .billing-side-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto; }
}

@media (max-width: 760px) {
  .billing-layout { gap: 18px; }
  .billing-page-heading { align-items: flex-start; flex-direction: column; }
  .billing-page-heading > .btn { width: 100%; }
  .billing-side-stack { grid-template-columns: 1fr; }
  .billing-settings-grid .billing-card-heading { flex-wrap: wrap; }
  .billing-form-grid { grid-template-columns: 1fr; }
  .billing-coupon-row { grid-template-columns: minmax(0, 1fr) auto; }
  .billing-coupon-row > span:not(.badge) { grid-column: 1; }
  .billing-coupon-row .badge { grid-column: 2; grid-row: 1; }
  .billing-coupon-row form { grid-column: 2; grid-row: 2; justify-self: end; }
  .billing-mini-events > div { grid-template-columns: minmax(0, 1fr) auto; }
  .billing-mini-events small { grid-column: 1 / -1; justify-self: start; }
}

@media (max-width: 480px) {
  .billing-metrics { grid-template-columns: 1fr; }
  .billing-metric { min-height: 110px; }
  .billing-plan-card,
  .billing-coupons-card,
  .billing-referral-card,
  .billing-settings-grid > .card { padding: 16px; }
  .billing-referral-link { align-items: flex-start; flex-direction: column; }
}

/* ==================== MOBILE FIT & TOUCH PASS ==================== */
.login-mobile-brand { display: none; }

@media (max-width: 760px) {
  .login-page {
    min-height: 100vh;
    min-height: 100svh;
    grid-template-columns: minmax(0, 1fr);
    overflow: visible;
  }
  .login-left { display: none; }
  .login-right {
    min-height: 100vh;
    min-height: 100svh;
    padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  }
  .login-box { width: min(100%, 440px); min-width: 0; }
  .login-mobile-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 36px; }
  .login-mobile-brand img { width: 48px; height: 48px; object-fit: contain; }
  .login-mobile-brand .brandname b { font-size: 20px; }
  .login-mobile-brand .brandname span { font-size: 10px; }
  .login-box h2 { font-size: clamp(27px, 7vw, 32px); line-height: 1.2; }
  .login-box > p { line-height: 1.55; }

  .main { min-width: 0; width: 100%; }
  .topbar { min-width: 0; min-height: 64px; height: auto; padding: 11px 16px; gap: 10px; }
  .topbar > div:first-child { min-width: 0; flex: 1 1 auto; }
  .topbar-actions { min-width: 0; flex: 0 0 auto; gap: 8px; }
  .top-user { min-width: 0; }
  .top-user > div:last-child { max-width: 120px; }
  .top-user b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .content { width: 100%; min-width: 0; padding: 22px 16px calc(42px + env(safe-area-inset-bottom)); }
  .pagehead { align-items: stretch; flex-direction: column; gap: 14px; margin-bottom: 20px; }
  .pagehead > *, .head-actions { min-width: 0; max-width: 100%; }
  .head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
  .head-actions > .btn { flex: 1 1 auto; justify-content: center; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat, .card, .panel, .content > * { min-width: 0; }
  .toolbar { flex-wrap: wrap; gap: 10px; }
  .toolbar > * { min-width: 0; max-width: 100%; }
  .table-wrap { max-width: 100%; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }

  .bx-dialog-main { min-height: 0; }
  .bx-main-content { min-width: 0; padding: 18px 16px 22px; }
  .bx-dialog-foot { gap: 10px; }
  .bx-foot-meta { max-width: 100%; }
  .bx-footer-actions { width: 100%; justify-content: flex-end; }
}

@media (max-width: 420px) {
  .login-right { padding-inline: 18px; }
  .login-mobile-brand { margin-bottom: 28px; }
  .login-line { align-items: flex-start; flex-wrap: wrap; gap: 12px; }
  .content { padding-inline: 14px; }
  .topbar { padding-inline: 12px; }
  .topbar h1 { max-width: 45vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .top-user > div:last-child { display: none; }
  .stats, .reseller-stats, .billing-metrics { grid-template-columns: minmax(0, 1fr); }
  .pagehead .btn, .head-actions > .btn { max-width: 100%; }
  .bx-main-content { padding-inline: 14px; }
  .bx-dialog-foot { align-items: stretch; flex-direction: column; }
  .bx-footer-actions { justify-content: stretch; }
  .bx-footer-actions > .btn { flex: 1 1 auto; }
}


/* ==================== MOBILE RESPONSIVE & LAYOUT HARDENING ==================== */
.brand-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 22px;
  align-items: start;
}
.brand-layout > aside {
  position: sticky;
  top: 86px;
}
.prefs-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.show-mobile { display: none !important; }
.hide-mobile { display: inline !important; }

.iconbtn-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  background: transparent;
  border: 1px solid #363e48;
  border-radius: 5px;
  color: #9cb1c2;
  cursor: pointer;
  transition: all 0.15s ease;
  vertical-align: middle;
}
.iconbtn-inline:hover {
  background: #252b33;
  color: #fff;
  border-color: #556271;
}

.btn-wa-inline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #4ade80;
  text-decoration: none;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 5px;
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.25);
  transition: all 0.15s ease;
}
.btn-wa-inline:hover {
  background: rgba(74, 222, 128, 0.2);
  border-color: #4ade80;
}

.server-filter-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.pill-btn {
  padding: 5px 13px;
  border-radius: 20px;
  border: 1px solid #363e48;
  background: #141920;
  color: #9aa5af;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.pill-btn:hover {
  color: #f0f3f5;
  border-color: #4a5663;
}
.pill-btn.active {
  background: var(--bx-gold, #dfb75e);
  color: #12161b;
  border-color: var(--bx-gold, #dfb75e);
  font-weight: 700;
}

.mobile-bottom-bar {
  display: none;
}

@media (max-width: 1024px) {
  .brand-layout {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .brand-layout > aside {
    position: static !important;
  }
  .prefs-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

@media (max-width: 768px) {
  .sidebar {
    bottom: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
    height: auto !important;
    max-height: calc(100dvh - 56px - env(safe-area-inset-bottom, 0px)) !important;
    padding-bottom: 28px !important;
    border-bottom: 1px solid var(--bx-line2);
    box-sizing: border-box !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .mobile-bottom-bar {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
    background: #11151a !important;
    border-top: 1px solid #29313a !important;
    z-index: 99999 !important;
    align-items: center;
    justify-content: space-around;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.45);
  }
  .mobile-bottom-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    height: 100%;
    color: #8c97a2;
    text-decoration: none;
    font-size: 10px;
    font-weight: 600;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: color 0.15s ease, transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-bottom-item.active {
    color: var(--bx-gold, #dfb75e);
  }
  .mobile-bottom-item:active {
    transform: scale(0.94);
  }
  .mobile-bottom-item svg {
    stroke-width: 1.9;
  }
  .main {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

@media (max-width: 600px) {
  .show-mobile { display: inline !important; }
  .hide-mobile { display: none !important; }
  
  .bx-dialog-head {
    padding: 16px 16px 14px !important;
    padding-right: 56px !important;
  }
  .bx-close {
    right: 14px !important;
    top: 14px !important;
    width: 32px !important;
    height: 32px !important;
  }
  .bx-heading {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
    margin-top: 8px !important;
  }
  .bx-ref {
    align-self: flex-start !important;
    margin-top: 2px !important;
  }

  .topbar {
    padding: 8px 12px !important;
    gap: 8px !important;
  }
  .topbar h1 {
    font-size: 18px !important;
  }
  .topbar-actions {
    gap: 6px !important;
  }
  .topbar-actions .btn {
    padding: 6px 10px !important;
    font-size: 11.5px !important;
  }

  .table-wrap table tr[data-server-row] {
    display: flex;
    flex-direction: column;
    padding: 12px 14px;
    margin-bottom: 12px;
    background: #141920;
    border: 1px solid #28303a;
    border-radius: 8px;
  }
  .table-wrap table tr[data-server-row] td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border: none;
  }
  .table-wrap table tr[data-server-row] td.actions-cell {
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid #232a33;
    justify-content: flex-end;
    gap: 8px;
  }
}


/* ==================== TOOLBAR & SEARCH MOBILE HARDENING ==================== */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.toolbar .search {
  flex: 1 1 260px;
  min-width: 220px;
}
.toolbar-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
@media (max-width: 768px) {
  .topbar {
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
    background: rgba(13, 16, 20, 0.98) !important;
  }
  .toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }
  .toolbar .search {
    width: 100% !important;
    min-width: 100% !important;
    flex: 1 1 auto !important;
  }
  .toolbar .search input {
    width: 100% !important;
    font-size: 14px !important;
  }
  .toolbar-filters {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    width: 100% !important;
  }
  .toolbar-filters select {
    width: 100% !important;
    min-width: 0 !important;
  }
  .toolbar-filters .btn {
    width: 100% !important;
    justify-content: center !important;
  }
}

/* ==================== LUXURY COMMUNICATION STYLING ==================== */
.communication-thread {
  background: #141920 !important;
  border: 1px solid #28303a !important;
  border-radius: 14px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4) !important;
}
.communication-thread-head {
  background: #161c23 !important;
  border-bottom: 1px solid #28303a !important;
  padding: 16px 22px !important;
}
.communication-messages {
  background: #0f1318 !important;
  padding: 24px 22px !important;
  gap: 16px !important;
}
.communication-message {
  border-radius: 12px !important;
  padding: 14px 18px !important;
  background: #181f27 !important;
  border: 1px solid #28323e !important;
  color: #e2e8f0 !important;
  font-size: 14px !important;
}
.communication-message.mine {
  background: linear-gradient(135deg, rgba(221,180,97,0.18) 0%, rgba(221,180,97,0.08) 100%) !important;
  border: 1px solid rgba(221, 180, 97, 0.35) !important;
}
.communication-reply {
  background: #141920 !important;
  border-top: 1px solid #28303a !important;
  padding: 20px 22px !important;
}
.communication-reply textarea, .communication-compose textarea {
  background: #0d1116 !important;
  border: 1px solid #303842 !important;
  border-radius: 8px !important;
  color: #f3f5f6 !important;
  padding: 12px !important;
  font-size: 14px !important;
  resize: vertical !important;
}
.communication-reply textarea:focus, .communication-compose textarea:focus {
  border-color: var(--bx-gold) !important;
  box-shadow: 0 0 0 2px rgba(221,180,97,0.2) !important;
  outline: none !important;
}
.communication-attachment-row input[type="file"] {
  background: #10151b !important;
  border: 1px dashed #303842 !important;
  border-radius: 8px !important;
  padding: 10px 14px !important;
  color: #8b949e !important;
  cursor: pointer !important;
}
.communication-admin-card {
  background: #141920 !important;
  border: 1px solid #28303a !important;
  border-radius: 12px !important;
  transition: border-color 0.2s ease, transform 0.2s ease !important;
}
.communication-admin-card[open] {
  border-color: rgba(221,180,97,0.4) !important;
}
.communication-admin-card summary {
  padding: 16px 20px !important;
  background: #161c23 !important;
}
.communication-admin-card summary:hover {
  background: #19212a !important;
}
.communication-bell {
  background: rgba(221,180,97,0.1) !important;
  border: 1px solid rgba(221,180,97,0.25) !important;
  color: var(--bx-gold) !important;
  border-radius: 8px !important;
}
.communication-ticket {
  background: #141920 !important;
  border: 1px solid #28303a !important;
  border-radius: 12px !important;
  padding: 18px 20px !important;
  transition: all 0.2s ease !important;
}
.communication-ticket:hover {
  background: #181f27 !important;
  border-color: rgba(221,180,97,0.4) !important;
  transform: translateY(-1px) !important;
}

/* ---- Servidores: busca em todas as páginas, resumo por tipo e uso ---- */
.server-stats { margin-bottom: 18px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.server-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.server-toolbar .search { flex: 1 1 280px; min-width: 200px; }
a.pill-btn { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; }
.pill-count { display: inline-grid; place-content: center; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 999px; background: rgba(255,255,255,.06); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.pill-btn.active .pill-count { background: rgba(18,22,27,.18); }
.server-table td[data-label="Servidor"] { min-width: 200px; }
.server-name-block { display: inline-flex; flex-direction: column; min-width: 0; }
.server-usage { display: block; margin-top: 3px; font-weight: 500; }
.server-dns { overflow-wrap: anywhere; }
.badge.server-type { text-transform: uppercase; letter-spacing: .05em; font-size: 10px; }
.badge.server-type-xtream { background: var(--gold-soft, rgba(215,175,50,.12)); color: var(--gold-hi, #f0cf6a); border-color: rgba(215,175,50,.3); }
.badge.server-type-m3u { background: rgba(69,185,218,.1); color: #9bd9ef; border-color: rgba(69,185,218,.25); }
.badge.server-type-stalker { background: rgba(167,139,250,.1); color: #c4b5fd; border-color: rgba(167,139,250,.28); }
[data-server-results] { transition: opacity .15s ease; }
[data-server-results][aria-busy="true"] { opacity: .55; pointer-events: none; }
.server-empty { padding: 32px 16px; }
@media (max-width: 720px) {
  .server-stats { grid-template-columns: 1fr; }
  .server-toolbar { flex-direction: column; align-items: stretch; }
  .server-filter-pills { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
}

/* ---- Revendas: link de cadastro e pedidos aguardando liberação ---- */
.signup-link-card { margin-bottom: 18px; }
.signup-link-card h2 .badge { margin-left: 8px; vertical-align: middle; }
.signup-link-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.signup-link-url { flex: 1 1 320px; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border, #28303a); border-radius: 10px; background: var(--surface-hover, #141920); }
.signup-link-url .mono { overflow-wrap: anywhere; }
.signup-link-url.is-off .mono { opacity: .55; text-decoration: line-through; }
.signup-link-actions, .signup-link-settings { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.signup-link-settings { margin-top: 12px; justify-content: space-between; }
.signup-link-form { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.signup-switch, .signup-days { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; color: var(--text-2, #9aa5af); }
.signup-days select { width: auto; min-width: 92px; padding: 6px 10px; }
.signup-requests { margin-top: 18px; border-top: 1px solid var(--border, #28303a); padding-top: 14px; display: grid; gap: 10px; }
.signup-requests h3 { margin: 0; font-size: 14px; }
.signup-request { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; padding: 12px 14px; border: 1px solid var(--border, #28303a); border-radius: 12px; background: var(--surface, #12161b); }
.signup-request-info { display: grid; gap: 3px; min-width: 0; flex: 1 1 280px; }
.signup-request-info .small { overflow-wrap: anywhere; }
.signup-request-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.signup-approve { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.signup-approve select { width: auto; max-width: 230px; padding: 6px 10px; }
.danger-text { color: #f79aa1; }
@media (max-width: 720px) {
  .signup-request-actions, .signup-approve, .signup-approve select { width: 100%; max-width: none; }
  .signup-approve .btn, .signup-request-actions form:last-child .btn { flex: 1 1 auto; }
  .signup-link-settings { flex-direction: column; align-items: stretch; }
}

/* Campo opcional no formulário de revenda */
.bx-field label em.optional { color: var(--text-3, #7d8a96); }
[data-no-autofill][readonly] { cursor: text; }
