/* F10.1-r2 — Visual System: padrão moderno, profissional e white-label. */
:root{
  --product-primary:#0f2d5b;
  --product-deep:#1e4e8c;
  --product-gold:#d4a833;
  --brand-primary:var(--product-primary);
  --brand-accent:var(--product-deep);
  --nav:var(--product-primary);
  --safe-top:env(safe-area-inset-top,0px);
  --safe-right:env(safe-area-inset-right,0px);
  --safe-bottom:env(safe-area-inset-bottom,0px);
  --safe-left:env(safe-area-inset-left,0px);
  --surface:#fff;
  --surface-soft:#f7f9fc;
  --canvas:#f3f6fa;
  --text:#122033;
  --muted:#66778b;
  --line:#dfe7ef;
  --line-strong:#ccd8e3;
  --nav2:rgba(255,255,255,.105);
  --nav-muted:#a9bed2;
  --success:#087a49;
  --success-soft:#e6f7ef;
  --danger:#c53131;
  --danger-soft:#fdecec;
  --warning:#b86b16;
  --warning-soft:#fff3df;
  --info:#1763a6;
  --info-soft:#e7f2fb;
  --shadow:0 8px 28px rgba(27,48,70,.055);
  --shadow-soft:0 2px 10px rgba(27,48,70,.04);
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%;scroll-behavior:smooth}
body{margin:0;min-width:320px;background:var(--canvas);color:var(--text);font-size:15px;line-height:1.45}
a{color:var(--brand-accent);text-underline-offset:3px}
.ui-icon{display:inline-block;flex:0 0 auto}
.shell{min-height:100vh;display:grid;grid-template-columns:250px minmax(0,1fr)}
.sidebar{background:linear-gradient(180deg,var(--nav) 0%,color-mix(in srgb,var(--nav) 88%,#07182a) 100%);color:#fff;padding:18px 16px 16px;position:sticky;top:0;height:100vh;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-gutter:stable;display:flex;flex-direction:column}
.sidebar-brand{min-height:126px;display:flex;align-items:center;padding:8px 8px 24px}
.product-brand--sidebar{display:grid;justify-items:start;gap:6px;min-width:0;width:100%;color:#fff}
.product-brand__sidebar-logo{display:block;width:min(100%,184px);height:auto;max-height:60px;object-fit:contain;object-position:left center}
.product-brand__sidebar-tagline{max-width:184px;color:#d1dce6;font-size:.7rem;font-weight:560;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.product-brand--horizontal{display:grid;justify-items:center}
.product-brand__logo{display:block;max-width:100%;height:auto}
.product-brand__tagline{margin-top:4px;color:var(--muted);font-size:.8rem}
.nav{display:grid;gap:3px;flex:1;padding-bottom:24px}
.nav .group{margin:17px 12px 5px;color:var(--nav-muted);font-size:.72rem;font-weight:850;text-transform:uppercase;letter-spacing:.075em}
.nav-link{display:flex;align-items:center;gap:11px;min-height:42px;color:#e9f1f8;text-decoration:none;padding:9px 11px;border-radius:10px;font-weight:560;transition:background .15s ease,color .15s ease,transform .15s ease}
.nav-link .ui-icon{opacity:.86}
.nav-link:hover{background:rgba(255,255,255,.075);color:#fff}
.nav-link.active{background:color-mix(in srgb,var(--product-deep) 78%,#fff 5%);color:#fff;box-shadow:inset 3px 0 0 var(--product-gold),inset 0 0 0 1px rgba(255,255,255,.06)}
.nav-link.active .ui-icon{opacity:1}
.sidebar-footer{border-top:1px solid rgba(255,255,255,.12);padding:15px 11px 2px;display:grid;gap:2px;color:#b7c9d8;font-size:.75rem}
.sidebar-footer strong{color:#dce8f2;font-size:.79rem;font-weight:700}
.content{min-width:0}
.topbar{min-height:76px;background:rgba(255,255,255,.97);border-bottom:1px solid var(--line);display:grid;grid-template-columns:minmax(175px,.78fr) minmax(260px,1fr) auto;align-items:center;gap:14px;padding:10px 20px;position:sticky;top:0;z-index:850;backdrop-filter:blur(12px)}
.topbar-left{display:flex;align-items:center;gap:12px;min-width:0}
.topbar-institution-logo{width:46px;height:46px;flex:0 0 46px;object-fit:contain;object-position:center;border:1px solid var(--line);border-radius:10px;background:#fff;padding:3px;box-shadow:var(--shadow-soft)}
.topbar-identity{display:grid;min-width:0}
.topbar-identity strong{font-size:1rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.topbar-identity span{font-size:.8rem;color:var(--muted)}
.topbar-context{display:flex;align-items:center;justify-content:center;gap:9px;min-width:0;overflow:hidden}
.period-context{height:46px;display:flex;align-items:center;gap:9px;min-width:202px;padding:0 13px;border:1px solid var(--line-strong);border-radius:10px;background:#fff;color:#33465a;box-shadow:var(--shadow-soft)}
.period-context__copy{display:grid;gap:2px;min-width:0;line-height:1.04}
.period-context__copy small{color:var(--muted);font-size:.67rem;font-weight:650;white-space:nowrap}
.period-context__copy strong{color:var(--text);font-size:.84rem;font-weight:820;white-space:nowrap}
.period-status{height:36px;display:inline-flex;align-items:center;gap:7px;padding:0 11px;border-radius:999px;text-decoration:none;font-weight:750;font-size:.82rem;white-space:nowrap}
.period-status.open{background:var(--success-soft);color:var(--success)}
.period-status.closed{background:var(--danger-soft);color:#9e2e2e}
.status-dot{width:8px;height:8px;border-radius:50%;background:currentColor}
.topbar-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;min-width:0}
.topbar-actions form{margin:0}
.top-action{height:40px;display:inline-flex;align-items:center;gap:7px;padding:0 12px;border-radius:9px;text-decoration:none;font-size:.84rem;font-weight:780;white-space:nowrap;border:1px solid transparent}
.top-action.primary{background:var(--product-primary);color:#fff}
.top-action.success{background:var(--success-soft);border-color:#c7ead9;color:var(--success)}
.top-action.danger{background:var(--danger-soft);border-color:#f4cccc;color:var(--danger)}
.user-chip{height:44px;display:flex;align-items:center;gap:9px;padding:0 8px 0 5px;border-left:1px solid var(--line);margin-left:3px}
.user-avatar{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;background:#dbe7f1;color:#20364e;font-weight:850}
.user-chip-copy{display:grid;line-height:1.2}
.user-chip-copy strong{font-size:.84rem}
.user-chip-copy small{font-size:.72rem;color:var(--muted);margin-top:2px}
.topbar-icon-btn{height:40px;min-width:40px;padding:0 10px;border:1px solid var(--line-strong);background:#fff;border-radius:9px;color:#31465b;cursor:pointer;display:inline-grid;place-items:center;font:inherit}
.topbar-icon-btn:hover{background:#f7f9fb}
.pwa-install-btn[hidden]{display:none!important}
.mobile-menu-btn{display:none;width:42px;height:42px;border:1px solid var(--line-strong);background:#fff;border-radius:10px;font-size:1.2rem;cursor:pointer}
.sidebar-scrim{display:none;border:0}
.main{max-width:1440px;margin:0 auto;padding:32px 28px 34px}
.pagehead{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;margin-bottom:22px}
.pagehead h1{margin:0 0 5px;font-size:1.9rem;line-height:1.14;letter-spacing:-.025em}
.pagehead p{margin:0;color:var(--muted);font-size:.98rem}
.dashboard-head{margin-bottom:19px}
.card{background:var(--surface);border:1px solid var(--line);border-radius:15px;padding:21px;margin-bottom:18px;box-shadow:var(--shadow-soft)}
.card:hover{border-color:#d5e0ea}
.grid{display:grid;gap:18px}
.grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}
.grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}
.section-title{margin:0 0 14px;font-size:1.05rem}
.stat{font-size:1.75rem;font-weight:850}
.muted{color:var(--muted)}
label{display:block;font-weight:720;margin:0 0 6px;color:#26384a}
input,select,textarea{width:100%;min-height:43px;padding:10px 12px;border:1px solid var(--line-strong);border-radius:9px;font:inherit;background:#fff;color:var(--text);transition:border-color .15s ease,box-shadow .15s ease}
input:focus,select:focus,textarea:focus{border-color:color-mix(in srgb,var(--brand-accent) 70%,#fff);box-shadow:0 0 0 3px color-mix(in srgb,var(--brand-accent) 12%,transparent);outline:0}
input[type=color]{padding:4px}
textarea{min-height:96px;resize:vertical}
.field{margin-bottom:16px}
.actions{display:flex;gap:9px;align-items:center;flex-wrap:wrap}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:40px;padding:9px 13px;border-radius:9px;border:1px solid var(--line-strong);background:#fff;color:#24374a;text-decoration:none;font:inherit;font-size:.9rem;font-weight:740;cursor:pointer;box-shadow:0 1px 2px rgba(15,34,52,.02)}
.btn:hover{background:#f8fafc}
.btn.primary{background:var(--product-primary);border-color:var(--product-primary);color:#fff}
.btn.danger{background:var(--danger-soft);border-color:#f0c9c9;color:var(--danger)}
.status,.errors,.offline-status{padding:12px 14px;border-radius:10px;margin-bottom:18px}
.status{background:var(--success-soft);border:1px solid #bfe2d0;color:var(--success)}
.errors{background:var(--danger-soft);border:1px solid #efc4c4;color:#9e2e2e}
.errors ul{margin:6px 0 0;padding-left:20px}
.offline-status{border:1px solid #efcc8c;background:#fff8e8;color:#75500d;font-weight:700}
table{width:100%;border-collapse:collapse}
th,td{text-align:left;padding:11px 10px;border-bottom:1px solid #e8edf2;vertical-align:middle}
th{font-size:.75rem;text-transform:uppercase;letter-spacing:.045em;color:#607185;font-weight:780}
tbody tr:last-child td{border-bottom:0}
tbody tr:hover{background:#fbfcfd}
.table-shell{overflow-x:auto}
.badge{display:inline-flex;align-items:center;padding:4px 8px;border-radius:999px;font-size:.75rem;font-weight:800;background:#eef3f7;color:#43566a}
.badge.ok{background:var(--success-soft);color:var(--success)}
.badge.off{background:var(--danger-soft);color:#9e2e2e}
.checkrow{display:flex;gap:8px;align-items:flex-start}.checkrow input{width:auto;min-height:auto;margin-top:3px}
.permission-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.rolebox{border:1px solid var(--line);border-radius:12px;padding:16px;margin-bottom:14px;background:#fff}
.rolebox h3{margin:0 0 5px}
.code{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:.86rem;background:#f2f5f7;padding:2px 6px;border-radius:6px}
.amount{font-variant-numeric:tabular-nums;font-weight:820}
.amount.in{color:var(--success)}
.amount.out{color:var(--danger)}
.toolbar{display:flex;gap:10px;align-items:end;flex-wrap:wrap}
.toolbar .field{margin:0}
.kpi-label{color:#52667b;font-size:.9rem}
.kpi-value{font-size:1.45rem;font-weight:850;margin-top:3px;letter-spacing:-.015em}
.kpi-note{color:var(--muted);font-size:.83rem;margin-top:3px}
.nowrap{white-space:nowrap}
.align-right{text-align:right!important}

/* Dashboard */
.kpi-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:15px;margin-bottom:16px}
.kpi-card{background:#fff;border:1px solid var(--line);border-radius:15px;min-height:138px;padding:20px;display:flex;align-items:center;gap:16px;box-shadow:var(--shadow)}
.kpi-icon{width:58px;height:58px;border-radius:50%;display:grid;place-items:center;flex:0 0 auto}
.kpi-icon.blue,.quick-icon.blue{background:var(--info-soft);color:var(--info)}
.kpi-icon.green,.quick-icon.green{background:var(--success-soft);color:var(--success)}
.kpi-icon.red,.quick-icon.red{background:var(--danger-soft);color:var(--danger)}
.kpi-card .kpi-value{font-size:1.55rem;line-height:1.08;white-space:nowrap}
.dashboard-pair{display:grid;grid-template-columns:1.08fr .92fr;gap:16px}
.dashboard-card{padding:18px 20px}
.card-heading{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:13px}
.card-title{display:flex;align-items:center;gap:10px;min-width:0}
.card-title h2{font-size:1.04rem;margin:0}
.heading-icon{width:31px;height:31px;border-radius:9px;display:grid;place-items:center;color:var(--info);background:#edf5fc}
.text-link{display:inline-flex;align-items:center;gap:4px;text-decoration:none;font-size:.84rem;font-weight:720;white-space:nowrap}
.alert-list,.account-list,.quick-list{display:grid;gap:8px}
.alert-row,.quick-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:11px;min-height:63px;padding:10px 11px;border-radius:11px;background:var(--surface-soft);text-decoration:none;color:var(--text)}
.alert-row:hover,.quick-row:hover{background:#f0f5f9}
.alert-row>span:nth-child(2),.quick-row>span:nth-child(2){display:grid}
.alert-row strong,.quick-row strong{font-size:.88rem}
.alert-row small,.quick-row small{font-size:.77rem;color:var(--muted);margin-top:2px}
.alert-icon{width:36px;height:36px;border-radius:50%;display:grid;place-items:center}
.alert-icon.ok{background:var(--success-soft);color:var(--success)}
.alert-icon.warning{background:var(--danger-soft);color:var(--danger)}
.row-chevron{color:#7c8d9c}
.account-row{min-height:57px;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px;padding:9px 11px;border-radius:11px;background:var(--surface-soft)}
.account-icon{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;background:var(--info-soft);color:var(--info)}
.account-name{font-weight:650}
.dashboard-bottom{display:grid;grid-template-columns:minmax(0,1fr) 290px;gap:16px}
.recent-card{min-width:0}
.dashboard-table td strong{display:block;font-size:.87rem}
.dashboard-table td small{display:block;color:var(--muted);font-size:.75rem;margin-top:2px}
.movement-type{display:inline-flex;align-items:center;gap:7px;font-size:.82rem;white-space:nowrap}
.movement-dot{width:8px;height:8px;border-radius:50%;background:#7d8c9b}
.movement-type.income .movement-dot{background:var(--success)}
.movement-type.expense .movement-dot{background:var(--danger)}
.movement-type.manual .movement-dot{background:var(--info)}
.quick-row{min-height:67px}
.quick-icon{width:38px;height:38px;border-radius:10px;display:grid;place-items:center}
.empty-state,.empty-cell{padding:18px;text-align:center;color:var(--muted);font-size:.88rem}
.empty-dashboard{display:flex;gap:14px;align-items:flex-start}
.empty-dashboard h2{margin:0 0 4px;font-size:1.05rem}
.empty-dashboard p{margin:0}
.app-footer{display:flex;justify-content:space-between;gap:20px;align-items:end;margin-top:22px;padding:0 2px;color:#8290a0;font-size:.76rem}
.app-footer>div{display:grid}
.app-footer strong{color:#637387;font-size:.8rem}


/* F10.6 — Resumo financeiro padronizado */
.finance-overview-filter{display:flex;align-items:end;gap:10px;flex-wrap:wrap}
.finance-overview-filter .field{width:min(100%,280px);margin:0}
.finance-overview-grid{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(290px,.65fr);gap:16px}
.finance-account-list{display:grid;gap:8px}
.finance-account-row{min-height:64px;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:11px;padding:10px 11px;border-radius:11px;background:var(--surface-soft)}
.finance-account-copy{display:grid;min-width:0}
.finance-account-copy strong{font-size:.9rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.finance-account-copy small{margin-top:2px;color:var(--muted);font-size:.77rem}
.finance-period-card{align-self:start}
.finance-period-summary{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px;border:1px solid var(--line);border-radius:12px;background:var(--surface-soft)}
.finance-period-summary>div{display:grid}
.finance-period-summary small{color:var(--muted);font-size:.76rem}
.finance-period-summary strong{margin-top:2px;font-size:1rem}
.finance-period-note{margin:14px 0 0;color:var(--muted);font-size:.86rem;line-height:1.55}
.finance-period-actions{display:grid;gap:8px;margin-top:16px}
.finance-period-actions .btn{width:100%}

@media(max-width:900px){
  .finance-overview-grid{grid-template-columns:1fr}
  .finance-period-card{align-self:auto}
}
@media(max-width:620px){
  .finance-overview-filter{display:grid;grid-template-columns:1fr}
  .finance-overview-filter .field{width:100%}
  .finance-overview-filter .btn{width:100%}
  .finance-account-row{grid-template-columns:auto minmax(0,1fr)}
  .finance-account-row>.amount{grid-column:2;text-align:left!important;margin-top:2px}
  .finance-period-summary{align-items:flex-start;flex-direction:column}
}


/* F10.7 — sistema visual das telas internas */
.content > .pagehead:not(.dashboard-head){
  align-items:center;
  padding-bottom:2px;
}
.content > .pagehead:not(.dashboard-head) h1{
  font-size:1.75rem;
}
.content > .pagehead:not(.dashboard-head) p{
  max-width:780px;
  line-height:1.5;
}

.filter-card{
  padding:16px 18px;
  border-radius:14px;
  background:linear-gradient(180deg,#fff 0%,#fbfcfe 100%);
}
.filter-card.toolbar,
form.filter-card{
  gap:12px;
}
.filter-card .field{
  min-width:180px;
}
.filter-card .field label{
  font-size:.78rem;
  color:#52667b;
}
.filter-card .btn{
  min-height:43px;
}

.table-card{
  padding:0;
  overflow-x:auto;
  overflow-y:hidden;
}
.table-card table{
  min-width:760px;
  margin:0;
}
.table-card thead th{
  padding-top:13px;
  padding-bottom:13px;
  background:#f7f9fc;
  color:#52667b;
  border-bottom:1px solid var(--line);
}
.table-card th:first-child,
.table-card td:first-child{
  padding-left:18px;
}
.table-card th:last-child,
.table-card td:last-child{
  padding-right:18px;
}
.table-card tbody tr{
  transition:background .14s ease;
}
.table-card tbody tr:hover{
  background:#f8fbfe;
}
.table-card td{
  padding-top:13px;
  padding-bottom:13px;
}
.table-card td .muted{
  margin-top:3px;
  font-size:.78rem;
}
.table-card td .actions{
  justify-content:flex-end;
  gap:6px;
  flex-wrap:nowrap;
}
.table-card td .actions .btn{
  min-height:34px;
  padding:6px 9px;
  font-size:.82rem;
}
.table-card .pagination-actions{
  position:sticky;
  left:0;
  justify-content:flex-end;
  padding:14px 18px;
  border-top:1px solid var(--line);
  background:#fff;
}

.form-card{
  max-width:1080px;
  padding:22px;
}
.form-card .section-title{
  margin-top:6px;
  padding-top:18px;
  border-top:1px solid var(--line);
}
.form-card .form-actions{
  margin-top:6px;
  padding-top:18px;
  border-top:1px solid var(--line);
}
.form-card .field > small,
.form-card .field > .muted{
  display:block;
  margin-top:5px;
  font-size:.78rem;
  line-height:1.45;
}
.form-card input,
.form-card select,
.form-card textarea{
  background:#fff;
}

.confirmation-card{
  max-width:760px;
  border-left:4px solid #e3ad32;
}
.confirmation-card .actions{
  margin-top:18px;
  padding-top:16px;
  border-top:1px solid var(--line);
}

.rolebox{
  padding:20px;
  border-radius:15px;
  box-shadow:var(--shadow-soft);
}
.rolebox > .pagehead{
  margin-bottom:16px;
}
.permission-grid .checkrow{
  padding:12px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fbfcfe;
  transition:border-color .15s ease,background .15s ease;
}
.permission-grid .checkrow:hover{
  border-color:#cfdce8;
  background:#fff;
}

.content .badge{
  gap:5px;
}
.content .code{
  color:#42566b;
}

@media(max-width:820px){
  .content > .pagehead:not(.dashboard-head){
    align-items:flex-start;
  }
  .filter-card,
  form.filter-card{
    display:grid;
    grid-template-columns:1fr;
    align-items:stretch;
  }
  .filter-card .field{
    min-width:0;
    width:100%;
  }
  .filter-card .btn{
    width:100%;
  }
  .form-card{
    padding:17px;
  }
  .permission-grid{
    grid-template-columns:1fr;
  }
}
@media(max-width:620px){
  .table-card{
    margin-left:-2px;
    margin-right:-2px;
    border-radius:12px;
  }
  .table-card table{
    min-width:680px;
  }
  .content > .pagehead:not(.dashboard-head) h1{
    font-size:1.55rem;
  }
}


/* F10.7-r2 — filtros mensais e busca de membros */
.filter-card .month-select-field{
  min-width:220px;
}
.filter-card.members-filter-card .member-search-field{
  min-width:340px;
  flex:1 1 340px;
}
.filter-card.members-filter-card .member-search-field input{
  width:100%;
}
@media(max-width:820px){
  .filter-card.members-filter-card .member-search-field{
    min-width:0;
    width:100%;
  }
}

/* F10.8 — responsive release-candidate hardening */
html,
body{
  max-width:100%;
}
body{
  overflow-x:hidden;
}
.shell,
.content,
.main,
.pagehead,
.card,
.form-card,
.filter-card,
.table-card{
  min-width:0;
}
.topbar-identity,
.topbar-identity > div{
  min-width:0;
}
.topbar-identity strong,
.topbar-identity span{
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.table-card{
  -webkit-overflow-scrolling:touch;
  overscroll-behavior-inline:contain;
  scrollbar-gutter:stable;
}
.table-card table{
  width:100%;
}
.app-footer{
  min-width:0;
  overflow-wrap:anywhere;
}
.form-card img,
.card img{
  max-width:100%;
  height:auto;
}
@media(pointer:coarse){
  .btn,
  button,
  .top-action,
  .mobile-menu-btn,
  .nav-link{
    min-height:44px;
  }
}
@media(max-width:900px){
  input,
  select,
  textarea{
    font-size:16px;
  }
  .main{
    width:100%;
    box-sizing:border-box;
  }
  .pagehead > .actions{
    width:100%;
  }
  .pagehead > .actions > .btn,
  .pagehead > .actions > button{
    min-height:44px;
  }
  .table-card{
    max-width:100%;
  }
  .form-card .actions,
  .confirmation-card .actions{
    flex-wrap:wrap;
  }
}
@media(max-width:620px){
  .pagehead > .actions{
    display:grid;
    grid-template-columns:1fr;
  }
  .pagehead > .actions > .btn,
  .pagehead > .actions > button{
    width:100%;
  }
  .filter-card{
    padding:15px;
  }
  .form-card{
    border-radius:13px;
  }
  .table-card{
    border-radius:12px;
  }
  .table-card .pagination-actions{
    padding:12px 14px;
  }
}
@media(max-width:390px){
  .main{
    padding-left:calc(10px + var(--safe-left));
    padding-right:calc(10px + var(--safe-right));
  }
  .card,
  .form-card{
    padding:14px;
  }
  .topbar{
    padding-left:calc(9px + var(--safe-left));
    padding-right:calc(9px + var(--safe-right));
  }
  .topbar-institution-logo{
    width:32px;
    height:32px;
    flex-basis:32px;
  }
  .topbar-identity strong{
    font-size:.84rem;
  }
}

/* Accessibility / interaction */
.btn:focus-visible,.topbar button:focus-visible,.nav-link:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,.top-action:focus-visible,.alert-row:focus-visible,.quick-row:focus-visible{outline:3px solid rgba(48,119,203,.32);outline-offset:2px}
.status,.errors{scroll-margin-top:90px}

/* Responsive */

@media(max-width:1450px){
  .topbar{grid-template-columns:minmax(165px,.72fr) minmax(250px,1fr) auto;gap:11px;padding-left:18px;padding-right:18px}
  .top-action.success,.top-action.danger{display:none}
  .kpi-card{padding:17px 16px;gap:12px}
  .kpi-icon{width:50px;height:50px}
  .kpi-card .kpi-value{font-size:1.42rem}
}
@media(max-width:1280px){
  .top-action.primary{display:none}
  .period-context{min-width:194px}
}
@media(max-width:1200px){
  .topbar{grid-template-columns:minmax(170px,1fr) auto}
  .topbar-context{display:none}
  .top-action{padding:0 10px}
  .user-chip-copy{display:none}
  .kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .dashboard-bottom{grid-template-columns:1fr}
  .quick-card .quick-list{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:900px){
  body.menu-open{overflow:hidden}
  .shell{display:block!important}
  .content{min-width:0}
  .sidebar{position:fixed!important;z-index:1200;left:0;top:0;bottom:0;width:min(86vw,310px);height:100dvh!important;padding-top:calc(18px + var(--safe-top));padding-bottom:calc(18px + var(--safe-bottom));transform:translateX(-103%);transition:transform .22s ease;box-shadow:10px 0 30px rgba(5,18,30,.18);overflow-y:auto!important}
  .menu-open .sidebar{transform:translateX(0)}
  .sidebar-scrim{display:block!important;position:fixed;z-index:1190;inset:0;background:rgba(5,18,30,.42);opacity:0;pointer-events:none;transition:opacity .22s ease}
  .menu-open .sidebar-scrim{opacity:1;pointer-events:auto}
  .mobile-menu-btn{display:inline-grid!important;place-items:center}
  .topbar{min-height:64px;padding:9px calc(12px + var(--safe-right)) 9px calc(12px + var(--safe-left));grid-template-columns:minmax(0,1fr) auto;gap:8px}
  .topbar-actions{gap:5px}
  .top-action{width:40px;padding:0;justify-content:center;font-size:0}
  .top-action .ui-icon{width:18px;height:18px}
  .user-chip{display:none}
  .main{padding:22px calc(14px + var(--safe-right)) calc(34px + var(--safe-bottom)) calc(14px + var(--safe-left));max-width:none}
  .pagehead{display:grid;grid-template-columns:1fr;gap:12px}
  .pagehead h1{font-size:1.6rem}
  .grid.two,.grid.three,.permission-grid,.dashboard-pair{grid-template-columns:1fr}
  .card{padding:17px;border-radius:14px;overflow-x:auto}
  .toolbar{align-items:stretch}
  .toolbar .field{width:100%}
  .actions{align-items:stretch}
  .actions>.btn,.actions>button{flex:1 1 auto;text-align:center}
  .stat{font-size:1.45rem}
  .kpi-value{font-size:1.3rem}
  .table-shell{overflow-x:auto}
  table{min-width:680px}
  th,td{padding:10px 8px}
  .nav-link{min-height:44px}
  .sidebar-brand{min-height:96px}
  .sidebar-brand img{max-width:168px;max-height:90px}
  .quick-card .quick-list{grid-template-columns:1fr}
}
@media(max-width:620px){
  .kpi-grid{grid-template-columns:1fr}
  .kpi-card{min-height:112px;padding:16px}
  .kpi-icon{width:50px;height:50px}
  .kpi-card .kpi-value{font-size:1.45rem}
  .topbar-institution-logo{width:36px;height:36px;flex-basis:36px}
  .topbar-identity span{display:none}
  .topbar-identity strong{font-size:.9rem}
  .app-footer{display:grid;gap:8px}
}
@media(max-width:520px){
  .pwa-install-btn{font-size:0}
  .pwa-install-btn::after{content:'App';font-size:.8rem}
  .card{margin-bottom:14px}
  .main{padding-top:18px}
}
@media(prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  .sidebar,.sidebar-scrim,.nav-link{transition:none!important}
}


/* F10.5 — AFI Gestão product identity + institutional login */
.auth-page{margin:0;height:100vh;height:100dvh;overflow:hidden;background:#eef3f8;color:var(--text)}
.auth-shell{height:100vh;height:100dvh;min-height:0;display:grid;grid-template-columns:minmax(430px,.96fr) minmax(520px,1.04fr)}
.auth-institution{position:relative;min-height:0;overflow:hidden;background:
  radial-gradient(circle at 84% 78%,color-mix(in srgb,var(--institution-accent,#294b70) 25%,transparent) 0,transparent 30%),
  linear-gradient(145deg,color-mix(in srgb,var(--institution-primary,#17283c) 88%,#07182a) 0%,var(--product-primary) 100%);
  color:#fff}
.auth-institution::before{content:"";position:absolute;inset:-12% -20% auto auto;width:70%;height:52%;border-radius:50%;border:1px solid rgba(255,255,255,.08);transform:rotate(-18deg)}
.auth-institution::after{content:"";position:absolute;inset:auto -18% -28% 16%;height:50%;border-radius:50%;background:rgba(255,255,255,.025);transform:rotate(-12deg)}
.auth-institution__inner{position:relative;z-index:1;height:100%;min-height:0;box-sizing:border-box;display:flex;flex-direction:column;justify-content:center;padding:clamp(28px,4vw,58px)}
.auth-institution__brand{display:flex;align-items:center;gap:20px}
.auth-institution__logo{display:block;max-width:190px;max-height:118px;object-fit:contain;object-position:left center;background:rgba(255,255,255,.98);border-radius:14px;padding:10px;box-shadow:0 14px 34px rgba(2,14,29,.18)}
.auth-institution__fallback{width:74px;height:74px;border-radius:18px;display:grid;place-items:center;background:rgba(255,255,255,.11);border:1px solid rgba(255,255,255,.16);font-weight:900;font-size:1.2rem}
.auth-institution__denomination{color:#bfd0df;font-size:.76rem;text-transform:uppercase;letter-spacing:.08em;font-weight:800;margin-bottom:6px}
.auth-institution__brand h1{margin:0;font-size:clamp(1.65rem,2.8vw,2.45rem);line-height:1.12}
.auth-institution__message{max-width:620px;margin-top:clamp(34px,5vh,52px)}
.auth-gold-rule{display:block;width:58px;height:3px;border-radius:999px;background:var(--product-gold);margin-bottom:18px}
.auth-institution__message h2{max-width:590px;margin:0;font-size:clamp(1.55rem,2.6vw,2.25rem);line-height:1.2;letter-spacing:-.025em}
.auth-institution__message p{max-width:560px;margin:14px 0 0;color:#c6d4e0;font-size:1rem;line-height:1.65}
.auth-feature-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:clamp(28px,4vh,42px)}
.auth-feature{min-width:0;padding:15px 12px;border-left:1px solid rgba(255,255,255,.12)}
.auth-feature:first-child{border-left:0;padding-left:0}
.auth-feature__icon{width:42px;height:42px;border-radius:50%;display:grid;place-items:center;background:rgba(255,255,255,.07);border:1px solid rgba(212,168,51,.45);color:var(--product-gold);margin-bottom:10px}
.auth-feature strong{display:block;font-size:.94rem}
.auth-feature small{display:block;margin-top:5px;color:#c2d0dc;font-size:.82rem;line-height:1.5}
.auth-institution__verse{margin-top:clamp(24px,3vh,34px);padding-top:0;display:flex;align-items:center;gap:14px;color:#c2cfdb}
.auth-verse-rule{width:54px;height:2px;flex:0 0 54px;border-radius:999px;background:var(--product-gold)}
.auth-institution__verse blockquote{margin:0;font-family:Georgia,serif;font-style:italic;font-size:.84rem}
.auth-institution__verse cite{display:block;font-size:.7rem;color:#98adbf;margin-top:4px}
.auth-access{min-height:0;display:grid;place-items:center;overflow:hidden;padding:clamp(18px,3.4vw,46px);background:
  radial-gradient(circle at 80% 12%,rgba(30,78,140,.06),transparent 24%),
  linear-gradient(135deg,#f5f8fb,#fff)}
.auth-access__inner{width:min(100%,620px);box-sizing:border-box;background:#fff;border:1px solid var(--line);border-radius:22px;padding:clamp(28px,3.6vw,44px);box-shadow:0 26px 70px rgba(15,45,91,.10)}
.auth-product-brand{margin:0 auto 20px;width:min(100%,330px)}
.auth-product-brand .product-brand__logo{max-height:104px;object-fit:contain}
.auth-access__heading{text-align:center;margin-bottom:22px}
.auth-access__heading .auth-gold-rule{margin:0 auto 13px;width:48px;height:2px}
.auth-access__heading h2{margin:0;font-size:1.75rem;letter-spacing:-.02em}
.auth-access__heading p{margin:7px 0 0;color:var(--muted)}
.auth-error{background:var(--danger-soft);border:1px solid #efc4c4;color:#9e2e2e;padding:11px 13px;border-radius:10px;margin-bottom:18px;font-weight:650}
.auth-form .field{margin-bottom:14px}
.auth-form label{font-size:.9rem}
.auth-input-wrap{position:relative}
.auth-input-wrap>.ui-icon{position:absolute;left:13px;top:50%;transform:translateY(-50%);color:#64768a;pointer-events:none}
.auth-input-wrap input{padding-left:42px;min-height:48px;font-size:.94rem}
.auth-input-wrap input:-webkit-autofill,
.auth-input-wrap input:-webkit-autofill:hover,
.auth-input-wrap input:-webkit-autofill:focus,
.auth-input-wrap input:-webkit-autofill:active{-webkit-text-fill-color:var(--text)!important;-webkit-box-shadow:0 0 0 1000px #fff inset!important;box-shadow:0 0 0 1000px #fff inset!important;caret-color:var(--text);transition:background-color 9999s ease-out 0s}
.auth-remember{display:flex;align-items:center;gap:9px;margin:0 0 14px;color:#465a6f;font-weight:560;font-size:.88rem;cursor:pointer}
.auth-remember input{width:auto;min-height:auto;accent-color:var(--product-primary)}
.auth-submit{width:100%;min-height:48px;background:var(--product-primary)!important;border-color:var(--product-primary)!important;color:#fff!important;font-size:.96rem}
.auth-submit:hover{background:#123967!important}
.auth-submit .ui-icon{transform:rotate(180deg)}
.auth-security-note{display:flex;align-items:center;justify-content:center;gap:9px;margin-top:16px;padding-top:13px;border-top:1px solid var(--line);color:#6a7c8f}
.auth-security-note>span{width:32px;height:32px;border-radius:50%;display:grid;place-items:center;background:var(--success-soft);color:var(--success)}
.auth-security-note p{margin:0;font-size:.82rem;line-height:1.5}
.auth-product-footer{margin-top:16px;display:grid;justify-items:center;gap:3px;color:#8a98a7;font-size:.72rem;text-align:center}
.auth-product-footer strong{color:#637488;font-size:.78rem}

@media(max-width:1100px){
  .auth-shell{grid-template-columns:minmax(350px,.82fr) minmax(480px,1.18fr)}
  .auth-institution__inner{padding:38px}
  .auth-feature-grid{grid-template-columns:1fr}
  .auth-feature{display:grid;grid-template-columns:auto 1fr;column-gap:10px;border-left:0;border-top:1px solid rgba(255,255,255,.10);padding:12px 0}
  .auth-feature:first-child{border-top:0}
  .auth-feature__icon{grid-row:1/3;margin:0}
}

@media(min-width:821px) and (max-height:760px){
  .auth-institution__inner{padding:22px 34px}
  .auth-institution__brand{gap:14px}
  .auth-institution__logo{max-width:140px;max-height:82px;padding:7px;border-radius:11px}
  .auth-institution__fallback{width:60px;height:60px;border-radius:14px}
  .auth-institution__denomination{font-size:.68rem;margin-bottom:3px}
  .auth-institution__brand h1{font-size:1.55rem}
  .auth-institution__message{margin-top:20px}
  .auth-gold-rule{width:48px;height:2px;margin-bottom:10px}
  .auth-institution__message h2{font-size:1.6rem;line-height:1.14}
  .auth-institution__message p{margin-top:8px;font-size:.86rem;line-height:1.45}
  .auth-feature-grid{margin-top:16px;gap:8px}
  .auth-feature{padding:8px 8px}
  .auth-feature__icon{width:34px;height:34px;margin-bottom:6px}
  .auth-feature strong{font-size:.82rem}
  .auth-feature small{display:none}
  .auth-institution__verse{margin-top:16px;gap:10px}
  .auth-verse-rule{width:42px;flex-basis:42px}
  .auth-institution__verse blockquote{font-size:.75rem}
  .auth-institution__verse cite{font-size:.64rem}
  .auth-access{padding:14px 26px}
  .auth-access__inner{width:min(100%,590px);padding:20px 32px;border-radius:18px}
  .auth-product-brand{width:min(100%,270px);margin-bottom:10px}
  .auth-product-brand .product-brand__logo{max-height:76px}
  .auth-access__heading{margin-bottom:14px}
  .auth-access__heading .auth-gold-rule{margin-bottom:9px}
  .auth-access__heading h2{font-size:1.42rem}
  .auth-access__heading p{margin-top:4px;font-size:.84rem}
  .auth-form .field{margin-bottom:9px}
  .auth-form label{font-size:.82rem}
  .auth-input-wrap input{min-height:42px;font-size:.88rem}
  .auth-remember{margin-bottom:9px;font-size:.82rem}
  .auth-submit{min-height:42px;font-size:.9rem}
  .auth-security-note{margin-top:10px;padding-top:9px}
  .auth-security-note>span{width:28px;height:28px}
  .auth-security-note p{font-size:.74rem}
  .auth-product-footer{margin-top:10px;font-size:.66rem}
}

@media(max-width:820px){
  .auth-page{height:auto;min-height:100vh;overflow:auto}
  .auth-shell{display:block;height:auto;min-height:100vh}
  .auth-institution{min-height:auto}
  .auth-institution__inner{min-height:auto;padding:22px 20px}
  .auth-institution__brand{gap:12px}
  .auth-institution__logo{max-width:120px;max-height:70px;padding:6px}
  .auth-institution__denomination{display:none}
  .auth-institution__brand h1{font-size:1.2rem}
  .auth-institution__message,.auth-feature-grid,.auth-institution__verse{display:none}
  .auth-access{padding:22px 14px calc(28px + var(--safe-bottom))}
  .auth-access__inner{padding:26px 20px;border-radius:17px}
  .auth-product-brand{width:min(100%,245px);margin-bottom:18px}
}
