:root {
  --portal-primary: #1774ff;
  --portal-primary-dark: #0d58c7;
  --portal-sidebar-width: 248px;
  --portal-sidebar-collapsed: 72px;
  --portal-bg: #f4f7fb;
  --portal-border: #e3eaf3;
}

html, body { min-height: 100%; }
body { background: var(--portal-bg); color: #1f2937; }
.portal-navbar { background: linear-gradient(135deg, var(--portal-primary), var(--portal-primary-dark)); box-shadow: 0 2px 12px rgba(13, 88, 199, .18); }
.portal-navbar .navbar { min-height: 68px; }
.brand-logo { width: 38px; height: 38px; object-fit: contain; background: #fff; border-radius: .5rem; padding: .25rem; }
.navbar-brand { font-weight: 700; }
.user-summary { display: flex; flex-direction: column; font-size: .72rem; line-height: 1.2; }
.user-summary strong { font-size: .8rem; }
.portal-layout { display: flex; min-height: calc(100vh - 68px); }
.portal-sidebar { width: var(--portal-sidebar-collapsed); flex: 0 0 auto; background: var(--portal-primary); transition: width .2s ease; overflow: hidden; }
.portal-sidebar.expanded { width: var(--portal-sidebar-width); }
.portal-sidebar .menu-label { opacity: 0; white-space: nowrap; transition: opacity .15s ease; }
.portal-sidebar.expanded .menu-label { opacity: 1; }
.portal-content { flex: 1 1 auto; min-width: 0; }
.portal-nav-link { display: flex; align-items: center; gap: .85rem; margin: .2rem .55rem; padding: .72rem .9rem; color: rgba(255,255,255,.9); text-decoration: none; border-radius: .55rem; }
.portal-nav-link i { width: 22px; flex: 0 0 22px; text-align: center; font-size: 1.1rem; }
.portal-nav-link:hover, .portal-nav-link:focus, .portal-nav-link.active { color: #fff; background: rgba(255,255,255,.18); }
.portal-nav-divider { border-top: 1px solid rgba(255,255,255,.2); margin: .75rem 1rem; }
.portal-mobile-menu { background: var(--portal-primary); color: #fff; }
.portal-card { border: 1px solid var(--portal-border); border-radius: 1rem; box-shadow: 0 .4rem 1rem rgba(31, 41, 55, .05); }
.metric-icon { display: grid; place-items: center; width: 48px; height: 48px; flex: 0 0 48px; border-radius: .85rem; color: var(--portal-primary); background: #eaf2ff; font-size: 1.25rem; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 1.25rem; background: linear-gradient(135deg, #eef5ff 0%, #f7f9fc 55%, #e7f0ff 100%); }
.login-card { width: min(100%, 460px); padding: clamp(1.5rem, 4vw, 2.5rem); background: #fff; border: 1px solid var(--portal-border); border-radius: 1.25rem; box-shadow: 0 1.25rem 3rem rgba(30, 64, 175, .12); }
.login-logo { width: 92px; max-height: 64px; object-fit: contain; }
.login-card .input-group-text { color: var(--portal-primary); background: #eef5ff; }
.btn-primary { --bs-btn-bg: var(--portal-primary); --bs-btn-border-color: var(--portal-primary); --bs-btn-hover-bg: var(--portal-primary-dark); --bs-btn-hover-border-color: var(--portal-primary-dark); }
@media (max-width: 575.98px) { .navbar-brand span { font-size: .95rem; } .brand-logo { width: 34px; height: 34px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
/* Bloco 5: mapas (Leaflet) */
.portal-mapa { height: 360px; border-radius: .5rem; border: 1px solid var(--bs-border-color); z-index: 0; }
.portal-mapa:focus-visible { outline: 3px solid var(--bs-primary); outline-offset: 2px; }
@media (max-width: 575.98px) { .portal-mapa { height: 300px; } }
/* 29/11/2026: nome de fazenda, área, parcela e válvula escrito no mapa (rótulo fixo, sem caixa) */
.leaflet-tooltip.portal-mapa-rotulo { background: transparent; border: 0; box-shadow: none; padding: 0;
  color: #fff; font-weight: 600; font-size: .75rem; white-space: nowrap;
  text-shadow: 0 0 3px #000, 0 0 2px #000, 0 0 1px #000; }
.leaflet-tooltip.portal-mapa-rotulo::before { display: none; }
.portal-legenda-ponto { display: inline-block; width: .75rem; height: .75rem; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #adb5bd; vertical-align: -1px; }
.portal-mapa-pequeno { height: 200px; }
/* Tela cheia do mapa: ocupa a janela inteira, por cima do menu e da barra do Portal. */
.portal-mapa.portal-mapa-cheio, .portal-mapa:fullscreen { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; border-radius: 0; border: 0; z-index: 2000; }
body.portal-com-mapa-cheio { overflow: hidden; }
.leaflet-container .leaflet-bar.portal-tela-cheia a { display: flex; align-items: center; justify-content: center; width: auto; min-width: 30px; font-size: 1rem; color: #212529; }
.leaflet-container .leaflet-bar.portal-tela-cheia.portal-tela-cheia-sair a { padding: 0 .6rem; font-size: .9rem; font-weight: 600; white-space: nowrap; }
.portal-mapa-info { display: none; max-width: 22rem; padding: .4rem .6rem; background: rgba(255, 255, 255, .92); border-radius: .375rem; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); font-size: .85rem; }
.portal-mapa-cheio .portal-mapa-info:not([hidden]) { display: block; }

/* Bloco 14: impressão (pedidos e contas a receber). Só o conteúdo da página, sem menus. */
@media print {
  .portal-navbar, .portal-sidebar, .portal-mobile-menu, #sidebar, .offcanvas { display: none !important; }
  .portal-layout { display: block; min-height: 0; }
  .portal-content .container-fluid { padding: 0 !important; }
  .portal-card { box-shadow: none; break-inside: avoid; }
  details > summary { list-style: none; }
  details > summary .bi-chevron-down { display: none; }
  .table-responsive { overflow: visible; }
  a[href]::after { content: none; }
  body { font-size: 11pt; }
}
