/* CRM Loja de Móveis - Estilos */

/* Reset e base */
* {
    box-sizing: border-box;
}

/* Layout principal */
.crm-layout {
    display: flex;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f8fafc;
}

/* Sidebar */
.crm-sidebar {
    width: 250px;
    background: linear-gradient(180deg, #1e293b 0%, #334155 100%);
    color: white;
    padding: 2rem 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.1);
}

.crm-sidebar h3 {
    padding: 0 1.5rem 2rem;
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
}

.crm-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.crm-menu li {
    margin: 0;
}

.crm-menu a {
    display: block;
    padding: 1rem 1.5rem;
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.crm-menu a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-left-color: #3b82f6;
}

.crm-menu a.active {
    background: rgba(59, 130, 246, 0.2);
    color: white;
    border-left-color: #3b82f6;
    font-weight: 600;
}

/* Conteúdo principal */
.crm-content {
    flex: 1;
    margin-left: 250px;
    padding: 2rem 2.5rem;
    background: #f8fafc;
    min-height: 100vh;
}

.crm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.crm-header h1 {
    margin: 0;
    color: #1e293b;
    font-size: 2rem;
    font-weight: 700;
}

/* Botões */
.crm-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #6b7280;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.crm-btn:hover {
    background: #4b5563;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.crm-btn-primary {
    background: #3b82f6;
}

.crm-btn-primary:hover {
    background: #2563eb;
}

.crm-btn-secondary {
    background: #6b7280;
}

.crm-btn-secondary:hover {
    background: #4b5563;
}

.crm-btn-danger {
    background: #ef4444;
}

.crm-btn-danger:hover {
    background: #dc2626;
}

.crm-btn-small {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
}

.crm-btn-large {
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
}

/* Mensagens */
.crm-message {
    padding: 1rem 1.5rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.crm-message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.crm-message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* Formulários */
.crm-form-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.crm-form {
    max-width: none;
}

.crm-form h3 {
    margin: 0 0 1.5rem;
    color: #1e293b;
    font-size: 1.25rem;
    font-weight: 600;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.75rem;
}

.crm-form h4 {
    margin: 2rem 0 1rem;
    color: #374151;
    font-size: 1.1rem;
    font-weight: 600;
}

.crm-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.crm-form-group {
    display: flex;
    flex-direction: column;
}

.crm-form-group label {
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.crm-form-group input,
.crm-form-group select,
.crm-form-group textarea {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.crm-form-group input:focus,
.crm-form-group select:focus,
.crm-form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.crm-form-group small {
    color: #6b7280;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.crm-form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-start;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

/* Busca */
.crm-search {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.crm-search form {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.crm-search input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

/* Tabelas */
.crm-table-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.crm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.crm-table th {
    background: #f8fafc;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
}

.crm-table td {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    color: #1f2937;
}

.crm-table tr:hover {
    background: #f9fafb;
}

.crm-table .actions {
    white-space: nowrap;
}

.crm-table .actions form {
    display: inline-block;
    margin: 0 0.25rem;
}

/* Status badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-badge.status-aberta {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.status-paga {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.status-cancelada {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge.status-success {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.status-warning {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.status-danger {
    background: #fee2e2;
    color: #991b1b;
}

/* Paginação */
.crm-pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.crm-pagination a,
.crm-pagination span {
    padding: 0.5rem 0.75rem;
    text-decoration: none;
    border: 1px solid #d1d5db;
    color: #374151;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.crm-pagination a:hover {
    background: #f3f4f6;
}

.crm-pagination .current {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

/* Dashboard */
.crm-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.crm-stat-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.crm-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.crm-stat-card h3 {
    margin: 0 0 1rem;
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.crm-stat-card small {
    color: #6b7280;
    font-size: 0.875rem;
}

.crm-recent-orders {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.crm-recent-orders h2 {
    margin: 0 0 1.5rem;
    color: #1e293b;
    font-size: 1.25rem;
    font-weight: 600;
}

/* Estoque */
.stock-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.875rem;
}

.stock-badge.stock-ok {
    background: #d1fae5;
    color: #065f46;
}

.stock-badge.stock-low {
    background: #fef3c7;
    color: #92400e;
}

.stock-badge.stock-zero {
    background: #fee2e2;
    color: #991b1b;
}

.crm-stock-summary {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-top: 2rem;
}

.crm-stock-summary h3 {
    margin: 0 0 1.5rem;
    color: #1e293b;
    font-size: 1.25rem;
    font-weight: 600;
}

.stock-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.summary-card {
    padding: 1.5rem;
    border-radius: 6px;
    text-align: center;
}

.summary-card.danger {
    background: #fee2e2;
    color: #991b1b;
}

.summary-card.warning {
    background: #fef3c7;
    color: #92400e;
}

.summary-card.success {
    background: #d1fae5;
    color: #065f46;
}

.summary-card.primary {
    background: #dbeafe;
    color: #1e40af;
}

.summary-card.info {
    background: #e0f2fe;
    color: #0277bd;
}

.card-number {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.card-label {
    font-size: 0.875rem;
    font-weight: 500;
}

.card-detail {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-top: 0.25rem;
}

/* PDV */
.crm-pdv-form {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.crm-form-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.crm-form-section:last-child {
    border-bottom: none;
}

.crm-form-section h3 {
    margin: 0 0 1.5rem;
    color: #1e293b;
    font-size: 1.1rem;
    font-weight: 600;
}

.item-row {
    margin-bottom: 1rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.item-grid {
    display: grid;
    grid-template-columns: 1fr 2fr 120px 150px 150px auto;
    gap: 1rem;
    align-items: end;
}   /* <-- AQUI TERMINA o bloco que já existia */

/* === PDV: override do grid só dentro do formulário do PDV === */
.crm-pdv-form .item-row,
.crm-pdv-form .item-grid,
.crm-pdv-form .item-grid .crm-form-group { min-width: 0; }

.crm-pdv-form .item-grid{
  grid-template-columns:
    160px               /* SKU */
    220px               /* busca por nome */
    minmax(220px, 1fr)  /* select do produto */
    minmax(280px, 2fr)  /* preview do produto (nome visível) */
    110px               /* qty */
    150px               /* preço */
    150px               /* subtotal */
    auto;               /* ações */
  gap: 14px;
  align-items: end;
}

@media (max-width: 1200px){
  .crm-pdv-form .item-grid{
    grid-template-columns: 1fr 1fr 1fr 1fr 0.8fr 1fr 1fr auto;
  }
  .crm-pdv-form .product-title-wrap{ grid-column: 1 / -1; }
}

@media (max-width: 900px){
  .crm-pdv-form .item-grid{ grid-template-columns: 1fr 1fr; }
  .crm-pdv-form .product-title-wrap{ grid-column: 1 / -1; }
  .crm-pdv-form .item-actions{ grid-column: 1 / -1; }
}

.item-actions {
    display: flex;
    justify-content: center;
}


.item-actions {
    display: flex;
    justify-content: center;
}

.crm-total-section {
    background: #f8fafc;
    padding: 2rem;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    margin: 2rem 0;
}

.total-display {
    max-width: 400px;
    margin-left: auto;
}

.total-line {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.total-line.total-final {
    border-bottom: none;
    border-top: 2px solid #1e293b;
    font-size: 1.1rem;
    padding-top: 1rem;
    margin-top: 0.5rem;
}

/* Vendas */
.crm-filters {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.filters-form {
    display: flex;
    gap: 1.5rem;
    align-items: end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.filter-group input,
.filter-group select {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
}

.crm-order-details {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.order-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.order-info-card {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.order-info-card h3 {
    margin: 0 0 1rem;
    color: #1e293b;
    font-size: 1rem;
    font-weight: 600;
}

.order-info-card p {
    margin: 0.5rem 0;
    color: #374151;
}

.order-totals {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 6px;
    margin-top: 1.5rem;
    text-align: right;
}

.order-totals p {
    margin: 0.5rem 0;
    color: #374151;
}

.nfe-status {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.nfe-status.status-processing {
    background: #fef3c7;
    color: #92400e;
}

.nfe-status.status-issued {
    background: #d1fae5;
    color: #065f46;
}

.nfe-status.status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.nfe-status.status-error {
    background: #fee2e2;
    color: #991b1b;
}

/* Financeiro */
.financial-summary {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.financial-summary h2 {
    margin: 0 0 1.5rem;
    color: #1e293b;
    font-size: 1.25rem;
    font-weight: 600;
}

.payment-methods-summary {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.payment-methods-summary h2 {
    margin: 0 0 1.5rem;
    color: #1e293b;
    font-size: 1.25rem;
    font-weight: 600;
}

.payment-chart {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.payment-chart h3 {
    margin: 0 0 1.5rem;
    color: #1e293b;
    font-size: 1.1rem;
    font-weight: 600;
}

.chart-bars {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chart-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.bar-label {
    min-width: 120px;
    font-weight: 500;
    color: #374151;
}

.bar-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.bar-fill {
    height: 30px;
    background: linear-gradient(90deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: 4px;
    min-width: 2px;
    position: relative;
    transition: width 0.3s ease;
}

.bar-value {
    font-weight: 500;
    color: #374151;
    min-width: 100px;
}

.accounts-receivable {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.accounts-receivable h2 {
    margin: 0 0 1.5rem;
    color: #1e293b;
    font-size: 1.25rem;
    font-weight: 600;
}

.receivable-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.receivable-card {
    padding: 1.5rem;
    border-radius: 6px;
    text-align: center;
}

/* Configurações */
.crm-form-section {
    margin-bottom: 3rem;
}

.crm-form-section h2 {
    margin: 0 0 0.5rem;
    color: #1e293b;
    font-size: 1.25rem;
    font-weight: 600;
}

.section-description {
    color: #6b7280;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.crm-instructions {
    background: #f8fafc;
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin: 2rem 0;
}

.crm-instructions h2,
.crm-instructions h3 {
    color: #1e293b;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.crm-instructions h2:first-child,
.crm-instructions h3:first-child {
    margin-top: 0;
}

.crm-instructions ol,
.crm-instructions ul {
    margin-left: 1.5rem;
    line-height: 1.7;
}

.crm-instructions li {
    margin-bottom: 0.5rem;
}

.crm-instructions code {
    background: #e2e8f0;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.85em;
}

.config-status {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-top: 2rem;
}

.config-status h2 {
    margin: 0 0 1.5rem;
    color: #1e293b;
    font-size: 1.25rem;
    font-weight: 600;
}

.status-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 6px;
}

.status-item.status-ok {
    background: #d1fae5;
    color: #065f46;
}

.status-item.status-warning {
    background: #fef3c7;
    color: #92400e;
}

.status-item.status-info {
    background: #e0f2fe;
    color: #0277bd;
}

.status-icon {
    font-size: 1.25rem;
    font-weight: bold;
}

.status-text {
    font-weight: 500;
}

/* Import CSV */
.crm-instructions {
    background: #f8fafc;
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-bottom: 2rem;
}

.crm-instructions h3,
.crm-instructions h4 {
    color: #1e293b;
    margin: 1.5rem 0 1rem;
}

.crm-instructions ol {
    margin-left: 1.5rem;
}

.crm-instructions pre {
    background: #1f2937;
    color: #f9fafb;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.875rem;
    margin: 1rem 0;
}

.crm-import-results {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.error-list {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    padding: 1rem;
    border-radius: 6px;
    margin-top: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

.error-list li {
    color: #991b1b;
    margin-bottom: 0.5rem;
}

.crm-download-template {
    background: #f8fafc;
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-top: 2rem;
    text-align: center;
}

/* Responsividade */
@media (max-width: 768px) {
    .crm-layout {
        flex-direction: column;
    }
    
    .crm-sidebar {
        position: relative;
        width: 100%;
        height: auto;
    }
    
    .crm-content {
        margin-left: 0;
        padding: 1rem;
    }
    
    .crm-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .crm-form-grid {
        grid-template-columns: 1fr;
    }
    
    .item-grid {
        grid-template-columns: 1fr;
    }
    
    .filters-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .crm-table-container {
        overflow-x: auto;
    }
    
    .crm-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .order-info-grid {
        grid-template-columns: 1fr;
    }
}

/* Melhorias de acessibilidade e micro-interações */
.crm-btn:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.crm-form-group input:focus,
.crm-form-group select:focus,
.crm-form-group textarea:focus {
    transform: translateY(-1px);
}

.crm-table tbody tr {
    transition: all 0.2s ease;
}

.crm-stat-card,
.summary-card {
    transition: all 0.3s ease;
}

.status-badge {
    transition: all 0.2s ease;
}

/* Animações suaves */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.crm-content > * {
    animation: fadeIn 0.3s ease;
}

/* Estados de hover mais suaves */
.crm-table tr:hover {
    transform: translateX(2px);
}

.crm-menu a {
    position: relative;
    overflow: hidden;
}

.crm-menu a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
}

.crm-menu a:hover::before {
    left: 100%;
}

/* Evita rolagem horizontal no documento todo */
html, body { max-width: 100%; overflow-x: hidden; }

/* Sidebar fixa + conteúdo ocupando o restante */
.crm-content {
  margin-left: 250px;               /* já existe */
  width: calc(100% - 250px);        /* garante largura visível */
  overflow-x: hidden;               /* o body não rola pro lado */
}

/* A tabela é que rola na horizontal */
.crm-table-container {
  overflow-x: auto;                  /* <-- era hidden */
  overflow-y: visible;
}

/* Largura mínima pra caber colunas (ajuste à sua realidade) */
.crm-table {
  min-width: 1100px;                 /* pode aumentar/diminuir */
  table-layout: auto;
}

/* Evita quebra feia e mantém legível */
.crm-table th, .crm-table td { white-space: nowrap; }

/* (Opcional) Trunca nomes muito grandes na 2ª coluna */
.crm-table td:nth-child(2) {
  max-width: 680px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* (Opcional) Deixa 'Ações' sempre visível ao rolar pro lado */
.crm-table .actions {
  position: sticky;
  right: 0;
  background: #fff;
  box-shadow: -6px 0 8px rgba(0,0,0,.05);
}

/* (Opcional) Cabeçalho da tabela colado no topo ao rolar verticalmente */
.crm-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

/* Garante que a sidebar fique por cima, sem “comer” a barra de rolagem interna */
.crm-sidebar { z-index: 100; }


/* A tabela é o único lugar que rola na horizontal */
.crm-table-container{
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 16px;             /* dá espaço pra barra de rolagem */
  scrollbar-gutter: stable both-edges; /* reserva espaço p/ scrollbar (Chrome/Edge/Firefox novos) */
}

/* Paginação fora do container rolável, com quebra de linha */
.crm-pagination{
  display: flex;
  flex-wrap: wrap;                  /* QUEBRA em 2+ linhas se precisar */
  gap: 8px;
  padding: 12px 4px;
  position: relative;
  z-index: 2;                       /* fica acima de qualquer sombra */
}

.crm-pagination a,
.crm-pagination .current{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  background: #fff;
}

.crm-pagination .current{
  background: #111827;
  color: #fff;
  border-color: #111827;
}

.crm-pagination .ellipsis{
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  pointer-events: none;
  opacity: .7;
}

/* (opcional) Botões anterior/próximo */
.crm-pagination .nav{
  font-weight: 700;
}

/* === Full width somente quando o CRM estiver ativo === */
body.crm-app-page .site,
body.crm-app-page .site-content,
body.crm-app-page .content-area,
body.crm-app-page .entry-content,
body.crm-app-page .container,
body.crm-app-page .wrap {
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Opcional: dar um respiro lateral ao conteúdo interno do CRM */
body.crm-app-page .crm-layout {
  width: 100%;
  max-width: 100%;
  margin: 0;
}

body.crm-app-page .crm-content {
  padding: 0 24px 32px;
}

/* Garante que a tabela ocupe toda a largura disponível */
body.crm-app-page .crm-table-container,
body.crm-app-page .crm-table {
  width: 100%;
}

/* Se o tema tiver colunas/flutuações, zera para não “apertar” o CRM */
body.crm-app-page #primary,
body.crm-app-page .primary,
body.crm-app-page .content {
  float: none !important;
  width: 100% !important;
}

/* Full width e limpeza somente no CRM */
body.crm-app-page .site,
body.crm-app-page .site-content,
body.crm-app-page .content-area,
body.crm-app-page .entry-content,
body.crm-app-page .container,
body.crm-app-page .wrap,
body.crm-app-page .content,
body.crm-app-page #primary {
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
}

/* Some com títulos/cabecalhos padrão do tema */
body.crm-app-page .entry-title,
body.crm-app-page h1.entry-title,
body.crm-app-page .page-title,
body.crm-app-page .post-title,
body.crm-app-page .entry-header {
  display: none !important;
}

/* CRM ocupando a tela toda */
body.crm-app-page .crm-layout {
  width: 100%;
  max-width: 100%;
  margin: 0;
  min-height: 100vh;
}

/* Respiro lateral só no conteúdo do CRM */
body.crm-app-page .crm-content {
  padding: 0 24px 32px;
}

/* Tabelas sempre 100% (sem “aperto”) */
body.crm-app-page .crm-table-container,
body.crm-app-page .crm-table {
  width: 100%;
}

/* Evita que wrappers externos criem barras desnecessárias */
body.crm-app-page html, 
body.crm-app-page body {
  overflow-x: hidden;
}

/* === MODO APP (somente quando o CRM está ativo) === */
body.crm-app-page {
  margin-top: 0 !important;              /* se o tema ajusta por causa da admin bar */
  overflow-x: hidden;
}

/* some com admin bar caso algum plugin/tema ainda injete */
body.crm-app-page #wpadminbar { display: none !important; }

/* tira todo o invólucro/limite do tema */
body.crm-app-page .site,
body.crm-app-page .site-content,
body.crm-app-page .site-inner,
body.crm-app-page .content-area,
body.crm-app-page .entry-content,
body.crm-app-page .container,
body.crm-app-page .wrap,
body.crm-app-page .content,
body.crm-app-page #primary,
body.crm-app-page main {
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
}

/* some com header/footer do tema (sem afetar o CRM) */
body.crm-app-page .site-header,
body.crm-app-page header.site-header,
body.crm-app-page .header,
body.crm-app-page .site-footer,
body.crm-app-page footer.site-footer,
body.crm-app-page .footer,
body.crm-app-page .page-header,
body.crm-app-page .entry-header,
body.crm-app-page .page-title,
body.crm-app-page h1.entry-title {
  display: none !important;
}

/* layout do CRM ocupando a tela toda */
body.crm-app-page .crm-layout {
  width: 100%;
  max-width: 100%;
  margin: 0;
  min-height: 100vh;
}

/* respiro lateral do conteúdo do CRM */
body.crm-app-page .crm-content {
  padding: 0 24px 32px;
}

/* tabelas e contêineres do CRM sempre 100% */
body.crm-app-page .crm-table-container,
body.crm-app-page .crm-table {
  width: 100%;
}

/* evita barra horizontal em contêineres */
body.crm-app-page .crm-table-container {
  overflow-x: auto;
}

/* === PDV: Autocomplete de produtos (sugestões) === */
.crm-pdv-form .crm-form-group .suggest-box{ position: relative; }
.crm-pdv-form .crm-form-group .suggest-box .suggest-list{
  position: absolute;
  z-index: 3000;
  left: 0; right: 0; top: 100%;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0,0,0,.08);
  margin-top: 4px;
  max-height: 220px;
  overflow: auto;
}
.crm-pdv-form .crm-form-group .suggest-box .suggest-item{
  padding: 8px 10px;
  cursor: pointer;
  font-size: 14px;
}
.crm-pdv-form .crm-form-group .suggest-box .suggest-item:hover{
  background: #f3f4f6;
}

/* Preview do produto não quebra layout */
.crm-pdv-form .product-title{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Inputs/selects ocupam 100% da célula no grid */
.crm-pdv-form .item-grid .crm-form-group > input,
.crm-pdv-form .item-grid .crm-form-group > select{
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
