/* ============================================================
   PEDIDOS IEDA — ESTILOS EXECUTIVOS (PADRÃO VITRINE / BOLOES_SILCE)
   Reutiliza tokens de global.css e linguagem tátil do SuperApp.
   ============================================================ */

body {
    background-color: var(--fundo);
    color: var(--texto);
    padding-bottom: max(84px, calc(70px + env(safe-area-inset-bottom, 0px)));
}

.pi-container {
    width: 100%;
    max-width: 1260px;
    margin: 0 auto;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pi-container input[type="number"]::-webkit-outer-spin-button,
.pi-container input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pi-container input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.pi-header-btn {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.38);
}

/* ── 0. NAVEGAÇÃO PRIMÁRIA SEGMENTADA (ESTILO .silce-module-nav) ─────── */
.pi-module-nav {
    background: #e2e8f0;
    padding: 4px;
    border-radius: 12px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    border: 1px solid #cbd5e1;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
}

.pi-nav-tab {
    background: transparent;
    border: none;
    border-radius: 9px;
    padding: 8px 10px;
    font-family: inherit;
    font-size: 0.79rem;
    font-weight: 800;
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.18s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pi-nav-tab:hover {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.55);
}

.pi-nav-tab.active {
    background: #ffffff;
    color: var(--azul-caixa);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
}

.pi-nav-tab .nav-pill {
    font-size: 0.65rem;
    font-weight: 900;
    padding: 1px 6px;
    border-radius: 999px;
    background: #cbd5e1;
    color: #1e293b;
    font-variant-numeric: tabular-nums;
}

.pi-nav-tab.active .nav-pill {
    background: #dbeafe;
    color: #1d4ed8;
}

.pi-nav-tab .nav-pill.alert {
    background: #fee2e2;
    color: #b91c1c;
}

.pi-nav-tab.active .nav-pill.alert {
    background: #dc2626;
    color: #ffffff;
}

.pi-tab-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pi-minha-conta-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    background: var(--fundo-card);
    border: 1px solid var(--borda);
    border-left: 4px solid var(--azul-caixa);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.8rem;
    color: var(--texto);
}

.pi-minha-conta-vals {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-variant-numeric: tabular-nums;
}

.pi-minha-conta-vals strong {
    color: var(--azul-caixa);
    font-weight: 900;
}

.pi-conta-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    background: var(--fundo-sutil);
    border: 1px solid var(--borda-sutil);
    color: #334155;
}

.pi-conta-pill.issued {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1e40af;
}

.pi-conta-pill.issued strong {
    color: #1d4ed8;
}

.pi-kpis-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* ── CABEÇALHOS & BOTÕES DE AÇÃO ──────────────────────────────────────── */
.hub-panel {
    padding: 14px 16px;
    border-radius: 14px;
}

.pi-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.pi-composer-head {
    padding-bottom: 10px;
    border-bottom: 1px solid var(--borda-sutil);
    margin-bottom: 10px;
}

.pi-panel-title {
    font-size: 0.98rem;
    font-weight: 900;
    color: var(--azul-caixa);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 7px;
}

.pi-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pi-section-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    padding: 2px 2px 0;
}

.btn-pi-action {
    height: 32px;
    padding: 0 11px;
    border-radius: 8px;
    font-size: 0.74rem;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 1.5px solid var(--borda-forte);
    background: #ffffff;
    color: var(--texto);
    transition: all 0.15s ease;
    font-family: inherit;
    white-space: nowrap;
}

.btn-pi-action:hover {
    border-color: var(--azul-caixa);
    color: var(--azul-caixa);
    background: #f8fafc;
}

.btn-pi-action.primary {
    background: var(--azul-caixa);
    border-color: var(--azul-caixa);
    color: #ffffff;
}

.btn-pi-action.primary:hover {
    background: var(--azul-acao-hover);
    border-color: var(--azul-acao-hover);
    color: #ffffff;
}

.btn-pi-action.danger-ghost {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.btn-pi-action.danger-ghost:hover {
    background: #fee2e2;
    border-color: #f87171;
}

/* ── COMPOSITOR NOVO PEDIDO & BUSCA RÁPIDA INTEGRADA ─────────────────── */
.pi-composer-card {
    border: 1px solid var(--borda);
    border-top: 3px solid var(--pi-accent, var(--azul-caixa));
    transition: border-top-color 0.25s ease;
}

.pi-composer-head-actions {
    flex: 0 0 auto;
    justify-content: flex-end;
}

.pi-quick-search-wrap {
    position: relative;
    flex: 1 1 260px;
    max-width: 420px;
    min-width: min(100%, 240px);
}

/* ── PÍLULAS DE MODALIDADE, CONCURSOS ESPECIAIS & TOOLBAR (.filters-card) */
.filters-card {
    background: var(--fundo-card);
    border: 1px solid var(--borda);
    border-radius: 12px;
    padding: 9px 12px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filters-toolbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.filters-group {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.filter-chip {
    background: var(--fundo-sutil);
    border: 1.5px solid var(--borda);
    color: var(--texto);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s ease;
    font-family: inherit;
    white-space: nowrap;
    line-height: 1.25;
}

.filter-chip:hover {
    border-color: var(--azul-claro);
    background: #ffffff;
}

.filter-chip.active {
    background: var(--azul-caixa);
    border-color: var(--azul-caixa);
    color: #ffffff;
}

.filter-chip.active .chip-color-dot {
    background: #ffffff !important;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.filter-chip.pi-chip-action {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.filter-chip.pi-chip-action:hover {
    background: #dbeafe;
    border-color: #60a5fa;
}

.filter-chip.pi-chip-especial:not(.active) {
    background: #ffffff;
    border-color: color-mix(in srgb, var(--esp-color, #b45309) 42%, #ffffff);
    color: var(--esp-color, #78350f);
    box-shadow: inset 0 0 0 999px color-mix(in srgb, var(--esp-color, #b45309) 7%, transparent);
}

.filter-chip.pi-chip-especial:not(.active):hover {
    border-color: var(--esp-color, #b45309);
    box-shadow: inset 0 0 0 999px color-mix(in srgb, var(--esp-color, #b45309) 13%, transparent);
}

.chip-color-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.radar-modalidades-row {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    padding-top: 7px;
    border-top: 1px solid var(--borda-sutil);
}

.radar-modalidades-row.pi-concurso-strip {
    padding-top: 0;
    border-top: none;
}

.pi-concurso-zone {
    margin-bottom: 10px;
}

/* ── BUSCA RÁPIDA FLUTUANTE & RESULTADOS COM BADGE CAIXA ─────────────────── */
.pi-search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 9px;
    height: 36px;
    padding: 0 10px;
    gap: 8px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.pi-search-input-wrap:focus-within {
    background: #ffffff;
    border-color: var(--pi-accent, var(--azul-caixa));
    box-shadow: 0 0 0 3px rgba(0, 54, 109, 0.12);
}

.pi-search-icon {
    color: var(--azul-claro);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.pi-search-input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    padding: 4px 0;
    font-family: inherit;
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--texto);
}

.pi-clear-btn {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #475569;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.pi-clear-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.pi-search-results {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: auto;
    width: max(100%, min(92vw, 440px));
    z-index: 60;
    border: 1px solid var(--borda-forte);
    border-radius: 12px;
    background: #ffffff;
    max-height: 310px;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.pi-search-item {
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--borda-sutil);
    border-left: 4px solid var(--azul-caixa);
    padding: 9px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-family: inherit;
    transition: background 0.12s ease;
}

.pi-search-item:last-child {
    border-bottom: none;
}

.pi-search-item:hover,
.pi-search-item.selected {
    background: #eff6ff;
}

.pi-search-item-main {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.pi-search-item-title {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 0.85rem;
    font-weight: 800;
    color: #0f172a;
}

.pi-search-item-sub {
    font-size: 0.71rem;
    font-weight: 600;
    color: #64748b;
}

.pi-search-item-price {
    text-align: right;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.pi-search-item-venda {
    display: block;
    font-size: 0.94rem;
    font-weight: 900;
    color: var(--azul-caixa);
}

.pi-search-item-custo {
    display: block;
    font-size: 0.69rem;
    font-weight: 700;
    color: #475569;
}

.pi-search-empty {
    padding: 16px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--texto-secundario);
}

/* Badges de Modalidade e Concurso Especial (padrão boloes_silce) */
.bolao-mod-badge {
    color: #ffffff;
    font-size: 0.67rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.25px;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.3;
}

.bolao-store-pill {
    background: #e0f2fe;
    color: #0369a1;
    font-size: 0.66rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 6px;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.25;
}

.pi-especial-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 800;
    color: #ffffff;
    white-space: nowrap;
}

.pi-tag-conciliacao {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 0.64rem;
    font-weight: 800;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
    white-space: nowrap;
}

.pi-tag-lock {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 800;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
    white-space: nowrap;
}

/* ── MONTADOR INLINE & CUSTO MANUAL ─────────────────────────────────────── */
.pi-fg-compact {
    margin-bottom: 0;
}

.pi-fg-compact label {
    font-size: 0.7rem;
    margin-bottom: 4px;
    color: var(--azul-caixa);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    display: block;
}

.pi-fg-compact .form-control {
    height: 38px;
    padding: 6px 10px;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 9px;
    box-sizing: border-box;
}

.pi-fg-end {
    display: flex;
    align-items: flex-end;
}

.pi-montador-box {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 2px 0 2px;
    margin-bottom: 8px;
}

.pi-manual-box {
    background: var(--fundo-sutil);
    border: 1px solid var(--borda);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 12px;
}

.pi-montador-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 8px;
}

.pi-builder-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    align-items: start;
}

.pi-dezenas-pair {
    display: contents;
}

.pi-montador-meta {
    margin-top: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #475569;
}

.pi-montador-status {
    margin-top: 6px;
    font-size: 0.79rem;
    font-weight: 800;
}

.pi-montador-status.ok {
    color: var(--sucesso);
}

.pi-montador-status.err {
    color: var(--perigo);
}

.pi-btn-sm-pill {
    padding: 8px 14px;
    font-size: 0.8rem;
    border-radius: 9px;
}

/* ── RODAPÉ & PREVIEW DO BOLÃO SELECIONADO ───────────────────────────────── */
.pi-composer-footer {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--borda-sutil);
}

.pi-preview-card {
    flex: 0 0 auto;
    width: 100%;
    box-sizing: border-box;
    background: var(--fundo-sutil);
    border: 1px solid var(--borda);
    border-left: 3px solid var(--azul-caixa);
    border-radius: 9px;
    padding: 7px 12px;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px 14px;
    flex-wrap: wrap;
}

.pi-preview-title {
    font-size: 0.88rem;
    font-weight: 900;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.pi-preview-metrics {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.8rem;
    color: #475569;
    font-variant-numeric: tabular-nums;
}

.pi-num-primary {
    color: var(--azul-caixa);
    font-size: 0.92rem;
    font-weight: 900;
}

.pi-preview-change-btn {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #475569;
    border-radius: 999px;
    padding: 2px 9px;
    font-size: 0.68rem;
    font-weight: 800;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
}

.pi-preview-change-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* ── BARRA DE LANÇAMENTO (QTD, DATA, VENDEDORA & CTA) ────────────────────── */
.pi-launch-bar {
    display: grid;
    grid-template-columns: 148px 160px minmax(200px, 280px);
    gap: 10px;
    align-items: start;
    margin-bottom: 12px;
}

.pi-qty-stepper {
    display: flex;
    align-items: stretch;
    gap: 5px;
    height: 38px;
}

.pi-step-btn {
    width: 36px;
    flex-shrink: 0;
    border: 1.5px solid #cbd5e1;
    border-radius: 9px;
    background: #f8fafc;
    color: var(--azul-caixa);
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.pi-step-btn:hover {
    background: #eff6ff;
    border-color: var(--azul-claro);
}

.pi-qty-input {
    width: 52px !important;
    flex: 0 0 52px;
    text-align: center;
    font-weight: 900 !important;
    font-variant-numeric: tabular-nums;
    padding: 5px 2px !important;
    height: 38px;
}

.pi-check-inline {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 0;
    font-size: 0.74rem;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
}

.pi-check-inline input {
    width: 15px;
    height: 15px;
    accent-color: var(--azul-acao);
    cursor: pointer;
}

.pi-submit-btn {
    flex: 0 0 auto;
    width: auto;
    min-width: 210px;
    height: 42px;
    padding: 0 22px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 800;
}

/* ── TOOLBAR COMPACTA DE FILTROS ────────────────────────────────────────── */
.pi-toolbar-controls {
    gap: 6px;
}

.pi-toolbar-search {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--fundo-sutil);
    border: 1.5px solid var(--borda);
    border-radius: 9px;
    padding: 0 9px;
    height: 32px;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.pi-toolbar-search:focus-within {
    border-color: var(--azul-claro);
    background: #ffffff;
}

.pi-toolbar-search i {
    color: #64748b;
    font-size: 0.74rem;
}

.pi-toolbar-input {
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--texto);
    width: 155px;
    min-width: 0;
}

.pi-toolbar-select,
.pi-toolbar-date {
    height: 32px;
    padding: 4px 10px;
    font-size: 0.74rem;
    font-weight: 700;
    border-radius: 9px;
    width: auto;
    min-width: 0;
    box-sizing: border-box;
}

.pi-toolbar-select {
    max-width: 210px;
    padding-right: 28px !important;
    background-position: right 9px center !important;
    background-size: 13px !important;
}

/* ── GAVETAS EXECUTIVAS (ACCORDION .mod-drawer ESTILO boloes_silce) ────── */
.mod-drawers-stack {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.mod-drawer {
    background: var(--fundo-card);
    border: 1px solid var(--borda);
    border-left: 5px solid var(--azul-caixa);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow 0.18s ease;
}

.mod-drawer:hover {
    box-shadow: var(--shadow-md);
}

.mod-drawer-header {
    width: 100%;
    box-sizing: border-box;
    background: #ffffff;
    border: none;
    padding: 10px 14px;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    text-align: left;
    font-family: inherit;
    transition: background 0.15s ease;
}

.mod-drawer-header:hover {
    background: #f8fafc;
}

.mod-drawer.open .mod-drawer-header {
    background: #f8fafc;
    border-bottom: 1px solid var(--borda-sutil);
}

.mod-drawer-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.mod-drawer-main {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1;
}

.mod-drawer-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.mod-drawer-title {
    font-size: 0.88rem;
    font-weight: 900;
    color: var(--azul-caixa);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.mod-drawer-sub-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 0.73rem;
    color: #475569;
    font-weight: 600;
}

.mod-drawer-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.mod-summary-pill {
    background: var(--fundo-sutil);
    border: 1px solid var(--borda-sutil);
    padding: 5px 10px;
    border-radius: 8px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.mod-summary-pill strong {
    display: block;
    font-size: 0.86rem;
    font-weight: 900;
    color: var(--azul-caixa);
    line-height: 1.15;
}

.mod-summary-pill span {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    color: #64748b;
}

.mod-chevron {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    transition: transform 0.2s ease, background 0.2s ease;
    flex-shrink: 0;
}

.mod-drawer.open .mod-chevron {
    transform: rotate(180deg);
    background: var(--azul-caixa);
    color: #ffffff;
}

.mod-drawer-body {
    padding: 10px 12px;
    background: #f8fafc;
    display: none;
}

.mod-drawer.open .mod-drawer-body {
    display: block;
}

.pi-slip-lines {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}

.pi-slip-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 7px;
    background: var(--fundo-sutil);
    border: 1px solid var(--borda-sutil);
    font-size: 0.77rem;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
}

.pi-slip-item strong {
    color: var(--azul-caixa);
    font-weight: 900;
}

.pi-slip-sub {
    color: #475569;
    font-size: 0.72rem;
    font-weight: 700;
}

.pi-slip-add-btn {
    height: 28px;
    padding: 0 9px;
    font-size: 0.7rem;
}

/* ── CARDS DE PEDIDO DENTRO DAS GAVETAS ─────────────────────────────────── */
.pi-orders-stack {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.pi-order-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    background: #ffffff;
    border: 1px solid var(--borda);
    border-left: 4px solid var(--azul-caixa);
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: box-shadow 0.15s ease;
}

.pi-order-row:hover {
    box-shadow: var(--shadow-sm);
}

.pi-order-row.no-check {
    grid-template-columns: minmax(0, 1fr) auto auto;
}

.pi-order-row.no-actions {
    grid-template-columns: auto minmax(0, 1fr) auto;
}

.pi-order-row.no-check.no-actions {
    grid-template-columns: minmax(0, 1fr) auto;
}

.pi-row-check input {
    width: 18px;
    height: 18px;
    accent-color: var(--azul-acao);
    cursor: pointer;
}

.pi-row-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pi-row-top {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.pi-row-bolao {
    font-size: 0.85rem;
    font-weight: 800;
    color: #0f172a;
}

.pi-row-sub {
    font-size: 0.72rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.pi-row-nums {
    text-align: right;
    font-variant-numeric: tabular-nums;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.pi-row-val-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
}

.pi-unit-sub {
    display: block;
    font-size: 0.67rem;
    font-weight: 700;
    color: #64748b;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}

.pi-row-boleto {
    font-size: 0.92rem;
    font-weight: 900;
    color: var(--azul-caixa);
}

.pi-row-qtd {
    font-size: 0.71rem;
    font-weight: 700;
    color: #475569;
}

.pi-row-actions {
    display: flex;
    align-items: center;
    gap: 5px;
}

.pi-empty-box {
    text-align: center;
    padding: 26px 14px;
    color: var(--texto-secundario);
    font-size: 0.84rem;
    font-weight: 600;
    background: var(--fundo-card);
    border-radius: 12px;
    border: 1px dashed var(--borda-forte);
}

/* ── PERNA 1: CARDS DE VENDEDORAS ───────────────────────────────────────── */
.pi-vendedoras-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(225px, 1fr));
    gap: 9px;
}

.pi-vend-card {
    background: var(--fundo-card);
    border: 1.5px solid var(--borda);
    border-radius: 12px;
    padding: 11px 13px;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    box-shadow: var(--shadow-sm);
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pi-vend-card:hover {
    border-color: var(--azul-claro);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.pi-vend-card.active {
    border-color: var(--azul-caixa);
    background: #f8fafc;
    box-shadow: 0 0 0 2px rgba(0, 54, 109, 0.12);
}

.pi-vend-card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.pi-vend-identity {
    flex: 1;
    min-width: 0;
}

.pi-vend-card-name {
    display: block;
    font-size: 0.88rem;
    font-weight: 900;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pi-vend-card-sub {
    display: block;
    font-size: 0.67rem;
    font-weight: 700;
    color: #64748b;
}

.pi-vend-hero {
    background: var(--fundo-sutil);
    border: 1px solid var(--borda-sutil);
    border-radius: 9px;
    padding: 7px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-variant-numeric: tabular-nums;
}

.pi-vend-hero span {
    font-size: 0.65rem;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
}

.pi-vend-hero strong {
    font-size: 0.98rem;
    font-weight: 900;
    color: #0f172a;
}

.pi-vend-hero strong.aberto { color: #b91c1c; }
.pi-vend-hero strong.emitido { color: #1d4ed8; }

.pi-vend-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px 8px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #475569;
    font-variant-numeric: tabular-nums;
}

.pi-vend-card-foot .cred {
    color: #b45309;
    font-weight: 800;
}

/* ── BARRAS DE BAIXA EM LOTE ────────────────────────────────────────────── */
.pi-batch-bar {
    position: sticky;
    top: 86px;
    z-index: 95;
    background: #00366D;
    color: #ffffff;
    border-radius: 12px;
    padding: 11px 14px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pi-batch-bar-p2 {
    background: #0f172a;
}

.pi-batch-info {
    font-size: 0.84rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.pi-batch-creditos {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 7px 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.76rem;
}

.pi-batch-creditos label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-weight: 700;
}

.pi-batch-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.pi-batch-input {
    flex: 1 1 130px;
    padding: 8px 10px !important;
    font-size: 0.84rem !important;
    border-color: rgba(255, 255, 255, 0.35) !important;
}

.pi-batch-btn {
    flex: 0 0 auto;
    width: auto;
    padding: 9px 18px;
    font-size: 0.85rem;
    background-color: var(--laranja-caixa);
    color: var(--azul-caixa);
    font-weight: 900;
}

.pi-batch-btn:hover:not(:disabled) {
    background-color: var(--laranja-hover);
}

/* ── HISTÓRICO / ACORDEÕES & CONFIG ─────────────────────────────────────── */
.pi-accordions-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pi-details-summary {
    cursor: pointer;
    font-weight: 800;
    font-size: 0.88rem;
    color: var(--azul-caixa);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    list-style: none;
}

.pi-details-body {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pi-cfg-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pi-cfg-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px 12px;
    border: 1px solid var(--borda-sutil);
    border-radius: 10px;
    background: var(--fundo-sutil);
}

.pi-checks-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 4px;
}

.pi-setup-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    background: #fffbeb;
    border: 1.5px solid #f59e0b;
    border-radius: 12px;
    padding: 10px 14px;
    color: #92400e;
    font-size: 0.84rem;
    font-weight: 700;
}

.pi-cfg-section {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--borda-sutil);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pi-cfg-section:last-of-type {
    padding-bottom: 0;
    border-bottom: none;
}

.pi-ext-form-row {
    display: grid;
    grid-template-columns: 1fr 90px auto;
    gap: 6px;
    align-items: center;
}

.pi-cfg-pct-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 800;
    color: #475569;
}

.pi-cfg-pct-input {
    width: 74px !important;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.pi-admin-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--azul-claro);
    text-decoration: none;
    align-self: flex-start;
}

.pi-admin-link:hover {
    text-decoration: underline;
    color: var(--azul-caixa);
}

.pi-extra-users-bar {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.pi-extra-users-bar .form-control {
    flex: 1 1 180px;
    min-width: 0;
}

.pi-extra-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.pi-extra-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e3a8a;
    font-size: 0.76rem;
    font-weight: 700;
}

.pi-extra-chip button {
    background: transparent;
    border: none;
    color: #dc2626;
    cursor: pointer;
    padding: 0 2px;
    font-size: 0.82rem;
    line-height: 1;
}

/* ── MODAIS ESPECÍFICOS ─────────────────────────────────────────────────── */
.pi-modal-lg {
    max-width: 560px;
}

.pi-modal-title {
    margin: 0;
    font-size: 1.06rem;
    font-weight: 900;
    color: var(--azul-caixa);
    display: flex;
    align-items: center;
    gap: 8px;
}

.pi-modal-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pi-modal-2col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.pi-modal-3col {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.mod-sub-sep {
    color: #94a3b8;
    font-size: 0.68rem;
}

.pi-details {
    margin-bottom: 0;
}

.pi-queue-header {
    padding-top: 4px;
}

.pi-search-item.kbd-active {
    background: #dbeafe;
    outline: 2px solid var(--azul-claro);
    outline-offset: -2px;
}

.pi-sim-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 800;
    background: #fef3c7;
    color: #92400e;
    margin-left: 6px;
    text-transform: uppercase;
}

.pi-order-row.is-estornado {
    opacity: 0.72;
    background: #f8fafc;
}

.pi-order-row .btn-icon {
    min-width: 34px;
    min-height: 34px;
    border-radius: 8px;
    border: 1px solid var(--borda-sutil);
    background: #f8fafc;
}

.pi-order-row .btn-icon:hover {
    background: #ffffff;
    border-color: var(--azul-claro);
}

/* Impede auto-zoom no iOS/iPadOS Safari/WebKit ao focar inputs (inclusive tablets > 768px) */
@supports (-webkit-touch-callout: none) {
    .pi-container input:not([type="checkbox"]):not([type="radio"]),
    .pi-container select,
    .hub-modal-content input:not([type="checkbox"]):not([type="radio"]),
    .hub-modal-content select {
        font-size: 16px !important;
        line-height: 1.25 !important;
        min-height: 38px;
        height: auto;
    }
}

@media (pointer: coarse) {
    .pi-clear-btn {
        width: 32px;
        height: 32px;
    }
    .pi-slip-add-btn,
    .pi-slip-pay-btn,
    .pi-slip-reopen-btn {
        min-height: 34px;
        height: auto;
        padding: 5px 10px;
    }
    .pi-sheet-actions .btn-icon {
        min-width: 34px;
        min-height: 34px;
        width: 34px;
        height: 34px;
    }
    .pi-inline-stepper,
    .pi-inline-stepper-card {
        height: 34px;
    }
    .pi-inline-step-btn,
    .pi-inline-stepper-card .pi-inline-step-btn {
        width: 34px;
    }
}

@media (max-width: 920px) {
    .pi-launch-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .pi-container {
        padding: 9px 10px;
        gap: 10px;
    }

    .pi-nav-tab {
        padding: 8px 4px;
        font-size: 0.7rem;
        gap: 4px;
        min-height: 38px;
        letter-spacing: -0.015em;
    }

    .pi-nav-tab .nav-pill {
        display: none;
    }

    .pi-composer-head-actions {
        width: auto;
        justify-content: flex-end;
    }

    .pi-quick-search-wrap {
        width: 100%;
        max-width: 100%;
        flex: 1 1 100%;
    }

    .pi-search-results {
        left: 0;
        right: 0;
        width: 100%;
        min-width: 0;
    }

    /* Zero scroll lateral no mobile: grid de 3 colunas igual boloes_silce */
    .radar-modalidades-row {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 5px;
    }

    .radar-modalidades-row .filter-chip {
        justify-content: center;
        padding: 5px 5px;
        font-size: 0.64rem;
        gap: 4px;
        letter-spacing: -0.01em;
        width: 100%;
        min-height: 30px;
        box-sizing: border-box;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .filters-group.status-pills-row {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
        gap: 5px;
    }

    .filters-group.status-pills-row.has-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filters-group.status-pills-row .filter-chip {
        width: 100%;
        justify-content: center;
        padding: 5px 6px;
        font-size: 0.69rem;
        min-height: 32px;
    }

    .pi-batch-bar {
        top: max(8px, env(safe-area-inset-top, 0px));
    }

    .pi-toolbar-controls {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .pi-toolbar-search {
        grid-column: 1 / -1;
        width: 100%;
        min-height: 38px;
        height: auto;
        padding: 4px 10px;
    }

    .pi-toolbar-input {
        width: 100%;
    }

    .pi-toolbar-select,
    .pi-toolbar-date {
        width: 100% !important;
        max-width: 100% !important;
        min-height: 38px !important;
        height: auto !important;
        padding: 6px 10px !important;
        line-height: 1.25 !important;
    }

    .pi-toolbar-select {
        padding-right: 28px !important;
    }

    .pi-toolbar-date {
        grid-column: 1 / -1;
    }

    .mod-drawer-header {
        padding: 10px 11px;
        gap: 8px;
    }
}

@media (max-width: 640px) {
    .pi-hide-xs {
        display: none;
    }

    .pi-kpis-3 {
        grid-template-columns: 1fr;
    }

    .pi-launch-bar {
        grid-template-columns: 1fr;
    }

    .pi-composer-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .pi-preview-card {
        flex: 0 0 auto;
        width: 100%;
        box-sizing: border-box;
    }

    .pi-composer-footer .pi-submit-btn {
        margin-left: 0;
        width: auto;
        flex: 1 1 auto;
    }

    .pi-order-row {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 7px 8px;
    }

    .pi-order-row:not(.no-check) .pi-row-main {
        grid-column: 2 / -1;
    }

    .pi-order-row.no-actions {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .pi-order-row.no-check {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .pi-order-row.no-check .pi-row-main {
        grid-column: 1 / -1;
    }

    .pi-order-row.no-check.no-actions {
        grid-template-columns: minmax(0, 1fr);
    }

    .pi-row-nums {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        border-top: 1px solid var(--borda-sutil);
        padding-top: 6px;
    }

    .pi-row-nums .pi-row-val-stack {
        align-items: flex-start;
    }

    .pi-order-row:not(.no-actions) .pi-row-nums {
        grid-column: 1 / -2;
    }

    .pi-row-actions {
        grid-column: -2 / -1;
        justify-content: flex-end;
        align-self: stretch;
        border-top: 1px solid var(--borda-sutil);
        padding-top: 6px;
        margin-left: -8px;
        padding-left: 8px;
    }

    .pi-modal-2col,
    .pi-modal-3col,
    .pi-ext-form-row {
        grid-template-columns: 1fr;
    }
}

/* ── COMPOSITOR STICKY, BUSCA PROTAGONISTA & PLANILHA ADMIN (v20261122-v11) ─ */
.pi-head-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pi-lote-sticky-hint {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--azul-caixa);
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    padding: 2px 9px;
    border-radius: 999px;
    white-space: nowrap;
}

.pi-lock-pill {
    font-size: 0.6rem;
    font-weight: 800;
    color: #047857;
    background: #dcfce7;
    border: 1px solid #86efac;
    padding: 1px 6px;
    border-radius: 999px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.pi-batch-context-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: flex-end;
    margin-bottom: 10px;
}

.pi-batch-context-row .pi-fg-date {
    flex: 0 1 168px;
    min-width: 132px;
}

.pi-batch-context-row .pi-fg-vend {
    flex: 1 1 200px;
    min-width: 0;
}

.pi-batch-context-row .pi-fg-compact label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

#pi-data-pedido.is-pending-date {
    border: 1.5px dashed var(--laranja-caixa);
    background: #fffbeb;
    color: #92400e;
}

/* ── MONTADOR 3 CAMPOS + VALOR AUTOMÁTICO ─────────────────────────────────── */
.pi-bolao-inputs-grid {
    display: grid;
    gap: 8px;
    align-items: end;
}

.pi-bolao-3col {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pi-bolao-4col {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pi-bolao-inputs-grid .form-control {
    height: 42px;
    text-align: center;
    font-size: 0.96rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    border: 1.5px solid var(--borda-forte);
    border-radius: 9px;
    outline: none;
    background: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pi-bolao-inputs-grid .form-control:focus {
    border-color: var(--azul-acao);
    box-shadow: 0 0 0 3px rgba(0, 92, 169, 0.14);
}

.pi-bolao-inputs-grid .form-control[readonly] {
    background: #f1f5f9;
    color: #475569;
    cursor: default;
}

.pi-range-hint {
    font-size: 0.63rem;
    font-weight: 700;
    color: #64748b;
    text-transform: none;
    letter-spacing: 0;
}

.pi-cota-auto-banner {
    margin-top: 9px;
    padding: 9px 12px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px 10px;
    flex-wrap: wrap;
    font-size: 0.78rem;
}

.pi-cota-auto-banner.idle {
    background: var(--fundo-sutil);
    border: 1px dashed var(--borda-forte);
    color: var(--texto-secundario);
    justify-content: flex-start;
}

.pi-cota-auto-banner.invalid {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    font-weight: 700;
    justify-content: flex-start;
}

.pi-cota-auto-banner.valid {
    background: #ecfdf5;
    border: 1.5px solid #6ee7b7;
    color: #065f46;
}

.pi-cota-auto-left {
    display: inline-flex;
    align-items: baseline;
    gap: 7px;
    flex-wrap: wrap;
}

.pi-cota-auto-lbl {
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.pi-cota-auto-val {
    font-size: 1.12rem;
    font-weight: 900;
    color: #047857;
    font-variant-numeric: tabular-nums;
}

.pi-cota-auto-meta {
    font-size: 0.74rem;
    font-weight: 700;
    color: #065f46;
}

.pi-footer-submit-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    flex-wrap: wrap;
}

.pi-qty-inline-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.pi-qty-lbl {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--azul-caixa);
}

.pi-footer-submit-row .pi-submit-btn {
    flex: 1 1 172px;
    min-width: 0;
    width: auto;
    min-height: 42px;
    height: auto;
    padding: 9px 14px;
    font-size: 0.86rem;
    white-space: nowrap;
    margin-left: 0;
}

.pi-esp-divider {
    display: inline-block;
    width: 1px;
    height: 22px;
    background: var(--borda-forte);
    margin: 0 3px;
    flex-shrink: 0;
}

.pi-esp-star {
    font-size: 0.68rem;
    color: var(--laranja-caixa);
    margin-right: 1px;
}

.filter-chip.active .pi-esp-star {
    color: #ffffff;
}

/* ── PLANILHA POR DIA ADMIN & STEPPER INLINE −/+ ─────────────────────────── */
.pi-sheet-wrap {
    background: var(--fundo-card);
    border: 1px solid var(--borda);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.pi-day-sheet-wrap {
    border: 1px solid var(--borda-sutil);
    border-radius: 10px;
    box-shadow: none;
}

.pi-sheet-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 480px;
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
}

.pi-sheet-table thead th {
    background: #f8fafc;
    color: #475569;
    font-size: 0.67rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    text-align: left;
    padding: 8px;
    border-bottom: 1.5px solid var(--borda-sutil);
    white-space: nowrap;
}

.pi-th-center,
.pi-td-qty {
    text-align: center;
    white-space: nowrap;
}

.pi-th-num,
.pi-cell-num {
    text-align: right;
    white-space: nowrap;
}

.pi-th-actions,
.pi-td-actions {
    text-align: right;
    width: 44px;
    white-space: nowrap;
}

.pi-td-vend {
    padding-left: 8px !important;
}

.pi-vend-locked {
    display: inline-block;
    font-size: 0.76rem;
    font-weight: 800;
    color: #334155;
    padding: 4px 2px;
    white-space: nowrap;
}

.pi-locked-qty {
    display: inline-block;
    font-size: 0.76rem;
    font-weight: 800;
    color: #475569;
}

.pi-inline-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--borda-forte);
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
    height: 30px;
}

.pi-inline-stepper-card {
    height: 30px;
}

.pi-inline-step-btn {
    appearance: none;
    border: none;
    background: var(--fundo-sutil);
    color: var(--azul-caixa);
    width: 28px;
    height: 100%;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    transition: background 0.14s ease;
}

.pi-inline-stepper-card .pi-inline-step-btn {
    width: 28px;
}

.pi-inline-step-btn:hover:not(:disabled) {
    background: #e2e8f0;
}

.pi-inline-step-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.pi-inline-qty-val {
    min-width: 26px;
    padding: 0 5px;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 900;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
}

.pi-inline-stepper-card .pi-inline-qty-val {
    min-width: 22px;
    font-size: 0.74rem;
}

.pi-sheet-table tbody tr {
    border-bottom: 1px solid var(--borda-sutil);
    transition: background 0.12s ease;
}

.pi-sheet-table tbody tr:hover {
    background: #f8fafc;
}

.pi-sheet-table tbody tr.is-estornado {
    background: #fffbeb;
    opacity: 0.85;
}

.pi-sheet-table tbody td {
    padding: 6px 7px;
    vertical-align: middle;
}

.pi-sheet-table tfoot td {
    background: #f1f5f9;
    border-top: 2px solid var(--borda-forte);
    padding: 9px 8px;
    font-size: 0.78rem;
    color: #0f172a;
    white-space: nowrap;
}

.pi-sheet-bolao-cell {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: nowrap;
    min-width: 140px;
    max-width: 280px;
}

.pi-sheet-bolao-txt {
    font-weight: 700;
    color: #0f172a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pi-pill-xs {
    padding: 1px 6px;
    font-size: 0.6rem;
}

.pi-badge-xs {
    font-size: 0.62rem;
    padding: 2px 6px;
}

.pi-cell-input {
    font-family: inherit;
    font-size: 0.76rem;
    font-weight: 700;
    color: #0f172a;
    background: #ffffff;
    border: 1px solid var(--borda-sutil);
    border-radius: 7px;
    padding: 4px 6px;
    height: 30px;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pi-cell-input:hover:not(:disabled) {
    border-color: #94a3b8;
}

.pi-cell-input:focus {
    outline: none;
    border-color: var(--azul-acao);
    box-shadow: 0 0 0 2px rgba(0, 92, 169, 0.15);
}

.pi-cell-input:disabled {
    background: #f1f5f9;
    color: #64748b;
    cursor: not-allowed;
    border-color: transparent;
}

.pi-cell-select {
    width: 124px;
    min-width: 112px;
    cursor: pointer;
}

.pi-cell-money {
    width: 72px;
    text-align: right;
}

.pi-cell-money.is-adjusted {
    border-color: var(--laranja-caixa);
    background: #fff7ed;
    color: #9a3412;
}

.pi-status-toggle {
    appearance: none;
    font-family: inherit;
    border-radius: 999px;
    font-size: 0.69rem;
    font-weight: 800;
    padding: 4px 9px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.pi-status-toggle.open {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.pi-status-toggle.open:hover {
    background: #fef3c7;
    border-color: var(--laranja-caixa);
}

.pi-status-toggle.paid {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.pi-status-toggle.paid:hover {
    background: #bbf7d0;
}

.pi-num-pos {
    color: #047857;
    font-weight: 800;
}

.pi-num-neg {
    color: #b91c1c;
    font-weight: 800;
}

.pi-sheet-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.pi-sheet-actions .btn-icon {
    min-width: 28px;
    min-height: 28px;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 7px;
    border: 1px solid var(--borda-sutil);
    background: #f8fafc;
    font-size: 0.72rem;
}

/* ── FORNECEDOR: EDIÇÃO INLINE, QUITAR DIA & FALTANTE RÁPIDO ────────────── */
.pi-p2-custo-inline-wrap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #475569;
}

.pi-slip-pay-btn {
    height: 28px;
    padding: 0 9px;
    font-size: 0.7rem;
    background: #ecfdf5;
    border-color: #6ee7b7;
    color: #047857;
}

.pi-slip-pay-btn:hover {
    background: #d1fae5;
    border-color: #059669;
    color: #065f46;
}

.pi-slip-reopen-btn {
    height: 28px;
    padding: 0 9px;
    font-size: 0.7rem;
    background: #f8fafc;
    border-color: var(--borda-forte);
    color: #475569;
}

.pi-slip-reopen-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
}

.pi-day-paid-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.68rem;
    padding: 3px 8px;
    white-space: nowrap;
}

.pi-p2-item-row {
    background: #fcfdff;
}

.pi-p2-quick-add {
    border: 1px solid #93c5fd;
    border-left: 4px solid var(--azul-caixa);
    background: #f8fafc;
}

.pi-qa-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 0.85rem;
    color: var(--azul-caixa);
}

.pi-qa-grid {
    display: grid;
    grid-template-columns: minmax(145px, 165px) minmax(175px, 1.4fr) minmax(120px, 1fr) minmax(82px, 95px) auto;
    gap: 10px;
    align-items: end;
}

.pi-qa-submit-btn {
    width: auto;
    min-height: 38px;
    height: 38px;
    padding: 0 16px;
    border-radius: 9px;
    font-size: 0.82rem;
    font-weight: 800;
    white-space: nowrap;
}

.pi-qa-preview {
    margin-top: 10px;
    padding: 8px 11px;
    border-radius: 9px;
    background: #ffffff;
    border: 1px solid var(--borda-sutil);
    font-size: 0.75rem;
    color: #1e293b;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

    .pi-qa-matches {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

/* ── MULTI-BOLETOS EMITIDOS & STATUS INTERMEDIÁRIO ────────────────────────── */
.pi-badge-issued {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #93c5fd;
}

.pi-vend-card-foot .issued-foot {
    color: #1d4ed8;
    font-weight: 800;
}

.pi-batch-btn-secondary {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.36);
    color: #ffffff;
}

.pi-batch-btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.24);
    border-color: #ffffff;
    color: #ffffff;
}

.pi-emitted-panel {
    border: 1px solid #93c5fd;
    border-left: 4px solid #1d4ed8;
    background: #f8fafc;
}

.pi-emitted-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.pi-emitted-total {
    font-size: 1.02rem;
    font-weight: 900;
    color: #1d4ed8;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.pi-emitted-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pi-emitted-card {
    background: #ffffff;
    border: 1px solid var(--borda-sutil);
    border-radius: 10px;
    padding: 11px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    flex-wrap: wrap;
}

.pi-emitted-main {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1 1 260px;
    min-width: 0;
}

.pi-emitted-top {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.85rem;
}

.pi-emitted-val {
    font-weight: 900;
    color: #1d4ed8;
    font-variant-numeric: tabular-nums;
}

.pi-emitted-items {
    font-size: 0.72rem;
    font-weight: 600;
    color: #475569;
}

.pi-emitted-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    flex-wrap: nowrap;
    flex: 0 0 auto;
}

.pi-comp-meio {
    width: auto !important;
    min-width: 116px;
    min-height: 36px;
    height: 36px;
    padding: 4px 28px 4px 10px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    flex: 0 0 auto;
}

.pi-comp-date {
    width: 138px !important;
    min-height: 36px;
    height: 36px;
    padding: 4px 9px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    flex: 0 0 auto;
}

.pi-btn-comp {
    width: auto;
    flex: 0 0 auto;
    min-height: 36px;
    height: 36px;
    padding: 0 14px;
    border-radius: 8px;
    font-size: 0.79rem;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: none;
}

.pi-emitted-actions .btn-icon,
.pi-cfg-row .btn-icon {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
    border-radius: 8px;
    border: 1px solid var(--borda);
    background: #f8fafc;
    color: #475569;
    font-size: 0.82rem;
    cursor: pointer;
    flex: 0 0 36px;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.pi-emitted-actions .btn-icon:hover,
.pi-cfg-row .btn-icon:hover {
    background: #ffffff;
    border-color: var(--azul-claro);
    color: var(--azul-caixa);
}

.pi-emitted-actions .btn-icon.danger,
.pi-cfg-row .btn-icon.danger {
    color: #dc2626;
}

.pi-emitted-actions .btn-icon.danger:hover,
.pi-cfg-row .btn-icon.danger:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #b91c1c;
}

.pi-qa-matches-lbl {
    font-size: 0.71rem;
    font-weight: 800;
    color: #475569;
    margin-right: 2px;
}

@media (max-width: 920px) {
    .pi-qa-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pi-qa-grid .pi-fg-end {
        grid-column: 1 / -1;
    }

    .pi-qa-submit-btn {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .pi-esp-divider {
        grid-column: 1 / -1;
        width: 100%;
        height: 1px;
        margin: 2px 0;
    }

    .pi-emitted-actions {
        width: 100%;
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .pi-comp-meio,
    .pi-comp-date {
        width: auto !important;
        flex: 1 1 128px;
    }

    .pi-btn-comp {
        flex: 1 1 140px;
    }
}

@media (max-width: 640px) {
    .pi-qa-grid {
        grid-template-columns: 1fr;
    }

    .pi-bolao-4col {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* Planilha Admin dentro da gaveta vira cards responsivos sem scroll horizontal */
    .pi-day-sheet-wrap {
        overflow-x: visible;
        border: none;
        background: transparent;
        border-radius: 0;
    }

    .pi-day-sheet-wrap .pi-sheet-table {
        display: block;
        min-width: 0;
    }

    .pi-day-sheet-wrap .pi-sheet-table thead {
        display: none;
    }

    .pi-day-sheet-wrap .pi-sheet-table tbody {
        display: flex;
        flex-direction: column;
        gap: 7px;
    }

    .pi-day-sheet-wrap .pi-sheet-table tbody tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto;
        grid-template-areas:
            "vend status status"
            "bolao bolao bolao"
            "num qty act";
        align-items: center;
        gap: 6px 8px;
        background: #ffffff;
        border: 1px solid var(--borda);
        border-left: 4px solid var(--row-accent, var(--azul-caixa));
        border-radius: 10px;
        padding: 8px 10px;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    }

    .pi-day-sheet-wrap .pi-sheet-table tbody td {
        padding: 0;
        border: none !important;
    }

    .pi-day-sheet-wrap .pi-td-vend {
        grid-area: vend;
        padding-left: 0 !important;
        min-width: 0;
    }

    .pi-day-sheet-wrap .pi-td-vend .pi-cell-select {
        width: 100%;
        max-width: 190px;
        min-width: 0;
    }

    .pi-day-sheet-wrap .pi-td-status {
        grid-area: status;
        text-align: right;
    }

    .pi-day-sheet-wrap .pi-td-bolao {
        grid-area: bolao;
        min-width: 0;
    }

    .pi-day-sheet-wrap .pi-sheet-bolao-cell {
        min-width: 0;
        max-width: none;
        flex-wrap: wrap;
    }

    .pi-day-sheet-wrap .pi-sheet-bolao-txt {
        white-space: normal;
    }

    .pi-day-sheet-wrap .pi-cell-num {
        grid-area: num;
        text-align: left;
        border-top: 1px solid var(--borda-sutil);
        padding-top: 6px !important;
        align-self: stretch;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .pi-day-sheet-wrap .pi-td-qty {
        grid-area: qty;
        border-top: 1px solid var(--borda-sutil);
        padding-top: 6px !important;
        margin-left: -8px;
        padding-left: 8px !important;
        align-self: stretch;
        display: flex;
        align-items: center;
    }

    .pi-day-sheet-wrap .pi-td-actions {
        grid-area: act;
        width: auto;
        border-top: 1px solid var(--borda-sutil);
        padding-top: 6px !important;
        margin-left: -8px;
        padding-left: 8px !important;
        align-self: stretch;
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }

    .pi-inline-stepper,
    .pi-inline-stepper-card {
        height: 32px;
    }

    .pi-inline-step-btn,
    .pi-inline-stepper-card .pi-inline-step-btn {
        width: 30px;
    }
}

@media (max-width: 359px) {
    .pi-batch-context-row {
        flex-wrap: wrap;
    }

    .pi-batch-context-row .pi-fg-date,
    .pi-batch-context-row .pi-fg-vend {
        flex: 1 1 100%;
    }
}
