/* A consistent workspace, scoped away from the public site and printed documents. */
@media screen {
  body[data-portal-ui] {
    --text: #202421; --muted: #626962; --border: #e2e5e0; --line: #e2e5e0;
    --green-950: #172e23; --green-900: #253c2d; --green-800: #345e45; --green-700: #376e4f;
    --green-100: #edf2eb; --green-050: #f7f8f5; --green-50: #f7f8f5;
    --shadow: 0 2px 6px #14241904; --radius: 16px;
    color: var(--text); background: #fcfcfa; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.55; margin: 0; min-height: 100dvh; font-size: 14px;
  }
  body[data-portal-ui] *, body[data-portal-ui] *::before, body[data-portal-ui] *::after { box-sizing: border-box; }
  body[data-portal-ui] [hidden] { display: none !important; }
  body[data-portal-ui] :is(button, input, select, textarea) { font-family: inherit; }
  body[data-portal-ui] :is(button, a, input, select, textarea, summary):focus-visible { outline: 3px solid #518769; outline-offset: 3px; }
  body[data-portal-ui] h1 { color: #252c27; letter-spacing: -.045em; line-height: 1.16; font-weight: 600; font-size: clamp(1.8rem, 3vw, 2.75rem); }
  body[data-portal-ui] :is(h2,h3,h4) { color: #29342c; letter-spacing: -.025em; }
  body[data-portal-ui] :is(.btn,.btn-primary,.btn-secondary,.btn-main,.pill) { border-radius: 10px; box-shadow: none; font-weight: 600; font-size: .875rem; padding: 10px 15px; min-height: 40px; }
  body[data-portal-ui] :is(.btn-primary,.btn-main,.btn.primary) { background: #345e45; color: #fff; }
  body[data-portal-ui] :is(.btn-light,.btn-secondary,.btn.ghost) { background: #f0f2ed; color: #344439; border: 1px solid #dde2da; }
  body[data-portal-ui] :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),select,textarea) { border-radius: 10px; border: 1px solid #d4dbd2; color: #26372c; background: #fff; min-height: 44px; padding: 11px 13px; max-width: 100%; }
  body[data-portal-ui] label { font-weight: 500; }
  body[data-portal-ui] :is(.card,.content-card,.panel-card,.module-card,.stat-card,.quick-area,.toolbar-card,.gestao-menu-card,.family-menu-card,.summary-card,.selector-card,.report-preview,.status-card,.metric), body[data-portal-ui] .kpis article { box-shadow: none; border: 1px solid #e1e5dc; border-radius: 15px; background: #fff; }
  body[data-portal-ui] :is(.hero,.hero-card,.hero-banner) { background: transparent; box-shadow: none; border: 0; border-radius: 0; color: #26372c; }
  body[data-portal-ui] :is(.hero,.hero-card,.hero-banner) p { color: #626962; }
  body[data-portal-ui] .hero-card::after { display: none; }
  body[data-portal-ui] :is(.status-card,.summary-card) { background: #f1f4ed; color: #344439; }
  body[data-portal-ui] .status-card :is(span,strong) { color: #344439; }
  body[data-portal-ui] :is(.stat-card,.metric,.kpis article) { border-top: 2px solid #b1c4a6; }
  body[data-portal-ui] :is(.stats-grid,.school-box,.kpis) { gap: 12px; }
  body[data-portal-ui] :is(.tab,.tab-button,.family-tab-button) { border-radius: 9px; font-weight: 500; box-shadow: none; }
  body[data-portal-ui] :is(.tab,.tab-button).active { color: #fff; background: #345e45; }
  body[data-portal-ui] :is(.tabs,.tab-bar) { gap: 7px; padding-bottom: 12px; border-bottom: 1px solid #e1e5dc; }
  body[data-portal-ui] :is(.gestao-nav-button,.family-nav-button,.action-card,.quick-link) { box-shadow: none; border: 1px solid #e1e5dc; border-radius: 11px; background: #fff; color: #344439; padding: 15px; transition: background .15s, border-color .15s; }
  body[data-portal-ui] :is(.gestao-nav-button,.family-nav-button,.action-card,.quick-link):hover { transform: none; background: #f4f6f0; border-color: #a9b9a0; box-shadow: none; }
  body[data-portal-ui] :is(.gestao-nav-button,.family-nav-button).active { background: #eaf0e5; color: #294a36; border-color: #a9b9a0; }
  body[data-portal-ui] :is(.gestao-nav-button,.family-nav-button).active :is(strong,small) { color: #294a36; }
  body[data-portal-ui] :is(.gestao-nav-icon,.family-nav-icon,.action-icon) { width: 30px; height: 30px; font-size: 12px; border-radius: 8px; background: #edf2e8; color: #3e6247; box-shadow: none; }
  body[data-portal-ui] :is(.gestao-buttons,.family-section-buttons,.action-menu) { gap: 10px; }
  body[data-portal-ui] .module-card { min-height: 220px; padding: 23px; transition: border-color .18s, background .18s; }
  body[data-portal-ui] .module-card:hover { border-color: #a9b9a0; background: #fefffc; }
  body[data-portal-ui] .module-card .icon { width: 38px; height: 38px; padding: 8px; border-radius: 11px; background: #eef2e9; color: #466448; }
  body[data-portal-ui] .module-card .icon svg { width: 100%; height: 100%; filter: none; }
  body[data-portal-ui] .module-top { gap: 12px; }
  body[data-portal-ui] .module-card h3 { font-size: 1.05rem; }
  body[data-portal-ui] .module-card p { font-size: .88rem; line-height: 1.65; }
  body[data-portal-ui] .module-actions .btn { font-size: .8rem; padding: 8px 12px; }
  body[data-portal-ui] :is(table) { font-size: .875rem; }
  body[data-portal-ui] :is(th) { background: #f3f5ef; color: #56624f; font-weight: 600; }
  body[data-portal-ui] :is(.record,.report-stat) { background: #fafbf8; border-color: #e1e5dc; border-radius: 10px; }

  /* Workspace frame. No application nodes are moved or cloned. */
  body[data-portal-ui="workspace"] { transition: padding-left .2s; }
  body[data-portal-ui="workspace"].portal-sidebar-visible { padding-left: 252px; }
  body[data-portal-ui="workspace"] > div.topbar { display: none; }
  body[data-portal-ui="workspace"] > header { background: #fcfcfaf5; color: #29342c; border-bottom: 1px solid #e7e9e2; padding: 13px 28px; min-height: 72px; position: sticky; top: 0; z-index: 50; box-shadow: none; display: flex; flex-direction: row; align-items: center; gap: 20px; flex-wrap: wrap; }
  body[data-portal-ui="workspace"] > header > :is(.container,.nav) { width: auto; flex: 1; margin: 0; padding: 0; }
  body[data-portal-ui="workspace"] > header > :is(.actions,.top-actions,.topbar-actions,.topbar-right,.header-actions) { margin: 0 0 0 auto; }
  body[data-portal-ui="workspace"] > header :is(.brand img,.brand-logo,.brand-mark) { width: 32px; height: 32px; }
  body[data-portal-ui="workspace"] > header :is(.brand strong,.topbar-title,.topo h1) { font-size: 1.1rem; }
  body[data-portal-ui="workspace"] > header :is(.brand span,.brand small,.eyebrow) { font-size: .7rem; }
  body[data-portal-ui="workspace"] > header h1 { font-size: 1.15rem; }
  body[data-portal-ui="workspace"] > header.topo > a { color: #345e45; background: #eef2e7; }
  body[data-portal-ui="workspace"] > :is(main,.hero) { width: auto; max-width: 1440px; margin: 0 auto; padding: 30px 36px 80px; }
  body[data-portal-ui="workspace"] > .hero { padding-bottom: 0; }
  body[data-portal-ui="workspace"] > .hero .hero-card { padding: 14px 0; }
  body[data-portal-ui="workspace"] .container { width: 100%; }
  body[data-portal-ui="workspace"] main > .hero { padding: 10px 0 24px; }
  body[data-portal-ui="workspace"] .hero-card { padding: 12px 0 28px; }
  body[data-portal-ui="workspace"] main > .hero-banner { padding: 10px 0 24px; }
  body[data-portal-ui="workspace"] .grid:not(.two):has(> .module-card) { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
  body[data-portal-ui="workspace"] .section-head h2 { font-size: 1.2rem; }
  .portal-header-tools { display: flex; align-items: center; gap: 8px; }
  body[data-portal-ui] :is(.portal-ui-button,.portal-icon-button,.portal-search-trigger) { display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid #dfe4da; background: #fff; color: #354936; border-radius: 9px; padding: 9px 12px; cursor: pointer; min-height: 40px; font: inherit; }
  body[data-portal-ui] .portal-icon-button { padding: 9px; }
  .portal-icon-button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  body[data-portal-ui] :is(.portal-header-tools,.portal-sidebar,.portal-command-dialog) svg { width: 19px; height: 19px; flex-shrink: 0; }
  body[data-portal-ui] .portal-sidebar { position: fixed; margin: 0; inset: 0 auto 0 0; height: 100dvh; max-height: 100dvh; width: 252px; max-width: 87vw; padding: 22px 14px; border: 0; border-right: 1px solid #e3e7dc; background: #f1f3ec; color: #29342c; overflow-y: auto; z-index: 100; }
  .portal-sidebar[open] { display: flex; flex-direction: column; gap: 12px; }
  .portal-sidebar::backdrop, .portal-command-dialog::backdrop { background: #17251c66; backdrop-filter: blur(3px); }
  .portal-side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .portal-wordmark { display: flex; align-items: center; gap: 9px; text-decoration: none; color: #253c2d; letter-spacing: .06em; font-size: 16px; }
  .portal-wordmark img { width: 31px; height: 31px; object-fit: contain; border-radius: 7px; }
  .portal-side-head .portal-icon-button { border: 0; background: transparent; }
  .portal-scope { font-size: 11px; color: #64705e; margin: -2px 8px 8px; }
  body[data-portal-ui] .portal-search-trigger { width: 100%; justify-content: flex-start; font-size: 12px; padding: 10px; }
  .portal-search-trigger kbd { font-family: inherit; font-size: 9px; white-space: nowrap; color: #707769; margin-left: auto; }
  .portal-nav { display: grid; gap: 4px; }
  body[data-portal-ui] :is(.portal-nav-link,.portal-context-link) { width: 100%; display: flex; align-items: center; gap: 11px; padding: 11px 12px; border: 0; border-radius: 9px; background: transparent; color: #515c4c; text-decoration: none; text-align: left; font: inherit; font-size: 12px; cursor: pointer; min-height: 41px; }
  body[data-portal-ui] :is(.portal-nav-link,.portal-context-link):hover { background: #e6ebdf; color: #253c2d; }
  body[data-portal-ui] :is(.portal-nav-link[aria-current="page"],.portal-context-link[aria-pressed="true"]) { background: #e0e8d8; color: #2b4932; font-weight: 600; }
  .portal-nav-caption { margin: 16px 12px 7px; font-size: 10px; text-transform: uppercase; letter-spacing: .09em; color: #6a765f; }
  body[data-portal-ui] .portal-context-link { font-size: 11px; padding-block: 8px; }
  body[data-portal-ui] .portal-context-link svg { width: 13px; height: 13px; }
  .portal-side-footer { margin-top: auto; padding-top: 20px; border-top: 1px solid #dfe4d7; }
  .portal-side-footer small { display: block; color: #6b7563; padding: 16px 12px 0; font-size: 10px; }
  body[data-portal-ui] .portal-command-dialog { margin: 12vh auto auto; width: min(600px,calc(100vw - 28px)); max-height: 75dvh; padding: 20px; border: 1px solid #dce3d5; border-radius: 19px; background: #fff; box-shadow: 0 20px 90px #16241933; color: #29342c; }
  .portal-command-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
  body[data-portal-ui] .portal-command-head h2 { font-size: 18px; margin: 0; }
  body[data-portal-ui] .portal-command-input { width: 100%; padding: 15px; font-size: 16px; }
  .portal-command-count,.portal-command-help { font-size: 11px; color: #63715c; margin: 12px 2px; }
  .portal-command-results { display: grid; gap: 5px; }
  body[data-portal-ui] .portal-command-result { width: 100%; display: flex; gap: 10px; align-items: center; border: 0; border-radius: 9px; padding: 13px; background: #f5f7f1; color: #293c2e; font: inherit; text-align: left; cursor: pointer; }
  .portal-command-result small { margin-left: auto; font-size: 10px; color: #627357; white-space: nowrap; }
  .portal-command-result:hover { background: #e7eddf; }
  .portal-skip { position: fixed; left: 16px; top: -80px; z-index: 200; background: #fff; color: #244b32; padding: 12px; }
  .portal-skip:focus { top: 12px; }

  /* Entry points and sign-in share the same visual language. */
  body[data-portal-ui="login"] { display: grid; place-items: center; padding: 90px 28px 48px; background: #f7f8f3; }
  body[data-portal-ui="login"] :is(.auth-shell,.login-shell) { width: min(1040px,100%); display: grid; grid-template-columns: 1fr 1fr; gap: 0; background: #fff; border: 1px solid #e1e5db; border-radius: 22px; overflow: hidden; }
  body[data-portal-ui="login"] :is(.auth-card,.login-card) { padding: 46px; border: 0; box-shadow: none; border-radius: 0; background: #fff; }
  body[data-portal-ui="login"] :is(.auth-panel,.info-card) { padding: 46px; background: #edf1e5; border: 0; box-shadow: none; border-radius: 0; display: flex; flex-direction: column; justify-content: center; }
  body[data-portal-ui="login"] .auth-panel .panel-card { background: transparent; border: 0; box-shadow: none; padding: 0; color: #3e5134; }
  body[data-portal-ui="login"] :is(.info-card,.panel-card) h2 { font-size: 27px; font-weight: 500; line-height: 1.3; margin-bottom: 24px; color: #354a2b; }
  body[data-portal-ui="login"] :is(.info-card,.panel-card) li { color: #55634a; line-height: 1.7; margin-bottom: 16px; }
  body[data-portal-ui="login"] .brand-row img { width: 50px; height: 50px; object-fit: contain; background: transparent; }
  body[data-portal-ui="login"] .brand-row h1 { font-size: 1.65rem; letter-spacing: .04em; }
  body[data-portal-ui="login"] :is(.brand-row p,.fine-print) { font-size: 12px; }
  body[data-portal-ui="login"] .eyebrow { color: #5d6c54; font-size: 10px; letter-spacing: .09em; }
  body[data-portal-ui="login"] form { margin-top: 24px; }
  body[data-portal-ui="login"] .portal-password-toggle { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 8px; padding: 3px; border: 0; background: transparent; color: #49623f; font-size: 11px; cursor: pointer; }
  body[data-portal-ui="login"] .portal-password-toggle svg { width: 15px; height: 15px; }
  body[data-portal-ui="login"] .portal-password-toggle span { margin: 0; }
  .portal-login-back { position: absolute; top: 26px; left: 32px; color: #4f6245; text-decoration: none; font-size: 13px; }
  body[data-portal-ui="access"] { background: #fafbf7; }
  body[data-portal-ui="access"] .top { background: #eef2e7; color: #5e6d53; font-size: 11px; letter-spacing: .06em; font-weight: 500; }
  body[data-portal-ui="access"] .hero { padding-top: 65px; }
  body[data-portal-ui="access"] .hero h1 { font-size: clamp(2rem,4vw,3rem); font-weight: 500; }
  body[data-portal-ui="access"] .card { min-height: 305px; padding: 30px; }
  body[data-portal-ui="access"] .card:hover { transform: translateY(-3px); box-shadow: 0 10px 25px #26372c08; }
  body[data-portal-ui="access"] .icon { width: 46px; height: 46px; padding: 10px; margin-bottom: 30px; background: #eaf0e1; color: #506542; border-radius: 13px; }
  body[data-portal-ui="access"] .icon svg { width: 100%; height: 100%; filter: none; }
  body[data-portal-ui="access"] .btn { background: #345e45; font-weight: 500; }
  body[data-portal-ui="access"] .note { font-weight: 400; font-size: 13px; color: #617056; background: #f0f3e9; border: 0; border-radius: 12px; }
  @media (max-width: 1200px) {
    body[data-portal-ui="workspace"] .grid:not(.two):has(> .module-card) { grid-template-columns: repeat(2,minmax(0,1fr)); }
    body[data-portal-ui="workspace"] > :is(main,.hero) { padding-left: 24px; padding-right: 24px; }
    body[data-portal-ui="workspace"] .grid.two { grid-template-columns: 1fr; }
  }
  @media (max-width: 900px) {
    body[data-portal-ui="workspace"].portal-sidebar-visible { padding-left: 0; }
    body[data-portal-ui="workspace"] > header { padding: 12px 16px; gap: 12px; }
    body[data-portal-ui="workspace"] > header .nav { flex-wrap: wrap; }
    body[data-portal-ui="workspace"] :is(.hero,.hero-card,.hero-banner) { grid-template-columns: 1fr; gap: 18px; }
    body[data-portal-ui="workspace"] .kpis { grid-template-columns: repeat(2,minmax(0,1fr)); }
    body[data-portal-ui="login"] :is(.auth-shell,.login-shell) { max-width: 520px; grid-template-columns: 1fr; }
    body[data-portal-ui="login"] :is(.auth-panel,.info-card) { padding: 28px; }
    body[data-portal-ui="login"] :is(.info-card,.panel-card) h2 { font-size: 21px; }
    body[data-portal-ui="login"] :is(.info-card,.panel-card) li { margin-bottom: 8px; font-size: 13px; }
  }
  @media (max-width: 560px) {
    body[data-portal-ui="workspace"] > :is(main,.hero) { padding: 24px 16px 65px; }
    body[data-portal-ui="workspace"] > .hero { padding-bottom: 0; }
    body[data-portal-ui="workspace"] > header { position: relative; }
    body[data-portal-ui="workspace"] > header > :is(.actions,.top-actions,.topbar-actions,.topbar-right,.header-actions) { margin-left: 0; width: 100%; }
    body[data-portal-ui="workspace"] > header .small-user { max-width: 180px; white-space: normal; font-size: 11px; }
    body[data-portal-ui="workspace"] .grid:not(.two):has(> .module-card) { grid-template-columns: 1fr; }
    body[data-portal-ui="workspace"] :is(.quick-grid,.gestao-buttons,.family-section-buttons,.action-menu,.school-box) { grid-template-columns: repeat(2,minmax(0,1fr)); }
    body[data-portal-ui="workspace"] :is(.gestao-nav-button,.family-nav-button,.action-card) { padding: 12px; min-width: 0; }
    body[data-portal-ui="workspace"] :is(.gestao-nav-button,.family-nav-button,.action-card) strong { font-size: 12px; }
    body[data-portal-ui="workspace"] .school-box .metric:first-child { grid-column: 1 / -1; }
    body[data-portal-ui="workspace"] .summary-card { min-width: 0; }
    body[data-portal-ui="workspace"] :is(.form-grid,.stats-grid) { grid-template-columns: 1fr; }
    body[data-portal-ui="login"] { padding: 72px 14px 25px; }
    body[data-portal-ui="login"] :is(.auth-card,.login-card) { padding: 28px 24px; }
    .portal-login-back { left: 20px; top: 23px; }
    .portal-command-result small { display: none; }
  }
  @media (prefers-reduced-motion: reduce) {
    body[data-portal-ui], body[data-portal-ui] *, body[data-portal-ui] *::before, body[data-portal-ui] *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
  }
}
@media print { .portal-sidebar,.portal-header-tools,.portal-command-dialog,.portal-skip,.portal-login-back,.portal-password-toggle { display: none !important; } }
