:root{
  --csb-blue:#093262;
  --csb-blue-soft:#0f4b8c;
  --csb-green:#21a157;
  --csb-yellow:#f4b400;
  --text:#0f172a;
  --muted:#64748b;
  --bg:#f3f4f6;
  --card:#ffffff;
  --border:#e5e7eb;
  --radius:14px;
  --shadow:0 12px 26px rgba(15,23,42,0.08);
  --danger:#ef4444;
  --danger-soft:#fef2f2;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  color:var(--text);
  background:var(--bg);
  overflow-x:hidden; /* impede estouro horizontal */
}

/* trava o scroll do fundo quando um modal estiver aberto */
body.modal-open{ overflow:hidden; }

.bg{
  position:fixed; inset:0;
  background:
    radial-gradient(1200px 600px at 10% 0%, rgba(33,161,87,0.15), transparent 60%),
    radial-gradient(1200px 600px at 90% 0%, rgba(15,75,140,0.18), transparent 60%),
    radial-gradient(800px 400px at 50% 100%, rgba(244,180,0,0.10), transparent 60%);
  pointer-events:none;
}

.topbar{
  position:sticky; top:0; z-index:20;
  background:rgba(243,244,246,0.75);
  backdrop-filter:saturate(160%) blur(10px);
  border-bottom:1px solid var(--border);
}
.topbar-inner{
  max-width:1200px; margin:0 auto;
  padding:14px 16px;
  display:flex; align-items:center; justify-content:space-between; gap:12px;
}
.brand{display:flex; align-items:center; gap:10px}
.brand-badge{
  width:44px; height:44px;
  border-radius:12px;
  background:#fff;
  border:1px solid var(--border);
  display:flex; align-items:center; justify-content:center;
  overflow:hidden;
  box-shadow:var(--shadow);
}

.brand-logo{
  width:100%;
  height:100%;
  object-fit:contain;
  padding:6px; /* controla o “respiro” */
  display:block;
}

.brand-title{font-weight:800; font-size:16px}
.brand-sub{font-size:12px; color:var(--muted)}
.topbar-actions{display:flex; align-items:center; gap:10px; flex-wrap:wrap; justify-content:flex-end; min-width:0}
.userbox{display:flex; align-items:center; gap:10px; flex-wrap:wrap; min-width:0}
.userbox-meta{text-align:right; min-width:0; max-width:260px}
.userbox-name{font-weight:700; font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.userbox-email{font-size:12px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap}

.app{padding:18px 0 calc(18px + env(safe-area-inset-bottom))}
.container{max-width:1200px; margin:0 auto; padding:0 16px}

.view{min-height:calc(100vh - 74px)}
.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:16px;
}
.card-head{margin-bottom:12px}
.h1{font-size:26px; font-weight:800; margin:0 0 6px}
.h2{font-size:16px; font-weight:800; margin:0 0 6px}
.h3{font-size:14px; font-weight:800; margin:0 0 8px}
.muted{color:var(--muted)}
.small{font-size:12px}

.page-head{
  display:flex; justify-content:space-between; align-items:flex-start;
  gap:14px; margin:12px 0 14px;
}
.head-actions{display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end}

/* LISTA: força empilhar (Dados da lista em cima, Itens abaixo) */
.grid2-stack{
  grid-template-columns: 1fr !important;
}
.grid3{display:grid; grid-template-columns:repeat(3,1fr); gap:14px}
.grid4{display:grid; grid-template-columns:repeat(4,1fr); gap:12px}
.grid5{display:grid; grid-template-columns:1.25fr 1fr 1fr 1fr 1.25fr; gap:12px}

@media (max-width: 980px){
  .grid2{grid-template-columns:1fr}
  .grid3{grid-template-columns:1fr}
  .grid4{grid-template-columns:1fr 1fr}
  .grid5{grid-template-columns:1fr 1fr}
  /* Mantém nome/email visíveis até telas bem menores */
}

@media (max-width: 560px){
  .grid4{grid-template-columns:1fr}
  .grid5{grid-template-columns:1fr}
  .head-actions{width:100%}
  .head-actions .btn{flex:1}

  /* ✅ manter nome do logado visível no mobile */
  .topbar-inner{ gap:10px; }
  .topbar-actions{ gap:8px; }
  .userbox{ flex-wrap:nowrap; gap:8px; }
  .userbox-meta{
    display:block;           /* antes estava none */
    text-align:right;
    max-width:150px;         /* evita estourar */
  }
  .userbox-name{ font-size:12.5px; }
  .userbox-email{ font-size:11.5px; }

  /* Se a tela for muito pequena, esconde só o e-mail (mantém o NOME) */
  @media (max-width: 420px){
    .userbox-meta{ max-width:140px; }
    .userbox-email{ display:none; }
  }

  .top-user-menu-btn{
    min-width:auto;
    padding:10px 12px;
    border-radius:12px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
  }

  .top-user-menu-btn{
  height:40px;
  min-width:40px;
  padding:0 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:#fff;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  cursor:pointer;
}
.top-user-menu-btn:hover{
  background:#f8fafc;
}

/* mobile bottom bar */
.anu-bottom-bar{
  display:none;
  position:fixed;
  left:0;
  right:0;
  bottom:0;
  z-index:9650;
  padding:10px 12px calc(10px + env(safe-area-inset-bottom));
  background:linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(248,250,252,.96) 25%, rgba(248,250,252,.98) 100%);
  backdrop-filter:blur(10px);
}
.anu-bottom-btn{
  width:100%;
  min-height:56px;
  justify-content:space-between;
  gap:12px;
}
.anu-bottom-user{
  min-width:0;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:center;
  overflow:hidden;
}
.anu-bottom-name{
  font-weight:900;
  font-size:13px;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.anu-bottom-email{
  font-size:11px;
  color:var(--muted);
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.anu-bottom-actions{
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:18px;
}

/* mobile sheet */
.anu-sheet-backdrop{
  position:fixed;
  inset:0;
  z-index:9655;
  background:rgba(2,6,23,.44);
  backdrop-filter:blur(6px);
  opacity:0;
  pointer-events:none;
  transition:opacity .18s ease;
}
.anu-sheet-backdrop.show{
  opacity:1;
  pointer-events:auto;
}
.anu-sheet{
  position:fixed;
  left:0;
  right:0;
  bottom:0;
  z-index:9660;
  background:rgba(255,255,255,.98);
  border-top-left-radius:20px;
  border-top-right-radius:20px;
  border:1px solid rgba(2,6,23,.10);
  box-shadow:0 -18px 48px rgba(2,6,23,.22);
  transform:translateY(110%);
  transition:transform .20s ease;
  padding-bottom:env(safe-area-inset-bottom);
}
.anu-sheet.show{
  transform:translateY(0);
}
.anu-sheet-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  padding:14px 14px 10px;
  border-bottom:1px solid rgba(2,6,23,.08);
}
.anu-sheet-name{ font-weight:1000; font-size:14px; }
.anu-sheet-close{
  border:0;
  background:transparent;
  font-size:18px;
  line-height:1;
  cursor:pointer;
  opacity:.75;
  padding:6px 8px;
}
.anu-sheet-close:hover{ opacity:1; }
.anu-sheet-body{
  padding:14px 16px 16px;
  display:grid;
  gap:12px;
}
.anu-sheet-btn{
  width:100%;
  min-height:48px;
  justify-content:flex-start;
  gap:10px;
  padding:12px 14px;
  font-size:16px;
  font-weight:800;
  line-height:1.2;
}
.anu-sheet-btn i{
  font-size:16px;
  width:18px;
  text-align:center;
}
.anu-sheet-btn span{
  font-size:16px;
  font-weight:800;
}

/* desktop offcanvas */
.anu-oc-backdrop{
  position:fixed;
  inset:0;
  z-index:9655;
  background:rgba(2,6,23,.55);
  backdrop-filter:blur(6px);
  opacity:0;
  pointer-events:none;
  transition:opacity .18s ease;
}
.anu-oc-backdrop.show{
  opacity:1;
  pointer-events:auto;
}
.anu-offcanvas{
  position:fixed;
  top:0;
  right:0;
  height:100vh;
  width:min(360px,92vw);
  z-index:9660;
  background:rgba(255,255,255,.96);
  border-left:1px solid rgba(2,6,23,.10);
  box-shadow:-24px 0 80px rgba(2,6,23,.30);
  transform:translateX(110%);
  transition:transform .20s ease;
  display:flex;
  flex-direction:column;
  padding-bottom:env(safe-area-inset-bottom);
}
.anu-offcanvas.show{
  transform:translateX(0);
}
.anu-oc-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  padding:14px 14px 10px;
  border-bottom:1px solid rgba(2,6,23,.08);
}
.anu-oc-name{ font-weight:1000; font-size:14px; }
.anu-oc-close{
  border:0;
  background:transparent;
  font-size:18px;
  line-height:1;
  cursor:pointer;
  opacity:.75;
  padding:6px 8px;
}
.anu-oc-close:hover{ opacity:1; }
.anu-oc-body{
  padding:14px 16px 16px;
  display:grid;
  gap:12px;
}

@media (max-width: 919px){
  .anu-bottom-bar{ display:block; }
  .top-user-menu-btn{ display:none !important; }
  .anu-offcanvas,
  .anu-oc-backdrop{
    display:none !important;
  }
}

@media (min-width: 920px){
  .anu-bottom-bar{ display:none !important; }
  .anu-sheet,
  .anu-sheet-backdrop{
    display:none !important;
  }
}

  /* ✅ Modal mais “mobile friendly” */
  .modal-card{
    width: calc(100vw - 18px);
    margin: 18px auto;
    max-height: calc(100vh - 24px);
    border-radius: 16px;
  }
  .modal-actions{
    flex-direction:column;
    align-items:stretch;
  }
  .modal-actions .btn{
    width:100%;
  }
}

/* ✅ evita estouro de textos longos (ex.: Federação/Entidade) */
.cardtitle,
.cardmeta,
.list-card-title,
.list-card-lines,
.list-card-lines .muted.small{
  word-break: break-word;
  overflow-wrap: anywhere;
}
/* ===== Menu lateral / mobile FAB ===== */
.top-user-menu-btn{
  width:40px;
  height:40px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px solid rgba(2,6,23,0.10);
  background:rgba(255,255,255,0.70);
  backdrop-filter:blur(10px);
  border-radius:14px;
  cursor:pointer;
  box-shadow:0 10px 24px rgba(15,23,42,0.06);
}
.top-user-menu-btn:hover{
  background:rgba(255,255,255,0.85);
}

/* botão flutuante mobile */
.anu-fab-menu{
  position:fixed;
  right:14px;
  bottom:calc(14px + env(safe-area-inset-bottom));
  z-index:9600;
  width:52px;
  height:52px;
  border:none;
  border-radius:999px;
  background:linear-gradient(135deg,var(--csb-blue),var(--csb-blue-soft));
  color:#fff;
  display:none;
  align-items:center;
  justify-content:center;
  box-shadow:0 14px 34px rgba(9,50,98,.30);
  cursor:pointer;
}
.anu-fab-menu i{
  font-size:22px;
  line-height:1;
}
.anu-fab-menu:hover{
  transform:translateY(-1px);
  box-shadow:0 18px 40px rgba(9,50,98,.36);
}

/* mobile sheet */
.anu-sheet-backdrop{
  position:fixed;
  inset:0;
  z-index:9650;
  background:rgba(2,6,23,0.55);
  backdrop-filter:blur(6px);
  opacity:0;
  pointer-events:none;
  transition:opacity .18s ease;
}
.anu-sheet-backdrop.show{
  opacity:1;
  pointer-events:auto;
}
.anu-sheet{
  position:fixed;
  left:10px;
  right:10px;
  bottom:calc(10px + env(safe-area-inset-bottom));
  z-index:9700;
  background:rgba(255,255,255,.99);
  border-radius:20px;
  border:1px solid rgba(2,6,23,0.10);
  box-shadow:0 -18px 48px rgba(2,6,23,.22);
  transform:translateY(110%);
  transition:transform .20s ease;
  height:min(78vh, 620px);
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
.anu-sheet.show{
  transform:translateY(0);
}
.anu-sheet-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  padding:12px 12px 8px;
  border-bottom:1px solid rgba(2,6,23,0.08);
  flex:0 0 auto;
}
.anu-sheet-name{
  font-weight:1000;
  font-size:14px;
}
.anu-sheet-close{
  border:0;
  background:transparent;
  font-size:18px;
  line-height:1;
  cursor:pointer;
  opacity:.75;
  padding:6px 8px;
}
.anu-sheet-close:hover{ opacity:1; }

.anu-sheet-body{
  flex:1 1 auto;
  min-height:0;
  padding:10px 12px 8px;
  display:grid;
  gap:12px;
  overflow-y:auto;
  overflow-x:hidden;
  -webkit-overflow-scrolling:touch;

  scrollbar-width:thin;
  scrollbar-color:rgba(15,75,140,.28) transparent;
}

.anu-sheet-body::-webkit-scrollbar{
  width:4px;
}
.anu-sheet-body::-webkit-scrollbar-track{
  background:transparent;
}
.anu-sheet-body::-webkit-scrollbar-thumb{
  background:rgba(15,75,140,.24);
  border-radius:999px;
}
.anu-sheet-body::-webkit-scrollbar-thumb:hover{
  background:rgba(15,75,140,.34);
}

.anu-menu-group{
  display:grid;
  gap:8px;
}

.anu-menu-label{
  font-size:11px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--muted);
  padding:2px 4px 0;
}

.anu-sheet-btn{
  width:100%;
  min-height:46px;
  display:flex;
  align-items:center;
  justify-content:flex-start !important;
  text-align:left !important;
  gap:10px;
  padding:11px 13px;
  font-size:14px;
  font-weight:800;
  line-height:1.1;
  border:1px solid rgba(15,75,140,.16);
  background:linear-gradient(180deg,#ffffff 0%, #f8fbff 100%);
  border-radius:14px;
  box-shadow:none;
}

.anu-sheet-btn:hover{
  border-color:rgba(15,75,140,.28);
  background:linear-gradient(180deg,#ffffff 0%, #f2f8ff 100%);
  box-shadow:0 10px 24px rgba(15,23,42,.06);
}

.anu-sheet-btn i{
  flex:0 0 18px;
  width:18px;
  text-align:left;
  font-size:15px;
  opacity:.92;
}

.anu-sheet-btn span{
  flex:1 1 auto;
  display:block;
  text-align:left !important;
  font-size:14px;
  font-weight:800;
}

.anu-sheet-footer{
  flex:0 0 auto;
  padding:10px 12px calc(12px + env(safe-area-inset-bottom));
  border-top:1px solid rgba(2,6,23,0.08);
  background:rgba(255,255,255,.98);
}

.anu-sheet-btn-danger{
  border-color:rgba(239,68,68,.18);
  background:linear-gradient(180deg,#fff 0%, #fff6f6 100%);
}

.anu-sheet-btn-danger:hover{
  border-color:rgba(239,68,68,.30);
  background:linear-gradient(180deg,#fff 0%, #fff0f0 100%);
}

/* desktop offcanvas */
.anu-oc-backdrop{
  position:fixed;
  inset:0;
  z-index:9650;
  background:rgba(2,6,23,0.55);
  backdrop-filter:blur(6px);
  opacity:0;
  pointer-events:none;
  transition:opacity .18s ease;
}
.anu-oc-backdrop.show{
  opacity:1;
  pointer-events:auto;
}
.anu-offcanvas{
  position:fixed;
  top:0;
  right:0;
  height:100vh;
  width:min(360px, 92vw);
  z-index:9700;
  background:rgba(255,255,255,0.96);
  border-left:1px solid rgba(2,6,23,0.10);
  box-shadow:-24px 0 80px rgba(2,6,23,0.30);
  transform:translateX(110%);
  transition:transform .20s ease;
  display:flex;
  flex-direction:column;
  padding-bottom:env(safe-area-inset-bottom);
}
.anu-offcanvas.show{
  transform:translateX(0);
}
.anu-oc-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  padding:14px 14px 10px;
  border-bottom:1px solid rgba(2,6,23,0.08);
}
.anu-oc-name{
  font-weight:1000;
  font-size:14px;
}
.anu-oc-close{
  border:0;
  background:transparent;
  font-size:18px;
  line-height:1;
  cursor:pointer;
  opacity:.75;
  padding:6px 8px;
}
.anu-oc-close:hover{ opacity:1; }
.anu-oc-body{
  padding:12px 14px;
  display:grid;
  gap:14px;
  overflow:auto;
}

.anu-oc-footer{
  margin-top:auto;
  padding:12px 14px calc(14px + env(safe-area-inset-bottom));
  border-top:1px solid rgba(2,6,23,0.08);
  background:rgba(255,255,255,.98);
}

.anu-offcanvas .anu-sheet-btn{
  min-height:48px;
  display:flex;
  align-items:center;
  justify-content:flex-start !important;
  text-align:left !important;
  gap:10px;
  padding:12px 14px;
  font-size:15px;
  font-weight:800;
  line-height:1.2;
  border:1px solid rgba(15,75,140,.16);
  background:linear-gradient(180deg,#ffffff 0%, #f8fbff 100%);
  border-radius:14px;
  box-shadow:none;
}
.anu-offcanvas .anu-sheet-btn:hover{
  border-color:rgba(15,75,140,.28);
  background:linear-gradient(180deg,#ffffff 0%, #f2f8ff 100%);
  box-shadow:0 10px 24px rgba(15,23,42,.06);
}
.anu-offcanvas .anu-sheet-btn i{
  flex:0 0 18px;
  width:18px;
  text-align:left;
  font-size:16px;
}
.anu-offcanvas .anu-sheet-btn span{
  flex:1 1 auto;
  display:block;
  text-align:left !important;
  font-size:15px;
  font-weight:800;
}

@media (min-width: 920px){
  .userbox{
    flex-wrap:nowrap;
    gap:8px;
  }
  .userbox-meta{
    display:block;
    text-align:right;
    max-width:260px;
  }
  .anu-fab-menu{ display:none !important; }
}

@media (max-width: 919px){
  .anu-fab-menu{ display:flex !important; }
  .anu-oc-backdrop,
  .anu-offcanvas,
  .top-user-menu-btn{
    display:none !important;
  }
}

@media (min-width: 920px){
  .anu-sheet-backdrop,
  .anu-sheet{
    display:none !important;
  }
}

@media (max-width: 560px){
  .topbar-inner{ gap:10px; }
  .topbar-actions{ gap:8px; }
  .userbox{ flex-wrap:nowrap; gap:8px; }
  .userbox-meta{
    display:block;
    text-align:right;
    max-width:150px;
  }
  .userbox-name{ font-size:12.5px; }
  .userbox-email{ font-size:11.5px; }

  .anu-fab-menu{
    width:48px;
    height:48px;
    right:12px;
    bottom:calc(12px + env(safe-area-inset-bottom));
  }

  .anu-sheet{
    left:8px;
    right:8px;
    bottom:calc(8px + env(safe-area-inset-bottom));
    height:min(82vh, 620px);
  }

  .anu-sheet-btn{
    min-height:42px;
    padding:10px 11px;
    font-size:13px;
  }

  .anu-sheet-btn span{
    font-size:13px;
  }

  .anu-sheet-body::-webkit-scrollbar{
    width:3px;
  }
}

@media (max-width: 420px){
  .userbox-meta{ max-width:140px; }
  .userbox-email{ display:none; }
}
.btn{
  border:1px solid var(--border);
  background:#fff;
  color:var(--text);
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
  font-weight:700;
  display:inline-flex; gap:8px; align-items:center; justify-content:center;
  transition:transform .05s ease, box-shadow .12s ease, border-color .12s ease;
}
.btn:hover{box-shadow:0 10px 20px rgba(15,23,42,.08)}
.btn:active{transform:translateY(1px)}
.btn[disabled]{opacity:.5; cursor:not-allowed; box-shadow:none}

.btn-primary{
  background:linear-gradient(135deg,var(--csb-green),#1db954);
  color:#fff;
  border-color:rgba(0,0,0,.0);
}
.btn-outline{
  border-color:rgba(15,75,140,.25);
  background:rgba(15,75,140,.03);
}
.btn-ghost{
  border-color:transparent;
  background:transparent;
}

.link{
  border:0; background:transparent; cursor:pointer; color:var(--csb-blue-soft);
  font-weight:800; padding:0; display:inline-flex; gap:6px; align-items:center;
}

.pill{
  display:inline-flex; gap:8px; align-items:center;
  border:1px solid var(--border);
  border-radius:999px;
  padding:7px 10px;
  font-size:12px;
  background:#fff;
  color:var(--muted);
  font-weight:800;
}
.pill i{font-size:14px}
.pill-gray{background:#f8fafc}
.pill-yellow{background:rgba(244,180,0,.14); border-color:rgba(244,180,0,.35); color:#8a5800}
.pill-blue{background:rgba(15,75,140,.10); border-color:rgba(15,75,140,.25); color:var(--csb-blue)}
.pill-green{background:rgba(33,161,87,.12); border-color:rgba(33,161,87,.25); color:#0f6b3a}
.pill-muted{background:#f1f5f9}

.sep{
  display:flex; align-items:center; gap:10px;
  margin:14px 0;
}
.sep:before, .sep:after{
  content:""; flex:1; height:1px; background:var(--border);
}
.sep span{color:var(--muted); font-size:12px; font-weight:900}

.sep2{height:1px; background:var(--border); margin:12px 0}

.form{display:grid; gap:12px}
.field{display:grid; gap:6px}
.field span{font-size:12px; color:var(--muted); font-weight:800}
/* Inputs “normais” (texto, número, email, etc) */
.field input:not([type="checkbox"]):not([type="radio"]),
.field select,
.field textarea{
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px 12px;
  font:inherit;
  outline:none;
  background:#fff;
  width:100%;
  max-width:100%;
  min-width:0; /* essencial em grid/flex */
}

/* Campo com erro (validação) */
.field.field-error span{
  color: var(--danger);
}
.field.field-error input:not([type="checkbox"]):not([type="radio"]),
.field.field-error select,
.field.field-error textarea{
  border-color: var(--danger);
  background: var(--danger-soft);
  box-shadow: 0 0 0 3px rgba(239,68,68,0.12);
}


/* Checkbox/Radio NÃO podem herdar estilo de input de texto */
.field input[type="checkbox"],
.field input[type="radio"]{
  width:auto;
  max-width:none;
  padding:0;
  border:none;
  background:transparent;
  border-radius:0;
}
.field textarea{min-height:120px; resize:vertical}
.field-inline{display:flex; gap:10px; align-items:center}

.row{display:flex; gap:10px; align-items:center; flex-wrap:wrap}
.row > *{min-width:0}
.row-between{display:flex; justify-content:space-between; align-items:center; gap:10px; margin-top:8px}

.breadcrumbs{display:flex; gap:8px; align-items:center; margin-bottom:6px}

.section{margin-top:14px}
.section-head{display:flex; justify-content:space-between; align-items:flex-end; gap:10px; margin:6px 0 10px}

.cards{display:grid; grid-template-columns:repeat(2,1fr); gap:14px}
@media (max-width: 980px){ .cards{grid-template-columns:1fr} }

.cardline{display:flex; justify-content:space-between; align-items:flex-start; gap:10px}
.cardtitle{font-weight:900; font-size:14px}
.cardmeta{font-size:12px; color:var(--muted); margin-top:3px}
.badgeRow{display:flex; gap:8px; flex-wrap:wrap; margin-top:8px}
.cardactions{display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end}

.tablewrap{overflow:auto; border:1px solid var(--border); border-radius:14px}
table{width:100%; border-collapse:collapse; min-width:760px; background:#fff}
th, td{padding:10px 10px; border-bottom:1px solid var(--border); font-size:13px}
th{font-size:12px; color:var(--muted); text-align:left}
td.center, th.center{text-align:center}
td .btn{padding:8px 10px; border-radius:10px}
.td-actions{white-space:nowrap}

/* ===== People Admin: sticky header + paginação + cards ===== */
#peopleTable thead th{
  position:sticky;
  top:0;
  background:#fff;
  z-index:5;
}
#peopleTable thead th::after{
  content:"";
  position:absolute;
  left:0; right:0; bottom:-1px;
  height:1px;
  background:var(--border);
}
.select-sm{
  height:40px;
  padding:8px 10px;
  border-radius:12px;
  border:1px solid var(--border);
  background:#fff;
  color:var(--text);
  font-weight:700;
}

.people-cards{display:none}
.people-card{
  border:1px solid var(--border);
  border-radius:14px;
  background:#fff;
  padding:12px;
}
.people-card .pc-head{display:flex; justify-content:space-between; gap:10px; align-items:flex-start}
.people-card .pc-title{font-weight:1000; font-size:14px}
.people-card .pc-sub{color:var(--muted); font-size:12px; margin-top:3px; word-break:break-word}
.people-card .pc-grid{display:grid; grid-template-columns:1fr; gap:6px; margin-top:10px}
.people-card .pc-line{display:flex; justify-content:space-between; gap:10px; font-size:13px}
.people-card .pc-line .k{color:var(--muted); font-size:12px; white-space:nowrap}
.people-card .pc-line .v{font-weight:700; text-align:right; word-break:break-word}
.people-card .pc-actions{display:flex; gap:10px; justify-content:flex-end; margin-top:10px; flex-wrap:wrap}

@media (max-width: 860px){
  .people-tablewrap{display:none}
  .people-cards{display:grid; grid-template-columns:1fr; gap:12px}
  table{min-width:0}
}

.kpi{display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin:8px 0 12px}
.kpi-item{border:1px dashed var(--border); border-radius:12px; padding:10px; min-width:0}
.kpi-val{
  font-size:18px;
  font-weight:900;
  white-space:normal;        /* permite quebrar linha */
  overflow-wrap:anywhere;    /* evita estouro */
  line-height:1.15;
}

/* ✅ KPIs responsivas no mobile (evita “Criada em” estourar) */
@media (max-width: 560px){
  .kpi{ grid-template-columns: 1fr 1fr; }
  .kpi-val{ font-size:16px; }
}
@media (max-width: 420px){
  .kpi{ grid-template-columns: 1fr; }
}

.filters{padding:12px}

/* ===== Histórico (timeline) ===== */
.hist-wrap{display:grid; gap:12px}
.hist-top{padding:6px 2px 2px}
.hist-top-title{font-weight:1000; font-size:15px}
.hist-top-sub{margin-top:2px}

.hist-day{margin-top:6px}
.hist-day-title{
  font-weight:900;
  font-size:12px;
  letter-spacing:.02em;
  color:var(--muted);
  margin:10px 0 6px;
  text-transform:uppercase;
}

.hist-list{display:grid; gap:10px}

.hist-item{display:grid; grid-template-columns:18px 1fr; gap:10px}
.hist-left{position:relative}
.hist-dot{
  width:10px; height:10px; border-radius:999px;
  border:2px solid var(--border);
  background:#fff;
  margin-top:14px;
  position:relative;
  z-index:2;
}
.hist-line{
  position:absolute;
  left:5px;
  top:26px;
  bottom:-10px;
  width:2px;
  background:var(--border);
}

.hist-card{
  border:1px solid var(--border);
  border-radius:14px;
  background:#fff;
  padding:10px 12px;
  box-shadow:0 10px 24px rgba(15,23,42,0.05);
}

.hist-row1{display:flex; align-items:flex-start; justify-content:space-between; gap:10px}
.hist-action{display:flex; align-items:center; gap:8px; flex-wrap:wrap}
.hist-action-text{font-weight:900}
.hist-when{white-space:nowrap}

.hist-row2{display:flex; align-items:center; gap:8px; margin-top:4px}

.hist-pill{
  font-size:11px;
  padding:4px 8px;
  border-radius:999px;
  border:1px solid var(--border);
  font-weight:900;
}
.hist-info{background:#eff6ff}
.hist-ok{background:#ecfdf5}
.hist-warn{background:#fff7ed}
.hist-danger{background:#fef2f2}

.hist-chips{display:flex; flex-wrap:wrap; gap:6px; margin-top:8px}
.hist-chip{
  font-size:12px;
  border:1px dashed var(--border);
  border-radius:999px;
  padding:5px 8px;
  background:#fff;
}

.hist-details{margin-top:8px}
.hist-details summary{
  cursor:pointer;
  font-weight:900;
  font-size:12px;
  color:var(--muted);
}
.hist-json{
  margin:8px 0 0;
  padding:10px;
  border:1px solid var(--border);
  border-radius:12px;
  background:#f9fafb;
  font-size:12px;
  overflow:auto;
  max-height:240px;
}

/* NOVO toast padrão “CTPA” (mais limpo e com título) */
.toast{
  position:fixed; right:16px; bottom:16px; z-index:60;
  background:#fff; color:var(--text);
  border:1px solid var(--border);
  border-radius:14px;
  padding:12px 12px;
  box-shadow:0 14px 34px rgba(0,0,0,.14);
  max-width:460px;
  display:flex; gap:10px; align-items:flex-start;
}
.toast .dot{
  width:10px; height:10px; border-radius:999px; margin-top:6px; flex:0 0 auto;
  background:#2563eb;
}
.toast.ok .dot{background:#16a34a}
.toast.err .dot{background:#dc2626}
.toast.warn .dot{background:#f59e0b}
.toast .t-body{min-width:0}
.toast .t-title{font-weight:900; font-size:13px; margin:0}
.toast .t-msg{font-size:12px; color:var(--muted); margin-top:4px; line-height:1.35; word-break:break-word}
.toast .t-x{margin-left:auto; border:0; background:transparent; cursor:pointer; color:var(--muted); font-weight:1000}

.modal{position:fixed; inset:0; z-index:40}
.modal-backdrop{position:absolute; inset:0; background:rgba(2,6,23,.55)}
.modal-card{
  position:relative;
  width:min(760px, calc(100% - 28px));
  margin:60px auto;
  background:#fff;
  border-radius:18px;
  box-shadow:0 24px 60px rgba(0,0,0,.22);
  overflow:hidden;
  display:flex;
  flex-direction:column;
  max-height:calc(100vh - 48px);
}
.modal-head{display:flex; justify-content:space-between; align-items:center; padding:14px 14px 0}
.modal-title{font-weight:900; font-size:15px}
.modal-body{
  padding:12px 14px 12px;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
}
.modal-actions{display:flex; justify-content:flex-end; gap:10px; padding:0 14px 14px}
@media (max-width:560px){ .modal-card{margin:24px auto} }

.auth-wrap{
  max-width:1100px; margin:0 auto; padding:16px;
  display:grid; grid-template-columns:1fr 0.8fr; gap:14px; align-items:start;
}
@media (max-width: 980px){ .auth-wrap{grid-template-columns:1fr} }

.bullets{margin:10px 0 0; padding-left:18px}
.bullets li{margin:8px 0}

/* Modal "Como funciona" */
.how-grid{display:grid; gap:12px}
.how-section{
  border:1px solid var(--border);
  border-radius:14px;
  padding:12px;
  background:rgba(15,75,140,.03);
}
.steps{margin:10px 0 0; padding-left:18px}
.steps li{margin:8px 0}

.callout{
  display:flex;
  gap:10px;
  align-items:flex-start;
  border-radius:14px;
  padding:12px;
  border:1px solid rgba(245,158,11,.35);
  background:rgba(245,158,11,.10);
}
.callout i{margin-top:2px}
.callout.warn b{display:block; margin-bottom:4px}

.paylink{
  border:1px dashed rgba(15,75,140,.35);
  border-radius:14px;
  padding:12px;
  background:rgba(15,75,140,.04);
}
.paylink-row{display:flex; justify-content:space-between; gap:10px; align-items:center; flex-wrap:wrap}
.paylink-actions{display:flex; gap:10px; flex-wrap:wrap}

.tabs{display:flex; gap:10px; margin:12px 0}
.tab{
  border:1px solid var(--border);
  border-radius:999px;
  background:#fff;
  padding:8px 12px;
  cursor:pointer;
  font-weight:900;
  color:var(--muted);
}
.tab.active{color:var(--text); border-color:rgba(15,75,140,.35); background:rgba(15,75,140,.06)}
.tabpane{padding:10px 0}

/* garante que o atributo hidden sempre esconda */
[hidden] { display: none !important; }


.toast{ animation: toastIn .16s ease-out; }
@keyframes toastIn{
  from{ transform: translateY(8px); opacity:0; }
  to{ transform: translateY(0); opacity:1; }
}


/* Cadastro de Pessoas */
.colsbox{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:6px 0}
.colcheck{display:flex;align-items:center;gap:10px}
.cpfname{line-height:1.1}


/* Autocomplete de Entidade (Criar lista) */
.ac-list{display:grid; gap:8px}
.ac-item{
  width:100%;
  text-align:left;
  border:1px solid var(--border);
  background:#fff;
  border-radius:12px;
  padding:10px 12px;
  cursor:pointer;
}
.ac-item:hover{box-shadow:0 10px 20px rgba(15,23,42,.08)}
.ac-title{font-weight:900; font-size:13px}
.ac-sub{margin-top:4px}
.pill-warn{background:rgba(245,158,11,.14); border-color:rgba(245,158,11,.35); color:#8a5800}


/* ===== Destaque "Criar entidade" no autocomplete ===== */
.ac-item.ac-create{
  display:flex;
  align-items:center;
  gap:12px;
  width:100%;
  text-align:left;

  background:rgba(34,197,94,.12); /* verde claro */
  border:1px solid rgba(34,197,94,.25);
}

.ac-item.ac-create:hover{
  background:rgba(34,197,94,.16);
  border-color:rgba(34,197,94,.35);
}

.ac-item.ac-create:focus-visible{
  outline:3px solid rgba(34,197,94,.25);
  outline-offset:2px;
}

.ac-item.ac-create .ac-left{
  display:flex;
  align-items:center;
  justify-content:center;
}

.ac-item.ac-create .ac-plus{
  width:34px;
  height:34px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;

  background:rgba(22,163,74,.14);      /* verde mais escuro (fundo) */
  border:1px solid rgba(22,163,74,.35); /* verde mais escuro (borda) */
  color:rgba(22,163,74,.95);            /* verde mais escuro (ícone) */
}

.ac-item.ac-create .ac-plus i{
  font-size:14px;
  line-height:1;
}

.ac-item.ac-create .ac-right{
  display:flex;
  flex-direction:column;
  gap:2px;
  min-width:0;
}


/* Aviso abaixo da entidade selecionada (Criar lista) */
.ent-warn-box{
  margin-top:10px;
  display:flex;
  gap:10px;
  align-items:flex-start;

  padding:10px 12px;
  border-radius:12px;

  background:rgba(245,158,11,.12);
  border:1px solid rgba(245,158,11,.35);
  color:#8a5800;
}

.ent-warn-box i{
  font-size:16px;
  margin-top:2px;
  flex:0 0 auto;
}

.ent-warn-title{
  font-weight:900;
  font-size:14px;
  line-height:1.2;
}

.ent-warn-sub{
  margin-top:5px;
  font-size:13px;
  opacity:.95;
  line-height:1.4;
}



/* =========================
   Busy / Loading UI (delayed)
   ========================= */
#topProgress{
  position:fixed;
  top:0; left:0; right:0;
  height:3px;
  z-index:99999;
  opacity:0;
  pointer-events:none;
  background: linear-gradient(90deg, rgba(46,204,113,.2), rgba(52,152,219,.95), rgba(241,196,15,.95), rgba(52,152,219,.95), rgba(46,204,113,.2));
  background-size: 220% 100%;
  animation: topProgressMove 1.05s linear infinite;
  transition: opacity .18s ease;
}
#topProgress.show{ opacity:1; }

@keyframes topProgressMove{
  0%{ background-position: 0% 0; }
  100%{ background-position: 220% 0; }
}

#busyOverlay{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
  z-index:99998;
  opacity:0;
  pointer-events:none;
  background: rgba(0,0,0,.22);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  transition: opacity .18s ease;
}
#busyOverlay.show{
  opacity:1;
  pointer-events:auto;
}

#busyOverlay .busy-card{
  width:min(520px, 100%);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 18px 60px rgba(0,0,0,.18);
  padding: 16px 16px 14px;
  border: 1px solid rgba(0,0,0,.06);
}

#busyOverlay .busy-brand{
  display:flex;
  align-items:center;
  gap:12px;
}
#busyOverlay .busy-brand img{
  width:46px;
  height:46px;
  object-fit:contain;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.10));
}

#busyOverlay .busy-text{ min-width:0; }
#busyOverlay .busy-title{
  font-weight: 900;
  letter-spacing: .2px;
  font-size: 14px;
  line-height: 1.15;
}
#busyOverlay .busy-sub{
  margin-top: 3px;
  font-size: 12px;
  opacity: .72;
  line-height: 1.2;
}

#busyOverlay .busy-bar{
  margin-top: 12px;
  height: 10px;
  border-radius: 999px;
  overflow:hidden;
  background: rgba(0,0,0,.06);
}
#busyOverlay .busy-bar-inner{
  height:100%;
  width:38%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(46,204,113,.35), rgba(52,152,219,.95), rgba(241,196,15,.95));
  animation: busyBarMove 1.0s ease-in-out infinite;
}

@keyframes busyBarMove{
  0%{ transform: translateX(-60%); width: 35%; }
  50%{ transform: translateX(60%);  width: 55%; }
  100%{ transform: translateX(-60%); width: 35%; }
}
/* =========================
   Listas gerais: resumo (totais por status)
   ========================= */
.summarybar{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
  margin-top:10px;
}

.summarybar .sumchip{
  display:inline-flex;
  gap:6px;
  align-items:baseline;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid var(--border, #e5e7eb);
  background:#fff;
  font-size:13px;
  line-height:1;
}

.summarybar .sumchip b{ font-weight:700; }

.summarybar .sum-draft{ background: #fff7ed; border-color:#fed7aa; }
.summarybar .sum-pending{ background: #eff6ff; border-color:#bfdbfe; }
.summarybar .sum-paid{ background: #ecfdf5; border-color:#bbf7d0; }
.summarybar .sum-total{ background: #f3f4f6; border-color:#e5e7eb; }


.pill-review{
  background:#fff7ed;
  border-color:#fed7aa;
  color:#9a3412;
  font-weight:800;
}


/* =========================
   Billing: Busy overlay + Top progress
   ========================= */
#topProgress{
  position: fixed;
  top: 0; left: 0;
  width: 0%;
  height: 3px;
  background: rgba(20, 120, 255, .85);
  z-index: 9999;
  opacity: 0;
  transition: opacity .15s ease, width .35s ease;
}
#topProgress.show{
  opacity: 1;
  width: 100%;
}

#busyOverlay{
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(10, 18, 40, 0.35);
  backdrop-filter: blur(2px);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
#busyOverlay.show{
  opacity: 1;
  pointer-events: auto;
}

.busy-card{
  width: min(520px, calc(100vw - 28px));
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(15,75,140,0.12);
  border-radius: 18px;
  padding: 14px 14px 12px;
  box-shadow: 0 18px 55px rgba(0,0,0,0.18);
}
.busy-brand{
  display:flex;
  align-items:center;
  gap:12px;
}
.busy-brand img{
  width: 38px;
  height: 38px;
  object-fit: contain;
}
.busy-title{
  font-weight: 900;
  font-size: 14px;
}
.busy-sub{
  margin-top: 2px;
  font-size: 12px;
  opacity: .75;
}
.busy-bar{
  margin-top: 12px;
  height: 10px;
  background: rgba(15,75,140,0.08);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(15,75,140,0.10);
}
.busy-bar-inner{
  height: 100%;
  width: 40%;
  background: rgba(20, 120, 255, .65);
  border-radius: 999px;
  animation: busySlide 1.05s infinite ease-in-out;
}
@keyframes busySlide{
  0%{ transform: translateX(-80%); }
  50%{ transform: translateX(120%); }
  100%{ transform: translateX(-80%); }
}

/* =========================
   Itens (LISTA): Cards slim no mobile
   ========================= */
.items-cards{
  display: none;
  margin-top: 12px;
  gap: 10px;
}
.item-card{
  border: 1px solid rgba(15,75,140,0.12);
  background: rgba(255,255,255,0.72);
  border-radius: 14px;
  padding: 10px 12px;
}
.item-card .ic-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}
.item-card .ic-ident{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
  line-height: 1.1;
}
.item-card .ic-idx{
  font-weight: 900;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(15,75,140,0.08);
  border: 1px solid rgba(15,75,140,0.10);
}
.item-card .ic-code{
  font-weight: 900;
  font-size: 14px;
}
.item-card .ic-actions{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.item-card .ic-name{
  margin-top: 6px;
  font-size: 12px;
  opacity: .78;
}
.item-card .ic-grid{
  margin-top: 8px;
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:8px 12px;
}
.item-card .ic-field{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
  padding: 6px 8px;
  border-radius: 12px;
  background: rgba(15,75,140,0.04);
  border: 1px solid rgba(15,75,140,0.08);
}
.item-card .ic-field span{
  font-size: 11px;
  opacity: .7;
  white-space: nowrap;
}
.item-card .ic-field b{
  font-size: 12px;
}
.item-card .ic-flags{
  margin-top: 8px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.item-card .ic-flag{
  display:flex;
  align-items:center;
  gap:8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.03);
  border: 1px solid rgba(0,0,0,0.08);
  font-size: 12px;
}
.item-card .ic-obs{
  margin-top: 8px;
  font-size: 12px;
  opacity: .8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* troca: no mobile esconde tabela e mostra cards */
@media (max-width: 860px){
  #itemsTableWrap{ display:none !important; }
  .items-cards{ display:grid !important; }
  .item-card .ic-grid{ grid-template-columns: 1fr; }
}

/* =========================
   Billing: Compact cards (padrão index)
   ========================= */
.bill-card{
  padding: 14px;
}

.bill-row{
  display:flex;
  gap:12px;
  align-items:flex-start;
  justify-content:space-between;
  flex-wrap:wrap;
}

.bill-left{
  min-width: 260px;
  flex: 1;
}

.bill-title{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}

.bill-entity{
  font-weight: 900;
  font-size: 16px;
  line-height: 1.15;
}

.bill-sub{
  margin-top: 6px;
}

.bill-right{
  display:flex;
  gap:12px;
  align-items:flex-end;
  justify-content:flex-end;
  flex-wrap:wrap;
  text-align:right;
}

.bill-total .bill-money{
  font-size: 18px;
  font-weight: 900;
  line-height: 1.1;
}

.bill-paylink{
  width: min(420px, 100%);
  text-align:left;
  background: rgba(15,75,140,0.04);
  border: 1px solid rgba(15,75,140,0.10);
  border-radius: 12px;
  padding: 10px 12px;
}

.bill-paylink-k{
  font-weight: 900;
  letter-spacing: .2px;
}

.bill-paylink-v{
  margin-top: 4px;
  font-weight: 700;
  font-size: 12.5px;
  word-break: break-word;
}

.bill-actions{
  display:flex;
  gap:8px;
  justify-content:flex-end;
}

@media (max-width: 760px){
  .bill-right{
    width: 100%;
    justify-content:space-between;
    text-align:left;
    align-items:stretch;
  }
  .bill-actions{
    justify-content:flex-start;
  }
}


/* =========================
   Billing page spacing (igual index)
   ========================= */
.app{
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 18px 50px;
}

@media (max-width: 520px){
  .app{ padding: 12px 12px 40px; }
}

/* grid 2 colunas no desktop */
.billing-grid{
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

@media (min-width: 980px){
  .billing-grid{
    grid-template-columns: 1fr 1fr;
  }
}

/* =========================
   Card padrão index (compacto)
   ========================= */
.list-card{
  padding: 16px;
  border-radius: 16px;
}

.list-card-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.list-card-title{
  font-weight: 900;
  font-size: 16px;
  line-height: 1.2;
}

.btn-sm{
  padding: 10px 12px !important;
  border-radius: 14px !important;
  font-weight: 800 !important;
}

.list-card-lines{
  margin-top: 8px;
  display:flex;
  flex-direction:column;
  gap:4px;
}

.list-card-foot{
  margin-top: 10px;
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:10px;
}

.list-card-price{
  font-weight: 900;
  font-size: 18px;
  white-space: nowrap;
}

/* Billing cards: fonte um pouco maior (sem exagero) */
.list-card-lines .muted.small{
  font-size: 13px;           /* era 12px */
  line-height: 1.35;
}

.list-card-title{
  font-size: 17px;           /* era 16px */
}

.list-card-price{
  font-size: 19px;           /* era 18px */
}

/* opcional: deixa o badge um tiquinho maior */
.pill{
  font-size: 12.5px;         /* era 12px */
}



/* ---- Billing: seleção / batch ---- */
.batchbar{
  display:flex;
  gap:12px;
  align-items:flex-end;
  justify-content:space-between;
  padding:12px;
  border:1px solid rgba(255,255,255,.10);
  border-radius:14px;
  background:rgba(0,0,0,.18);
}
.batchbar-title{ font-weight:800; }
.batchbar-meta{ font-size:13px; opacity:.9; margin-top:4px; }
.batchbar-right{ display:flex; gap:10px; align-items:flex-end; flex-wrap:wrap; justify-content:flex-end; }
.list-card-select{
  display:flex;
  align-items:center;
  gap:8px;
  user-select:none;
}
.list-card-select input{ width:18px; height:18px; }


  /* Garantir camadas corretas */
  #toast{
    position: fixed !important;
    z-index: 99999 !important; /* acima de modal */
  }
  #modal{
    z-index: 9000 !important;
  }
  #busyOverlay{
    z-index: 95000 !important; /* acima de tudo enquanto carregando */
  }
  #topProgress{
    z-index: 95001 !important;
  }

  /* Modal sempre encaixado na viewport (desktop e mobile) */
  #modal .modal-card{
    width: min(760px, calc(100vw - 24px)) !important;
    max-width: 760px !important;
    max-height: calc(100vh - 24px) !important;
    margin: 12px auto !important;
    display: flex !important;
    flex-direction: column !important;
  }
  #modal .modal-body{
    overflow: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  /* Em telas menores, força 1 coluna no grid do modal */
  @media (max-width: 820px){
    #modal .modal-body > .grid{
      grid-template-columns: 1fr !important;
    }
  }



  /* Billing: subtítulo abaixo do título do card (Modalidade + Tipo) */
.list-card-titlebox{
  display:flex;
  flex-direction:column;
  gap:2px;
  min-width:0;
}

.list-card-submeta{
  margin-top:2px;
  font-size:12.5px;
  line-height:1.2;
}

/* Billing: linha 2 (ATLETAS / TÉCNICOS) com destaque maior */
.list-card-type{
  font-weight: 900;
  font-size: 13.5px;
  line-height: 1.15;
  color: var(--csb-blue-soft);
  margin-top: 2px;
}


/* =========================
   Cards: menu de ações no mobile
   ========================= */
.actions-menu{ position:relative; }
.actions-menu summary{ list-style:none; cursor:pointer; }
.actions-menu summary::-webkit-details-marker{ display:none; }

.cardactions-inline{ display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end; }
.cardactions-menu{ display:none; }

.actions-menu .menu-pop{
  position:absolute;
  right:0;
  top:44px;
  width:min(220px, 80vw);
  background:#fff;
  border:1px solid var(--border);
  border-radius:14px;
  box-shadow:0 18px 48px rgba(0,0,0,.14);
  padding:8px;
  z-index:30;
}

.actions-menu .menu-item{
  width:100%;
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 10px;
  border-radius:12px;
  border:1px solid transparent;
  background:transparent;
  cursor:pointer;
  font-weight:800;
  color:var(--text);
  text-align:left;
}
.actions-menu .menu-item:hover{
  background: rgba(15,75,140,.05);
  border-color: rgba(15,75,140,.10);
}
.actions-menu .menu-item.danger{
  color: var(--danger);
}
.actions-menu .menu-item.danger:hover{
  background: var(--danger-soft);
  border-color: rgba(239,68,68,.20);
}

/* ✅ no mobile, esconde os botões soltos e mostra o menu */
@media (max-width: 560px){
  .cardactions-inline{ display:none; }
  .cardactions-menu{ display:block; }
}


/* ===== Dashboard menu (desktop + mobile) ===== */
.dash-menu .menu-pop{
  top: 48px;               /* distância do botão */
  min-width: 240px;
}

@media (max-width: 560px){
  .dash-menu summary.btn{
    flex: 1;               /* fica do tamanho do Criar Lista */
    justify-content: center;
  }
  .dash-menu .menu-pop{
    width: min(260px, 92vw);
  }
}

/* opcional: no desktop deixar o botão "Menu" mais compacto */
@media (min-width: 561px){
  .dash-menu summary.btn{
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* ========= Navegação / Page Head mais estável ========= */
.page-head{
  flex-wrap:wrap;
}
.page-head > div:first-child{
  flex:1;
  min-width:260px;
}
.head-actions{
  flex-shrink:0;
  align-items:flex-start;
}

/* ========= Menu “Exportar” ========= */
.export-menu .menu-pop{
  top: 46px;
  min-width: 220px;
}

/* Mobile: header mais “organizado” */
@media (max-width: 560px){
  .page-head{
    flex-direction:column;
    align-items:stretch;
  }
  .head-actions{
    width:100%;
    justify-content:flex-start; /* exportar fica mais natural do que colado à direita */
  }
  .export-menu summary.btn{
    width:100%;
    justify-content:center;
  }
  .export-menu .menu-pop{
    width: min(260px, 92vw);
  }
}


/* ===== Botão VOLTAR mais intuitivo ===== */
.backbtn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid rgba(15,75,140,.20);
  background:rgba(15,75,140,.04);
  color:var(--csb-blue-soft);
  cursor:pointer;
  font-weight:900;
}
.backbtn:hover{
  background:rgba(15,75,140,.07);
  box-shadow:0 10px 20px rgba(15,23,42,.06);
}
.backbtn:active{ transform: translateY(1px); }

/* melhora o alinhamento do breadcrumb */
.breadcrumbs{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.breadcrumbs .muted{ white-space:nowrap; }

/* Mobile: botão voltar com área de toque maior */
@media (max-width:560px){
  .backbtn{ padding:10px 12px; }
}


/* =========================
   Boot: evita "flash" da tela de login antes do auth resolver
   ========================= */
body.booting .view{
  display: none !important;
}


/* =========================
   Billing: mini loader de sincronização (entre filtros)
   ========================= */
.mini-sync{
  margin-top: 10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;

  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(15,75,140,.14);
  background: rgba(15,75,140,.05);
}

.mini-sync-left{
  display:flex;
  gap:10px;
  align-items:center;
  min-width:0;
}

.mini-spinner{
  width:14px;
  height:14px;
  border-radius:999px;
  border:2px solid rgba(15,75,140,.22);
  border-top-color: rgba(15,75,140,.85);
  animation: miniSpin .8s linear infinite;
  flex:0 0 auto;
}

@keyframes miniSpin{
  from{ transform: rotate(0deg); }
  to{ transform: rotate(360deg); }
}

.mini-sync-text{ min-width:0; }
.mini-sync-title{
  font-weight: 900;
  font-size: 12.5px;
  line-height: 1.1;
}
.mini-sync-sub{
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.1;
}

.mini-sync-hide{
  padding: 8px 10px;
  border-radius: 12px;
}


/* =========================
   LISTA (mobile): botões + tabela navegável
   ========================= */

@media (max-width: 560px){

  /* 1) Barra de ações do card "Itens" vira grid (2 colunas) */
  #viewList .list-actions{
    display:grid !important;
    grid-template-columns: 1fr 1fr;
    gap:10px;
    align-items:stretch;
  }
  #viewList .list-actions .btn{
    width:100%;
    justify-content:center;
  }
  /* CTA principal em largura total */
  #viewList .list-actions #btnSendBilling{
    grid-column: 1 / -1;
  }

  /* 2) Tabela: deixa "arrastável" e legível */
  #viewList .tablewrap{
    overflow:auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 14px;
  }

  /* aumenta a largura mínima para evitar esmagar */
  #viewList #itemsTable{
    min-width: 980px; /* força scroll horizontal em vez de comprimir */
  }

  #viewList #itemsTable th,
  #viewList #itemsTable td{
    padding: 9px 10px;
    font-size: 12.5px;
  }

  /* 3) Sticky nas 2 primeiras colunas (# e CPF) para navegação */
  #viewList #itemsTable th:nth-child(1),
  #viewList #itemsTable td:nth-child(1){
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 6;
  }

  #viewList #itemsTable th:nth-child(2),
  #viewList #itemsTable td:nth-child(2){
    position: sticky;
    left: 46px; /* largura aproximada da coluna # */
    background: #fff;
    z-index: 6;
    box-shadow: 10px 0 18px rgba(15,23,42,0.06);
  }

  /* 4) Mantém “Obs” mais leve (é o que mais estoura) */
  #viewList #itemsTable th:nth-child(9),
  #viewList #itemsTable td:nth-child(9){
    max-width: 220px;
    white-space: normal;
    overflow-wrap: anywhere;
    color: var(--muted);
  }
}

/* dica opcional: melhora a leitura do nome que fica abaixo do CPF */
#viewList .cpfname{
  margin-top: 4px;
  line-height: 1.15;
}

/* ===== Ajuste fino do menu no mobile ===== */
@media (max-width: 560px){
  .anu-sheet-head{
    padding:16px 16px 12px;
  }

  .anu-sheet-name{
    font-size:15px;
    font-weight:1000;
  }

  .anu-sheet-body{
    gap:14px;
  }

  .anu-sheet-btn{
    min-height:52px;
    padding:13px 15px;
    border-radius:14px;
  }

  .anu-sheet-btn i{
    font-size:17px;
    width:20px;
  }

  .anu-sheet-btn span{
    font-size:17px;
    font-weight:800;
  }
}

/* ===== Ajuste fino do menu no desktop ===== */
@media (min-width: 920px){
  .anu-oc-name{
    font-size:15px;
  }

  .anu-offcanvas .anu-sheet-btn{
    border-radius:14px;
  }
}

/* ===== Gate de entidade / solicitação ===== */
.entity-empty-state{
  margin-bottom:14px;
  border:1px solid rgba(15,75,140,.16);
  background:
    linear-gradient(180deg, rgba(15,75,140,.05), rgba(15,75,140,.02)),
    #fff;
  display:flex;
  gap:16px;
  align-items:flex-start;
}

.entity-empty-icon{
  width:58px;
  height:58px;
  min-width:58px;
  border-radius:18px;
  display:grid;
  place-items:center;
  background:rgba(15,75,140,.10);
  color:#0f4b8c;
  font-size:1.45rem;
}

.entity-empty-body{
  min-width:0;
}

.entity-empty-label{
  font-size:.78rem;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.04em;
  color:#0f4b8c;
  margin-bottom:4px;
}

.entity-empty-title{
  font-size:1.08rem;
  font-weight:900;
  line-height:1.28;
  color:#0f172a;
  margin-bottom:6px;
}

.entity-empty-text{
  font-size:.96rem;
  line-height:1.55;
  color:var(--muted);
}

.entity-badge-row{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:8px;
}

.pill-pending{
  background:rgba(245,158,11,.14);
  border-color:rgba(245,158,11,.35);
  color:#8a5800;
}

.pill-federation{
  background:rgba(15,75,140,.10);
  border-color:rgba(15,75,140,.25);
  color:#0f4b8c;
}

.pill-linked-entity{
  background:rgba(33,161,87,.12);
  border-color:rgba(33,161,87,.25);
  color:#0f6b3a;
}

@media (max-width: 720px){
  .entity-empty-state{
    flex-direction:column;
  }

  .entity-empty-icon{
    width:52px;
    height:52px;
    min-width:52px;
  }
}