/* ============================================
   CSS PREMIUM PARA LISTAS SALVAS
   Design moderno e responsivo para mobile
   ============================================ */

/* RESET PARA MOBILE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f8f9fa;
    -webkit-font-smoothing: antialiased;
}

/* CONTAINER PRINCIPAL */
.lista-supermercado-container {
    max-width: 100%;
    min-height: 100vh;
    padding: 20px 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.lista-supermercado-container h2 {
    color: white;
    font-size: 24px;
    font-weight: 800;
    text-align: center;
    margin: 0 0 25px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: -0.5px;
}

/* FILTRO MODERNO */
.filtro-listas-container {
    background: white;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.filtro-listas-container h3 {
    font-size: 18px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

#form-filtrar-listas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.filtro-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filtro-field label {
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
}

.filtro-field input {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    background: #f8fafc;
    transition: all 0.2s ease;
}

.filtro-field input:focus {
    border-color: #667eea;
    background: white;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filtro-buttons {
    grid-column: 1 / -1;
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.filtro-buttons button {
    flex: 1;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.filtro-buttons button:active {
    transform: scale(0.97);
}

#btn-filtrar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

#btn-limpar-filtros {
    background: #edf2f7;
    color: #4a5568;
}

#status-filtro {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    display: none;
    margin-top: 15px;
}

#status-filtro.success {
    background: #d1fae5;
    border: 1px solid #10b981;
    color: #065f46;
}

#status-filtro.error {
    background: #fee2e2;
    border: 1px solid #ef4444;
    color: #991b1b;
}

/* NOTICE DE LIMITE */
.notice {
    background: white;
    border-radius: 15px;
    padding: 16px 20px;
    margin-bottom: 20px;
    border-left: 4px solid;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.notice-warning {
    background: #fffbeb;
    border-color: #f59e0b;
    color: #92400e;
}

.notice-error {
    background: #fef2f2;
    border-color: #ef4444;
    color: #991b1b;
}

/* CONTAINER DE LISTAS */
.listas-salvas-container {
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

#listas-salvas {
    margin-bottom: 25px;
}

/* CARDS DE LISTA */
.lista-card {
    background: white;
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.lista-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* CABEÇALHO DA LISTA */
.lista-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    gap: 15px;
}

.lista-info {
    flex: 1;
}

.lista-supermercado {
    font-size: 18px;
    font-weight: 800;
    color: #2d3748;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lista-supermercado::before {
    content: '🏪';
    font-size: 20px;
}

.lista-data {
    font-size: 13px;
    color: #718096;
    display: flex;
    align-items: center;
    gap: 6px;
}

.lista-data::before {
    content: '📅';
    font-size: 14px;
}

.lista-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 18px;
}

.action-btn:active {
    transform: scale(0.95);
}

.btn-visualizar {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-editar {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.btn-excluir {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

/* RESUMO DA LISTA */
.lista-resumo {
    background: #f8fafc;
    border-radius: 15px;
    padding: 16px;
    margin-bottom: 15px;
}

.resumo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.resumo-item {
    text-align: center;
    padding: 12px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.resumo-label {
    font-size: 12px;
    font-weight: 600;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: block;
}

.resumo-valor {
    font-size: 16px;
    font-weight: 800;
    color: #2d3748;
}

.resumo-valor.total {
    color: #059669;
    font-size: 18px;
}

/* ITENS DA LISTA */
.lista-itens {
    margin-top: 15px;
}

.itens-header {
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.itens-header::before {
    content: '🛒';
    font-size: 16px;
}

.itens-container {
    max-height: 200px;
    overflow-y: auto;
    padding-right: 10px;
}

.itens-container::-webkit-scrollbar {
    width: 6px;
}

.itens-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.itens-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.itens-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.item-linha {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: white;
    border-radius: 10px;
    margin-bottom: 8px;
    border: 1px solid #e5e7eb;
}

.item-nome {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.item-quantidade {
    font-size: 13px;
    color: #667eea;
    font-weight: 700;
    margin: 0 12px;
    background: #e0e7ff;
    padding: 4px 8px;
    border-radius: 6px;
    min-width: 40px;
    text-align: center;
}

.item-valor {
    font-size: 14px;
    font-weight: 700;
    color: #059669;
    min-width: 70px;
    text-align: right;
}

/* BOTÃO CARREGAR MAIS */
.carregar-mais-container {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

#carregar-mais-listas {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 30px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

#carregar-mais-listas:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

#carregar-mais-listas:active {
    transform: translateY(0);
}

/* LOADING STATE */
.carregando-listas {
    text-align: center;
    padding: 40px 20px;
}

.carregando-listas .spinner {
    margin: 0 auto 20px auto;
    width: 40px;
    height: 40px;
    border: 3px solid #e0e7ff;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.carregando-listas p {
    color: #64748b;
    font-size: 15px;
    font-weight: 500;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* MENSAGEM SEM LISTAS */
.sem-listas {
    text-align: center;
    padding: 50px 20px;
}

.sem-listas .icon {
    font-size: 48px;
    margin-bottom: 20px;
    color: #cbd5e1;
}

.sem-listas h3 {
    color: #4b5563;
    font-size: 18px;
    margin-bottom: 10px;
}

.sem-listas p {
    color: #6b7280;
    font-size: 15px;
    line-height: 1.5;
}

/* MODAL ADICIONAR ITEM */
.modal-adicionar-item {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-adicionar-content {
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    animation: modalSlideUp 0.3s ease-out;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-adicionar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-adicionar-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #2d3748;
    margin: 0;
}

.btn-fechar-modal {
    background: #ef4444;
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
}

.modal-adicionar-body {
    padding: 20px;
}

.modal-field {
    margin-bottom: 20px;
}

.modal-field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 8px;
}

.modal-field input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    background: #f8fafc;
    transition: all 0.2s ease;
}

.modal-field input:focus {
    border-color: #667eea;
    background: white;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.modal-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.modal-adicionar-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 25px;
}

.modal-adicionar-buttons button {
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.modal-adicionar-buttons button:active {
    transform: scale(0.97);
}

.btn-confirmar-adicionar {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

.btn-cancelar-adicionar {
    background: #edf2f7;
    color: #4a5568;
}

/* SCANNER MODAL (simplificado) */
.scanner-modal-lista {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #0f172a;
    z-index: 1000;
}

.scanner-modal-lista-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.scanner-modal-lista-header {
    padding: 60px 20px 20px;
    background: #1e293b;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.scanner-modal-lista-header h3 {
    color: white;
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

#fechar-scanner-lista {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.scanner-modal-lista-body {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.scanner-viewport-lista {
    flex: 1;
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    background: #1e293b;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scanner-input-group-lista {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.scanner-input-lista {
    flex: 1;
    padding: 16px;
    border: 2px solid #334155;
    border-radius: 15px;
    font-size: 16px;
    background: #1e293b;
    color: white;
}

.scanner-search-btn-lista {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 15px;
    padding: 0 24px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============================================
   ESTILOS ESPECÍFICOS PARA A TABELA DE LISTA
   (Baseado na imagem fornecida)
   ============================================ */

/* Container principal da lista */
.lista-salva-conteudo {
    margin-top: 20px;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

/* Tabela estilo da imagem */
.tabela-lista-editavel {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Cabeçalho da tabela */
.tabela-lista-editavel thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.tabela-lista-editavel th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
}

.tabela-lista-editavel th:first-child {
    border-top-left-radius: 8px;
    padding-left: 20px;
}

.tabela-lista-editavel th:last-child {
    border-top-right-radius: 8px;
    padding-right: 20px;
}

/* Linhas da tabela */
.tabela-lista-editavel tbody tr {
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.2s ease;
}

.tabela-lista-editavel tbody tr:hover {
    background-color: #f8fafc;
}

.tabela-lista-editavel tbody tr:last-child {
    border-bottom: none;
}

/* Células da tabela */
.tabela-lista-editavel td {
    padding: 12px;
    vertical-align: middle;
    border: none;
}

.tabela-lista-editavel td:first-child {
    padding-left: 20px;
}

.tabela-lista-editavel td:last-child {
    padding-right: 20px;
}

/* Coluna específica da imagem */
.tabela-lista-editavel td:nth-child(1) {
    width: 80px;
    min-width: 80px;
    max-width: 80px;
    text-align: center;
    padding: 8px;
}

/* Container da imagem do produto */
.item-image-container {
    position: relative;
    width: 70px;
    height: 70px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

/* Imagem do produto */
.item-preview-imagem {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

/* Placeholder quando não tem imagem */
.sem-imagem-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #6c757d;
    font-size: 10px;
    text-align: center;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

/* Número do item (posição) */
.item-position-number {
    position: absolute;
    top: -6px;
    left: -6px;
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Coluna do nome do produto */
.tabela-lista-editavel td:nth-child(2) {
    font-weight: 500;
    color: #374151;
    min-width: 150px;
}

.item-nome .nome-texto {
    display: block;
    padding: 4px 0;
    line-height: 1.4;
}

/* Coluna de seleção (checkbox) */
.tabela-lista-editavel td:nth-child(3) {
    width: 60px;
    min-width: 60px;
    max-width: 60px;
    text-align: center;
}

.item-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin: 0;
}

/* Coluna de quantidade */
.tabela-lista-editavel td:nth-child(4) {
    width: 100px;
    min-width: 100px;
    max-width: 120px;
}

.quantidade-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    text-align: center;
    background: white;
    transition: all 0.2s ease;
}

.quantidade-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

/* Coluna de valor unitário */
.tabela-lista-editavel td:nth-child(5) {
    width: 120px;
    min-width: 120px;
    max-width: 140px;
}

.valor-unitario-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    text-align: right;
    background: white;
    transition: all 0.2s ease;
    font-family: 'Courier New', monospace;
    font-weight: 500;
}

.valor-unitario-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

/* Coluna do total */
.tabela-lista-editavel td:nth-child(6) {
    width: 100px;
    min-width: 100px;
    max-width: 120px;
    text-align: right;
    font-weight: 600;
    color: #059669;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.valor-total-text {
    display: block;
    padding: 8px 0;
}

/* Coluna de ações */
.tabela-lista-editavel td:nth-child(7) {
    width: 170px;
    min-width: 170px;
    max-width: 180px;
    padding: 8px;
}

/* Container superior com setas e checkbox */
.item-top-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 6px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

/* Setas de organização */
.arrow-buttons-container {
    display: flex;
    gap: 4px;
}

.arrow-button {
    min-width: 30px !important;
    padding: 4px 8px !important;
    font-size: 11px !important;
    line-height: 1;
    height: 26px !important;
    margin: 0 !important;
    border-radius: 4px !important;
    border: 1px solid !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.arrow-button.arrow-up {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    border-color: #059669 !important;
    color: white !important;
}

.arrow-button.arrow-down {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8) !important;
    border-color: #1d4ed8 !important;
    color: white !important;
}

.arrow-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Checkbox do item */
.item-checkbox-container {
    margin-left: 8px;
    display: flex;
    align-items: center;
}

/* Container dos botões principais */
.action-buttons-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Botões principais */
.btn-comprar-item,
.btn-salvar-item,
.btn-cancelar-item,
.btn-excluir-item {
    width: 100% !important;
    padding: 6px 10px !important;
    font-size: 11px !important;
    border-radius: 4px !important;
    border: 1px solid !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    text-align: center !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    line-height: 1.2 !important;
    height: auto !important;
}

.btn-comprar-item {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    border-color: #059669 !important;
    color: white !important;
}

.btn-salvar-item {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8) !important;
    border-color: #1d4ed8 !important;
    color: white !important;
}

.btn-cancelar-item {
    background: linear-gradient(135deg, #6b7280, #4b5563) !important;
    border-color: #4b5563 !important;
    color: white !important;
}

.btn-excluir-item {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    border-color: #dc2626 !important;
    color: white !important;
}

.btn-comprar-item:hover,
.btn-salvar-item:hover,
.btn-cancelar-item:hover,
.btn-excluir-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.btn-comprar-item:active,
.btn-salvar-item:active,
.btn-cancelar-item:active,
.btn-excluir-item:active {
    transform: translateY(0);
}

/* Item comprado */
.tabela-lista-editavel tr.item-comprado td {
    background-color: #f0fdf4 !important;
    position: relative;
}

.tabela-lista-editavel tr.item-comprado td::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #059669;
    transform: translateY(-50%);
}

.tabela-lista-editavel tr.item-comprado .nome-texto,
.tabela-lista-editavel tr.item-comprado .valor-total-text,
.tabela-lista-editavel tr.item-comprado .quantidade-input,
.tabela-lista-editavel tr.item-comprado .valor-unitario-input {
    opacity: 0.6;
}

.tabela-lista-editavel tr.item-comprado .btn-comprar-item {
    background: linear-gradient(135deg, #6b7280, #4b5563) !important;
    border-color: #4b5563 !important;
}

/* Item alterado */
.tabela-lista-editavel tr.item-alterado {
    background-color: #fff7ed !important;
    animation: pulseAlterado 2s ease-in-out;
}

@keyframes pulseAlterado {
    0%, 100% { background-color: #fff7ed; }
    50% { background-color: #fed7aa; }
}

/* Item selecionado */
.tabela-lista-editavel tr.item-selecionado {
    background-color: #eff6ff !important;
    border-left: 3px solid #3b82f6;
}

/* Cabeçalho da lista */
.lista-salva-conteudo > div:first-child {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5e7eb;
    flex-wrap: wrap;
    gap: 10px;
}

/* Checkbox "Selecionar todos" estilizado */
.selecionar-todos-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin: 0;
}

.selecionar-todos-checkbox-label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Botões de filtro/organização */
.filtros-organizacao-container {
    display: flex;
    gap: 6px;
    margin-left: 10px;
}

.filtro-btn {
    padding: 6px 12px !important;
    font-size: 12px !important;
    min-width: 45px !important;
    border-radius: 4px !important;
    border: 1px solid #d1d5db !important;
    background: white !important;
    color: #374151 !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    text-align: center !important;
}

.filtro-btn:hover {
    background: #f8fafc !important;
    border-color: #9ca3af !important;
    transform: translateY(-1px);
}

.filtro-btn.ativo {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    border-color: #764ba2 !important;
    color: white !important;
}

/* Botões de ação principal */
.btn-adicionar-item,
.btn-escanear-lista {
    margin-right: 5px;
}

.filtros-organizacao-container {
    border-left: 1px solid #dee2e6;
    padding-left: 10px;
    margin-left: 10px;
}

/* Estilo para checkbox quando marcado */
.item-checkbox:checked {
    accent-color: #007cba;
}

.selecionar-todos-checkbox:checked {
    accent-color: #007cba;
}

/* Indicador visual para itens selecionados */
.item-selecionado .item-nome {
    position: relative;
}

.item-selecionado .item-nome::before {
    content: "✓ ";
    color: #28a745;
    font-weight: bold;
    margin-right: 5px;
}

/* Efeito de foco para acessibilidade */
.item-checkbox:focus,
.selecionar-todos-checkbox:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Mensagens de status */
.mensagem-atualizacao {
    margin-top: 15px;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 13px;
    display: none;
}

.mensagem-atualizacao.auto-saving {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    color: #92400e;
}

.mensagem-atualizacao.mensagem-sucesso {
    background: #d1fae5;
    border: 1px solid #10b981;
    color: #065f46;
}

.mensagem-atualizacao.mensagem-erro {
    background: #fee2e2;
    border: 1px solid #ef4444;
    color: #991b1b;
}

.mensagem-atualizacao.mensagem-info {
    background: #dbeafe;
    border: 1px solid #3b82f6;
    color: #1e40af;
}

/* Animação para novos itens */
@keyframes fadeInItem {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tabela-lista-editavel tbody tr {
    animation: fadeInItem 0.3s ease-out;
}

/* ANIMAÇÕES */
.lista-card {
    animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* PREVENIR ZOOM EM INPUTS */
@media screen and (max-width: 768px) {
    input, select, textarea {
        font-size: 16px !important;
    }
}

/* RESPONSIVIDADE */
@media (max-width: 768px) {
    .lista-supermercado-container {
        padding: 15px 12px;
    }
    
    .filtro-listas-container {
        padding: 16px;
    }
    
    #form-filtrar-listas {
        grid-template-columns: 1fr;
    }
    
    .filtro-buttons {
        flex-direction: column;
    }
    
    .lista-card {
        padding: 16px;
    }
    
    .lista-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .lista-actions {
        justify-content: center;
    }
    
    .resumo-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .item-linha {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .item-quantidade {
        margin: 0;
        align-self: flex-start;
    }
    
    .item-valor {
        align-self: flex-start;
    }
    
    .modal-fields-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-adicionar-buttons {
        grid-template-columns: 1fr;
    }
    
    /* Responsividade da tabela */
    .tabela-lista-editavel {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .lista-salva-conteudo > div:first-child {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filtros-organizacao-container {
        margin-left: 0;
        margin-top: 10px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .filtro-btn {
        flex: 1;
        min-width: 60px;
    }
    
    .tabela-lista-editavel td:before {
        width: 40%;
        font-size: 12px;
    }
    
    .action-buttons-container {
        flex-direction: column;
    }
    
    .action-buttons-container button {
        width: 100% !important;
        min-width: 100% !important;
    }
    
    .item-top-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .arrow-buttons-container {
        width: 100%;
        justify-content: center;
    }
    
    .item-checkbox-container {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }
    
    /* Responsividade da coluna de imagem */
    .tabela-lista-editavel td:nth-child(1) {
        width: 60px !important;
        min-width: 60px !important;
        max-width: 60px !important;
        padding: 5px !important;
    }
    
    .item-image-container {
        width: 50px;
        height: 50px;
    }
    
    .sem-imagem-placeholder {
        font-size: 8px;
    }
    
    .item-position-number {
        width: 18px;
        height: 18px;
        font-size: 9px;
        top: -4px;
        left: -4px;
    }
}

@media (max-width: 480px) {
    .lista-supermercado-container h2 {
        font-size: 22px;
    }
    
    .lista-supermercado {
        font-size: 16px;
    }
    
    .action-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .resumo-valor {
        font-size: 15px;
    }
    
    /* Para dispositivos muito pequenos, converter tabela para layout vertical */
    @media (max-width: 360px) {
        .tabela-lista-editavel thead {
            display: none;
        }
        
        .tabela-lista-editavel tbody tr {
            display: block;
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            margin-bottom: 10px;
            padding: 10px;
        }
        
        .tabela-lista-editavel td {
            display: block;
            text-align: right;
            padding: 8px;
            position: relative;
            padding-left: 50%;
        }
        
        .tabela-lista-editavel td:before {
            content: attr(data-label);
            position: absolute;
            left: 10px;
            width: 45%;
            padding-right: 10px;
            white-space: nowrap;
            font-weight: bold;
            text-align: left;
        }
        
        .tabela-lista-editavel td:nth-child(1) {
            text-align: center;
            padding-left: 8px;
        }
        
        .tabela-lista-editavel td:nth-child(1):before {
            display: none;
        }
    }
}