/* VF SYS 2.0 — presentation only. Keep authentication and theme selection intact.
   Loaded after the responsive contract; geometry changes stay within its breakpoints. */
html[data-vf-shell-variant] body.vf-premium:where(:not(:has(#loginScreen.active:not(.admin-authenticated)))) {
  --vf-line: rgba(197, 154, 244, .24);
  --vf-line-strong: rgba(213, 166, 255, .46);
  --vf-glass: linear-gradient(125deg, rgba(219, 194, 255, .09), transparent 54%, rgba(223, 65, 189, .045));
  --vf-elevation: inset 0 1px 0 rgba(244, 221, 255, .13), 0 12px 36px rgba(10, 4, 30, .16);
  --vf-gradient-primary: linear-gradient(110deg, #7922e8, #ab20cf 58%, #cf2098);
  --vf-gradient-primary-hover: linear-gradient(110deg, #8935ee, #bb30de 58%, #dd30aa);
  &:not(.theme-light):not(.theme-dark) {
    --vf-bg: #17102f;
    --vf-panel: rgba(54, 37, 86, .57);
    --vf-panel-soft: #251b40;
    --vf-panel-raised: #37264f;
    --vf-ink: #f8f3ff;
    --vf-muted: #c6b6dd;
    --vf-accent: #d6a5ff;
    --vf-accent-solid: #a74bed;
    --vf-magenta: #ed54ca;
    --vf-accent-wash: rgba(174, 83, 233, .12);
    --vf-border-active: #c184f4;
    --vf-ambient: radial-gradient(ellipse at 54% -12%, rgba(146, 48, 197, .32), transparent 52%), radial-gradient(ellipse at 100% 62%, rgba(191, 25, 151, .14), transparent 42%), radial-gradient(ellipse at 4% 100%, rgba(101, 42, 193, .23), transparent 48%);
  }
  &.theme-light { --vf-line: rgba(105, 53, 160, .2); --vf-line-strong: rgba(105, 53, 160, .35); }
  .main-panel { background: var(--vf-ambient), var(--vf-bg) !important; }
  #vfMainStage.compact-main-stage { background: transparent !important; }
  .bg-layer { display: none !important; }
  .side-panel.left-panel {
    /* Ambient light stays within the sidebar; no extra layers or layout changes. */
    --vf-sidebar-ink: #eee8fa;
    --vf-sidebar-muted: #cbc0df;
    --vf-sidebar-icon: #d4bdf2;
    --vf-sidebar-line: rgba(211, 182, 255, .17);
    background:
      radial-gradient(ellipse at -18% 0%, rgba(146, 70, 228, .36), transparent 49%),
      radial-gradient(ellipse at 112% 30%, rgba(187, 57, 188, .20), transparent 37%),
      radial-gradient(ellipse at 100% 96%, rgba(99, 63, 191, .27), transparent 42%),
      linear-gradient(155deg, rgba(35, 23, 66, .97), rgba(18, 15, 40, .96) 55%, rgba(28, 20, 59, .97)) !important;
    border-color: var(--vf-sidebar-line) !important;
    box-shadow: inset 1px 0 rgba(230, 207, 255, .05), inset -1px 0 rgba(218, 173, 255, .04), inset 0 1px rgba(238, 216, 255, .07), 8px 0 32px rgba(11, 5, 30, .18) !important;
    backdrop-filter: blur(18px) saturate(115%) !important;
    -webkit-backdrop-filter: blur(18px) saturate(115%) !important;
  }
  &.theme-light .side-panel.left-panel {
    --vf-sidebar-ink: #382350;
    --vf-sidebar-muted: #655075;
    --vf-sidebar-icon: #765393;
    --vf-sidebar-line: rgba(112, 69, 158, .18);
    background:
      radial-gradient(ellipse at -18% 0%, rgba(174, 119, 235, .20), transparent 49%),
      radial-gradient(ellipse at 112% 30%, rgba(215, 115, 201, .12), transparent 37%),
      linear-gradient(155deg, rgba(248, 243, 255, .96), rgba(235, 228, 246, .97)) !important;
  }
  .compact-shell-brand {
    display: flex !important; align-items: center !important; justify-content: center !important;
    min-height: 72px; flex: 0 0 auto; padding: 2px 4px 12px !important;
    background: transparent !important; box-shadow: none !important; border-radius: 0 !important;
    border: 0 !important; border-bottom: 1px solid var(--vf-sidebar-line) !important;
  }
  .compact-shell-brand-mark {
    display: block; width: min(232px, 100%) !important; height: 60px !important; flex: 0 0 auto;
    padding: 0 !important; box-sizing: border-box !important;
    border: 0 !important; border-radius: 0 !important;
    background: transparent !important; box-shadow: none !important;
  }
  /* Fill the header width proportionally; crop only transparent vertical margins. */
  .compact-shell-brand-logo { display: block; min-width: 0; min-height: 0; filter: none; width: 100% !important; height: 100% !important; object-fit: cover !important; object-position: center; }
  .compact-shell-brand-copy { display: none !important; }
  #appSidebarPanel .nav-btn { border: 1px solid transparent !important; font-size: 13px !important; font-weight: 500 !important; }
  #appSidebarPanel .nav-btn :is(.compact-nav-text, .toolbar-nav-label) { font-size: inherit !important; font-weight: inherit !important; }
  .vf-mobile-brand img { padding: 0; box-sizing: border-box; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  #appSidebarPanel .nav-btn {
    color: var(--vf-sidebar-ink) !important;
    transition: background-color 200ms ease, border-color 200ms ease, box-shadow 200ms ease, color 200ms ease !important;
  }
  #appSidebarPanel .nav-btn :is(.compact-nav-text, .toolbar-nav-label) { color: inherit !important; }
  #appSidebarPanel .nav-btn :is(.compact-nav-icon, .toolbar-nav-icon) { color: var(--vf-sidebar-icon) !important; }
  #appSidebarPanel .nav-btn.active {
    color: #fff !important;
    background:
      linear-gradient(180deg, rgba(255, 227, 255, .13), transparent 48%, rgba(43, 10, 83, .12)),
      linear-gradient(110deg, rgba(116, 37, 203, .82), rgba(142, 39, 181, .62) 58%, rgba(215, 64, 162, .82)) !important;
    border-color: rgba(231, 155, 244, .52) !important;
    box-shadow: inset 2px 0 rgba(248, 172, 245, .86), inset 0 1px rgba(255, 225, 255, .20), inset 0 -1px rgba(86, 18, 112, .18), 0 3px 13px rgba(166, 41, 184, .18) !important;
  }
  #appSidebarPanel .nav-btn.active :is(.compact-nav-icon, .toolbar-nav-icon) { color: #f6d9ff !important; }
  #appSidebarPanel .sidebar-profile-shortcut { border-color: var(--vf-sidebar-line) !important; }
  #appSidebarPanel .sidebar-profile-shortcut-divider { background: var(--vf-sidebar-line) !important; }
  #appSidebarPanel .sidebar-profile-shortcut-card {
    background: linear-gradient(125deg, rgba(207, 174, 248, .10), rgba(168, 126, 225, .04) 65%, rgba(209, 119, 207, .09)) !important;
    border-color: var(--vf-sidebar-line) !important;
    box-shadow: inset 0 1px rgba(240, 217, 255, .08), 0 3px 12px rgba(13, 7, 35, .10) !important;
    transition: background-color 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
  }
  #appSidebarPanel .sidebar-profile-shortcut-meta strong { color: var(--vf-sidebar-ink) !important; }
  #appSidebarPanel .sidebar-profile-shortcut-meta span { color: var(--vf-sidebar-muted) !important; }
  @media (hover: hover) {
    #appSidebarPanel .nav-btn:hover:not(.active) {
      background: rgba(190, 151, 242, .09) !important;
      border-color: rgba(199, 166, 242, .13) !important;
      box-shadow: inset 0 1px rgba(231, 212, 255, .04) !important;
      color: var(--vf-sidebar-ink) !important;
    }
    #appSidebarPanel .nav-btn.active:hover {
      border-color: rgba(242, 184, 252, .72) !important;
      box-shadow: inset 2px 0 rgba(255, 201, 250, .95), inset 0 1px rgba(255, 235, 255, .30), inset 0 0 18px rgba(248, 166, 231, .10), 0 4px 16px rgba(166, 41, 184, .23) !important;
    }
    #appSidebarPanel .sidebar-profile-shortcut:hover .sidebar-profile-shortcut-card {
      background-color: rgba(190, 151, 242, .06) !important;
      border-color: rgba(199, 166, 242, .30) !important;
      box-shadow: inset 0 1px rgba(240, 217, 255, .13), 0 3px 12px rgba(13, 7, 35, .10) !important;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    #appSidebarPanel :is(.nav-btn, .sidebar-profile-shortcut-card) { transition: none !important; }
  }
  :is(.sidebar-collapse-toggle, .vf-mobile-header) { background: var(--vf-glass), var(--vf-panel-soft) !important; border-color: var(--vf-line-strong) !important; }
  .sidebar-collapse-toggle { border-radius: 50% !important; }
  :is(.side-card, .expenses-day-summary, .faturamento-kpi-card, .fat-composition) { backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
  :is(.modal-content, .medicos-modal-content, .expenses-modal) {
    background: var(--vf-glass), color-mix(in srgb, var(--vf-panel-soft) 94%, transparent) !important;
    backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); border-radius: 20px !important;
  }
  :is(button, a, input, select, textarea):focus-visible { outline: 2px solid var(--vf-accent); outline-offset: 4px; }
  :is(.filter-input, .filter-select, .fake-field input, .fake-field select, .expenses-date-field input) { border-radius: 11px !important; border-color: var(--vf-line-strong) !important; box-shadow: inset 0 2px 6px rgba(8,4,24,.12); }
  :is(.expenses-button, .fat-button, .primary-btn, .secondary-btn):active:not(:disabled) { transform: translateY(1px); }
  table { font-variant-numeric: tabular-nums; }
  table th { font-size: 11px; letter-spacing: .025em; }
  table :is(td, th) { border-bottom-color: var(--vf-line) !important; }
  #abaDespesas .expenses-day-summary { border-color: var(--vf-line-strong) !important; background: var(--vf-glass), var(--vf-panel) !important; }
  #abaDespesas .expenses-summary-card { position: relative; }
  #abaDespesas .expenses-summary-card > .vf-summary-icon {
    width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--vf-line-strong); border-radius: 14px; color: var(--vf-accent);
    background: linear-gradient(135deg, rgba(165,84,243,.3), rgba(208,64,188,.09));
    box-shadow: inset 0 1px rgba(244,213,255,.12); grid-column: 1; grid-row: 1 / 3;
  }
  .vf-summary-icon svg { width: 24px; height: 24px; }
  #abaDespesas .expenses-empty-state { min-height: 270px; background: var(--vf-glass), var(--vf-panel) !important; }
  #abaDespesas .expenses-empty-state strong { font-size: 19px; font-weight: 600; }
  #abaDespesas .expenses-empty-state p { max-width: 560px; font-size: 14px; }
  #abaDespesas .expenses-empty-symbol { font-size: 48px; color: var(--vf-accent); }
  #abaDespesas .expenses-attendance-card { background: var(--vf-glass), var(--vf-panel) !important; border-color: var(--vf-line) !important; border-radius: 14px; }
  #abaDespesas .expenses-attendance-card:hover { border-color: var(--vf-border-active) !important; box-shadow: var(--vf-elevation); }
  #abaPlanilhas .planilhas-stage-header { padding-bottom: 22px; margin-bottom: 22px; border-bottom: 1px solid var(--vf-line); align-items: center; }
  #abaPlanilhas .planilha-month-card { border-radius: 15px !important; border-color: var(--vf-line) !important; gap: 16px; transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease; }
  #abaPlanilhas .planilha-month-card:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--vf-border-active) !important; box-shadow: var(--vf-elevation) !important; }
  #abaPlanilhas .planilha-month-card.is-current { border-color: var(--vf-border-active) !important; }
  .vf-product-signature {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    margin-top: 56px;
    padding: 20px 0 6px;
    box-sizing: border-box;
    overflow: hidden;
  }
  .vf-product-signature-copy {
    min-width: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    color: var(--vf-muted);
    font-size: 10px;
    line-height: 1.6;
    letter-spacing: .16em;
  }
  .vf-product-signature-copy strong {
    font-size: 23px;
    font-weight: 400;
    letter-spacing: -.03em;
    color: var(--vf-accent);
    white-space: nowrap;
  }
  .vf-product-signature-copy strong::after {
    content: '';
    display: inline-block;
    width: 38px;
    height: 1px;
    margin: 0 6px 7px 18px;
    background: linear-gradient(90deg, #ee4fcc, #9847ef);
  }
  .vf-product-signature img {
    display: block;
    width: clamp(220px, 17vw, 310px);
    max-width: min(46%, 310px);
    height: auto;
    flex: 0 1 auto;
    object-fit: contain;
    object-position: center;
    opacity: .82;
    filter: saturate(.94) brightness(.98);
  }
}

/* Resultados keeps the desktop dashboard and becomes a progressive browser on phones. */
body.vf-premium #abaResultados {
  .resultados-mobile-flow,
  .resultados-mobile-continue,
  .resultados-mobile-detail-toggle,
  .resultados-attendance-financials {
    display: none;
  }

  .resultados-secondary-actions-menu {
    display: contents;
  }

  .resultados-secondary-actions-menu > summary {
    display: none;
  }

  .resultados-secondary-actions-popover {
    display: contents;
  }
}

@media (max-width: 767px), (pointer: coarse) {
  body.vf-premium #abaResultados {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    scroll-padding-top: calc(var(--header-height) + 78px);

    &,
    * {
      box-sizing: border-box;
    }

    :is(.resultados-shell, .resultados-stage-card, #resultadosWorkspace, .resultados-browser-shell, .resultados-mobile-panel) {
      min-width: 0;
      max-width: 100%;
    }

    > .top-header {
      display: grid !important;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: end !important;
      gap: 10px !important;
      margin-bottom: 12px !important;
    }

    > .top-header .eyebrow {
      display: none;
    }

    > .top-header h1 {
      font-size: clamp(1.45rem, 7vw, 1.8rem);
      line-height: 1.08;
    }

    > .top-header .subtitle {
      max-width: 28ch;
      margin-top: 5px;
      font-size: 12px;
      line-height: 1.4;
    }

    .resultados-header-actions .primary-btn {
      min-width: 82px;
      min-height: 44px;
      padding: 9px 12px;
    }

    .resultados-stage-card {
      padding: 12px !important;
      border-radius: 18px !important;
    }

    .resultados-stage-card > .planilhas-stage-header {
      display: grid !important;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 8px !important;
      margin-bottom: 10px !important;
      padding-bottom: 10px !important;
    }

    .resultados-stage-card > .planilhas-stage-header p,
    .resultados-stage-card > .planilhas-stage-header .section-title-with-icon .vf-icon-shell {
      display: none;
    }

    .resultados-stage-card > .planilhas-stage-header h3 {
      font-size: 1rem !important;
    }

    #resultadosCountPill {
      max-width: 124px;
      min-height: 30px;
      padding: 5px 8px;
      font-size: 10px;
      text-align: center;
    }

    .resultados-mobile-flow {
      position: sticky;
      top: calc(var(--header-height) + 5px);
      z-index: 24;
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 4px;
      margin-bottom: 12px;
      padding: 6px;
      border: 1px solid var(--vf-line);
      border-radius: 16px;
      background: color-mix(in srgb, var(--vf-panel-soft) 95%, transparent);
      box-shadow: 0 12px 34px rgba(7, 3, 20, .28);
      backdrop-filter: blur(18px);
      -webkit-backdrop-filter: blur(18px);
    }

    .resultados-mobile-flow button {
      min-width: 0;
      min-height: 48px;
      display: grid;
      place-items: center;
      align-content: center;
      gap: 2px;
      padding: 4px 2px;
      border: 1px solid transparent;
      border-radius: 11px;
      color: var(--vf-muted);
      background: transparent;
    }

    .resultados-mobile-flow button > span {
      width: 22px;
      height: 22px;
      display: grid;
      place-items: center;
      border: 1px solid var(--vf-line-strong);
      border-radius: 50%;
      font-size: 10px;
      font-weight: 800;
    }

    .resultados-mobile-flow button > strong {
      max-width: 100%;
      font-size: clamp(7px, 2.3vw, 10px);
      line-height: 1.1;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .resultados-mobile-flow button:is(.is-active, .is-complete) {
      color: var(--vf-ink);
    }

    .resultados-mobile-flow button.is-active {
      border-color: var(--vf-border-active);
      background: var(--vf-accent-wash);
    }

    .resultados-mobile-flow button:is(.is-active, .is-complete) > span {
      border-color: transparent;
      color: #fff;
      background: var(--vf-gradient-primary);
    }

    .resultados-mobile-panel {
      scroll-margin-top: calc(var(--header-height) + 78px);
    }

    .resultados-mobile-panel[hidden] {
      display: none !important;
    }

    .resultados-mobile-summary {
      display: grid;
      gap: 12px;
    }

    .resultados-kpi-strip {
      grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
      gap: 9px !important;
      margin: 0 !important;
    }

    .resultados-kpi-card {
      min-width: 0;
      min-height: 82px;
      gap: 7px !important;
      padding: 12px !important;
      border-radius: 14px !important;
    }

    .resultados-kpi-card-secondary {
      display: none !important;
    }

    .resultados-kpi-card .metric-card-head {
      gap: 6px;
    }

    .resultados-kpi-card .metric-card-head .vf-icon-shell {
      width: 17px;
      height: 17px;
    }

    .resultados-kpi-card .label {
      font-size: 10px !important;
      line-height: 1.2;
    }

    .resultados-kpi-card > strong {
      min-width: 0;
      font-size: clamp(1.05rem, 5.5vw, 1.35rem) !important;
      font-variant-numeric: tabular-nums;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .resultados-mobile-continue {
      width: 100%;
      min-height: 48px;
      display: inline-flex;
    }

    .resultados-browser-shell {
      display: contents;
    }

    .resultados-browser-section {
      width: 100%;
      padding: 12px !important;
      border-radius: 16px !important;
    }

    .resultados-browser-section > .planilhas-stage-header {
      margin-bottom: 10px !important;
      padding-bottom: 9px !important;
    }

    .resultados-browser-section > .planilhas-stage-header .eyebrow,
    .resultados-browser-section > .planilhas-stage-header .subtitle {
      display: none;
    }

    .resultados-browser-section > .planilhas-stage-header h3 {
      font-size: 1.05rem !important;
    }

    .resultados-month-grid {
      grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
      gap: 7px !important;
    }

    .resultados-month-grid .planilha-month-card {
      min-width: 0;
      min-height: 64px !important;
      gap: 4px;
      padding: 8px 5px !important;
      border-radius: 11px !important;
      text-align: center;
    }

    .resultados-month-grid .planilha-month-card span {
      font-size: 11px !important;
      line-height: 1.15;
    }

    .resultados-month-grid .planilha-month-card small {
      max-width: 100%;
      font-size: 8px !important;
      line-height: 1.15;
      white-space: normal;
    }

    .resultados-calendar-shell {
      padding: 6px !important;
      overflow: hidden !important;
    }

    :is(.resultados-calendar-grid, .resultados-calendar-weekdays) {
      min-width: 0 !important;
      grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
      gap: 3px !important;
    }

    .resultados-calendar-weekday {
      min-width: 0;
      min-height: 22px !important;
      font-size: 8px !important;
      text-align: center;
    }

    :is(.resultados-calendar-day, .resultados-calendar-empty) {
      position: relative;
      min-width: 0 !important;
      min-height: 48px !important;
      display: grid;
      place-items: center;
      padding: 4px 2px !important;
      border-radius: 9px !important;
    }

    .resultados-calendar-day strong {
      font-size: 12px;
    }

    .resultados-calendar-day :is(small, em) {
      display: none;
    }

    .resultados-calendar-day .resultados-calendar-dot {
      position: absolute;
      right: 5px;
      bottom: 5px;
      width: 6px;
      height: 6px;
      display: block;
      box-shadow: 0 0 0 3px rgba(111, 224, 171, .12);
    }

    .resultados-detail-head {
      display: grid !important;
      gap: 10px !important;
      padding: 0 0 12px !important;
    }

    .resultados-detail-head h3 {
      font-size: 1.15rem !important;
    }

    .resultados-detail-head .subtitle {
      font-size: 12px;
      overflow-wrap: anywhere;
    }

    .resultados-detail-head-actions {
      width: 100%;
      justify-items: stretch;
    }

    .resultados-detail-toolbar {
      display: grid !important;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 6px !important;
    }

    .resultados-detail-toolbar :is(.primary-btn, .secondary-btn) {
      min-width: 0 !important;
      min-height: 44px;
      padding: 7px 5px;
      font-size: 10px;
      line-height: 1.15;
    }

    .resultados-detail-pills {
      justify-content: flex-start;
    }

    .resultados-detail-summary {
      display: none !important;
    }

    .resultados-detail-list {
      gap: 10px !important;
    }

    .resultados-detail-attendance {
      min-width: 0;
      display: grid;
      gap: 12px;
      padding: 13px !important;
      border-radius: 16px !important;
    }

    .resultados-detail-attendance-head {
      display: grid !important;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: start !important;
      gap: 10px !important;
    }

    .resultados-attendance-identity {
      min-width: 0;
    }

    .resultados-attendance-identity > strong {
      display: block;
      font-size: 15px;
      line-height: 1.3;
      overflow-wrap: anywhere;
    }

    .resultados-attendance-identity p {
      font-size: 12px;
      line-height: 1.35;
      overflow-wrap: anywhere;
    }

    .resultados-attendance-identity small {
      display: block;
      margin-top: 7px;
      color: var(--vf-muted);
      font-size: 10px;
      line-height: 1.4;
      overflow-wrap: anywhere;
    }

    .resultados-attendance-actions {
      position: relative;
      display: grid !important;
      grid-template-columns: 44px;
      justify-items: end;
      gap: 7px !important;
    }

    .resultados-attendance-actions > .pill {
      grid-column: 1 / -1;
      max-width: 104px;
      min-height: 28px;
      padding: 5px 7px;
      font-size: 10px;
      white-space: nowrap;
    }

    .resultados-mobile-detail-toggle {
      grid-column: 1 / -1;
      width: 114px;
      min-height: 44px;
      display: inline-flex;
      padding: 8px;
      font-size: 11px;
    }

    .resultados-secondary-actions-menu {
      position: relative;
      display: block;
      grid-column: 1 / -1;
    }

    .resultados-secondary-actions-menu > summary {
      width: 44px;
      height: 44px;
      display: grid;
      place-items: center;
      margin-left: auto;
      border: 1px solid var(--vf-line-strong);
      border-radius: 12px;
      color: var(--vf-ink);
      background: var(--vf-panel-raised);
      cursor: pointer;
      list-style: none;
      font-size: 15px;
      letter-spacing: 2px;
    }

    .resultados-secondary-actions-menu > summary::-webkit-details-marker {
      display: none;
    }

    .resultados-secondary-actions-popover {
      position: absolute;
      z-index: 40;
      top: calc(100% + 6px);
      right: 0;
      width: 154px;
      display: grid;
      gap: 5px;
      padding: 7px;
      border: 1px solid var(--vf-line-strong);
      border-radius: 13px;
      background: var(--vf-panel-soft);
      box-shadow: 0 16px 36px rgba(5, 1, 15, .42);
    }

    .resultados-secondary-actions-popover .secondary-btn {
      width: 100%;
      min-width: 0;
      min-height: 44px;
      justify-content: flex-start;
      padding: 8px 10px;
      font-size: 12px;
    }

    .resultados-secondary-actions-popover [data-planilha-detail] {
      display: none;
    }

    .resultados-attendance-financials {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 6px;
    }

    .resultados-attendance-financials > span {
      min-width: 0;
      display: grid;
      gap: 4px;
      padding: 9px 7px;
      border: 1px solid var(--vf-line);
      border-radius: 11px;
      background: rgba(255, 255, 255, .025);
    }

    .resultados-attendance-financials small {
      color: var(--vf-muted);
      font-size: 8px;
      line-height: 1.2;
      text-transform: uppercase;
    }

    .resultados-attendance-financials strong {
      min-width: 0;
      font-size: clamp(10px, 2.75vw, 12px);
      font-variant-numeric: tabular-nums;
      white-space: nowrap;
    }

    .resultados-attendance-details[hidden] {
      display: none !important;
    }

    .resultados-attendance-details {
      min-width: 0;
      max-height: 55dvh;
      overflow-y: auto;
      overflow-x: hidden;
      overscroll-behavior: contain;
    }

    .resultados-attendance-details .week-table-wrapper {
      width: 100%;
      min-width: 0;
      overflow: visible !important;
      border: 0 !important;
      background: transparent !important;
    }

    .resultados-exams-table,
    .resultados-exams-table tbody {
      width: 100%;
      min-width: 0 !important;
      display: grid;
      gap: 8px;
    }

    .resultados-exams-table thead {
      display: none;
    }

    .resultados-exams-table .resultados-exam-row {
      width: 100%;
      min-width: 0;
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px 12px;
      padding: 11px;
      border: 1px solid var(--vf-line);
      border-radius: 13px;
      background: rgba(255, 255, 255, .025);
    }

    .resultados-exams-table .resultados-exam-row > td {
      width: 100% !important;
      min-width: 0 !important;
      display: grid;
      gap: 3px;
      padding: 0 !important;
      border: 0 !important;
      background: transparent !important;
      font-size: 11px !important;
      white-space: normal;
    }

    .resultados-exams-table .resultados-exam-row > td::before {
      content: attr(data-label);
      color: var(--vf-muted);
      font-size: 8px;
      font-weight: 700;
      letter-spacing: .05em;
      text-transform: uppercase;
    }

    .resultados-exams-table .resultados-exam-name {
      grid-column: 1 / -1;
      padding-bottom: 7px !important;
      border-bottom: 1px solid var(--vf-line) !important;
    }

    .resultados-exams-table .resultados-exam-name strong {
      font-size: 13px;
      line-height: 1.35;
      overflow-wrap: anywhere;
    }

    .resultados-exams-table .money {
      font-variant-numeric: tabular-nums;
      white-space: nowrap !important;
      word-break: keep-all !important;
    }
  }
}

/* Mobile header: navigation controls framing the transparent VF brand only. */
@media (max-width: 1023px) {
  body.vf-premium .vf-mobile-header {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    gap: 8px;
  }

  body.vf-premium .vf-mobile-brand {
    width: 100%;
    min-width: 0;
    height: calc(var(--header-height) - 8px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0 4px;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  body.vf-premium .vf-mobile-brand > div {
    display: none !important;
  }

  body.vf-premium .vf-mobile-brand img {
    display: block;
    width: min(210px, 100%) !important;
    height: 52px !important;
    max-width: 100%;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    object-fit: cover;
    object-position: center;
  }
}

/* Mobile auth is a standalone surface. The private application is not mounted behind it. */
@media (max-width: 767px), (pointer: coarse) {
  html[data-vf-auth-surface="mobile"] {
    width: 100%;
    min-height: 100%;
    background: #130724;
  }

  html[data-vf-auth-surface="mobile"] body.auth-locked {
    width: 100%;
    min-height: 100dvh;
    margin: 0;
    background:
      radial-gradient(circle at 18% 8%, rgba(190, 58, 255, .2), transparent 38%),
      radial-gradient(circle at 88% 88%, rgba(235, 42, 173, .14), transparent 42%),
      linear-gradient(155deg, #19092c, #10071e 64%, #170625);
  }

  html[data-vf-auth-surface="mobile"] #loginScreen.active {
    position: relative !important;
    inset: auto !important;
    box-sizing: border-box;
    width: 100%;
    min-height: 100dvh !important;
    height: auto !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding:
      max(18px, env(safe-area-inset-top))
      max(14px, env(safe-area-inset-right))
      max(18px, env(safe-area-inset-bottom))
      max(14px, env(safe-area-inset-left)) !important;
    overflow-x: clip !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain;
  }

  html[data-vf-auth-surface="mobile"] .vf-mobile-login-brand {
    position: relative !important;
    inset: auto !important;
    width: min(100%, 390px) !important;
    margin: 0 auto;
    transform: none !important;
  }

  html[data-vf-auth-surface="mobile"] .vf-mobile-auth-shell {
    width: min(100%, 410px) !important;
    max-width: 410px;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 auto !important;
    display: flex !important;
    flex-direction: column;
    gap: 12px;
    overflow: visible !important;
  }

  html[data-vf-auth-surface="mobile"] .vf-mobile-auth-shell .login-form-panel {
    box-sizing: border-box;
    width: 100%;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 18px 16px 20px !important;
    border: 1px solid rgba(221, 181, 255, .2);
    border-radius: 26px !important;
    overflow: visible !important;
    background:
      linear-gradient(145deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .035)),
      rgba(31, 13, 53, .78);
    box-shadow: 0 22px 60px rgba(4, 0, 15, .38), inset 0 1px rgba(255, 255, 255, .09);
    backdrop-filter: blur(22px) saturate(118%);
    -webkit-backdrop-filter: blur(22px) saturate(118%);
  }

  html[data-vf-auth-surface="mobile"] .vf-mobile-auth-shell :is(.login-auth-form, .login-form, .fake-field, .password-input-shell, .mini-info, .profile-help, .login-actions) {
    box-sizing: border-box;
    width: 100%;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  html[data-vf-auth-surface="mobile"] .vf-mobile-auth-shell :is(.profile-help, .mini-info strong) {
    overflow-wrap: anywhere;
  }

  html[data-vf-auth-surface="mobile"] .vf-mobile-auth-shell :is(.fake-field input, .password-input-shell input) {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 48px !important;
    font-size: 16px !important;
  }

  html[data-vf-auth-surface="mobile"] .vf-mobile-auth-shell .login-actions .primary-btn {
    min-height: 50px !important;
  }

  html[data-vf-auth-surface="mobile"] .vf-mobile-auth-shell .login-signature {
    position: relative !important;
    inset: auto !important;
    width: 100%;
    max-width: none;
    margin: 0 !important;
    transform: none !important;
    box-sizing: border-box;
  }

  .vf-mobile-admin-unavailable {
    min-height: 320px;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 12px;
    padding: 22px 10px;
    color: var(--vf-ink);
    text-align: center;
  }

  .vf-mobile-admin-unavailable[hidden] {
    display: none !important;
  }

  .vf-mobile-admin-unavailable h2,
  .vf-mobile-admin-unavailable p {
    margin: 0;
  }

  .vf-mobile-admin-unavailable p {
    max-width: 280px;
    color: var(--vf-muted);
    line-height: 1.5;
  }

  .vf-mobile-admin-mark {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border: 1px solid var(--vf-line-strong);
    border-radius: 18px;
    color: #fff;
    background: linear-gradient(145deg, #a12cff, #e22a9d);
    box-shadow: 0 12px 34px rgba(177, 38, 244, .3);
    font-weight: 800;
  }

  .vf-mobile-admin-unavailable .secondary-btn {
    min-height: 46px;
    margin-top: 8px;
  }
}
@media (min-width: 1024px) {
  html[data-vf-shell-variant] body.vf-premium:where(:not(:has(#loginScreen.active:not(.admin-authenticated)))) {
    .side-panel.left-panel {
      padding: 12px 14px 10px !important;
      gap: 8px !important;
      overflow: hidden !important;
      overscroll-behavior: none;
    }
    :is(.toolbar-tabs, .compact-nav-grid) { gap: 2px !important; }
    .side-panel .nav-btn {
      min-height: 37px !important; height: 37px !important;
      gap: 11px !important; padding: 7px 11px !important;
      border-radius: 9px !important;
    }
    .side-panel .nav-btn :is(.toolbar-nav-icon, .compact-nav-icon) {
      width: 18px !important; height: 18px !important; flex-basis: 18px !important;
    }
    .side-panel .nav-btn :is(.toolbar-nav-label, .compact-nav-text) {
      font-size: 12.5px !important; line-height: 1.2; white-space: nowrap;
    }
    .sidebar-profile-shortcut {
      min-height: 42px !important; padding: 8px 2px 0 !important;
    }
    .sidebar-profile-shortcut-card { min-height: 34px; padding: 2px !important; gap: 9px !important; }
    .sidebar-profile-avatar { width: 30px !important; height: 30px !important; flex-basis: 30px !important; }
    .sidebar-profile-shortcut-meta { min-width: 0; gap: 0 !important; text-align: left; }
    .sidebar-profile-shortcut-meta strong { font-size: 11px !important; line-height: 1.3; }
    .sidebar-profile-shortcut-meta span {
      display: block; max-width: 164px; overflow: hidden; text-overflow: ellipsis;
      font-size: 9px !important; line-height: 1.3; white-space: nowrap;
    }
  }
}
@media (min-width: 1280px) {
  html[data-vf-shell-variant] body.vf-premium:where(:not(:has(#loginScreen.active:not(.admin-authenticated)))) {
    --sidebar-width: 244px; --page-padding: 32px;
    .aba-conteudo > :is(.top-header, .expenses-page-header, .faturamento-executive-header) { padding-top: 24px !important; padding-bottom: 12px !important; }
    .aba-conteudo h1 { font-size: clamp(30px, 2.6vw, 44px) !important; letter-spacing: -.04em; }
    :is(#abaDespesas, #abaPlanilhas, #abaFaturamento) h1 { font-size: clamp(30px, 2.6vw, 44px) !important; }
    #abaDespesas .expenses-page-heading .subtitle { font-size: 17px !important; }
    #abaDespesas .expenses-page-header { border-bottom: 0 !important; padding-top: 34px !important; margin-bottom: 28px !important; }
    #abaDespesas .expenses-block-header h2 { font-size: 23px !important; }
    #abaDespesas .expenses-block-header p { font-size: 14px !important; }
    #abaDespesas .expenses-date-field > span { font-size: 12px !important; }
    #abaDespesas .expenses-button { min-height: 48px; font-size: 13px !important; }
    #abaDespesas .expenses-date-field input { height: 48px; }
    .side-panel .nav-btn { min-height: 38px !important; height: 38px !important; }
    #abaDespesas .expenses-summary-card { grid-template-columns: 48px minmax(0,1fr); column-gap: 16px; row-gap: 4px; flex: 1 1 0; padding-inline: 20px; }
    #abaDespesas .expenses-summary-card:first-child { padding-left: 0; }
    #abaDespesas .expenses-summary-card > :is(span:not(.vf-summary-icon), strong) { grid-column: 2; }
    #abaDespesas .expenses-summary-card > span:not(.vf-summary-icon) { font-size: 12px; }
  }
}
@media (min-width: 1600px) {
  html[data-vf-shell-variant] body.vf-premium { --sidebar-width: 272px; --page-padding: 40px; }
}
@media (min-width: 1024px) and (max-height: 739px) {
  html[data-vf-shell-variant] body.vf-premium:where(:not(:has(#loginScreen.active:not(.admin-authenticated)))) {
    .compact-shell-brand { min-height: 58px; padding-bottom: 8px !important; }
    .compact-shell-brand-mark { height: 50px !important; }
    .side-panel .nav-btn { min-height: 35px !important; height: 35px !important; padding-block: 6px !important; }
    .side-panel .nav-btn :is(.toolbar-nav-label, .compact-nav-text) { font-size: 12px !important; }
    .sidebar-profile-shortcut { padding-top: 6px !important; }
  }
}
@media (max-width: 1279px) {
  html[data-vf-shell-variant] body.vf-premium #abaDespesas .expenses-summary-card > .vf-summary-icon { display: none; }
}
@media (max-width: 600px) {
  html[data-vf-shell-variant] body.vf-premium .vf-product-signature {
    align-items: flex-end;
    flex-direction: column;
    gap: 18px;
    margin-top: 28px;
    padding-bottom: 2px;
  }
  html[data-vf-shell-variant] body.vf-premium .vf-product-signature-copy {
    width: 100%;
    display: grid;
    justify-items: start;
    gap: 3px;
  }
  html[data-vf-shell-variant] body.vf-premium .vf-product-signature-copy strong::after { display: none; }
  html[data-vf-shell-variant] body.vf-premium .vf-product-signature img { width: min(220px, 64vw); max-width: 100%; opacity: .74; }
}
@media (prefers-reduced-motion: reduce) {
  html[data-vf-shell-variant] body.vf-premium #abaPlanilhas .planilha-month-card:hover { transform: none; }
}

/* User avatars share one geometry contract across account surfaces. */
html[data-vf-shell-variant] body.vf-premium :is(
  .profile-photo-preview,
  .sidebar-profile-avatar,
  .login-avatar-frame,
  .vision-message-avatar,
  .accounting-profile-avatar
) {
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

html[data-vf-shell-variant] body.vf-premium :is(
  .profile-photo-preview,
  .sidebar-profile-avatar,
  .login-avatar-frame,
  .vision-message-avatar,
  .accounting-profile-avatar
) > img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
}

/* Neutralize legacy minimums so the premium account preview cannot become oval. */
html[data-vf-shell-variant] body.vf-premium:where(:not(:has(#loginScreen.active:not(.admin-authenticated)))) #abaConfiguracoes .profile-photo-preview {
  width: 112px !important;
  height: 112px !important;
  min-width: 112px !important;
  min-height: 112px !important;
  max-width: 112px !important;
  max-height: 112px !important;
}

@media (max-width: 480px) {
  html[data-vf-shell-variant] body.vf-premium:where(:not(:has(#loginScreen.active:not(.admin-authenticated)))) #abaConfiguracoes .profile-photo-preview {
    width: 96px !important;
    height: 96px !important;
    min-width: 96px !important;
    min-height: 96px !important;
    max-width: 96px !important;
    max-height: 96px !important;
  }
}

/* Compact notebooks: preserve the full navigation without scaling the product UI. */
@media (min-width: 1024px) and (max-width: 1440px) and (max-height: 800px) {
  html[data-vf-shell-variant] body.vf-premium:where(:not(:has(#loginScreen.active:not(.admin-authenticated)))) {
    --sidebar-width: 232px;
    --page-padding: 22px;
    --card-padding: 20px;
    --page-gap: 18px;

    .side-panel.left-panel {
      padding: 10px 12px 8px !important;
      gap: 6px !important;
      overflow: hidden !important;
    }

    .compact-shell-brand {
      min-height: 60px;
      height: 60px;
      padding: 0 4px 8px !important;
    }

    .compact-shell-brand-mark {
      width: min(208px, 100%) !important;
      height: 48px !important;
    }

    :is(.toolbar-tabs, .compact-nav-grid) {
      gap: 2px !important;
    }

    .side-panel .nav-btn {
      min-height: 35px !important;
      height: 35px !important;
      gap: 10px !important;
      padding: 6px 10px !important;
    }

    .side-panel .nav-btn :is(.toolbar-nav-icon, .compact-nav-icon) {
      width: 18px !important;
      height: 18px !important;
      flex-basis: 18px !important;
    }

    .side-panel .nav-btn :is(.toolbar-nav-label, .compact-nav-text) {
      font-size: 12px !important;
      line-height: 1.2;
    }

    .sidebar-profile-shortcut {
      min-height: 42px !important;
      padding: 6px 2px 0 !important;
    }

    .sidebar-profile-shortcut-card {
      min-height: 34px;
      padding: 2px !important;
    }

    .sidebar-collapse-toggle--collapse {
      top: 18px !important;
    }

    .aba-conteudo > :is(.top-header, .expenses-page-header, .faturamento-executive-header) {
      padding-top: 12px !important;
      padding-bottom: 10px !important;
      margin-bottom: var(--page-gap) !important;
    }

    .aba-conteudo h1,
    :is(#abaDespesas, #abaPlanilhas, #abaFaturamento) h1 {
      font-size: clamp(28px, 2.35vw, 32px) !important;
    }

    #abaDespesas .expenses-page-header {
      padding-top: 16px !important;
      margin-bottom: 20px !important;
    }

    #abaDespesas .expenses-button,
    #abaDespesas .expenses-date-field input {
      min-height: 44px;
      height: 44px;
    }
  }
}

/* Desktop account lives in the application header; the sidebar remains navigation-only. */
html[data-vf-shell-variant] body.vf-premium .vf-compact-account {
  display: none;
}

html[data-vf-shell-variant] body.vf-premium:where(:not(:has(#loginScreen.active:not(.admin-authenticated)))) #appSidebarPanel .sidebar-profile-shortcut {
  display: none !important;
}

@media (min-width: 1024px) {
  html[data-vf-shell-variant] body.vf-premium:where(:not(:has(#loginScreen.active:not(.admin-authenticated)))) {
    .vf-compact-account {
      position: fixed;
      z-index: 920;
      top: 12px;
      right: 16px;
      display: block;
    }

    .vf-compact-account-trigger {
      min-width: 164px;
      height: 44px;
      display: grid;
      grid-template-columns: 30px minmax(0, 1fr) 14px;
      align-items: center;
      gap: 9px;
      padding: 6px 10px 6px 7px;
      border: 1px solid var(--vf-line-strong);
      border-radius: 14px;
      color: var(--vf-ink);
      background: var(--vf-glass), color-mix(in srgb, var(--vf-panel-soft) 94%, transparent);
      box-shadow: var(--vf-elevation);
      backdrop-filter: blur(20px) saturate(120%);
      -webkit-backdrop-filter: blur(20px) saturate(120%);
    }

    .vf-compact-account-trigger:hover,
    .vf-compact-account-trigger:focus-visible,
    .vf-compact-account.is-open .vf-compact-account-trigger {
      border-color: var(--vf-border-active);
      background: var(--vf-glass), var(--vf-panel-raised);
    }

    .vf-compact-account-trigger > img,
    .vf-compact-account-identity > img {
      display: block;
      width: 30px;
      height: 30px;
      border: 1px solid var(--vf-line-strong);
      border-radius: 50%;
      object-fit: cover;
      object-position: center;
      background: var(--vf-panel-raised);
    }

    .vf-compact-account-trigger-copy {
      min-width: 0;
      display: grid;
      gap: 1px;
      text-align: left;
    }

    .vf-compact-account-trigger-copy strong,
    .vf-compact-account-trigger-copy small {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .vf-compact-account-trigger-copy strong {
      font-size: 11px;
      line-height: 1.2;
    }

    .vf-compact-account-trigger-copy small {
      color: var(--vf-muted);
      font-size: 9px;
      line-height: 1.2;
    }

    .vf-compact-account-chevron {
      color: var(--vf-muted);
      font-size: 14px;
      transition: transform 160ms ease;
    }

    .vf-compact-account.is-open .vf-compact-account-chevron {
      transform: rotate(180deg);
    }

    .vf-compact-account-menu {
      position: absolute;
      top: calc(100% + 8px);
      right: 0;
      width: min(284px, calc(100vw - 32px));
      padding: 12px;
      border: 1px solid var(--vf-line-strong);
      border-radius: 16px;
      color: var(--vf-ink);
      background: var(--vf-glass), color-mix(in srgb, var(--vf-panel-soft) 97%, transparent);
      box-shadow: 0 18px 48px rgba(8, 3, 24, .34), inset 0 1px rgba(255, 255, 255, .08);
      backdrop-filter: blur(24px) saturate(125%);
      -webkit-backdrop-filter: blur(24px) saturate(125%);
    }

    .vf-compact-account-menu[hidden] {
      display: none !important;
    }

    .vf-compact-account-identity {
      display: grid;
      grid-template-columns: 38px minmax(0, 1fr);
      align-items: center;
      gap: 10px;
      padding: 4px;
    }

    .vf-compact-account-identity > img {
      width: 38px;
      height: 38px;
    }

    .vf-compact-account-identity > span {
      min-width: 0;
      display: grid;
      gap: 3px;
    }

    .vf-compact-account-identity strong,
    .vf-compact-account-identity small {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .vf-compact-account-identity strong {
      font-size: 13px;
    }

    .vf-compact-account-identity small {
      color: var(--vf-muted);
      font-size: 10px;
    }

    .vf-compact-account-divider {
      height: 1px;
      margin: 10px 2px;
      background: var(--vf-line);
    }

    .vf-compact-account-menu > button {
      width: 100%;
      min-height: 40px;
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 9px 10px;
      border: 1px solid transparent;
      border-radius: 10px;
      color: var(--vf-ink);
      background: transparent;
      font-size: 12px;
      text-align: left;
    }

    .vf-compact-account-menu > button:hover,
    .vf-compact-account-menu > button:focus-visible {
      border-color: var(--vf-line);
      background: var(--vf-accent-wash);
    }

    .vf-compact-account-menu > button.is-danger {
      color: var(--vf-danger);
    }

    .vf-compact-account-menu .vf-icon-shell {
      width: 18px;
      height: 18px;
      flex: 0 0 18px;
    }

    .aba-conteudo > :is(.top-header, .expenses-page-header, .faturamento-executive-header) {
      padding-right: 184px !important;
    }
  }
}

/* Low-height notebooks keep the same account pattern with denser navigation. */
@media (min-width: 1024px) and (max-height: 720px) {
  html[data-vf-shell-variant] body.vf-premium:where(:not(:has(#loginScreen.active:not(.admin-authenticated)))) {
    .side-panel.left-panel {
      padding: 8px 10px 6px !important;
      gap: 4px !important;
    }

    .compact-shell-brand {
      min-height: 52px;
      height: 52px;
      padding: 0 4px 6px !important;
    }

    .compact-shell-brand-mark {
      width: min(198px, 100%) !important;
      height: 44px !important;
    }

    :is(.toolbar-tabs, .compact-nav-grid) {
      gap: 1px !important;
    }

    .side-panel .nav-btn {
      min-height: 33px !important;
      height: 33px !important;
      padding: 5px 10px !important;
    }

    .side-panel .nav-btn :is(.toolbar-nav-label, .compact-nav-text) {
      font-size: 12px !important;
    }
  }
}

/* Planilhas: desktop keeps the table; mobile receives a dedicated four-step flow. */
body.vf-premium #abaPlanilhas {
  .planilha-mobile-stepper,
  .planilha-mobile-flow-nav,
  .planilha-mobile-access-status,
  .planilha-exam-mobile-extra,
  .planilha-qty-button {
    display: none;
  }

  .planilha-qty-control {
    display: block;
  }
}

@media (max-width: 767px), (pointer: coarse) {
  body.vf-premium #abaPlanilhas {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    scroll-padding-top: calc(var(--header-height) + 88px);

    &,
    * {
      box-sizing: border-box;
    }

    :is(.planilhas-shell, .planilhas-stage-card, #planilhasWorkspace, .planilha-registration-shell, .planilha-mobile-step-panel) {
      min-width: 0;
      max-width: 100%;
    }

    > .top-header {
      gap: 8px !important;
      margin-bottom: 12px !important;
    }

    > .top-header h1 {
      font-size: clamp(1.45rem, 7vw, 1.85rem);
    }

    .planilhas-header-rules,
    .planilhas-guide-grid {
      display: none;
    }

    .planilhas-stage-card {
      padding: 12px !important;
      border-radius: 18px !important;
    }

    .planilhas-stage-header {
      display: grid !important;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 10px !important;
      align-items: center !important;
      padding-bottom: 10px !important;
      margin-bottom: 12px !important;
    }

    .planilhas-stage-header h3 {
      font-size: 1rem !important;
    }

    .planilhas-stage-header p {
      display: none;
    }

    .planilhas-stage-actions {
      width: auto !important;
      display: flex;
      flex-wrap: nowrap !important;
      justify-content: flex-end;
      gap: 6px !important;
    }

    .planilhas-stage-actions .pill {
      max-width: 110px;
      min-height: 30px;
      padding: 5px 8px;
      font-size: 9px;
      line-height: 1.15;
      text-align: center;
    }

    #planilhasBackBtn {
      min-width: 70px;
      min-height: 38px;
      padding: 7px 10px;
      font-size: 12px;
    }

    .planilha-registration-shell.is-mobile-flow {
      display: grid;
      gap: 12px;
      padding-bottom: calc(76px + env(safe-area-inset-bottom));
    }

    .planilha-mobile-stepper {
      position: sticky;
      top: calc(var(--header-height) + 6px);
      z-index: 24;
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 4px;
      padding: 6px;
      border: 1px solid var(--vf-line);
      border-radius: 16px;
      background: color-mix(in srgb, var(--vf-panel-soft) 94%, transparent);
      box-shadow: 0 12px 34px rgba(7, 3, 20, .3);
      backdrop-filter: blur(18px);
      -webkit-backdrop-filter: blur(18px);
    }

    .planilha-mobile-step {
      min-width: 0;
      min-height: 48px !important;
      display: grid;
      place-items: center;
      align-content: center;
      gap: 2px;
      padding: 4px 2px !important;
      border: 1px solid transparent;
      border-radius: 11px;
      color: var(--vf-muted);
      background: transparent;
    }

    .planilha-mobile-step > span {
      width: 22px;
      height: 22px;
      display: grid;
      place-items: center;
      border: 1px solid var(--vf-line-strong);
      border-radius: 50%;
      font-size: 10px;
      font-weight: 800;
    }

    .planilha-mobile-step > strong {
      min-width: 0;
      font-size: clamp(8px, 2.45vw, 10px);
      line-height: 1.1;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .planilha-mobile-step:is(.is-active, .is-complete) {
      color: var(--vf-ink);
    }

    .planilha-mobile-step.is-active {
      border-color: var(--vf-border-active);
      background: var(--vf-accent-wash);
    }

    .planilha-mobile-step.is-active > span,
    .planilha-mobile-step.is-complete > span {
      border-color: transparent;
      color: #fff;
      background: var(--vf-gradient-primary);
    }

    .planilha-mobile-flow-nav {
      position: fixed;
      z-index: 790;
      right: max(12px, env(safe-area-inset-right));
      bottom: max(10px, env(safe-area-inset-bottom));
      left: max(12px, env(safe-area-inset-left));
      width: auto;
      max-width: 430px;
      min-height: 58px;
      margin: 0 auto;
      display: grid;
      grid-template-columns: minmax(78px, .8fr) minmax(92px, 1fr) minmax(88px, .9fr);
      align-items: center;
      gap: 8px;
      padding: 7px;
      border: 1px solid var(--vf-line-strong);
      border-radius: 17px;
      background: color-mix(in srgb, var(--vf-panel-soft) 96%, transparent);
      box-shadow: 0 18px 46px rgba(5, 1, 15, .46);
      backdrop-filter: blur(22px) saturate(120%);
      -webkit-backdrop-filter: blur(22px) saturate(120%);
    }

    .planilha-mobile-flow-nav > span {
      min-width: 0;
      color: var(--vf-muted);
      font-size: 11px;
      font-weight: 700;
      text-align: center;
      white-space: nowrap;
    }

    .planilha-mobile-flow-nav button {
      min-width: 0;
      min-height: 44px !important;
      padding: 8px !important;
      border-radius: 12px !important;
      font-size: 12px;
    }

    .planilha-mobile-flow-nav button[hidden] {
      display: none !important;
    }

    .planilha-mobile-flow-nav:has([data-planilha-mobile-next][hidden]) {
      grid-template-columns: minmax(96px, 1fr) minmax(120px, 1.4fr);
    }

    .planilha-mobile-step-panel {
      scroll-margin-top: calc(var(--header-height) + 84px);
    }

    .planilha-mobile-step-panel[hidden] {
      display: none !important;
    }

    .planilha-attendance-step {
      padding: 14px;
      border: 1px solid var(--vf-line);
      border-radius: 18px;
      background: var(--vf-glass), rgba(255, 255, 255, .025);
    }

    .planilha-registration-top {
      display: grid !important;
      gap: 12px;
    }

    .planilha-registration-top h3 {
      font-size: 1.2rem !important;
    }

    .planilha-registration-top .subtitle {
      margin-top: 4px;
      font-size: 13px;
      line-height: 1.4;
    }

    .planilha-entry-strip {
      width: 100%;
      display: grid !important;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px !important;
    }

    .planilha-entry-chip,
    .planilha-uber-toggle,
    .planilha-mobile-access-status {
      width: 100%;
      min-width: 0;
      min-height: 44px !important;
      justify-content: center;
      padding: 8px 10px !important;
      border: 1px solid var(--vf-line);
      border-radius: 12px;
      font-size: 11px;
      text-align: center;
      overflow-wrap: anywhere;
    }

    .planilha-mobile-access-status {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      color: #bdf5dc;
      background: rgba(24, 171, 112, .1);
    }

    .planilha-mobile-access-status i {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: #6fe0ab;
      box-shadow: 0 0 12px rgba(111, 224, 171, .48);
    }

    .planilha-form-shell,
    .planilha-table-shell {
      width: 100%;
      min-width: 0;
      padding: 14px !important;
      border-radius: 18px !important;
    }

    .planilha-form-section-head {
      align-items: flex-start;
      gap: 10px;
    }

    .planilha-form-section-head p {
      margin-top: 3px;
      font-size: 12px !important;
      line-height: 1.35;
    }

    .planilha-section-step {
      width: 30px;
      min-width: 30px;
      min-height: 30px !important;
      padding: 0 !important;
      border-radius: 50%;
    }

    .planilha-form-grid-clean {
      grid-template-columns: minmax(0, 1fr) !important;
      gap: 12px !important;
    }

    .planilha-form-shell :is(.fake-field, select) {
      width: 100%;
      min-width: 0;
      max-width: 100%;
    }

    .planilha-form-shell select {
      min-height: 48px !important;
      padding-right: 42px;
      text-overflow: ellipsis;
    }

    .planilha-table-shell > .planilha-form-section-head {
      padding-bottom: 10px;
      border-bottom: 1px solid var(--vf-line);
    }

    .planilha-table-shell > .planilha-form-section-head .planilha-entry-chip {
      width: auto;
      min-height: 32px !important;
      white-space: nowrap;
    }

    .planilha-table-shell .week-table-wrapper {
      width: 100%;
      max-height: calc(100dvh - var(--header-height) - 250px);
      padding: 0 3px 0 0;
      border: 0 !important;
      border-radius: 0 !important;
      background: transparent !important;
      overflow-x: hidden !important;
      overflow-y: auto !important;
      overscroll-behavior: contain;
      scrollbar-gutter: stable;
    }

    .planilha-exams-table,
    .planilha-exams-table tbody {
      width: 100%;
      min-width: 0 !important;
      display: grid;
      gap: 10px;
    }

    .planilha-exams-table thead {
      display: none;
    }

    .planilha-exams-table .planilha-exam-row {
      width: 100%;
      min-width: 0;
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px 12px;
      padding: 14px;
      border: 1px solid var(--vf-line);
      border-radius: 16px;
      background: linear-gradient(145deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .018));
      box-shadow: 0 10px 28px rgba(8, 3, 20, .16);
    }

    .planilha-exams-table .planilha-exam-row > td {
      width: 100% !important;
      min-width: 0 !important;
      display: grid;
      gap: 4px;
      padding: 0 !important;
      border: 0 !important;
      color: var(--vf-ink);
      background: transparent !important;
      font-size: 12px !important;
      white-space: normal;
    }

    .planilha-exams-table .planilha-exam-row > td::before {
      content: attr(data-label);
      color: var(--vf-muted);
      font-size: 9px;
      font-weight: 700;
      letter-spacing: .06em;
      text-transform: uppercase;
    }

    .planilha-exams-table .planilha-exam-description {
      grid-column: 1 / -1;
      gap: 10px !important;
      padding-bottom: 10px !important;
      border-bottom: 1px solid var(--vf-line) !important;
    }

    .planilha-exams-table .planilha-exam-description > strong {
      max-width: 100%;
      color: var(--vf-ink);
      font-size: 14px;
      line-height: 1.35;
      overflow-wrap: anywhere;
      word-break: normal;
    }

    .planilha-money-value,
    .planilha-exam-mobile-extra .money {
      display: block;
      color: var(--vf-ink);
      font-size: 13px;
      font-variant-numeric: tabular-nums;
      white-space: nowrap !important;
      word-break: keep-all !important;
    }

    .planilha-exam-mobile-extra {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: center;
      gap: 5px 12px;
      padding: 8px 10px;
      border-radius: 11px;
      background: rgba(8, 5, 24, .22);
    }

    .planilha-exam-mobile-extra > span {
      color: var(--vf-muted);
      font-size: 10px;
    }

    .planilha-exams-table .planilha-exam-row > td:last-child {
      grid-column: 1 / -1;
      margin-top: 4px;
    }

    .planilha-qty-control {
      width: 100%;
      display: grid !important;
      grid-template-columns: 48px minmax(64px, 1fr) 48px;
      align-items: center;
      gap: 8px;
    }

    .planilha-qty-button {
      min-width: 44px;
      min-height: 44px !important;
      display: inline-grid;
      place-items: center;
      padding: 0 !important;
      border: 1px solid var(--vf-line-strong);
      border-radius: 12px;
      color: var(--vf-ink);
      background: var(--vf-accent-wash);
      font-size: 22px;
      font-weight: 700;
      line-height: 1;
    }

    .planilha-qty-input {
      width: 100% !important;
      min-width: 0 !important;
      min-height: 48px !important;
      padding: 8px !important;
      border-radius: 12px !important;
      font-size: 18px !important;
      font-weight: 800;
      text-align: center;
      appearance: textfield;
      -moz-appearance: textfield;
    }

    .planilha-qty-input::-webkit-inner-spin-button,
    .planilha-qty-input::-webkit-outer-spin-button {
      margin: 0;
      appearance: none;
      -webkit-appearance: none;
    }

    .planilha-summary-step {
      display: grid;
      gap: 14px;
      padding: 14px;
      border: 1px solid var(--vf-line);
      border-radius: 18px;
      background: var(--vf-glass), rgba(255, 255, 255, .025);
    }

    .planilha-totals-strip {
      grid-template-columns: minmax(0, 1fr) !important;
      gap: 9px !important;
    }

    .planilha-totals-strip .summary-item {
      min-height: 72px !important;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: center;
      gap: 12px !important;
      padding: 13px 14px !important;
    }

    .planilha-totals-strip .summary-item strong {
      font-size: 1.22rem !important;
      font-variant-numeric: tabular-nums;
      white-space: nowrap;
      word-break: keep-all;
    }

    .planilha-actions,
    .planilha-finish-btn {
      width: 100%;
    }

    .planilha-finish-btn {
      min-width: 0 !important;
      min-height: 54px !important;
      border-radius: 15px !important;
      font-size: 15px;
      font-weight: 800;
      box-shadow: 0 16px 38px rgba(174, 50, 223, .3) !important;
    }

    .planilha-calendar-shell {
      padding: 6px !important;
      overflow: hidden !important;
    }

    :is(.planilha-calendar-grid, .resultados-calendar-weekdays) {
      min-width: 0 !important;
      grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
      gap: 3px !important;
    }

    :is(.planilha-calendar-day, .planilha-calendar-empty) {
      min-width: 0 !important;
      min-height: 52px !important;
      padding: 4px 2px !important;
      border-radius: 9px !important;
    }

    .planilha-calendar-day strong {
      font-size: 13px;
    }

    .planilha-calendar-day small {
      max-width: 100%;
      font-size: 7px;
      line-height: 1;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .resultados-calendar-weekday {
      min-width: 0;
      font-size: 8px;
      text-align: center;
    }
  }
}

@media (max-width: 767px), (pointer: coarse) {
  html[data-vf-shell-variant] body.vf-premium #abaResultados .resultados-month-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 7px !important;
  }
}

/* Mobile drawer: one shared icon rhythm for every system module. */
@media (max-width: 1023px) {
  html[data-vf-shell-variant] body.vf-premium #appSidebarPanel .compact-nav-grid {
    min-width: 0;
    overflow-x: clip;
  }

  html[data-vf-shell-variant] body.vf-premium #appSidebarPanel .compact-nav-btn {
    display: grid !important;
    grid-template-columns: 21px minmax(0, 1fr);
    align-items: center !important;
    justify-content: stretch !important;
    column-gap: 12px !important;
    min-width: 0;
    min-height: 46px !important;
    height: auto !important;
    padding: 10px 12px !important;
    color: rgba(239, 226, 255, .82) !important;
  }

  html[data-vf-shell-variant] body.vf-premium #appSidebarPanel .compact-nav-icon.vf-icon-shell {
    width: 21px !important;
    height: 21px !important;
    min-width: 21px;
    flex: 0 0 21px !important;
    display: inline-grid !important;
    place-items: center;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: rgba(221, 191, 255, .9) !important;
  }

  html[data-vf-shell-variant] body.vf-premium #appSidebarPanel .compact-nav-icon > svg {
    display: block;
    width: 100% !important;
    height: 100% !important;
    overflow: visible;
    vector-effect: non-scaling-stroke;
  }

  html[data-vf-shell-variant] body.vf-premium #appSidebarPanel .compact-nav-text {
    min-width: 0;
    color: inherit !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.25 !important;
    text-align: left;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  html[data-vf-shell-variant] body.vf-premium #appSidebarPanel .compact-nav-btn.active {
    color: #fff !important;
    background:
      linear-gradient(180deg, rgba(255, 231, 255, .14), transparent 52%),
      linear-gradient(108deg, rgba(117, 38, 204, .94), rgba(177, 39, 190, .88) 58%, rgba(222, 50, 158, .92)) !important;
    border-color: rgba(242, 174, 255, .55) !important;
    box-shadow: inset 2px 0 rgba(255, 207, 255, .9), 0 8px 22px rgba(118, 25, 174, .22) !important;
  }

  html[data-vf-shell-variant] body.vf-premium #appSidebarPanel .compact-nav-btn.active .compact-nav-icon {
    color: #fff1ff !important;
  }
}

/* Tall desktops use the sidebar height more naturally; compact notebooks keep their dedicated density. */
@media (min-width: 1024px) and (min-height: 801px) {
  html[data-vf-shell-variant] body.vf-premium:where(:not(:has(#loginScreen.active:not(.admin-authenticated)))) {
    :is(.toolbar-tabs, .compact-nav-grid) {
      gap: 6px !important;
    }

    .side-panel .nav-btn {
      min-height: 42px !important;
      height: 42px !important;
      padding: 8px 11px !important;
    }
  }
}

@media (min-width: 1024px) and (min-height: 1000px) {
  html[data-vf-shell-variant] body.vf-premium:where(:not(:has(#loginScreen.active:not(.admin-authenticated)))) {
    :is(.toolbar-tabs, .compact-nav-grid) {
      gap: 8px !important;
    }

    .side-panel .nav-btn {
      min-height: 46px !important;
      height: 46px !important;
      padding-block: 10px !important;
    }
  }
}
