/* ============================================================
   Data Router - Tema Modern Dark (Mobile-First & Responsivo)
   Revisão v3.2.1: sidebar, responsividade e renovação Pix automática.
   Escopo: dashboard, login, indicação, retorno de pagamento,
   formulários, tabelas, modais e telas responsivas.
   ============================================================ */

:root {
  --bg: #141820;
  --bg-deep: #10141b;
  --panel: #1d222c;
  --panel-2: #202630;
  --panel-3: #252c37;
  --surface-soft: #181d25;
  --surface-hover: #272f3b;
  --sidebar: #121720;
  --text: #f4f7fb;
  --text-soft: #d8dee8;
  --muted: #8f9aaa;
  --muted-2: #6e7887;
  --line: #2b3340;
  --line-soft: #242b36;
  --border: var(--line);
  --primary: #2f86ff;
  --primary2: #1f6ed8;
  --primary-soft: rgba(47, 134, 255, .13);
  --success: #20d67a;
  --success-soft: rgba(32, 214, 122, .12);
  --danger: #ff5d64;
  --danger-soft: rgba(255, 93, 100, .12);
  --warning: #f6b73c;
  --warning-soft: rgba(246, 183, 60, .13);
  --cyan: #35c3d6;
  --violet: #9b7cfb;
  --shadow: 0 12px 28px rgba(0, 0, 0, .18);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, .34);
  --radius: 12px;
  --radius-sm: 9px;
  --sidebar-width: 252px;
  --login-bg-image: none;
}

* { box-sizing: border-box; }
html { color-scheme: dark; background: var(--bg); }
body {
  margin: 0;
  min-width: 320px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: #78adff; }
[hidden] { display: none !important; }
::selection { background: rgba(47, 134, 255, .34); color: #fff; }

/* Scrollbar discreta */
* { scrollbar-width: thin; scrollbar-color: #3a4656 transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #394453; border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: #4a5667; border: 2px solid transparent; background-clip: padding-box; }

.muted { color: var(--muted); }
.error { color: var(--danger); min-height: 20px; }
.positive { color: var(--success); font-weight: 800; }
.negative { color: var(--danger); font-weight: 800; }
.truncate { max-width: 280px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ============================================================
   Campos e formulários
   ============================================================ */
label {
  display: grid;
  gap: 7px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 720;
}
input, select, textarea {
  width: 100%;
  border: 1px solid #343d4a;
  border-radius: var(--radius-sm);
  outline: none;
  background: #171c24;
  color: var(--text);
  padding: 11px 12px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
input::placeholder, textarea::placeholder { color: #687384; }
input:hover, select:hover, textarea:hover { border-color: #414c5b; }
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 134, 255, .13);
  background: #191f28;
}
input:disabled, select:disabled, textarea:disabled {
  opacity: .58;
  cursor: not-allowed;
}
input[readonly], textarea[readonly] { background: #141920; color: #b9c3d0; }
textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
select option { background: #181d25; color: var(--text); }

.stack { display: grid; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.form-span-2 { grid-column: span 2; }
.three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-actions { display: flex; align-items: end; gap: 9px; }
.form-actions > button { width: 100%; }
.check { display: flex; align-items: center; gap: 9px; align-self: end; padding: 10px 0; }
.check input { width: 17px; height: 17px; accent-color: var(--primary); }
.form-hint { margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.settings-divider { grid-column: 1 / -1; border-top: 1px solid var(--line); margin: 5px 0 2px; }

/* ============================================================
   Botões
   ============================================================ */
.primary, .button-link.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px; /* Aumentado para melhor toque */
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 10px 15px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  text-align: center;
  box-shadow: none;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.primary:hover, .button-link.primary:hover { background: var(--primary2); border-color: var(--primary2); }
.primary:active, .button-link.primary:active { transform: translateY(1px); }
.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px; /* Aumentado para melhor toque */
  border: 1px solid #37414f;
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  background: #202630;
  color: #d5dce6;
  font-weight: 700;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.ghost:hover { background: #29313d; border-color: #465263; color: #fff; }
.danger-text { color: #ff8b90; }
.danger-text:hover { color: #ffb2b5; border-color: rgba(255, 93, 100, .32); background: var(--danger-soft); }
.mini {
  border: 1px solid #35404e;
  border-radius: 7px;
  padding: 8px 10px; /* Mais área de toque */
  background: #252c37;
  color: #dce3ed;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.mini:hover { background: #303947; border-color: #485567; }
.mini.success { border-color: rgba(32, 214, 122, .22); background: var(--success-soft); color: #61e8a2; }
.mini.danger { border-color: rgba(255, 93, 100, .25); background: var(--danger-soft); color: #ff8d92; }
.mini-link { color: #78adff; font-weight: 800; }
button:disabled, .primary:disabled, .ghost:disabled, .mini:disabled { opacity: .45; cursor: not-allowed; transform: none !important; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.danger-primary { background: #d84f56 !important; border-color: #d84f56 !important; }
.danger-primary:hover { background: #c54249 !important; border-color: #c54249 !important; }

/* ============================================================
   Estrutura principal
   ============================================================ */
.app-page {
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
}

/* Sidebar - Mobile First */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 30;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  padding: 16px 12px 14px;
  background: linear-gradient(180deg, #151a22 0%, #11161e 100%);
  border-right: 1px solid #29313d;
  color: #fff;
  box-shadow: 10px 0 30px rgba(0, 0, 0, .12);
  transform: translateX(-100%);
  transition: transform .3s ease;
}
.sidebar.open {
  transform: translateX(0);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 56px;
  padding: 8px 9px;
  margin-bottom: 10px;
  border: 1px solid #2b3440;
  border-radius: 11px;
  background: #1a2029;
}
.brand > div:last-child { display: grid; gap: 2px; min-width: 0; }
.brand strong { font-size: 14px; letter-spacing: -.01em; }
.brand small { color: #7f8b9b; font-size: 10px; }
.brand-logo-wrap {
  width: 39px;
  height: 39px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #303947;
  border-radius: 10px;
  background: #1d242e;
}
.brand-logo { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 14px;
  background: #1f68c5;
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -.04em;
}
.brand-mark.small { width: 39px; height: 39px; border-radius: 9px; font-size: 12px; }
.sidebar nav {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 5px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 2px 10px 0;
}
.nav-group-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 8px 3px;
  color: #697587;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.nav-group-label::after {
  content: '';
  height: 1px;
  flex: 1;
  background: #29313c;
}
.nav-link {
  position: relative;
  width: 100%;
  border: 1px solid #242d38;
  border-radius: 9px;
  background: #171d26;
  color: #a9b3c1;
  padding: 12px 14px; /* Mais área de toque */
  text-align: left;
  font-size: 12px;
  font-weight: 720;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.012);
  transition: background .14s ease, color .14s ease, border-color .14s ease, transform .14s ease;
}
.nav-link:hover {
  background: #202731;
  border-color: #364150;
  color: #f0f4f9;
}
.nav-link.active, .nav-link[aria-current="page"] {
  border-color: rgba(47, 134, 255, .45);
  background: linear-gradient(90deg, rgba(47, 134, 255, .18), #1c2430 74%);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--primary), 0 6px 16px rgba(0,0,0,.10);
}
.nav-icon { display: inline-flex; width: 17px; justify-content: center; margin-right: 5px; color: #63a5ff; font-size: 9px; }
.sidebar > button:last-child {
  flex: 0 0 auto;
  margin-top: 10px;
  width: 100%;
  border-color: #343d49;
  background: #191f28;
}

/* Overlay para mobile */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 29;
  background: rgba(7, 10, 14, .6);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Botão para abrir sidebar no mobile */
.sidebar-toggle {
  display: none; /* Escondido no desktop */
  position: fixed;
  top: 15px;
  left: 15px;
  z-index: 31;
  width: 44px;
  height: 44px;
  border: 1px solid #374251;
  border-radius: 10px;
  background: #202630;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}

.referral-role-setting {
  padding: 13px;
  border: 1px solid #303a47;
  border-radius: 10px;
  background: #191f28;
}
.referral-role-setting small { color: #8995a6; line-height: 1.45; }

.main-content {
  min-height: 100vh;
  margin-left: 0; /* Mobile first */
  padding: 24px 16px 34px; /* Padding adaptado */
  background: var(--bg);
  transition: margin-left .3s ease;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 58px;
  margin-bottom: 18px;
  padding-bottom: 13px;
  border-bottom: 1px solid #222936;
}
.topbar h1 { margin: 0 0 3px; color: #fff; font-size: 21px; font-weight: 850; letter-spacing: -.025em; }
.topbar p { margin: 0; font-size: 11px; }
.user-chip {
  min-width: 132px;
  display: grid;
  gap: 2px;
  padding: 8px 11px;
  border: 1px solid #2d3541;
  border-radius: 9px;
  background: #1a2029;
  text-align: right;
}
.user-chip > span { color: #e9eef5; font-size: 12px; font-weight: 800; }
.user-chip > small { color: #7f8a9a; font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.user-chip-balance {
  margin-top: 5px;
  padding-top: 6px;
  border-top: 1px solid #303946;
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 7px;
}
.user-chip-balance span { color: #7f8a9a; font-size: 8px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.user-chip-balance strong { color: #f4f7fb; font-size: 15px; line-height: 1; font-weight: 900; }
.user-chip-balance strong.is-infinite { color: #b7a1ff; font-size: 22px; }
.section { display: grid; gap: 15px; }
.section[hidden] { display: none !important; }

/* ============================================================
   Cards e painéis
   ============================================================ */
.panel, .stat-card, .dashboard-summary-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: none;
}
.panel { padding: 18px; }
.panel h2 { margin: 0 0 13px; color: #f4f7fb; font-size: 16px; font-weight: 830; letter-spacing: -.015em; }
.panel p { line-height: 1.5; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
  flex-wrap: wrap; /* Permite quebra no mobile */
}
.panel-head h2 { margin: 0; }
.panel-head p { margin: 4px 0 0; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.stat-card { min-height: 118px; display: grid; align-content: space-between; gap: 9px; padding: 16px; }
.stat-card span { color: #aeb7c3; font-size: 10px; font-weight: 780; text-transform: uppercase; letter-spacing: .04em; }
.stat-card strong { color: #fff; font-size: 24px; line-height: 1; }
.stat-card.accent { background: linear-gradient(145deg, #1d242e, #202938); border-color: #334154; }

/* ============================================================
   Dashboard - visual inspirado na referência
   ============================================================ */
.dashboard-brand-banner {
  max-height: 170px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #1a2029;
}
.dashboard-brand-banner img { display: block; width: 100%; height: 100%; max-height: 170px; object-fit: cover; }
.quick-trial-feature {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  min-height: 88px;
  padding: 14px 16px;
  overflow: hidden;
  background: #1b222c;
  border-color: #2d3745;
}
.quick-trial-feature::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--primary);
}
.quick-trial-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(246, 183, 60, .25);
  border-radius: 10px;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 20px;
}
.quick-trial-kicker { display: block; margin-bottom: 3px; color: #7f8a9b; font-size: 8px; font-weight: 900; letter-spacing: .15em; }
.quick-trial-feature h2 { margin: 0 0 3px; font-size: 15px; }
.quick-trial-feature p { margin: 0; font-size: 11px; }
.quick-trial-cta { min-width: 150px; }
.dashboard-ad {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  border: 1px solid #303946;
  border-radius: 9px;
  background: #1b212a;
  color: #bdc6d2;
  font-size: 11px;
  font-weight: 750;
  text-decoration: none;
}
.dashboard-ad:hover { border-color: #3c4858; background: #202731; }
.dashboard-ad-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.dashboard-detailed { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.dashboard-summary-card { overflow: hidden; background: #1d232c; }
.dashboard-summary-card:hover { border-color: #364151; }
.dashboard-card-title {
  padding: 13px 14px 10px;
  border-bottom: 1px solid #2a323e;
  color: #eef2f7;
  font-size: 12px;
  font-weight: 820;
  letter-spacing: -.01em;
}
.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: #2a323e;
}
.dashboard-metrics > div {
  min-height: 76px;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 12px 14px;
  background: #1f252f;
}
.dashboard-metrics span { color: #8e99a8; font-size: 9px; font-weight: 780; letter-spacing: .05em; text-transform: uppercase; }
.dashboard-metrics strong { color: #fff; font-size: 22px; line-height: 1; font-weight: 850; }
.dashboard-metrics > div:nth-child(1) strong { color: var(--success); }
.dashboard-metrics > div:nth-child(2) strong { color: #ff7c82; }
.dashboard-metrics > div:nth-child(3) strong { color: #f5f7fa; }
.dashboard-metrics > div:nth-child(4) strong { color: #60a5ff; }
.dashboard-more {
  width: 100%;
  border: 0;
  border-top: 1px solid #29313c;
  background: #1b212a;
  color: #78adff;
  padding: 12px 16px; /* Melhor toque */
  text-align: left;
  font-size: 10px;
  font-weight: 760;
}
.dashboard-more:hover { background: #222a35; }
.dashboard-table-card { grid-column: 1 / -1; padding: 0; overflow: hidden; }
.dashboard-table-head { padding: 14px 17px 11px; border-bottom: 1px solid var(--line); }
.dashboard-table-head h2 { margin: 0 0 3px; font-size: 14px; }
.dashboard-table-head strong { color: #8995a5; font-size: 10px; }
.dashboard-table-card .table-wrap { padding: 0 8px 8px; }
.expected-revenue-card {
  grid-column: 1 / -1;
  display: grid;
  gap: 7px;
  padding: 18px 20px;
  border: 1px solid rgba(32, 214, 122, .2);
  border-radius: var(--radius);
  background: linear-gradient(110deg, #19231f, #1c242d 70%);
  box-shadow: none;
}
.expected-revenue-card span { color: #8fc8aa; font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.expected-revenue-card strong { color: var(--success); font-size: 30px; line-height: 1; }
.expected-revenue-card small { color: #8d9c96; font-size: 10px; }

/* ============================================================
   Tabelas (Mobile com scroll horizontal)
   ============================================================ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 9px; }
table { width: 100%; min-width: 760px; border-collapse: separate; border-spacing: 0; }
th, td {
  padding: 12px 12px; /* Mais respiro */
  border-bottom: 1px solid #29313c;
  color: #dce2ea;
  text-align: left;
  vertical-align: middle;
  font-size: 11px;
}
th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #1a2028;
  color: #818d9d;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
}
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: #222934; }
tbody tr:last-child td { border-bottom: 0; }
td strong { color: #f0f3f7; }
td small { display: block; margin-top: 3px; color: #7f8a99; font-size: 9px; }
.empty { padding: 22px; color: #778393; text-align: center; }
.empty-state { padding: 22px; border: 1px dashed #343e4c; border-radius: 9px; background: #181d24; color: #7f8b9b; text-align: center; }
.clients-table { min-width: 1050px; }
.resellers-table { min-width: 1260px; }
.clients-table td, .resellers-table td { vertical-align: top; padding-top: 14px; padding-bottom: 14px; }
.client-user { color: #4ade80; }
#resellers .reseller-user { color: #c084fc; }
#monthlyResellers .reseller-user { color: #60a5fa; }
.session-device { min-width: 250px; max-width: 420px; white-space: normal; word-break: break-word; }

/* Badges e status */
.badge, .status, .trial-badge, .prepaid-badge, .content-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #394352;
  border-radius: 999px;
  padding: 4px 8px;
  background: #252c36;
  color: #c3ccd7;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .04em;
}
.status { text-transform: capitalize; }
.status.active, .status.approved { border-color: rgba(32, 214, 122, .25); background: var(--success-soft); color: #63e7a4; }
.status.pending { border-color: rgba(246, 183, 60, .25); background: var(--warning-soft); color: #f7c85e; }
.status.past_due, .status.expired, .status.blocked, .status.canceled, .status.cancelled, .status.rejected, .status.charged_back { border-color: rgba(255, 93, 100, .25); background: var(--danger-soft); color: #ff8e93; }
.status.paused { border-color: rgba(155, 124, 251, .24); background: rgba(155, 124, 251, .11); color: #b9a5ff; }
.trial-badge { border-color: rgba(246, 183, 60, .28); background: var(--warning-soft); color: #f5bf4d; }
.prepaid-badge { margin-left: 4px; border-color: rgba(53, 195, 214, .24); background: rgba(53, 195, 214, .1); color: #6cd4e2; }
.content-badge { margin-left: 4px; }

/* ============================================================
   Clientes / Revendas
   ============================================================ */
.quick-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.quick-role {
  border: 1px solid #36506f;
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(47, 134, 255, .1);
  color: #85b7ff;
  font-size: 10px;
  font-weight: 800;
}
.quick-role:hover { background: rgba(47, 134, 255, .16); }
.ownership-chip { display: inline-flex; align-items: center; padding: 6px 9px; border: 1px solid rgba(32, 214, 122, .22); border-radius: 999px; background: var(--success-soft); color: #67e4a4; font-size: 9px; font-weight: 850; white-space: nowrap; }
.clients-head, .resellers-head { align-items: flex-end; }
.client-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.client-filters input { width: 100%; max-width: 235px; }
.client-filters select { width: 100%; max-width: 165px; }
.client-actions, .row-actions, .credit-row-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.client-actions { min-width: auto; } /* Mobile não precisa de min-width */
.credit-row-actions { min-width: auto; }
.action-btn {
  min-height: 36px; /* Melhor toque */
  border: 1px solid #374251;
  border-radius: 7px;
  padding: 8px 10px;
  background: #252d38;
  color: #d8e0ea;
  font-size: 10px;
  font-weight: 820;
  white-space: nowrap;
  transition: background .12s ease, border-color .12s ease;
}
.action-btn:hover { background: #303a48; border-color: #4a586a; }
.action-edit { color: #dfe6ef; }
.action-playlist { border-color: rgba(47, 134, 255, .25); background: rgba(47, 134, 255, .1); color: #80b3ff; }
.action-renew { border-color: rgba(155, 124, 251, .25); background: rgba(155, 124, 251, .1); color: #baa7ff; }
.action-whatsapp, .action-unlock { border-color: rgba(32, 214, 122, .23); background: var(--success-soft); color: #62e6a3; }
.action-lock, .action-delete { border-color: rgba(255, 93, 100, .22); background: var(--danger-soft); color: #ff9095; }
.client-name-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.trial-row { background: rgba(246, 183, 60, .025); }
.client-note { margin-top: 7px !important; padding: 6px 8px; border-left: 2px solid #465363; border-radius: 4px; background: #181d24; color: #8894a4 !important; }
.client-master-info { margin-top: 7px !important; color: #83b5ff !important; }

.client-manager { padding: 0; overflow: hidden; }
.client-page-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 17px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.client-page-head h2 { margin: 0 0 3px; }
.client-page-head p { margin: 0; font-size: 10px; }
.client-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) minmax(145px, .7fr) minmax(175px, .9fr) minmax(120px, .55fr) auto;
  gap: 10px;
  align-items: end;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  background: #191f27;
}
.reseller-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(130px, 180px);
  gap: 10px;
  align-items: end;
  margin: 0 -18px 13px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #191f27;
}
.toolbar-field { color: #7f8b9c; font-size: 9px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.toolbar-field input, .toolbar-field select { margin-top: 2px; text-transform: none; letter-spacing: normal; }
.toolbar-button { height: 44px; }
.client-list-summary { display: flex; justify-content: space-between; align-items: center; padding: 9px 18px; border-bottom: 1px solid var(--line); color: #8c98a8; font-size: 10px; flex-wrap: wrap; gap: 8px; }
.clients-table-wrap { padding: 0 12px 10px; }

.master-client-info { padding: 13px; border: 1px solid rgba(47, 134, 255, .2); border-radius: 10px; background: rgba(47, 134, 255, .055); }
.master-info-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.master-info-head small { color: #8390a1; }

/* Créditos */
.credit-balance {
  min-width: 82px;
  display: inline-grid;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid #35404d;
  border-radius: 8px;
  background: #202731;
}
.credit-balance strong { color: #f2f5f8; font-size: 17px; line-height: 1; font-weight: 900; }
.credit-balance small { margin: 1px 0 0 !important; color: #7f8b9b; font-size: 7px; font-weight: 900; letter-spacing: .1em; }
.credit-balance.credit-unlimited { border-color: rgba(155, 124, 251, .28); background: rgba(155, 124, 251, .09); }
.credit-balance.credit-unlimited strong { color: #b7a1ff; font-size: 24px; }
.credit-balance.credit-unlimited small { color: #a793eb; }
.credit-action-note { display: inline-flex; align-items: center; padding: 6px 8px; border: 1px solid rgba(155, 124, 251, .2); border-radius: 7px; background: rgba(155, 124, 251, .08); color: #b9a8f7; font-size: 9px; font-weight: 800; white-space: nowrap; }
.credit-edit-box { display: grid; gap: 8px; padding: 11px; border: 1px solid #35404d; border-radius: 9px; background: #181e26; }
.credit-edit-label { color: #94a0af; font-size: 10px; font-weight: 800; }
.credit-edit-balance { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.credit-edit-balance strong { color: #f1f4f8; font-size: 27px; line-height: 1; }
.credit-edit-balance strong.is-infinite { color: #b7a1ff; font-size: 36px; }
.credit-edit-balance small { color: #818d9d; font-size: 9px; font-weight: 650; }
.credit-edit-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.credit-edit-actions button { flex: 1 1 125px; }
.credit-adjust-current { display: grid; gap: 3px; padding: 14px; border: 1px solid #35404d; border-radius: 10px; background: #181e26; }
.credit-adjust-current span { color: #818d9d; font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.credit-adjust-current strong { color: #f3f5f8; font-size: 32px; line-height: 1; }
.credit-adjust-current small { color: #818d9d; }
.credit-adjust-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
#walletBalance.unlimited-wallet { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.wallet-infinity { color: #b6a0ff; font-size: 42px; line-height: .8; font-weight: 900; }
#walletBalance.unlimited-wallet small { color: #a591e9; font-size: 9px; font-weight: 900; letter-spacing: .08em; }
#resellerBalanceGroup small { color: #7f8a99; font-weight: 600; }

/* ============================================================
   Modais (Mobile First)
   ============================================================ */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 12px; }
.modal[hidden] { display: none !important; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(7, 10, 14, .76); backdrop-filter: blur(4px); }
.modal-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  padding: 18px;
  border: 1px solid #374151;
  border-radius: 13px;
  background: #1c222b;
  box-shadow: var(--shadow-lg);
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 16px; }
.modal-head h2 { margin: 0 0 4px; font-size: 17px; }
.modal-head p { margin: 0; }
.modal-close { width: 40px; height: 40px; flex: 0 0 auto; border: 1px solid #384352; border-radius: 8px; background: #252d38; color: #aeb8c5; font-size: 21px; line-height: 1; }
.modal-close:hover { background: #303947; color: #fff; }
.modal-open { overflow: hidden; }
.client-editor-form { grid-template-columns: 1fr; } /* Mobile first: 1 coluna */
.client-editor-form label small { color: #7d8999; font-weight: 500; }
.client-modal-actions { grid-column: 1; justify-content: flex-end; flex-wrap: wrap; }
.client-modal-actions button { width: auto; min-width: 130px; }
.playlist-modal-card { width: 100%; max-width: 760px; }
.quick-trial-modal-card { width: 100%; max-width: 560px; }
.credit-adjust-modal-card { width: 100%; max-width: 520px; }
.client-modal-card { width: 100%; max-width: 820px; }
.reseller-create-modal-card { width: 100%; max-width: 820px; }
.pix-renewal-modal-card { width: 100%; max-width: 720px; }
.payment-details-modal-card { width: 100%; max-width: 860px; }
.credentials-grid { display: grid; grid-template-columns: 1fr; gap: 9px; margin-bottom: 14px; }
.credentials-grid > div { padding: 11px; border: 1px solid #333d4b; border-radius: 9px; background: #181e26; }
.credentials-grid small { display: block; margin-bottom: 3px; color: #7f8b9b; font-size: 9px; }
.credentials-grid strong { color: #e9eef5; font-size: 11px; word-break: break-all; }
.playlist-url-label textarea { font: 11px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.playlist-url-label button { margin-top: 9px; width: 100%; } /* Mobile: botão largura total */
.playlist-buttons { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.trial-duration-card { display: grid; gap: 3px; padding: 12px; border: 1px solid rgba(47, 134, 255, .22); border-radius: 9px; background: rgba(47, 134, 255, .07); }
.trial-duration-card span { color: #8390a0; font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.trial-duration-card strong { color: #79adff; font-size: 19px; }
.trial-duration-card small { color: #7e8a9b; }

/* ============================================================
   Avisos / tickets / anotações / utilidades
   ============================================================ */
.notice-list { display: grid; gap: 10px; }
.notice-card { padding: 14px; border: 1px solid #313a47; border-radius: 10px; background: #1a2028; }
.notice-card.notice-inactive { opacity: .58; }
.notice-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.notice-card h3 { margin: 0 0 3px; color: #edf1f6; font-size: 14px; }
.notice-card small { color: #7c8898; }
.notice-card p { margin: 11px 0 0; color: #b7c0cc; line-height: 1.55; }
.status-list { display: grid; gap: 8px; }
.status-list div { display: flex; justify-content: space-between; gap: 12px; padding: 10px; border: 1px solid #303946; border-radius: 8px; background: #191f27; flex-wrap: wrap; }
.webhook-box { margin-top: 15px; padding: 11px; border: 1px dashed #3a4655; border-radius: 8px; background: #181d24; }
.webhook-box small { display: block; margin-bottom: 5px; color: #7f8a99; }
.webhook-box code { color: #a9caff; font-size: 10px; word-break: break-all; }
.notes-footer { display: flex; align-items: center; justify-content: space-between; gap: 11px; margin-top: 11px; flex-wrap: wrap; }
.notes-footer .primary { min-width: 170px; flex: 1; }
.migration-result { margin-top: 14px; padding: 12px; border: 1px solid rgba(47, 134, 255, .2); border-radius: 9px; background: rgba(47, 134, 255, .06); color: #b8c7da; line-height: 1.5; }
.migration-result details { margin-top: 9px; }
.migration-result ul { max-height: 210px; overflow: auto; margin-bottom: 0; }
.mini-select { min-width: 125px; border-radius: 7px; padding: 8px 10px; }

/* ============================================================
   Configurações / branding / API
   ============================================================ */
.settings-preview-block { padding: 14px; border: 1px dashed #3a4554; border-radius: 10px; background: #181e26; }
.settings-preview-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.settings-preview-head strong { display: block; color: #e7ecf2; font-size: 12px; }
.settings-preview-head small { display: block; margin-top: 2px; color: #7f8b9b; }
.branding-preview-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.branding-preview-card { padding: 10px; border: 1px solid #303a47; border-radius: 9px; background: #1c222b; }
.branding-preview-card > span { display: block; margin-bottom: 7px; color: #7f8b9b; font-size: 9px; font-weight: 800; }
.preview-login-logo, .preview-banner { height: 118px; display: grid; place-items: center; overflow: hidden; border: 1px solid #303a47; border-radius: 8px; background: #121820; }
.preview-login-logo img { max-width: 88%; max-height: 94px; object-fit: contain; }
.preview-banner img { width: 100%; height: 100%; object-fit: cover; }
.preview-fallback { width: 72px; height: 72px; display: grid; place-items: center; border: 1px solid #3d4857; border-radius: 15px; background: #202832; color: #fff; font-weight: 900; }
.preview-fallback.wide { width: auto; height: auto; border: 0; background: transparent; }
.preview-background { height: 118px; display: grid; place-items: center; border-radius: 8px; background-position: center; background-size: cover; color: #fff; text-shadow: 0 2px 9px #000; }
.preview-ad { min-height: 56px; display: flex; align-items: center; padding: 10px; border: 1px solid #303a47; border-radius: 8px; background: #181e26; color: #aab4c1; font-weight: 700; }
.media-help { display: block; margin: 4px 0 8px; color: #748090; font-size: 9px; font-weight: 600; line-height: 1.45; }
.media-upload-row { display: grid; grid-template-columns: 1fr; gap: 8px; align-items: center; margin-top: 7px; }
.media-upload-row input[type="file"] { padding: 10px; font-size: 10px; }
.media-upload-btn { white-space: nowrap; width: 100%; }
.api-docs pre { overflow: auto; padding: 14px; border: 1px solid #303947; border-radius: 9px; background: #10151c; color: #ccd8e8; white-space: pre-wrap; }
.api-docs h3 { margin: 20px 0 7px; color: #edf2f7; }

/* ============================================================
   Indicação
   ============================================================ */
.referral-link-panel { max-width: 860px; }
.referral-link-grid { display: grid; gap: 14px; }
.referral-link-panel .playlist-url-label { display: grid; grid-template-columns: 1fr; gap: 8px; align-items: center; }
.referral-link-panel .playlist-url-label button { margin-top: 0; width: 100%; min-width: 112px; }
.referral-link-panel small { color: #7f8b9b; font-weight: 500; }
.ref-message { min-height: 19px; font-size: 11px; }
.ref-message.success { color: var(--success); }
.ref-message.error { color: var(--danger); }
.ref-success { margin-top: 19px; padding: 15px; border: 1px solid rgba(32, 214, 122, .22); border-radius: 11px; background: rgba(32, 214, 122, .06); text-align: left; }
.success-kicker { color: #62df9f; font-size: 8px; font-weight: 900; letter-spacing: .12em; }
.ref-success h2 { margin: 5px 0 12px; font-size: 16px; }
.ref-data-grid { display: grid; grid-template-columns: 1fr; gap: 7px; margin-bottom: 12px; }
.ref-data-grid > div { display: grid; gap: 2px; padding: 9px; border: 1px solid #304039; border-radius: 8px; background: #18211e; }
.ref-data-grid span { color: #7d8d86; font-size: 9px; }
.ref-data-grid strong { color: #e8f2ed; font-size: 11px; }
.ref-success .primary { width: 100%; margin-bottom: 7px; }
.ref-back { display: inline-block; margin-top: 17px; color: #7eaff7; font-size: 11px; font-weight: 750; text-decoration: none; }
.ref-back:hover { color: #a3c8ff; }

/* ============================================================
   Login / retorno de pagamento
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  position: relative;
  overflow: auto;
  padding: 16px;
  background: #0f1319;
}
.login-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(120deg, rgba(10, 13, 18, .9), rgba(15, 20, 27, .8)),
    var(--login-bg-image),
    radial-gradient(circle at 18% 12%, rgba(47, 134, 255, .13), transparent 36%);
  background-position: center;
  background-size: cover;
}
.login-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: auto;
  display: grid;
  grid-template-columns: 1fr;
  overflow: hidden;
  border: 1px solid #303946;
  border-radius: 16px;
  background: #181e26;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .38);
}
.login-visual {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 40px 20px;
  background: linear-gradient(145deg, #131a23, #1b2735 60%, #193760);
}
.login-visual::after { content: ""; position: absolute; width: 360px; height: 360px; right: -180px; bottom: -200px; border-radius: 50%; background: rgba(47, 134, 255, .08); }
.login-visual-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .13)); }
.login-brand-stage { position: relative; z-index: 1; color: #fff; text-align: center; }
.login-logo-large { display: block; max-width: min(280px, 90%); max-height: 180px; object-fit: contain; margin: 0 auto 20px; }
.login-logo-fallback { width: 110px; height: 110px; display: grid; place-items: center; margin: 0 auto 20px; border: 1px solid #425065; border-radius: 24px; background: rgba(255, 255, 255, .055); color: #fff; font-size: 42px; font-weight: 950; letter-spacing: -.05em; }
.login-brand-stage h1 { margin: 0 0 8px; font-size: 28px; letter-spacing: -.04em; }
.login-brand-stage p { max-width: 400px; margin: 0 auto; color: #9eabbc; font-size: 13px; line-height: 1.6; }
.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 28px 20px;
  border: 1px solid #303946;
  border-radius: 14px;
  background: #1b212a;
  color: var(--text);
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.login-card h1 { margin: 13px 0 5px; font-size: 22px; }
.modern-login-card {
  width: auto !important;
  max-width: none !important;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 0 !important;
  padding: 34px 24px !important;
  border: 0 !important;
  border-top: 1px solid #303946 !important;
  border-radius: 0 !important;
  background: #1b212a !important;
  box-shadow: none !important;
  text-align: left;
}
.login-card-head { margin-bottom: 20px; }
.login-eyebrow { display: inline-block; margin-bottom: 9px; color: #6ba8ff; font-size: 9px; font-weight: 900; letter-spacing: .14em; }
.login-card-head h2 { margin: 0 0 6px; color: #f6f8fb; font-size: 24px; letter-spacing: -.035em; }
.login-card-head p { margin: 0; font-size: 11px; }
.login-form-modern { display: grid; gap: 14px; }
.login-form-modern label { color: #aeb8c5; font-size: 10px; font-weight: 800; }
.login-form-modern input { height: 46px; margin-top: 5px; }
.login-submit { height: 46px; margin-top: 2px; }
.login-footnote { margin-top: 18px; color: #667282; font-size: 9px; text-align: center; }
.modern-login-card .error { min-height: 17px; margin: 10px 0 0; font-size: 10px; font-weight: 700; }
.referral-card { width: 100%; max-width: 560px; text-align: center; }
.referral-card .brand-mark { margin: auto; }
.referral-page .stack { text-align: left; }

/* ============================================================
   Toasts
   ============================================================ */
.toast {
  position: fixed;
  top: 12px;
  right: 12px;
  left: 12px;
  z-index: 200;
  max-width: none;
  padding: 12px 16px;
  border: 1px solid #394453;
  border-radius: 9px;
  background: #202731;
  color: #fff;
  box-shadow: var(--shadow-lg);
  font-size: 12px;
  font-weight: 700;
}
.toast-ok { border-color: rgba(32, 214, 122, .28); background: #163128; color: #a8f5ce; }
.toast-error { border-color: rgba(255, 93, 100, .3); background: #3a2024; color: #ffc0c3; }

/* ============================================================
   Responsivo (Desktop)
   ============================================================ */
@media (min-width: 901px) {
  /* Restaura layout desktop */
  .sidebar {
    transform: translateX(0);
    position: fixed;
  }
  .sidebar-overlay, .sidebar-toggle {
    display: none;
  }
  .main-content {
    margin-left: var(--sidebar-width);
    padding: 24px 26px 34px;
  }
  .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .client-editor-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .client-modal-actions { grid-column: 1 / -1; }
  .credentials-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .branding-preview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .media-upload-row { grid-template-columns: minmax(0, 1fr) auto; }
  .media-upload-btn { width: auto; }
  .playlist-url-label button { width: auto; margin-top: 0; }
  .referral-link-panel .playlist-url-label { grid-template-columns: minmax(0, 1fr) auto; }
  .referral-link-panel .playlist-url-label button { width: auto; }
  .quick-trial-feature { grid-template-columns: auto 1fr auto; }
  .quick-trial-feature .primary { grid-column: auto; width: auto; }
  .client-toolbar { grid-template-columns: minmax(220px, 1.5fr) minmax(145px, .7fr) minmax(175px, .9fr) minmax(120px, .55fr) auto; }
  .modal-card { width: min(860px, 100%); padding: 20px; }
  .login-shell { grid-template-columns: 1.05fr .95fr; min-height: 570px; }
  .login-visual { padding: 44px; }
  .login-logo-large { max-width: min(340px, 82%); max-height: 230px; }
  .login-logo-fallback { width: 150px; height: 150px; font-size: 50px; }
  .login-brand-stage h1 { font-size: 31px; }
  .modern-login-card { padding: 50px 42px !important; border-left: 1px solid #303946 !important; border-top: 0 !important; }
  .toast { left: auto; max-width: 380px; }
}

@media (max-width: 1250px) {
  .dashboard-detailed { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-table-card, .expected-revenue-card { grid-column: 1 / -1; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  /* Ajustes para tablet */
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-toggle {
    display: inline-flex;
  }
  .main-content {
    padding-top: 70px; /* Espaço para o botão */
  }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .three-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .client-toolbar, .reseller-toolbar { grid-template-columns: 1fr 1fr; }
  .dashboard-detailed { grid-template-columns: 1fr; }
  .dashboard-table-card, .expected-revenue-card { grid-column: auto; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .topbar { align-items: flex-start; }
  .topbar { flex-wrap: wrap; }
  .user-chip { display: grid; min-width: 138px; margin-left: auto; }
  .form-grid, .two-col, .three-col, .client-toolbar, .reseller-toolbar { grid-template-columns: 1fr; }
  .form-span-2, .settings-divider { grid-column: 1; }
  .client-page-head .primary { width: 100%; }
  .credentials-grid { grid-template-columns: 1fr; }
  .credit-adjust-actions { grid-template-columns: 1fr; }
  .notes-footer, .notice-card-head, .master-info-head { align-items: stretch; flex-direction: column; }
  .notes-footer .primary { width: 100%; }
  .media-upload-row { grid-template-columns: 1fr; }
  .media-upload-btn { width: 100%; }
  .referral-link-panel .playlist-url-label { grid-template-columns: 1fr; }
  .referral-link-panel .playlist-url-label button { width: 100%; }
  .quick-trial-feature { grid-template-columns: auto 1fr; }
  .quick-trial-feature .primary { grid-column: 1 / -1; width: 100%; }
  .cards { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .main-content { padding: 70px 11px 24px; }
  .panel { padding: 14px; }
  .topbar h1 { font-size: 19px; }
  .dashboard-metrics { grid-template-columns: 1fr 1fr; }
  .dashboard-metrics strong { font-size: 20px; }
  .modal { padding: 6px; }
  .modal-card { max-height: calc(100vh - 12px); padding: 15px; }
  .client-modal-actions { display: grid; grid-template-columns: 1fr; }
  .client-modal-actions button { width: 100%; }
  .credit-row-actions { min-width: auto; } /* Remove min-width no mobile */
  .ref-data-grid { grid-template-columns: 1fr; }
  .login-page { padding: 8px; }
  .login-shell { min-height: 0; border-radius: 12px; }
  .login-visual { min-height: 200px; padding: 20px 12px; }
  .login-brand-stage h1 { font-size: 22px; }
  .login-brand-stage p { font-size: 11px; }
  .login-logo-large { max-height: 110px; margin-bottom: 12px; }
  .login-logo-fallback { width: 80px; height: 80px; margin-bottom: 12px; border-radius: 16px; font-size: 28px; }
  .modern-login-card { padding: 24px 16px !important; }
  .login-card { padding: 20px 14px; }
}

/* Ajustes de classes funcionais específicas */
.active-section { min-width: 0; }
.quick-trial-panel { width: 100%; }
.credit-action-btn { min-height: 36px; }

/* v3.1.7 - organizacao Revendas x Mensalistas */
.section-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.reseller-create-roles {
  justify-content: flex-start;
  margin: -2px 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #303947;
}
.reseller-create-form label[hidden] { display: none !important; }

/* v3.1.8 - atalhos de gestão */
.reseller-whatsapp-btn {
  border-color: rgba(32, 214, 122, .22);
  background: var(--success-soft);
  color: #61e8a2;
}
.payment-day-permission-btn { white-space: nowrap; }

/* v3.1.9 - renovacao por Pix */
.pix-renewal-result { display: grid; gap: 14px; }
.pix-renewal-result[hidden] { display: none !important; }
.pix-renewal-summary { margin-top: 4px; }
#pixRenewalStatus { transition: color .2s ease, opacity .2s ease; }
.pix-qr-wrap { display: flex; justify-content: center; align-items: center; min-height: 220px; padding: 14px; border: 1px solid var(--border, #303947); border-radius: 14px; background: rgba(255,255,255,.03); }
.pix-qr-wrap img { width: min(280px, 80vw); height: auto; border-radius: 10px; background: #fff; padding: 8px; }
.pix-renewal-result textarea { width: 100%; resize: vertical; word-break: break-all; }
.pix-renewal-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pix-renewal-actions .button-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.pix-renew-btn { white-space: nowrap; }

/* v3.2.0 - Pagamentos centralizados no painel */
.payment-panel-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:14px; flex-wrap: wrap; }
.payment-filters { display:grid; grid-template-columns:minmax(220px, 1fr) minmax(180px, 240px); gap:12px; margin-bottom:14px; }
.payment-filters label { margin:0; }
.payment-details-grid { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:12px; margin:8px 0 18px; }
.payment-detail-item { border:1px solid var(--border); border-radius:12px; padding:12px; display:grid; gap:5px; min-width:0; background:rgba(255,255,255,.02); }
.payment-detail-item small { color:var(--muted); }
.payment-detail-item strong, .payment-detail-item code { overflow-wrap:anywhere; }

/* Media queries específicas para componentes */
@media (max-width: 820px) {
  .section-head-actions { justify-content: flex-start; width: 100%; }
  .payment-panel-head { display: grid; }
  .payment-filters, .payment-details-grid { grid-template-columns: 1fr; }
  .pix-renewal-actions { display: grid; grid-template-columns: 1fr; }
  .pix-renewal-actions > * { width: 100%; }
}

@media (max-width: 560px) {
  .section-head-actions { display: grid; grid-template-columns: 1fr; }
  .section-head-actions button { width: 100%; }
  .payment-filters { grid-template-columns: 1fr; }
  .payment-details-grid { grid-template-columns: 1fr; }
  .pix-renewal-actions { grid-template-columns: 1fr; }
  .pix-renewal-actions > * { width: 100%; }
}

/* v3.2.1 - acessibilidade e estabilidade visual */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* v3.2.2 - Revendas e Mensalistas em formato mobile */
@media (max-width: 820px) {
  #resellers .table-wrap,
  #monthlyResellers .table-wrap {
    overflow: visible;
    border-radius: 0;
  }

  #resellers .resellers-table,
  #monthlyResellers .resellers-table {
    width: 100%;
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
  }

  #resellers .resellers-table thead,
  #monthlyResellers .resellers-table thead {
    display: none;
  }

  #resellers .resellers-table tbody,
  #monthlyResellers .resellers-table tbody {
    display: grid;
    gap: 12px;
  }

  #resellers .resellers-table tbody tr,
  #monthlyResellers .resellers-table tbody tr {
    display: block;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #191f27;
  }

  #resellers .resellers-table tbody tr:hover,
  #monthlyResellers .resellers-table tbody tr:hover {
    background: #191f27;
  }

  #resellers .resellers-table tbody td,
  #monthlyResellers .resellers-table tbody td {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(105px, 38%) minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-bottom: 1px solid #29313c;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  #resellers .resellers-table tbody td:last-child,
  #monthlyResellers .resellers-table tbody td:last-child {
    border-bottom: 0;
  }

  #resellers .resellers-table tbody td::before,
  #monthlyResellers .resellers-table tbody td::before {
    color: #7f8b9b;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
  }

  /* Revendas por créditos */
  #resellers .resellers-table tbody td:nth-child(1)::before { content: "Usuário"; }
  #resellers .resellers-table tbody td:nth-child(2)::before { content: "Categoria"; }
  #resellers .resellers-table tbody td:nth-child(3)::before { content: "Superior"; }
  #resellers .resellers-table tbody td:nth-child(4)::before { content: "Nível"; }
  #resellers .resellers-table tbody td:nth-child(5)::before { content: "Status"; }
  #resellers .resellers-table tbody td:nth-child(6)::before { content: "Créditos"; }
  #resellers .resellers-table tbody td:nth-child(7)::before { content: "Vencimento"; }
  #resellers .resellers-table tbody td:nth-child(8)::before { content: "Ações"; }

  /* Revendas mensalistas */
  #monthlyResellers .resellers-table tbody td:nth-child(1)::before { content: "Usuário"; }
  #monthlyResellers .resellers-table tbody td:nth-child(2)::before { content: "Categoria"; }
  #monthlyResellers .resellers-table tbody td:nth-child(3)::before { content: "Cobrança"; }
  #monthlyResellers .resellers-table tbody td:nth-child(4)::before { content: "Valor"; }
  #monthlyResellers .resellers-table tbody td:nth-child(5)::before { content: "Status"; }
  #monthlyResellers .resellers-table tbody td:nth-child(6)::before { content: "Vencimento"; }
  #monthlyResellers .resellers-table tbody td:nth-child(7)::before { content: "Ações"; }

  #resellers .resellers-table .row-actions,
  #resellers .resellers-table .credit-row-actions,
  #monthlyResellers .resellers-table .row-actions,
  #monthlyResellers .resellers-table .credit-row-actions {
    min-width: 0;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  #resellers .resellers-table .row-actions > *,
  #resellers .resellers-table .credit-row-actions > *,
  #monthlyResellers .resellers-table .row-actions > *,
  #monthlyResellers .resellers-table .credit-row-actions > * {
    width: 100%;
    min-width: 0;
    white-space: normal;
  }

  /* Mensagem de lista vazia não recebe rótulo de coluna */
  #resellers .resellers-table td[colspan],
  #monthlyResellers .resellers-table td[colspan],
  #resellers .resellers-table td.empty,
  #monthlyResellers .resellers-table td.empty {
    display: block;
    padding: 20px 14px;
    text-align: center;
  }

  #resellers .resellers-table td[colspan]::before,
  #monthlyResellers .resellers-table td[colspan]::before,
  #resellers .resellers-table td.empty::before,
  #monthlyResellers .resellers-table td.empty::before {
    content: none !important;
  }
}

@media (max-width: 560px) {
  #resellers .panel,
  #monthlyResellers .panel {
    padding: 12px;
  }

  #resellers .resellers-table tbody td,
  #monthlyResellers .resellers-table tbody td {
    grid-template-columns: 1fr;
    gap: 5px;
    padding: 11px;
  }

  #resellers .resellers-table tbody td::before,
  #monthlyResellers .resellers-table tbody td::before {
    display: block;
  }

  #resellers .resellers-table .row-actions,
  #resellers .resellers-table .credit-row-actions,
  #monthlyResellers .resellers-table .row-actions,
  #monthlyResellers .resellers-table .credit-row-actions {
    grid-template-columns: 1fr;
  }
}

/* v3.3.0 - resumo operacional de revendas e tickets centralizados */
.reseller-activity {
  display: grid;
  gap: 4px;
  min-width: 230px;
  font-size: 12px;
  line-height: 1.35;
}
.reseller-activity-server {
  display: block;
  padding-bottom: 5px;
  margin-bottom: 2px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  overflow-wrap: anywhere;
}
.reseller-activity span { color: var(--muted); }
.reseller-activity span b { color: var(--text); font-weight: 800; }

.ticket-details-modal-card { width: min(760px, calc(100vw - 28px)); }
.ticket-conversation { display: grid; gap: 10px; max-height: 48vh; overflow-y: auto; padding: 2px 2px 12px; }
.ticket-message { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: rgba(255,255,255,.025); }
.ticket-message > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ticket-message small { color: var(--muted); }
.ticket-message p { margin: 9px 0 0; line-height: 1.5; overflow-wrap: anywhere; }
.ticket-message-reply { border-left-width: 3px; }
.ticket-master-controls { display: grid; gap: 12px; margin-top: 12px; }
.ticket-master-controls[hidden], #ticketViewerControls[hidden] { display: none !important; }
.ticket-master-controls > label { max-width: 240px; }

@media (max-width: 820px) {
  #resellers .resellers-table tbody td:nth-child(8)::before { content: "Resumo"; }
  #resellers .resellers-table tbody td:nth-child(9)::before { content: "Ações"; }
  #monthlyResellers .resellers-table tbody td:nth-child(7)::before { content: "Resumo"; }
  #monthlyResellers .resellers-table tbody td:nth-child(8)::before { content: "Ações"; }
  .reseller-activity { min-width: 0; width: 100%; }
  .ticket-conversation { max-height: 42vh; }
}
@media (max-width: 820px) {
  #resellers .resellers-table tbody td:nth-child(8)::before { content: "Resumo"; }
  #resellers .resellers-table tbody td:nth-child(9)::before { content: "Ações"; }
  #monthlyResellers .resellers-table tbody td:nth-child(7)::before { content: "Resumo"; }
  #monthlyResellers .resellers-table tbody td:nth-child(8)::before { content: "Ações"; }
}

/* ============================================================
   v3.3.1 - Centralização e gestão responsiva
   Revendas, mensalistas e tickets sem necessidade de zoom.
   ============================================================ */
.main-content > .topbar,
.main-content > .section {
  width: 100%;
  max-width: 1640px;
  margin-inline: auto;
}
.section,
.panel,
.panel-head,
.table-wrap,
.resellers-table,
.tickets-table { min-width: 0; }
.table-wrap { width: 100%; max-width: 100%; }
#resellers .panel,
#monthlyResellers .panel,
#supportTickets .panel { overflow: hidden; }

/* Em desktops comuns a tabela de revendas vira cartões em grade,
   evitando corte lateral causado pelo menu fixo. */
@media (min-width: 821px) {
  #resellers .table-wrap,
  #monthlyResellers .table-wrap {
    overflow: visible;
    border-radius: 0;
  }
  #resellers .resellers-table,
  #monthlyResellers .resellers-table {
    width: 100%;
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
  }
  #resellers .resellers-table thead,
  #monthlyResellers .resellers-table thead { display: none; }
  #resellers .resellers-table tbody,
  #monthlyResellers .resellers-table tbody {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
  }
  #resellers .resellers-table tbody tr,
  #monthlyResellers .resellers-table tbody tr {
    display: block;
    min-width: 0;
    overflow: hidden;
    border: 1px solid #36404d;
    border-radius: 14px;
    background: #191f27;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .18);
  }
  #resellers .resellers-table tbody tr {
    border-left: 4px solid #9b7cfb;
  }
  #monthlyResellers .resellers-table tbody tr {
    border-left: 4px solid #2f86ff;
  }
  #resellers .resellers-table tbody tr:hover,
  #monthlyResellers .resellers-table tbody tr:hover { background: #191f27; }
  #resellers .resellers-table tbody td,
  #monthlyResellers .resellers-table tbody td {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(112px, 31%) minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid #29313c;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  #resellers .resellers-table tbody td:first-child,
  #monthlyResellers .resellers-table tbody td:first-child {
    background: rgba(255, 255, 255, .025);
    padding-top: 14px;
    padding-bottom: 14px;
  }
  #resellers .resellers-table tbody td:last-child,
  #monthlyResellers .resellers-table tbody td:last-child { border-bottom: 0; }
  #resellers .resellers-table tbody td::before,
  #monthlyResellers .resellers-table tbody td::before {
    color: #7f8b9b;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
  }
  #resellers .resellers-table tbody td:nth-child(1)::before { content: "Usuário"; }
  #resellers .resellers-table tbody td:nth-child(2)::before { content: "Categoria"; }
  #resellers .resellers-table tbody td:nth-child(3)::before { content: "Superior"; }
  #resellers .resellers-table tbody td:nth-child(4)::before { content: "Nível"; }
  #resellers .resellers-table tbody td:nth-child(5)::before { content: "Status"; }
  #resellers .resellers-table tbody td:nth-child(6)::before { content: "Créditos"; }
  #resellers .resellers-table tbody td:nth-child(7)::before { content: "Vencimento"; }
  #resellers .resellers-table tbody td:nth-child(8)::before { content: "Resumo"; }
  #resellers .resellers-table tbody td:nth-child(9)::before { content: "Ações"; }
  #monthlyResellers .resellers-table tbody td:nth-child(1)::before { content: "Usuário"; }
  #monthlyResellers .resellers-table tbody td:nth-child(2)::before { content: "Categoria"; }
  #monthlyResellers .resellers-table tbody td:nth-child(3)::before { content: "Cobrança"; }
  #monthlyResellers .resellers-table tbody td:nth-child(4)::before { content: "Valor"; }
  #monthlyResellers .resellers-table tbody td:nth-child(5)::before { content: "Status"; }
  #monthlyResellers .resellers-table tbody td:nth-child(6)::before { content: "Vencimento"; }
  #monthlyResellers .resellers-table tbody td:nth-child(7)::before { content: "Resumo"; }
  #monthlyResellers .resellers-table tbody td:nth-child(8)::before { content: "Ações"; }
  #resellers .reseller-activity,
  #monthlyResellers .reseller-activity { width: 100%; min-width: 0; }
  #resellers .row-actions,
  #monthlyResellers .row-actions {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }
  #resellers .row-actions > *,
  #monthlyResellers .row-actions > * {
    width: 100%;
    min-width: 0;
    white-space: normal;
  }
  #resellers td[colspan],
  #monthlyResellers td[colspan],
  #resellers td.empty,
  #monthlyResellers td.empty {
    display: block !important;
    text-align: center;
  }
  #resellers td[colspan]::before,
  #monthlyResellers td[colspan]::before,
  #resellers td.empty::before,
  #monthlyResellers td.empty::before { content: none !important; }
}

/* Tickets em cartões quando as oito colunas não cabem confortavelmente. */
@media (max-width: 1450px) {
  #supportTickets .tickets-table-wrap { overflow: visible; border-radius: 0; }
  #supportTickets .tickets-table { width: 100%; min-width: 0; border-spacing: 0; }
  #supportTickets .tickets-table thead { display: none; }
  #supportTickets .tickets-table tbody {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(430px, 100%), 1fr));
    gap: 12px;
  }
  #supportTickets .tickets-table tbody tr {
    display: block;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #191f27;
  }
  #supportTickets .tickets-table tbody tr.ticket-row-answered {
    border-color: rgba(32, 214, 122, .28);
    box-shadow: inset 3px 0 0 rgba(32, 214, 122, .55);
  }
  #supportTickets .tickets-table tbody td {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(100px, 27%) minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid #29313c;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  #supportTickets .tickets-table tbody td:last-child { border-bottom: 0; }
  #supportTickets .tickets-table tbody td::before {
    color: #7f8b9b;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
  }
  #supportTickets .tickets-table tbody td:nth-child(1)::before { content: "ID"; }
  #supportTickets .tickets-table tbody td:nth-child(2)::before { content: "Assunto"; }
  #supportTickets .tickets-table tbody td:nth-child(3)::before { content: "De"; }
  #supportTickets .tickets-table tbody td:nth-child(4)::before { content: "Para"; }
  #supportTickets .tickets-table tbody td:nth-child(5)::before { content: "Prioridade"; }
  #supportTickets .tickets-table tbody td:nth-child(6)::before { content: "Status"; }
  #supportTickets .tickets-table tbody td:nth-child(7)::before { content: "Atualizado"; }
  #supportTickets .tickets-table tbody td:nth-child(8)::before { content: "Ações"; }
  #supportTickets .tickets-table td[colspan],
  #supportTickets .tickets-table td.empty {
    display: block;
    padding: 20px 14px;
    text-align: center;
  }
  #supportTickets .tickets-table td[colspan]::before,
  #supportTickets .tickets-table td.empty::before { content: none !important; }
}

/* Status do atendimento e aviso ao cliente. */
.status.ticket-status.pending { border-color: rgba(246,183,60,.28); background: var(--warning-soft); color: #f7c85e; }
.status.ticket-status.read { border-color: rgba(47,134,255,.3); background: var(--primary-soft); color: #83b7ff; }
.status.ticket-status.answered { border-color: rgba(32,214,122,.3); background: var(--success-soft); color: #69e7a8; }
.status.ticket-status.closed { border-color: rgba(255,93,100,.25); background: var(--danger-soft); color: #ff969a; }
.ticket-status-box {
  display: grid;
  grid-template-columns: minmax(150px, .45fr) minmax(0, 1.55fr);
  gap: 12px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #181e26;
}
.ticket-status-current { display: grid; gap: 4px; }
.ticket-status-current span { color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
.ticket-status-current strong { font-size: 17px; }
.ticket-status-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.ticket-status-action.is-current { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); color: #fff; }
.ticket-viewer-notice {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(32,214,122,.28);
  border-radius: 12px;
  background: var(--success-soft);
}
.ticket-viewer-notice[hidden] { display: none !important; }
.ticket-viewer-notice strong { color: #72e9ad; }
.ticket-viewer-notice span { color: var(--text-soft); font-size: 11px; line-height: 1.45; }

@media (max-width: 820px) {
  #supportTickets .panel { padding: 12px; }
  #supportTickets .tickets-table tbody { grid-template-columns: 1fr; }
  #supportTickets .tickets-table tbody td { grid-template-columns: minmax(92px, 32%) minmax(0, 1fr); }
  .ticket-details-modal-card { width: min(100%, calc(100vw - 12px)); }
  .ticket-status-box { grid-template-columns: 1fr; }
  .ticket-status-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); justify-content: stretch; }
  .ticket-status-actions .ticket-status-action { width: 100%; white-space: normal; min-height: 42px; }
  .ticket-reply-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .ticket-reply-actions > button { width: 100%; }
}

@media (max-width: 560px) {
  #resellers .resellers-table tbody td,
  #monthlyResellers .resellers-table tbody td,
  #supportTickets .tickets-table tbody td {
    grid-template-columns: 1fr;
    gap: 5px;
  }
  #supportTickets .panel-head { align-items: stretch; }
  #supportTickets .panel-head > button { width: 100%; }
  .ticket-status-actions { grid-template-columns: 1fr; }
  .ticket-reply-actions { grid-template-columns: 1fr; }
  .ticket-conversation { max-height: 46vh; }
  .ticket-message { padding: 10px; }
}


.site-footer {
    width: 100%;
    text-align: center;
    padding: 15px 10px;
    margin-top: 30px;
    font-size: 13px;
    color: #777;
}

.btn-voltar-redondo {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;

    width: 44px;
    height: 44px;
    border-radius: 50%;

    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.08);
    color: white;

    font-size: 22px;
    cursor: pointer;
    backdrop-filter: blur(10px);
}










/* ============================================================
   Campo M3U menor
   ============================================================ */
#playlistM3uUrl {
  min-height: 42px;
  max-height: 60px;
  resize: vertical;
  font-size: 0.8rem;
}

/* ============================================================
   Seção de downloads
   ============================================================ */
.app-downloads {
  margin: 15px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.download-title {
  margin: 0 0 4px;
  font-size: 0.95rem;
}

/* ============================================================
   Grupo input/textarea + botão copiar
   ============================================================ */
.copy-input-group {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.copy-input-group input,
.copy-input-group textarea {
  flex: 1;
  min-width: 0;
}
.copy-input-group .small-btn {
  white-space: nowrap;
  padding: 6px 12px;
  font-size: 0.85rem;
  align-self: stretch;
}

/* ============================================================
   Servidor + Usuário + Senha — compacto, 3 colunas iguais
   ============================================================ */
.server-info-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin: 6px 0 10px;
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 8px;
}

.server-info-field {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.server-info-field small {
  display: block;
  color: #94a3b8;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.1;
}
.server-info-field strong {
  font-size: 0.85rem;
  color: #f1f5f9;
  font-family: 'Consolas', 'Monaco', monospace;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

/* Linha do usuário/senha com botão copiar ao lado */
.credential-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.credential-line strong {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Botão copiar usuário/senha — MAIOR e mais clicável */
  .credential-line .small-btn {
    padding: 6px 12px;
    font-size: 0.85rem;
    min-height: 34px;
    min-width: 38px;
  }

/* Efeito hover */
.credential-line .small-btn:hover {
  background: rgba(245, 158, 11, 0.15);
  border-color: #f59e0b;
  color: #fbbf24;
}

/* ============================================================
   Botões de download — altura UNIFICADA (72px)
   ============================================================ */
.download-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.download-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  height: 72px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: bold;
  color: #fff;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
  box-sizing: border-box;
  overflow: hidden;
}

.download-links .download-btn {
  flex: 1 1 180px;
}

.download-btn.activation {
  width: 100%;
  margin-top: 8px;
}

.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
  filter: brightness(1.08);
}
.download-btn:active {
  transform: translateY(0);
}

/* Ícones (🤖 Android / 💻 Windows) */
.download-btn .download-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
  width: 44px;
  text-align: center;
}

/* Texto padronizado */
.download-btn .download-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  text-align: left;
  min-width: 0;
}
.download-btn .download-text strong {
  font-size: 0.9rem;
}
.download-btn .download-text small {
  font-weight: normal;
  opacity: 0.85;
  font-size: 0.72rem;
  margin-top: 2px;
}

/* ============================================================
   Cores por plataforma
   ============================================================ */
.download-btn.android {
  background: linear-gradient(135deg, #3ddc84, #0f9d58);
}
.download-btn.windows {
  background: linear-gradient(135deg, #0078d4, #005a9e);
}

/* Botão de ativação (laranja) */
.download-btn.activation {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  height: 72px;
  min-height: 72px;
  max-height: 72px;
  padding: 8px 16px;
  align-items: center;
}
.download-btn.activation:hover {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  box-shadow: 0 6px 14px rgba(245, 158, 11, 0.35);
}

/* ============================================================
   Logo do botão de ativação
   ============================================================ */
.download-btn.activation .download-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.55);
  transition: transform 0.2s ease;
  margin: 0;
}
.download-btn.activation:hover .download-logo {
  transform: scale(1.06);
}

/* ============================================================
   Apps pagos (premium)
   ============================================================ */
.premium-title {
  margin-top: 12px;
  color: #d4af37;
}
.download-btn.premium {
  background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
  border: 1px solid #d4af37;
  color: #f5e6a8;
}
.download-btn.premium:hover {
  background: linear-gradient(135deg, #3a3a3a, #262626);
  border-color: #f5d76e;
  box-shadow: 0 6px 14px rgba(212, 175, 55, 0.35);
}
.download-btn.premium .download-text strong { color: #f5e6a8; }
.download-btn.premium .download-text small  { color: #c9b458; }

/* ============================================================
   📱 RESPONSIVO — CELULAR
   ============================================================ */

/* Tablets e celulares grandes (até 640px) */
@media (max-width: 640px) {
  .app-downloads {
    margin: 12px 0;
    gap: 8px;
  }

  /* Servidor/Usuário/Senha em 3 colunas ainda, mais apertado */
  .server-info-row {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
    padding: 8px;
  }
  .server-info-field small  { font-size: 0.6rem; }
  .server-info-field strong { font-size: 0.78rem; }
  .credential-line { gap: 3px; }
  .credential-line .small-btn {
    padding: 2px 5px;
    font-size: 0.68rem;
  }

  /* Android + Windows empilhados */
  .download-links {
    flex-direction: column;
    gap: 8px;
  }
  .download-links .download-btn {
    flex: 1 1 auto;
    width: 100%;
    height: 64px;
    padding: 8px 12px;
    gap: 10px;
  }
  .download-btn .download-icon {
    width: 38px;
    font-size: 1.4rem;
  }
  .download-btn .download-text strong { font-size: 0.85rem; }
  .download-btn .download-text small  { font-size: 0.68rem; }

  /* Botão de ativação laranja */
  .download-btn.activation {
    height: 64px;
    min-height: 64px;
    max-height: 64px;
    padding: 6px 12px;
    gap: 10px;
  }
  .download-btn.activation .download-logo {
    width: 38px;
    height: 38px;
  }
  .download-btn.activation .download-text strong {
    font-size: 0.82rem;
    line-height: 1.2;
  }
  .download-btn.activation .download-text small { font-size: 0.66rem; }

  /* Campo M3U mais compacto */
  #playlistM3uUrl {
    min-height: 38px;
    max-height: 50px;
    font-size: 0.75rem;
  }

  /* Input + botão copiar: empilha em telas muito estreitas */
  .copy-input-group {
    flex-direction: column;
    gap: 6px;
  }
  .copy-input-group .small-btn {
    align-self: flex-end;
    padding: 5px 10px;
    font-size: 0.8rem;
  }
}

/* Celulares pequenos (até 420px) */
@media (max-width: 420px) {
  /* Servidor/Usuário/Senha empilham em 1 coluna */
  .server-info-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .server-info-field {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .server-info-field small { font-size: 0.62rem; }
  .credential-line {
    flex: 1;
    justify-content: flex-end;
  }

  /* Botões de download mais baixos */
  .download-btn,
  .download-links .download-btn {
    height: 58px;
    padding: 6px 10px;
    gap: 8px;
    border-radius: 8px;
  }
  .download-btn .download-icon {
    width: 34px;
    font-size: 1.25rem;
  }
  .download-btn .download-text strong { font-size: 0.8rem; }
  .download-btn .download-text small  { font-size: 0.64rem; margin-top: 1px; }

  /* Botão ativação */
  .download-btn.activation {
    height: 58px;
    min-height: 58px;
    max-height: 58px;
    padding: 4px 10px;
  }
  .download-btn.activation .download-logo {
    width: 34px;
    height: 34px;
  }
  .download-btn.activation .download-text strong { font-size: 0.78rem; }
  .download-btn.activation .download-text small  { font-size: 0.62rem; }

  /* Botão copiar Downloader ocupa 100% da largura */
  .copy-input-group .small-btn {
    align-self: stretch;
    text-align: center;
  }
}