/* =====================================================================
   4face.cash - Design System (painel)
   Laranja = marca (acento, <=10%); verde = dinheiro; teal = apoio da marca.
   Sidebar CLARA. Estetica fintech: limpa, profissional, confiavel.
   ===================================================================== */

:root {
  --brand: #FF4D00;
  --brand-ink: #cc3d00;
  --brand-soft: #fff1ea;
  --teal: #16816A;          /* verde-azulado da logo (".cash") */
  --teal-soft: #e4f3ef;
  --money: #00B25C;
  --money-bg: #D8F5E4;
  --money-ink: #00713A;
  --ink: #1b1a1f;
  --ink-soft: #55535e;
  --danger: #E4392B;
  --danger-bg: #fdecea;
  --warn: #b7791f;
  --warn-bg: #fdf3e2;

  --bg: #f5f6f8;
  --surface: #ffffff;
  --border: #e9e9ee;
  --line: #f0f0f4;
  --muted: #7b7b85;
  --muted-2: #a3a3ad;

  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 1px 2px rgba(23,20,25,.04), 0 6px 20px rgba(23,20,25,.05);
  --shadow-lg: 0 16px 48px rgba(23,20,25,.14);

  --font: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Bricolage Grotesque', var(--font);
  --sidebar-w: 256px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; color: var(--ink); margin: 0 0 .4em; letter-spacing: -.015em; }
.material-icons-round { font-size: 20px; line-height: 1; vertical-align: middle; }

/* Marca em texto: "4face.cash" (fallback quando nao usa imagem) */
.brand-word { font-family: var(--font-display); font-weight: 800; letter-spacing: -.02em; color: var(--brand); }
.brand-word .cash { color: var(--teal); }
.brand-word .dot { color: var(--brand); }

/* --------------------------------------------------------------------- */
/* App shell                                                              */
/* --------------------------------------------------------------------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: var(--surface); color: var(--ink-soft);
  display: flex; flex-direction: column; padding: 18px 14px;
  position: fixed; inset: 0 auto 0 0; z-index: 50; border-right: 1px solid var(--border);
}
.sidebar .logo { display: flex; align-items: center; padding: 6px 8px; }
.sidebar .logo img { width: 100%; max-width: 100%; }
.sidebar .logo .brand-word { font-size: 22px; }
.sidebar nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.sidebar nav .nav-group { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-2); padding: 14px 12px 6px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px;
  color: var(--ink-soft); font-weight: 500; font-size: 14.5px; transition: .15s;
}
.sidebar nav a .material-icons-round { font-size: 21px; color: var(--muted); transition: .15s; }
.sidebar nav a:hover { background: var(--bg); color: var(--ink); }
.sidebar nav a:hover .material-icons-round { color: var(--ink-soft); }
.sidebar nav a.active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.sidebar nav a.active .material-icons-round { color: var(--brand); }
.sidebar .nav-sep { height: 1px; background: var(--border); margin: 12px 8px; }
.sidebar .side-foot { border-top: 1px solid var(--border); padding: 12px 10px 4px; font-size: 12px; color: var(--muted-2); }
.sidebar .side-foot b { color: var(--ink-soft); font-weight: 600; }

.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(23,20,25,.4); z-index: 49; }

.app-main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }
.app-topbar {
  height: 66px; display: flex; align-items: center; gap: 14px; padding: 0 28px;
  background: rgba(255,255,255,.85); backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30;
}
.topbar-title { font-size: 19px; font-weight: 700; margin: 0; flex: 1; font-family: var(--font-display); letter-spacing: -.015em; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px; border: none; background: transparent;
  color: var(--ink-soft); cursor: pointer; transition: .15s;
}
.btn-icon:hover { background: var(--bg); color: var(--ink); }

/* Seletor de evento ativo (topbar) */
.event-switch {
  display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 6px 0 11px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border); max-width: 260px;
}
.event-switch:hover { border-color: var(--brand); }
.event-switch > .material-icons-round { font-size: 18px; color: var(--brand); flex-shrink: 0; }
.event-switch select {
  border: 0; background: transparent; outline: none; cursor: pointer;
  font-size: 13.5px; font-weight: 600; color: var(--ink);
  max-width: 210px; text-overflow: ellipsis; padding: 0 4px;
}
@media (max-width: 640px) { .event-switch { max-width: 150px; } .event-switch select { max-width: 108px; } }

/* Seletor de idioma */
.lang-switch { display: inline-flex; gap: 2px; font-size: 12px; font-weight: 700; }
.lang-switch a { padding: 5px 8px; border-radius: 8px; color: var(--muted); }
.lang-switch a:hover { color: var(--ink); }
.lang-switch a.active { background: var(--bg); color: var(--ink); }

/* Menu do usuario */
.user-menu { position: relative; }
.user-chip { display: flex; align-items: center; gap: 9px; background: none; border: 0; cursor: pointer; padding: 4px 8px 4px 5px; border-radius: 999px; transition: .15s; }
.user-chip:hover { background: var(--bg); }
.user-chip .caret { font-size: 18px; color: var(--muted); transition: transform .2s ease; }
.user-menu:has(.user-dropdown.open) .caret { transform: rotate(180deg); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), #ff7a40); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; letter-spacing: .01em; }
.user-name { font-size: 14px; font-weight: 600; }

/* Dropdown do usuario */
.user-dropdown { position: absolute; right: 0; top: calc(100% + 10px); display: none; z-index: 60; }
.user-dropdown.open { display: block; }
.ud-scrim { display: none; }
.ud-grip { display: none; }
.ud-panel {
  width: 288px; background: #fff; border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-lg); padding: 8px; overflow: hidden; transform-origin: top right;
}
.user-dropdown.open .ud-panel { animation: udIn .17s cubic-bezier(.2,.85,.25,1); }
@keyframes udIn { from { opacity: 0; transform: translateY(-8px) scale(.97); } to { opacity: 1; transform: none; } }

.ud-head {
  display: flex; align-items: center; gap: 12px; padding: 13px 12px; margin-bottom: 6px;
  border-radius: 12px; background: linear-gradient(135deg, var(--brand-soft) 0%, #fff 72%);
}
.ud-avatar { width: 42px; height: 42px; font-size: 15px; box-shadow: 0 5px 14px rgba(226,62,0,.28); }
.ud-head-txt { min-width: 0; }
.ud-head .n { font-weight: 700; font-size: 14.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ud-head .e { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ud-list { display: flex; flex-direction: column; gap: 2px; }
.ud-item {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 11px;
  font-size: 14px; color: var(--ink); font-weight: 500; cursor: pointer;
  transition: background .14s, color .14s;
}
.ud-item:hover { background: var(--bg); }
.ud-ic {
  width: 30px; height: 30px; border-radius: 9px; background: var(--bg); color: var(--ink-soft);
  display: flex; align-items: center; justify-content: center; font-size: 19px; flex-shrink: 0;
  transition: background .14s, color .14s;
}
.ud-item:hover .ud-ic { background: var(--brand-soft); color: var(--brand); }
.ud-item.danger { color: var(--danger); }
.ud-item.danger .ud-ic { background: var(--danger-bg); color: var(--danger); }
.ud-item.danger:hover { background: var(--danger-bg); }
.ud-item.exit-imp { color: var(--brand-ink); font-weight: 600; }
.ud-item.exit-imp .ud-ic { background: var(--brand-soft); color: var(--brand); }
.ud-item.exit-imp:hover { background: var(--brand-soft); }

.ud-sep { height: 1px; background: var(--line); margin: 6px 6px; }

/* Personificacao: seletor de organizador dentro do menu do usuario */
.ud-imp { padding: 4px 6px 2px; }
.ud-imp label { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.ud-imp label .material-icons-round { font-size: 16px; color: var(--brand); }
.ud-select { position: relative; }
.ud-select::after {
  content: 'expand_more'; font-family: 'Material Icons Round'; font-size: 20px;
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none;
}
.ud-imp select {
  width: 100%; border: 1px solid var(--border); border-radius: 11px; padding: 10px 34px 10px 12px;
  font-size: 13.5px; font-weight: 500; color: var(--ink); background: var(--surface); cursor: pointer;
  appearance: none; -webkit-appearance: none; transition: border-color .14s, box-shadow .14s;
}
.ud-imp select:hover { border-color: var(--brand); }
.ud-imp select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

/* Mobile: dropdown vira bottom sheet */
@media (max-width: 560px) {
  .user-dropdown { position: fixed; inset: 0; top: 0; right: 0; }
  .ud-scrim { display: block; position: fixed; inset: 0; background: rgba(23,20,25,.45); animation: udScrim .2s ease; }
  @keyframes udScrim { from { opacity: 0; } to { opacity: 1; } }
  .ud-panel {
    position: fixed; left: 0; right: 0; bottom: 0; width: auto; border: 0;
    border-radius: 22px 22px 0 0; padding: 8px 14px calc(16px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -16px 48px rgba(23,20,25,.24);
  }
  .user-dropdown.open .ud-panel { animation: udSheet .26s cubic-bezier(.2,.85,.25,1); }
  @keyframes udSheet { from { transform: translateY(100%); } to { transform: none; } }
  .ud-grip { display: block; width: 42px; height: 4px; border-radius: 999px; background: var(--border); margin: 4px auto 12px; }
  .ud-head { margin-bottom: 8px; }
  .ud-item { padding: 13px 10px; font-size: 15px; }
  .ud-ic { width: 34px; height: 34px; font-size: 21px; }
}

/* Banner fixo indicando que o super esta navegando como organizador */
.imp-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 28px; color: #fff; font-size: 13.5px; font-weight: 500;
  background: linear-gradient(100deg, #FF4D00 0%, #FF6321 45%, #2C8F6F 100%);
  box-shadow: 0 6px 18px rgba(226,62,0,.18);
}
.imp-banner .material-icons-round { font-size: 20px; }
.imp-banner .imp-txt { flex: 1; }
.imp-banner .imp-txt strong { font-weight: 700; }
.imp-banner .imp-exit {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 10px; font-weight: 600; font-size: 13px;
  color: #fff; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.35);
  transition: .16s; white-space: nowrap;
}
.imp-banner .imp-exit:hover { background: rgba(255,255,255,.3); }
.imp-banner .imp-exit .material-icons-round { font-size: 17px; }

.app-content { padding: 28px; flex: 1; max-width: 1320px; width: 100%; }

/* --------------------------------------------------------------------- */
/* Cabecalho de pagina                                                    */
/* --------------------------------------------------------------------- */
.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 24px; }
.page-head .sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.page-head .spacer { flex: 1; }

/* --------------------------------------------------------------------- */
/* Botoes                                                                 */
/* --------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font); font-weight: 600; font-size: 14.5px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 10px 17px; cursor: pointer; transition: .15s; text-decoration: none;
  background: var(--bg); color: var(--ink);
}
.btn:hover { filter: brightness(.98); }
.btn:disabled, .btn.disabled { opacity: .55; cursor: not-allowed; }
.btn .material-icons-round { font-size: 19px; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(255,77,0,.22); }
.btn-primary:hover { background: var(--brand-ink); filter: none; }
.btn-ghost { background: #fff; border-color: var(--border); color: var(--ink); }
.btn-ghost:hover { background: var(--bg); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-danger { background: #fff; border-color: #f6c9c4; color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); }
.btn-money { background: var(--money); color: #fff; box-shadow: 0 6px 16px rgba(0,178,92,.22); }
.btn-money:hover { background: var(--money-ink); filter: none; }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 22px; font-size: 16px; border-radius: 12px; }
.btn-xl { padding: 20px 26px; font-size: 20px; border-radius: 14px; }
.btn-sm { padding: 7px 12px; font-size: 13px; }

/* --------------------------------------------------------------------- */
/* Cards, estatisticas, badges                                            */
/* --------------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 22px; }
.card h3 { font-size: 16px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.stat { display: flex; align-items: center; gap: 15px; padding: 20px; }
.stat .ic { width: 48px; height: 48px; border-radius: 13px; background: var(--bg); color: var(--ink-soft); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat .ic .material-icons-round { font-size: 24px; }
.stat .ic.money { background: var(--money-bg); color: var(--money-ink); }
.stat .ic.brand { background: var(--brand-soft); color: var(--brand); }
.stat .ic.teal { background: var(--teal-soft); color: var(--teal); }
.stat .num { font-size: 26px; font-weight: 800; font-family: var(--font-display); line-height: 1.1; letter-spacing: -.02em; }
.stat .lbl { font-size: 13px; color: var(--muted); font-weight: 500; }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 4px 11px; border-radius: 999px; background: #eef0f4; color: var(--ink-soft); }
.badge-money { background: var(--money-bg); color: var(--money-ink); }
.badge-brand { background: var(--brand-soft); color: var(--brand-ink); }
.badge-teal { background: var(--teal-soft); color: var(--teal); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }

/* Valor monetario */
.money { color: var(--money-ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.money-lg { font-size: 30px; }
.money-xl { font-size: 46px; font-weight: 800; }

/* --------------------------------------------------------------------- */
/* Formularios                                                            */
/* --------------------------------------------------------------------- */
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin: 0 0 6px; }
.form-control {
  width: 100%; font-family: var(--font); font-size: 14.5px; color: var(--ink);
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 14px; transition: .15s;
}
.form-control:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255,77,0,.12); }
.form-control::placeholder { color: var(--muted-2); }
.form-field { margin-bottom: 16px; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237b7b85' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }

/* --------------------------------------------------------------------- */
/* Tabelas                                                                */
/* --------------------------------------------------------------------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; padding: 12px 14px; border-bottom: 1px solid var(--border); background: #fbfbfd; }
.table th:first-child { border-top-left-radius: var(--radius); }
.table th:last-child { border-top-right-radius: var(--radius); }
.table td { padding: 13px 14px; border-bottom: 1px solid var(--line); }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover td { background: #fafafe; }
.card-pad > .table { margin: -4px 0; }

/* --------------------------------------------------------------------- */
/* Estados, alertas, grids                                                */
/* --------------------------------------------------------------------- */
.empty { text-align: center; color: var(--muted); padding: 48px 20px; }
.empty .material-icons-round { font-size: 46px; color: var(--muted-2); display: block; margin-bottom: 8px; }

.alert { border-radius: var(--radius-sm); padding: 13px 16px; font-size: 14px; margin-bottom: 16px; }
.alert-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid #f6c9c4; }
.alert-money { background: var(--money-bg); color: var(--money-ink); }
.alert-brand { background: var(--brand-soft); color: var(--brand-ink); border: 1px solid rgba(255,77,0,.2); }
.alert-warn { background: var(--warn-bg); color: var(--warn); border: 1px solid #f0dcb0; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 820px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.text-muted { color: var(--muted); }
.text-danger { color: var(--danger); }
.mt-0{margin-top:0}.mt-1{margin-top:8px}.mt-2{margin-top:16px}.mt-3{margin-top:24px}
.mb-0{margin-bottom:0}.mb-1{margin-bottom:8px}.mb-2{margin-bottom:16px}.mb-3{margin-bottom:24px}
.flex{display:flex}.items-center{align-items:center}.gap-1{gap:8px}.gap-2{gap:16px}.spacer{flex:1}

/* --------------------------------------------------------------------- */
/* Responsivo                                                             */
/* --------------------------------------------------------------------- */
.mobile-only { display: none; }
@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s; }
  .app-shell.sidebar-open .sidebar, .sidebar.open { transform: none; }
  .app-shell.sidebar-open .sidebar-backdrop { display: block; }
  .app-main { margin-left: 0; }
  .mobile-only { display: inline-flex; }
  .app-content { padding: 18px; }
  .app-topbar { padding: 0 16px; }
}

/* --------------------------------------------------------------------- */
/* Auth (login staff)                                                     */
/* --------------------------------------------------------------------- */
.auth-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background:
    radial-gradient(1100px 520px at 85% -10%, rgba(255,77,0,.10), transparent),
    radial-gradient(900px 520px at -10% 110%, rgba(22,129,106,.12), transparent),
    var(--bg);
}
.auth-card { width: 100%; max-width: 410px; background: #fff; border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow-lg); padding: 36px 32px; }
.auth-logo { display: flex; justify-content: center; margin-bottom: 6px; }
.auth-logo img { height: 52px; }
.auth-logo .brand-word { font-size: 32px; }
.auth-card h1 { font-size: 22px; text-align: center; margin: 16px 0 4px; }
.auth-sub { text-align: center; color: var(--muted); font-size: 14px; margin: 0 0 24px; }
.oauth-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; border: 1px solid var(--border); border-radius: 12px; padding: 12px; font-weight: 600; margin-bottom: 10px; background: #fff; transition: .15s; }
.oauth-btn:hover { background: var(--bg); }
.oauth-btn img { width: 18px; height: 18px; }
.auth-divider { text-align: center; color: var(--muted-2); font-size: 12px; margin: 18px 0; position: relative; }
.auth-divider::before, .auth-divider::after { content: ''; position: absolute; top: 50%; width: 40%; height: 1px; background: var(--border); }
.auth-divider::before { left: 0; } .auth-divider::after { right: 0; }
.auth-foot { text-align: center; font-size: 13px; color: var(--muted); margin-top: 18px; }
.auth-foot a { color: var(--brand-ink); font-weight: 600; }
.auth-resend-wait { color: var(--muted); }
.auth-resend-wait b { color: var(--ink); font-weight: 600; }
.code-inputs { display: flex; gap: 8px; justify-content: center; margin-bottom: 18px; }
.code-inputs input { width: 46px; height: 56px; text-align: center; font-size: 24px; font-weight: 700; border: 1px solid var(--border); border-radius: 12px; }
.code-inputs input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255,77,0,.12); }

/* --------------------------------------------------------------------- */
/* Erros                                                                  */
/* --------------------------------------------------------------------- */
.minimal-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg); }
.error-page { text-align: center; padding: 60px; }
.error-code { font-size: 84px; font-weight: 800; font-family: var(--font-display); color: var(--brand); }
.error-page p { color: var(--muted); margin: 6px 0 18px; }

/* --------------------------------------------------------------------- */
/* Drawer lateral (CRUD via AJAX)                                          */
/* --------------------------------------------------------------------- */
/* Acoes por linha de tabela */
.row-actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.btn-icon-sm { padding: 7px !important; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; }
.btn-icon-sm .material-icons-round { font-size: 19px; }

body.drawer-lock { overflow: hidden; }
.drawer { position: fixed; inset: 0; z-index: 1000; visibility: hidden; }
.drawer.open { visibility: visible; }
.drawer-scrim {
  position: absolute; inset: 0; background: rgba(23,20,25,.45);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  opacity: 0; transition: opacity .3s ease;
}
.drawer.open .drawer-scrim { opacity: 1; }
.drawer-panel {
  position: absolute; top: 0; right: 0; height: 100%; width: 580px; max-width: 94vw;
  display: flex; flex-direction: column; background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -24px 0 70px rgba(23,20,25,.24);
  transform: translateX(101%); transition: transform .34s cubic-bezier(.22,.61,.36,1);
}
.drawer.open .drawer-panel { transform: translateX(0); }

/* Cabecalho com acento em degrade da marca */
.drawer-head {
  position: relative; flex-shrink: 0; display: flex; align-items: flex-start; gap: 14px;
  padding: 24px 26px 20px; border-bottom: 1px solid var(--line);
}
.drawer-head::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--brand) 0%, #FF6321 45%, var(--teal) 100%);
}
.drawer-head-txt { flex: 1; min-width: 0; }
.drawer-eyebrow {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--brand-ink); background: var(--brand-soft); padding: 4px 10px; border-radius: 999px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.drawer-eyebrow .material-icons-round { font-size: 14px; }
.drawer-head h2 { margin: 10px 0 0; font-family: var(--font-display); font-size: 22px; letter-spacing: -.02em; line-height: 1.15; }
.drawer-x {
  flex-shrink: 0; width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--surface); color: var(--ink-soft); cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; transition: .15s;
}
.drawer-x:hover { background: var(--bg); color: var(--ink); }

/* Formulario ocupa o espaco restante como coluna flex (head fica fora do form;
   body-scroll + foot ficam dentro do form). min-height:0 permite o scroll interno. */
.drawer-form { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* Corpo rolavel */
.drawer-body-scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 22px 26px; }
.drawer-body-scroll .form-field { margin-bottom: 14px; }
.drawer-body-scroll .grid-2, .drawer-body-scroll .grid-3 { gap: 12px; }
.drawer-section {
  display: flex; align-items: center; gap: 8px; margin: 22px 0 12px;
  font-family: var(--font-display); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-soft);
}
.drawer-section::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.drawer-section .material-icons-round { font-size: 17px; color: var(--brand); }
.drawer-check { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--ink-soft); margin-top: 8px; cursor: pointer; }
.drawer-check input { width: 17px; height: 17px; accent-color: var(--brand); }

/* Rodape fixo com acoes */
.drawer-foot {
  flex-shrink: 0; display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 26px; border-top: 1px solid var(--line); background: var(--surface);
}
.drawer-foot .btn.is-loading { opacity: .7; pointer-events: none; }

/* Estados de carregamento / erro */
.drawer-loading, .drawer-error { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 40px; color: var(--muted); }
.drawer-error .material-icons-round { font-size: 40px; color: var(--muted-2); }
.drawer-spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: drawer-spin .7s linear infinite; }
@keyframes drawer-spin { to { transform: rotate(360deg); } }

@media (max-width: 600px) {
  .drawer-panel { width: 100vw; max-width: 100vw; }
  .drawer-head, .drawer-body-scroll, .drawer-foot { padding-left: 18px; padding-right: 18px; }
}

/* --------------------------------------------------------------------- */
/* Modal de QR Code (link de cadastro publico)                            */
/* --------------------------------------------------------------------- */
.qr-modal { text-align: center; padding: 4px 4px 6px; }
.qr-eyebrow {
  display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--brand-ink); background: var(--brand-soft); padding: 4px 12px; border-radius: 999px;
}
.qr-title { margin: 12px 0 2px; font-family: var(--font-display); font-size: 20px; letter-spacing: -.02em; color: var(--ink); }
.qr-desc { margin: 0 0 16px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.qr-box {
  display: inline-flex; padding: 16px; background: #fff; border: 1px solid var(--border);
  border-radius: 18px; box-shadow: var(--shadow); margin: 0 auto;
}
.qr-box img, .qr-box canvas { display: block; border-radius: 6px; }
.qr-link {
  margin: 16px auto 0; max-width: 340px; font-size: 12.5px; color: var(--ink-soft);
  background: var(--bg); border-radius: 10px; padding: 9px 12px; word-break: break-all; font-weight: 500;
}
.qr-actions { display: flex; gap: 10px; justify-content: center; margin-top: 16px; }
.qr-actions .btn { flex: 1; max-width: 170px; }

/* Tooltip (data-toggle="tooltip") */
.tip-ic {
  font-size: 16px; color: var(--muted); cursor: help; vertical-align: middle;
  margin-left: 4px; position: relative; top: -1px;
}
.tip-ic:hover { color: var(--ink-soft); }
.tooltip-inner {
  max-width: 340px; text-align: left; font-size: 12px; line-height: 1.45;
  padding: 10px 12px; font-family: Poppins, sans-serif;
}
