:root {
  --sb-w: 262px;
  --brand: #E94E1B;
  /* laranja do logo GDC */
  --brand-600: #CF4416;
  /* laranja escuro (hover/active) */
  --brand-soft: #FB8C3B;
  /* laranja mais fraco (acentos) */
  --bg: #f4f6fb;
  --ink: #1f2a44;
  --muted: #8a93a8;
  --card-radius: 16px;
}

* {
  scrollbar-width: thin;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

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

.sidebar {
  width: var(--sb-w);
  background: #fff;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  z-index: 1040;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .9rem 1.25rem;
  background: #e6e6e6;
}

[data-bs-theme="dark"] .sidebar__brand {
  background: #151b2b;
}

.sidebar__brand .logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand), #7aa0ff);
  color: #fff;
  font-size: 1.2rem;
}

.sidebar__brand b {
  font-size: 1.15rem;
  letter-spacing: .2px;
}

.sidebar__nav {
  overflow-y: auto;
  padding: 1.25rem .75rem 1.5rem;
  flex: 1;
}

.nav-section {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 1rem .85rem .35rem;
}

.sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: .7rem;
  color: #56607a;
  font-weight: 500;
  border-radius: 10px;
  padding: .6rem .85rem;
  margin-bottom: 2px;
  font-size: .93rem;
  transition: .15s;
}

.sidebar .nav-link .bi {
  font-size: 1.08rem;
  color: #9aa3b8;
  transition: .15s;
}

.sidebar .nav-link:hover {
  background: #f3f6ff;
  color: var(--brand-600);
}

.sidebar .nav-link:hover .bi {
  color: var(--brand-600);
}

.sidebar .nav-link.active {
  background: #eef3ff;
  color: var(--brand-600);
  font-weight: 600;
}

.sidebar .nav-link.active .bi {
  color: var(--brand-600);
}

.sidebar .nav-link .soon {
  margin-left: auto;
  color: #cbd2e0;
}

.sidebar .nav-link .bi-dot {
  font-size: 1.3rem;
  margin: -4px -2px;
}

.sidebar .nav-toggle .arrow {
  font-size: .8rem;
  transition: .2s;
  color: #b6bdcc;
}

.sidebar .nav-toggle:not(.collapsed) .arrow {
  transform: rotate(90deg);
}

.sidebar .nav-toggle:not(.collapsed) {
  color: var(--brand-600);
}

.sidebar .nav-sub {
  position: relative;
}

.sidebar .nav-sub .nav-link {
  font-size: .875rem;
  padding-top: .42rem;
  padding-bottom: .42rem;
}

.sidebar .nav-link.is-soon {
  color: #aeb6c6;
}

.sidebar .nav-link.is-soon:hover {
  background: #f7f8fc;
  color: #8a93a8;
}

.nav-section {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 1rem .85rem .35rem;
}

/* ---------- Main ---------- */
.main {
  flex: 1;
  margin-left: var(--sb-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: #e6e6e6;
  border-bottom: 1px solid #eef0f5;
  padding: .6rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 1030;
}

.topbar .search {
  flex: 1;
  max-width: 440px;
}

.topbar .search input {
  border-radius: 30px;
  background: #f4f6fb;
  border: 1px solid #eef0f5;
  padding-left: 2.4rem;
}

.topbar .search .bi {
  position: absolute;
  left: .9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

.topbar .icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #56607a;
  background: transparent;
  border: 0;
  position: relative;
}

.topbar .icon-btn:hover {
  background: #f3f6ff;
  color: var(--brand-600);
}

.topbar .avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(135deg, var(--brand), #7aa0ff);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 600;
}

.topbar .badge-dot {
  position: absolute;
  top: 6px;
  right: 7px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ff5b7f;
  color: #fff;
  font-size: .6rem;
  display: grid;
  place-items: center;
}

.content {
  padding: 1.5rem 1.75rem;
}

/* ---------- Cards ---------- */
.card {
  border: 0;
  border-radius: var(--card-radius);
  box-shadow: 0 4px 18px rgba(31, 42, 68, .05);
}

.kpi .ico {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.45rem;
}

.kpi .num {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.1;
}

.kpi .lbl {
  color: var(--muted);
  font-size: .84rem;
}

.soft-blue {
  background: #eaf1ff;
  color: #4f7cff;
}

.soft-green {
  background: #e6f8f0;
  color: #16b87f;
}

.soft-amber {
  background: #fff3e0;
  color: #f5a623;
}

.soft-red {
  background: #ffeaef;
  color: #ff5b7f;
}

.soft-violet {
  background: #f0ebff;
  color: #8159f3;
}

.table thead th {
  color: var(--muted);
  font-weight: 600;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  border-bottom: 1px solid #eef0f5;
}

.table td {
  vertical-align: middle;
}

.badge-soft {
  font-weight: 600;
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform .2s;
    box-shadow: 0 0 40px rgba(0, 0, 0, .15);
  }

  .sidebar.show {
    transform: translateX(0);
  }

  .main {
    margin-left: 0;
  }

  .sb-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .4);
    z-index: 1035;
  }
}

/* ---------- Auth ---------- */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
}

.auth-hero {
  background: linear-gradient(135deg, #4f7cff, #6a5cff 60%, #8159f3);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3.5rem;
  position: relative;
  overflow: hidden;
}

.auth-hero .blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: .18;
  background: #fff;
}

.auth-form {
  display: grid;
  place-items: center;
  padding: 2rem;
}

.auth-card {
  width: 100%;
  max-width: 400px;
}

@media (max-width: 860px) {
  .auth-wrap {
    grid-template-columns: 1fr;
  }

  .auth-hero {
    display: none;
  }
}

/* ---------- Dark mode ---------- */
[data-bs-theme="dark"] {
  --bg: #0f1420;
  --ink: #e6e9f2;
  --muted: #8b93a8;
}

[data-bs-theme="dark"] body {
  background: var(--bg);
  color: var(--ink);
}

[data-bs-theme="dark"] .sidebar {
  background: #151b2b;
  border-right-color: #222a3d;
}

[data-bs-theme="dark"] .sidebar .nav-link {
  color: #aab2c6;
}

[data-bs-theme="dark"] .sidebar .nav-link:hover {
  background: #1c2438;
  color: #9bb4ff;
}

[data-bs-theme="dark"] .sidebar .nav-link.active {
  background: #1b2740;
  color: #9bb4ff;
}

[data-bs-theme="dark"] .sidebar .nav-link .bi {
  color: #6b7390;
}

[data-bs-theme="dark"] .sidebar__brand b {
  color: #e6e9f2;
}

[data-bs-theme="dark"] .topbar {
  background: #151b2b;
  border-bottom-color: #222a3d;
}

[data-bs-theme="dark"] .topbar .search input {
  background: #1c2438;
  border-color: #2a3450;
  color: #e6e9f2;
}

[data-bs-theme="dark"] .topbar .icon-btn {
  color: #aab2c6;
}

[data-bs-theme="dark"] .topbar .icon-btn:hover {
  background: #1c2438;
  color: #9bb4ff;
}

[data-bs-theme="dark"] .card {
  background: #151b2b;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .35);
}

[data-bs-theme="dark"] .table thead th {
  border-bottom-color: #2a3450;
}

[data-bs-theme="dark"] .badge.bg-light,
[data-bs-theme="dark"] .btn-light {
  background: #1c2438 !important;
  color: #cdd3e1 !important;
  border-color: #2a3450;
}

[data-bs-theme="dark"] .text-dark {
  color: #e6e9f2 !important;
}

/* Dark mode — tabelas alinhadas ao card */
[data-bs-theme="dark"] .table {
  --bs-table-bg: transparent;
  --bs-table-color: #e6e9f2;
  --bs-table-border-color: #222a3d;
  --bs-table-hover-bg: #1c2438;
  --bs-table-hover-color: #e6e9f2;
  --bs-table-striped-bg: #161d2e;
  --bs-table-striped-color: #e6e9f2;
}

[data-bs-theme="dark"] .table-light {
  --bs-table-bg: #1b2235;
  --bs-table-color: #aab2c6;
  --bs-table-border-color: #2a3450;
}

[data-bs-theme="dark"] .table>:not(caption)>*>* {
  border-color: #222a3d;
}

[data-bs-theme="dark"] .table thead th {
  color: #8b93a8;
}

/* Dark mode — corrige fundos CLAROS hardcoded que sumiam textos (UX fix jun/2026):
   - card-header / seções com bg-white|bg-light (apareciam como banda branca, texto invisível)
   - alert-light, e os placeholders de foto/avatar com fundo claro inline */
[data-bs-theme="dark"] .bg-white,
[data-bs-theme="dark"] .card-header.bg-white {
  background-color: #151b2b !important;
  color: #e6e9f2;
}
[data-bs-theme="dark"] .bg-light:not(.badge):not(.table-light) {
  background-color: #1b2235 !important;
  color: #cdd3e1;
}
[data-bs-theme="dark"] .alert-light {
  background-color: #1b2235 !important;
  color: #cdd3e1;
  border-color: #2a3450 !important;
}
[data-bs-theme="dark"] .card-header {
  border-bottom-color: #222a3d;
}
/* placeholders de foto/avatar (fundos claros definidos inline) */
[data-bs-theme="dark"] [style*="#f1f3f5"],
[data-bs-theme="dark"] [style*="#e8eef7"],
[data-bs-theme="dark"] [style*="#f8f9fb"],
[data-bs-theme="dark"] [style*="#e9ecef"],
[data-bs-theme="dark"] [style*="background:#eee"],
[data-bs-theme="dark"] [style*="background:#fff"] {
  background-color: #1b2235 !important;
  border-color: #2a3450 !important;
  color: #8b93a8 !important;
}

/* ---------- Branding GDC Clubes ---------- */
.sidebar__brand {
  gap: .5rem;
}

.sidebar__brand .brand-logo {
  height: 30px;
  width: auto;
}

.brand-logo--dark {
  display: none;
}

[data-bs-theme="dark"] .brand-logo--light {
  display: none;
}

[data-bs-theme="dark"] .brand-logo--dark {
  display: inline-block;
}

.brand-clubes {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
  letter-spacing: .2px;
}

/* ---------- Tema laranja (primary) ---------- */
:root {
  --bs-primary: #E94E1B;
  --bs-primary-rgb: 233, 78, 27;
  --bs-link-color: #E94E1B;
  --bs-link-color-rgb: 233, 78, 27;
  --bs-link-hover-color: #CF4416;
}

.btn-primary {
  --bs-btn-bg: #E94E1B;
  --bs-btn-border-color: #E94E1B;
  --bs-btn-hover-bg: #CF4416;
  --bs-btn-hover-border-color: #CF4416;
  --bs-btn-active-bg: #CF4416;
  --bs-btn-active-border-color: #CF4416;
  --bs-btn-disabled-bg: #E94E1B;
  --bs-btn-disabled-border-color: #E94E1B;
}

.btn-outline-primary {
  --bs-btn-color: #E94E1B;
  --bs-btn-border-color: #E94E1B;
  --bs-btn-hover-bg: #E94E1B;
  --bs-btn-hover-border-color: #E94E1B;
  --bs-btn-active-bg: #E94E1B;
  --bs-btn-active-border-color: #E94E1B;
}

.text-primary {
  color: #E94E1B !important;
}

.bg-primary {
  background-color: #E94E1B !important;
}

a {
  color: #E94E1B;
}

a:hover {
  color: #CF4416;
}

.form-control:focus,
.form-select:focus {
  border-color: #F5A06A;
  box-shadow: 0 0 0 .2rem rgba(233, 78, 27, .18);
}

.page-link {
  color: #E94E1B;
}

.page-item.active .page-link {
  background-color: #E94E1B;
  border-color: #E94E1B;
}

.badge.bg-primary-subtle {
  background-color: #fdeadf !important;
}

.text-primary-emphasis {
  color: #b73d12 !important;
}

[data-bs-theme="dark"] .badge.bg-primary-subtle {
  background-color: #3a2113 !important;
}

[data-bs-theme="dark"] .text-primary-emphasis {
  color: #f8a877 !important;
}

/* KPI "soft-blue" repintado p/ laranja (mantém o nome de classe) */
.soft-blue {
  background: #fdeadf;
  color: #E94E1B;
}

[data-bs-theme="dark"] .soft-blue {
  background: #3a2113;
  color: #fb8c3b;
}

/* Avatar e hero do login em laranja */
.topbar .avatar {
  background: linear-gradient(135deg, var(--brand), var(--brand-soft));
}

.sidebar__brand .logo {
  background: linear-gradient(135deg, var(--brand), var(--brand-soft));
}

.auth-hero {
  background: linear-gradient(135deg, #E94E1B, #F5821F 55%, #FBA94C);
}

/* Realces da navegação no tom laranja */
.sidebar .nav-link:hover {
  background: #fdf1ec;
}

.sidebar .nav-link.active {
  background: #fdeadf;
}

.topbar .icon-btn:hover {
  background: #fdf1ec;
}

[data-bs-theme="dark"] .sidebar .nav-link:hover {
  background: #2a1b13;
  color: #fb8c3b;
}

[data-bs-theme="dark"] .sidebar .nav-link:hover .bi {
  color: #fb8c3b;
}

[data-bs-theme="dark"] .sidebar .nav-link.active {
  background: #2a1b13;
  color: #fb8c3b;
}

[data-bs-theme="dark"] .sidebar .nav-link.active .bi {
  color: #fb8c3b;
}

[data-bs-theme="dark"] .topbar .icon-btn:hover {
  background: #2a1b13;
  color: #fb8c3b;
}
/* ---------- Layout PDV (tela cheia, sem sidebar) ---------- */
.pdv-body{ background:var(--bg); }
.pdv-topbar{ background:#fff; border-bottom:1px solid #eef0f5; padding:.55rem 1.1rem;
  display:flex; align-items:center; gap:.75rem; position:sticky; top:0; z-index:1030; }
[data-bs-theme="dark"] .pdv-topbar{ background:#151b2b; border-bottom-color:#222a3d; }
.pdv-topbar .avatar{ width:34px;height:34px;border-radius:50%;display:grid;place-items:center;font-weight:600;
  color:#fff; background:linear-gradient(135deg,var(--brand),var(--brand-soft)); }
.pdv-content{ padding:1.1rem 1.25rem; max-width:1500px; margin:0 auto; }

/* ---------- Impressão / PDF (window.print em qualquer tela) ---------- */
.btn-print{ }
@media print {
  .sidebar, .topbar, .sb-backdrop, .no-print,
  .btn, .pagination, .nav, .dropdown, .modal, .alert,
  form .input-group, .card-header .btn { display:none !important; }
  .main{ margin-left:0 !important; }
  .content{ padding:0 !important; }
  body{ background:#fff !important; }
  .card{ box-shadow:none !important; border:1px solid #ddd !important; border-radius:0 !important; }
  .print-only{ display:block !important; }
  .table{ font-size:11px; }
  a[href]:after{ content:""; }
  /* cabeçalho de impressão (injetado no topo da página impressa) */
  .print-header{ display:block !important; border-bottom:2px solid #000; margin-bottom:10px; padding-bottom:6px; }
  .print-header .pc{ font-size:15px; font-weight:bold; }
  @page { margin:14mm 10mm; }
}
.print-only, .print-header{ display:none; }

/* =========================================================
   MEGA MENU (topo) + appbar — substitui a sidebar no desktop
   ========================================================= */
body.has-megamenu .content { margin-left: 0; padding: 1.25rem 1.5rem; }

.appbar { position: sticky; top: 0; z-index: 1031; background: #fff; box-shadow: 0 1px 0 rgba(15,23,42,.05); }
.appbar .topbar { position: relative; top: auto; z-index: 5; background: transparent; }
.appbar__brand { display: flex; align-items: center; gap: .5rem; text-decoration: none; padding-right: .25rem; }
.appbar__brand .brand-logo { height: 26px; width: auto; }
.appbar__brand .brand-clubes { font-weight: 700; color: var(--bs-primary); letter-spacing: .2px; }

.megabar { position: relative; display: flex; flex-wrap: wrap; align-items: stretch; gap: .1rem;
  padding: .25rem .6rem; background: transparent; border-top: 1px solid #eef0f5; }

.mega-trigger, .mega-item-link { display: inline-flex; align-items: center; gap: .45rem; border: 0; background: transparent;
  color: #475569; font-weight: 600; font-size: .82rem; padding: .5rem .7rem; border-radius: .55rem; cursor: pointer;
  white-space: nowrap; text-decoration: none; line-height: 1; }
.mega-trigger .caret { font-size: .6rem; opacity: .55; margin-left: .15rem; transition: transform .15s; }
.mega-trigger > i:first-child, .mega-item-link > i:first-child { font-size: .95rem; color: var(--bs-primary); }
.mega-trigger:hover, .mega-item-link:hover,
.mega-item:hover .mega-trigger, .mega-item.open .mega-trigger,
.mega-item.active .mega-trigger, .mega-item-link.active { background: #eef2ff; color: #1e293b; }

.mega-panel { position: absolute; left: .5rem; right: .5rem; top: 100%; margin-top: .2rem;
  background: #fff; border: 1px solid #eef0f5; border-radius: .9rem; box-shadow: 0 18px 50px rgba(15,23,42,.16);
  padding: .85rem; z-index: 1050; display: none; }
.mega-item:hover .mega-panel, .mega-item.open .mega-panel { display: block; }
.mega-item:hover .mega-trigger .caret, .mega-item.open .mega-trigger .caret { transform: rotate(180deg); }
.mega-panel-inner { max-height: 72vh; overflow: auto; }
.mega-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); gap: .35rem 1rem; }
.mega-col { min-width: 0; padding: .1rem .15rem; }
.mega-col-h { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #94a3b8;
  padding: .3rem .5rem .2rem; display: flex; align-items: center; gap: .4rem; }
.mega-col-h i { color: var(--bs-primary); font-size: .8rem; }
.mega-subh { font-size: .66rem; font-weight: 700; text-transform: uppercase; color: #b8c2cf; padding: .45rem .5rem .1rem; }
.mega-link { display: flex; align-items: center; gap: .55rem; padding: .38rem .55rem; border-radius: .5rem;
  color: #475569; text-decoration: none; font-size: .83rem; line-height: 1.15; }
.mega-link i { width: 1rem; text-align: center; color: #94a3b8; font-size: .85rem; flex: none; }
.mega-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mega-link:hover { background: #f1f5f9; color: #0f172a; }
.mega-link:hover i { color: var(--bs-primary); }
.mega-link.active { background: #eef2ff; color: var(--bs-primary); font-weight: 600; }
.mega-link.active i { color: var(--bs-primary); }
.mega-link.soon { opacity: .55; }
.mega-link .soon-dot { margin-left: auto; color: #f59e0b; font-style: normal; }

/* sidebar é drawer em qualquer largura quando há megamenu */
body.has-megamenu .sidebar { transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.18); z-index: 1060; }
body.has-megamenu .sidebar.show { transform: translateX(0); }

/* desktop menor: compacta a barra */
@media (max-width: 1300px) { .mega-trigger, .mega-item-link { font-size: .78rem; padding: .45rem .52rem; gap: .35rem; } }

/* dark mode */
[data-bs-theme="dark"] .appbar { background: #0f1115; box-shadow: 0 1px 0 rgba(255,255,255,.04); }
[data-bs-theme="dark"] .megabar { border-color: #1f2430; }
[data-bs-theme="dark"] .mega-trigger, [data-bs-theme="dark"] .mega-item-link, [data-bs-theme="dark"] .mega-link { color: #cbd5e1; }
[data-bs-theme="dark"] .mega-trigger:hover, [data-bs-theme="dark"] .mega-item-link:hover,
[data-bs-theme="dark"] .mega-item:hover .mega-trigger, [data-bs-theme="dark"] .mega-item.open .mega-trigger { background: #1b2230; color: #fff; }
[data-bs-theme="dark"] .mega-panel { background: #11151c; border-color: #1f2430; }
[data-bs-theme="dark"] .mega-link:hover { background: #1b2230; color: #fff; }

/* =========================================================
   MEGA MENU LAUNCHER (botão "Menu" → painel sob demanda)
   ========================================================= */
.mega-launcher { position: absolute; top: 100%; left: 0; right: 0; z-index: 1056;
  background: #fff; border-bottom: 1px solid #eef0f5; box-shadow: 0 24px 60px rgba(15,23,42,.18);
  max-height: calc(100vh - 60px); overflow: auto; }
body.ml-open .appbar { z-index: 1056; }     /* sobe acima do backdrop quando aberto */
.mega-launcher__bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: .5rem;
  padding: .7rem 1.25rem; background: #fff; border-bottom: 1px solid #f1f5f9; }
.ml-search { position: relative; flex: 1; max-width: 480px; }
.ml-search input { width: 100%; border: 1px solid #e6eaf2; background: #f7f9fc; border-radius: 30px;
  padding: .5rem .9rem .5rem 2.3rem; font-size: .9rem; outline: none; }
.ml-search input:focus { border-color: var(--bs-primary); background: #fff; }
.ml-search > i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: #94a3b8; }
.mega-launcher__grid { columns: 232px; column-gap: 1.5rem; padding: 1rem 1.25rem 1.5rem; }
.lnch-sec { break-inside: avoid; margin: 0 0 1.1rem; display: inline-block; width: 100%; vertical-align: top; }
.lnch-h { display: flex; align-items: center; gap: .5rem; font-size: .8rem; font-weight: 700; color: #0f172a;
  padding: .25rem .4rem .4rem; border-bottom: 2px solid #eef2ff; margin-bottom: .35rem; text-decoration: none; }
.lnch-h > i { color: var(--bs-primary); }
.lnch-h--link:hover, .lnch-h--link.active { color: var(--bs-primary); }
.mega-launcher__backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.35); z-index: 1054; }
body.ml-open { overflow: hidden; }
#menuBtn .fa-grip { font-size: .85rem; }

@media (max-width: 575.98px) { .mega-launcher__grid { columns: 1; } }

[data-bs-theme="dark"] .mega-launcher, [data-bs-theme="dark"] .mega-launcher__bar { background: #11151c; border-color: #1f2430; }
[data-bs-theme="dark"] .ml-search input { background: #1b2230; border-color: #2a3242; color: #e5e7eb; }
[data-bs-theme="dark"] .lnch-h { color: #e5e7eb; border-color: #2a3242; }

/* Busca global do topo (dropdown de resultados) */
.top-search-drop { top: calc(100% + 4px); left: 0; right: 0; z-index: 1090; max-height: 60vh; overflow: auto; border-radius: .75rem; background: #fff; }
.top-search-drop .ts-h { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #94a3b8; padding: .5rem .85rem .25rem; }
.top-search-drop .list-group-item:first-child { border-top-left-radius: 0; border-top-right-radius: 0; }
[data-bs-theme="dark"] .top-search-drop { background: #11151c; }

/* Mega launcher — usar TODA a tela: mais colunas (estreitas) + cards densos */
.mega-launcher { max-height: calc(100vh - 3.25rem); }
.mega-launcher__grid { columns: 190px; column-gap: 1.05rem; padding: .8rem 1rem 1.2rem; }
@media (min-width: 1700px) { .mega-launcher__grid { columns: 200px; } }
.lnch-sec { margin: 0 0 .8rem; break-inside: avoid; display: inline-block; width: 100%; vertical-align: top; }
.lnch-parent { font-size: .57rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #b6c0cf; padding: 0 .4rem; line-height: 1.1; }
.lnch-h { font-size: .78rem; padding: .12rem .4rem .28rem; margin-bottom: .25rem; border-bottom-width: 1.5px; }
.lnch-h > i { font-size: .82rem; }
.mega-launcher .mega-link { padding: .26rem .5rem; font-size: .8rem; gap: .5rem; }
.mega-launcher .mega-link i { font-size: .8rem; }
.mega-launcher .mega-subh { padding: .28rem .5rem .04rem; font-size: .62rem; }
[data-bs-theme="dark"] .lnch-parent { color: #5b6675; }

/* ===== Mega launcher MESTRE-DETALHE (lista de menus → painel) ===== */
.mega-launcher { display: flex; flex-direction: column; height: calc(100vh - 3.25rem); max-height: none; overflow: hidden; }
.mega-launcher__bar { flex: none; }
.ml-body { flex: 1; min-height: 0; display: flex; }
.ml-nav { flex: none; width: 256px; overflow: auto; border-right: 1px solid #eef0f5; padding: .5rem; }
.ml-content, .ml-results { flex: 1; min-width: 0; overflow: auto; padding: .6rem 1rem 1.5rem; }
.ml-nav-item { display: flex; align-items: center; gap: .6rem; width: 100%; border: 0; background: transparent; text-align: left;
  padding: .55rem .7rem; border-radius: .55rem; color: #475569; font-weight: 600; font-size: .85rem; cursor: pointer; text-decoration: none; }
.ml-nav-item > i:first-child { width: 1.15rem; text-align: center; color: var(--bs-primary); font-size: .98rem; }
.ml-nav-item:hover { background: #f1f5f9; color: #0f172a; }
.ml-nav-item.current { background: #eef2ff; color: var(--bs-primary); }
.ml-nav-item.active:not(.current) { color: #0f172a; }
.ml-pane-h { display: flex; align-items: center; gap: .6rem; font-size: 1rem; font-weight: 700; color: #0f172a;
  padding: .25rem .4rem .6rem; margin-bottom: .4rem; border-bottom: 1px solid #eef2ff; }
.ml-pane-h i { color: var(--bs-primary); }
.ml-content .mega-launcher__grid, .ml-results .mega-launcher__grid { padding: 0; columns: 200px; column-gap: 1.1rem; }

[data-bs-theme="dark"] .ml-nav { border-color: #1f2430; }
[data-bs-theme="dark"] .ml-nav-item { color: #cbd5e1; }
[data-bs-theme="dark"] .ml-nav-item:hover { background: #1b2230; color: #fff; }
[data-bs-theme="dark"] .ml-nav-item.current { background: #1b2230; }
[data-bs-theme="dark"] .ml-pane-h { color: #e5e7eb; border-color: #2a3242; }

/* ===== Sub-navegação contextual do módulo (barra fina, compacta) ===== */
.subnav { align-items: center; gap: .3rem; padding: .2rem .9rem; background: #fafbfd; border-top: 1px solid #eef0f5;
  overflow-x: auto; white-space: nowrap; scrollbar-width: thin; }
.subnav::-webkit-scrollbar { height: 4px; }
.subnav::-webkit-scrollbar-thumb { background: #d8dee9; border-radius: 4px; }
.subnav__mod { display: inline-flex; align-items: center; gap: .4rem; flex: none; font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .03em; color: #94a3b8; padding-right: .6rem; margin-right: .2rem; border-right: 1px solid #e6eaf2; }
.subnav__mod i { color: var(--bs-primary); font-size: .8rem; }
.subnav__items { display: inline-flex; align-items: center; gap: .1rem; }
.subnav-pill { display: inline-flex; align-items: center; gap: .35rem; border: 0; background: transparent; color: #475569;
  font-size: .78rem; font-weight: 500; padding: .28rem .55rem; border-radius: .45rem; text-decoration: none; white-space: nowrap; cursor: pointer; line-height: 1; }
.subnav-pill > i:first-child { font-size: .76rem; color: #9aa6b6; }
.subnav-pill:hover { background: #eef2f8; color: #0f172a; }
.subnav-pill.active { background: #eef2ff; color: var(--bs-primary); font-weight: 600; }
.subnav-pill.active > i:first-child { color: var(--bs-primary); }
.subnav-caret { font-size: .54rem; opacity: .5; }
.subnav .dropdown { display: inline-flex; }
[data-bs-theme="dark"] .subnav { background: #0e1116; border-color: #1f2430; }
[data-bs-theme="dark"] .subnav__mod { color: #64748b; border-color: #1f2430; }
[data-bs-theme="dark"] .subnav-pill { color: #cbd5e1; }
[data-bs-theme="dark"] .subnav-pill:hover { background: #1b2230; color: #fff; }
/* dark mode: estados ATIVOS dos menus (corrige claro-no-claro — o item ativo herdava fundo claro #eef2ff
   e a cor era sobrescrita p/ cinza pela regra de atributo, ficando ilegível). */
[data-bs-theme="dark"] .subnav-pill.active,
[data-bs-theme="dark"] .mega-link.active,
[data-bs-theme="dark"] .mega-item.active .mega-trigger,
[data-bs-theme="dark"] .mega-item-link.active { background: rgba(233,78,27,.18); color: #fff; }
[data-bs-theme="dark"] .subnav-pill.active > i:first-child,
[data-bs-theme="dark"] .mega-link.active i { color: var(--bs-primary); }
[data-bs-theme="dark"] .ml-nav-item.active:not(.current) { color: #fff; }

/* Atalhos rápidos personalizáveis (header do dashboard) */
.quick-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .34rem .75rem; border-radius: 30px;
  background: #fff; border: 1px solid #e6eaf2; color: #475569; font-size: .8rem; font-weight: 500; text-decoration: none; white-space: nowrap; transition: all .12s; }
.quick-chip > i { color: var(--bs-primary); font-size: .8rem; }
.quick-chip:hover { border-color: var(--bs-primary); color: var(--bs-primary); box-shadow: 0 2px 8px rgba(13,110,253,.12); }
.qk-row { cursor: pointer; } .qk-row:hover { background: #f1f5f9; }
[data-bs-theme="dark"] .quick-chip { background: #11151c; border-color: #2a3242; color: #cbd5e1; }
[data-bs-theme="dark"] .qk-row:hover { background: #1b2230; }

/* Sub-nav: não cortar dropdowns (era overflow-x:auto que clipava) + quebrar linha se grande */
.subnav { overflow: visible; flex-wrap: wrap; }
.subnav .dropdown-menu { z-index: 1080; }
.subnav__crumb { color: #aeb8c6; font-weight: 600; }
[data-bs-theme="dark"] .subnav__crumb { color: #5b6675; }

/* Sub-nav: linha única + botão "Mais" (priority nav, JS move o excedente) */
.subnav { overflow: visible; flex-wrap: nowrap; }
.subnav__items { flex-wrap: nowrap; min-width: 0; }
.subnav-more > .subnav-pill { color: var(--bs-primary); }
.subnav-more .dropdown-menu { max-height: 70vh; overflow: auto; }

/* Botão "Mais" da sub-nav — preenchido e bem visível */
.subnav-more-btn { background: var(--bs-primary); color: #fff !important; font-weight: 600; padding: .34rem .8rem; border-radius: 30px; box-shadow: 0 2px 6px rgba(233,78,27,.3); }
.subnav-more-btn > i, .subnav-more-btn .subnav-caret { color: #fff !important; }
.subnav-more-btn:hover { filter: brightness(.94); color: #fff; }
.subnav-more-btn .subnav-caret { opacity: .85; }

/* Atalhos rápidos do dashboard — visual melhorado (chip com ícone em círculo) */
#quickBar .quick-chip { display: inline-flex; align-items: center; gap: .5rem; padding: .38rem .95rem .38rem .4rem;
  border-radius: 40px; background: #fff; border: 1px solid #e9edf3; color: #1e293b; font-size: .85rem; font-weight: 600;
  text-decoration: none; box-shadow: 0 1px 2px rgba(16,24,40,.05); transition: all .14s ease; }
#quickBar .quick-chip .qc-ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg,#fff1ec,#ffe3d8); color: var(--bs-primary); font-size: .82rem; flex: none; }
#quickBar .quick-chip:hover { border-color: #ffd2c2; color: var(--bs-primary); box-shadow: 0 6px 16px rgba(233,78,27,.16); transform: translateY(-1px); }
#quickBar .quick-chip:hover .qc-ic { background: var(--bs-primary); color: #fff; }
#quickBar .quick-chip--add { border-style: dashed; color: #64748b; background: transparent; box-shadow: none; }
#quickBar .quick-chip--add .qc-ic { background: #eef2f7; color: #64748b; }
[data-bs-theme="dark"] #quickBar .quick-chip { background: #11151c; border-color: #2a3242; color: #e5e7eb; }
[data-bs-theme="dark"] #quickBar .quick-chip .qc-ic { background: #2a2018; }

/* Painel de widgets (dashboard dinâmico) */
.dash-w-head .drag-handle, .dash-w-head .dash-w-toggle { display: none; }
#dashGrid.customizing .dash-w { outline: 2px dashed #cfd8e6; outline-offset: -5px; border-radius: 1rem; }
#dashGrid.customizing .dash-w--exc { opacity: .5; }
#dashGrid.customizing .dash-w-head .drag-handle { display: inline-flex; cursor: grab; color: #94a3b8; padding-right: .35rem; }
#dashGrid.customizing .dash-w-head .dash-w-toggle { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border: 0; border-radius: 50%; background: #eef2f7; color: #64748b; }
#dashGrid.customizing .dash-w--exc .dash-w-toggle { background: var(--bs-primary); color: #fff; }
.dash-ghost { opacity: .4; }
.dash-w-title { text-transform: none; }
[data-bs-theme="dark"] #dashGrid.customizing .dash-w-head .dash-w-toggle { background: #2a3242; color: #cbd5e1; }

/* Widgets do painel — UI refinada (clean) */
.dash-w > .card { border: 1px solid #edf0f5; box-shadow: 0 4px 18px rgba(31,42,68,.05); transition: box-shadow .16s ease, transform .16s ease; }
.dash-w > .card:hover { box-shadow: 0 10px 26px rgba(31,42,68,.10); transform: translateY(-1px); }
.dash-w > .card > .card-body { padding: .95rem 1.05rem; }
.dash-w-title { font-size: .7rem !important; text-transform: uppercase; letter-spacing: .07em; color: #9aa6b6 !important; font-weight: 700; }
.dash-w-head { padding-bottom: .35rem; border-bottom: 1px solid #f3f5f9; margin-bottom: .9rem !important; }
.dash-kpi { display: flex; align-items: center; gap: .85rem; min-width: 0; }
.dash-kpi__ic { width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; font-size: 1.32rem; flex: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.55); }
.dash-kpi__num { font-size: 1.5rem; font-weight: 800; line-height: 1.05; letter-spacing: -.02em; color: #0f172a; }
.dash-kpi__lbl { font-size: .78rem; color: #94a3b8; margin-top: 2px; font-weight: 500; }
/* separador vertical sutil entre KPIs lado a lado (apenas xl, onde não quebram) */
@media (min-width: 1200px){
  .dash-w .row > .col-xl + .col-xl .dash-kpi { border-left: 1px solid #f0f3f7; padding-left: 1.25rem; }
}
[data-bs-theme="dark"] .dash-w > .card { border-color: #1f2430; }
[data-bs-theme="dark"] .dash-w-head { border-color: #1f2430; }
[data-bs-theme="dark"] .dash-kpi__num { color: #f1f5f9; }
[data-bs-theme="dark"] .dash-w .row > .col-xl + .col-xl .dash-kpi { border-color: #262d3a; }

/* ===== Régua de Cobrança (linha contínua por fase) ===== */
.rc2-row { display: flex; align-items: stretch; }
.rc2-info { flex: 0 0 168px; border-right: 1px solid #eef1f6; padding: 1.1rem 1rem; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.rc2-ava { width: 46px; height: 46px; border-radius: 50%; border: 2px solid currentColor; display: grid; place-items: center; font-size: 1.15rem; margin-bottom: .5rem; opacity: .9; }
.rc2-name { font-weight: 700; font-size: .92rem; line-height: 1.15; }
.rc2-count { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.rc2-time { flex: 1 1 auto; overflow-x: auto; padding: 1rem 1.25rem; }
.rc2-track { display: inline-block; min-width: 100%; --cell: 56px; }
.rc2-heads { display: flex; margin-bottom: .35rem; }
.rc2-head { width: calc(var(--cell) * var(--n,1)); flex: none; text-align: center; font-size: .62rem; line-height: 1.1; font-weight: 600; color: #9aa6b6; white-space: nowrap; }
.rc2-nodes { display: flex; }
.rc2-node { width: var(--cell); flex: none; position: relative; display: flex; flex-direction: column; align-items: center; padding-top: 2px; }
.rc2-node::before { content: ''; position: absolute; top: 26px; left: -50%; width: 100%; height: 3px; background: var(--seg, transparent); z-index: 0; }
.rc2-day { font-size: .72rem; font-weight: 700; color: #64748b; height: 16px; line-height: 16px; }
.rc2-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--dot, #9aa6b6); margin: 4px 0; position: relative; z-index: 1; box-shadow: 0 0 0 3px #fff; }
.rc2-ics { display: flex; flex-direction: column; align-items: center; gap: 3px; margin-top: 4px; }
.rc2-ic { position: relative; color: #94a3b8; font-size: .85rem; }
.rc2-ic.rc2-ic-off { opacity: .4; }
.rc2-node.rc2-off { opacity: .55; }
.rc2-rm { position: absolute; top: -7px; right: -11px; margin: 0; opacity: 0; transition: opacity .12s; z-index: 3; }
.rc2-rm button { width: 16px; height: 16px; line-height: 14px; border: 0; border-radius: 50%; background: #ef4444; color: #fff; font-size: 11px; padding: 0; }
.rc2-ic:hover .rc2-rm { opacity: 1; }
/* picker do modal (reaproveita .rc-ch) */
.rc-ch { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--c, #94a3b8); font-size: .72rem; }
.rc-pick { display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .8rem; border: 1px solid #e6eaf2; border-radius: 30px; cursor: pointer; user-select: none; }
.rc-pick.sel { border-color: var(--bs-primary); background: #eef2ff; }
[data-bs-theme="dark"] .rc2-info { border-color: #2a3242; }
[data-bs-theme="dark"] .rc2-head, [data-bs-theme="dark"] .rc2-day { color: #94a3b8; }
[data-bs-theme="dark"] .rc2-dot { box-shadow: 0 0 0 3px var(--bs-body-bg); }
[data-bs-theme="dark"] .rc-pick { border-color: #2a3242; }

/* ===== Conformidade Financeira ===== */
.conf-kpi { display: flex; align-items: center; gap: .8rem; padding: .85rem .95rem; }
.conf-kpi__ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-size: 1.15rem; flex: none; }
.conf-kpi__num { font-size: 1.4rem; font-weight: 800; line-height: 1.05; letter-spacing: -.02em; color: #0f172a; }
.conf-kpi__den { font-size: .9rem; font-weight: 600; color: #94a3b8; }
.conf-kpi__lbl { font-size: .72rem; color: #94a3b8; margin-top: 2px; font-weight: 500; }
.conf-card { border-left: 4px solid transparent !important; transition: box-shadow .15s ease; }
.conf-card:hover { box-shadow: 0 10px 26px rgba(31,42,68,.10) !important; }
.conf-card--grave  { border-left-color: var(--bs-danger) !important; }
.conf-card--alerta { border-left-color: var(--bs-warning) !important; }
.conf-card--ok     { border-left-color: var(--bs-success) !important; }
.conf-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 1.1rem; flex: none; }
.conf-param { font-size: .68rem; color: #aab4c2; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.conf-qtd { font-size: 1.5rem; font-weight: 800; line-height: 1; letter-spacing: -.02em; white-space: nowrap; }
.conf-qtd__u { font-size: .68rem; font-weight: 600; color: #94a3b8; }
.conf-val { font-size: .82rem; font-weight: 700; color: #ef4444; margin-top: 2px; white-space: nowrap; }
.nav-sm .nav-link { font-size: .82rem; padding: .32rem .85rem; border-radius: 30px; }
.conf-tabs { border-bottom: 1px solid #e6eaf2; gap: .25rem; }
.conf-tabs .nav-link { border: 0; border-bottom: 2px solid transparent; color: #64748b; font-weight: 600; font-size: .9rem; padding: .55rem .95rem; border-radius: 0; }
.conf-tabs .nav-link:hover { color: #0f172a; border-bottom-color: #cbd5e1; }
.conf-tabs .nav-link.active { color: var(--bs-primary); border-bottom-color: var(--bs-primary); background: transparent; }
[data-bs-theme="dark"] .conf-tabs { border-color: #2a3242; }
[data-bs-theme="dark"] .conf-tabs .nav-link { color: #94a3b8; }
[data-bs-theme="dark"] .conf-tabs .nav-link:hover { color: #e5e7eb; }
[data-bs-theme="dark"] .conf-kpi__num { color: #f1f5f9; }
[data-bs-theme="dark"] .conf-val { color: #f87171; }
/* dark mode: badges text-bg-light ficam ilegíveis (fundo claro + texto claro) — usar superfície escura */
[data-bs-theme="dark"] .badge.text-bg-light { background-color: #222b3a !important; color: #cbd5e1 !important; }
[data-bs-theme="dark"] .badge.text-bg-light.text-muted { color: #94a3b8 !important; }

/* ── Tom Select (busca em todo <select>) — padrão GDC ── */
.ts-wrapper.form-select{ padding:0; }
.ts-control{ border-radius:.5rem; }
.ts-dropdown{ border-radius:.6rem; box-shadow:0 8px 24px rgba(15,23,42,.12); }
.ts-dropdown .active{ background:var(--bs-primary); color:#fff; }
.ts-dropdown .ts-dropdown-content{ max-height:280px; }
/* dark mode */
[data-bs-theme="dark"] .ts-control{ background:#141a24; border-color:#2a3242; color:#e5e7eb; }
[data-bs-theme="dark"] .ts-wrapper.single .ts-control,
[data-bs-theme="dark"] .ts-control input{ color:#e5e7eb; }
[data-bs-theme="dark"] .ts-control input::placeholder{ color:#7b8696; }
[data-bs-theme="dark"] .ts-dropdown{ background:#141a24; border-color:#2a3242; color:#e5e7eb; box-shadow:0 8px 24px rgba(0,0,0,.5); }
[data-bs-theme="dark"] .ts-dropdown .option{ color:#cbd5e1; }
[data-bs-theme="dark"] .ts-dropdown .option:hover,
[data-bs-theme="dark"] .ts-dropdown .active{ background:var(--bs-primary); color:#fff; }
[data-bs-theme="dark"] .ts-dropdown .optgroup-header{ background:#141a24; color:#7b8696; }
[data-bs-theme="dark"] .ts-wrapper.multi .ts-control > div{ background:#27303f; color:#e5e7eb; }
[data-bs-theme="dark"] .ts-control .ts-dropdown .no-results{ color:#9aa6b6; }

/* ── Trilha / timeline (padrão dos módulos financeiros) ── */
.trilha{ position:relative; padding-left:.25rem; }
.trilha-item{ position:relative; padding-left:2.1rem; padding-bottom:1.1rem; }
.trilha-item:not(:last-child)::before{ content:""; position:absolute; left:.72rem; top:1.5rem; bottom:-.1rem; width:2px; background:#e6eaf2; }
[data-bs-theme="dark"] .trilha-item:not(:last-child)::before{ background:#2a3242; }
.trilha-dot{ position:absolute; left:0; top:0; width:1.55rem; height:1.55rem; border-radius:50%; display:grid; place-items:center; font-size:.78rem; }
.trilha-desc{ font-size:.86rem; font-weight:500; line-height:1.3; }
.trilha-meta{ font-size:.74rem; color:var(--muted); margin-top:.1rem; }
