/* ============================================================
   Gestão de Promoter — Retrô Anos Incríveis
   Visual baseado no site retroanosincriveis.com.br (v2)
   ============================================================ */
:root {
  --bg: #F7F4EF; --bg-alt: #EFE9DF; --card: #FFFFFF; --ph: #E6DFD3;
  --ink: #141414; --ink-2: #3A352F; --muted: #5E574E; --faint: #6F675C;
  --line: #E2D8C6; --gold-line: #E0D0AE;
  --gold: #A8761F; --gold-text: #8C6219; --gold-bright: #C9A04A;
  --accent: #C4122F; --accent-hover: #A30E26; --plum: #8E1F6E;
  --green: #1E7B45; --blue: #2B5C8A;
  --foot: #111111; --foot-line: #2A2A2A; --foot-muted: #C9BFA9;
  --display: 'Bungee', sans-serif; --script: 'Yellowtail', cursive;
  --body: 'DM Sans', system-ui, sans-serif;
  --radius: 16px; --header-h: 118px; --footer-h: 44px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body);
  font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased;
  padding-top: var(--header-h); padding-bottom: calc(var(--footer-h) + 24px); min-height: 100vh;
}
a { color: var(--gold-text); text-decoration: none; }
a:hover { color: #6B4A10; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--gold-bright); outline-offset: 2px; border-radius: 6px; }
.wrap { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 20px; }
@media (min-width: 768px) { .wrap { padding: 0 32px; } }

/* ---------- HEADER FIXO ---------- */
.app-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(247,244,239,.95); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.app-header .top { height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand img { width: 48px; height: 48px; object-fit: contain; }
.brand-name { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name b { font-family: var(--display); font-weight: 400; font-size: 17px; letter-spacing: 1px; }
.brand-name span { font-size: 11px; letter-spacing: 3px; color: var(--gold-text); font-weight: 700; text-transform: uppercase; }
.user-box { display: flex; align-items: center; gap: 12px; }
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: #F1D48A;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem;
}
.user-meta { display: none; line-height: 1.2; }
.user-meta b { display: block; font-size: .85rem; }
.user-meta small { color: var(--muted); font-size: .75rem; }
@media (min-width: 900px) { .user-meta { display: block; } }
.logout-btn {
  border: 1px solid var(--gold-line); background: transparent; color: var(--ink); border-radius: 999px;
  padding: 7px 14px; font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer;
}
.logout-btn:hover { border-color: var(--accent); color: var(--accent); }
.menu-btn {
  width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--gold-line); background: transparent;
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink);
}
.main-nav { display: flex; gap: 4px; height: 48px; align-items: center; overflow-x: auto; scrollbar-width: none; border-top: 1px solid var(--line); }
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a {
  display: inline-flex; align-items: center; gap: 5px; padding: 7px 11px; border-radius: 999px;
  color: var(--ink-2); font-weight: 500; font-size: .86rem; white-space: nowrap;
}
.main-nav a:hover { background: var(--bg-alt); color: var(--ink); }
.main-nav a.active { background: var(--ink); color: #F7F4EF; }
.main-nav .sep { width: 1px; height: 22px; background: var(--line); margin: 0 6px; flex-shrink: 0; }
@media (max-width: 899px) {
  :root { --header-h: 70px; }
  .main-nav { display: none; position: absolute; top: 70px; left: 0; right: 0; height: auto; flex-direction: column;
    align-items: stretch; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 12px 14px; box-shadow: 0 20px 40px rgba(0,0,0,.08); }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px 14px; border-radius: 12px; font-size: 1rem; }
  .main-nav .sep { width: auto; height: 1px; margin: 6px 0; }
}
@media (min-width: 900px) { .menu-btn { display: none; } }

/* ---------- FOOTER FIXO ---------- */
.app-footer {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 90; height: var(--footer-h);
  background: var(--foot); border-top: 3px solid var(--gold-bright); color: var(--foot-muted);
  display: flex; align-items: center; justify-content: center; font-size: .8rem; letter-spacing: .3px; text-align: center; padding: 0 12px;
}
.app-footer a { color: var(--gold-bright); }

/* ---------- PAGE HEAD ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; padding: 26px 0 20px; }
.page-head .eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 3px; color: var(--gold-text); text-transform: uppercase; }
.page-title { margin: 2px 0 0; font-family: var(--display); font-weight: 400; font-size: clamp(26px, 3.4vw, 38px); line-height: 1.05; }
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.script { font-family: var(--script); color: var(--gold); }

/* ---------- FLASH ---------- */
.flash { padding: 12px 16px; border-radius: 14px; margin-bottom: 18px; font-weight: 500; display: flex; gap: 10px; align-items: center; border: 1px solid; }
.flash-success { background: #EAF5EE; border-color: #B9DEC6; color: var(--green); }
.flash-error   { background: #FBEAEC; border-color: #F0B9C1; color: var(--accent); }
.flash-info    { background: #EAF1F8; border-color: #BCD0E4; color: var(--blue); }

/* ---------- STAT CARDS ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-bottom: 22px; }
.stat-card { background: var(--card); border: 1px solid var(--gold-line); border-radius: var(--radius); padding: 16px 18px; position: relative; overflow: hidden; }
.stat-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--gold-bright); }
.stat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1.5px; font-weight: 700; }
.stat-value { font-family: var(--display); font-size: clamp(19px, 1.75vw, 24px); line-height: 1.25; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-sub { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.sc-gold::before  { background: var(--gold-bright); } .sc-gold .stat-value  { color: var(--gold-text); }
.sc-red::before   { background: var(--accent); }      .sc-red .stat-value   { color: var(--accent); }
.sc-green::before { background: var(--green); }       .sc-green .stat-value { color: var(--green); }
.sc-plum::before  { background: var(--plum); }        .sc-plum .stat-value  { color: var(--plum); }
.sc-ink::before   { background: var(--ink); }

/* ---------- CARDS / TABLES ---------- */
.card { background: var(--card); border: 1px solid var(--gold-line); border-radius: var(--radius); overflow: hidden; margin-bottom: 18px; }
.card-header { padding: 14px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-title { font-family: var(--display); font-weight: 400; font-size: 1.05rem; letter-spacing: .5px; margin: 0; }
.card-body { padding: 20px; }
.grid-2 { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 1000px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.grid-2 > .card { margin-bottom: 0; }
.table-wrap { width: 100%; overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data-table th {
  padding: 10px 14px; text-align: left; font-size: 11px; color: var(--muted); text-transform: uppercase;
  letter-spacing: 1px; font-weight: 700; background: var(--bg); white-space: nowrap; border-bottom: 1px solid var(--line);
}
table.data-table td { padding: 11px 14px; border-bottom: 1px solid #F0EAE0; vertical-align: middle; }
table.data-table tbody tr:last-child td { border-bottom: none; }
table.data-table tbody tr:hover { background: #FCFAF6; }
table.data-table tfoot td { background: var(--bg); font-weight: 700; padding: 11px 14px; border-top: 1px solid var(--line); }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
th.num { text-align: right; }
.sort-link { color: var(--muted); }
.sort-link.active, .sort-link:hover { color: var(--ink); }
.sort-idle { opacity: .45; }
.name-link { color: var(--ink); font-weight: 600; }
.name-link:hover { color: var(--accent); }

/* ---------- FORMS ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form-group.full { grid-column: 1 / -1; }
label, .label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.hint { font-size: .78rem; color: var(--faint); }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=number],
input[type=password], input[type=search], select, textarea {
  background: #fff; border: 1px solid var(--gold-line); color: var(--ink); padding: 10px 12px; border-radius: 10px;
  font: inherit; font-size: .92rem; outline: none; width: 100%; transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold-bright); box-shadow: 0 0 0 3px rgba(201,160,74,.18); }
textarea { resize: vertical; min-height: 80px; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 18px; }
.filters .form-group { min-width: 190px; flex: 0 1 260px; }
.seg { display: inline-flex; background: #fff; border: 1px solid var(--gold-line); border-radius: 999px; padding: 4px; gap: 2px; flex-wrap: wrap; }
.seg a, .seg label.seg-opt { padding: 7px 16px; border-radius: 999px; color: var(--ink-2); font-weight: 600; font-size: .86rem; text-transform: none; letter-spacing: 0; cursor: pointer; }
.seg a.active, .seg input:checked + span { background: var(--ink); color: #F7F4EF; }
.seg label.seg-opt { padding: 0; }
.seg label.seg-opt span { display: block; padding: 7px 16px; border-radius: 999px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }

/* chips (áreas) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; }
.chip span {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--gold-line);
  background: #fff; cursor: pointer; font-size: .88rem; font-weight: 500; user-select: none; color: var(--ink-2); text-transform: none; letter-spacing: 0;
}
.chip input:checked + span { background: var(--ink); border-color: var(--ink); color: #F7F4EF; }
.chip input:focus-visible + span { outline: 3px solid var(--gold-bright); outline-offset: 2px; }
.area-tag { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--bg-alt); color: var(--ink-2); font-size: .76rem; margin: 1px 2px 1px 0; white-space: nowrap; }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 20px;
  border-radius: 999px; font-weight: 700; font-size: .9rem; font-family: var(--body); cursor: pointer;
  border: 1.5px solid transparent; transition: background .2s, border-color .2s, color .2s; white-space: nowrap; text-decoration: none;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--gold-line); }
.btn-secondary:hover { border-color: var(--ink); color: var(--ink); }
.btn-dark { background: var(--ink); color: #F7F4EF; }
.btn-dark:hover { background: #333; color: #fff; }
.btn-danger { background: #fff; color: var(--accent); border-color: #F0B9C1; }
.btn-danger:hover { background: #FBEAEC; color: var(--accent); }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #17633A; color: #fff; }
.btn-wa { background: #25D366; color: #07240F; }
.btn-wa:hover { background: #1FB957; color: #07240F; }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: .8rem; }
.btn-icon { min-height: 32px; width: 32px; padding: 0; }
.btn[disabled], .btn.disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }
.inline-form { display: inline; margin: 0; }
.actions { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; }

/* ---------- BADGES ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; white-space: nowrap; }
.badge-green { background: #E3F3E9; color: var(--green); }
.badge-red   { background: #FBE6E9; color: var(--accent); }
.badge-gold  { background: #F6ECD5; color: var(--gold-text); }
.badge-plum  { background: #F4E3EF; color: var(--plum); }
.badge-blue  { background: #E4EDF6; color: var(--blue); }
.badge-gray  { background: var(--bg-alt); color: var(--muted); }
.badge-ink   { background: var(--ink); color: #F1D48A; }

/* ---------- MISC ---------- */
.text-green { color: var(--green); } .text-red { color: var(--accent); } .text-gold { color: var(--gold-text); }
.text-plum { color: var(--plum); } .text-muted { color: var(--muted); } .text-right { text-align: right; }
.fw-600 { font-weight: 600; } .small { font-size: .82rem; }
.flex-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.divider { border: none; border-top: 1px solid var(--line); margin: 20px 0; }
.empty-state { text-align: center; padding: 44px 16px; color: var(--muted); }
.empty-state .emo { font-size: 2.2rem; margin-bottom: 8px; }
.info-grid { display: flex; flex-wrap: wrap; gap: 26px; }
.info-grid .label { display: block; margin-bottom: 2px; }

/* paginação */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); font-size: .85rem; color: var(--muted); }
.pager .pages { display: flex; gap: 4px; flex-wrap: wrap; }
.pager a, .pager span.cur { min-width: 34px; height: 34px; padding: 0 10px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--gold-line); color: var(--ink); font-weight: 600; }
.pager span.cur { background: var(--ink); color: #F7F4EF; border-color: var(--ink); }
.pager a:hover { border-color: var(--ink); }

/* ranking */
.rank-list { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.rank-item { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; align-items: center; gap: 14px; }
.rank-item:hover { border-color: var(--gold-bright); }
.rank-item.top1 { border-color: var(--gold-bright); background: #FFFBF1; }
.rank-pos { font-family: var(--display); font-size: 1.5rem; width: 2.6rem; text-align: center; flex-shrink: 0; color: var(--muted); }
.rank-item.top .rank-pos { color: var(--gold); }
.rank-main { flex: 1; min-width: 0; }
.rank-name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.rank-bar-bg { background: var(--bg-alt); border-radius: 4px; height: 8px; overflow: hidden; }
.rank-bar { height: 100%; background: linear-gradient(90deg, var(--gold-bright), var(--gold)); border-radius: 4px; }
.rank-stats { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 6px; font-size: .8rem; color: var(--muted); }
.rank-stats b { color: var(--ink); }
.rank-big { font-family: var(--display); font-size: 1.8rem; color: var(--ink); text-align: right; line-height: 1; flex-shrink: 0; }
.rank-big small { display: block; font-family: var(--body); font-size: .68rem; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }
@media (max-width: 640px) { .rank-big { display: none; } .rank-item { align-items: flex-start; } }

/* setores e lotes */
.setor-box { background: var(--bg); border: 1px solid var(--gold-line); border-radius: 14px; padding: 16px; margin-bottom: 12px; }
.setor-top { display: flex; gap: 12px; align-items: flex-end; margin-bottom: 12px; flex-wrap: wrap; }
.setor-top .form-group { flex: 1 1 220px; }
.lotes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.lote-box { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; position: relative; }
.lote-box .lote-head { display: flex; align-items: center; gap: 6px; }
.lote-box .lote-head input { font-weight: 700; color: var(--gold-text); padding: 6px 8px; }
.lote-add { border: 1.5px dashed var(--gold-line); border-radius: 12px; background: transparent; color: var(--gold-text); font: inherit; font-weight: 700; cursor: pointer; min-height: 120px; }
.lote-add:hover { border-color: var(--gold); background: #fff; }
.lock-note { font-size: .74rem; color: var(--faint); }

/* resumo (pagamentos/retiradas) */
.summary-box { background: var(--bg); border: 1px solid var(--gold-line); border-radius: 14px; padding: 16px; }
.summary-box .info-grid .big { font-family: var(--display); font-size: 1.5rem; }

/* gráfico */
.chart-box { position: relative; height: 360px; }
.legend-note { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: .82rem; color: var(--muted); margin-top: 10px; }
.legend-note i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 6px; }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 96px 1fr auto; gap: 12px; padding: 10px 20px; border-bottom: 1px solid #F0EAE0; align-items: center; font-size: .9rem; }
.timeline li:last-child { border-bottom: none; }
.timeline .when { color: var(--muted); font-variant-numeric: tabular-nums; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: 0; }

/* print-only */
.print-only { display: none; }

/* ---------- LOGIN ---------- */
body.login-page { padding: 0; display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box { background: #fff; border: 1px solid var(--gold-line); border-radius: 24px; padding: 36px 30px; width: calc(100% - 32px); max-width: 400px; box-shadow: 0 24px 60px rgba(120,90,30,.14); }
.login-box .brand { justify-content: center; margin-bottom: 6px; }
.login-box .brand img { width: 64px; height: 64px; }
.login-box h1 { font-family: var(--display); font-weight: 400; text-align: center; font-size: 1.4rem; margin: 18px 0 2px; }
.login-box .sub { text-align: center; color: var(--muted); font-size: .9rem; margin-bottom: 18px; }
.login-box .form-group { margin-top: 14px; }
.login-box .btn { width: 100%; margin-top: 22px; min-height: 48px; }

/* ============================================================
   IMPRESSÃO — folha A4 com fundo branco (não é print da tela)
   ============================================================ */
@media print {
  @page { size: A4; margin: 12mm 10mm 14mm; }
  :root { --radius: 8px; }
  html, body { background: #fff !important; color: #000; }
  body { padding: 0 !important; font-size: 10.5pt; min-height: 0; }
  .app-header, .app-footer, .no-print, .page-actions, .filters, .btn, .pager, .seg, .flash, .inline-form { display: none !important; }
  .print-only { display: block !important; }
  .wrap { max-width: none; padding: 0; }
  .page-head { padding: 0 0 8px; }
  .print-head { display: flex !important; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 2px solid #000; padding-bottom: 8px; margin-bottom: 12px; }
  .print-head .brand img { width: 40px; height: 40px; }
  .print-head .meta { text-align: right; font-size: 9pt; color: #333; }
  .print-foot { display: block !important; position: fixed; bottom: 0; left: 0; right: 0; text-align: center; font-size: 8pt; color: #555; }
  .card, .stat-card, .rank-item, .summary-box, .setor-box { background: #fff !important; border: 1px solid #bbb !important; box-shadow: none !important; break-inside: avoid; }
  .card { margin-bottom: 10px; }
  .stat-grid { grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 10px; }
  .stat-card { padding: 8px 10px; }
  .stat-card::before { display: none; }
  .stat-value { font-size: 13pt; color: #000 !important; }
  .stat-label, .stat-sub { color: #333; }
  .grid-2 { grid-template-columns: 1fr 1fr; gap: 10px; }
  table.data-table { font-size: 9pt; }
  table.data-table th { background: #eee !important; color: #000; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  table.data-table td, table.data-table th { padding: 5px 8px; }
  table.data-table tbody tr:hover { background: none; }
  .badge { border: 1px solid #999; background: #fff !important; color: #000 !important; }
  a { color: #000 !important; }
  .chart-box { height: 230px; }
  .page-head { display: none; }
  canvas { max-width: 100% !important; }
  .text-green, .text-red, .text-gold, .text-plum { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .page-break { break-before: page; }
}
@media (max-width: 480px) {
  .brand-name span { letter-spacing: 1.5px; font-size: 10px; }
  .brand img { width: 40px; height: 40px; }
}

/* ---------- LISTA AGRUPADA (retiradas) ---------- */
table.grouped tbody.grupo .grupo-item { display: none; }
table.grouped tbody.grupo.open .grupo-item { display: table-row; }
table.grouped .grupo-head { cursor: pointer; background: #FCFAF6; }
table.grouped .grupo-head:hover { background: #F6F0E4; }
table.grouped .grupo-head td { border-bottom: 1px solid var(--line); }
table.grouped tbody.grupo.open .grupo-head { background: #F6ECD5; }
table.grouped .caret { display: inline-block; width: 14px; color: var(--gold); transition: transform .15s; }
table.grouped tbody.grupo.open .caret { transform: rotate(90deg); }
table.grouped .grupo-item td { background: #fff; font-size: .86rem; }
@media print { table.grouped tbody.grupo .grupo-item { display: table-row; } }

/* ---------- PERMISSÕES ---------- */
.perm-table td, .perm-table th { vertical-align: middle; }
.perm-table select { max-width: 260px; }
.role-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.role-card { position: relative; }
.role-card input { position: absolute; opacity: 0; }
.role-card span { display: block; border: 1.5px solid var(--gold-line); border-radius: 14px; padding: 14px 16px; background: #fff; cursor: pointer; text-transform: none; letter-spacing: 0; font-size: .9rem; font-weight: 400; color: var(--ink-2); }
.role-card span b { display: block; font-size: 1rem; color: var(--ink); margin-bottom: 2px; }
.role-card input:checked + span { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink) inset; background: #FFFBF1; }
.role-card input:focus-visible + span { outline: 3px solid var(--gold-bright); outline-offset: 2px; }
.perm-chips { display: flex; flex-wrap: wrap; gap: 4px; }

/* ---------- FAIXAS DE COMISSÃO (tudo numa linha) ---------- */
.comissao-faixa { display: grid; grid-template-columns: 110px 130px 130px minmax(160px, 1fr) auto; gap: 10px; align-items: end; margin-bottom: 10px; }
.comissao-faixa .form-group { min-width: 0; }
.comissao-faixa + .comissao-faixa label { display: none; }   /* título só na 1ª linha */
@media (max-width: 640px) {
  .comissao-faixa { grid-template-columns: 1fr 1fr 1fr auto; }
  .comissao-faixa .form-group:nth-child(4) { grid-column: 1 / 4; grid-row: 2; }
  .comissao-faixa + .comissao-faixa label { display: block; }
  .comissao-faixa { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
}

tr.grupo-item.is-dev td { background: #F4FAF6; }

/* botão do manual */
.help-btn { text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.help-btn:hover { border-color: var(--gold); color: var(--gold-text); }
@media (max-width: 480px) { .help-btn span { display: none; } .user-avatar { display: none; } }
