    :root {
      --bg: #F4F7F8;
      --surface: #FFFFFF;
      --ink: #10262E;
      --muted: #5E747D;
      --faint: #8DA2AA;
      --line: #E4ECEE;
      --teal: #0E8C7F;
      --teal-deep: #0B6E63;
      --teal-soft: #E2F2EF;
      --feito: #2C7BE5;
      --feito-soft: #E6F0FD;
      --recebido: #1FAE6B;
      --recebido-soft: #E3F6EC;
      --pend: #E0962F;
      --pend-soft: #FBF0DD;
      --shadow-sm: 0 1px 2px rgba(16, 38, 46, .06), 0 2px 8px rgba(16, 38, 46, .06);
      --shadow: 0 1px 2px rgba(16, 38, 46, .04), 0 8px 24px rgba(16, 38, 46, .06);
      --shadow-lg: 0 12px 40px rgba(16, 38, 46, .16);
      --r: 16px;
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      -webkit-tap-highlight-color: transparent
    }

    html,
    body {
      height: 100%
    }

    body {
      font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
      background: var(--bg);
      color: var(--ink);
      -webkit-font-smoothing: antialiased;
      line-height: 1.45;
      overscroll-behavior-y: none
    }

    button {
      font-family: inherit;
      cursor: pointer;
      border: none;
      background: none;
      color: inherit
    }

    input,
    select {
      font-family: inherit;
      font-size: 16px
    }

    .num {
      font-family: 'Sora', sans-serif;
      font-variant-numeric: tabular-nums;
      font-feature-settings: "tnum"
    }

    .app {
      display: flex;
      min-height: 100dvh
    }

    .sidebar {
      display: none
    }

    .main {
      flex: 1;
      display: flex;
      flex-direction: column;
      min-width: 0;
      padding-bottom: calc(76px + env(safe-area-inset-bottom))
    }

    .view {
      display: none;
      animation: fade .28s ease
    }

    .view.active {
      display: block
    }

    @keyframes fade {
      from {
        opacity: 0;
        transform: translateY(6px)
      }

      to {
        opacity: 1;
        transform: none
      }
    }

    .wrap {
      max-width: 680px;
      margin: 0 auto;
      padding: 0 18px
    }

    .topbar {
      position: sticky;
      top: 0;
      z-index: 30;
      background: var(--bg);
      padding: calc(env(safe-area-inset-top) + 14px) 18px 8px
    }

    .topbar .wrap2 {
      max-width: 680px;
      margin: 0 auto;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 9px;
      font-family: 'Sora';
      font-weight: 700;
      font-size: 21px;
      letter-spacing: -.02em
    }

    .brand .ekg {
      width: 26px;
      height: 26px;
      flex: none;
      display: block;
      object-fit: contain
    }

    .brand b {
      font-weight: 800;
      color: #0E8C7F;
    }

    .gear {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      background: var(--surface);
      border: 1px solid var(--line);
      display: grid;
      place-items: center;
      color: var(--muted);
      box-shadow: var(--shadow)
    }

    .gear svg {
      width: 20px;
      height: 20px
    }

    .topbar-profile {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      background: var(--surface);
      border: 1px solid var(--line);
      display: grid;
      place-items: center;
      box-shadow: var(--shadow);
      padding: 0;
      overflow: hidden;
      cursor: pointer;
      transition: transform .15s
    }

    .topbar-profile:active {
      transform: scale(.94)
    }

    h2.title {
      font-family: 'Sora';
      font-weight: 700;
      font-size: 15px;
      letter-spacing: .01em;
      margin: 24px 0 12px;
      display: flex;
      align-items: center;
      justify-content: space-between
    }

    h2.title .link {
      font-family: 'Plus Jakarta Sans';
      font-size: 13px;
      font-weight: 700;
      color: var(--teal);
      background: var(--teal-soft);
      padding: 5px 12px;
      border-radius: 999px;
      border: 1.5px solid rgba(14,140,127,.25);
      transition: all .18s;
      cursor: pointer
    }


    /* ---- Period filter ---- */
    .period {
      margin-top: 6px
    }

    .yearstep {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      background: var(--surface);
      border: 1px solid var(--line);
      border-radius: 999px;
      padding: 5px 6px 5px 14px;
      box-shadow: var(--shadow);
      font-family: 'Sora';
      font-weight: 700;
      font-size: 15px
    }

    .yearstep button {
      width: 30px;
      height: 30px;
      border-radius: 50%;
      display: grid;
      place-items: center;
      color: var(--muted)
    }

    .yearstep button:hover {
      background: var(--bg);
      color: var(--ink)
    }

    .yearstep .yv {
      min-width: 48px;
      text-align: center
    }

    .monthchips {
      display: flex;
      gap: 7px;
      overflow-x: auto;
      padding: 12px 2px 4px;
      scrollbar-width: none;
      -ms-overflow-style: none
    }

    .monthchips::-webkit-scrollbar {
      display: none
    }

    .mchip {
      flex: none;
      padding: 8px 13px;
      border-radius: 999px;
      background: var(--surface);
      border: 1px solid var(--line);
      font-weight: 700;
      font-size: 13px;
      color: var(--muted);
      text-transform: capitalize;
      transition: .15s
    }

    .mchip.on {
      background: var(--teal);
      border-color: var(--teal);
      color: #fff;
      box-shadow: 0 4px 12px rgba(11, 110, 99, .28)
    }

    /* ---- Summary cards ---- */
    .dashtop {
      display: grid;
      grid-template-columns: 1fr;
      gap: 12px
    }

    .statgrid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px
    }

    .card {
      background: var(--surface);
      border: 1px solid var(--line);
      border-radius: var(--r);
      padding: 14px;
      box-shadow: var(--shadow);
      display: flex;
      flex-direction: column;
      min-height: 120px
    }

    .card.hero {
      background: linear-gradient(150deg, var(--teal) 0%, var(--teal-deep) 100%);
      border: none;
      color: #fff;
      box-shadow: 0 14px 34px rgba(11, 110, 99, .3);
      position: relative;
      overflow: hidden;
      grid-column: span 2;
      min-height: 100px;
      padding: 12px 16px
    }

    .card.hero::after {
      content: "";
      position: absolute;
      right: -40px;
      top: -50px;
      width: 170px;
      height: 170px;
      border-radius: 50%;
      background: radial-gradient(circle, rgba(255, 255, 255, .14), transparent 70%)
    }

    .card .ck {
      font-size: 12.5px;
      color: var(--muted);
      font-weight: 700;
      display: flex;
      align-items: center;
      gap: 8px
    }

    .card.hero .ck {
      color: rgba(255, 255, 255, .85)
    }

    .card .ci {
      width: 30px;
      height: 30px;
      border-radius: 9px;
      display: grid;
      place-items: center;
      flex: none;
      font-size: 14px
    }

    .card .cbody {
      flex: 1;
      display: flex;
      flex-direction: column;
      justify-content: center
    }

    .card.hero .cbody {
      flex-direction: row;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      margin-top: 4px
    }

    .card .big {
      font-family: 'Sora';
      font-weight: 800;
      font-size: 24px;
      letter-spacing: -.025em;
      line-height: 1.08
    }

    .card .pill {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      margin-top: 10px;
      background: rgba(255, 255, 255, .16);
      padding: 6px 12px;
      border-radius: 999px;
      font-size: 12.5px;
      font-weight: 600;
      align-self: flex-start
    }

    .card.hero .pill {
      margin-top: 0;
      padding: 4px 10px
    }

    .split .row {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 4px;
      padding: 6px 0
    }

    .split .row+.row {
      border-top: 1px dashed var(--line)
    }

    .split .rl {
      font-size: 12px;
      font-weight: 600;
      color: var(--muted)
    }

    .split .rv {
      font-family: 'Sora';
      font-weight: 700;
      font-size: 16px
    }

    .rv.recebido {
      color: var(--recebido)
    }

    .rv.pend {
      color: var(--pend)
    }

    .rv.feito {
      color: var(--feito)
    }

    .card.solo .v {
      font-family: 'Sora';
      font-weight: 800;
      font-size: 20px;
      letter-spacing: -.02em;
      color: var(--pend)
    }

    .card.solo .vs {
      font-size: 10px;
      color: var(--faint);
      margin-top: 4px;
      line-height: 1.3
    }

    /* ---- Big charts ---- */
    .bigcharts {
      display: grid;
      grid-template-columns: 1fr;
      gap: 12px
    }

    @media(min-width:600px) {
      .bigcharts {
        grid-template-columns: 1fr 1fr
      }
    }

    .bigchart {
      background: var(--surface);
      border: 1px solid var(--line);
      border-radius: 18px;
      padding: 16px 14px 12px;
      box-shadow: var(--shadow)
    }

    .bigchart .bc-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 2px;
      padding: 0 2px
    }

    .bigchart .bc-title {
      font-size: 13.5px;
      font-weight: 700;
      display: flex;
      align-items: center;
      gap: 8px
    }

    .bigchart .bc-tot {
      font-family: 'Sora';
      font-weight: 800;
      font-size: 16px
    }

    .bigchart .bc-sub {
      font-size: 11px;
      color: var(--faint);
      padding: 0 2px;
      margin-top: 1px
    }

    .bars {
      display: flex;
      align-items: flex-end;
      gap: 6px;
      height: 220px;
      padding: 10px 2px 0;
      position: relative
    }

    .bars::before {
      content: "";
      position: absolute;
      left: 0;
      right: 0;
      bottom: 34px;
      height: 1px;
      background: var(--line)
    }

    .bcol {
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 7px;
      min-width: 0;
      cursor: pointer;
      position: relative;
      z-index: 1;
      height: 100%;
      justify-content: flex-end
    }

    .btrack {
      width: 100%;
      height: 174px;
      display: flex;
      align-items: flex-end;
      justify-content: center;
      flex: none
    }

    .bar {
      width: 74%;
      max-width: 28px;
      border-radius: 6px 6px 2px 2px;
      transition: height .55s cubic-bezier(.2, .8, .2, 1);
      min-height: 4px;
      opacity: .6
    }

    .bar.feito {
      background: linear-gradient(180deg, var(--feito), #6AA6EE)
    }

    .bar.recebido {
      background: linear-gradient(180deg, var(--recebido), #4ECB91)
    }

    .bar.recebido.partial {
      background: repeating-linear-gradient(135deg, var(--recebido), var(--recebido) 5px, #a9e0c6 5px, #a9e0c6 10px)
    }

    .bcol.cur .bar {
      opacity: 1;
      transform: scaleX(1.15)
    }

    .bcol.cur .bar.feito {
      box-shadow: 0 0 0 3px var(--feito-soft)
    }

    .bcol.cur .bar.recebido {
      box-shadow: 0 0 0 3px var(--recebido-soft)
    }

    .blbl {
      font-size: 10px;
      color: var(--faint);
      font-weight: 700;
      text-transform: capitalize;
      flex: none
    }

    .bcol.cur .blbl {
      color: var(--ink)
    }

    .bval {
      font-size: 9.5px;
      font-weight: 700;
      font-family: 'Sora';
      height: 12px;
      color: var(--muted);
      flex: none
    }

    /* ---- List ---- */
    .list {
      display: flex;
      flex-direction: column;
      gap: 9px
    }

    .item {
      background: var(--surface);
      border: 1px solid var(--line);
      border-radius: 14px;
      padding: 12px 14px;
      display: flex;
      align-items: center;
      gap: 13px;
      box-shadow: var(--shadow);
      cursor: pointer;
      transition: background .15s, box-shadow .15s, border-color .15s, transform .12s
    }


    .item:active {
      transform: scale(.99)
    }

    .ic {
      width: 42px;
      height: 42px;
      border-radius: 12px;
      flex: none;
      display: grid;
      place-items: center;
      font-family: 'Sora';
      font-weight: 700;
      font-size: 14px;
      line-height: 1.05;
      text-align: center
    }

    .item .body {
      flex: 1;
      min-width: 0
    }

    .item .l1 {
      font-weight: 700;
      font-size: 14.5px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis
    }

    .item .l2 {
      font-size: 12.5px;
      color: var(--muted);
      margin-top: 2px;
      display: flex;
      gap: 10px;
      flex-wrap: wrap
    }

    .item .val {
      text-align: right;
      flex: none
    }

    .item .val .v {
      font-family: 'Sora';
      font-weight: 700;
      font-size: 15px
    }

    .badge {
      font-size: 10.5px;
      font-weight: 700;
      padding: 2px 8px;
      border-radius: 999px;
      display: inline-flex;
      align-items: center;
      gap: 4px
    }

    .badge.pago {
      background: var(--recebido-soft);
      color: var(--recebido)
    }

    .badge.aberto {
      background: var(--pend-soft);
      color: var(--pend)
    }

    .badge.parcial {
      background: #FDEFD9;
      color: #B5790F
    }

    .badge.outflow {
      background: var(--feito-soft);
      color: var(--feito)
    }

    .badge.metodo {
      background: var(--bg);
      color: var(--muted);
      border: 1px solid var(--line);
      font-weight: 600
    }

    .badge.tipo {
      background: var(--surface);
      border: 1px solid var(--line);
      font-weight: 700
    }

    /* ---- Escolha do tipo de lançamento ----
       Lista de linhas em vez de grade: alvo de toque cheio na
       largura e leitura em uma passada só no celular. */
    .tipo-list {
      display: flex;
      flex-direction: column;
      gap: 10px
    }

    .tipo-opt {
      display: flex;
      align-items: center;
      gap: 12px;
      width: 100%;
      padding: 13px 14px;
      border-radius: 14px;
      border: 1.5px solid var(--line);
      background: var(--surface);
      box-shadow: var(--shadow-sm);
      text-align: left;
      transition: border-color .16s, box-shadow .16s, transform .12s
    }

    .tipo-opt:hover {
      border-color: var(--teal);
      box-shadow: 0 6px 18px rgba(14, 140, 127, .14)
    }

    .tipo-opt:active {
      transform: scale(.985)
    }

    .tipo-opt .to-ic {
      width: 44px;
      height: 44px;
      border-radius: 13px;
      display: grid;
      place-items: center;
      font-size: 20px;
      line-height: 1;
      flex: none
    }

    .tipo-opt .to-body {
      flex: 1;
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 2px
    }

    .tipo-opt .to-t {
      font-family: 'Sora';
      font-weight: 700;
      font-size: 15px;
      color: var(--ink);
      line-height: 1.2
    }

    .tipo-opt .to-d {
      font-size: 12.5px;
      color: var(--muted);
      line-height: 1.3
    }

    .tipo-opt .to-arrow {
      width: 18px;
      height: 18px;
      color: var(--faint);
      flex: none
    }

    .markpaid-btn {
      flex: none;
      display: flex;
      align-items: center;
      gap: 6px;
      background: var(--teal-soft);
      color: var(--teal-deep);
      font-weight: 700;
      font-size: 12px;
      padding: 9px 14px;
      border-radius: 11px;
      border: 1.5px solid rgba(14,140,127,.35);
      white-space: nowrap;
      transition: all 0.18s;
      box-shadow: 0 2px 8px rgba(14,140,127,.1)
    }

    .markpaid-btn:active {
      transform: scale(.96)
    }

    .markpaid-btn svg {
      width: 15px;
      height: 15px
    }

    .markpaid-btn.highlight {
      background: var(--teal);
      color: #fff;
      border: 1px solid var(--teal-deep);
      box-shadow: 0 2px 8px rgba(14,140,127,.25)
    }

    .markpaid-btn.highlight:hover {
      background: var(--teal-deep)
    }

    .markpaid-btn.highlight.outflow {
      background: var(--feito);
      border-color: #1E5FA8;
      box-shadow: 0 2px 8px rgba(44,123,229,.25)
    }

    .markpaid-btn.highlight.outflow:hover {
      background: #1E5FA8
    }

    .listhead {
      display: flex;
      justify-content: space-between;
      padding: 0 2px;
      margin-bottom: 8px
    }

    .listhead span {
      font-size: 11px;
      font-weight: 700;
      color: var(--faint);
      text-transform: uppercase;
      letter-spacing: .04em
    }

    .empty {
      text-align: center;
      padding: 40px 20px;
      color: var(--muted)
    }

    .empty .em-ic {
      width: 56px;
      height: 56px;
      border-radius: 16px;
      background: var(--teal-soft);
      display: grid;
      place-items: center;
      margin: 0 auto 14px;
      font-size: 24px
    }

    .empty h3 {
      font-family: 'Sora';
      font-size: 16px;
      margin-bottom: 6px;
      color: var(--ink)
    }

    .empty p {
      font-size: 13.5px;
      max-width: 300px;
      margin: 0 auto 16px
    }

    .monthhdr {
      font-size: 12px;
      font-weight: 700;
      color: var(--faint);
      text-transform: uppercase;
      letter-spacing: .05em;
      margin: 18px 2px 9px;
      display: flex;
      justify-content: space-between
    }

    .monthhdr .mt {
      color: var(--muted)
    }

    /* ---- Status segment ---- */
    .seg {
      display: flex;
      gap: 7px;
      margin-top: 12px
    }

    .seg button {
      flex: 1;
      padding: 10px 6px;
      border: 1.5px solid var(--line);
      border-radius: 11px;
      background: var(--surface);
      font-weight: 700;
      font-size: 13px;
      color: var(--muted);
      transition: all .15s
    }

    .seg button.on {
      border-color: var(--teal);
      background: var(--teal-soft);
      color: var(--teal-deep)
    }

    /* ---- Insights ---- */
    .ins-hero {
      background: linear-gradient(150deg, var(--teal) 0%, var(--teal-deep) 100%);
      color: #fff;
      border-radius: 20px;
      padding: 18px 20px;
      box-shadow: 0 14px 34px rgba(11, 110, 99, .3);
      position: relative;
      overflow: hidden
    }

    .ins-hero::after {
      content: "";
      position: absolute;
      right: -30px;
      bottom: -50px;
      width: 160px;
      height: 160px;
      border-radius: 50%;
      background: radial-gradient(circle, rgba(255, 255, 255, .14), transparent 70%)
    }

    .ins-hero .ih-k {
      font-size: 12.5px;
      color: rgba(255, 255, 255, 0.85);
      font-weight: 600
    }

    .ins-hero .ih-v {
      font-family: 'Sora';
      font-weight: 800;
      font-size: 26px;
      margin-top: 4px;
      letter-spacing: -.02em;
      color: #fff
    }

    .ins-hero .ih-s {
      font-size: 13px;
      color: rgba(255, 255, 255, 0.7);
      margin-top: 6px
    }

    .histgrid {
      display: grid;
      grid-template-columns: 1fr;
      gap: 12px;
      margin-top: 12px
    }

    @media(min-width:600px) {
      .histgrid {
        grid-template-columns: 1fr 1fr 1fr
      }
    }

    .hist-card {
      background: linear-gradient(150deg, var(--teal) 0%, var(--teal-deep) 100%);
      border-radius: 16px;
      padding: 16px;
      box-shadow: 0 14px 34px rgba(11, 110, 99, .3);
      min-height: 104px;
      display: flex;
      flex-direction: column;
      justify-content: center;
      color: #fff;
      position: relative;
      overflow: hidden
    }

    .hist-card .hk {
      font-size: 12px;
      font-weight: 700;
      display: flex;
      align-items: center;
      gap: 7px;
      color: rgba(255, 255, 255, .85)
    }

    .hist-card .hv {
      font-family: 'Sora';
      font-weight: 800;
      font-size: 23px;
      margin-top: 7px;
      letter-spacing: -.02em;
      color: #fff
    }

    .hist-card .hs {
      font-size: 11px;
      margin-top: 3px;
      color: rgba(255, 255, 255, .7)
    }



    .weekcompare {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-top: 6px;
      font-size: 12px;
      font-weight: 700
    }

    .weekcompare.up {
      color: var(--recebido)
    }

    .weekcompare.down {
      color: #C5733B
    }

    .weekcompare.flat {
      color: var(--faint)
    }

    .donutcard {
      background: var(--surface);
      border: 1px solid var(--line);
      border-radius: 18px;
      padding: 18px;
      box-shadow: var(--shadow);
      margin-top: 12px
    }

    .donutwrap {
      display: flex;
      gap: 18px;
      align-items: center;
      flex-wrap: wrap
    }

    .donut {
      position: relative;
      width: 150px;
      height: 150px;
      flex: none;
      margin: 0 auto
    }

    .donut .ctr {
      position: absolute;
      inset: 0;
      display: grid;
      place-items: center;
      text-align: center
    }

    .donut .ctr .ct-k {
      font-size: 10.5px;
      color: var(--muted);
      font-weight: 600
    }

    .donut .ctr .ct-v {
      font-family: 'Sora';
      font-weight: 800;
      font-size: 17px
    }

    .legend {
      flex: 1;
      min-width: 180px;
      display: flex;
      flex-direction: column;
      gap: 9px
    }

    .leg {
      display: flex;
      align-items: center;
      gap: 9px;
      font-size: 13px
    }

    .leg .lc {
      width: 11px;
      height: 11px;
      border-radius: 3px;
      flex: none
    }

    .leg .ln {
      flex: 1;
      font-weight: 600;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis
    }

    .leg .lv {
      font-family: 'Sora';
      font-weight: 700
    }

    .leg .lp {
      color: var(--faint);
      font-size: 11.5px;
      font-weight: 600;
      width: 38px;
      text-align: right
    }

    .ins-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px;
      margin-top: 12px
    }

    .ins-card {
      background: var(--surface);
      border: 1px solid var(--line);
      border-radius: 16px;
      padding: 15px;
      box-shadow: var(--shadow)
    }

    .ins-card .ik {
      font-size: 12px;
      color: var(--muted);
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 7px
    }

    .ins-card .iv {
      font-family: 'Sora';
      font-weight: 800;
      font-size: 24px;
      letter-spacing: -.02em;
      margin-top: 8px
    }

    .ins-card .is {
      font-size: 11.5px;
      color: var(--faint);
      margin-top: 4px
    }

    .iemoji {
      font-size: 15px
    }

    /* ---- Bottom nav ---- */
    .tabbar {
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      z-index: 40;
      background: rgba(255, 255, 255, .88);
      backdrop-filter: saturate(180%) blur(18px);
      -webkit-backdrop-filter: saturate(180%) blur(18px);
      border-top: 1px solid var(--line);
      display: flex;
      justify-content: space-around;
      align-items: center;
      padding: 8px 6px calc(8px + env(safe-area-inset-bottom))
    }

    .tab {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 3px;
      color: var(--faint);
      font-size: 10.5px;
      font-weight: 600;
      flex: 1;
      padding: 4px;
      border-radius: 12px
    }

    .tab svg {
      width: 22px;
      height: 22px
    }

    .tab.on {
      color: var(--teal)
    }

    .fab {
      position: relative;
      top: -20px;
      width: 56px;
      height: 56px;
      border-radius: 18px;
      flex: none;
      background: linear-gradient(150deg, var(--teal), var(--teal-deep));
      color: #fff;
      display: grid;
      place-items: center;
      box-shadow: 0 10px 26px rgba(11, 110, 99, .4);
      transition: transform .18s, box-shadow .18s, filter .15s
    }

    .fab:active {
      transform: scale(.94);
      box-shadow: 0 6px 16px rgba(11, 110, 99, .3)
    }

    .fab svg {
      width: 26px;
      height: 26px
    }

    /* ---- Sheets ---- */
    .scrim {
      position: fixed;
      inset: 0;
      background: rgba(16, 38, 46, .42);
      z-index: 80;
      opacity: 0;
      pointer-events: none;
      transition: opacity .25s
    }

    .scrim.show {
      opacity: 1;
      pointer-events: auto
    }

    .sheet {
      position: fixed;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: 90;
      background: var(--surface);
      border-radius: 24px 24px 0 0;
      box-shadow: var(--shadow-lg);
      transform: translateY(100%);
      transition: transform .32s cubic-bezier(.2, .85, .25, 1), opacity .32s, visibility .32s;
      max-height: 92dvh;
      overflow-y: auto;
      padding-bottom: calc(20px + env(safe-area-inset-bottom));
      pointer-events: none;
      visibility: hidden;
    }

    .sheet.show {
      transform: translateY(0);
      pointer-events: auto;
      visibility: visible;
    }

    .sheet .grab {
      width: 38px;
      height: 4px;
      border-radius: 99px;
      background: var(--line);
      margin: 10px auto 4px
    }

    .sheet .sh-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 6px 20px 14px
    }

    .sheet .sh-head h3 {
      font-family: 'Sora';
      font-size: 18px;
      font-weight: 700
    }

    .sheet .x {
      width: 32px;
      height: 32px;
      border-radius: 50%;
      background: var(--bg);
      display: grid;
      place-items: center;
      color: var(--muted);
      border: 1px solid var(--line);
      font-size: 13px;
      transition: all .15s
    }

    .form {
      padding: 0 20px;
      display: flex;
      flex-direction: column;
      gap: 15px
    }

    .field label {
      display: block;
      font-size: 12.5px;
      font-weight: 700;
      color: var(--muted);
      margin-bottom: 7px
    }

    .field input,
    .field select {
      width: 100%;
      padding: 13px 14px;
      border: 1.5px solid var(--line);
      border-radius: 12px;
      background: var(--bg);
      color: var(--ink);
      font-weight: 600;
      transition: border-color .15s
    }

    .field input:focus,
    .field select:focus {
      outline: none;
      border-color: var(--teal);
      background: #fff
    }

    .segf {
      display: flex;
      gap: 8px
    }

    .segf button {
      flex: 1;
      padding: 11px 6px;
      border: 1.5px solid var(--line);
      border-radius: 11px;
      background: var(--bg);
      font-weight: 700;
      font-size: 13.5px;
      color: var(--muted);
      transition: all .15s
    }

    .segf button.on {
      border-color: var(--teal);
      background: var(--teal-soft);
      color: var(--teal-deep);
      box-shadow: 0 2px 8px rgba(14,140,127,.15)
    }

    .row2 {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px
    }

    .btn {
      width: 100%;
      padding: 15px;
      border-radius: 14px;
      background: linear-gradient(135deg, var(--teal) 0%, var(--teal-deep) 100%);
      color: #fff;
      font-weight: 700;
      font-size: 15.5px;
      margin-top: 6px;
      box-shadow: 0 8px 20px rgba(11, 110, 99, .28);
      transition: box-shadow .2s, transform .15s, filter .15s;
      letter-spacing: 0.01em
    }

    .btn:active {
      transform: translateY(1px);
      box-shadow: 0 4px 12px rgba(11, 110, 99, .20);
      filter: brightness(0.97)
    }

    .pay-method-btn {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 4px;
      padding: 14px 8px;
      border-radius: 14px;
      border: 2px solid var(--line);
      background: var(--bg);
      color: var(--ink);
      font-family: inherit;
      cursor: pointer;
      transition: border-color .15s, background .15s, box-shadow .15s;
    }

    .pay-method-btn:hover {
      border-color: var(--teal);
      background: var(--teal-soft);
    }

    .pay-method-btn.active {
      border-color: var(--teal);
      background: var(--teal-soft);
      box-shadow: 0 0 0 3px rgba(14,140,127,.15);
    }

    .hint {
      font-size: 12px;
      color: var(--faint);
      text-align: center;
      margin-top: 2px
    }

    .del-row {
      display: flex;
      justify-content: center;
      padding: 10px 20px 0
    }

    .del-row button {
      color: #C53B3B;
      font-weight: 700;
      font-size: 13.5px;
      padding: 9px 20px;
      border-radius: 10px;
      border: 1.5px solid rgba(197,59,59,.2);
      background: rgba(197,59,59,.04);
      transition: all .15s
    }

    .toast {
      position: fixed;
      left: 50%;
      bottom: 96px;
      transform: translateX(-50%) translateY(20px);
      z-index: 100;
      background: var(--ink);
      color: #fff;
      padding: 12px 20px;
      border-radius: 999px;
      font-size: 13.5px;
      font-weight: 600;
      opacity: 0;
      transition: .3s;
      box-shadow: var(--shadow-lg);
      white-space: nowrap
    }

    .toast.show {
      opacity: 1;
      transform: translateX(-50%) translateY(0)
    }

    .set-card {
      background: var(--surface);
      border: 1px solid var(--line);
      border-radius: 14px;
      box-shadow: var(--shadow);
      overflow: hidden
    }

    .set-row {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 15px 16px;
      border-bottom: 1px solid var(--line)
    }

    .set-row:last-child {
      border-bottom: none
    }

    .set-row .si {
      width: 38px;
      height: 38px;
      border-radius: 11px;
      background: var(--teal-soft);
      display: grid;
      place-items: center;
      flex: none
    }

    .set-row .st {
      font-weight: 700;
      font-size: 14px
    }

    .set-row .sd {
      font-size: 12px;
      color: var(--muted)
    }

    /* ---- Confirm sheet ---- */
    .confirm-box {
      padding: 8px 24px 4px;
      text-align: center
    }

    .confirm-ic {
      width: 54px;
      height: 54px;
      border-radius: 16px;
      background: var(--recebido-soft);
      display: grid;
      place-items: center;
      margin: 0 auto 16px;
      font-size: 24px
    }

    .confirm-box h4 {
      font-family: 'Sora';
      font-size: 17px;
      font-weight: 700;
      margin-bottom: 8px
    }

    .confirm-box p {
      font-size: 13.5px;
      color: var(--muted);
      line-height: 1.5;
      margin-bottom: 4px
    }

    .confirm-box .cval {
      font-family: 'Sora';
      font-weight: 800;
      font-size: 22px;
      color: var(--recebido);
      margin: 10px 0 2px
    }

    .confirm-actions {
      display: flex;
      gap: 10px;
      padding: 18px 20px 4px
    }

    .confirm-actions button {
      flex: 1;
      padding: 14px;
      border-radius: 13px;
      font-weight: 700;
      font-size: 14.5px;
      transition: all .15s
    }

    .confirm-actions .cancel {
      background: var(--bg);
      color: var(--muted);
      border: 1.5px solid var(--line)
    }

    .confirm-actions .confirm {
      background: linear-gradient(135deg, var(--recebido), #17974f);
      color: #fff;
      box-shadow: 0 8px 20px rgba(31, 174, 107, .3)
    }

    .confirm-actions .confirm:active {
      transform: translateY(1px)
    }

    /* ---- Support FAB ---- */
    .support-fab {
      position: fixed;
      right: 18px;
      bottom: calc(86px + env(safe-area-inset-bottom));
      z-index: 50;
      width: 52px;
      height: 52px;
      border-radius: 50%;
      background: var(--teal-deep);
      color: #fff;
      display: grid;
      place-items: center;
      box-shadow: 0 10px 24px rgba(11, 110, 99, .38);
      transition: transform .2s
    }

    .support-fab:active {
      transform: scale(.92)
    }

    .support-fab svg {
      width: 23px;
      height: 23px
    }

    .support-fab .ping {
      position: absolute;
      top: -3px;
      right: -3px;
      width: 13px;
      height: 13px;
      border-radius: 50%;
      background: #E5556E;
      border: 2px solid #fff
    }

    @media(min-width:900px) {
      .support-fab {
        bottom: 26px;
        right: 26px
      }
    }

    .support-box {
      padding: 6px 22px 4px
    }

    .support-box .sup-ic {
      width: 52px;
      height: 52px;
      border-radius: 16px;
      background: var(--teal-soft);
      display: grid;
      place-items: center;
      margin: 0 auto 14px;
      font-size: 23px
    }

    .support-box h4 {
      font-family: 'Sora';
      font-size: 17px;
      font-weight: 700;
      text-align: center;
      margin-bottom: 6px
    }

    .support-box p {
      font-size: 13px;
      color: var(--muted);
      text-align: center;
      margin-bottom: 18px;
      line-height: 1.5
    }

    .sup-opt {
      display: flex;
      align-items: center;
      gap: 13px;
      padding: 14px;
      border-radius: 14px;
      border: 1.5px solid var(--line);
      margin-bottom: 10px;
      text-align: left;
      text-decoration: none;
      color: inherit
    }

    .sup-opt:hover {
      border-color: var(--teal)
    }

    .sup-opt .soi {
      width: 42px;
      height: 42px;
      border-radius: 12px;
      display: grid;
      place-items: center;
      flex: none;
      font-size: 18px
    }

    .sup-opt .sob {
      flex: 1
    }

    .sup-opt .sot {
      font-weight: 700;
      font-size: 14px
    }

    .sup-opt .sod {
      font-size: 12px;
      color: var(--muted);
      margin-top: 1px
    }

    .sup-opt .soa {
      color: var(--faint);
      font-size: 16px
    }

    /* ---- Tour / Onboarding ---- */
    .tour-btn {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      background: var(--surface);
      border: 1px solid var(--line);
      display: grid;
      place-items: center;
      color: var(--muted);
      box-shadow: var(--shadow)
    }

    .tour-btn svg {
      width: 19px;
      height: 19px
    }

    .tour-scrim {
      position: fixed;
      inset: 0;
      z-index: 200;
      display: none;
      pointer-events: none
    }

    .tour-scrim.show {
      display: block
    }

    .tour-veil {
      position: absolute;
      inset: 0;
      background: transparent;
      transition: background .2s;
      pointer-events: auto
    }

    .tour-card {
      position: absolute;
      z-index: 201;
      background: var(--surface);
      border-radius: 18px;
      box-shadow: var(--shadow-lg);
      width: 280px;
      max-width: 86vw;
      padding: 18px 18px 16px;
      pointer-events: auto;
      transition: top .35s cubic-bezier(.4, 0, .2, 1), left .35s cubic-bezier(.4, 0, .2, 1);
      opacity: 0
    }

    .tour-card.show {
      opacity: 1
    }

    .tour-card .tc-eyebrow {
      font-size: 11px;
      font-weight: 700;
      color: var(--teal);
      text-transform: uppercase;
      letter-spacing: .04em;
      display: flex;
      align-items: center;
      gap: 6px
    }

    .tour-card .tc-title {
      font-family: 'Sora';
      font-weight: 700;
      font-size: 16px;
      margin-top: 6px;
      color: var(--ink)
    }

    .tour-card .tc-body {
      font-size: 13px;
      color: var(--muted);
      line-height: 1.5;
      margin-top: 7px
    }

    .tour-card .tc-foot {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-top: 16px
    }

    .tour-dots {
      display: flex;
      gap: 5px
    }

    .tour-dots span {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: var(--line)
    }

    .tour-dots span.on {
      background: var(--teal);
      width: 16px;
      border-radius: 3px;
      transition: .25s
    }

    .tour-actions {
      display: flex;
      gap: 8px;
      align-items: center
    }

    .tour-close {
      position: absolute;
      top: 14px;
      right: 14px;
      width: 30px;
      height: 30px;
      border-radius: 50%;
      background: var(--bg);
      color: var(--muted);
      display: grid;
      place-items: center;
      font-size: 14px;
      z-index: 5
    }

    .tour-close:hover {
      background: var(--line);
      color: var(--ink)
    }

    .tour-skip {
      font-size: 12.5px;
      font-weight: 600;
      color: var(--faint);
      padding: 8px 4px
    }

    .tour-next {
      background: var(--teal);
      color: #fff;
      font-weight: 700;
      font-size: 13px;
      padding: 9px 16px;
      border-radius: 10px;
      display: flex;
      align-items: center;
      gap: 5px;
      box-shadow: 0 6px 16px rgba(11, 110, 99, .28)
    }

    .tour-next svg {
      width: 14px;
      height: 14px
    }

    .tour-spot-ring {
      position: absolute;
      z-index: 201;
      border-radius: 16px;
      border: 2.5px solid var(--teal);
      pointer-events: none;
      transition: top .35s cubic-bezier(.4, 0, .2, 1), left .35s cubic-bezier(.4, 0, .2, 1), width .35s, height .35s, box-shadow .25s;
      opacity: 0
    }

    .tour-spot-ring.show {
      opacity: 1
    }

    .tour-center {
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
      pointer-events: auto
    }

    .tour-intro {
      background: var(--surface);
      border-radius: 22px;
      box-shadow: var(--shadow-lg);
      width: 320px;
      max-width: 88vw;
      padding: 28px 24px;
      text-align: center;
      position: relative
    }

    .tour-intro .ti-ic {
      width: 64px;
      height: 64px;
      border-radius: 18px;
      background: var(--teal-soft);
      display: grid;
      place-items: center;
      margin: 0 auto 16px;
      font-size: 28px
    }

    .tour-intro h3 {
      font-family: 'Sora';
      font-weight: 800;
      font-size: 20px;
      color: var(--ink)
    }

    .tour-intro p {
      font-size: 13.5px;
      color: var(--muted);
      margin-top: 8px;
      line-height: 1.5
    }

    .tour-intro .btn {
      margin-top: 18px
    }

    .tour-intro .skipline {
      display: block;
      text-align: center;
      margin-top: 12px;
      font-size: 12.5px;
      color: var(--faint);
      font-weight: 600
    }

    @media(prefers-reduced-motion:reduce) {

      .tour-card,
      .tour-spot-ring,
      .tour-veil {
        transition: none !important
      }
    }

    /* ---- Desktop ---- */
    @media(min-width:900px) {
      .tabbar {
        display: none
      }

      .sidebar {
        display: flex;
        flex-direction: column;
        width: 240px;
        background: var(--surface);
        border-right: 1px solid var(--line);
        padding: 26px 16px;
        position: sticky;
        top: 0;
        height: 100dvh;
        gap: 4px
      }

      .sidebar .brand {
        padding: 0 10px 26px;
        font-size: 23px
      }

      .snav {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 14px;
        border-radius: 12px;
        font-weight: 600;
        font-size: 14.5px;
        color: var(--muted)
      }

      .snav svg {
        width: 21px;
        height: 21px
      }

      .snav:hover {
        background: var(--bg);
        color: var(--ink)
      }

      .snav.on {
        background: var(--teal-soft);
        color: var(--teal-deep)
      }

      .snav-add {
        margin-top: 12px;
        background: linear-gradient(135deg, var(--teal), var(--teal-deep));
        color: #fff;
        justify-content: center;
        box-shadow: 0 8px 20px rgba(11, 110, 99, .28);
        font-weight: 700;
        transition: box-shadow .2s, filter .15s
      }

      .snav-add:hover {
        background: linear-gradient(135deg, var(--teal), var(--teal-deep));
        color: #fff;
        box-shadow: 0 12px 28px rgba(11, 110, 99, .4);
        filter: brightness(1.06)
      }

      .sidebar-profile {
        display: none;
        align-items: center;
        padding: 10px;
        border-radius: 14px;
        background: var(--bg);
        border: 1.5px solid var(--line);
        cursor: pointer;
        transition: all .2s;
        margin-top: auto
      }

      .sidebar-profile:hover {
        background: var(--teal-soft);
        border-color: var(--teal)
      }

      .main {
        padding-bottom: 40px
      }

      .topbar .brand {
        display: none
      }

      .wrap,
      .topbar .wrap2 {
        max-width: 960px
      }

      .dashtop {
        display: grid;
        grid-template-columns: 1.05fr .95fr;
        gap: 14px;
        align-items: start
      }

      .sheet {
        left: 50%;
        right: auto;
        bottom: auto;
        top: 50%;
        transform: translate(-50%, -46%) scale(.98);
        width: 460px;
        border-radius: 22px;
        max-height: 88dvh;
        opacity: 0;
        transition: transform .28s, opacity .28s, visibility .28s
      }

      .sheet.show {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1
      }

      .sheet .grab {
        display: none
      }

      .toast {
        bottom: 30px
      }

      .mobileonly {
        display: none !important
      }

      .statgrid {
        grid-template-columns: 1fr 1fr 1fr
      }

      .card {
        min-height: 148px;
        padding: 18px
      }

      .card.hero {
        grid-column: span 1;
        min-height: 148px;
        padding: 18px
      }

      .card.hero .cbody {
        flex-direction: column;
        align-items: stretch;
        justify-content: center;
        margin-top: 0
      }

      .card .big {
        font-size: 32px
      }

      .card.hero .pill {
        margin-top: 10px;
        padding: 6px 12px
      }

      .split .row {
        flex-direction: row;
        justify-content: space-between;
        align-items: baseline;
        padding: 7px 0
      }

      .split .rl {
        font-size: 12.5px
      }

      .split .rv {
        font-size: 19px
      }

      .card.solo .v {
        font-size: 28px
      }

      .card.solo .vs {
        font-size: 11.5px;
        margin-top: 6px
      }
    }

    /* ---- Spreadsheet view styles ---- */
    .view-toggle {
      display: inline-flex;
      background: var(--line);
      padding: 3px;
      border-radius: 12px;
      margin-bottom: 18px;
      border: 1px solid var(--line);
      align-self: flex-start;
    }

    .view-toggle .toggle-btn {
      padding: 7px 18px;
      border-radius: 9px;
      font-weight: 700;
      font-size: 13px;
      color: var(--muted);
      transition: all .2s;
    }

    .view-toggle .toggle-btn.active {
      background: var(--surface);
      color: var(--teal-deep);
      box-shadow: var(--shadow);
    }

    .table-actions {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
      margin-bottom: 12px;
      flex-wrap: wrap;
    }

    .search-box {
      position: relative;
      flex: 1;
      min-width: 220px;
    }

    .search-box input {
      width: 100%;
      padding: 11px 14px 11px 38px;
      border: 1.5px solid var(--line);
      border-radius: 12px;
      background: var(--surface);
      color: var(--ink);
      font-size: 14px;
      transition: border-color .15s;
      box-shadow: var(--shadow);
    }

    .search-box input:focus {
      outline: none;
      border-color: var(--teal);
      background: #fff;
    }

    .search-box svg {
      position: absolute;
      left: 12px;
      top: 50%;
      transform: translateY(-50%);
      width: 16px;
      height: 16px;
      color: var(--faint);
      pointer-events: none;
    }

    .btn-export {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 11px 16px;
      background: var(--surface);
      border: 1.5px solid var(--line);
      border-radius: 12px;
      font-weight: 700;
      font-size: 13.5px;
      color: var(--muted);
      box-shadow: var(--shadow);
      transition: all .15s;
    }

    .btn-export:hover {
      border-color: var(--teal);
      color: var(--teal-deep);
      background: var(--teal-soft);
    }

    .btn-export svg {
      width: 16px;
      height: 16px;
    }

    .table-responsive {
      width: 100%;
      overflow-x: auto;
      border: 1px solid var(--line);
      border-radius: 16px;
      background: var(--surface);
      box-shadow: var(--shadow);
      scrollbar-width: thin;
    }

    .plantoes-table {
      width: 100%;
      border-collapse: collapse;
      text-align: left;
      font-size: 13.5px;
    }

    .plantoes-table th,
    .plantoes-table td {
      padding: 13px 16px;
      border-bottom: 1px solid var(--line);
      white-space: nowrap;
    }

    .plantoes-table th {
      background: #FAFBFB;
      font-weight: 700;
      color: var(--muted);
      cursor: pointer;
      user-select: none;
      transition: background .15s;
    }

    .plantoes-table th:hover {
      background: var(--line);
      color: var(--ink);
    }

    .plantoes-table th .sort-dir {
      display: inline-block;
      margin-left: 4px;
      font-size: 10px;
      color: var(--teal);
    }

    .plantoes-table tr:last-child td {
      border-bottom: none;
    }

    .plantoes-table tbody tr {
      cursor: pointer;
      transition: background .15s;
    }

    .plantoes-table tbody tr:hover {
      background: var(--teal-soft);
    }

    .plantoes-table .tbl-actions {
      display: flex;
      gap: 8px;
    }

    .plantoes-table .tbl-btn {
      padding: 5px 9px;
      border-radius: 8px;
      font-size: 11.5px;
      font-weight: 700;
      border: 1.5px solid var(--line);
      background: var(--surface);
      transition: all .15s;
    }

    .plantoes-table .tbl-btn:hover {
      background: var(--bg);
    }

    .plantoes-table .tbl-btn.pay {
      border-color: rgba(14,140,127,.35);
      color: var(--teal-deep);
      background: var(--teal-soft);
    }

    .plantoes-table .tbl-btn.pay:hover {
      background: #cdeae6;
    }

    @media(max-width: 768px) {
      .hide-mobile {
        display: none !important;
      }

      #view-plantoes .wrap {
        padding: 0 8px !important;
      }

      .plantoes-table th,
      .plantoes-table td {
        padding: 10px 6px !important;
        font-size: 12px !important;
      }

      .plantoes-table th .sort-dir {
        margin-left: 2px !important;
        font-size: 9px !important;
      }

      .plantoes-table .tbl-actions {
        gap: 4px !important;
      }

      .plantoes-table .tbl-btn {
        padding: 4px 6px !important;
        font-size: 11px !important;
        border-radius: 6px !important;
      }
    }

    /* ============================================================
       MOBILE LAYOUT — compact view for phones (≤ 430px)
    ============================================================ */
    @media (max-width: 430px) {
      .wrap {
        padding: 0 12px
      }

      .topbar {
        padding: calc(env(safe-area-inset-top) + 10px) 14px 6px
      }

      h2.title {
        font-size: 14px;
        margin: 16px 0 9px
      }

      .statgrid {
        gap: 9px
      }

      .card {
        padding: 12px;
        min-height: 100px
      }

      .card.hero {
        min-height: 88px;
        padding: 10px 14px
      }

      .card .big {
        font-size: 21px
      }

      .card .ck {
        font-size: 11.5px
      }

      .mchip {
        padding: 7px 11px;
        font-size: 12px
      }

      .bigchart {
        padding: 14px 12px 10px
      }

      .bigchart .bc-title {
        font-size: 12.5px
      }

      .bigchart .bc-tot {
        font-size: 14px
      }

      .item {
        padding: 10px 12px;
        gap: 10px
      }

      .ic {
        width: 38px;
        height: 38px;
        border-radius: 11px;
        font-size: 13px
      }

      .item .l1 {
        font-size: 13.5px
      }

      .item .l2 {
        font-size: 11.5px
      }

      .empty {
        padding: 30px 16px
      }

      .empty h3 {
        font-size: 15px
      }

      .empty p {
        font-size: 13px
      }
    }

    @media(prefers-reduced-motion:reduce) {
      * {
        animation: none !important;
        transition: none !important
      }
    }
    @keyframes spin {
      to { transform: rotate(360deg); }
    }

    #pBtnAddDate {
      display: flex !important;
      align-items: center;
      justify-content: center;
      gap: 8px;
      background: var(--teal-soft) !important;
      color: var(--teal-deep) !important;
      border: 2px solid var(--teal) !important;
      padding: 13px 18px !important;
      border-radius: 12px !important;
      font-size: 14px !important;
      font-weight: 700 !important;
      cursor: pointer;
      width: 100%;
      box-sizing: border-box;
      transition: all 0.18s ease;
      margin-top: 10px;
      box-shadow: 0 2px 8px rgba(14, 140, 127, 0.15);
      letter-spacing: 0.01em;
    }
    #pBtnAddDate:active {
      transform: scale(0.97);
      box-shadow: none;
    }

    /* Date input fields inside multi-date container */
    .p-data-input {
      flex: 1;
      padding: 11px 12px;
      border: 1.5px solid var(--line);
      border-radius: 10px;
      background: var(--bg);
      color: var(--ink);
      font-weight: 600;
      font-size: 15px;
      font-family: inherit;
      transition: border-color .15s;
    }
    .p-data-input:focus {
      outline: none;
      border-color: var(--teal);
      background: #fff;
    }

    /* Remove date button */
    .btn-del-date {
      color: var(--faint);
      font-size: 14px;
      width: 44px;
      height: 44px;
      min-width: 44px;
      display: grid;
      place-items: center;
      border: 1.5px solid var(--line) !important;
      border-radius: 50%;
      background: var(--surface) !important;
      cursor: pointer;
      transition: all .15s;
    }
    .btn-del-date:active {
      color: #C53B3B;
      border-color: rgba(197,59,59,.4) !important;
      background: rgba(197,59,59,.08) !important;
      transform: scale(.92);
    }

    /* ============================================================
       HOVER EFFECTS — pointer devices only (no sticky on touch)
    ============================================================ */
    @media (hover: hover) and (pointer: fine) {
      .item:hover {
        border-color: rgba(14,140,127,.22);
        box-shadow: 0 4px 18px rgba(14,140,127,.10);
        background: #FAFEFE
      }
      h2.title .link:hover {
        background: rgba(14,140,127,.18);
        border-color: var(--teal)
      }
      .btn:hover {
        box-shadow: 0 12px 28px rgba(11, 110, 99, .38);
        filter: brightness(1.06)
      }
      .fab:hover {
        transform: scale(1.06);
        box-shadow: 0 14px 32px rgba(11, 110, 99, .5);
        filter: brightness(1.07)
      }
      .sheet .x:hover {
        background: var(--line);
        color: var(--ink)
      }
      .confirm-actions .cancel:hover {
        background: var(--line);
        color: var(--ink)
      }
      .confirm-actions .confirm:hover {
        box-shadow: 0 12px 28px rgba(31, 174, 107, .42);
        filter: brightness(1.05)
      }
      .markpaid-btn:hover {
        background: rgba(14,140,127,.18);
        border-color: var(--teal);
        box-shadow: 0 4px 14px rgba(14,140,127,.22)
      }
      .seg button:hover {
        border-color: rgba(14,140,127,.3);
        color: var(--ink)
      }
      .segf button:hover {
        border-color: rgba(14,140,127,.3);
        color: var(--ink)
      }
      .del-row button:hover {
        background: rgba(197,59,59,.09);
        border-color: rgba(197,59,59,.4)
      }
      #pBtnAddDate:hover {
        background: rgba(14, 140, 127, 0.18) !important;
        box-shadow: 0 4px 16px rgba(14, 140, 127, 0.28);
        border-color: var(--teal-deep) !important;
      }
      .btn-del-date:hover {
        color: #C53B3B;
        border-color: rgba(197,59,59,.3) !important;
        background: rgba(197,59,59,.05) !important;
      }
      .snav-add:hover {
        box-shadow: 0 12px 28px rgba(11, 110, 99, .4);
        filter: brightness(1.06)
      }
      .sup-opt:hover {
        border-color: var(--teal)
      }
      .btn-export:hover {
        border-color: var(--teal);
        color: var(--teal-deep);
        background: var(--teal-soft);
      }
      .plantoes-table tbody tr:hover {
        background: var(--teal-soft);
      }
      .plantoes-table .tbl-btn:hover {
        background: var(--bg);
      }
      .plantoes-table .tbl-btn.pay:hover {
        background: #cdeae6;
      }
      .mchip:hover {
        border-color: var(--teal);
        color: var(--teal-deep)
      }
      .sup-opt:hover {
        border-color: var(--teal)
      }
      .topbar-profile:hover {
        border-color: var(--teal)
      }
      .yearstep button:hover {
        background: var(--bg);
        color: var(--ink)
      }
    }

    /* ============================================================
       MOBILE — active feedback for touch (replaces hover)
    ============================================================ */
    @media (hover: none) {
      /* Disable transitions that would cause layout jank on touch */
      .item { transition: transform .1s }
      .item:active {
        transform: scale(.98);
        background: #F3FAF9
      }
      .btn:active {
        filter: brightness(.93);
        transform: translateY(1px)
      }
      .fab:active {
        transform: scale(.90)
      }
      .markpaid-btn:active {
        background: rgba(14,140,127,.20)
      }
      .seg button:active {
        border-color: rgba(14,140,127,.4);
        background: rgba(14,140,127,.07)
      }
      .segf button:active {
        border-color: rgba(14,140,127,.4);
        background: rgba(14,140,127,.07)
      }
      .del-row button:active {
        background: rgba(197,59,59,.1)
      }
      #pBtnAddDate:active {
        background: rgba(11,110,99,.14)
      }
      h2.title .link:active {
        background: rgba(14,140,127,.2)
      }
      .confirm-actions .cancel:active {
        background: var(--line)
      }
      .confirm-actions .confirm:active {
        filter: brightness(.93)
      }
    }

    /* ============================================================
       MOBILE FORM — stacked layout for date + duration fields
    ============================================================ */
    @media (max-width: 480px) {
      /* Stack date(s) and duration vertically on narrow screens */
      #sheetPlantao .row2 {
        grid-template-columns: 1fr !important;
      }

      /* Make duration buttons taller for easier tap */
      .segf button {
        padding: 13px 6px;
        font-size: 14px
      }

      /* Larger tap target for segments */
      .seg button {
        padding: 13px 6px
      }

      /* Give remove-date button plenty of room */
      .btn-del-date {
        width: 44px;
        height: 44px;
        min-width: 44px
      }

      /* Date inputs fill properly */
      .p-data-input {
        font-size: 16px; /* Prevents iOS zoom on focus */
        padding: 13px 12px
      }

      /* Add date button bigger on mobile */
      #pBtnAddDate {
        padding: 13px 16px;
        font-size: 14px
      }

      /* Del-row button easier to tap */
      .del-row button {
        padding: 12px 28px
      }

      /* markpaid bigger touch area */
      .markpaid-btn {
        padding: 11px 14px;
        font-size: 13px
      }

      /* Confirm actions full height */
      .confirm-actions button {
        padding: 16px
      }

      /* Toast above tab bar with safe area */
      .toast {
        bottom: calc(90px + env(safe-area-inset-bottom))
      }
    }




/* ============================================================
   Árvore de indicações (admin → Financeiro)
   Layout hierárquico de cima para baixo: cada nível é um <ul>, cada
   pessoa um <li>. Os conectores são bordas nos pseudo-elementos do
   <li>, técnica que dispensa qualquer cálculo em JS e acompanha o
   tamanho real dos cards.
============================================================ */
.gen-scroll {
  overflow-x: auto;
  padding: 4px 0 12px;
}

.gen-tree {
  display: inline-block;
  min-width: 100%;
}

.gen-tree ul {
  display: flex;
  justify-content: center;
  padding-top: 26px;
  position: relative;
  list-style: none;
  margin: 0;
}

.gen-tree > ul {
  padding-top: 0;
}

.gen-tree li {
  list-style: none;
  position: relative;
  padding: 26px 10px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Meia-linha horizontal de cada lado, formando a barra que liga os irmãos */
.gen-tree li::before,
.gen-tree li::after {
  content: '';
  position: absolute;
  top: 0;
  right: 50%;
  width: 50%;
  height: 26px;
  border-top: 2px solid var(--line);
}

.gen-tree li::after {
  right: auto;
  left: 50%;
  border-left: 2px solid var(--line);
}

/* Filho único não precisa da barra horizontal, só do tronco vertical */
.gen-tree li:only-child::before,
.gen-tree li:only-child::after {
  display: none;
}

.gen-tree li:only-child {
  padding-top: 26px;
}

/* As pontas da barra não podem passar do primeiro/último irmão */
.gen-tree li:first-child::before,
.gen-tree li:last-child::after {
  border: 0 none;
}

.gen-tree li:last-child::before {
  border-right: 2px solid var(--line);
  border-radius: 0 7px 0 0;
}

.gen-tree li:first-child::after {
  border-radius: 7px 0 0 0;
}

/* Tronco que desce do pai até a barra dos filhos */
.gen-tree ul ul::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  border-left: 2px solid var(--line);
  width: 0;
  height: 26px;
}

.gen-card {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 210px;
  transition: border-color .16s, box-shadow .16s;
}

.gen-card:hover {
  border-color: var(--teal);
  box-shadow: 0 6px 18px rgba(14, 140, 127, .14);
}

/* Quem tem indicados abaixo ganha destaque — é o nó que importa ler */
.gen-card--pai {
  border-color: rgba(14, 140, 127, .45);
}

.gen-card--root {
  background: var(--teal-soft);
  border-color: var(--teal);
}

.gen-top {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.gen-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--teal);
  color: #fff;
  font-family: 'Sora';
  font-weight: 700;
  font-size: 11.5px;
}

.gen-card--root .gen-avatar {
  background: var(--teal-deep);
}

.gen-id {
  display: flex;
  flex-direction: column;
  min-width: 0;
  text-align: left;
}

.gen-name {
  font-family: 'Sora';
  font-weight: 700;
  font-size: 12.5px;
  color: var(--ink);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gen-sub {
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gen-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.gen-badge {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
}

.gen-badge--pago {
  background: var(--recebido-soft);
  color: var(--recebido);
}

.gen-badge--pendente {
  background: var(--pend-soft);
  color: var(--pend);
}

.gen-badge--free {
  background: var(--teal-soft);
  color: var(--teal-deep);
}

.gen-badge--plano {
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--line);
  text-transform: capitalize;
}

.gen-code {
  font-family: monospace;
  font-size: 9.5px;
  font-weight: 700;
  color: var(--teal-deep);
  background: var(--surface);
  border: 1px dashed var(--teal);
  padding: 1px 6px;
  border-radius: 5px;
}

.gen-rede {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--feito-soft);
  color: var(--feito);
  white-space: nowrap;
}

/* Contas sem indicador: lista simples, sem árvore de um nó só */
.gen-soltos {
  border-top: 1px dashed var(--line);
  padding-top: 14px;
  margin-top: 4px;
}

.gen-soltos-tit {
  font-size: 11px;
  font-weight: 700;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 10px;
}

.gen-soltos-lista {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.gen-card--solto {
  width: 210px;
}

@media (max-width: 560px) {
  .gen-card,
  .gen-card--solto {
    width: 175px;
  }

  .gen-tree li {
    padding-left: 5px;
    padding-right: 5px;
  }
}
