
.purchase-toolbar-premium{
  display:flex;
  flex-direction:column;
  gap:12px;
}
.purchase-search-layout{
  display:grid;
  grid-template-columns:minmax(0,1.55fr) minmax(280px,.95fr);
  gap:14px;
  align-items:stretch;
}
.search-area-condensed .compact-search-input-shell{
  min-width:0;
  flex:1 1 360px;
  max-width:560px;
}
.search-area-condensed .search-toolbar-line{
  justify-content:space-between;
  gap:12px;
}
.search-area-condensed .search-toolbar-right{
  flex:0 1 auto;
}
.search-result-card{
  position:relative;
  display:flex;
  flex-direction:column;
  justify-content:center;
  min-height:128px;
  padding:18px 18px 16px;
  border-radius:24px;
  overflow:hidden;
  border:1px solid rgba(141,168,255,.28);
  background:linear-gradient(180deg,rgba(247,250,255,.94),rgba(229,238,255,.90));
  box-shadow:0 18px 38px rgba(12,35,79,.10);
}
.search-result-card::before{
  content:'';
  position:absolute;
  inset:-20% auto auto 56%;
  width:140px;
  height:140px;
  border-radius:999px;
  background:radial-gradient(circle, rgba(255,255,255,.42), transparent 70%);
  pointer-events:none;
}
.search-result-card.bump{
  animation:searchCardPulse .72s ease;
}
.search-result-badge{
  display:inline-flex;
  align-items:center;
  align-self:flex-start;
  padding:6px 10px;
  border-radius:999px;
  font-size:10px;
  font-weight:900;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:#6c4ad1;
  background:rgba(255,255,255,.76);
  border:1px solid rgba(155,128,255,.22);
}
.search-result-title{
  margin-top:12px;
  color:#123e73;
  font-size:.96rem;
  font-weight:900;
}
.search-result-value{
  margin-top:8px;
  font-size:1.8rem;
  font-weight:900;
  line-height:1.05;
  color:#0d2e58;
}
.search-result-meta{
  margin-top:8px;
  color:#36506f;
  font-size:.9rem;
  font-weight:800;
}
.search-result-submeta{
  margin-top:6px;
  color:#6a809a;
  font-size:.86rem;
  line-height:1.45;
  font-weight:700;
}
@keyframes searchCardPulse{
  0%{transform:scale(1);box-shadow:0 18px 38px rgba(12,35,79,.10);}
  40%{transform:scale(1.012);box-shadow:0 24px 44px rgba(28,98,211,.18);}
  100%{transform:scale(1);box-shadow:0 18px 38px rgba(12,35,79,.10);}
}
@media (max-width:1180px){
  .purchase-search-layout{grid-template-columns:1fr;}
  .search-area-condensed .compact-search-input-shell{max-width:none;}
}
@media (max-width:900px){
  .search-area-condensed .search-toolbar-line{flex-direction:column;align-items:stretch;}
}

/* ===== v9 compras responsive + card compacto ===== */
.purchase-search-layout{
  grid-template-columns:minmax(0,1.35fr) minmax(260px,.8fr);
}
.search-area-condensed .compact-search-input-shell{
  max-width:420px;
}
.search-result-card{
  min-height:0;
  padding:14px 16px;
  gap:10px;
  border-radius:22px;
}
.search-result-topline{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}
.search-result-grid-compact{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(180px,1fr);
  gap:12px;
  align-items:stretch;
}
.search-result-hero-block{
  min-width:0;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:6px;
}
.search-result-stats-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
}
.search-result-mini-stat{
  min-width:0;
  border-radius:16px;
  padding:10px 11px;
  background:rgba(255,255,255,.72);
  border:1px solid rgba(145,170,255,.18);
  display:flex;
  flex-direction:column;
  gap:5px;
}
.mini-stat-label{
  font-size:.7rem;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:#6f82a1;
}
.mini-stat-value{
  font-size:.92rem;
  line-height:1.2;
  font-weight:900;
  color:#143e73;
  overflow-wrap:anywhere;
}
.mini-stat-value.negative{ color:#c43b39; }
.mini-stat-value.accent{ color:#1d5fd1; }
.search-result-title{
  margin-top:0;
  font-size:.92rem;
}
.search-result-value{
  margin-top:0;
  font-size:clamp(1.35rem, 2.4vw, 1.95rem);
  overflow-wrap:anywhere;
}
.search-result-meta,
.search-result-submeta{
  font-size:.82rem;
  line-height:1.35;
}
@media (max-width:1180px){
  .purchase-search-layout{grid-template-columns:1fr;}
}
@media (max-width:760px){
  .search-result-grid-compact{grid-template-columns:1fr;}
}
@media (max-width:560px){
  .search-result-card{padding:12px;}
  .search-result-stats-grid{grid-template-columns:1fr 1fr;}
  .search-result-topline{align-items:flex-start;}
}

/* ===== v10 compras com pills apenas + busca compacta ===== */
.search-layout-pills-only,
.purchase-search-layout.search-layout-pills-only{
  display:block;
}
.search-area-pills-only{
  width:100%;
}
.search-toolbar-line-pills-only{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  flex-wrap:wrap;
}
.premium-toolbar-right-pills{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
  min-width:0;
  flex:1 1 520px;
}
.search-area-pills-only .compact-search-input-shell{
  flex:1 1 320px;
  max-width:390px;
  min-width:220px;
}
.search-area-pills-only .search-input-shell input{
  min-height:46px;
  padding:16px 12px 8px;
}
.premium-search-pills-wrap{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:stretch;
  justify-content:flex-end;
}
.premium-search-pills-wrap .search-mini-pill{
  min-width:auto;
  min-height:42px;
  padding:6px 11px;
  font-size:.84rem;
  line-height:1.15;
  white-space:nowrap;
}
#search-base-pill,
#search-terms-pill{
  background:linear-gradient(180deg, rgba(255,255,255,0.96), rgba(241,247,255,0.84));
}
#search-credits-pill{
  background:linear-gradient(180deg, rgba(255,252,252,0.98), rgba(255,239,239,0.86));
}
#search-credits-pill{ color:#a63232; }
#search-total-pill{ color:#1d5fd1; }
@media (max-width:1220px){
  .premium-toolbar-right-pills{
    justify-content:flex-start;
  }
}
@media (max-width:900px){
  .search-toolbar-line-pills-only{
    align-items:stretch;
  }
  .search-area-pills-only .compact-search-input-shell,
  .premium-toolbar-right-pills{
    flex-basis:100%;
    max-width:none;
  }
}
@media (max-width:640px){
  .premium-search-pills-wrap .search-mini-pill,
  .premium-toggle-pill{
    min-height:40px;
    padding:7px 10px;
    font-size:.78rem;
  }
  .premium-search-pills-wrap{
    gap:8px;
  }
  .premium-search-pills-wrap .search-mini-pill{
    flex:1 1 calc(50% - 8px);
    min-width:118px;
    white-space:normal;
    overflow-wrap:anywhere;
  }
}

.stacked-tab-deck{
  position:relative;
  display:block!important;
  min-height:88px;
  padding-bottom:8px;
  touch-action:pan-y;
  cursor:grab;
}
.stacked-tab-deck.is-dragging{cursor:grabbing;}
.stacked-tab-deck .tab-button{
  position:absolute;
  inset:0;
  width:100%;
  opacity:1;
  transition:
    transform .42s cubic-bezier(.22,.61,.36,1),
    filter .3s ease,
    box-shadow .3s ease,
    opacity .3s ease;
  transform:
    translate3d(calc(var(--stack-depth, 0) * 12px), calc(var(--stack-depth, 0) * 8px), 0)
    scale(calc(1 - (var(--stack-depth, 0) * .03)));
  filter:saturate(.82);
}
.stacked-tab-deck .tab-button.stack-active{
  transform:translate3d(0,0,0) scale(1);
  filter:none;
  box-shadow:0 18px 34px rgba(10,23,55,.14);
}
.stacked-tab-dots{
  display:flex;
  gap:7px;
  align-items:center;
  justify-content:center;
  margin-top:8px;
}
.stacked-tab-dot{
  width:9px;
  height:9px;
  border:none;
  border-radius:999px;
  background:rgba(36,83,199,.18);
  cursor:pointer;
  transition:transform .22s ease, background .22s ease, box-shadow .22s ease;
}
.stacked-tab-dot.is-active{
  background:#2453c7;
  box-shadow:0 6px 12px rgba(36,83,199,.26);
  transform:scale(1.2);
}

.stacked-tab-deck .tab-button{
  min-height:96px;
  padding:14px 14px 12px;
}
.stacked-tab-deck .purchase-tab-main{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  min-width:0;
  font-size:clamp(.86rem, 1.6vw, 1.02rem);
  line-height:1.22;
}
.stacked-tab-deck .purchase-tab-main > span{
  min-width:0;
  overflow-wrap:anywhere;
}
.stacked-tab-deck .purchase-tab-sub{
  display:block;
  margin-top:6px;
  font-size:clamp(.74rem, 1.35vw, .92rem);
  line-height:1.32;
  overflow-wrap:anywhere;
}
.stacked-tab-deck .tab-icon-bubble{
  flex:0 0 auto;
}

@media (max-width:640px){
  .stacked-tab-deck{
    min-height:96px;
  }
  .stacked-tab-deck .tab-button{
    min-height:102px;
    padding:12px 12px 11px;
  }
  .stacked-tab-deck .purchase-tab-main{
    font-size:clamp(.82rem, 3.8vw, .94rem);
    gap:8px;
  }
  .stacked-tab-deck .purchase-tab-sub{
    font-size:clamp(.72rem, 3.2vw, .84rem);
  }
}

/* ===== v11 compras expander reformulado ===== */
.purchase-browser-shell{
  display:grid;
  gap:14px;
  margin-bottom:14px;
  padding:18px;
  border-radius:28px;
  background:linear-gradient(180deg, rgba(245,249,255,.96), rgba(231,240,255,.9));
  border:1px solid rgba(161,193,234,.46);
  box-shadow:0 18px 42px rgba(10,23,55,.08);
}
.purchase-browser-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  flex-wrap:wrap;
}
.purchase-browser-copy{
  display:grid;
  gap:6px;
  min-width:0;
}
.purchase-browser-kicker{
  display:inline-flex;
  align-items:center;
  width:max-content;
  padding:7px 12px;
  border-radius:999px;
  background:rgba(255,255,255,.78);
  border:1px solid rgba(163,194,235,.44);
  color:#1e58b8;
  font-size:11px;
  font-weight:900;
  letter-spacing:.1em;
  text-transform:uppercase;
}
#purchase-browser-title{
  color:#123765;
  font-size:clamp(1.08rem, 2vw, 1.32rem);
  line-height:1.15;
}
#purchase-browser-subtitle{
  color:#5f7597;
  font-size:clamp(.84rem, 1.35vw, .96rem);
  line-height:1.45;
}
.purchase-year-switcher{
  display:flex;
  align-items:stretch;
  gap:10px;
  flex-wrap:wrap;
}
.purchase-year-current,
.purchase-year-menu-toggle,
.purchase-year-option{
  border:none;
  cursor:pointer;
}
.purchase-year-current{
  min-width:170px;
  display:grid;
  gap:4px;
  padding:14px 16px;
  border-radius:22px;
  background:linear-gradient(180deg, #ffffff, #edf4ff);
  border:1px solid rgba(160,193,236,.42);
  box-shadow:0 14px 28px rgba(10,23,55,.06);
  text-align:left;
}
.purchase-year-current.is-current{
  background:linear-gradient(180deg, rgba(25,99,214,.96), rgba(17,78,175,.92));
  color:#fff;
}
.purchase-year-current .year-current-kicker{
  font-size:10px;
  font-weight:900;
  letter-spacing:.1em;
  text-transform:uppercase;
  opacity:.72;
}
.purchase-year-current strong{
  font-size:clamp(1.2rem, 2.8vw, 1.8rem);
  line-height:1;
}
.purchase-year-current small{
  font-size:clamp(.76rem, 1.2vw, .9rem);
  line-height:1.3;
  opacity:.84;
}
.purchase-year-menu-toggle{
  min-width:140px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 16px;
  border-radius:22px;
  background:rgba(255,255,255,.8);
  border:1px solid rgba(160,193,236,.42);
  box-shadow:0 14px 28px rgba(10,23,55,.05);
  color:#1d3f69;
  font-size:.92rem;
  font-weight:800;
}
.purchase-year-menu-toggle strong{
  display:grid;
  place-items:center;
  min-width:26px;
  height:26px;
  padding:0 8px;
  border-radius:999px;
  background:#e8f1ff;
  color:#1d5fd1;
  font-size:.8rem;
}
.purchase-year-menu-toggle:disabled{
  opacity:.55;
  cursor:default;
}
.purchase-year-menu{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(160px,1fr));
  gap:10px;
}
.purchase-year-menu.hidden{
  display:none!important;
}
.purchase-year-option{
  min-width:0;
  display:grid;
  gap:8px;
  padding:14px 15px;
  border-radius:20px;
  background:rgba(255,255,255,.78);
  border:1px solid rgba(173,201,238,.44);
  box-shadow:0 12px 26px rgba(10,23,55,.04);
  color:#1d3f69;
  text-align:left;
}
.purchase-year-option.is-current{
  background:linear-gradient(180deg, rgba(233,243,255,.96), rgba(216,232,255,.92));
}
.purchase-year-option-main{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.purchase-year-option-main strong{
  font-size:1.05rem;
}
.purchase-year-option-sub{
  font-size:.84rem;
  color:#637a99;
  line-height:1.35;
  overflow-wrap:anywhere;
}
.purchase-year-tabs,
.purchase-past-years{
  display:none!important;
}
.purchase-months-board{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
  margin-bottom:12px;
}
.purchase-month-card{
  min-width:0;
  display:grid;
  gap:8px;
  padding:14px 14px 13px;
  border-radius:22px;
  border:1px solid rgba(168,196,235,.4);
  background:linear-gradient(180deg, rgba(255,255,255,.92), rgba(241,247,255,.84));
  color:#1a3e6c;
  box-shadow:0 14px 30px rgba(10,23,55,.05);
  text-align:left;
  cursor:pointer;
  transition:transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
}
.purchase-month-card:hover{
  transform:translateY(-2px);
  box-shadow:0 18px 34px rgba(10,23,55,.08);
}
.purchase-month-card.active{
  background:linear-gradient(180deg, rgba(28,97,209,.96), rgba(18,77,172,.92));
  color:#fff;
  border-color:rgba(28,97,209,.36);
  box-shadow:0 20px 38px rgba(28,97,209,.2);
}
.purchase-month-card.is-current:not(.active){
  border-color:rgba(29,95,209,.42);
  background:linear-gradient(180deg, rgba(233,243,255,.96), rgba(218,232,255,.9));
}
.purchase-month-card.is-paid:not(.active){
  background:linear-gradient(180deg, rgba(244,251,246,.96), rgba(229,244,235,.9));
  border-color:rgba(107,190,139,.26);
}
.purchase-month-card-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.purchase-month-card-name{
  min-width:0;
  font-size:clamp(.86rem, 1.35vw, .98rem);
  font-weight:900;
  line-height:1.2;
}
.purchase-month-card-icon{
  display:grid;
  place-items:center;
  width:30px;
  height:30px;
  border-radius:999px;
  background:rgba(255,255,255,.72);
  font-size:1rem;
}
.purchase-month-card.active .purchase-month-card-icon{
  background:rgba(255,255,255,.18);
}
.purchase-month-card-value{
  font-size:clamp(1rem, 2.15vw, 1.3rem);
  line-height:1.1;
  overflow-wrap:anywhere;
}
.purchase-month-card-meta{
  font-size:clamp(.72rem, 1vw, .82rem);
  line-height:1.35;
  color:#647a99;
}
.purchase-month-card.active .purchase-month-card-meta{
  color:rgba(255,255,255,.78);
}

@media (max-width:1100px){
  .purchase-months-board{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}
@media (max-width:820px){
  .purchase-browser-shell{
    padding:16px;
  }
  .purchase-year-current,
  .purchase-year-menu-toggle{
    flex:1 1 220px;
  }
  .purchase-months-board{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
@media (max-width:560px){
  .purchase-browser-shell{
    padding:14px;
    border-radius:24px;
  }
  .purchase-browser-head{
    gap:12px;
  }
  .purchase-year-switcher{
    width:100%;
  }
  .purchase-year-current,
  .purchase-year-menu-toggle{
    width:100%;
  }
  .purchase-year-menu{
    grid-template-columns:1fr;
  }
  .purchase-months-board{
    grid-template-columns:1fr;
  }
}

/* ===== v12 compras x pesquisar ===== */
.search-context-row{
  display:flex;
  align-items:stretch;
  gap:10px;
  flex-wrap:wrap;
  width:100%;
}
.search-context-pill{
  min-width:220px;
  display:grid;
  gap:4px;
  padding:12px 14px;
  border:none;
  border-radius:18px;
  background:linear-gradient(180deg, rgba(255,255,255,.96), rgba(239,246,255,.88));
  border:1px solid rgba(171,199,236,.4);
  box-shadow:0 12px 24px rgba(10,23,55,.05);
  color:#173e6f;
  text-align:left;
  cursor:pointer;
  position:relative;
}
.search-context-pill small{
  font-size:10px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:#6a7f9b;
}
.search-context-pill strong{
  font-size:clamp(.84rem, 1.25vw, .96rem);
  line-height:1.3;
  overflow-wrap:anywhere;
}
.search-context-menu{
  position:absolute;
  z-index:25;
  margin-top:56px;
  min-width:min(100%, 520px);
  max-width:640px;
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  padding:14px;
  border-radius:22px;
  background:rgba(255,255,255,.98);
  border:1px solid rgba(171,199,236,.42);
  box-shadow:0 24px 54px rgba(10,23,55,.16);
}
.search-context-menu.hidden{display:none!important;}
.search-context-section{
  display:grid;
  gap:8px;
}
.search-context-section-title{
  font-size:11px;
  font-weight:900;
  letter-spacing:.1em;
  text-transform:uppercase;
  color:#6f82a1;
}
.search-context-option{
  padding:10px 12px;
  border:none;
  border-radius:14px;
  background:#f3f8ff;
  color:#1f426f;
  text-align:left;
  cursor:pointer;
  font-size:.86rem;
  font-weight:800;
  line-height:1.35;
}
.search-context-option.active{
  background:linear-gradient(180deg, rgba(29,95,209,.94), rgba(20,79,177,.92));
  color:#fff;
}

@media (max-width:760px){
  .search-context-row{
    align-items:stretch;
  }
  .search-context-pill{
    width:100%;
  }
  .search-context-menu{
    position:relative;
    margin-top:0;
    min-width:100%;
    grid-template-columns:1fr;
  }
}
