/* =========================================================
   X-DELIVERY - AJUSTE VISUAL BASE PAINEL LOJA
   Layout estrutural: loja-painel.css
   Componentes do painel da loja: loja-painel.css
========================================================= */

/* =========================================================
   CHECKLIST DE RESPONSIVIDADE
========================================================= */
/* 
   [✓] Desktop (>1280px): Layout completo com sidebar + painel
   [✓] Tablet (860px-1280px): Menu mobile, ajustes de grid
   [✓] Mobile (<860px): Single column, touch-friendly, menu drawer
   
   Media Queries implementadas:
   - @media (max-width: 1280px) - Grandes tablets
   - @media (max-width: 1200px) - Ajustes tablets
   - @media (max-width: 1100px) - Tablet horizontal
   - @media (max-width: 1024px) - Tablet
   - @media (max-width: 900px) - Desktop pequeno / tablet grande
   - @media (max-width: 860px) - Tablet / mobile
   - @media (max-width: 768px) - Mobile vertical
   - @media (max-width: 600px) - Mobile pequeno
   
   Componentes Responsivos:
   [✓] Navbar (flex-wrap, responsive padding)
   [✓] Sidebar (hidden no mobile, drawer ativo)
   [✓] Tables (overflow-x auto, labels via ::before)
   [✓] Grids (auto-fill, minmax responsive)
   [✓] Cards (flex, width 100%, max-width controles)
   [✓] Modals (calc() para altura/largura dinâmica)
   [✓] Menu (drawer lateral no mobile)
   [✓] Fonts (12px-16px base, escalas)
   [✓] Spacing (rem/em baseado em 16px)
   [✓] Padding/Margins (ajustados por breakpoint)
   
   Verificação:
   [✓] Sem scroll horizontal em mobile
   [✓] Touch targets >= 44px (recomendado)
   [✓] Safe-area-inset usado para notch
   [✓] Overflow-x:hidden em body
   [✓] Box-sizing: border-box em tudo
*/
* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: Inter, Arial, Helvetica, sans-serif;
    color: #0f172a;
    background: #f4f7f9;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

body {
    overflow-x: hidden;
}

.loja-main {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.table-container {
    width: 100%;
    overflow-x: auto;
} 

.table-res {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.table-res th,
.table-res td {
    white-space: nowrap;
}

#aba-operacional .box-branca {
    overflow: hidden;
}

@media (max-width: 900px) {
    .loja-layout {
        flex-direction: column;
    }
    .loja-topbar {
        flex-wrap: wrap;
        height: auto;
        padding: 10px;
        gap: 10px;
    }
    .loja-nav {
        overflow-x: auto;
        flex-wrap: nowrap;
    }
}

body {
    background: #f4f7f9;
}

.loja-layout {
    display: flex;
    flex-direction: row;
    min-height: 100vh;
    width: 100%;
}

.painel-header-nav {
    position: sticky;
    top: 0;
    left: auto;
    right: auto;
    height: auto;
    min-height: var(--header-h, 70px);
    background: #ffffff !important;
    border-radius: 16px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    z-index: 100;
    flex-shrink: 0;
}

@media (max-width: 900px) {
    .painel-header-nav {
        flex-wrap: wrap;
        height: auto;
        padding: 14px;
        gap: 14px;
    }
}

.topbar-brand {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 15px !important;
    position: relative !important;
}

.header-brand-loja {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 1 auto;
    min-width: 0;
    max-width: min(280px, 32vw);
    padding-right: 14px;
    margin-right: 4px;
    border-right: 1px solid #e2e8f0;
}

.header-brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    min-width: 0;
    gap: 2px;
}

.loja-perfil-media-top {
    position: relative;
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    padding: 3px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
    overflow: hidden;
    box-sizing: border-box;
}

.loja-perfil-media-top img,
#fotoPerfil {
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 9px !important;
    object-fit: cover !important;
    border: none !important;
    background: #fff !important;
    box-shadow: none !important;
    margin: 0 !important;
    display: block !important;
}

.loja-status-toggle-top input {
    display: none;
}

/* Status ON/OFF no header (ao lado de Sair) */
.loja-status-toggle-header {
    position: static;
    flex-shrink: 0;
}

.loja-status-toggle-header label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: auto;
    height: 38px;
    margin: 0;
    padding: 0 14px 0 12px;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1;
    box-shadow: none;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    user-select: none;
}

.loja-status-toggle-header input:not(:checked) + label {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.loja-status-toggle-header input:checked + label {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #047857;
}

.loja-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
}

.loja-status-toggle-header input:not(:checked) + label .loja-status-dot {
    background: #ef4444;
}

.loja-status-toggle-header input:checked + label .loja-status-dot {
    background: #10b981;
}

.loja-status-toggle-header input:checked + label .loja-status-text-off,
.loja-status-toggle-header input:not(:checked) + label .loja-status-text-on {
    display: none;
}

.painel-header-nav .header-brand-text .topbar-nome,
.painel-header-nav .header-brand-text #nomeFantasia {
    display: block !important;
    width: 100%;
    max-width: 100% !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px !important;
    font-weight: 900 !important;
    color: #0f172a !important;
    letter-spacing: 0.02em;
}

.topbar-loja-info {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: flex-start !important;
    text-align: left !important;
}

.topbar-nome,
#nomeFantasia {
    font-size: 15px !important;
    font-weight: 800 !important;
    color: #1e293b !important;
    text-transform: uppercase !important;
    line-height: 1.2 !important;
    max-width: none !important;
    margin: 0 !important;
    text-shadow: none !important;
}

.topbar-saldo {
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
}

.topbar-saldo strong {
    color: #10b981;
    font-weight: 800;
}

.topbar-relogio,
#relogioLoja {
    display: block !important;
    font-size: 12px !important;
    color: #3b82f6 !important;
    font-family: 'Courier New', Courier, monospace !important;
    font-weight: 800 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
    text-shadow: none !important;
    text-align: left !important;
    line-height: 1.2 !important;
}

.loja-nav {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    background: #f8fafc;
    padding: 6px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.loja-nav button {
    border: none;
    background: transparent;
    color: #64748b;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.loja-nav button:hover {
    color: #0f172a;
    background: rgba(15, 23, 42, 0.05);
}

.loja-nav button.active {
    background: #3b82f6 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3) !important;
}

.loja-nav button.active .icon-menu {
    color: #ffffff !important;
}

/* Move map controls to the right side below the header */
.leaflet-top.leaflet-left {
    left: auto !important;
    right: 35px !important;
    top: 90px !important;
    margin-top: 0 !important;
}

.loja-nav button .icon-menu {
    font-size: 16px !important;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.btn-sair-loja-top {
    border: none;
    background: #fee2e2;
    color: #ef4444;
    padding: 0 14px;
    height: 38px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: .2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-install-app-top {
    background: #eff6ff !important;
    color: #1d4ed8 !important;
}

.btn-sair-loja-top:hover {
    background: #fca5a5;
    color: #b91c1c;
}

.loja-nav button .chat-badge {
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px rgba(17, 24, 39, 0.35);
}

.loja-nav button:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.loja-nav button.active {
    background: #1e293b; /* Dark grey background */
    color: #fff;
}

.loja-nav button.active .icon-menu {
    color: #facc15; /* cone amarelo quando ativo */
}

.loja-nav button .icon-menu {
    color: #22c55e; /* cone verde por padrão */
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.loja-sidebar-footer {
    padding: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-sair-loja {
    width: 100%;
    border: none;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
}
.btn-sair-loja .icon-menu {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.loja-main {
    flex: 1;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.global-map {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    border-radius: 0;
    border: none;
}

.global-map #map {
    width: 100%;
    height: 100%;
    min-height: 100%;
}

.painel-section {
    display: none;
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    z-index: 5;
    overflow-x: hidden;
    overflow-y: auto;
    background: #f4f7f9 !important;
    padding: 24px;
    border-radius: 0;
    box-shadow: none;
    box-sizing: border-box;
}

/* Chat como popup flutuante no canto inferior esquerdo */

#aba-chat {
    position: fixed !important;
    top: auto !important;
    bottom: 20px !important;
    left: calc(var(--loja-sidebar-w, 0px) + 16px) !important;
    right: auto !important;
    width: min(400px, calc(100vw - 32px)) !important;
    height: min(560px, calc(100vh - 90px)) !important;
    max-height: calc(100vh - 90px) !important;
    max-width: calc(100vw - 32px) !important;
    padding: 0 !important;
    overflow: hidden !important;
    display: none;
    flex-direction: column;
    z-index: 10000 !important;
}
#aba-chat.active {
    display: flex !important;
}
#aba-chat .wa-chat-admin-theme {
    flex: 1;
    height: 100%;
}

/* Forar comportamento mobile (lista ou conversa) dentro do popup pequeno */
#aba-chat .wa-admin-chat .wa-sidebar {
    width: 100% !important;
    max-width: none !important;
}
#aba-chat .wa-admin-chat .wa-main {
    display: none !important;
    width: 100% !important;
}
#aba-chat .wa-admin-chat.wa-mobile-show-chat .wa-sidebar {
    display: none !important;
}
#aba-chat .wa-admin-chat.wa-mobile-show-chat .wa-main {
    display: flex !important;
}
#aba-chat .wa-btn-back {
    display: flex !important;
}

.painel-section.active {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    animation: slideUp 0.35s ease;
}

#aba-operacional.painel-section {
    background: transparent;
    backdrop-filter: none;
    pointer-events: none;
    padding: 0;
}

#aba-operacional.painel-section > * {
    pointer-events: auto;
}

.card-hero,
.card-mini-info,
.box-branca {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    box-shadow: 0 8px 25px rgba(15, 23, 42, 0.05);
}

.card-hero {
    padding: 22px;
}

.card-hero h1 {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.8px;
}

.card-hero p { 
    margin: 0;
    color: #6b7280;
    line-height: 1.5;
}

.mini-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 18px;
}

.mini-kpi {
    padding: 16px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.mini-kpi small {
    display: block;
    color: #6b7280;
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 6px;
}

.mini-kpi strong {
    font-size: 22px;
    color: #111827;
}

.section-title-loja {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 18px;
}

.section-title-loja h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.6px;
}

.section-title-loja p {
    margin: 4px 0 0;
    color: #6b7280;
    font-size: 14px;
}

.toolbar-busca {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    align-items: end;
}

.toolbar-busca .campo {
    min-width: 180px;
    flex: 1;
}

.toolbar-busca label,
.campo-inline label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    color: #111827;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.btn-acao {
    border: none;
    border-radius: 12px;
    padding: 13px 16px;
    font-weight: 800;
    cursor: pointer;
    transition: .2s;
}

.btn-acao:hover {
    transform: translateY(-1px);
}

.btn-primario {
    background: #00d166;
    color: #111827;
}

.btn-secundario {
    background: #111827;
    color: #fff;
}

.btn-neutro {
    background: #e5e7eb;
    color: #111827;
}

.btn-alerta {
    background: #ef4444;
    color: #fff;
}

.subtabs-loja {
    display: inline-flex;
    gap: 6px;
    padding: 5px;
    background: #e2e8f0;
    border-radius: 14px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.subtabs-loja button {
    border: none;
    background: transparent;
    color: #64748b;
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
}

.subtabs-loja button.active {
    background: #fff;
    color: #111827;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.subtab-content {
    display: none;
}

.subtab-content.active {
    display: block;
}

.box-branca {
    padding: 18px;
    margin-bottom: 22px;
}

#aba-operacional > .box-branca {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 450px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(8px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 16px;
}

@media (max-width: 768px) {
    #aba-operacional > .box-branca {
        width: calc(100% - 40px);
        bottom: 20px;
        top: auto;
    }
}

.badge-motos-online {
    position: absolute;
    right: 16px;
    bottom: 16px;
    z-index: 500;
    background: rgba(17, 24, 39, 0.92);
    color: #fff;
    border-radius: 14px;
    padding: 14px 16px;
    min-width: 180px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
}

.badge-motos-online small {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    color: #9ca3af;
    margin-bottom: 6px;
    font-weight: 800;
}

.badge-motos-online strong {
    display: block;
    font-size: 28px;
    line-height: 1;
    color: #00d166;
}

.rastreamento-layout-loja {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 18px;
    align-items: stretch;
}

.rastreamento-info-loja {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 8px 25px rgba(15, 23, 42, 0.05);
}

.rastreamento-info-loja h4 {
    margin: 0 0 10px;
    font-size: 18px;
    color: #111827;
}

.rastreamento-linha {
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

.rastreamento-linha small {
    display: block;
    color: #6b7280;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.rastreamento-linha strong {
    color: #111827;
    font-size: 14px;
}

#mapRastreamentoLoja {
    width: 100%;
    height: calc(100vh - 190px);
    min-height: 520px;
    border-radius: 18px;
    border: 1px solid #e5e7eb;
    background: #e5e7eb;
}

.placeholder-integracao-loja {
    border: 1px dashed #cbd5e1;
    background: #f8fafc;
    border-radius: 18px;
    padding: 28px;
    color: #475569;
    line-height: 1.6;
}

.placeholder-integracao-loja strong {
    color: #111827;
}

.grid-pedidos-integracao-loja {
    display: grid;
    grid-template-columns: repeat(2, minmax(320px, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.card-pedido-integracao-loja {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    box-shadow: 0 8px 25px rgba(15, 23, 42, 0.05);
    padding: 18px;
}

.card-pedido-integracao-topo {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.card-pedido-integracao-topo h4 {
    margin: 0;
    font-size: 17px;
    color: #111827;
}

.card-pedido-integracao-topo small {
    display: block;
    margin-top: 4px;
    color: #6b7280;
    font-weight: 700;
}

.origem-pedido-badge {
    display: inline-flex;
    border-radius: 999px;
    padding: 7px 11px;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    white-space: nowrap;
}

.origem-ifood {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.origem-pdv {
    background: #dbeafe;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.pedido-integracao-dados {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 14px 0;
}

.pedido-integracao-dado {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 13px;
    padding: 12px;
}

.pedido-integracao-dado small {
    display: block;
    color: #6b7280;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.pedido-integracao-dado strong {
    color: #111827;
    font-size: 14px;
    word-break: break-word;
}

.pedido-integracao-endereco {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 13px;
    padding: 12px;
    margin: 12px 0;
}

.pedido-integracao-endereco small {
    display: block;
    color: #6b7280;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.pedido-integracao-endereco strong {
    color: #111827;
    font-size: 14px;
    line-height: 1.5;
}

.pedido-integracao-acoes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.status-integracao-aguardando {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.status-integracao-chamado {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.status-integracao-cancelado {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.painel-vazio-integracao {
    padding: 28px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    color: #64748b;
    text-align: center;
    font-weight: 700;
}

.painel-base-toggle {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 600;
    border: none;
    border-radius: 14px;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.94);
    color: #111827;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

.painel-operacional-toggle {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 600;
    border: none;
    border-radius: 14px;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
    background: rgba(17, 24, 39, 0.94);
    color: #fff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.22);
}

.painel-operacional-flutuante {
    position: absolute;
    top: 64px;
    left: 16px;
    z-index: 650;
    width: 460px;
    max-width: calc(100% - 32px);
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
    padding: 18px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px) scale(0.98);
    transition: .22s ease;
}

.painel-operacional-flutuante.aberto {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.painel-operacional-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(150px, 1fr));
    gap: 10px;
}

.painel-operacional-kpi {
    padding: 12px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.painel-operacional-kpi small {
    display: block;
    color: #6b7280;
    text-transform: uppercase;
    font-size: 10px;
    font-weight: 800;
    margin-bottom: 5px;
}

.painel-operacional-kpi strong {
    font-size: 23px;
    color: #111827;
    line-height: 1;
}

/* Chat message styles for loja (compatvel com comerciante.js render) */
.messages-list {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
}

.message-item {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.message-item .message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex: 0 0 40px;
    font-weight: 700;
}

.message-item .message-content {
    max-width: 75%;
    padding: 10px 12px;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    background: #fff;
    color: #0f172a;
    position: relative;
}

.message-item.sent .message-content {
    background: #25D366;
    color: #04270a;
    border-bottom-right-radius: 6px;
}

.message-item.received .message-content {
    background: #fff;
    color: #0f172a;
    border-bottom-left-radius: 6px;
}

.message-item .message-text img,
.message-item .message-text video {
    max-width: 320px;
    border-radius: 8px;
    display: block;
}

.message-item .message-header {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
}

.message-item .message-time {
    font-size: 11px;
    color: rgba(0, 0, 0, 0.45);
}

.message-item .message-ticks {
    margin-left: 8px;
    font-size: 12px;
    color: rgba(0, 0, 0, 0.45);
}


/* Ajustes globais para melhor alinhamento e botes menores */
.table-res th,
.table-res td {
    padding: 12px 14px;
    vertical-align: middle;
    text-align: left;
}

.table-res th:nth-child(1),
.table-res td:nth-child(1) {
    width: 180px;
}

.table-res th:nth-child(2),
.table-res td:nth-child(2) {
    width: 140px;
}

.table-res th:nth-child(12),
.table-res td:nth-child(12) {
    width: 170px;
    text-align: center;
}

.acoes-inline {
    display: flex;
    gap: 8px;
    align-items: center;
}

.acoes-inline .btn-mini {
    padding: 6px 8px;
    font-size: 12px;
    border-radius: 8px;
}

.btn-mini {
    border: none;
    cursor: pointer;
    background: #e5e7eb;
    color: #111827;
    font-weight: 700;
}

.btn-mini.btn-config {
    background: #06b6d4;
    color: #fff;
}

.btn-mini.btn-aprovar {
    background: #10b981;
    color: #fff;
}

.btn-mini.btn-bloquear {
    background: #ef4444;
    color: #fff;
}

.historico-vazio {
    text-align: center;
    color: #64748b;
    padding: 24px 0;
}

.pill-status {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 12px;
}

.pill-status.st-localizando {
    background: #fef3c7;
    color: #92400e;
}

.pill-status.st-andamento {
    background: #dcfce7;
    color: #166534;
}

.pill-status.st-finalizado {
    background: #dcfce7 !important;
    color: #15803d !important;
    border: 1px solid #86efac;
    font-weight: 700;
}

.pill-status.st-cancelado {
    background: #fee2e2 !important;
    color: #dc2626 !important;
    border: 1px solid #fca5a5;
    font-weight: 700;
}

#rastreamentoStatusLoja.status-rastreamento-finalizada {
    color: #15803d !important;
}

#rastreamentoStatusLoja.status-rastreamento-cancelada {
    color: #dc2626 !important;
}

#rastreamentoStatusLoja.status-rastreamento-andamento {
    color: #1d4ed8;
}

.badge-origem-despacho {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 12px;
}

.badge-km-despacho {
    display: inline-block;
    padding: 6px 8px;
    border-radius: 8px;
    background: #f1f5f9;
    font-weight: 700;
}

.endereco-operacao-despacho {
    font-size: 12px;
    color: #64748b;
    margin-top: 6px;
}

@media (max-width: 900px) {

    .table-res th:nth-child(1),
    .table-res td:nth-child(1),
    .table-res th:nth-child(2),
    .table-res td:nth-child(2) {
        width: auto;
    }

    .loja-main {
        padding: 12px;
    }
}

/* Ajustes especficos para lista de pedidos - corrigir desalinhamento */
#tabelaPedidosMontadosWrapLoja,
#listaPedidosMontadosLoja {
    width: 100%;
}

#listaPedidosMontadosLoja td,
#listaPedidosMontadosLoja th {
    vertical-align: middle;
    padding: 12px 14px;
}

.pedido-montado-cliente {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
}

.pedido-montado-cliente strong {
    font-size: 14px;
    color: #111827;
    font-weight: 700;
}

.pedido-montado-cliente small {
    font-size: 12px;
    color: #6b7280;
    display: block;
    margin-top: 2px;
    font-weight: 600;
}

.badge-origem-despacho {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    white-space: nowrap;
}

.badge-origem-manual {
    background: #f3f4f6;
    color: #111827;
    border: 1px solid #e5e7eb;
}

.badge-origem-ifood {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.badge-origem-pdv {
    background: #dbeafe;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.badge-km-despacho,
.badge-tempo-despacho {
    display: inline-block;
    font-weight: 700;
    color: #111827;
    background: transparent;
}

.pill-status {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 12px;
    font-size: 12px;
}

.btn-acoes-pedido {
    position: relative;
}


.painel-base-flutuante {
    position: absolute;
    top: 64px;
    right: 16px;
    z-index: 650;
    width: 360px;
    max-width: calc(100% - 32px);
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
    padding: 18px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px) scale(0.98);
    transition: .22s ease;
}

.painel-base-flutuante.aberto {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.titulo-mini {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 900;
    color: #111827;
}

.painel-base-fechar {
    position: absolute;
    top: 10px;
    right: 10px;
    border: none;
    background: #e5e7eb;
    color: #111827;
    border-radius: 10px;
    width: 34px;
    height: 34px;
    cursor: pointer;
    font-weight: 900;
}

.pedido-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(320px, 1fr));
    gap: 16px;
    margin-top: 18px;
    align-items: start;
}

.card-pedido {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 18px;
    background: #fff;
    height: 100%;
}

.card-pedido-topo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.label-pedido {
    font-size: 13px;
    font-weight: 900;
    color: #111827;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.pedido-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.pedido-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.opcoes-pedido {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 12px;
    align-items: center;
}

.opcoes-pedido label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: #374151;
}

.label-retorno-entrega {
    border: 1px solid #e5e7eb;
    background: #f8fafc;
    padding: 9px 12px;
    border-radius: 12px;
    cursor: pointer;
}

.label-retorno-entrega.retorno-ativo {
    border-color: #f59e0b;
    background: #fff7ed;
    color: #92400e;
}

.chuva-alerta-entrega {
    margin-top: 12px;
    display: none;
    align-items: center;
    gap: 8px;
    border-radius: 12px;
    border: 1px solid #f59e0b;
    background: #fff7ed;
    color: #9a3412;
    font-weight: 800;
    font-size: 12px;
    padding: 10px 12px;
}

.aviso-chuva-montagem {
    margin: 10px 0 14px;
    display: none;
    align-items: center;
    gap: 8px;
    border-radius: 12px;
    border: 1px solid #f59e0b;
    background: #fffbeb;
    color: #92400e;
    font-weight: 800;
    font-size: 12px;
    padding: 10px 12px;
}

.modal-confirmacao-entrega {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px;
    backdrop-filter: blur(3px);
}

.modal-confirmacao-entrega.aberto {
    display: flex;
}

.modal-confirmacao-card {
    width: min(520px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 30px 60px rgba(2, 6, 23, 0.24);
    display: flex;
    flex-direction: column;
}

.modal-confirmacao-card::-webkit-scrollbar {
    width: 6px;
}

.modal-confirmacao-card::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.modal-confirmacao-header {
    padding: 18px 20px;
    background: linear-gradient(120deg, #0f172a, #1f2937);
    color: #fff;
    font-size: 18px;
    font-weight: 900;
}

.modal-confirmacao-body {
    padding: 18px 20px;
    display: grid;
    gap: 8px;
    color: #1f2937;
    font-size: 14px;
}

.modal-confirmacao-acoes {
    padding: 14px 20px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.avaliacao-estrelas-loja {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 8px 0 12px;
}

.avaliacao-estrelas-loja button {
    border: 1px solid #e5e7eb;
    background: #fff7ed;
    color: #f59e0b;
    border-radius: 10px;
    width: 42px;
    height: 42px;
    font-size: 20px;
    cursor: pointer;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.avaliacao-estrelas-loja button i {
    pointer-events: none;
}

.avaliacao-estrelas-loja button.active {
    background: #111827;
    color: #ffffff;
    border-color: #111827;
}

.tag-retorno-pendente {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 900;
    color: #92400e;
    background: #f1f5f9;
    border: 1px solid #111827;
    text-transform: uppercase;
}

.tag-avaliacao-pendente {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 900;
    color: #1d4ed8;
    background: #dbeafe;
    border: 1px solid #93c5fd;
    text-transform: uppercase;
}

.resumo-entrega {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.resumo-item {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 16px;
}

.resumo-item small {
    display: block;
    color: #6b7280;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.resumo-item strong {
    font-size: 20px;
    color: #111827;
}

.actions-row {
    margin-top: 18px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pill-status {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.st-localizando {
    background: #111827;
    color: #ffffff;
    border: 1px solid #111827;
}

.st-andamento {
    background: #dbeafe;
    color: #1d4ed8;
}

.st-cancelado {
    background: #fee2e2 !important;
    color: #dc2626 !important;
    border: 1px solid #fca5a5;
    font-weight: 700;
}

.st-finalizado {
    background: #dcfce7 !important;
    color: #15803d !important;
    border: 1px solid #86efac;
    font-weight: 700;
}

.painel-financeiro-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 22px;
}

.kpi-financeiro {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 8px 25px rgba(15, 23, 42, 0.05);
}

.kpi-financeiro small {
    display: block;
    margin-bottom: 8px;
    font-size: 11px;
    text-transform: uppercase;
    color: #6b7280;
    font-weight: 800;
}

.kpi-financeiro strong {
    font-size: 24px;
    color: #111827;
}

.config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.historico-vazio {
    padding: 30px;
    text-align: center;
    color: #6b7280;
    font-weight: 600;
}

.chat-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 18px;
}

.chat-lista {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 12px;
    max-height: 620px;
    overflow-y: auto;
}

.chat-item {
    padding: 14px;
    border-radius: 12px;
    cursor: pointer;
    background: #fff;
    border: 1px solid #e5e7eb;
    margin-bottom: 10px;
    transition: .2s;
}

.chat-item:hover,
.chat-item.active {
    border-color: #00d166;
    background: #f0fdf4;
}

.chat-item strong {
    display: block;
    font-size: 13px;
    color: #111827;
    margin-bottom: 4px;
}

.chat-item small {
    color: #6b7280;
    font-size: 12px;
}

.chat-box {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    display: flex;
    flex-direction: column;
    min-height: 620px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.07);
}

.chat-topo {
    padding: 16px 18px;
    border-bottom: 1px solid #e5e7eb;
    background: #ffffff;
}

.chat-topo strong {
    display: block;
    color: #111827;
    font-size: 15px;
}

.chat-topo small {
    color: #6b7280;
}

/* Chat estilo tipo WhatsApp */
.wa-chat-bg {
    background: linear-gradient(180deg, #e5ddd5 0%, #f0f2f5 120px) !important;
}

.chat-mensagens {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: linear-gradient(180deg, #f7f7f7, #ffffff);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.msg-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.msg-row.mine,
.msg-row.admin {
    flex-direction: row-reverse;
    margin-left: auto;
    max-width: 100%;
}

.msg-row:not(.mine):not(.admin) {
    margin-right: auto;
    max-width: 100%;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    flex: 0 0 36px;
    font-size: 14px;
}

.msg {
    max-width: 72%;
    padding: 10px 12px;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(2, 6, 23, 0.06);
    word-break: break-word;
    position: relative;
}

.msg.loja {
    background: #25D366;
    color: #04270a;
    border-bottom-right-radius: 6px;
}

.msg.admin,
.msg.motoboy {
    background: #fff;
    color: #0f172a;
    border-bottom-left-radius: 6px;
}

.msg.loja::after,
.msg.admin::after,
.msg.motoboy::after {
    content: '';
    position: absolute;
    bottom: 0;
    width: 12px;
    height: 12px;
    transform: translateY(50%);
}

.msg.loja::after {
    right: -6px;
    background: linear-gradient(180deg, #25D366, #1aa65a);
    clip-path: polygon(0 0, 100% 0, 100% 100%);
}

.msg.admin::after,
.msg.motoboy::after {
    left: -6px;
    background: #fff;
    clip-path: polygon(0 0, 100% 0, 0 100%);
}

.msg .msg-time {
    display: block;
    font-size: 11px;
    color: rgba(0, 0, 0, 0.45);
    margin-top: 6px;
    text-align: right;
}

.msg .msg-ticks {
    display: inline-block;
    margin-left: 8px;
    vertical-align: middle;
}

.chat-envio {
    display: flex;
    gap: 8px;
    align-items: center;
    padding-top: 6px;
}

.chat-envio textarea,
#mensagemChat {
    flex: 1;
    padding: 12px 14px;
    border-radius: 24px;
    border: 1px solid #e6e6e6;
    outline: none;
}

#btnAttachLoja {
    background: transparent;
    border: 1px solid #e6e6e6;
    padding: 8px 10px;
    border-radius: 50%;
}

.btn-acao.btn-primario,
.chat-envio .btn-primario,
.chat-envio button[type=button] {
    background: #25D366;
    color: #fff;
    border-radius: 20px;
    padding: 8px 14px;
    border: none;
}

/* Admin sidebar / contacts (WhatsApp-like) */
.admin-sidebar {
    background: #f8fafc;
    border-radius: 8px;
    padding: 8px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.admin-search {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 8px;
}

.admin-contacts {
    flex: 1;
    overflow: auto;
    padding: 6px 4px;
}

.admin-section-title {
    font-size: 12px;
    color: #6b7280;
    padding: 8px 6px;
    font-weight: 700;
}

.admin-contact-item {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px 8px;
    border-radius: 8px;
    cursor: pointer;
}

.admin-contact-item:hover {
    background: #eef2f7;
}

.admin-contact-item.active {
    background: #e6f7ee;
}

.admin-contact-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    flex: 0 0 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #c7d2da;
    color: #fff;
    font-weight: 700;
    overflow: hidden;
}

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

.admin-contact-name {
    display: block;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-contact-last {
    display: block;
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-contact-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.admin-contact-time {
    font-size: 11px;
    color: #94a3b8;
}

.admin-contact-badge {
    background: #25D366;
    color: #fff;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 11px;
}

/* Chat header */
.chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-bottom: 1px solid #e6eef5;
}

.chat-header .avatar-lg {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #9ca3af;
    color: #fff;
    font-weight: 700;
}

.chat-header .chat-title {
    font-weight: 700;
}

/* Bubble tweaks for WhatsApp look */
.bubble {
    padding: 10px 12px;
    border-radius: 16px;
    position: relative;
}

.bubble.admin {
    background: #e9f4ef;
    color: #0b5138;
    border: 1px solid rgba(2, 6, 23, 0.04);
}

.bubble.other {
    background: #25D366;
    color: #04270a;
}

.campo-senha {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px dashed #d1d5db;
}

.campo-senha h4 {
    margin: 0 0 12px;
    font-size: 15px;
    color: #111827;
}

input,
select,
textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 12px 14px;
    background: #fff;
    font-family: inherit;
    font-size: 14px;
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #00d166;
    box-shadow: 0 0 0 3px rgba(0, 209, 102, 0.10);
}

@media (max-width: 1200px) {
    .pedido-cards {
        grid-template-columns: 1fr;
    }

    .chat-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1100px) {

    .config-grid,
    .painel-financeiro-grid,
    .resumo-entrega,
    .pedido-grid,
    .pedido-grid-3 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .loja-layout {
        flex-direction: column;
    }

    .loja-sidebar {
        width: 100%;
        min-width: 100%;
    }

    .loja-main {
        padding: 16px;
    }

    #map {
        height: 48vh;
        min-height: 320px;
    }

    .painel-base-flutuante {
        width: calc(100% - 24px);
        right: 12px;
        top: 58px;
    }

    .painel-base-toggle {
        top: 12px;
        right: 12px;
    }

    .painel-operacional-toggle {
        top: 12px;
        left: 12px;
    }

    .painel-operacional-flutuante {
        left: 12px;
        top: 58px;
        width: calc(100% - 24px);
    }

    .painel-operacional-grid {
        grid-template-columns: 1fr;
    }

    .mini-grid {
        grid-template-columns: 1fr;
    }

    .chat-envio {
        grid-template-columns: 1fr;
    }

    .rastreamento-layout-loja {
        grid-template-columns: 1fr;
    }

    #mapRastreamentoLoja {
        height: 60vh;
        min-height: 360px;
    }

    .grid-pedidos-integracao-loja {
        grid-template-columns: 1fr;
    }

    .pedido-integracao-dados {
        grid-template-columns: 1fr;
    }
}



/* =========================================================
   X DELIVERY  MONTAR ENTREGA PRO
   Camada visual sem quebrar IDs/classes do JS.
========================================================= */

.tela-montar-entrega-pro .section-title-loja {
    margin-bottom: 14px;
}

.tela-montar-entrega-pro .section-title-loja h3 {
    font-size: clamp(22px, 2vw, 30px);
    letter-spacing: -0.04em;
}

.tela-montar-entrega-pro .section-title-loja p {
    font-size: 13px;
    color: #64748b;
}

.montar-entrega-shell {
    background:
        radial-gradient(circle at top right, rgba(0, 209, 102, 0.12), transparent 34%),
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 24px;
    padding: 18px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.montar-entrega-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    padding: 12px;
    border-radius: 18px;
    background: rgba(248, 250, 252, 0.92);
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.montar-entrega-toolbar .actions-row {
    margin: 0 !important;
}

.montar-entrega-help {
    max-width: 520px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.45;
    font-weight: 700;
}

.pedido-cards-pro {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: 14px;
    align-items: start;
}

.card-pedido-pro {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    padding: 16px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.07);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.card-pedido-pro:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 209, 102, 0.35);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.10);
}

.card-pedido-pro::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 5px;
    background: linear-gradient(90deg, #00d166, #65f3a2);
}

.card-pedido-topo-pro {
    padding-top: 4px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eef2f7;
    margin-bottom: 14px;
}

.card-pedido-pro .label-pedido {
    font-size: 12px;
    color: #0f172a;
    letter-spacing: .06em;
}

.card-pedido-pro .pill-status {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
    padding: 6px 10px;
    font-size: 10px;
}

.card-pedido-pro .pedido-grid,
.card-pedido-pro .pedido-grid-3 {
    display: grid;
    gap: 10px;
    margin-bottom: 10px;
}

.card-pedido-pro .pedido-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card-pedido-pro .pedido-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card-pedido-pro .campo-inline label {
    color: #334155;
    font-size: 9.5px;
    letter-spacing: .04em;
    font-weight: 900;
    margin-bottom: 4px;
}

.card-pedido-pro input,
.card-pedido-pro select,
.card-pedido-pro textarea {
    min-height: 40px;
    border-radius: 12px;
    padding: 9px 11px;
    font-size: 12px;
    background: #f8fafc;
    border: 1px solid #cfd8e3;
    color: #0f172a;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.card-pedido-pro input:focus,
.card-pedido-pro select:focus,
.card-pedido-pro textarea:focus {
    background: #ffffff;
    border-color: #00d166;
    box-shadow: 0 0 0 4px rgba(0, 209, 102, 0.13);
}

.card-pedido-pro textarea {
    min-height: 74px;
    resize: vertical;
}

.card-pedido-pro .opcoes-pedido {
    margin-top: 12px;
    padding: 10px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    gap: 10px;
    align-items: center;
}

.card-pedido-pro .label-retorno-entrega {
    flex: 1;
    min-width: 145px;
    justify-content: center;
    gap: 8px;
    border: 1px solid #dbe4ec;
    background: #ffffff;
    border-radius: 14px;
    padding: 9px 10px;
    font-size: 11px;
    font-weight: 900;
    color: #334155;
    text-align: center;
}

.card-pedido-pro .label-retorno-entrega input {
    width: 20px;
    height: 20px;
    min-height: 20px;
    padding: 0;
    accent-color: #00d166;
}

.card-pedido-pro .label-retorno-entrega.retorno-ativo,
.card-pedido-pro .label-retorno-entrega:has(input:checked) {
    border-color: #111827;
    background: #f1f5f9;
    color: #111827;
}

.card-pedido-pro .in-pontos {
    max-width: 72px;
    min-height: 36px;
    text-align: center;
    font-weight: 900;
}

.resumo-entrega-pro {
    margin-top: 18px;
    padding: 12px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 22px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 12px 32px rgba(15, 23, 42, 0.06);
    grid-template-columns: repeat(5, minmax(130px, 1fr));
}

.resumo-entrega-pro .resumo-item {
    min-height: 72px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 13px;
}

.resumo-entrega-pro .resumo-item small {
    color: #64748b;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .04em;
}

.resumo-entrega-pro .resumo-item strong {
    color: #0f172a;
    font-size: 18px;
    letter-spacing: -0.02em;
}

.resumo-entrega-pro .resumo-item:nth-child(3) {
    background: linear-gradient(135deg, #07111f, #0d1b2e);
    border-color: rgba(0, 209, 102, 0.18);
}

.resumo-entrega-pro .resumo-item:nth-child(3) small,
.resumo-entrega-pro .resumo-item:nth-child(3) strong {
    color: #ffffff;
}

#btnChamar {
    min-height: 50px;
    padding: 14px 22px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 1000;
    background: linear-gradient(135deg, #00d166, #65f3a2);
    color: #052016;
    box-shadow: 0 18px 34px rgba(0, 209, 102, 0.28);
}

#btnChamar:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 42px rgba(0, 209, 102, 0.34);
}

/* Operacional mais limpo */
#aba-operacional .box-branca {
    border-radius: 22px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .08);
}

#aba-operacional .table-container,
#aba-pedidos .table-container {
    border-radius: 18px;
    overflow: auto;
}

#aba-operacional .btn-acao,
#aba-pedidos .btn-acao {
    padding: 9px 13px;
    font-size: 11px;
    border-radius: 999px;
}

/* Responsivo */
@media (max-width: 1280px) {
    .pedido-cards-pro {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }

    .card-pedido-pro .pedido-grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .resumo-entrega-pro {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

@media (max-width: 860px) {
    .montar-entrega-shell {
        padding: 12px;
        border-radius: 18px;
    }

    .montar-entrega-toolbar {
        align-items: stretch;
    }

    .montar-entrega-toolbar .actions-row {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
    }

    .pedido-cards-pro,
    .card-pedido-pro .pedido-grid,
    .card-pedido-pro .pedido-grid-3,
    .resumo-entrega-pro {
        grid-template-columns: 1fr;
    }

    .card-pedido-pro {
        padding: 14px;
        border-radius: 18px;
    }

    #btnChamar {
        width: 100%;
    }
}

/* =========================================================
   X DELIVERY  GESTO DE ENTREGAS IMPLANTADA
   Fluxo: Novo pedido -> ficha lateral -> lista -> selecionar -> chamar motoboy.
========================================================= */

.tela-montar-entrega-lista {
    --lista-border: #dbe4ec;
    --lista-green: #00d166;
    --lista-yellow: #f7c400;
    --lista-text: #0f172a;
    --lista-muted: #64748b;
}

.tela-montar-entrega-lista .section-title-loja {
    margin-bottom: 18px;
    align-items: center;
}

.tela-montar-entrega-lista .section-title-loja h3 {
    font-size: clamp(24px, 2.2vw, 32px);
    letter-spacing: -0.04em;
}

.tela-montar-entrega-lista .section-title-loja p {
    font-size: 13px;
    color: var(--lista-muted);
}

.gestao-entregas-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 18px;
    align-items: start;
}

.gestao-entregas-lista,
.resumo-entrega-lateral {
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 12px 35px rgba(15, 23, 42, 0.06);
}

.gestao-entregas-topo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.gestao-entregas-topo h4,
.resumo-entrega-lateral h4 {
    margin: 0;
    color: var(--lista-text);
    font-size: 18px;
    font-weight: 900;
}

.gestao-entregas-topo p {
    margin: 5px 0 0;
    color: var(--lista-muted);
    font-size: 12px;
}

.gestao-entregas-topo strong {
    font-size: 13px;
    color: #111827;
    white-space: nowrap;
}

.estado-vazio-entrega {
    min-height: 260px;
    display: grid;
    place-items: center;
    text-align: center;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    border: 1px dashed #cbd5e1;
    padding: 30px;
}

.estado-vazio-icone {
    font-size: 68px;
    line-height: 1;
    margin-bottom: 10px;
}

.estado-vazio-entrega h4 {
    margin: 0 0 8px;
    font-size: 20px;
    color: var(--lista-text);
}

.estado-vazio-entrega p {
    max-width: 520px;
    margin: 0 0 18px;
    color: var(--lista-muted);
    font-size: 13px;
    line-height: 1.5;
}

.tabela-pedidos-montados {
    border-radius: 14px;
    overflow: auto;
}

.tabela-pedidos-montados .table-res {
    min-width: 1280px !important;
}

.tabela-pedidos-montados th {
    padding: 12px 14px;
    font-size: 11px;
    color: #0f172a;
}

.tabela-pedidos-montados td {
    padding: 13px 14px;
    font-size: 13px;
    vertical-align: middle;
}

.pedido-montado-cliente strong {
    display: block;
    color: #0f172a;
    font-size: 13px;
}

.pedido-montado-cliente small {
    display: block;
    margin-top: 3px;
    color: #64748b;
    font-size: 11px;
}

.check-pedido-montado {
    width: 18px;
    height: 18px;
    accent-color: var(--lista-yellow);
}

.badge-pagamento-online,
.badge-pagamento-pix,
.badge-pagamento-dinheiro,
.badge-pagamento-cartao {
    display: inline-flex;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
}

.badge-pagamento-online,
.badge-pagamento-pix {
    background: #dcfce7;
    color: #166534;
}

.badge-pagamento-dinheiro,
.badge-pagamento-cartao {
    background: #fff7ed;
    color: #9a3412;
}

.btn-acoes-pedido {
    position: relative;
    display: inline-flex;
}

.btn-acoes-pedido button {
    border: 1px solid #111827;
    background: #fff;
    color: #111827;
    padding: 9px 13px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.menu-acoes-pedido {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    width: 150px;
    display: none;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    box-shadow: 0 18px 38px rgba(15, 23, 42, .16);
    overflow: hidden;
    z-index: 30;
}

.btn-acoes-pedido.aberto .menu-acoes-pedido {
    display: block;
}

.menu-acoes-pedido a {
    display: block;
    padding: 11px 12px;
    color: #0f172a;
    text-decoration: none;
    font-size: 12px;
    cursor: pointer;
}

.menu-acoes-pedido a:hover {
    background: #f8fafc;
}

.resumo-entrega-lateral {
    position: sticky;
    top: 20px;
    padding: 18px;
}

.resumo-entrega-lateral h4 {
    padding-bottom: 12px;
    border-bottom: 1px solid #111827;
    margin-bottom: 14px;
}

.resumo-linha {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 12px 0;
    font-size: 13px;
    color: #111827;
}

.resumo-linha strong {
    font-size: 15px;
    color: #111827;
}

.resumo-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
    color: #111827;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.resumo-check input {
    width: 16px;
    height: 16px;
    min-height: 16px;
    accent-color: var(--lista-yellow);
}

.resumo-inversor {
    margin: 16px 0;
    padding: 13px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.resumo-inversor strong {
    display: block;
    margin-bottom: 4px;
    color: #0f172a;
    font-size: 13px;
}

.resumo-inversor p {
    margin: 0 0 8px;
    color: #64748b;
    font-size: 11px;
    line-height: 1.45;
}

.btn-chamar-lista {
    width: 100%;
    margin-top: 14px;
    min-height: 46px;
    background: #f7c400 !important;
    color: #111827 !important;
    border-radius: 10px;
    font-weight: 900;
}

/* Ficha lateral — portal no html (escapa zoom do body) + flex interno */
.ficha-pedido-overlay {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: flex-end;
    align-items: stretch;
    background: rgba(15, 23, 42, 0.45);
    z-index: 50000;
    padding: 0 max(8px, env(safe-area-inset-right, 0px)) 0 0;
    box-sizing: border-box;
    overflow: hidden;
}

.ficha-pedido-overlay.aberto {
    display: flex;
}

html:has(body.loja-painel.xd-ui-density) > #overlayFichaPedidoLoja.ficha-pedido-overlay {
    zoom: var(--xd-loja-scale);
    height: calc(100dvh / var(--xd-loja-scale, 1));
    min-height: calc(100dvh / var(--xd-loja-scale, 1));
}

html > #overlayFichaPedidoLoja.ficha-pedido-overlay {
    height: 100dvh;
    min-height: 100dvh;
}

body.ficha-pedido-aberta {
    overflow: hidden !important;
}

.ficha-pedido-drawer {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    align-self: stretch;
    position: relative;
    width: min(1120px, 100%);
    max-width: 100%;
    height: 100%;
    min-height: 100%;
    max-height: none;
    margin: 0;
    overflow: hidden;
    background: #ffffff;
    box-shadow: -28px 0 70px rgba(15, 23, 42, 0.22);
    border-left: 4px solid #00d166;
    padding: 0;
    box-sizing: border-box;
    animation: fichaSlideIn .22s ease;
    min-width: 0;
}

@keyframes fichaSlideIn {
    from {
        transform: translateX(30px);
        opacity: .7;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.ficha-pedido-header {
    flex: 0 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    padding: 10px 14px 8px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 0;
}

.ficha-pedido-header h3 {
    margin: 0;
    font-size: clamp(16px, 2.2vw, 20px);
    color: #0f172a;
    line-height: 1.2;
}

.ficha-pedido-header p {
    display: none !important;
}

.ficha-fechar {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    color: #0f172a;
    font-size: 24px;
    line-height: 1;
    font-weight: 400;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease, border-color .15s ease;
}

.ficha-fechar:hover {
    background: #eef2f7;
    border-color: #cbd5e1;
}

.ficha-pedido-corpo {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(340px, 420px);
    overflow: hidden;
}

.ficha-mapa-preview {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    margin: 12px 8px 12px 16px;
    border-radius: 14px;
    overflow: hidden;
    background: #e2e8f0;
    border: 1px solid #dbe4ec;
}

.ficha-pedido-form-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    border-left: 1px solid #e2e8f0;
    background: #fff;
}

#mapFichaPedidoLoja {
    width: 100%;
    height: 100%;
}

.ficha-pedido-drawer .campo-busca-endereco {
    position: relative;
    z-index: 30;
}

.ficha-pedido-drawer .autocomplete-endereco-lista {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 120;
    max-height: 240px;
    overflow: auto;
    background: #fff;
    border: 1px solid #dbe4ec;
    border-radius: 12px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16);
}

.ficha-pedido-drawer .autocomplete-endereco-lista.aberto {
    display: block;
}

.ficha-pedido-scroll.ficha-scroll-autocomplete-aberto {
    overflow: visible !important;
}

.ficha-pedido-drawer:has(.ficha-scroll-autocomplete-aberto) {
    overflow: visible !important;
}

.ficha-pedido-drawer .autocomplete-endereco-lista[style*="position: fixed"],
.ficha-pedido-drawer .autocomplete-endereco-lista.autocomplete-fixo {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    top: calc(100% + 4px) !important;
    width: auto !important;
    z-index: 200 !important;
}

.ficha-pedido-drawer .autocomplete-endereco-item {
    width: 100%;
    border: 0;
    border-bottom: 1px solid #f1f5f9;
    background: #fff;
    padding: 10px 12px;
    text-align: left;
    cursor: pointer;
}

.ficha-pedido-drawer .autocomplete-endereco-item:last-child {
    border-bottom: 0;
}

.ficha-pedido-drawer .autocomplete-endereco-item strong {
    display: block;
    color: #0f172a;
    font-size: 13px;
}

.ficha-pedido-drawer .autocomplete-endereco-item small {
    display: block;
    margin-top: 3px;
    color: #64748b;
    font-size: 11px;
    line-height: 1.35;
}

.ficha-pedido-drawer .autocomplete-endereco-item:hover {
    background: #f8fafc;
}

.ficha-bairro-wrap {
    display: flex;
}

.ficha-bairro-wrap.visivel {
    display: flex;
}

.ficha-pedido-drawer #fichaCidadeLoja[readonly] {
    background: #f8fafc;
    color: #475569;
    cursor: default;
}

.ficha-pedido-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 10px 14px 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.ficha-pedido-scroll > .ficha-bloco-endereco {
    overflow: visible;
    position: relative;
    z-index: 25;
}

.ficha-bloco {
    margin-bottom: 10px;
}

.ficha-bloco:last-child {
    margin-bottom: 0;
}

.ficha-bloco h4 {
    margin: 0 0 6px;
    color: #0f172a;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.ficha-bloco .campo-inline {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ficha-bloco .pedido-grid {
    display: grid;
    gap: 8px;
    margin-bottom: 8px;
}

.ficha-bloco .pedido-grid-endereco-principal {
    grid-template-columns: minmax(0, 1.5fr) minmax(96px, 0.55fr);
}

.ficha-bloco .pedido-grid-bairro-cidade,
.ficha-bloco .pedido-grid-cliente,
.ficha-bloco .pedido-grid-pagamento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ficha-bloco .pedido-grid-bairro-cidade {
    grid-template-columns: 1fr;
}

.ficha-bloco .pedido-grid-bairro-cidade:has(.ficha-bairro-wrap.visivel) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ficha-bloco .pedido-grid-cep {
    grid-template-columns: 1fr;
}

.ficha-bloco .pedido-grid-complemento {
    grid-template-columns: minmax(0, 1.35fr) minmax(128px, 0.7fr);
}

.ficha-bloco .campo-endereco-full,
.ficha-bloco .campo-observacao {
    grid-column: 1 / -1;
}

.ficha-bloco label {
    font-size: 10px;
    font-weight: 800;
    color: #334155;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.ficha-bloco input,
.ficha-bloco select,
.ficha-bloco textarea {
    width: 100%;
    box-sizing: border-box;
    min-height: 44px;
    border-radius: 12px;
    padding: 11px 13px;
    font-size: 14px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #0f172a;
}

.ficha-bloco textarea {
    min-height: 88px;
    resize: vertical;
    max-height: 160px;
}

.ficha-check-retorno {
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #dbe4ec;
    border-radius: 12px;
}

.ficha-acoes {
    flex: 0 0 auto;
    position: static;
    bottom: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 16px 20px;
    padding-bottom: max(16px, env(safe-area-inset-bottom, 16px));
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -10px 28px rgba(15, 23, 42, 0.08);
}

.ficha-bloco-taxa {
    margin-top: 14px;
}

.ficha-taxa-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid #bbf7d0;
    background: linear-gradient(180deg, #f0fdf4 0%, #ecfdf5 100%);
}

.ficha-taxa-box__label {
    display: none;
}

.ficha-taxa-box__valor {
    font-size: 26px;
    font-weight: 800;
    color: #14532d;
    line-height: 1.15;
}

.ficha-taxa-box__valor.is-erro {
    color: #b45309;
    font-size: 18px;
}

.ficha-taxa-box__meta {
    font-size: 12px;
    font-weight: 600;
    color: #3f6212;
}

.xd-cancelar-pedido-dialog {
    width: min(440px, calc(100vw - 32px));
    max-width: none;
    padding: 0;
    border: 0;
    border-radius: 18px;
    color: #0f172a;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.3);
}
.xd-cancelar-pedido-dialog::backdrop {
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(2px);
}
.xd-cancelar-pedido-dialog__form {
    display: grid;
    gap: 12px;
    padding: 24px;
}
.xd-cancelar-pedido-dialog__form h2 {
    margin: 0;
    font-size: 19px;
    font-weight: 850;
}
.xd-cancelar-pedido-dialog__form p {
    margin: 0;
    color: #475569;
    font-size: 14px;
    line-height: 1.5;
}
.xd-cancelar-pedido-dialog__form label {
    margin-top: 4px;
    font-size: 13px;
    font-weight: 750;
}
.xd-cancelar-pedido-dialog__form textarea {
    width: 100%;
    min-height: 104px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font: inherit;
    resize: vertical;
}
.xd-cancelar-pedido-dialog__form textarea:focus {
    outline: 2px solid #93c5fd;
    border-color: #2563eb;
}
.xd-cancelar-pedido-dialog__erro {
    color: #b91c1c;
    font-size: 13px;
    font-weight: 650;
}
.xd-cancelar-pedido-dialog__acoes {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 4px;
}
.xd-cancelar-pedido-dialog__acoes button {
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 10px;
    font: inherit;
    font-size: 13px;
    font-weight: 750;
    cursor: pointer;
}
.xd-cancelar-pedido-dialog__manter {
    background: #f1f5f9;
    color: #334155;
    border-color: #e2e8f0 !important;
}
.xd-cancelar-pedido-dialog__confirmar {
    background: #dc2626;
    color: #fff;
}
.xd-cancelar-pedido-dialog__confirmar:hover {
    background: #b91c1c;
}

/* Modal salvar cliente (ficha Chamar motoboy) */
.xd-salvar-cli-modal {
    position: fixed;
    inset: 0;
    z-index: 1000002;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.xd-salvar-cli-modal.is-open,
.xd-salvar-cli-modal:not([hidden]) {
    display: flex;
}
.xd-salvar-cli-modal[hidden] {
    display: none !important;
}
.xd-salvar-cli-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
}
.xd-salvar-cli-modal__card {
    position: relative;
    z-index: 1;
    width: min(400px, 100%);
    padding: 28px 24px 22px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.28);
    text-align: center;
    animation: xdSalvarCliIn .22s ease;
}
@keyframes xdSalvarCliIn {
    from { opacity: 0; transform: translateY(10px) scale(.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.xd-salvar-cli-modal__icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #dcfce7 0%, #bbf7d0 100%);
    color: #15803d;
    font-size: 22px;
}
.xd-salvar-cli-modal__titulo {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 900;
    color: #0f172a;
    letter-spacing: -0.02em;
}
.xd-salvar-cli-modal__nome {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: #14532d;
}
.xd-salvar-cli-modal__tel {
    margin: 2px 0 12px;
    font-size: 14px;
    font-weight: 700;
    color: #64748b;
}
.xd-salvar-cli-modal__desc {
    margin: 0 0 20px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
    color: #475569;
}
.xd-salvar-cli-modal__acoes {
    display: flex;
    gap: 10px;
}
.xd-salvar-cli-modal__btn {
    flex: 1;
    min-height: 46px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    border: none;
}
.xd-salvar-cli-modal__btn--ghost {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
}
.xd-salvar-cli-modal__btn--ok {
    background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
    box-shadow: 0 8px 18px rgba(22, 163, 74, 0.28);
}
.xd-salvar-cli-modal__btn--ok:hover {
    filter: brightness(1.03);
}

.ficha-acoes .btn-acao {
    width: 100%;
    min-height: 48px;
    margin: 0;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
}

.ficha-acoes .btn-neutro {
    background: #f1f5f9 !important;
    color: #334155 !important;
    border: 1px solid #cbd5e1 !important;
}

.ficha-acoes .btn-primario {
    background: #00d166 !important;
    color: #052016 !important;
    border: none !important;
}

@media (max-width: 1100px) {
    .gestao-entregas-layout {
        grid-template-columns: 1fr;
    }

    .resumo-entrega-lateral {
        position: relative;
        top: auto;
    }
}

@media (max-width: 768px) {
    .gestao-entregas-topo {
        flex-direction: column;
        align-items: flex-start;
    }

    .gestao-entregas-topo strong {
        white-space: normal;
    }

    .ficha-pedido-drawer {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0;
        border-radius: 16px 16px 0 0;
        max-height: 96dvh;
        height: 96dvh;
    }

    .ficha-pedido-overlay.aberto {
        align-items: flex-end;
        padding: 0;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .ficha-bloco .pedido-grid-endereco-principal,
    .ficha-bloco .pedido-grid-bairro-cidade,
    .ficha-bloco .pedido-grid-cliente,
    .ficha-bloco .pedido-grid-pagamento {
        grid-template-columns: 1fr;
    }

    .ficha-bloco .pedido-grid-complemento {
        grid-template-columns: minmax(0, 1.2fr) minmax(120px, 0.8fr);
    }

    .ficha-acoes {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 14px 16px;
        padding-bottom: max(14px, env(safe-area-inset-bottom, 14px));
    }
}

/* =========================================================
   AJUSTES  RESUMO SOMENTE APS PEDIDO + CONFIRMAO DE COLETA
========================================================= */

.resumo-entrega-lateral[style*="display:none"] {
    display: none !important;
}

.aviso-coleta-invertida {
    margin-top: 10px;
    padding: 10px 11px;
    border-radius: 12px;
    background: #fff7ed;
    border: 1px solid #f59e0b;
    color: #92400e;
}

.aviso-coleta-invertida strong {
    display: block;
    font-size: 12px;
    font-weight: 900;
    margin-bottom: 4px;
}

.aviso-coleta-invertida span {
    display: block;
    font-size: 11px;
    line-height: 1.35;
    font-weight: 700;
}

.resumo-inversor.inversor-ativo {
    border-color: #f59e0b;
    background: #fffbeb;
}

.resumo-inversor.inversor-ativo>strong {
    color: #92400e;
}

.gestao-entregas-layout.sem-resumo {
    grid-template-columns: 1fr;
}

/* =========================================================
   CENTRAL DE DESPACHO  MANUAL + IFOOD + PDV
========================================================= */

.gestao-entregas-filtros {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: -4px 0 16px;
}

.gestao-entregas-filtros button {
    border: 1px solid #dbe4ec;
    background: #ffffff;
    color: #334155;
    border-radius: 999px;
    padding: 8px 13px;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
    transition: .18s ease;
}

.gestao-entregas-filtros button:hover,
.gestao-entregas-filtros button.active {
    background: #111827;
    color: #ffffff;
    border-color: #111827;
}

.badge-origem-despacho {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 1000;
    text-transform: uppercase;
    white-space: nowrap;
}

.badge-origem-manual {
    background: #e0f2fe;
    color: #075985;
    border: 1px solid #bae6fd;
}

.badge-origem-ifood {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.badge-origem-pdv {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.linha-despacho-oculta {
    display: none !important;
}

.central-despacho-aviso {
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #dbe4ec;
    color: #475569;
    font-size: 12px;
    line-height: 1.45;
    font-weight: 700;
}

@media (max-width: 768px) {
    .gestao-entregas-filtros {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .gestao-entregas-filtros button {
        width: 100%;
    }
}

/* =========================================================
   X DELIVERY  CENTRAL DE DESPACHO FINAL SEM RESUMO LATERAL
========================================================= */
.tela-central-despacho-final .gestao-entregas-layout,
.gestao-entregas-layout.sem-resumo-lateral {
    display: block !important;
}

.tela-central-despacho-final .gestao-entregas-lista {
    width: 100% !important;
    overflow: visible !important;
    border-radius: 20px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 16px 42px rgba(15, 23, 42, 0.07);
}

.resumo-entrega-lateral {
    display: none !important;
}

.tabela-pedidos-montados {
    overflow: visible !important;
}

.tabela-pedidos-montados .table-res {
    min-width: 1260px;
}

.tabela-pedidos-montados th {
    background: #f1f5f9;
    color: #0f172a;
    font-size: 10px;
    letter-spacing: .04em;
    font-weight: 1000;
    text-transform: uppercase;
}

.tabela-pedidos-montados td {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}

.badge-km-despacho,
.badge-tempo-despacho,
.badge-pontos-despacho,
.badge-retorno-despacho,
.badge-inversor-despacho {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 1000;
    white-space: nowrap;
}

.badge-km-despacho {
    background: #eef2ff;
    color: #3730a3;
    border: 1px solid #c7d2fe;
}

.badge-tempo-despacho {
    background: #ecfeff;
    color: #155e75;
    border: 1px solid #a5f3fc;
}

.badge-pontos-despacho {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.badge-retorno-despacho.sim {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
}

.badge-retorno-despacho.nao {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.badge-inversor-despacho.sim {
    background: #e0f2fe;
    color: #075985;
    border: 1px solid #bae6fd;
}

.badge-inversor-despacho.nao {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.barra-despacho-central {
    margin-top: 16px;
    padding: 14px;
    border-radius: 18px;
    background: linear-gradient(135deg, #0f172a, #111827);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.18);
}

.barra-despacho-info {
    display: grid;
    grid-template-columns: repeat(7, minmax(90px, auto));
    gap: 12px;
    align-items: center;
    flex: 1;
}

.barra-despacho-info span {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.barra-despacho-info small {
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
    color: #94a3b8;
}

.barra-despacho-info strong {
    font-size: 13px;
    font-weight: 1000;
    color: #ffffff;
}

#barraTotalEntregaLoja {
    color: #86efac !important;
    font-size: 16px !important;
}

#barraChuvaLoja.ativa {
    color: #fdba74 !important;
}

.btn-chamar-central {
    min-width: 170px;
    min-height: 44px;
    border-radius: 13px !important;
    background: #00d166 !important;
    color: #052016 !important;
    font-weight: 1000 !important;
    box-shadow: 0 14px 28px rgba(0, 209, 102, 0.24);
}

.btn-chamar-central:disabled {
    opacity: .55;
    cursor: not-allowed;
    filter: grayscale(.35);
}

.btn-acoes-pedido {
    position: relative;
    z-index: 20;
}

.btn-acoes-pedido>button {
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
    color: #0f172a !important;
    padding: 8px 11px !important;
    border-radius: 10px !important;
    font-size: 11px !important;
    font-weight: 900 !important;
    min-width: 78px;
}

.menu-acoes-pedido {
    position: fixed !important;
    width: 190px !important;
    display: none;
    background: #ffffff;
    border: 1px solid #dbe4ec;
    border-radius: 14px;
    box-shadow: 0 22px 52px rgba(15, 23, 42, .22);
    overflow: hidden;
    z-index: 999999 !important;
}

.btn-acoes-pedido.aberto .menu-acoes-pedido {
    display: block;
}

.menu-acoes-pedido a {
    display: block;
    padding: 12px 13px;
    color: #0f172a;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.menu-acoes-pedido a:hover {
    background: #f1f5f9;
}

.btn-mini.btn-config,
.btn-mini.btn-bloquear,
.acoes-inline .btn-mini {
    padding: 7px 10px !important;
    font-size: 10px !important;
    border-radius: 999px !important;
    min-height: 30px;
    white-space: nowrap;
}

@media (max-width: 1100px) {
    .barra-despacho-central {
        flex-direction: column;
        align-items: stretch;
    }

    .barra-despacho-info {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .btn-chamar-central {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .barra-despacho-info {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   PATCH FINAL UX  BOTO CHAMAR NO TOPO E SEM BARRA INFERIOR
========================================================= */

.barra-despacho-central {
    display: none !important;
}

.acoes-topo-gestao-entregas {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-chamar-topo {
    background: #111827 !important;
    color: #ffffff !important;
    border: 1px solid rgba(17, 24, 39, .12) !important;
    box-shadow: 0 12px 26px rgba(15, 23, 42, .18);
    min-height: 42px;
    padding: 12px 18px !important;
    border-radius: 13px !important;
    font-weight: 1000 !important;
}

.btn-chamar-topo:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(15, 23, 42, .24);
}

.btn-chamar-topo:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.tabela-pedidos-montados .table-res {
    min-width: 1250px;
}

.tabela-pedidos-montados td,
.tabela-pedidos-montados th {
    white-space: nowrap;
}

.tabela-pedidos-montados td:nth-child(3) {
    white-space: normal;
    min-width: 230px;
}

.badge-km-despacho,
.badge-tempo-despacho,
.badge-pontos-despacho,
.badge-retorno-despacho,
.badge-inversor-despacho {
    min-width: 58px;
}

.badge-km-despacho.calculando {
    background: #fff7ed;
    color: #92400e;
    border-color: #fed7aa;
}

.menu-acoes-pedido {
    position: fixed !important;
    z-index: 999999 !important;
}

.btn-acoes-pedido>button {
    box-shadow: none !important;
}

#contadorPedidosSelecionadosLoja {
    color: #0f172a;
    font-weight: 1000;
}

@media (max-width: 900px) {
    .acoes-topo-gestao-entregas {
        width: 100%;
        justify-content: stretch;
        display: grid;
        grid-template-columns: 1fr;
    }

    .acoes-topo-gestao-entregas .btn-acao {
        width: 100%;
    }
}

/* =========================================================
   PATCH UX V5  CENTRAL MAIS PROFISSIONAL
   Endereo operacional, KM confivel, editar e inversor claro.
========================================================= */

.pedido-montado-cliente strong {
    font-size: 12px;
    font-weight: 1000;
    color: #0f172a;
}

.pedido-montado-cliente small {
    font-size: 10px;
    line-height: 1.35;
    color: #64748b;
}

.endereco-operacao-despacho {
    margin-top: 5px;
    padding: 6px 8px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.35;
}

.endereco-operacao-despacho.invertido {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.badge-km-despacho.erro,
.badge-tempo-despacho.erro {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}

.badge-km-despacho.calculando,
.badge-tempo-despacho.calculando {
    background: #fff7ed;
    color: #92400e;
    border-color: #fed7aa;
}

.badge-inversor-despacho.sim {
    background: #dbeafe !important;
    color: #1d4ed8 !important;
    border-color: #93c5fd !important;
}

.badge-retorno-despacho.sim {
    background: #ffedd5 !important;
    color: #9a3412 !important;
    border-color: #fdba74 !important;
}

.tabela-pedidos-montados .table-res {
    border-collapse: separate;
    border-spacing: 0;
}

.tabela-pedidos-montados tr:hover td {
    background: #f8fafc;
}

.btn-acoes-pedido>button {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    transition: .18s ease;
}

.btn-acoes-pedido>button:hover {
    background: #0f172a !important;
    color: #ffffff !important;
}

.menu-acoes-pedido a:nth-child(3) {
    font-weight: 1000;
    color: #1d4ed8;
}

.menu-acoes-pedido a:nth-child(3):hover {
    background: #eff6ff;
}

.ficha-pedido-drawer {
    border-left: 4px solid #00d166;
}

/* btn-primario da ficha definido no bloco principal .ficha-acoes */

/* =========================================================
   PATCH V6  VISUAL PRIME + KM OFICIAL + CHUVA VISVEL
========================================================= */

.tela-montar-entrega-lista .box-branca.gestao-entregas-lista {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(248, 250, 252, .98));
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 24px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .10);
}

.tabela-pedidos-montados .table-res {
    min-width: 1320px;
}

.tabela-pedidos-montados th {
    background: #0f172a !important;
    color: #e5edf8 !important;
    border: none !important;
    font-size: 10px !important;
    letter-spacing: .08em;
}

.tabela-pedidos-montados td {
    background: #ffffff !important;
    border-bottom: 1px solid #e8eef5 !important;
    color: #0f172a;
}

.tabela-pedidos-montados tr:hover td {
    background: #f8fbff !important;
}

.badge-origem-despacho,
.badge-km-despacho,
.badge-tempo-despacho,
.badge-pontos-despacho,
.badge-retorno-despacho,
.badge-inversor-despacho,
.badge-chuva-despacho,
.pill-status {
    border-radius: 12px !important;
    padding: 7px 10px !important;
    font-size: 10px !important;
    font-weight: 1000 !important;
    letter-spacing: .02em;
    border: 1px solid transparent;
    box-shadow: none !important;
}

.badge-origem-manual,
.badge-origem-despacho.badge-origem-manual {
    background: #ecfdf5 !important;
    color: #047857 !important;
    border-color: #a7f3d0 !important;
}

.badge-km-despacho {
    background: #eef2ff !important;
    color: #3730a3 !important;
    border-color: #c7d2fe !important;
}

.badge-km-despacho.calculando,
.badge-tempo-despacho.calculando {
    background: #f8fafc !important;
    color: #64748b !important;
    border-color: #dbe4ec !important;
}

.badge-km-despacho.erro,
.badge-tempo-despacho.erro {
    background: #fff7ed !important;
    color: #9a3412 !important;
    border-color: #fed7aa !important;
}

.badge-tempo-despacho {
    background: #ecfeff !important;
    color: #155e75 !important;
    border-color: #a5f3fc !important;
}

.badge-pontos-despacho {
    background: #f0fdf4 !important;
    color: #166534 !important;
    border-color: #bbf7d0 !important;
}

.badge-retorno-despacho.sim {
    background: #fff7ed !important;
    color: #9a3412 !important;
    border-color: #fed7aa !important;
}

.badge-retorno-despacho.nao {
    background: #f8fafc !important;
    color: #475569 !important;
    border-color: #e2e8f0 !important;
}

.badge-inversor-despacho.sim {
    background: #eff6ff !important;
    color: #1d4ed8 !important;
    border-color: #bfdbfe !important;
}

.badge-inversor-despacho.nao {
    background: #f8fafc !important;
    color: #475569 !important;
    border-color: #e2e8f0 !important;
}

.badge-chuva-despacho.ativa {
    background: #fff1f2 !important;
    color: #be123c !important;
    border-color: #fecdd3 !important;
}

.badge-chuva-despacho.inativa {
    background: #f8fafc !important;
    color: #64748b !important;
    border-color: #e2e8f0 !important;
}

.pill-status.st-localizando,
.pill-status {
    background: #fef3c7 !important;
    color: #92400e !important;
    border-color: #fde68a !important;
}

.pill-status.st-selecionado {
    background: #dcfce7 !important;
    color: #166534 !important;
    border-color: #bbf7d0 !important;
}

.pill-status.st-finalizado {
    background: #dcfce7 !important;
    color: #166534 !important;
    border-color: #bbf7d0 !important;
}

.pedido-montado-cliente strong {
    font-size: 12px;
    font-weight: 1000;
    letter-spacing: -.02em;
}

/* Correes de alinhamento final para tabela de pedidos */
.tabela-pedidos-montados {
    overflow-x: auto;
}

.tabela-pedidos-montados .table-res {
    width: 100%;
    min-width: 0 !important;
    table-layout: fixed;
    border-collapse: collapse;
}

.tabela-pedidos-montados th,
.tabela-pedidos-montados td {
    vertical-align: middle !important;
    padding: 10px 12px !important;
    white-space: normal !important;
    word-break: break-word;
}

.tabela-pedidos-montados th {
    text-align: left !important;
}

.tabela-pedidos-montados td {
    text-align: left;
}

.tabela-pedidos-montados td:nth-child(1),
.tabela-pedidos-montados th:nth-child(1) {
    width: 70px;
    text-align: center;
}

.tabela-pedidos-montados td:nth-child(2),
.tabela-pedidos-montados th:nth-child(2) {
    width: 70px;
    text-align: center;
}

.tabela-pedidos-montados td:nth-child(4),
.tabela-pedidos-montados th:nth-child(4) {
    width: 120px;
}

.tabela-pedidos-montados td:nth-child(5),
.tabela-pedidos-montados th:nth-child(5) {
    width: 110px;
}

.tabela-pedidos-montados td:nth-child(9),
.tabela-pedidos-montados th:nth-child(9) {
    width: 90px;
}

.tabela-pedidos-montados td:nth-child(10),
.tabela-pedidos-montados th:nth-child(10) {
    width: 120px;
}

.tabela-pedidos-montados td:nth-child(11),
.tabela-pedidos-montados th:nth-child(11) {
    width: 120px;
}

.tabela-pedidos-montados td:nth-child(12),
.tabela-pedidos-montados th:nth-child(12) {
    text-align: right;
    white-space: nowrap;
}

.pedido-montado-cliente {
    align-items: flex-start;
}

.pedido-montado-cliente small {
    white-space: normal;
}

.endereco-operacao-despacho {
    max-width: 420px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.endereco-operacao-despacho {
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 8px 10px;
    margin-top: 6px;
}

.endereco-operacao-despacho.invertido {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.acoes-topo-gestao-entregas .btn-primario {
    background: linear-gradient(135deg, #00d166, #62f0a0) !important;
    color: #042014 !important;
    border-radius: 16px !important;
    min-height: 46px;
    padding: 13px 18px !important;
    box-shadow: 0 16px 34px rgba(0, 209, 102, .22);
}

.btn-chamar-topo {
    background: linear-gradient(135deg, #111827, #1f2937) !important;
    border-radius: 16px !important;
    min-height: 46px;
    padding: 13px 20px !important;
}

.btn-acoes-pedido>button {
    border-radius: 14px !important;
    min-height: 36px;
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
}

.menu-acoes-pedido {
    border-radius: 16px !important;
}

.gestao-entregas-filtros button.active {
    background: #00d166 !important;
    color: #052016 !important;
    border-color: #00d166 !important;
}

/* =========================================================
   X DELIVERY  AJUSTE VISUAL PADRO IFOOD / PRIME
   Somente visual. No altera lgica.
========================================================= */

:root {
    --xd-red: #ea1d2c;
    --xd-red-dark: #c91020;
    --xd-green: #00a650;
    --xd-dark: #1f2937;
    --xd-text: #111827;
    --xd-muted: #6b7280;
    --xd-line: #e5e7eb;
    --xd-bg-soft: #f7f8fa;
    --xd-card: #ffffff;
}

/* =========================
   CENTRAL DE DESPACHO
========================= */

.tela-montar-entrega-lista .section-title-loja h3 {
    color: var(--xd-text);
    font-size: 26px;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.tela-montar-entrega-lista .section-title-loja p {
    color: var(--xd-muted);
    font-size: 13px;
}

.gestao-entregas-lista {
    background: var(--xd-card) !important;
    border: 1px solid var(--xd-line) !important;
    border-radius: 18px !important;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06) !important;
    padding: 18px !important;
}

.gestao-entregas-topo h4 {
    font-size: 18px !important;
    font-weight: 900 !important;
    color: var(--xd-text) !important;
}

.gestao-entregas-topo p {
    color: var(--xd-muted) !important;
    font-size: 12px !important;
}

#contadorPedidosSelecionadosLoja {
    color: var(--xd-text) !important;
    font-size: 12px !important;
    font-weight: 900 !important;
}

/* filtros estilo iFood */
.gestao-entregas-filtros {
    gap: 8px !important;
    margin-bottom: 14px !important;
}

.gestao-entregas-filtros button {
    background: #fff !important;
    border: 1px solid #d7dde5 !important;
    color: #303a46 !important;
    border-radius: 999px !important;
    padding: 8px 15px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    box-shadow: none !important;
}

.gestao-entregas-filtros button.active,
.gestao-entregas-filtros button:hover {
    background: var(--xd-red) !important;
    border-color: var(--xd-red) !important;
    color: #fff !important;
}

/* tabela mais limpa */
.tabela-pedidos-montados {
    border-radius: 16px !important;
    overflow: visible !important;
    border: 1px solid #e7ebf0 !important;
}

.tabela-pedidos-montados .table-res {
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

.tabela-pedidos-montados th {
    background: #f7f8fa !important;
    color: #4b5563 !important;
    border-bottom: 1px solid #e5e7eb !important;
    font-size: 10px !important;
    font-weight: 900 !important;
    letter-spacing: .06em !important;
    text-transform: uppercase !important;
    padding: 13px 12px !important;
}

.tabela-pedidos-montados td {
    background: #fff !important;
    border-bottom: 1px solid #edf0f3 !important;
    padding: 14px 12px !important;
    color: var(--xd-text) !important;
}

.tabela-pedidos-montados tr:last-child td {
    border-bottom: none !important;
}

.tabela-pedidos-montados tr:hover td {
    background: #fffafa !important;
}

/* checkbox */
.check-pedido-montado {
    width: 18px !important;
    height: 18px !important;
    accent-color: var(--xd-red) !important;
}

/* cliente/endereço */
.pedido-montado-cliente strong {
    color: var(--xd-text) !important;
    font-size: 13px !important;
    font-weight: 900 !important;
}

.pedido-montado-cliente small {
    color: #6b7280 !important;
    font-size: 11px !important;
}

.endereco-operacao-despacho {
    margin-top: 7px !important;
    padding: 7px 9px !important;
    border-radius: 10px !important;
    background: #fff5f5 !important;
    border: 1px solid #ffd6da !important;
    color: #8a1020 !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    line-height: 1.35 !important;
    box-shadow: none !important;
}

.endereco-operacao-despacho.invertido {
    background: #fff0f1 !important;
    border-color: #ffb9c0 !important;
    color: var(--xd-red-dark) !important;
}

/* badges padrão iFood */
.badge-origem-despacho,
.badge-km-despacho,
.badge-tempo-despacho,
.badge-pontos-despacho,
.badge-retorno-despacho,
.badge-inversor-despacho,
.badge-chuva-despacho,
.pill-status {
    border-radius: 999px !important;
    padding: 6px 10px !important;
    font-size: 10px !important;
    font-weight: 900 !important;
    border: 1px solid transparent !important;
    box-shadow: none !important;
    min-width: auto !important;
}

.badge-origem-despacho,
.badge-origem-manual,
.badge-origem-despacho.badge-origem-manual {
    background: #f2f4f7 !important;
    color: #374151 !important;
    border-color: #e5e7eb !important;
}

.badge-km-despacho,
.badge-tempo-despacho,
.badge-pontos-despacho {
    background: #f9fafb !important;
    color: #111827 !important;
    border-color: #e5e7eb !important;
}

.badge-retorno-despacho.sim,
.badge-inversor-despacho.sim {
    background: #fff1f2 !important;
    color: var(--xd-red-dark) !important;
    border-color: #fecdd3 !important;
}

.badge-retorno-despacho.nao,
.badge-inversor-despacho.nao {
    background: #f9fafb !important;
    color: #6b7280 !important;
    border-color: #e5e7eb !important;
}

.badge-chuva-despacho.ativa {
    background: #fff1f2 !important;
    color: var(--xd-red-dark) !important;
    border-color: #fecdd3 !important;
}

.badge-chuva-despacho.inativa {
    background: #f9fafb !important;
    color: #6b7280 !important;
    border-color: #e5e7eb !important;
}

.pill-status,
.pill-status.st-localizando {
    background: #fff7ed !important;
    color: #9a3412 !important;
    border-color: #fed7aa !important;
}

.pill-status.st-selecionado {
    background: #ecfdf5 !important;
    color: #047857 !important;
    border-color: #a7f3d0 !important;
}

/* botes topo */
.acoes-topo-gestao-entregas .btn-primario {
    background: var(--xd-red) !important;
    color: #fff !important;
    border-radius: 12px !important;
    min-height: 42px !important;
    padding: 11px 16px !important;
    box-shadow: 0 10px 22px rgba(234, 29, 44, .22) !important;
}

.acoes-topo-gestao-entregas .btn-primario:hover {
    background: var(--xd-red-dark) !important;
}

.btn-chamar-topo {
    background: #fff !important;
    color: var(--xd-red) !important;
    border: 1px solid #ffc8cf !important;
    border-radius: 12px !important;
    min-height: 42px !important;
    padding: 11px 16px !important;
    box-shadow: none !important;
}

.btn-chamar-topo:hover {
    background: #fff1f2 !important;
}

/* menu aes */
.btn-acoes-pedido>button {
    background: #fff !important;
    border: 1px solid #d7dde5 !important;
    color: #111827 !important;
    border-radius: 10px !important;
    min-height: 34px !important;
    padding: 8px 11px !important;
    font-size: 11px !important;
    font-weight: 900 !important;
}

.btn-acoes-pedido>button:hover {
    background: var(--xd-red) !important;
    border-color: var(--xd-red) !important;
    color: #fff !important;
}

.menu-acoes-pedido {
    border-radius: 14px !important;
    border: 1px solid #e5e7eb !important;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .18) !important;
}

.menu-acoes-pedido a {
    padding: 12px 14px !important;
    font-size: 12px !important;
    color: #111827 !important;
}

.menu-acoes-pedido a:hover {
    background: #fff1f2 !important;
    color: var(--xd-red) !important;
}

/* =========================
   ENTREGAS EM ANDAMENTO
========================= */

#aba-operacional .box-branca {
    border-radius: 18px !important;
    border: 1px solid #e5e7eb !important;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .06) !important;
}

#aba-operacional .table-res th {
    background: #f7f8fa !important;
    color: #4b5563 !important;
}

#aba-operacional .table-res td {
    padding: 13px 12px !important;
}

#aba-operacional .btn-acao,
#aba-pedidos .btn-acao {
    padding: 7px 12px !important;
    font-size: 10px !important;
    border-radius: 999px !important;
    min-height: 30px !important;
    box-shadow: none !important;
}

#aba-operacional .btn-secundario,
#aba-operacional .btn-primario,
#aba-pedidos .btn-secundario,
#aba-pedidos .btn-primario {
    background: var(--xd-red) !important;
    color: #fff !important;
}

#aba-operacional .btn-secundario:hover,
#aba-operacional .btn-primario:hover,
#aba-pedidos .btn-secundario:hover,
#aba-pedidos .btn-primario:hover {
    background: var(--xd-red-dark) !important;
}

/* =========================
   CHAT PADRO MAIS LIMPO
========================= */

.chat-layout-loja,
.chat-container,
#aba-chat .box-branca {
    border-radius: 18px !important;
}

#aba-chat .chat-contatos,
#aba-chat .chat-lista,
.chat-sidebar-loja {
    background: #fff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 18px !important;
}

#aba-chat .chat-mensagens,
.chat-mensagens-loja {
    background: #fff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 18px !important;
}

.mensagem-loja,
.msg-loja,
.chat-msg {
    border-radius: 16px !important;
    box-shadow: none !important;
}

.mensagem-enviada,
.msg-enviada,
.chat-msg.enviada {
    background: #fff1f2 !important;
    border: 1px solid #fecdd3 !important;
    color: #111827 !important;
}

.mensagem-recebida,
.msg-recebida,
.chat-msg.recebida {
    background: #f7f8fa !important;
    border: 1px solid #e5e7eb !important;
    color: #111827 !important;
}

#aba-chat input,
#aba-chat textarea {
    border-radius: 14px !important;
    border: 1px solid #d7dde5 !important;
}

/* Legacy loja chat button overrides removed so WA chat theme can use the admin-style green/black colors */

@media (max-width: 900px) {
    .tabela-pedidos-montados .table-res {
        min-width: 0 !important;
        width: 100% !important;
    }

    .gestao-entregas-lista {
        padding: 14px !important;
    }
}

/* =========================================================
   PATCH V8  COLETA/ENTREGA MAIS LEGVEL E COMPACTO
========================================================= */

.pedido-montado-cliente {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0 !important;
}

.pedido-montado-cliente strong {
    font-size: 13px !important;
    line-height: 1.2;
    font-weight: 1000 !important;
    color: #111827 !important;
}

.pedido-montado-cliente small {
    display: block !important;
    color: #6b7280 !important;
    font-size: 11px !important;
}

.rota-despacho-clean {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
}

.rota-despacho-clean span {
    display: block !important;
    font-size: 11px !important;
    color: #475569 !important;
    line-height: 1.35 !important;
    font-weight: 600 !important;
    white-space: normal !important;
}

.rota-despacho-clean .coleta-clean strong {
    color: #dc2626 !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    font-size: 10px;
    margin-right: 4px;
}

.rota-despacho-clean .entrega-clean strong {
    color: #2563eb !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    font-size: 10px;
    margin-right: 4px;
}

.tabela-pedidos-montados .table-res {
    width: 100% !important;
    min-width: 1000px !important;
    table-layout: auto !important;
    border-collapse: collapse !important;
}

.tabela-pedidos-montados th:nth-child(1),
.tabela-pedidos-montados td:nth-child(1) {
    width: 40px !important;
    min-width: 40px !important;
    text-align: center !important;
}

.tabela-pedidos-montados th:nth-child(2),
.tabela-pedidos-montados td:nth-child(2) {
    min-width: 240px !important;
    max-width: 320px !important;
    width: 280px !important;
    white-space: normal !important;
    word-break: break-word !important;
}

.tabela-pedidos-montados th:nth-child(3),
.tabela-pedidos-montados td:nth-child(3) {
    width: 140px !important;
    min-width: 140px !important;
    max-width: 140px !important;
}

.tabela-pedidos-montados th:nth-child(4),
.tabela-pedidos-montados td:nth-child(4) {
    width: 110px !important;
    min-width: 110px !important;
    max-width: 110px !important;
}

.pedido-montado-km-tempo {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-start;
}

.tabela-pedidos-montados th,
.tabela-pedidos-montados td {
    text-align: left !important;
    padding: 12px 14px !important;
    white-space: nowrap !important;
    word-break: normal !important;
}



@media (max-width: 900px) {
    .pedido-montado-cliente {
        min-width: 0 !important;
    }

    .endereco-operacao-despacho {
        max-width: 100%;
    }
}

/* =========================================================
   FINANCEIRO DA LOJA  ABAS CRDITOS / HISTÓRICO
   Mantm IDs existentes de PIX e recargas.
========================================================= */
.financeiro-box-abas {
    padding: 18px;
    overflow: hidden;
}

.financeiro-box-abas>input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.financeiro-abas-header {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
    padding: 6px;
    border-radius: 18px;
    background: #eef3f8;
    border: 1px solid #dce6ef;
}

.financeiro-tab-label {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
        "ico titulo"
        "ico texto";
    gap: 2px 10px;
    align-items: center;
    min-height: 64px;
    padding: 12px 14px;
    border-radius: 14px;
    color: #334155;
    cursor: pointer;
    transition: .2s ease;
    border: 1px solid transparent;
}

.financeiro-tab-label span {
    grid-area: ico;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 6px 15px rgba(15, 23, 42, .06);
}

.financeiro-tab-label strong {
    grid-area: titulo;
    font-size: 14px;
    font-weight: 950;
    line-height: 1.1;
}

.financeiro-tab-label small {
    grid-area: texto;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    line-height: 1.25;
}

#financeiroAbaCreditos:checked~.financeiro-abas-header label[for="financeiroAbaCreditos"],
#financeiroAbaHistorico:checked~.financeiro-abas-header label[for="financeiroAbaHistorico"] {
    background: #ffffff;
    color: #061524;
    border-color: rgba(0, 209, 102, .35);
    box-shadow: 0 12px 28px rgba(15, 23, 42, .08);
}

#financeiroAbaCreditos:checked~.financeiro-abas-header label[for="financeiroAbaCreditos"] span,
#financeiroAbaHistorico:checked~.financeiro-abas-header label[for="financeiroAbaHistorico"] span {
    background: #00d166;
    color: #061524;
}

.financeiro-tab-content {
    display: none;
    animation: financeiroFade .22s ease;
}

#financeiroAbaCreditos:checked~.financeiro-content-creditos,
#financeiroAbaHistorico:checked~.financeiro-content-historico {
    display: block;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.financeiro-subtitulo {
    margin-bottom: 12px;
}

.financeiro-subtitulo h3 {
    font-size: 18px !important;
}

.financeiro-toolbar {
    align-items: flex-end;
}

.campo-valor-recarga {
    max-width: 320px;
}

.resultado-pix-loja,
.historico-recargas-loja {
    border-radius: 16px;
    border: 1px dashed #cbd5e1;
    background: #f8fafc;
}

.financeiro-extrato-resumo {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 8px 0 16px;
}

.extrato-card-resumo {
    padding: 16px;
    border-radius: 16px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.extrato-card-resumo.saidas {
    background: #fff7ed;
    border-color: #fed7aa;
}

.extrato-card-resumo.saldo {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.extrato-card-resumo small {
    display: block;
    margin-bottom: 6px;
    color: #64748b;
    font-size: 10px;
    font-weight: 950;
    text-transform: uppercase;
}

.extrato-card-resumo strong {
    display: block;
    color: #0f172a;
    font-size: 22px;
    line-height: 1.1;
}

.financeiro-extrato-table {
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    background: #fff;
}

.financeiro-extrato-table .table-res th,
.financeiro-extrato-table .table-res td {
    padding: 12px 14px;
}

.financeiro-extrato-ajuda {
    display: grid;
    gap: 4px;
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 13px;
    line-height: 1.45;
}

.financeiro-extrato-ajuda strong {
    color: #0f172a;
}

@media (max-width: 860px) {

    .financeiro-abas-header,
    .financeiro-extrato-resumo {
        grid-template-columns: 1fr;
    }

    .campo-valor-recarga {
        max-width: 100%;
    }

    .financeiro-tab-label {
        min-height: 58px;
    }
}

/* =========================================================
   X-DELIVERY  MENU DEFINITIVO CORRIGIDO
   Correo final pedida:
   - Menu escondido por padrão e abre no boto de 3 riscos.
   - Sem X no boto e sem X nos painis flutuantes.
   - Menu mais largo, avanando para a direita.
   - Nome da loja em cima, foto no meio, relgio abaixo.
   - Letras das abas mais visveis e com respiro.
   - Contedo se ajusta no desktop e fica responsivo no mobile.
   - Mantm IDs, HTML e JS atuais.
========================================================= */

:root {
    --xd-menu-width: 360px;
    --xd-menu-mobile-width: min(360px, calc(100vw - 18px));
    --xd-menu-dark: #061524;
    --xd-menu-dark-2: #071d2c;
    --xd-menu-border: rgba(0, 209, 102, .18);
    --xd-menu-green: #00d166;
}

html,
body {
    width: 100% !important;
    min-height: 100% !important;
    overflow-x: hidden !important;
}

body {
    overflow: hidden !important;
    background: #f4f7f9 !important;
}

.loja-layout {
    display: flex !important;
    flex-direction: row !important;
    width: 100% !important;
    height: 100vh !important;
    max-height: 100vh !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

.loja-main {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 100vh !important;
    max-height: 100vh !important;
    min-height: 0 !important;
    padding: 0 !important;
    padding-left: var(--loja-sidebar-w, 0px) !important;
    margin-left: 0 !important;
    overflow: hidden !important;
    transition: transform 0.24s cubic-bezier(0.4, 0.0, 0.2, 1),
                width 0.24s cubic-bezier(0.4, 0.0, 0.2, 1),
                margin-left 0.24s cubic-bezier(0.4, 0.0, 0.2, 1) !important;
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
}

/* Quando o JS abre o menu, o contedo acompanha no desktop */
@media (min-width: 901px) {
    body.loja-menu-aberto .loja-main {
        transform: translateX(0) !important;
        margin-left: var(--xd-menu-width) !important;
        width: calc(100vw - var(--xd-menu-width)) !important;
        max-width: calc(100vw - var(--xd-menu-width)) !important;
    }
}

/* Boto hamburguer fixo: nunca vira X */
#btnMenuLoja,
#btnMenuLoja.loja-menu-toggle,
.loja-menu-toggle {
    position: fixed !important;
    top: 14px !important;
    left: 14px !important;
    z-index: 30050 !important;
    left: 14px !important;
    z-index: 30050 !important;
    width: 44px !important;
    height: 44px !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-direction: column !important;
    gap: 5px !important;
    padding: 0 !important;
    margin: 0 !important;
    color: transparent !important;
    font-size: 0 !important;
    line-height: 0 !important;
    transform: none !important;
}

#btnMenuLoja::before,
#btnMenuLoja::after,
#btnMenuLoja.loja-menu-toggle::before,
#btnMenuLoja.loja-menu-toggle::after,
.loja-menu-toggle::before,
.loja-menu-toggle::after {
    content: none !important;
    display: none !important;
}

#btnMenuLoja span,
#btnMenuLoja.loja-menu-toggle span,
.loja-menu-toggle span {
    display: block !important;
    width: 22px !important;
    height: 2px !important;
    min-height: 2px !important;
    max-height: 2px !important;
    border-radius: 999px !important;
    background: var(--xd-menu-green) !important;
    opacity: 1 !important;
    transform: none !important;
    rotate: 0deg !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Sidebar escondida por padrão */
#lojaSidebar,
.loja-sidebar {
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    width: var(--xd-menu-width) !important;
    min-width: var(--xd-menu-width) !important;
    max-width: var(--xd-menu-width) !important;
    height: 100vh !important;
    max-height: 100vh !important;
    z-index: 30000 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    color: #fff !important;
    background:
        radial-gradient(circle at top left, rgba(0, 209, 102, .14), transparent 34%),
        linear-gradient(180deg, rgba(7, 29, 44, .99) 0%, rgba(6, 21, 36, 1) 55%, rgba(4, 15, 27, 1) 100%) !important;
    border-right: 1px solid var(--xd-menu-border) !important;
    box-shadow: 18px 0 42px rgba(2, 6, 23, .24) !important;
    transform: translateX(-105%) !important;
    transition: transform .24s ease !important;
}

/* Estados de aberto aceitando as classes usadas pelo JS atual */
#lojaSidebar.aberta,
#lojaSidebar.open,
#lojaSidebar.active,
.loja-sidebar.aberta,
.loja-sidebar.open,
.loja-sidebar.active,
body.loja-menu-aberto #lojaSidebar,
body.menu-loja-aberto #lojaSidebar,
body.sidebar-aberta #lojaSidebar,
body.menu-aberto #lojaSidebar,
body.sidebar-open #lojaSidebar,
body.loja-sidebar-aberta #lojaSidebar,
body.loja-menu-aberto .loja-sidebar,
body.menu-loja-aberto .loja-sidebar,
body.sidebar-aberta .loja-sidebar,
body.menu-aberto .loja-sidebar,
body.sidebar-open .loja-sidebar,
body.loja-sidebar-aberta .loja-sidebar {
    transform: translateX(0) !important;
}

/* Backdrop: aparece somente quando aberto, sem atrapalhar desktop */
#lojaSidebarBackdrop,
.loja-sidebar-backdrop {
    position: fixed !important;
    inset: 0 !important;
    z-index: 29990 !important;
    display: none !important;
    background: rgba(2, 6, 23, .46) !important;
    backdrop-filter: blur(3px) !important;
}

@media (max-width: 900px) {

    body.loja-menu-aberto #lojaSidebarBackdrop,
    body.menu-loja-aberto #lojaSidebarBackdrop,
    body.sidebar-aberta #lojaSidebarBackdrop,
    body.menu-aberto #lojaSidebarBackdrop,
    body.sidebar-open #lojaSidebarBackdrop,
    body.loja-sidebar-aberta #lojaSidebarBackdrop,
    #lojaSidebarBackdrop.aberto,
    #lojaSidebarBackdrop.open,
    #lojaSidebarBackdrop.active,
    .loja-sidebar-backdrop.aberto,
    .loja-sidebar-backdrop.open,
    .loja-sidebar-backdrop.active {
        display: block !important;
    }
}

/* Topo do menu: maior, respirando e com ordem correta */
.loja-sidebar-header {
    flex: 0 0 auto !important;
    padding: 62px 26px 18px !important;
    border-bottom: 1px solid rgba(255, 255, 255, .08) !important;
    overflow: visible !important;
}

.loja-top-brand,
.loja-topo-organizado-v11,
.loja-sidebar-header .loja-top-brand,
.loja-sidebar-header .loja-topo-organizado-v11 {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 9px !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: center !important;
}

/* Nome da loja em cima */
#nomeFantasia,
.loja-top-brand h2,
.loja-sidebar-header #nomeFantasia,
.loja-sidebar-header .loja-top-brand h2 {
    width: 100% !important;
    max-width: 305px !important;
    margin: 0 auto !important;
    padding: 0 4px !important;
    color: #ffffff !important;
    font-size: 17px !important;
    line-height: 1.22 !important;
    font-weight: 950 !important;
    text-align: center !important;
    letter-spacing: -.02em !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
}

/* Foto no menu lateral (não afeta o header do painel) */
.loja-top-brand img,
.loja-sidebar-header #fotoPerfil,
.loja-sidebar-header .loja-top-brand img {
    display: block !important;
    width: 78px !important;
    height: 78px !important;
    min-width: 78px !important;
    min-height: 78px !important;
    max-width: 78px !important;
    max-height: 78px !important;
    object-fit: cover !important;
    border-radius: 0 !important;
    margin: 0 auto !important;
    padding: 0 !important;
    background: #0b1220 !important;
    border: 2px solid rgba(0, 209, 102, .78) !important;
    box-shadow: 0 12px 26px rgba(0, 209, 102, .14) !important;
}

/* Relgio embaixo */
#relogioLoja,
.loja-top-brand p,
.loja-sidebar-header #relogioLoja,
.loja-sidebar-header .loja-top-brand p {
    display: block !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 0 !important;
    color: var(--xd-menu-green) !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    font-size: 13px !important;
    line-height: 1.2 !important;
    font-weight: 950 !important;
    text-align: center !important;
    font-variant-numeric: tabular-nums !important;
}

/* Status/saldo ajustados para o menu maior */
.loja-status-box {
    margin-top: 18px !important;
    padding: 15px !important;
    border-radius: 17px !important;
    background: rgba(255, 255, 255, .055) !important;
    border: 1px solid rgba(255, 255, 255, .08) !important;
}

.saldo-box-loja {
    margin-top: 14px !important;
    padding: 15px !important;
    border-radius: 17px !important;
    background: rgba(0, 209, 102, .10) !important;
    border: 1px solid rgba(0, 209, 102, .20) !important;
}

.saldo-box-loja strong {
    font-size: 25px !important;
}

/* Abas mais visveis */
.loja-nav.loja-nav {
    display: flex !important;
    flex-direction: row !important;
    gap: 8px !important;
    padding: 0 15px !important;
    margin-top: 0 !important;
    flex: 0 0 auto !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

.loja-nav::-webkit-scrollbar,
.loja-sidebar::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
}

.loja-nav button {
    width: auto !important;
    min-height: 40px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 8px 12px !important;
    background: transparent !important;
    color: #94a3b8 !important;
    text-align: center !important;
    font-size: 13px !important;
    line-height: 1.18 !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    transition: .18s ease !important;
}

.loja-nav button .icon-menu {
    font-size: 16px !important;
    color: #4ade80 !important;
    width: 20px !important;
    text-align: center !important;
    display: inline-block !important;
}

.loja-nav button:hover {
    background: rgba(255, 255, 255, .04) !important;
    color: #f8fafc !important;
    transform: translateX(2px) !important;
}

.loja-nav button.active {
    background: rgba(255, 255, 255, .08) !important;
    color: #ffffff !important;
    box-shadow: none !important;
    font-weight: 800 !important;
}

.loja-nav button.active .icon-menu {
    color: #fcd34d !important;
}

.loja-sidebar-footer {
    padding: 20px 15px !important;
    margin-top: 20px !important;
    border-top: 1px solid rgba(255, 255, 255, .05) !important;
}

.btn-sair-loja {
    width: 100% !important;
    min-height: 46px !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 13px 15px !important;
    background: transparent !important;
    color: #ef4444 !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    transition: .18s ease !important;
}

.btn-sair-loja:hover {
    background: rgba(239, 68, 68, 0.1) !important;
}

/* Remove o X que voc pediu para tirar */
.painel-base-fechar,
.ficha-fechar {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Contedo e tabelas continuam ocupando o espao correto */
.painel-section,
.box-branca,
.mapa-wrapper,
.table-container,
.gestao-entregas-lista,
.config-grid,
.financeiro-box-abas {
    max-width: 100% !important;
}

#map {
    width: 100% !important;
}

.table-container {
    overflow-x: auto !important;
    overflow-y: visible !important;
}

/* Responsivo */
@media (max-width: 900px) {

    #lojaSidebar,
    .loja-sidebar {
        width: var(--xd-menu-mobile-width) !important;
        min-width: var(--xd-menu-mobile-width) !important;
        max-width: var(--xd-menu-mobile-width) !important;
    }

    .loja-main {
        width: 100% !important;
        margin-left: 0 !important;
        padding: 76px 14px 18px !important;
    }

    .loja-sidebar-header {
        padding: 62px 20px 16px !important;
    }

    #nomeFantasia,
    .loja-top-brand h2 {
        max-width: 100% !important;
        font-size: 16px !important;
    }

    .loja-sidebar-header #fotoPerfil,
    .loja-top-brand img {
        width: 72px !important;
        height: 72px !important;
        min-width: 72px !important;
        min-height: 72px !important;
        max-width: 72px !important;
        max-height: 72px !important;
    }
}

/* =========================================================
   X-DELIVERY  FINALIZAO ENDEREO / SUGESTES
   Mantm o visual aprovado do menu e corrige a rea:
   - Novo pedido / Montar Entrega
   - Configuraes / Busca de Endereo
   - Campo de rua/endereço mais apresentvel
   - Nmero ao lado em telas largas
   - Sugestes bonitas, sem quadrados feios
========================================================= */

/* Drawer Novo Pedido — layout flex (sem padding no container raiz) */
.ficha-pedido-drawer {
    width: min(1120px, 100%) !important;
    max-width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    max-height: none !important;
    flex: 1 1 auto !important;
    align-self: stretch !important;
    padding: 0 !important;
    background: #ffffff !important;
    box-sizing: border-box !important;
}

.ficha-pedido-header {
    border-bottom: 1px solid #dbe4ec !important;
    padding-bottom: 14px !important;
    margin-bottom: 0 !important;
}

.ficha-pedido-header h3 {
    font-size: 22px !important;
    letter-spacing: -0.03em !important;
}

.ficha-mapa-preview {
    height: auto !important;
    min-height: 0 !important;
    border-radius: 18px !important;
    margin: 12px 8px 12px 16px !important;
}

/* Blocos internos do formulário */
.ficha-bloco {
    margin-bottom: 18px !important;
}

.ficha-bloco h4 {
    font-size: 13px !important;
    font-weight: 950 !important;
    color: #0f172a !important;
    margin-bottom: 12px !important;
}

/* Grid do formulário: endereço/rua maior e nmero ao lado */
.ficha-bloco .pedido-grid,
.ficha-bloco .pedido-grid-3,
#aba-configuracoes .pedido-grid,
#aba-configuracoes .config-grid .pedido-grid,
#aba-configuracoes .box-branca .pedido-grid {
    display: grid !important;
    gap: 12px !important;
    align-items: start !important;
}

.ficha-bloco .pedido-grid-endereco-principal {
    grid-template-columns: minmax(0, 1fr) minmax(72px, 118px) !important;
}

.ficha-pedido-drawer .ficha-bloco input,
.ficha-pedido-drawer .ficha-bloco select,
.ficha-pedido-drawer .ficha-bloco textarea {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
}

.ficha-bloco .pedido-grid-3 {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) !important;
}

/* Quando algum campo precisar ocupar linha toda */
.ficha-bloco .campo-endereco-full,
.ficha-bloco .campo-full,
.campo-endereco-full,
.campo-full {
    grid-column: 1 / -1 !important;
}

/* Inputs mais elegantes */
.ficha-bloco input,
.ficha-bloco select,
.ficha-bloco textarea,
#aba-configuracoes input,
#aba-configuracoes select,
#aba-configuracoes textarea {
    min-height: 44px !important;
    border-radius: 13px !important;
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
    color: #0f172a !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    padding: 11px 13px !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8) !important;
}

.ficha-bloco input:focus,
.ficha-bloco select:focus,
.ficha-bloco textarea:focus,
#aba-configuracoes input:focus,
#aba-configuracoes select:focus,
#aba-configuracoes textarea:focus {
    border-color: #00d166 !important;
    box-shadow: 0 0 0 4px rgba(0, 209, 102, .12) !important;
}

/* Labels menores, alinhadas e profissionais */
.ficha-bloco label,
.ficha-bloco .campo-inline label,
#aba-configuracoes label,
#aba-configuracoes .campo-inline label {
    display: block !important;
    margin-bottom: 6px !important;
    color: #0f172a !important;
    font-size: 10px !important;
    line-height: 1.1 !important;
    font-weight: 950 !important;
    letter-spacing: .04em !important;
    text-transform: uppercase !important;
}

/* Configuraes: Busca de Endereo organizada */
#aba-configuracoes .config-grid {
    display: block !important;
    grid-template-columns: none !important;
    align-items: stretch !important;
}

#aba-configuracoes .box-branca {
    overflow: visible !important;
}

#aba-configuracoes .box-branca h3,
#aba-configuracoes .box-branca h4 {
    letter-spacing: -0.03em !important;
}

/* O bloco de rua/endereço nas configuraes fica mais limpo */
#aba-configuracoes input[id*="Rua"],
#aba-configuracoes input[id*="rua"],
#aba-configuracoes input[name*="rua"],
#aba-configuracoes input[name*="endereco"],
#aba-configuracoes input[id*="endereco"] {
    font-weight: 800 !important;
}

/* Sugestes de rua/endereço  troca os quadrados feios por dropdown profissional */
.sugestoes-endereco,
.sugestoes-rua,
.lista-sugestoes,
.endereco-sugestoes,
.dropdown-ruas,
#sugestoesRuaLoja,
#listaSugestoesRuaLoja,
#lista-ruas,
#sugestoesEndereco,
#sugestoesEnderecoLoja,
#sugestoesRua,
#listaSugestoesRua,
[id*="sugestoes"],
[class*="sugestoes"] {
    position: relative !important;
    z-index: 9998 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 6px !important;
    padding: 6px !important;
    border-radius: 14px !important;
    border: 1px solid rgba(15, 23, 42, .10) !important;
    background: #ffffff !important;
    box-shadow: 0 18px 38px rgba(15, 23, 42, .16) !important;
    overflow: hidden !important;
}

/* Se a lista estiver vazia, desaparece */
.sugestoes-endereco:empty,
.sugestoes-rua:empty,
.lista-sugestoes:empty,
.endereco-sugestoes:empty,
.dropdown-ruas:empty,
#sugestoesRuaLoja:empty,
#listaSugestoesRuaLoja:empty,
#lista-ruas:empty,
#sugestoesEndereco:empty,
#sugestoesEnderecoLoja:empty,
#sugestoesRua:empty,
#listaSugestoesRua:empty, [id*="sugestoes"]:empty, [class*="sugestoes"]:empty, [id*="sugestoes"]:not(:has(*)), [class*="sugestoes"]:not(:has(*)) {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
}

/* Cada item da sugesto */
.sugestoes-endereco>*,
.sugestoes-rua>*,
.lista-sugestoes>*,
.endereco-sugestoes>*,
.dropdown-ruas>*,
#sugestoesRuaLoja>*,
#listaSugestoesRuaLoja>*,
#lista-ruas>*,
#sugestoesEndereco>*,
#sugestoesEnderecoLoja>*,
#sugestoesRua>*,
#listaSugestoesRua>*,
[id*="sugestoes"]>*,
[class*="sugestoes"]>* {
    display: block !important;
    width: 100% !important;
    padding: 10px 12px !important;
    margin: 0 !important;
    border: 0 !important;
    border-bottom: 1px solid #eef2f7 !important;
    border-radius: 10px !important;
    background: #ffffff !important;
    color: #0f172a !important;
    font-size: 12px !important;
    line-height: 1.25 !important;
    font-weight: 850 !important;
    text-align: left !important;
    cursor: pointer !important;
    transition: .16s ease !important;
    white-space: normal !important;
}

.sugestoes-endereco>*:last-child,
.sugestoes-rua>*:last-child,
.lista-sugestoes>*:last-child,
.endereco-sugestoes>*:last-child,
.dropdown-ruas>*:last-child,
#sugestoesRuaLoja>*:last-child,
#listaSugestoesRuaLoja>*:last-child,
#lista-ruas>*:last-child,
#sugestoesEndereco>*:last-child,
#sugestoesEnderecoLoja>*:last-child,
#sugestoesRua>*:last-child,
#listaSugestoesRua>*:last-child {
    border-bottom: 0 !important;
}

.sugestoes-endereco>*:hover,
.sugestoes-rua>*:hover,
.lista-sugestoes>*:hover,
.endereco-sugestoes>*:hover,
.dropdown-ruas>*:hover,
#sugestoesRuaLoja>*:hover,
#listaSugestoesRuaLoja>*:hover,
#lista-ruas>*:hover,
#sugestoesEndereco>*:hover,
#sugestoesEnderecoLoja>*:hover,
#sugestoesRua>*:hover,
#listaSugestoesRua>*:hover {
    background: #ecfdf5 !important;
    color: #065f46 !important;
    transform: translateX(2px) !important;
}

/* Alguns scripts criam botes/divs cinzas; fora acabamento */
.ficha-pedido-drawer [style*="border"],
#aba-configuracoes [style*="border"] {
    box-sizing: border-box !important;
}

/* rea de complemento sempre limpa e confortvel */
.ficha-bloco textarea,
textarea[id*="obs"],
textarea[id*="Observacao"],
textarea[id*="observacao"] {
    min-height: 78px !important;
    line-height: 1.4 !important;
}

/* Botes do rodap da ficha — layout principal em .ficha-acoes acima */
.ficha-acoes .btn-acao {
    min-height: 48px !important;
    border-radius: 14px !important;
    font-weight: 800 !important;
}

/* Mobile: grids em coluna */
@media (max-width: 768px) {
    .ficha-bloco .pedido-grid-endereco-principal,
    .ficha-bloco .pedido-grid-bairro-cidade,
    .ficha-bloco .pedido-grid-cliente,
    .ficha-bloco .pedido-grid-pagamento,
    .ficha-bloco .pedido-grid:not(.pedido-grid-complemento),
    .ficha-bloco .pedido-grid-3,
    #aba-configuracoes .pedido-grid,
    #aba-configuracoes .config-grid .pedido-grid,
    #aba-configuracoes .box-branca .pedido-grid {
        grid-template-columns: 1fr !important;
    }

    .ficha-bloco .pedido-grid-complemento {
        grid-template-columns: minmax(0, 1.2fr) minmax(120px, 0.8fr) !important;
    }

    .ficha-pedido-corpo {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(160px, 28vh) minmax(0, 1fr);
    }

    .ficha-mapa-preview {
        height: 100% !important;
        min-height: 0 !important;
        margin: 12px 16px 0 !important;
    }

    .ficha-pedido-form-col {
        border-left: 0;
        border-top: 1px solid #e2e8f0;
    }

    .ficha-pedido-scroll {
        padding-left: 16px;
        padding-right: 16px;
    }

    .sugestoes-endereco,
    .sugestoes-rua,
    .lista-sugestoes,
    .endereco-sugestoes,
    .dropdown-ruas,
    #sugestoesRuaLoja,
    #listaSugestoesRuaLoja,
    #lista-ruas,
    #sugestoesEndereco,
    #sugestoesEnderecoLoja,
    #sugestoesRua,
    #listaSugestoesRua,
    [id*="sugestoes"],
    [class*="sugestoes"] {
        max-height: 230px !important;
        overflow-y: auto !important;
    }
}

/* MUDANA: TABELAS COMO CARDS (GRID DE PEDIDOS) UNIFICADO */
.pedidos-unified-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
    gap: 16px !important;
    padding: 10px 0 !important;
    align-items: start !important;
}

/* Make all nested containers display: contents to flow into the grid */
.pedidos-unified-grid .subtab-content,
.pedidos-unified-grid .table-container,
.pedidos-unified-grid .table-res,
.pedidos-unified-grid tbody,
.pedidos-unified-grid .grid-pedidos-integracao-loja {
    display: contents !important;
}

/* Hide unwanted tab-specific headers, search bars, and placeholders */
.pedidos-unified-grid thead,
.pedidos-unified-grid .section-title-loja,
.pedidos-unified-grid .toolbar-busca,
.pedidos-unified-grid .placeholder-integracao-loja,
.pedidos-unified-grid td.historico-vazio::before {
    display: none !important;
}

/* Style the rows as cards (Accordion logic) */
.pedidos-unified-grid tr,
.pedidos-unified-grid .card-pedido-integracao {
    display: flex !important;
    flex-direction: column !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 16px !important;
    padding: 14px !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05) !important;
    position: relative !important;
    transition: transform 0.2s, box-shadow 0.2s !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    cursor: pointer; /* Makes it clickable */
}
.pedidos-unified-grid tr:hover,
.pedidos-unified-grid .card-pedido-integracao:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08) !important;
}

/* ESCONDER CLULAS POR PADRO (S MOSTRA ID e STATUS) */
.pedidos-unified-grid tr:not(.card-expanded) td:not(:nth-child(2)):not(:nth-child(8)) {
    display: none !important;
}

/* Esconder cards vazios na aba Pedidos */
#aba-pedidos .pedidos-unified-grid tr:has(.historico-vazio) {
    display: none !important;
}

/* Global Empty Message for Unified Grid */
.global-vazio-pedidos {
    display: none !important;
    grid-column: 1 / -1 !important;
    text-align: center !important;
    padding: 60px 20px !important;
    color: #64748b !important;
    font-size: 15px !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Se a grid NO TIVER nenhum 'tr' vlido E no tiver nenhum '.card-pedido-integracao', mostra a mensagem global! */
#aba-pedidos .pedidos-unified-grid:not(:has(tr:not(:has(.historico-vazio)))):not(:has(.card-pedido-integracao)) .global-vazio-pedidos {
    display: block !important;
}

/* Tambm escondemos os painis vazios individuais das integraes para evitar duplicidade com a mensagem global */
#aba-pedidos .pedidos-unified-grid:not(:has(tr:not(:has(.historico-vazio)))):not(:has(.card-pedido-integracao)) .painel-vazio-integracao {
    display: none !important;
}

#aba-historico .pedidos-unified-grid tr.historico-vazio-row {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 220px;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    cursor: default !important;
    padding: 60px 20px !important;
    transform: none !important;
}
#aba-historico .pedidos-unified-grid tr.historico-vazio-row:hover {
    transform: none !important;
    box-shadow: none !important;
}
#aba-historico .pedidos-unified-grid tr.historico-vazio-row td {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
    border: none !important;
    color: #64748b !important;
    font-size: 15px !important;
    padding: 0 !important;
}
#aba-historico .pedidos-unified-grid tr.historico-vazio-row td::before {
    display: none !important;
}

/* Estilizar mensagem de vazio no Histórico */
#aba-historico .pedidos-unified-grid tr:has(.historico-vazio) {
    display: block !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    text-align: center !important;
    padding: 60px 20px !important;
    cursor: default;
}
#aba-historico .pedidos-unified-grid:has(tr:not(:has(.historico-vazio))) tr:has(.historico-vazio) { display: none !important; }
#aba-historico .pedidos-unified-grid tr:has(.historico-vazio)::after {
    display: none !important;
}
#aba-historico .pedidos-unified-grid tr:has(.historico-vazio) td {
    display: block !important;
    border: none !important;
    color: #64748b !important;
    font-size: 15px !important;
}
#aba-historico .pedidos-unified-grid tr:has(.historico-vazio) td::before {
    display: none !important;
}

/* Estilo do ID quando fechado */
.pedidos-unified-grid tr:not(.card-expanded) td:nth-child(2) {
    font-size: 16px !important;
    font-weight: 800 !important;
    border-bottom: none !important;
    color: #1e293b !important;
    padding-bottom: 0 !important;
    padding-right: 30px !important;
}
.pedidos-unified-grid tr:not(.card-expanded) td:nth-child(2)::before {
    display: none !important; /* Esconde a label "ID:" quando fechado */
}

.pedido-id-card {
    display: inline-block;
    white-space: nowrap;
    word-break: keep-all;
    overflow-wrap: normal;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.pedidos-unified-grid td:nth-child(2) .pedido-id-card,
#aba-operacional .table-res td:nth-child(2) .pedido-id-card {
    font-size: 16px;
    font-weight: 800;
    color: #1e293b;
}

.pedidos-unified-grid tr:not(.card-expanded) td:nth-child(2),
.pedidos-unified-grid tr.card-expanded td:nth-child(2),
#aba-operacional .table-res td:nth-child(2) {
    white-space: nowrap !important;
    overflow-wrap: normal !important;
    word-break: keep-all !important;
}

/* Estilo do Status quando fechado */
.pedidos-unified-grid tr:not(.card-expanded) td:nth-child(8) {
    border-bottom: none !important;
    padding-top: 4px !important;
    padding-right: 30px !important;
}
.pedidos-unified-grid tr:not(.card-expanded) td:nth-child(8)::before {
    display: none !important; /* Esconde a label "Status:" quando fechado */
}

/* cone indicativo de expandir/recolher */
.pedidos-unified-grid tr::after,
.pedidos-unified-grid .card-pedido-integracao::after {
    content: '\f107'; /* fa-angle-down */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 18px;
    top: 18px;
    color: #94a3b8;
    font-size: 16px;
    transition: transform 0.3s;
}
.pedidos-unified-grid tr.card-expanded::after,
.pedidos-unified-grid .card-pedido-integracao.card-expanded::after {
    transform: rotate(180deg);
}

/* iFood/PDV Integration Card logic */
/* Hide extra info in integration cards unless expanded */
.pedidos-unified-grid .card-pedido-integracao:not(.card-expanded) > div:not(:first-child) {
    display: none !important;
}
.pedidos-unified-grid .card-pedido-integracao:not(.card-expanded) > div:first-child {
    border-bottom: none !important;
}

/* Style the td cells */
.pedidos-unified-grid td {
    display: flex !important;
    justify-content: flex-start !important;
    align-items: flex-start !important;
    padding: 6px 0 !important;
    border: none !important;
    border-bottom: 1px solid #f1f5f9 !important;
    font-size: 13px !important;
    color: #475569 !important;
    gap: 8px !important;
    min-width: 0 !important;
    max-width: 100% !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    line-height: 1.45 !important;
}
.pedidos-unified-grid td .pedido-card-valor {
    flex: 1 1 0;
    min-width: 0;
    max-width: 100%;
}
.pedidos-unified-grid tr.card-expanded td:nth-child(5) {
    flex-wrap: wrap !important;
}
.pedidos-unified-grid tr.card-expanded td:nth-child(5)::before {
    flex: 0 0 100% !important;
    width: 100% !important;
    margin-bottom: 2px !important;
}
.pedidos-unified-grid td:last-child {
    border-bottom: none !important;
    flex-direction: column !important;
    align-items: stretch !important;
    margin-top: 10px !important;
}

/* Labels for each cell */
.pedidos-unified-grid td:nth-child(1)::before { content: 'Tempo:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; width: 70px; }
.pedidos-unified-grid td:nth-child(2)::before { content: 'ID:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; width: 70px; }
.pedidos-unified-grid td:nth-child(3)::before { content: 'Cliente:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; width: 70px; }
.pedidos-unified-grid td:nth-child(4)::before { content: 'Entregador:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; width: 70px; }
.pedidos-unified-grid td:nth-child(5)::before { content: 'Endereo:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; width: 70px; }
.pedidos-unified-grid td:nth-child(6)::before { content: 'Valor:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; width: 70px; }
.pedidos-unified-grid td:nth-child(7)::before { content: 'Taxa:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; width: 70px; }
.pedidos-unified-grid td:nth-child(8)::before { content: 'Status:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; width: 70px; }
.pedidos-unified-grid td:nth-child(9)::before { content: 'Aes:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; width: 70px; display: none; }

/* Empty state */
.pedidos-unified-grid td.historico-vazio { 
    display: none !important; /* Hide empty placeholders since everything is unified */
}
.pedidos-unified-grid .painel-vazio-integracao {
    display: none !important;
}

/* Fix Operacional list which is not in the unified grid */
#aba-operacional .table-res, #aba-operacional .table-res thead, #aba-operacional .table-res tbody {
    display: block !important;
    width: 100% !important;
}
#aba-operacional .table-res thead { display: none !important; }
#aba-operacional .table-res tbody { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important; gap: 16px !important; }
#aba-operacional .table-res tr { display: flex !important; flex-direction: column !important; background: #ffffff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 14px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); min-width: 0; max-width: 100%; overflow: hidden; box-sizing: border-box; }
#aba-operacional .table-res td { display: flex !important; align-items: flex-start; padding: 6px 0; border-bottom: 1px solid #f1f5f9; font-size: 13px; gap: 8px; min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; word-break: break-word; line-height: 1.45; }
#aba-operacional .table-res td:nth-child(5) { flex-wrap: wrap; }
#aba-operacional .table-res td:nth-child(5)::before { flex: 0 0 100%; width: 100%; margin-bottom: 2px; }
#aba-operacional .table-res td:last-child { flex-direction: column; align-items: stretch; border: none; margin-top: 10px; }
#aba-operacional .table-res td:nth-child(1)::before { content: 'Tempo:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; width: 70px; }
#aba-operacional .table-res td:nth-child(2)::before { content: 'ID:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; width: 70px; }
#aba-operacional .table-res td:nth-child(3)::before { content: 'Cliente:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; width: 70px; }
#aba-operacional .table-res td:nth-child(4)::before { content: 'Entregador:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; width: 70px; }
#aba-operacional .table-res td:nth-child(5)::before { content: 'Endereo:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; width: 70px; }
#aba-operacional .table-res td:nth-child(6)::before { content: 'Valor:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; width: 70px; }
#aba-operacional .table-res td:nth-child(7)::before { content: 'Taxa:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; width: 70px; }
#aba-operacional .table-res td:nth-child(8)::before { content: 'Status:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; width: 70px; }
#aba-operacional .table-res td:nth-child(9)::before { content: 'Aes:'; display: none; }
#aba-operacional .table-res td.historico-vazio::before { display: none !important; }
#aba-operacional .table-res td.historico-vazio { justify-content: center !important; color: #94a3b8; padding: 20px; font-size: 14px; border: none; }

/* ====================================================================================================== */
/* GESTO DE ENTREGAS: CARDS ESPECFICOS */
/* ====================================================================================================== */
.tabela-pedidos-montados.pedidos-unified-grid tr:not(.card-expanded) td:not(:nth-child(1)):not(:nth-child(2)):not(:nth-child(3)) {
    display: none !important;
}

.tabela-pedidos-montados.pedidos-unified-grid td:nth-child(1) {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 0 !important;
    border: none !important;
    display: flex !important;
}

.tabela-pedidos-montados.pedidos-unified-grid td:nth-child(2) {
    border: none !important;
    padding-bottom: 5px !important;
    display: block !important;
}

.tabela-pedidos-montados.pedidos-unified-grid td:nth-child(3) {
    font-size: 16px !important;
    font-weight: 800 !important;
    color: #1e293b !important;
    border-bottom: none !important;
    padding-top: 0 !important;
    display: block !important;
}

/* Esconder checkbox label when collapsed */
.tabela-pedidos-montados.pedidos-unified-grid tr:not(.card-expanded) td:nth-child(1)::before {
    display: none !important;
}

/* Ocultar Status e exibir Aes simplificadas */
.tabela-pedidos-montados.pedidos-unified-grid td:nth-child(12) {
    display: none !important; /* Sem status (pedido do usuario) */
}

/* Colunas do card expandido */
.tabela-pedidos-montados.pedidos-unified-grid tr.card-expanded td {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f1f5f9 !important;
    padding: 10px 0 !important;
}

/* Restaura o display e oculta a borda das 3 primeiras colunas mesmo expandido */
.tabela-pedidos-montados.pedidos-unified-grid tr.card-expanded td:nth-child(1),
.tabela-pedidos-montados.pedidos-unified-grid tr.card-expanded td:nth-child(2),
.tabela-pedidos-montados.pedidos-unified-grid tr.card-expanded td:nth-child(3) {
    border-bottom: none !important;
}

/* Oculta os pseudo-elementos (labels) se j estiverem renderizados no HTML, mas no js no esto, ento adicionamos via CSS */
.tabela-pedidos-montados.pedidos-unified-grid tr.card-expanded td:nth-child(4)::before { content: 'Telefone:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; width: 90px; }
.tabela-pedidos-montados.pedidos-unified-grid tr.card-expanded td:nth-child(5)::before { content: 'Distncia:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; width: 90px; }
.tabela-pedidos-montados.pedidos-unified-grid tr.card-expanded td:nth-child(6)::before { content: 'Tempo:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; width: 90px; }
.tabela-pedidos-montados.pedidos-unified-grid tr.card-expanded td:nth-child(7)::before { content: 'Taxa Loja:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; width: 90px; }
.tabela-pedidos-montados.pedidos-unified-grid tr.card-expanded td:nth-child(8)::before { content: 'Retorno:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; width: 90px; }
.tabela-pedidos-montados.pedidos-unified-grid tr.card-expanded td:nth-child(9)::before { content: 'Inversor:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; width: 90px; }
.tabela-pedidos-montados.pedidos-unified-grid tr.card-expanded td:nth-child(10)::before { content: 'Valor Ped.:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; width: 90px; }
.tabela-pedidos-montados.pedidos-unified-grid tr.card-expanded td:nth-child(11)::before { content: 'Repasse:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; width: 90px; }
.tabela-pedidos-montados.pedidos-unified-grid tr.card-expanded td:nth-child(13)::before { display: none; }

/* Ocultar topo e filtros se no houver pedidos (estado vazio visível) e remover fundo branco */
.gestao-entregas-lista:has(#estadoVazioPedidosMontadosLoja:not([style*="display: none"])) .gestao-entregas-topo,
.gestao-entregas-lista:has(#estadoVazioPedidosMontadosLoja:not([style*="display: none"])) .gestao-entregas-filtros {
    display: none !important;
}
.gestao-entregas-lista:has(#estadoVazioPedidosMontadosLoja:not([style*="display: none"])) {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* ESTILIZAO COMPACTA PARA A BARRA DE BUSCA */
.toolbar-busca {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    background: #f8fafc;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-bottom: 20px;
}
.toolbar-busca .campo {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 220px;
}
.toolbar-busca .campo label {
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
}
.toolbar-busca .campo input,
.toolbar-busca .campo select {
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    background: #fff;
    height: 42px;
}
.toolbar-busca .btn-acao {
    padding: 0 24px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ESPAAMENTO CONFIGURAES DA LOJA */
#aba-configuracoes .pedido-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

#aba-configuracoes .campo-inline {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#aba-configuracoes .campo-inline label {
    font-size: 11px;
    font-weight: 800;
    color: #1e293b;
    text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; font-weight: 700; color: #64748b;
}
.ficha-bloco .campo-inline label, .form-group-loja label { font-size: 11px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; display: block;
}

#aba-configuracoes .campo-inline input {
    font-size: 13px !important;
    color: #475569 !important;
    gap: 8px !important;
}
.pedidos-unified-grid td:last-child {
    border-bottom: none !important;
    flex-direction: column !important;
    align-items: stretch !important;
    margin-top: 10px !important;
}

/* Labels for each cell */
.pedidos-unified-grid td:nth-child(1)::before { content: 'Tempo:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; min-width: 90px; flex-shrink: 0; }
.pedidos-unified-grid td:nth-child(2)::before { content: 'ID:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; min-width: 90px; flex-shrink: 0; }
.pedidos-unified-grid td:nth-child(3)::before { content: 'Cliente:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; min-width: 90px; flex-shrink: 0; }
.pedidos-unified-grid td:nth-child(4)::before { content: 'Entregador:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; min-width: 90px; flex-shrink: 0; }
.pedidos-unified-grid td:nth-child(5)::before { content: 'Endereo:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; min-width: 90px; flex-shrink: 0; }
.pedidos-unified-grid td:nth-child(6)::before { content: 'Valor:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; min-width: 90px; flex-shrink: 0; }
.pedidos-unified-grid td:nth-child(7)::before { content: 'Taxa:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; min-width: 90px; flex-shrink: 0; }
.pedidos-unified-grid td:nth-child(8)::before { content: 'Status:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; min-width: 90px; flex-shrink: 0; }
.pedidos-unified-grid td:nth-child(9)::before { content: 'Aes:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; min-width: 90px; flex-shrink: 0; display: none; }

/* Empty state */
.pedidos-unified-grid td.historico-vazio { 
    display: none !important; /* Hide empty placeholders since everything is unified */
}
.pedidos-unified-grid .painel-vazio-integracao {
    display: none !important;
}

/* Fix Operacional list which is not in the unified grid */
#aba-operacional .table-res, #aba-operacional .table-res thead, #aba-operacional .table-res tbody {
    display: block !important;
    width: 100% !important;
}
#aba-operacional .table-res thead { display: none !important; }
#aba-operacional .table-res tbody { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important; gap: 16px !important; }
#aba-operacional .table-res tr { display: flex !important; flex-direction: column !important; background: #ffffff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 14px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); min-width: 0; max-width: 100%; overflow: hidden; box-sizing: border-box; }
#aba-operacional .table-res td { display: flex !important; align-items: flex-start; padding: 6px 0; border-bottom: 1px solid #f1f5f9; font-size: 13px; gap: 8px; min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; word-break: break-word; line-height: 1.45; }
#aba-operacional .table-res td:nth-child(5) { flex-wrap: wrap; }
#aba-operacional .table-res td:nth-child(5)::before { flex: 0 0 100%; width: 100%; margin-bottom: 2px; }
#aba-operacional .table-res td:last-child { flex-direction: column; align-items: stretch; border: none; margin-top: 10px; }
#aba-operacional .table-res td:nth-child(1)::before { content: 'Tempo:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; min-width: 90px; flex-shrink: 0; }
#aba-operacional .table-res td:nth-child(2)::before { content: 'ID:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; min-width: 90px; flex-shrink: 0; }
#aba-operacional .table-res td:nth-child(3)::before { content: 'Cliente:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; min-width: 90px; flex-shrink: 0; }
#aba-operacional .table-res td:nth-child(4)::before { content: 'Entregador:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; min-width: 90px; flex-shrink: 0; }
#aba-operacional .table-res td:nth-child(5)::before { content: 'Endereo:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; min-width: 90px; flex-shrink: 0; }
#aba-operacional .table-res td:nth-child(6)::before { content: 'Valor:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; min-width: 90px; flex-shrink: 0; }
#aba-operacional .table-res td:nth-child(7)::before { content: 'Taxa:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; min-width: 90px; flex-shrink: 0; }
#aba-operacional .table-res td:nth-child(8)::before { content: 'Status:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; min-width: 90px; flex-shrink: 0; }
#aba-operacional .table-res td:nth-child(9)::before { content: 'Aes:'; display: none; }
#aba-operacional .table-res td.historico-vazio::before { display: none !important; }
#aba-operacional .table-res td.historico-vazio { justify-content: center !important; color: #94a3b8; padding: 20px; font-size: 14px; border: none; }

/* ====================================================================================================== */
/* GESTO DE ENTREGAS: CARDS ESPECFICOS */
/* ====================================================================================================== */
.tabela-pedidos-montados.pedidos-unified-grid tr:not(.card-expanded) td:not(:nth-child(1)):not(:nth-child(2)):not(:nth-child(3)) {
    display: none !important;
}

.tabela-pedidos-montados.pedidos-unified-grid td:nth-child(1) {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 0 !important;
    border: none !important;
    display: flex !important;
}

.tabela-pedidos-montados.pedidos-unified-grid td:nth-child(2) {
    border: none !important;
    padding-bottom: 5px !important;
    display: block !important;
}

.tabela-pedidos-montados.pedidos-unified-grid td:nth-child(3) {
    font-size: 16px !important;
    font-weight: 800 !important;
    color: #1e293b !important;
    border-bottom: none !important;
    padding-top: 0 !important;
    display: block !important;
}

/* Esconder checkbox label when collapsed */
.tabela-pedidos-montados.pedidos-unified-grid tr:not(.card-expanded) td:nth-child(1)::before {
    display: none !important;
}

/* Ocultar Status e exibir Aes simplificadas */
.tabela-pedidos-montados.pedidos-unified-grid td:nth-child(12) {
    display: none !important; /* Sem status (pedido do usuario) */
}

/* Colunas do card expandido */
.tabela-pedidos-montados.pedidos-unified-grid tr.card-expanded td {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f1f5f9 !important;
    padding: 10px 0 !important;
}

/* Restaura o display e oculta a borda das 3 primeiras colunas mesmo expandido */
.tabela-pedidos-montados.pedidos-unified-grid tr.card-expanded td:nth-child(1),
.tabela-pedidos-montados.pedidos-unified-grid tr.card-expanded td:nth-child(2),
.tabela-pedidos-montados.pedidos-unified-grid tr.card-expanded td:nth-child(3) {
    border-bottom: none !important;
}

/* Oculta os pseudo-elementos (labels) se j estiverem renderizados no HTML, mas no js no esto, ento adicionamos via CSS */
.tabela-pedidos-montados.pedidos-unified-grid tr.card-expanded td:nth-child(4)::before { content: 'Telefone:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; width: 90px; }
.tabela-pedidos-montados.pedidos-unified-grid tr.card-expanded td:nth-child(5)::before { content: 'Distncia:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; width: 90px; }
.tabela-pedidos-montados.pedidos-unified-grid tr.card-expanded td:nth-child(6)::before { content: 'Tempo:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; width: 90px; }
.tabela-pedidos-montados.pedidos-unified-grid tr.card-expanded td:nth-child(7)::before { content: 'Taxa Loja:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; width: 90px; }
.tabela-pedidos-montados.pedidos-unified-grid tr.card-expanded td:nth-child(8)::before { content: 'Retorno:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; width: 90px; }
.tabela-pedidos-montados.pedidos-unified-grid tr.card-expanded td:nth-child(9)::before { content: 'Inversor:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; width: 90px; }
.tabela-pedidos-montados.pedidos-unified-grid tr.card-expanded td:nth-child(10)::before { content: 'Valor Ped.:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; width: 90px; }
.tabela-pedidos-montados.pedidos-unified-grid tr.card-expanded td:nth-child(11)::before { content: 'Repasse:'; font-weight: 700; color: #94a3b8; font-size: 11px; text-transform: uppercase; width: 90px; }
.tabela-pedidos-montados.pedidos-unified-grid tr.card-expanded td:nth-child(13)::before { display: none; }

/* Ocultar topo e filtros se no houver pedidos (estado vazio visível) e remover fundo branco */
.gestao-entregas-lista:has(#estadoVazioPedidosMontadosLoja:not([style*="display: none"])) .gestao-entregas-topo,
.gestao-entregas-lista:has(#estadoVazioPedidosMontadosLoja:not([style*="display: none"])) .gestao-entregas-filtros {
    display: none !important;
}
.gestao-entregas-lista:has(#estadoVazioPedidosMontadosLoja:not([style*="display: none"])) {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* ESTILIZAO COMPACTA PARA A BARRA DE BUSCA */
.toolbar-busca {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    background: #f8fafc;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-bottom: 20px;
}
.toolbar-busca .campo {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 220px;
}
.toolbar-busca .campo label {
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
}
.toolbar-busca .campo input,
.toolbar-busca .campo select {
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    background: #fff;
    height: 42px;
}
.toolbar-busca .btn-acao {
    padding: 0 24px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ESPAAMENTO CONFIGURAES DA LOJA */
#aba-configuracoes .pedido-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

#aba-configuracoes .campo-inline {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#aba-configuracoes .campo-inline label,
.ficha-bloco .campo-inline label {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: block;
}

#aba-configuracoes .campo-inline input,
#aba-configuracoes .campo-inline select,
.ficha-bloco .campo-inline input,
.ficha-bloco .campo-inline select,
.ficha-bloco .campo-inline textarea {
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
    color: #1e293b;
    background: #f8fafc;
}

#aba-configuracoes .campo-inline input:focus,
#aba-configuracoes .campo-inline select:focus,
.ficha-bloco .campo-inline input:focus,
.ficha-bloco .campo-inline select:focus,
.ficha-bloco .campo-inline textarea:focus {
    border-color: #00d166;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 209, 102, 0.1);
}

#aba-configuracoes .actions-row {
    margin-top: 24px;
}

#aba-configuracoes .subtab-config-content {
    padding: 30px;
}
/* Fix white wrapper on dispatch screen */
#tabelaPedidosMontadosWrapLoja,
#tabelaPedidosMontadosWrapLoja.painel-branco {
    background: #ffffff !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05) !important;
    border: 1px solid #e2e8f0 !important;
    padding: 30px !important;
    min-height: calc(100vh - 180px);
    width: 100%;
    border-radius: 12px;
    display: flex !important;
    flex-direction: column !important;
}

#listaPedidosMontadosLoja {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    gap: 20px !important;
    width: 100% !important;
}

#listaPedidosMontadosLoja .card-pedido-integracao {
    width: calc(25% - 15px) !important;
    min-width: 250px;
    box-sizing: border-box;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    padding: 12px 14px;
    transition: none !important;
}

#listaPedidosMontadosLoja .card-pedido-integracao:hover {
    transform: none !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1) !important;
}

@media(max-width: 1024px) {
    #listaPedidosMontadosLoja .card-pedido-integracao {
        width: calc(50% - 10px) !important;
    }
}
@media(max-width: 768px) {
    #listaPedidosMontadosLoja .card-pedido-integracao {
        width: 100% !important;
    }
}

/* Kill fake CSS arrows */
.card-pedido-integracao-header::after,
.card-pedido-integracao-header::before,
.pedidos-unified-grid .card-pedido-integracao::after {
    display: none !important;
    content: none !important;
}

/* MELHORIA VISUAL DA FICHA DE PEDIDO */
.ficha-bloco .campo-inline input,
.ficha-bloco .campo-inline select,
.ficha-bloco .campo-inline textarea,
.form-group-loja input,
.form-group-loja select {
    padding: 12px 14px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    outline: none !important;
    transition: all 0.2s ease !important;
    color: #1e293b !important;
    background: #f8fafc !important;
}

.ficha-bloco .campo-inline input:focus,
.ficha-bloco .campo-inline select:focus,
.ficha-bloco .campo-inline textarea:focus,
.form-group-loja input:focus,
.form-group-loja select:focus {
    border-color: #00d166 !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(0, 209, 102, 0.1) !important;
}

/* ESCONDER A BARRA VAZIA DA SUGESTO DE FORMA FORTE */
.sugestoes-endereco:empty,
.sugestoes-rua:empty,
.lista-sugestoes:empty,
.endereco-sugestoes:empty,
.dropdown-ruas:empty,
#sugestoesRuaLoja:empty,
#listaSugestoesRuaLoja:empty,
#lista-ruas:empty,
#sugestoesEndereco:empty,
#sugestoesEnderecoLoja:empty,
#sugestoesRua:empty,
#listaSugestoesRua:empty,
[id*="sugestoes"]:empty,
[class*="sugestoes"]:empty,
[id*="sugestoes"]:not(:has(*)),
[class*="sugestoes"]:not(:has(*)) {
    display: none !important;
    min-height: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    border: none !important;
    margin: 0 !important;
}

/* =========================================================
   MEDIA QUERIES ADICIONAIS PARA RESPONSIVIDADE
========================================================= */

/* Smartphones pequenos (max 480px) */
@media (max-width: 480px) {
    .painel-header-nav {
        top: 8px;
        left: 8px;
        right: 8px;
        padding: 10px 12px;
        height: auto;
    }
    
    .loja-nav {
        font-size: 11px;
    }
    
    .loja-nav button {
        padding: 4px 8px !important;
        font-size: 11px !important;
        min-width: 36px !important;
    }
    
    button, input, select, textarea {
        font-size: 16px; /* Evita zoom em iOS */
        padding: 10px 12px;
    }
    
    .table-res {
        font-size: 11px;
    }
    
    .table-res th, .table-res td {
        padding: 6px 4px !important;
        white-space: normal;
    }
}

/* Smartphones médios (480px - 640px) */
@media (max-width: 640px) {
    .painel-section {
        padding: 10px !important;
    }
    
    .table-container {
        border-radius: 8px;
    }
    
    .btn-acao {
        font-size: 12px !important;
        padding: 8px 10px !important;
    }
    
    .drawer-content {
        width: 100% !important;
        right: -100% !important;
    }
}

/* iPads/Tablets pequenos (640px - 768px) */
@media (max-width: 768px) and (min-width: 641px) {
    .table-res {
        font-size: 12px;
    }
    
    .table-res th, .table-res td {
        padding: 8px 6px;
    }
}

/* Verificações gerais para todos os dispositivos */
@media (orientation: landscape) and (max-height: 500px) {
    .painel-header-nav {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        margin-bottom: 10px;
        border-radius: 12px;
    }
    
    .loja-main {
        max-height: calc(100vh - 100px);
        overflow-y: auto;
    }
}

/* Portrait orientation */
@media (orientation: portrait) {
    .painel-section {
        min-height: auto;
    }
}

/* Melhorias para toque (touch devices) */
@media (hover: none) and (pointer: coarse) {
    button, .btn-acao, [role="button"] {
        min-height: 44px;
        min-width: 44px;
        padding: 10px 14px;
    }
    
    input, select, textarea {
        min-height: 44px;
        padding: 12px;
        font-size: 16px; /* iOS zoom fix */
    }
    
    .table-res th, .table-res td {
        padding: 10px 8px;
    }
}
/* Central de despacho — layout responsivo */
.tela-central-despacho-final .section-title-loja {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 14px;
}

.tela-central-despacho-final .section-title-loja > div:first-child {
    flex: 1 1 220px;
    min-width: 0;
}

.tela-central-despacho-final .acoes-topo-gestao-entregas {
    flex: 1 1 240px;
    justify-content: flex-end;
}

.tela-central-despacho-final .gestao-entregas-lista {
    padding: 20px 18px;
}

.tela-central-despacho-final #contadorPedidosSelecionadosLoja {
    margin-bottom: 14px !important;
}

.tela-central-despacho-final .estado-vazio-entrega {
    min-height: clamp(160px, 30vh, 260px);
    padding: 24px 16px;
}

@media (max-width: 900px) {
    .tela-central-despacho-final .section-title-loja {
        flex-direction: column;
        align-items: stretch;
    }

    .tela-central-despacho-final .acoes-topo-gestao-entregas {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .tela-central-despacho-final .acoes-topo-gestao-entregas .btn-acao {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .ficha-acoes {
        grid-template-columns: 1fr;
    }

    .ficha-acoes .btn-acao {
        min-height: 50px;
    }
}

/* =========================================================
   RECARGA SALDO — visual X-DELIVERY (dark + neon)
========================================================= */
.modal-recarga-saldo.aberto {
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(12px);
}

.modal-recarga-saldo .modal-recarga-saldo-card {
    position: relative;
    width: min(100%, 440px);
    min-height: 440px;
    background: linear-gradient(165deg, #121212 0%, #0a0a0a 55%, #050505 100%);
    border-radius: 24px;
    box-shadow:
        0 0 0 1px rgba(57, 255, 20, 0.22),
        0 0 40px rgba(57, 255, 20, 0.12),
        0 28px 70px rgba(0, 0, 0, 0.65);
    overflow: hidden;
    border: 1px solid rgba(57, 255, 20, 0.28);
    display: flex;
    flex-direction: column;
}

.modal-recarga-saldo-fechar {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(57, 255, 20, 0.35);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.45);
    color: #39ff14;
    cursor: pointer;
    z-index: 2;
    font-size: 16px;
    transition: background 0.2s, box-shadow 0.2s;
}

.modal-recarga-saldo-fechar:hover {
    background: rgba(57, 255, 20, 0.12);
    box-shadow: 0 0 16px rgba(57, 255, 20, 0.25);
}

.modal-recarga-saldo-hero {
    padding: 33px 26px 24px;
    background:
        radial-gradient(ellipse 80% 70% at 50% 0%, rgba(57, 255, 20, 0.14) 0%, transparent 65%),
        linear-gradient(180deg, #141414 0%, #0a0a0a 100%);
    color: #fff;
    text-align: center;
    border-bottom: 1px solid rgba(57, 255, 20, 0.12);
}

.modal-recarga-saldo-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    margin-bottom: 16px;
}

.modal-recarga-saldo-logo {
    width: 79px;
    height: 79px;
    object-fit: contain;
    filter: drop-shadow(0 0 12px rgba(57, 255, 20, 0.55)) drop-shadow(0 0 28px rgba(57, 255, 20, 0.25));
}

.modal-recarga-saldo-brand-name {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.28em;
    color: #39ff14;
    text-shadow: 0 0 12px rgba(57, 255, 20, 0.45);
}

.modal-recarga-saldo-hero h2 {
    margin: 0 0 9px;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #f8fafc;
}

.modal-recarga-saldo-hero p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: rgba(226, 232, 240, 0.72);
}

.modal-recarga-saldo-body {
    padding: 24px 26px 12px;
    flex: 1;
}

.modal-recarga-saldo-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: rgba(57, 255, 20, 0.75);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 11px;
}

.modal-recarga-saldo-hint {
    margin: -2px 0 10px;
    font-size: 13px;
    font-weight: 600;
    color: #39ff14;
    line-height: 1.4;
}

.modal-recarga-saldo-input-wrap {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 18px;
    min-height: 58px;
    border: 1px solid rgba(57, 255, 20, 0.35);
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.55);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.modal-recarga-saldo-input-wrap:focus-within {
    border-color: #39ff14;
    box-shadow: 0 0 0 3px rgba(57, 255, 20, 0.15), 0 0 24px rgba(57, 255, 20, 0.12);
    background: rgba(0, 0, 0, 0.72);
}

.modal-recarga-saldo-prefix {
    font-size: 18px;
    font-weight: 800;
    color: #39ff14;
    text-shadow: 0 0 10px rgba(57, 255, 20, 0.35);
}

.modal-recarga-saldo-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 31px;
    font-weight: 800;
    color: #f8fafc;
    padding: 13px 0;
    outline: none;
    min-width: 0;
}

.modal-recarga-saldo-input::placeholder {
    color: rgba(148, 163, 184, 0.45);
    font-weight: 600;
}

.modal-recarga-saldo-valor-fixo {
    align-items: center;
    min-height: 52px;
    background: #f8fafc;
}

.modal-recarga-saldo-valor-display {
    flex: 1;
    font-size: 28px;
    font-weight: 800;
    color: #0f172a;
    padding: 10px 14px 10px 0;
    line-height: 1.1;
}

.btn-mensalidade-caixa {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.modal-recarga-saldo-atalhos {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 9px;
    margin-top: 16px;
}

.modal-recarga-saldo-atalhos button {
    border: 1px solid rgba(57, 255, 20, 0.28);
    background: rgba(0, 0, 0, 0.4);
    color: #e2e8f0;
    border-radius: 12px;
    padding: 11px 7px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}

.modal-recarga-saldo-atalhos button:hover {
    border-color: #39ff14;
    color: #39ff14;
    background: rgba(57, 255, 20, 0.08);
    box-shadow: 0 0 16px rgba(57, 255, 20, 0.15);
}

.modal-recarga-saldo-footer {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 11px;
    padding: 18px 26px 28px;
    margin-top: auto;
}

.modal-recarga-saldo-btn-sec {
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(255, 255, 255, 0.04);
    color: #cbd5e1;
    border-radius: 14px;
    padding: 15px 18px;
    min-height: 50px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}

.modal-recarga-saldo-btn-sec:hover {
    border-color: rgba(148, 163, 184, 0.55);
    background: rgba(255, 255, 255, 0.08);
}

.modal-recarga-saldo-btn-pix {
    border: 1px solid rgba(57, 255, 20, 0.5);
    border-radius: 14px;
    padding: 15px 18px;
    min-height: 50px;
    font-weight: 800;
    cursor: pointer;
    background: linear-gradient(135deg, #1a3d12 0%, #0d2208 100%);
    color: #39ff14;
    box-shadow: 0 0 20px rgba(57, 255, 20, 0.2), inset 0 1px 0 rgba(57, 255, 20, 0.15);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-shadow: 0 0 8px rgba(57, 255, 20, 0.35);
    transition: all 0.15s;
}

.modal-recarga-saldo-btn-pix:hover {
    box-shadow: 0 0 28px rgba(57, 255, 20, 0.35), inset 0 1px 0 rgba(57, 255, 20, 0.2);
    transform: translateY(-1px);
}

.modal-recarga-saldo-resultado {
    display: none;
}

/* ——— Modal PIX fullscreen ——— */
.modal-pix-deposito-loja {
    position: fixed;
    inset: 0;
    z-index: 12050;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(10px);
    padding: 16px;
}

.modal-pix-deposito-loja.aberto {
    display: flex;
}

.modal-pix-deposito-loja-inner {
    width: min(100%, 440px);
    max-height: calc(100vh - 32px);
    overflow: auto;
    border-radius: 24px;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
}

.pix-deposito-shell.pix-theme-premium {
    --pix-brand: #0d9488;
    --pix-brand-dark: #0f766e;
    --pix-brand-soft: #ccfbf1;
    --pix-text: #0f172a;
    --pix-muted: #64748b;
    background: #f1f5f9;
    min-height: auto;
    padding: 0;
}

.pix-deposito-card {
    background: #fff;
    border-radius: 24px;
    overflow: hidden;
}

.pix-deposito-topbar {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    gap: 8px;
    padding: 16px 14px 12px;
    border-bottom: 1px solid #f1f5f9;
}

.pix-deposito-nav-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    color: #334155;
    cursor: pointer;
    font-size: 15px;
}

.pix-deposito-topbar-text {
    text-align: center;
    min-width: 0;
}

.pix-deposito-eyebrow {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--pix-brand);
}

.pix-deposito-topbar-text h2 {
    margin: 2px 0 0;
    font-size: 15px;
    font-weight: 800;
    color: var(--pix-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pix-deposito-hero {
    text-align: center;
    padding: 8px 20px 16px;
}

.pix-deposito-marca {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--pix-brand-soft);
    color: var(--pix-brand-dark);
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 10px;
}

.pix-deposito-hero .pix-deposito-valor {
    font-size: clamp(36px, 9vw, 44px);
    font-weight: 900;
    color: var(--pix-text);
    letter-spacing: -0.03em;
    line-height: 1;
    margin: 0;
}

.pix-deposito-status-badge {
    display: inline-block;
    margin-top: 10px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    background: #fff7ed;
    color: #c2410c;
}

.pix-deposito-passos {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 0 16px 16px;
}

.pix-deposito-passo {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 10px 8px;
    text-align: center;
}

.pix-deposito-passo span {
    display: inline-flex;
    width: 22px;
    height: 22px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--pix-brand);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    margin-bottom: 6px;
}

.pix-deposito-passo p {
    margin: 0;
    font-size: 11px;
    line-height: 1.35;
    color: var(--pix-muted);
    font-weight: 600;
}

.pix-deposito-qr-frame {
    margin: 0 20px 14px;
    padding: 16px;
    border-radius: 20px;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
    border: 1px solid #e2e8f0;
    display: flex;
    justify-content: center;
}

.pix-deposito-qr-frame img {
    width: min(240px, 68vw);
    height: min(240px, 68vw);
    object-fit: contain;
    border-radius: 12px;
}

.pix-deposito-timer {
    text-align: center;
    font-size: 13px;
    color: var(--pix-muted);
    margin: 0 20px 10px;
    font-weight: 600;
}

.pix-deposito-timer strong {
    color: #dc2626;
}

.pix-deposito-sync {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 20px 16px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f0fdfa;
    border: 1px solid #99f6e4;
    color: #0f766e;
    font-size: 12px;
    font-weight: 700;
}

.pix-deposito-sync-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #14b8a6;
    animation: pix-sync-pulse 1.4s ease-in-out infinite;
}

@keyframes pix-sync-pulse {
    0%, 100% { opacity: 0.35; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.1); }
}

.pix-deposito-acoes-principais {
    display: grid;
    gap: 10px;
    padding: 0 20px 16px;
}

.pix-deposito-btn-primario,
.pix-deposito-btn-secundario {
    width: 100%;
    border-radius: 14px;
    padding: 15px 16px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
}

.pix-deposito-btn-primario {
    background: linear-gradient(135deg, #0f766e, #14b8a6);
    color: #fff;
    box-shadow: 0 10px 24px rgba(20, 184, 166, 0.25);
}

.pix-deposito-btn-secundario {
    background: #fff;
    color: #0f766e;
    border: 2px solid #99f6e4;
}

.pix-deposito-detalhes-collapse {
    margin: 0 20px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
}

.pix-deposito-detalhes-collapse summary {
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    background: #f8fafc;
    list-style: none;
}

.pix-deposito-detalhes-collapse summary::-webkit-details-marker {
    display: none;
}

.pix-deposito-detalhes-grid {
    display: grid;
    gap: 10px;
    padding: 12px 14px 14px;
    font-size: 12px;
}

.pix-deposito-detalhes-grid > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.pix-deposito-detalhes-grid span {
    color: var(--pix-muted);
    font-weight: 600;
}

.pix-deposito-detalhes-grid strong {
    color: var(--pix-text);
    text-align: right;
    word-break: break-all;
    font-weight: 700;
}

.pix-deposito-chave-mascarada {
    max-width: 58%;
}

.pix-deposito-acoes-rodape {
    padding: 0 20px 20px;
    text-align: center;
}

.pix-deposito-link {
    background: none;
    border: none;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
}

.pix-deposito-link.perigo {
    color: #dc2626;
}

.pix-pago-sucesso-inner {
    text-align: center;
    padding: 40px 24px 32px;
}

.pix-pago-sucesso-icon {
    font-size: 56px;
    color: #10b981;
    margin-bottom: 12px;
}

.pix-pago-sucesso-inner h3 {
    margin: 0 0 8px;
    font-size: 22px;
    color: #0f172a;
}

.pix-pago-sucesso-inner p {
    margin: 0 0 24px;
    color: #64748b;
    font-size: 14px;
}

@media (max-width: 480px) {
    .modal-pix-deposito-loja {
        padding: 0;
        align-items: stretch;
    }

    .modal-pix-deposito-loja-inner {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .pix-deposito-card {
        border-radius: 0;
        min-height: 100vh;
    }

    .modal-recarga-saldo-atalhos {
        grid-template-columns: repeat(2, 1fr);
    }

    .modal-recarga-saldo-footer {
        grid-template-columns: 1fr;
    }
}

/* Marcador da moto nos mapas Leaflet (painel loja / rastreamento) */
.xdelivery-moto-pin-marker,
.xdelivery-moto-pin-marker.leaflet-div-icon,
.xdelivery-motoboy-marker,
.xdelivery-motoboy-marker.leaflet-div-icon {
    background: transparent !important;
    border: none !important;
}

.map-motoboy-pin {
    display: block;
    line-height: 0;
    background: transparent !important;
    border: none !important;
}

.map-motoboy-pin--vermelho .map-motoboy-silhueta {
    animation: moto-pin-pulse-loja 2s ease-in-out infinite;
}

.xdelivery-motoboy-marker--verde .map-motoboy-silhueta,
.map-motoboy-pin--verde .map-motoboy-silhueta {
    filter: drop-shadow(0 2px 6px rgba(16, 185, 129, 0.4));
}

.xdelivery-motoboy-marker--vermelho .map-motoboy-silhueta,
.map-motoboy-pin--vermelho .map-motoboy-silhueta {
    filter: drop-shadow(0 2px 6px rgba(239, 68, 68, 0.45));
}

.xdelivery-motoboy-marker--preto .map-motoboy-silhueta,
.map-motoboy-pin--preto .map-motoboy-silhueta {
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.5));
  opacity: 0.88;
}

.xdelivery-motoboy-marker--amarelo .map-motoboy-silhueta,
.map-motoboy-pin--amarelo .map-motoboy-silhueta {
    filter: drop-shadow(0 2px 6px rgba(234, 179, 8, 0.45));
}

.map-loja-silhueta--online { filter: drop-shadow(0 2px 6px rgba(0, 230, 118, 0.45)); }
.map-loja-silhueta--offline { filter: drop-shadow(0 2px 6px rgba(255, 23, 68, 0.4)); }
.map-loja-silhueta--andamento { filter: drop-shadow(0 2px 6px rgba(255, 234, 0, 0.45)); }

@keyframes moto-pin-pulse-loja {
    0%, 100% { filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.35)); }
    50% { filter: drop-shadow(0 2px 8px rgba(239, 68, 68, 0.55)); }
}

.map-motoboy-marker-img,
.map-motoboy-marker-svg,
.map-motoboy-silhueta,
.map-moto-pin-wrap img,
.map-moto-pin-wrap svg {
    display: block;
    width: 52px;
    height: 40px;
    object-fit: contain;
    filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.45));
    background: transparent !important;
    border: none !important;
}

.map-motoboy-marker-host {
    background: transparent !important;
    border: none !important;
    line-height: 0;
    filter: drop-shadow(0 3px 6px rgba(15, 23, 42, 0.35));
}

.leaflet-container .leaflet-marker-icon.leaflet-div-icon.xdelivery-moto-pin-marker,
.leaflet-container .leaflet-marker-icon.leaflet-div-icon.xdelivery-motoboy-marker,
.leaflet-container .leaflet-marker-icon.leaflet-div-icon.xdelivery-moto-navigation-marker {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

.map-moto-pin-wrap {
    background: transparent !important;
    border: none !important;
    line-height: 0;
}

/* Cards de pedidos da loja — labels vermelhos, respostas em preto negrito */
.pedidos-unified-grid td::before,
#aba-operacional .table-res td::before,
.tabela-pedidos-montados.pedidos-unified-grid tr.card-expanded td::before {
    color: #dc2626 !important;
    font-weight: 800 !important;
}

.pedidos-unified-grid td:nth-child(2)::before,
#aba-operacional .table-res td:nth-child(2)::before {
    content: 'Pedido:' !important;
}

.pedidos-unified-grid td:nth-child(5)::before,
#aba-operacional .table-res td:nth-child(5)::before {
    content: 'Endereço:' !important;
}

.pedidos-unified-grid td,
#aba-operacional .table-res td {
    color: #0f172a !important;
}

/* Respostas — preto negrito */
.pedido-card-valor,
.pedidos-unified-grid td .pedido-id-card,
.pedidos-unified-grid td:nth-child(1) .pedido-card-valor,
.pedidos-unified-grid td:nth-child(1) > div > span:first-child,
.pedidos-unified-grid td:nth-child(1) > div > small,
.pedidos-unified-grid td:nth-child(3) .pedido-card-valor,
.pedidos-unified-grid td:nth-child(3) small,
.pedidos-unified-grid td:nth-child(3) .pedido-card-telefone,
.pedidos-unified-grid td:nth-child(4) .pedido-card-valor,
.pedidos-unified-grid td:nth-child(5) .pedido-card-valor,
.pedidos-unified-grid td:nth-child(6) .pedido-card-valor,
.pedidos-unified-grid td:nth-child(7) .pedido-card-valor,
#aba-operacional .table-res td .pedido-id-card,
#aba-operacional .table-res td .pedido-card-valor,
#aba-operacional .table-res td:nth-child(1) .pedido-card-valor,
#aba-operacional .table-res td:nth-child(1) > div > span:first-child,
#aba-operacional .table-res td:nth-child(1) > div > small,
#aba-operacional .table-res td:nth-child(3) small,
#aba-operacional .table-res td:nth-child(3) .pedido-card-telefone,
#aba-operacional .table-res td:nth-child(4) .pedido-card-valor,
#aba-operacional .table-res td:nth-child(5) .pedido-card-valor,
#aba-operacional .table-res td:nth-child(6) .pedido-card-valor,
#aba-operacional .table-res td:nth-child(7) .pedido-card-valor {
    font-weight: 800 !important;
    color: #0f172a !important;
}

.pedido-card-telefone {
    display: none !important;
}

.pedido-card-campo--tempo {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#aba-historico .pedidos-unified-grid > .subtab-content > [id^="paginacao"] {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.historico-pedidos-paginacao {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 12px;
    padding: 8px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
}

.historico-pedidos-paginacao__seletor {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.historico-pedidos-paginacao__seletor select {
    padding: 4px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #0f172a;
    font-size: 12px;
    font-weight: 700;
}

.historico-pedidos-paginacao__resumo strong {
    color: #0f172a;
}

.historico-pedidos-paginacao__nav {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.historico-pedidos-paginacao__nav button {
    min-width: 32px;
    height: 32px;
    padding: 0 9px;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    background: #fff;
    color: #334155;
    font-weight: 700;
    cursor: pointer;
}

.historico-pedidos-paginacao__nav button.active {
    border-color: #111827;
    background: #111827;
    color: #fff;
}

.historico-pedidos-paginacao__nav button:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.pedido-card-valor--duracao {
    font-size: 11px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
}

.pedidos-unified-grid td .pill-status,
#aba-operacional .table-res td .pill-status {
    font-weight: 800 !important;
}

.pedidos-unified-grid td:last-child .btn-mini,
#aba-operacional .table-res td:last-child .btn-mini {
    font-weight: 700;
}