/* File: css/style.css */
:root {
    --bc-marrom-escuro: #3c1e19;
    --bc-marrom-medio: #571B1C;
    --bc-laranja: #ed5900;
    --bc-bege: #f3eee8;
    --bc-fundo: #FFFFFF;
    --bc-vermelho: #E53935;
    --bc-laranja-alerta: #FFA000;
    --bc-verde: #4CAF50;
    --bc-cinza: #9E9E9E;
}

body {
    font-family: 'Open Sans', sans-serif;
    background-color: var(--bc-bege);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Montserrat', sans-serif;
}

.bg-marrom {
    background-color: var(--bc-marrom-escuro);
}

.text-marrom {
    color: var(--bc-marrom-escuro);
}

.text-marrom-medio {
    color: var(--bc-marrom-medio);
}

.text-bc-laranja {
    color: var(--bc-laranja);
}

.bg-bc-laranja {
    background-color: var(--bc-laranja);
}

.bg-vermelho-alerta {
    background-color: var(--bc-vermelho);
}

.bg-laranja-alerta {
    background-color: var(--bc-laranja-alerta);
}

.bg-verde-ok {
    background-color: var(--bc-verde);
}

.bg-cinza {
    background-color: var(--bc-cinza);
}

.border-marrom {
    border-color: var(--bc-marrom-escuro);
}

.accent-bc-laranja {
    accent-color: var(--bc-laranja);
}

.modal-backdrop,
.sidebar-backdrop {
    transition: opacity .3s ease;
}

.modal-content {
    transition: transform .3s ease, opacity .3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn .5s ease-out forwards;
}

.shadow-up {
    box-shadow: 0 -4px 6px -1px rgb(0 0 0 / .1), 0 -2px 4px -2px rgb(0 0 0 / .1);
}

#menu-sidebar,
.action-dropdown {
    transition: all .3s ease;
}

#login-helper-sidebar,
#login-helper-toggler {
    transition: transform .3s ease-in-out;
}

body.sidebar-open #login-helper-sidebar {
    transform: translateX(0);
}

body.sidebar-open #login-helper-toggler {
    transform: translateX(-18rem);
}

#sidebar-backdrop-app.show {
    opacity: 1;
    pointer-events: auto;
}

#sidebar-backdrop-app {
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.faq-answer {
    transition: max-height .3s ease-in-out, padding .3s ease-in-out;
    overflow: hidden;
    max-height: 0;
}

#appScreen.card-mode {
    background-color: var(--bc-marrom-escuro);
}

#mainContent.card-layout {
    background-color: #fff;
    border-top-left-radius: 1.5rem;
    border-top-right-radius: 1.5rem;
    margin-top: -3.5rem;
    padding-top: 1rem;
}

/* --- ESTILOS PARA CAMPO DE BUSCA EXPANSÍVEL --- */
.search-input-container {
    position: relative;
}

.search-input-container input {
    position: absolute;
    top: 50%;
    right: 100%;
    transform: translateY(-50%);
    width: 0;
    opacity: 0;
    transition: all 0.3s ease-in-out;
    margin-right: 0.5rem;
    pointer-events: none;
    border-width: 1px;
}

.search-input-container.expanded input {
    width: 150px;
    padding-left: .75rem;
    padding-right: .75rem;
    opacity: 1;
    pointer-events: auto;
}

.img-container {
    width: 100%;
    height: 300px;
    background-color: #f7f7f7;
}

/* Alteração aqui: Aplicando o estilo para AMBAS as classes quando estiverem sendo arrastadas */
.faq-item.dragging,
.draggable-item.dragging {
    opacity: .5;
    background: var(--bc-bege);
}

.faq-item.drag-over {
    border-top: 2px solid var(--bc-laranja);
}

#pageHeader {
  height: 3rem;
  padding-top: 2rem;
  padding-bottom: 5rem;
}

/* Estilos para o componente de Select com Busca (Combobox) */
.searchable-select-container {
    position: relative;
}

.searchable-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 160px;
    overflow-y: auto;
    background-color: white;
    border: 1px solid #d1d5db; /* cinza-300 */
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem; /* rounded-b-md */
    z-index: 10;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); /* shadow-lg */
}

.searchable-select-dropdown.hidden {
    display: none;
}

.searchable-select-option {
    padding: 0.5rem 0.75rem; /* p-2 px-3 */
    cursor: pointer;
}

.searchable-select-option:hover, .searchable-select-option.highlighted {
    background-color: var(--bc-bege);
}

.searchable-select-option small {
    color: #6b7280; /* text-gray-500 */
    display: block;
}

/* Estilos para animações de botões */
.delete-lote-entry,
.remove-image-btn {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.delete-lote-entry.is-hidden,
.remove-image-btn.is-hidden {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

/* --- CORREÇÃO DO SLIDE BUTTON (TOGGLE) --- */
.toggle-checkbox {
    transition: transform 0.2s ease-in-out;
    transform: translateX(0rem);
    left: 0;
}

.toggle-checkbox:checked {
    transform: translateX(1rem); /* 16px */
    border-color: var(--bc-laranja);
}

.toggle-checkbox:checked + .toggle-label {
    background-color: var(--bc-laranja);
}

/* --- NOVOS ESTILOS PARA CARDS SOBREPOSTOS --- */
.lote-card-container > .lote-card:not(:first-child) {
    margin-top: -56px; /* Ajuste este valor para o nível de sobreposição desejado */
}

.lote-card-container > .lote-card {
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
  position: relative;
  background-color: white; /* Garante que o fundo não seja transparente */
}

.lote-card-container:hover > .lote-card:hover {
  transform: translateY(-4px) scale(1.01);
  z-index: 10;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* --- ESTILOS PARA NOTIFICAÇÕES E MENSAGENS --- */
.clickable-card {
    cursor: pointer;
}

.truncate-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.truncate-message {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- ESTILOS PARA MULTI-SELECT CUSTOMIZADO COM BADGES --- */
.custom-multiselect-container {
    position: relative;
}

.custom-multiselect-input {
    display: flex;
    align-items: center;
    background-color: white;
    border: 1px solid #d1d5db; /* gray-300 */
    border-radius: 0.375rem;
    padding: 0.5rem 2.5rem 0.5rem 0.75rem; /* py-2 pl-3 pr-10 */
    width: 100%;
    height: 42px; /* Altura explícita para alinhar com inputs (py-2 + border) */
    text-align: left;
    cursor: pointer;
    position: relative;
    color: #6b7280; /* gray-500 */
}

.custom-multiselect-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 10rem; /* h-40 */
    overflow-y: auto;
    background-color: white;
    border: 1px solid #d1d5db;
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
    z-index: 51; /* Acima da modal backdrop (z-50) */
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.custom-multiselect-option {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

.custom-multiselect-option:hover {
    background-color: #f3eee8; /* var(--bc-bege) */
}

.custom-multiselect-option.selected {
    background-color: #e5e7eb; /* gray-200 */
    font-weight: 600;
    color: #9ca3af; /* gray-400 */
    cursor: default;
}

.badge-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem; /* gap-2 */
    padding-top: 0.75rem; /* pt-3 */
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    background-color: var(--bc-marrom-escuro);
    color: white;
    border-radius: 9999px; /* rounded-full */
    font-size: 0.875rem; /* text-sm */
    font-weight: 600;
}

.badge-close {
    margin-left: 0.5rem; /* ml-2 */
    background: none;
    border: none;
    padding: 0;
    color: white;
    opacity: 0.7;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.badge-close:hover {
    opacity: 1;
}

/* --- ESTILOS PARA EDITOR DE TEXTO SIMPLES (RTE) --- */
.simple-rte .rte-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.5rem;
    border: 1px solid #d1d5db; /* gray-300 */
    border-bottom: none;
    border-radius: 0.375rem 0.375rem 0 0; /* rounded-t-md */
    background-color: #f9fafb; /* gray-50 */
}

.simple-rte .rte-button {
    background-color: transparent;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    color: #4b5563; /* gray-600 */
}

.simple-rte .rte-button:hover {
    background-color: #e5e7eb; /* gray-200 */
    color: #111827; /* gray-900 */
}

.simple-rte .rte-button.active {
    background-color: var(--bc-marrom-escuro);
    color: white;
}

.simple-rte .rte-content {
    border: 1px solid #d1d5db; /* gray-300 */
    border-radius: 0 0 0.375rem 0.375rem; /* rounded-b-md */
    padding: 0.5rem 0.75rem; /* p-2 px-3 */
    min-height: 8rem; /* h-32 */
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.simple-rte .rte-content:focus {
    border-color: var(--bc-marrom-escuro);
    box-shadow: 0 0 0 1px var(--bc-marrom-escuro);
}

.simple-rte .rte-content blockquote {
    border-left: 4px solid #d1d5db; /* gray-300 */
    padding-left: 1rem;
    margin-left: 0.25rem;
    color: #6b7280; /* gray-500 */
    font-style: italic;
}

/* Padronização de campos de formulário desabilitados */
input:disabled,
select:disabled,
textarea:disabled {
  background-color: #f3f4f6; /* Cor cinza Tailwind (gray-100) */
  border-color: #d1d5db; /* Borda cinza Tailwind (gray-300) */
  opacity: 0.7;
  cursor: not-allowed;
}

select:disabled {
  -webkit-appearance: none; /* Remove a aparência nativa para garantir a cor de fundo no Chrome/Safari */
  -moz-appearance: none;
  appearance: none;
}


@media print {
    body * {
        visibility: hidden
    }

    #mainContent,
    #mainContent * {
        visibility: visible
    }

    #mainContent {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%
    }

    #addFab,
    .no-print,
    header,
    nav {
        display: none !important
    }

    .print-only {
        display: block !important
    }
}

/* --- ESTILOS PARA VISIBILIDADE DO EDITOR DE TEXTO --- */
.simple-rte .rte-content ul,
.simple-rte .rte-content ol {
  list-style: revert;
  padding-left: 2rem;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.simple-rte .rte-content a {
  color: #0056b3;
  text-decoration: underline;
}

.simple-rte .rte-content a:hover {
  color: #003d80;
}

/* --- NOVOS ESTILOS PARA SIDEBAR DE FILTROS --- */

.filter-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    z-index: 51;
    pointer-events: none;
}

.filter-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

.filter-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 90%;
    max-width: 18rem; /* w-72, para igualar ao menu sidebar */
    background-color: white;
    z-index: 52;
    box-shadow: -10px 0 15px -3px rgb(0 0 0 / 0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}

#filter-sidebar-body {
    flex-grow: 1;
    overflow-y: auto;
}

#filter-sidebar-header,
#filter-sidebar-footer {
    flex-shrink: 0;
}


#filter-sidebar-footer {
    position: fixed;
    bottom: 0;
    width: 100%;
}

.filter-sidebar.show {
    transform: translateX(0);
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid #d1d5db; /* border-gray-300 */
    background-color: white;
    color: var(--bc-marrom-escuro);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.filter-pill:hover {
    border-color: var(--bc-marrom-escuro);
}

.filter-pill.active {
    background-color: var(--bc-marrom-escuro);
    color: white;
    border-color: var(--bc-marrom-escuro);
}

.filter-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem; /* w-6 */
    height: 1.5rem; /* h-6 */
    border-radius: 9999px;
    background-color: var(--bc-laranja);
    color: white;
    font-size: 0.875rem; /* text-sm */
    font-weight: 700;
}

.selected-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem; /* gap-2 */
    background-color: #e5e7eb; /* gray-200 */
    color: #374151; /* gray-700 */
    padding: 0.25rem 0.75rem; /* py-1 px-3 */
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
}

.selected-filter-tag button {
    color: #6b7280; /* gray-500 */
}

.selected-filter-tag button:hover {
    color: #111827; /* gray-900 */
}

.filter-footer-btn {
    font-size: 0.875rem; /* text-sm */
    white-space: nowrap;
}

/* --- ESTILOS PARA BOTÃO DE VISUALIZAR SENHA --- */
.password-toggle-btn {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    top: 0;
    bottom: 0;
    right: 0.75rem; /* 12px */
    margin-top: auto;
    margin-bottom: auto;
    height: 1.25rem; /* Altura do ícone (h-5) */
}