/* Estilos globais do corpo */
body {
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; /* Fonte mais moderna */
  line-height: 1.6;
  color: #333;
  background-color: #eef2f6; /* Fundo mais claro e moderno */
  margin: 0;
  /* Ensure html and body take full height for fixed positioning */
  height: 100%; 
  overflow-x: hidden; /* Prevent horizontal scroll */
}
/* Impede a rolagem do corpo quando um modal está aberto */
body.modal-open {
    overflow: hidden;
}
html {
    height: 100%;
}
/* Estilos do cabeçalho */
header {
  background-color: #000; /* CABEÇALHO PRETO */
  color: white;
  padding: 15px 20px;
  text-align: center;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15); /* Sombra suave */
}
header img {
  max-height: 150px; /* **AUMENTADO O TAMANHO DA LOGO** */
  width: auto;
  display: block;
  margin: 0 auto;
  border-radius: 8px; /* Cantos levemente arredondados para a logo */
}

.header-title {
    color: #fff;
    margin-top: 7px;
    margin-bottom: 0;
    font-weight: 500;
    font-size: 1.1em;
    letter-spacing: 1px;
}

.header-title .neon-blue {
    color: #00d9ff;
}

/* Estilos da barra de navegação */
nav {
  display: flex;
  justify-content: center;
  align-items: center; /* Alinha itens verticalmente */
  flex-wrap: wrap;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  background-color: #004080; /* Cor alterada para o azul escuro padrão */
  gap: 1px; /* Espaçamento que cria as linhas horizontais e verticais */
}
nav button {
  background-color: #004080;
  border: none;
  color: white;
  padding: 16px 25px; /* Más padding */
  cursor: pointer;
  font-size: 17px; /* Fonte um pouco maior */
  font-weight: 500;
  letter-spacing: 0.5px;
  flex: 1;
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease; /* Transições suaves */
  border-bottom: 3px solid transparent;
}
nav button:hover {
  transform: translateY(-2px); /* Efeito de elevação sutil */
}
nav button.active {
  font-weight: bold;
  border-bottom: 4px solid #000; /* Destaque más forte para aba ativa */
  transform: none; /* Sem elevação para o botão ativo */
  background-color: #0066cc; /* Cor azul mais forte para o botão ativo padrão */
}

/* --- CORES PERSONALIZADAS PARA ABAS DE NAVEGAÇÃO --- */
#nav-pedido {
    background-color: #28a745;
}
#nav-pedido:hover {
    background-color: #218838;
}
#nav-pedido.active {
    background-color: #26b449; /* Verde mais forte */
}
#nav-agenda {
    background-color: #ffc107;
    color: #333;
}
#nav-agenda:hover {
    background-color: #e0a800;
}
#nav-agenda.active {
    background-color: #ffc51a; /* Amarelo mais forte */
    color: #333;
}
#nav-config {
    background-color: #dc3545;
}
#nav-config:hover {
    background-color: #c82333;
}
#nav-config.active {
    background-color: #ea4c5a; /* Vermelho mais forte */
}


/* Estilos das seções (abas) */
section {
  display: none;
  background-color: #ffffff;
  margin: 25px auto; /* Centralizado com margens */
  max-width: 900px; /* Largura máxima para o conteúdo */
  border-radius: 10px; /* Cantos arredondados para as seções */
  box-shadow: 0 5px 15px rgba(0,0,0,0.1); /* Sombra suave */
  padding: 30px; /* Más padding interno */
}
section.active {
  display: block;
}
/* Títulos dentro das seções */
section h2 {
  color: #002c5c; /* Cor do cabeçalho */
  text-align: center;
  margin-bottom: 30px;
  font-size: 2.2em;
  border-bottom: 2px solid #004080; /* Linha de destaque para os títulos */
  padding-bottom: 10px;
}
/* Estilos para grupos de formulário */
.form-group {
  margin-bottom: 18px; /* Más espaçamento vertical */
}
label {
  display: block;
  font-weight: 600; /* Negrito para labels */
  color: #444;
  margin-bottom: 8px; /* Espaço entre label e input */
  font-size: 0.95em;
}
input, select, textarea {
  width: 100%;
  padding: 12px 15px; /* Más padding */
  box-sizing: border-box;
  border-radius: 6px; /* Cantos arredondados */
  border: 1px solid #ced4da; /* Borda más suave */
  font-size: 1em;
  transition: border-color 0.3s ease, box-shadow 0.3s ease; /* Transições suaves para foco */
}
input:focus, select:focus, textarea:focus {
  border-color: #007bff; /* Borda azul no foco */
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25); /* Efeito de brilho no foco */
  outline: none; /* Remove o outline padrão */
}
textarea {
  min-height: 80px; /* Altura mínima para textarea */
  resize: vertical; /* Permite redimensionar verticalmente */
}
/* Estilo customizado para o campo de descrição */
#descricao, #orcamentoDescricao {
    font-family: Georgia, 'Times New Roman', Times, serif;
    font-style: italic;
    color: #5a5a5a;
    font-size: 1.02em;
    line-height: 1.5;
}
/* Estilos dos botões gerais */
.btn {
  background-color: #004080;
  color: white;
  border: none;
  padding: 12px 25px; /* Más padding */
  cursor: pointer;
  border-radius: 8px; /* Más arredondado */
  margin-right: 10px;
  font-size: 1.05em; /* Fonte ligeiramente maior */
  font-weight: 600;
  transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
  box-shadow: 0 3px 6px rgba(0,0,0,0.1); /* Sombra para botões */
}
.btn:hover {
  background-color: #0050a0; /* Tom de azul um pouco más escuro no hover */
  transform: translateY(-2px); /* Efeito de elevação sutil */
  box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}
/* Estilos para o cabeçalho da agenda (novo) */
.agenda-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #f0f5fa;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    gap: 10px; /* Espaçamento entre os botões */
}
.agenda-header .btn {
    flex-shrink: 0; /* Impede que os botões encolham */
}
.agenda-header h3 {
    margin: 0;
    color: #002c5c;
    font-size: 1.6em;
    border-bottom: none; /* Remove a linha do título principal aqui */
    padding-bottom: 0;
    flex-grow: 1; /* Permite que o título ocupe o espaço restante */
    text-align: center;
}
.agenda-header .btn {
    padding: 8px 15px;
    font-size: 0.9em;
    background-color: #007bff;
    box-shadow: none;
}
.agenda-header .btn:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
}
/* Estilos do calendário na agenda */
.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr); /* 7 colunas para os dias da semana */
  gap: 10px; /* Más espaço entre os dias */
  padding: 10px;
}
/* Estilo para os nomes dos dias da semana no cabeçalho do calendário */
.day-header {
  font-weight: bold;
  color: #002c5c;
  text-align: center;
  padding: 10px 0;
  background-color: #e0e6ed; /* Fundo leve para o cabeçalho do dia */
  border-radius: 5px;
  margin-bottom: 5px;
}
.day {
  background: #fdfdff; /* Off-white para as células do dia */
  border: 1px solid #e0e6ed; /* Borda más clara */
  border-radius: 8px; /* Cantos arredondados */
  padding: 15px; /* Más padding */
  min-height: 100px; /* Altura mínima para cada dia */
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05); /* Sombra suave */
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.3s ease, border-color 0.3s ease;
}
.day:hover {
    transform: translateY(-3px); /* Efeito de elevação no hover */
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
/* ALTERAÇÃO: Cor mais forte para dias desabilitados na agenda */
.day.disabled-day {
    background-color: #ffebee; 
    border-color: #ffcdd2;
}
.day.disabled-day strong {
    color: #c62828; 
    opacity: 0.7;
}
.day.disabled-day:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Novo estilo para dias vazios (sem número) */
.day.empty {
    background-color: #f5f8fb; /* Fundo más claro para dias vazios */
    border: 1px dashed #e0e6ed; /* Borda tracejada */
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.03); /* Sombra interna suave */
    opacity: 0.7; /* Levemente transparente */
    cursor: default; /* Não clicável */
}
.day.empty:hover {
    transform: none;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.03); /* Mantém a sombra interna */
}
.day strong {
  display: block;
  font-size: 1.2em; /* Dia do mês maior */
  color: #004080;
  margin-bottom: 10px;
  text-align: center;
  border-bottom: 1px solid #eee; /* Separador para o número do dia */
  padding-bottom: 5px;
}
.day a {
    color: #007bff; /* Azul para links */
    text-decoration: none;
    font-size: 0.9em;
    /* margin-top: 5px; Removido para controle pelo container flex */
    transition: color 0.2s ease;
    flex-grow: 1; /* Permite que o link ocupe espaço restante no flex */
}
.day a:hover {
    color: #0056b3;
    text-decoration: underline;
}
/* Estilos para o container de pedido na agenda (link + botão) */
.pedido-agenda-item {
    display: flex;
    align-items: center;
    justify-content: flex-start; 
    gap: 5px;
    margin-top: 5px;
    white-space: nowrap; /* Impede a quebra de linha */
    overflow: hidden; /* Esconde o que transbordar */
    text-overflow: ellipsis; /* Adiciona "..." se o texto for muito longo */
}
/* Cor e estilo para pedidos concluídos individualmente */
.pedido-concluido {
    color: #28a745 !important; /* Verde vibrante para texto de pedido concluído */
    font-weight: bold;
    text-decoration: line-through; /* Riscar o texto para indicar conclusão */
}
/* Estilo para o botão de "OK" na agenda */
.btn-agenda-ok {
    background-color: #28a745; /* Verde */
    color: white;
    border: none;
    padding: 4px 8px; /* Menor padding */
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
    transition: background-color 0.2s ease, transform 0.1s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    flex-shrink: 0; /* Não permite que o botão diminua */
}
.btn-agenda-ok:hover {
    background-color: #218838;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
/* Para o dia inteiro quando todos os pedidos estão concluídos */
.day.day-concluido {
    background-color: #e6ffe6; /* Fundo verde claro para o dia */
    border-color: #a7d9a7; /* Borda verde */
    box-shadow: 0 3px 10px rgba(40,167,69,0.2); /* Sombra más destacada em verde */
}
/* NOVO ESTILO: Contorno para o dia atual */
.day.today-highlight {
    border: 3px solid #007bff; /* Borda azul vibrante */
    box-shadow: 0 0 15px rgba(0, 123, 255, 0.4), inset 0 0 5px rgba(0, 123, 255, 0.2); /* Sombra e brilho internos */
    background-color: #f0f8ff; /* Um azul muito claro */
}
.highlight { /* Para destacar o dia atual (o número) */
  color: #007bff; /* Azul para destaque do número */
  font-weight: bold;
  padding: 3px 6px;
  border-radius: 4px;
}
/* Estilos para o resumo do pedido (para impressão) */
.resumo-pedido {
  background-color: #fff;
  border: 2px solid #004080;
  padding: 20px;
  border-radius: 8px;
  max-width: 800px;
  margin: 20px auto;
  font-family: 'Segoe UI', Arial, sans-serif; /* Consistência de fonte */
}
.resumo-pedido h3 {
  text-align: center;
  color: #004080;
  margin-bottom: 20px;
  font-size: 14px;
}
.resumo-pedido .titulo {
  font-weight: bold;
  text-align: center;
  margin: 10px 0;
  font-size: 14px;
}
.resumo-pedido .info {
  margin: 5px 0;
}
.resumo-pedido .descricao {
  border: 1px solid #ccc;
  padding: 10px;
  margin: 10px 0;
  background: #f9f9f9;
}
.resumo-pedido .logo-resumo {
    display: block;
    max-height: 80px;
    margin: 0 auto 15px auto;
}
/* Novo estilo para a área de resultados do cálculo */
.calculation-results {
    margin-top: 25px; /* Más espaçamento */
    padding: 20px;
    border: 1px solid #a0cbed; /* Borda más suave */
    background-color: #e9f5ff; /* Um azul claro para destaque */
    border-radius: 8px; /* Cantos arredondados */
    font-size: 1.1em;
    font-weight: bold;
    color: #004080;
    line-height: 1.8; /* Melhor espaçamento para o texto */
}
.calculation-results div {
    margin-bottom: 8px; /* Más espaçamento */
}
/* Estilo para o texto de lucro em verde */
.profit-text {
    color: #28a745; /* Verde más vibrante */
}
/* Novos estilos para os detalhes dos itens */
.item-detail {
    font-size: 0.88em; /* Fonte ligeiramente menor */
    color: #333; /* Texto mais escuro para melhor leitura */
    font-weight: normal;
    margin-left: 25px; /* Recuo maior para os detalhes */
}

/* NOVO: Estilo para os detalhes de custo em negrito e vermelho */
.item-detail-cost strong {
    font-weight: bold;
    color: #333; /* Garante que o texto seja preto */
}
.item-detail-cost span {
    color: #dc3545; /* Vermelho */
    font-weight: bold;
}


/* Novos estilos para a seção de vendas */
#vendas .controls-and-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    justify-content: center;
    background-color: #f8fbfd; /* Fundo suave para a área de controles */
    border: 1px solid #e0e6ed;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.07);
}
#vendas .summary-box {
    background-color: #fff;
    border: none; /* Remove a borda, usa sombra */
    padding: 20px 30px; /* Más padding */
    border-radius: 8px;
    text-align: center;
    flex-grow: 1;
    min-width: 200px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08); /* Sombra más pronunciada */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#vendas .summary-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}
#vendas .summary-box .label {
    font-size: 1em; /* Fonte ligeiramente maior */
    color: #666;
    margin-bottom: 8px;
}
#vendas .summary-box .value {
    font-size: 2.2em; /* Números maiores */
    font-weight: bold;
    color: #002c5c; /* Azul más escuro para valores */
}
#vendas .summary-box .value.profit {
    color: #28a745; /* Verde más vibrante */
}
#vendas select#mesFiltro {
    padding: 12px 18px; /* Más padding */
    border-radius: 6px;
    border: 1px solid #a0cbed; /* Borda suave */
    font-size: 1.05em;
    background-color: white;
    cursor: pointer;
    flex-basis: 200px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.06); /* Sombra interna para profundidade */
}

/* Novos estilos para a seção 'Novo Pedido' para campos compactos */
.form-row {
    display: flex;
    gap: 30px; /* Espaçamento maior entre os campos */
    margin-bottom: 18px;
    flex-wrap: wrap;
    align-items: flex-end; /* Alinha os itens na base */
}
.form-row .form-group {
    flex: 1;
    min-width: 180px; /* Garante que os campos não ficam muito pequenos */
}

.form-row-checkboxes {
    gap: 15px;
    justify-content: flex-start; /* Alinha os checkboxes à esquerda */
}
.form-row-checkboxes > .form-group {
    min-width: 220px;
    flex-grow: 1;
}

/* Títulos dentro da seção de pedido e configurações */
#pedido h3, #orcamento h3, #configuracoes h3, #clientes h3, #molduras h3, #configuracoes h4, #vendas h3 {
    color: #004080;
    margin-top: 30px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.5em;
    border-bottom: 2px solid #004080;
    padding-bottom: 8px;
}
#configuracoes h4 {
    font-size: 1.3em;
    margin-top: 25px;
    margin-bottom: 15px;
    border-bottom: 1px solid #a0cbed;
    padding-bottom: 5px;
    color: #0059b3;
}

/* CORREÇÃO: Estilo para o grupo de checkbox (mais específico) */
.form-group.checkbox-group-styled {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0 15px; /* Padding horizontal */
    height: 50.5px; /* Altura para alinhar com outros inputs */
    box-sizing: border-box;
    flex-grow: 1; /* Ocupa espaço disponível */
    margin-bottom: 0; /* Alinhamento com align-items: flex-end */
}
.form-group.checkbox-group-styled input[type="checkbox"] {
    width: auto;
    margin-right: 12px;
    transform: scale(1.2);
    cursor: pointer;
}
.form-group.checkbox-group-styled label {
    margin-bottom: 0;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
}

/* Estilos para o grupo da taxa personalizada para alinhamento */
.custom-tax-group label {
    margin-bottom: 0;
    margin-right: 10px;
    flex-shrink: 0;
}

.custom-tax-group input[type="number"] {
    width: auto;
    flex-grow: 1;
    max-width: 80px;
    padding: 8px;
}


/* Estilo para o container do gráfico */
.chart-container {
    position: relative;
    height: 450px; /* Altura do container do gráfico */
    width: 100%;
    max-width: 850px; /* Limita a largura para melhor visualização */
    margin: 20px auto; /* Centraliza o container */
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    padding: 25px; /* Padding interno */
    box-sizing: border-box; /* Garante que padding não aumente a largura total */
}
/* Ajuste para o canvas do gráfico, para controle de altura */
#grafico, #graficoMensal, #graficoSemanal {
    display: block; /* Remove o espaço extra abaixo do canvas */
    max-width: 100%;
    max-height: 100%;
    height: auto; 
}

/* Novos estilos para a aba de Clientes e Orçamentos */
#clientes .search-container, #orcamento .search-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    padding: 15px; /* Adicionado padding */
    background-color: #f8fbfd; /* Fundo suave */
    border: 1px solid #e0e6ed;
    border-radius: 8px; /* Cantos arredondados */
    box-shadow: inset 0 1px 5px rgba(0,0,0,0.05); /* Sombra interna */
}
#clientes .search-container input, #orcamento .search-container input {
    flex-grow: 1;
    padding: 10px 15px;
    border-radius: 6px;
    border: 1px solid #a0cbed; /* Borda azul clara */
    font-size: 1em;
    background-color: white;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.06); /* Sombra interna */
    transition: border-color: 0.3s ease, box-shadow 0.3s ease;
}
#clientes .search-container input:focus, #orcamento .search-container input:focus {
    border-color: #007bff;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.06), 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}
#clientes .search-container button, #orcamento .search-container button {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 1em;
}


#clientes #listaClientes, #orcamento #listaOrcamentos {
    list-style: none;
    padding: 0;
    max-height: 400px; /* Altura máxima para rolagem */
    overflow-y: auto; /* Adiciona barra de rolagem se o conteúdo exceder */
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    background-color: #fdfdff;
    margin-bottom: 25px;
}

#clientes #listaClientes li, #orcamento #listaOrcamentos li {
    border-bottom: 1px solid #eef2f6;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

#clientes #listaClientes li:last-child, #orcamento #listaOrcamentos li:last-child {
    border-bottom: none;
}

#clientes #listaClientes li:hover, #orcamento #listaOrcamentos li:hover {
    background-color: #f0f5fa;
    transform: translateX(5px);
}

#orcamento #listaOrcamentos li {
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#clientes #listaClientes li {
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#clientes #listaClientes li .cliente-nome, #orcamento #listaOrcamentos .orcamento-header {
    font-weight: bold;
    color: #004080;
    flex-grow: 1;
    cursor: pointer;
}
#clientes #listaClientes li .cliente-telefone {
    color: #666;
    font-size: 0.9em;
}
#orcamento #listaOrcamentos .orcamento-details {
    font-size: 0.9em;
    color: #444;
    line-height: 1.5;
    display: none; /* Oculto por padrão */
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eef2f6;
}
#orcamento #listaOrcamentos .orcamento-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}
 #orcamento #listaOrcamentos .orcamento-actions .btn {
    padding: 6px 12px;
    font-size: 0.9em;
}


#clientes #detalhesCliente {
    border: 1px solid #a0cbed;
    background-color: #e9f5ff;
    padding: 20px;
    border-radius: 8px;
    display: none; /* Inicia oculto */
}
#clientes #detalhesCliente h4 {
    color: #002c5c;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.3em;
    border-bottom: 1px solid #007bff;
    padding-bottom: 5px;
}
#clientes #detalhesCliente p {
    margin: 5px 0;
    color: #333;
}
#clientes #detalhesCliente .pedidos-cliente-lista {
    list-style: none;
    padding: 0;
    margin-top: 15px;
}
#clientes #detalhesCliente .pedidos-cliente-lista li {
    background-color: #f8fbfd;
    border: 1px solid #d0e6f9;
    border-radius: 6px;
    padding: 10px 15px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
}
#clientes #detalhesCliente .pedidos-cliente-lista li .pedido-info {
    flex-grow: 1;
    color: #444;
}
#clientes #detalhesCliente .pedidos-cliente-lista li .pedido-info strong {
    color: #004080;
}
#clientes #detalhesCliente .pedidos-cliente-lista li .btn-pdf {
    background-color: #dc3545; /* Vermelho para PDF */
    padding: 6px 12px;
    font-size: 0.8em;
    border-radius: 5px;
    box-shadow: none;
}
#clientes #detalhesCliente .pedidos-cliente-lista li .btn-pdf:hover {
    background-color: #c82333;
    transform: none;
}

/* --- ALTERAÇÕES PARA RESPONSIVIDADE --- */
@media (max-width: 768px) {
    /* === NOVO LAYOUT DO MENU PARA CELULAR === */
    nav {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr; /* Layout com 3 colunas */
    }
    nav button {
        font-size: 14px;
        padding: 14px 5px;
        flex: auto;
        width: auto;
    }
    nav button:last-child {
        grid-column: 1 / -1; /* O último botão ocupa a linha inteira */
    }

    section {
        margin: 15px auto;
        padding: 20px;
        border-radius: 8px;
    }
    /* Ajuste específico para a agenda em telas pequenas */
    section#agenda {
        padding: 15px 10px;
    }
    .form-row {
        flex-direction: column; /* Empilha os campos em telas pequenas */
        gap: 0; /* Remove gap quando empilhado */
        align-items: stretch; /* Garante que os itens ocupem a largura toda */
    }
    .form-row .form-group {
        min-width: unset;
        width: 100%;
    }
    #configuracoes .form-row {
        flex-direction: row;
    }

    /* === NOVOS AJUSTES PARA AGENDA RESPONSIVA === */
    .agenda-header h3 {
        font-size: 1.2em;
    }
    .agenda-header .btn {
        padding: 6px 10px;
        font-size: 0.8em;
    }
    .calendar {
        grid-template-columns: repeat(7, 1fr);
        gap: 2px; /* Espaçamento muito menor */
        padding: 5px;
    }
    .day {
        padding: 4px; /* Padding bem menor */
        min-height: 65px; /* Altura menor */
        font-size: 0.7em; /* Fonte bem menor nos dias */
        border-radius: 4px;
    }
    .day strong {
        font-size: 0.85em; /* Número do dia um pouco menor */
        margin-bottom: 4px;
        padding-bottom: 2px;
    }
    .day-header {
        font-size: 0.7em;
        padding: 5px 0;
    }
    .pedido-agenda-item {
        gap: 2px;
    }
    .pedido-numero-agenda {
        padding: 2px 4px;
        font-size: 0.8em;
        margin-right: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .delivery-icon {
        font-size: 0.9em;
    }
    /* === FIM DOS AJUSTES PARA AGENDA RESPONSIVA === */

    #vendas .controls-and-summary {
        flex-direction: column;
        align-items: stretch;
    }
    #vendas .summary-box {
        min-width: unset;
        width: 100%;
        margin-bottom: 15px;
    }
    #vendas select#mesFiltro {
        width: 100%;
    }
    .chart-container {
        height: 300px; /* Menor altura para o gráfico em telas pequenas */
        padding: 15px; /* Ajusta padding para telas menores */
    }
    #clientes #listaClientes, #orcamento #listaOrcamentos {
        max-height: 300px; /* Ajusta altura para lista de clientes */
    }
    #clientes .search-container, #orcamento .search-container {
        flex-direction: column;
    }
    #clientes .search-container button, #orcamento .search-container button {
        width: 100%;
    }
    .molduras-category-buttons {
        grid-template-columns: 1fr; /* Uma coluna em telas menores */
        gap: 15px;
    }
    .molduras-category-button {
        font-size: 1.1em; /* Ajuste menor em telas pequenas */
        padding: 12px 18px;
    }
    .moldura-catalog-list {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .moldura-catalog-image {
        width: 120px;
        height: 50px;
        max-width: none;
        max-height: none;
    }
    .moldura-catalog-item {
         flex-direction: column;
         text-align: center;
    }
    .moldura-catalog-info {
        margin-left: 0;
        margin-top: 10px;
    }
}

.btn-excluir-cliente {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 4px 8px;
    font-size: 0.85em;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 8px;
}
.btn-excluir-cliente:hover {
    background-color: #c82333;
}

/* Estilos para o Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: opacity 0.3s ease;
}

.modal-content {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 450px;
    position: relative;
    text-align: center;
}

.close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 28px;
    cursor: pointer;
    color: #888;
    transition: color 0.2s ease;
}

.close-button:hover {
    color: #333;
}

.modal-content h4 {
    color: #004080;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.6em;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.modal-content p {
    margin-bottom: 10px;
    font-size: 1.0em;
    color: #555;
}

/* --- ESTILOS PARA O BOTÃO VOLTAR E TÍTULO DO MODAL --- */
.modal-title-with-back {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-back-btn {
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 24px;
    font-weight: bold;
    color: #555;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    padding-bottom: 2px;
    transition: all 0.2s ease;
}
.modal-back-btn:hover {
    background-color: #e0e0e0;
    border-color: #ccc;
}
.modal-title-placeholder {
    width: 36px; /* Mesma largura do botão para balancear */
}


.modal-buttons {
    margin-top: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px; /* Espaçamento entre os botões */
}

.modal-btn {
    background-color: #007bff; /* Azul padrão para PDF */
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.05em;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
    width: 100%; /* Botões ocupam largura total */
}

.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

.modal-btn.orange-btn {
    background-color: #fd7e14; /* Laranja */
}
.modal-btn.orange-btn:hover {
    background-color: #e67312;
}

.modal-btn.yellow-btn {
    background-color: #ffc107; /* Amarelo para Em Produção */
    color: #333; /* Texto escuro para contraste */
}
.modal-btn.yellow-btn:hover {
    background-color: #e0a800;
}

.modal-btn.green-btn {
    background-color: #28a745; /* Verde para Quadro Pronto */
}
.modal-btn.green-btn:hover {
    background-color: #218838;
}

.modal-btn.blue-btn {
    background-color: #007bff; /* Azul */
}
.modal-btn.blue-btn:hover {
    background-color: #0056b3;
}

.modal-btn.red-btn {
    background-color: #dc3545; /* Vermelho */
}
.modal-btn.red-btn:hover {
    background-color: #c82333;
}
/* --- NOVO --- Cor roxa para o botão de Custos */
.modal-btn.gray-btn {
    background-color: #6f42c1; /* Roxo */
}
.modal-btn.gray-btn:hover {
    background-color: #5a349c;
}


/* Estilo para o dia com todos os pedidos em produção */
.day.day-in-production {
    background-color: #fff9e6; /* Amarelo muito claro */
    border-color: #ffe08a; /* Borda amarela */
    box-shadow: 0 3px 10px rgba(255,193,7,0.2); /* Sombra más destacada em amarelo */
}

/* Novos estilos para o span do número do pedido */
.pedido-numero-agenda {
    padding: 5px 10px;
    border-radius: 5px;
    margin-right: 5px;
    font-weight: bold;
    transition: background-color 0.3s ease, color 0.3s ease;
    display: inline-block;
    color: #333;
}

.pedido-numero-agenda.status-pending {
    background-color: #e0e0e0; /* Cinza claro para pendente */
    color: #555;
}
.pedido-numero-agenda.status-in_production {
    background-color: #ffc107; /* Amarelo para em produção */
    color: #333;
}
.pedido-numero-agenda.status-completed {
    background-color: #28a745; /* Verde para concluído */
    color: white;
}

/* --- Novos estilos para a aba de Molduras (Catálogo) --- */
.molduras-category-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-top: 30px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.molduras-category-button {
    background: linear-gradient(145deg, #0056b3, #004080);
    color: white;
    border: none;
    padding: 18px 25px;
    border-radius: 10px;
    font-size: 1.3em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 5px 10px rgba(0,0,0,0.15);
    text-align: center;
    position: relative;
    overflow: hidden;
    flex-grow: 1; 
}

.molduras-category-button:hover {
    background: linear-gradient(145deg, #004080, #0056b3);
    transform: translateY(-3px);
    box-shadow: 0 8px 18px rgba(0,0,0,0.25);
}

.molduras-category-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.1);
    transition: transform 0.6s ease-out;
    transform: scale(0);
    border-radius: 10px;
}
.molduras-category-button:hover::after {
    transform: scale(1);
}

.category-button-wrapper {
    position: relative;
    display: flex;
}

.btn-delete-category-catalog {
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: #dc3545;
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding-bottom: 2px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    transition: transform 0.2s ease, background-color 0.2s ease;
    z-index: 10;
    display: none; 
}

.btn-delete-category-catalog:hover {
    background-color: #c82333;
    transform: scale(1.1);
}

#molduraCategorySelection.delete-mode .btn-delete-category-catalog {
    display: flex;
}


#molduraCatalogView {
    display: none;
    margin-top: 20px;
}

#molduraCatalogView h3 {
    color: #002c5c;
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.8em;
    border-bottom: 1px solid #a0cbed;
    padding-bottom: 10px;
}

.moldura-catalog-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.moldura-catalog-item {
    background-color: #fdfdff;
    border: 1px solid #e0e6ed;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.moldura-catalog-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.moldura-catalog-image {
    width: 533px;
    height: 50px;
    object-fit: contain;
    border-radius: 8px;
    margin-right: 0;
    margin-bottom: 15px;
    border: 2px solid #a0cbed;
    background-color: #f0f8ff;
    cursor: zoom-in;
    flex-shrink: 0;
}

.moldura-catalog-info {
    flex-grow: 1;
    text-align: center;
}

.moldura-catalog-info h5 {
    margin: 0 0 8px 0;
    color: #004080;
    font-size: 1.25em;
    font-weight: 700;
}

.moldura-catalog-info p {
    margin: 0;
    color: #666;
    font-size: 0.95em;
    line-height: 1.5;
}

.moldura-catalog-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    justify-content: center;
}
.moldura-catalog-actions .btn {
    padding: 6px 14px;
    font-size: 0.9em;
    margin-right: 0;
}
.btn-edit {
    background-color: #ffc107;
    color: #333;
}
.btn-edit:hover {
    background-color: #e0a800;
}
.btn-delete {
    background-color: #dc3545;
}
.btn-delete:hover {
    background-color: #c82333;
}


.molduras-back-button {
    display: block;
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.molduras-back-button:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
}

/* Custom Alert/Message Box Styles */
.custom-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.custom-alert-overlay.show {
    opacity: 1;
    visibility: visible;
}
.custom-alert-box {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    text-align: center;
    font-family: 'Segoe UI', sans-serif;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}
.custom-alert-overlay.show .custom-alert-box {
    transform: translateY(0);
}
.custom-alert-box p {
    margin-bottom: 20px;
    font-size: 1.1em;
    color: #333;
}
.custom-alert-box .alert-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}
.custom-alert-box button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: background-color 0.2s ease;
}
.custom-alert-box button.confirm-btn {
    background-color: #dc3545;
    color: white;
}
.custom-alert-box button.confirm-btn:hover {
    background-color: #c82333;
}
/* --- NOVO --- Estilo para o botão de confirmação verde do backup */
.custom-alert-box.backup-alert .confirm-btn {
    background-color: #28a745;
}
.custom-alert-box.backup-alert .confirm-btn:hover {
    background-color: #218838;
}

.custom-alert-box button.cancel-btn {
    background-color: #6c757d;
    color: white;
}
.custom-alert-box button.cancel-btn:hover {
    background-color: #5a6268;
}
.temporary-alert {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    padding: 15px 25px; border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1); z-index: 1001; font-family: 'Segoe UI', sans-serif;
    opacity: 0;
    transition: opacity 0.5s ease-out;
}
.temporary-alert.show {
    opacity: 1;
}
.temporary-alert.success {
    background-color: #d4edda; color: #155724;
}
.temporary-alert.error {
    background-color: #f8d7da; color: #721c24;
}

/* Image Zoom Modal */
.image-zoom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    display: none;
}

.image-zoom-modal-content {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
    max-width: 90%;
    max-height: 90%;
    overflow: auto;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-zoom-close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 30px;
    cursor: pointer;
    color: #fff;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.image-zoom-close-button:hover {
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
}

#zoomedImage {
    max-width: 100%;
    max-height: 100%;
    display: block;
    border-radius: 8px;
    object-fit: contain;
    margin: auto;
}

/* --- LOGIN STYLES --- */
#main-content {
    display: none;
}
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    transition: opacity 0.3s ease;
}
.login-box {
    background-color: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    text-align: center;
    width: 90%;
    max-width: 380px;
}
.login-box h2 {
    color: #002c5c;
    margin-bottom: 25px;
}
.login-box input {
    margin-bottom: 15px;
}
.login-box .btn {
    width: 100%;
    margin: 10px 0 0 0;
}
#login-error {
    color: #dc3545;
    margin-top: 15px;
    font-size: 0.9em;
    min-height: 1.2em;
}

/* Container para botões na aba de configurações e molduras */
.top-right-buttons {
    display: flex;
    justify-content: center;
    gap: 20px; 
    margin-bottom: 20px;
}

/* MODIFICAÇÃO: Aumenta o espaçamento apenas na aba de molduras */
#molduras .top-right-buttons {
    gap: 60px;
    margin-bottom: 30px;
}


#logout-btn, #signup-btn-main {
    margin: 0;
}

#logout-btn {
    background-color: #dc3545;
}
#logout-btn:hover {
    background-color: #c82333;
}
#signup-btn-main {
    background-color: #007bff;
}
#signup-btn-main:hover {
    background-color: #0056b3;
}

/* --- NOVOS ESTILOS E AJUSTES PARA BUSCA E MODAL DE MOLDURA --- */
.frame-selection-box {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin: 25px 0;
}

.frame-selection-box .form-row:first-child {
    justify-content: center;
    margin-bottom: 10px;
}
.moldura-search-container {
    flex-basis: 60%; 
    max-width: 400px;
    flex-grow: 0;
}

.input-with-button {
    display: flex;
    gap: 10px;
}
.input-with-button input {
    flex-grow: 1;
}
.input-with-button .btn {
    flex-shrink: 0;
    margin-right: 0;
}

.moldura-selected-display {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    border-radius: 6px;
    padding: 12px 15px;
    font-size: 1em;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.moldura-selected-display strong {
    color: #0f3d1a;
}
.btn-cancel-selection {
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 16px;
    font-weight: bold;
    line-height: 24px;
    text-align: center;
    padding: 0;
    cursor: pointer;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}
.btn-cancel-selection:hover {
    background-color: #c82333;
}


#molduraModal .modal-content {
    max-width: 500px;
}
.moldura-modal-list {
    list-style: none;
    padding: 0;
    margin-top: 20px;
    max-height: 40vh;
    overflow-y: auto;
    text-align: left;
}
.moldura-modal-item {
    padding: 12px 15px;
    border: 1px solid #eee;
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    background-color: #f9f9f9;
}
.moldura-modal-item:hover {
    background-color: #e9f5ff;
    border-color: #007bff;
}
.moldura-modal-item .code {
    display: inline-block;
    background-color: #28a745;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: bold;
    margin-right: 10px;
    font-size: 0.9em;
}
.moldura-modal-item .title {
    font-weight: 600;
    color: #333;
}
.moldura-modal-item .category {
    display: block;
    font-size: 0.9em;
    color: #666;
    margin-top: 4px;
}

/* --- ESTILOS CORRIGIDOS PARA A PÁGINA DE CONFIGURAÇÕES --- */
#configuracoes .settings-wrapper {
    max-width: 850px;
    margin: 0 auto;
}

#configuracoes .settings-card {
    background-color: #f8fbfd;
    border: 1px solid #e0e6ed;
    border-radius: 12px;
    padding: 20px 30px 30px 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.07);
}

#configuracoes .settings-card h3 {
    text-align: left;
    border-bottom: none;
    margin-bottom: 25px;
    font-size: 1.6em;
}

#configuracoes .settings-card h4 {
    text-align: center;
    font-size: 1.2em;
    border-bottom: 1px solid #a0cbed;
    padding-bottom: 8px;
    margin-top: 30px;
    margin-bottom: 25px;
    color: #0059b3;
}

#configuracoes .form-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}
/* NOVO: Container para grupos de inputs dinâmicos */
.dynamic-config-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}


#configuracoes .form-group {
    text-align: center;
    min-width: 200px;
    flex-basis: 220px;
    flex-grow: 0;
}

#configuracoes label {
    display: block;
    min-height: 2.5em;
    margin-bottom: 8px;
}

#configuracoes .form-group input {
    max-width: 200px;
    margin: 0 auto;
}

#configuracoes .button-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
}

#configuracoes .button-group .btn {
    margin-right: 0;
}

#configuracoes .button-group-description {
    text-align: center;
    font-size: 0.9em;
    color: #666;
    max-width: 500px;
    margin: 10px auto 0 auto;
    line-height: 1.4;
}

#configuracoes hr {
    margin: 30px auto;
    width: 80%;
    border: 0;
    border-top: 1px solid #dee2e6;
}

.delivery-icon {
    font-size: 1.1em;
    margin-left: 4px;
    vertical-align: middle;
}

/* --- ESTILOS PARA O ALERTA DE "QUADRO PRONTO" --- */
.custom-alert-box.status-pronto-alert #customAlertTitle {
    background-color: #d4edda;
    color: #155724;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}
.custom-alert-box.status-pronto-alert .confirm-btn {
    background-color: #28a745;
}
.custom-alert-box.status-pronto-alert .confirm-btn:hover {
    background-color: #218838;
}

/* --- ESTILOS PARA NOVA FERRAMENTA DE CADASTRO DE MOLDURAS --- */
#cadastroMolduraModal .modal-content {
    max-width: 800px; /* Aumenta a largura do modal para comportar a nova seção */
}

.cadastro-moldura-header {
    display: grid;
    grid-template-columns: 3fr 2fr 80px;
    gap: 15px;
    padding: 0 10px 10px 10px;
    font-weight: bold;
    color: #333;
    border-bottom: 2px solid #eee;
    margin-bottom: 15px;
    text-align: left;
}
.cadastro-moldura-header span:last-child {
    text-align: center;
}

#cadastroMolduraLinhas {
    max-height: 40vh;
    overflow-y: auto;
    padding: 5px;
    margin-bottom: 20px;
}

.cadastro-moldura-linha {
    display: grid;
    grid-template-columns: 3fr 2fr 80px;
    gap: 15px;
    align-items: center;
    margin-bottom: 10px;
}

.btn-remover-linha {
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 3px;
    transition: background-color 0.2s ease;
    margin: 0 auto;
}

.btn-remover-linha:hover {
    background-color: #c82333;
}

.cadastro-moldura-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    border-top: 2px solid #eee;
    padding-top: 20px;
}

/* NOVO: Estilos para o modal de nova categoria */
#novaCategoriaModal .modal-content {
    max-width: 500px;
    text-align: left;
}
#novaCategoriaModal .form-group {
    text-align: left;
}
#novaCategoriaModal .form-group small {
    font-size: 0.8em;
    color: #6c757d;
}

/* NOVO: Estilos para o Modal de Edição de Item */
#editItemModal .modal-content {
    max-width: 900px; /* Modal mais largo para o formulário */
    text-align: left;
}
#editItemModal .modal-body {
    max-height: 60vh;
    overflow-y: auto;
    padding: 10px;
}
#editItemModal h3 {
    text-align: center;
    color: #004080;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.5em;
}

/* === ESTILOS MODIFICADOS PARA O GERENCIADOR DE MOLDURAS === */
#categoriaOrderList {
    list-style: none;
    padding: 0;
    margin-top: 15px;
    max-height: 25vh;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 6px;
}
#categoriaOrderList li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    background-color: #f9f9f9;
}
#categoriaOrderList li:last-child {
    border-bottom: none;
}
#categoriaOrderList .category-name {
    font-weight: 600;
}
#categoriaOrderList .order-buttons {
    display: flex;
    align-items: center;
}
#categoriaOrderList .order-buttons button {
    background-color: #6c757d;
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    margin-left: 5px;
    cursor: pointer;
    font-size: 18px;
    line-height: 28px;
    padding: 0;
    transition: background-color 0.2s ease;
}
#categoriaOrderList .order-buttons button:hover {
    background-color: #5a6268;
}
.btn-delete-category {
    background-color: #dc3545 !important; /* Vermelho */
}
.btn-delete-category:hover {
    background-color: #c82333 !important;
}

.cadastro-moldura-sections {
    display: flex;
    flex-direction: column; /* Empilha as seções */
    gap: 20px;
}
.cadastro-moldura-sections > div {
    flex: 1;
    min-width: 300px;
}


/**************************************************/
/********** INÍCIO DAS CORREÇÕES FINAIS **********/
/**************************************************/

/* === VERSÃO FINAL - LAYOUT IDÊNTICO À FOTO (SEM RECUO) === */

/* 1. O container principal do item (a tag <li>) */
#listaQuadrosNoPedido li, 
#listaQuadrosNoOrcamento li {
    position: relative; /* Essencial para posicionar os botões */
    padding: 15px;
    padding-top: 50px; /* Espaço no topo para o título e botões não se sobreporem ao conteúdo */
    border-bottom: 1px solid #eef2f6;
}

/* 2. O container dos botões */
.item-summary-actions {
    position: absolute;
    top: 15px; /* Distância do topo */
    right: 15px; /* Alinha na direita */
    display: flex;
    gap: 10px;
}

/* 3. O título "Item X" */
.item-content-wrapper > strong {
    position: absolute;
    top: 15px;
    left: 15px;
    font-size: 1em;
}

/* 4. Estilo para cada linha de detalhe (as tags <p>) */
.item-detail-line {
    margin: 4px 0; /* Espaçamento vertical pequeno entre as linhas */
    font-size: 0.9em; 
    color: #555;
}

.profit-line {
    color: #28a745; /* Cor verde para o lucro */
}

/* 5. Estilos dos botões (permanecem os mesmos) */
.btn-edit-item, .btn-remove-item {
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 0.9em;
    margin: 0;
}
.btn-edit-item {
    background-color: #007bff;
}
.btn-edit-item:hover {
    background-color: #0056b3;
}
.btn-remove-item {
    background-color: #dc3545;
}
.btn-remove-item:hover {
    background-color: #c82333;
}

/* Ajuste fino para o modal de sobreposição que já corrigimos */
#editItemModal {
    z-index: 1001;
}

#molduraModal {
    z-index: 1002;
}