/* ===== ESTILOS GERAIS ===== */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #eef2f5;
    color: #4a5568;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 40px auto;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    flex: 1;
}

/* ===== HEADER E BOTÕES ===== */
header {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

h1 {
    color: #2c5282;
    margin: 0;
    flex: 1;
    min-width: 200px;
}

/* Container para os botões do header */
.header-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* Estilo base para botões */
button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
}

#add-client-btn {
    background-color: #4299e1;
    color: white;
}

#add-client-btn:hover {
    background-color: #3182ce;
    transform: translateY(-2px);
}

#logout-btn {
    background-color: #e74c3c;
    color: white;
}

#logout-btn:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
}

/* ===== BARRA DE PESQUISA ===== */
#search-input {
    width: 100%;
    max-width: 300px;
    padding: 12px 20px;
    border: 1px solid #d1d5db;
    border-radius: 25px;
    font-size: 16px;
    color: #333;
    background-color: #f9fafb;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    outline: none;
}

#search-input:focus {
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
    background-color: #fff;
}

#search-input::placeholder {
    color: #9ca3af;
    font-style: italic;
}

/* ===== CONTROLES DA TABELA ===== */
.table-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

/* ===== BOTÃO REFRESH MELHORADO ===== */
#refresh-btn {
    padding: 10px 20px;
    background-color: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

#refresh-btn:hover {
    background-color: #e9ecef;
    color: #495057;
    transform: translateY(-2px);
}

#refresh-btn:disabled {
    opacity: 0.6;
    cursor: wait;
    transform: none;
}

#refresh-btn .icon {
    font-size: 16px;
    transition: transform 0.3s ease;
}

#refresh-btn:hover .icon {
    transform: rotate(360deg);
}

/* ===== TABELA ===== */
table {
    width: 100%;
    border-collapse: collapse;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border-radius: 8px;
    /*overflow: hidden;*/ /*Comentada pois esconde o menu ações*/
    margin: 20px 0;
}

thead th {
    background-color: #f7fafc;
    color: #718096;
    text-align: left;
    padding: 16px;
    font-weight: 600;
    border-bottom: 2px solid #e2e8f0;
}

tbody tr {
    transition: background-color 0.2s ease;
}

tbody tr:nth-child(even) {
    background-color: #fafafa;
}

tbody tr:hover {
    background-color: #ebf8ff;
}

td {
    padding: 16px;
    border-bottom: 1px solid #e2e8f0;
}

/* ===== STATUS ===== */
.status-ativo, .status-inativo, .envio-enviado, .envio-pendente, .envio-nao-enviado {
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    display: inline-block;
    font-size: 14px;
}

.status-ativo { background-color: #c6f6d5; color: #276749; }
.status-inativo { background-color: #fed7d7; color: #9b2c2c; }
.envio-enviado { background-color: #c4f1f9; color: #234e52; }
.envio-pendente { background-color: #fefcbf; color: #744210; }
.envio-nao-enviado { background-color: #fed7d7; color: #9b2c2c; }

/* style.css */

/* ===== MENU DE AÇÕES (Kebab Menu) ===== */
.actions-cell {
    position: relative;
    text-align: center;
}

.actions-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    color: #6c757d;
    padding: 5px 10px;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.actions-btn:hover {
    background-color: #f1f5f9;
    color: #2c5282;
}

.actions-menu {
    display: none; /* Inicia escondido */
    position: absolute;
    right: 30px; /* Alinha o menu à direita do botão */
    top: 50px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 100;
    width: 170px;
    overflow: hidden;
    animation: fadeIn 0.2s ease-out;
}

.actions-menu.show {
    display: block; /* Mostra o menu */
}

.actions-menu-item {
    display: block;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    text-align: left;
    font-size: 15px;
    color: #4a5568;
    cursor: pointer;
    transition: background-color 0.2s;
}

.actions-menu-item:hover {
    background-color: #ebf8ff;
    color: #2c5282;
}

/* Estilo específico para a opção de deletar */
.actions-menu-item.delete {
    color: #e53e3e;
}

.actions-menu-item.delete:hover {
    background-color: #fff5f5;
    color: #c53030;
}
/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 500px;
    position: relative;
    animation: fadeIn 0.3s ease-out;
}

/* === MODAL DE CONFIRMAÇÃO ELEGANTE (COM CLASSES ÚNICAS) === */
.custom-confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none; /* ← IMPORTANTE: iniciar escondido */
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: modalFadeIn 0.3s ease;
    padding: 20px;
    box-sizing: border-box;
}

.custom-confirm-modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 450px;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}

.custom-confirm-modal-header {
    background: linear-gradient(135deg, #2c5282, #3182ce);
    color: white;
    padding: 25px;
    text-align: center;
    position: relative;
}

.custom-confirm-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.custom-confirm-modal-header::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: #e53e3e;
    border-radius: 2px;
}

.custom-confirm-modal-body {
    padding: 35px 30px;
    text-align: center;
}

.custom-confirm-modal-body p {
    margin: 0;
    color: #4a5568;
    font-size: 16px;
    line-height: 1.6;
}

.custom-confirm-modal-footer {
    display: flex;
    gap: 12px;
    padding: 25px;
    background: #f8fafc;
}

.custom-confirm-btn-cancel {
    background: white;
    color: #64748b;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 20px;
    font-weight: 600;
    transition: all 0.3s ease;
    flex: 1;
    cursor: pointer;
}

.custom-confirm-btn-cancel:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-2px);
}

.custom-confirm-btn-ok {
    background: linear-gradient(135deg, #e53e3e, #c53030);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 14px 20px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(229, 62, 62, 0.3);
    flex: 1;
    cursor: pointer;
}

.custom-confirm-btn-ok:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(229, 62, 62, 0.4);
}

/* Animações */
@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}
/*--------- Fim codigo modal de confirmação-----*/
.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 15px;
}

.close-btn:hover, .close-btn:focus {
    color: #333;
    text-decoration: none;
}

.modal-content form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-content form label {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 5px;
}

.modal-content form input, 
.modal-content form select {
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    background-color: #f7fafc;
    transition: all 0.3s ease;
}

.modal-content form input:focus, 
.modal-content form select:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
}

.modal-content form button {
    margin-top: 15px;
    padding: 12px;
    background-color: #4299e1;
    color: white;
}

.modal-content form button:hover {
    background-color: #3182ce;
}

/* ===== NOTIFICAÇÕES ===== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    animation: notificationSlideIn 0.3s ease-out;
    max-width: 400px;
    border: 1px solid;
}

.notification-success {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.notification-error {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.notification-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.notification-text {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    margin: 0;
    color: inherit;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.notification-close:hover {
    opacity: 1;
}

@keyframes notificationSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== RODAPÉ ===== */
footer {
    width: 100%;
    padding: 25px 0;
    text-align: center;
    color: rgb(0, 0, 0);
    margin-top: auto;
}

footer p {
    margin: 0;
    font-size: 14px;
}

/* ===== RESPONSIVIDADE ===== */
@media screen and (max-width: 768px) {
    .container {
        margin: 15px;
        padding: 20px;
    }
    
    header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        text-align: center;
    }
    
    h1 {
        min-width: auto;
        font-size: 24px;
    }
    
    .header-buttons {
        justify-content: center;
        flex-direction: column;
        width: 100%;
    }
    
    #search-input {
        max-width: 90%;
        margin-bottom: 10px;
    }
    
    /* Tabela responsiva 768px*/
    table {
        display: block;
        overflow-x: auto;
    }
    
    thead {
        display: none;
    }
    
    tbody tr {
        display: block;
        margin-bottom: 20px;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 15px;
        background: white;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    
    tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 10px;
        border-bottom: 1px solid #f1f1f1;
        text-align: right;
    }
    
    tbody td::before {
        content: attr(data-label);
        font-weight: bold;
        text-align: left;
        color: #2c5282;
        margin-right: 15px;
    }
    
    .actions {
        justify-content: center;
        margin-top: 10px;
    }
    
    /* Modal responsivo 768px*/
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        padding: 25px 20px;
        margin: 10% auto;
    }
    /* Modal confirmação respossivo 768px*/
        .custom-confirm-modal {
        padding: 15px;
    }
    
    .custom-confirm-modal-content {
        width: 95%;
        max-width: none;
        margin: 0 10px;
    }
    
    .custom-confirm-modal-header {
        padding: 20px;
    }
    
    .custom-confirm-modal-header h3 {
        font-size: 18px;
    }
    
    .custom-confirm-modal-body {
        padding: 25px 20px;
    }
    
    .custom-confirm-modal-body p {
        font-size: 15px;
    }
    
    .custom-confirm-modal-footer {
        flex-direction: column;
        gap: 10px;
        padding: 20px;
    }
    
    .custom-confirm-btn-cancel,
    .custom-confirm-btn-ok {
        width: 100%;
        padding: 12px 15px;
        font-size: 14px;
    }

    
    /* Notificações responsivas 768px */
    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

@media screen and (max-width: 480px) {
    .container {
        margin: 10px;
        padding: 15px;
    }
    
    button {
        padding: 12px 16px;
        font-size: 14px;
        width: 100%;
    }
    
    .actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .actions button {
        width: 100%;
    }
    /*Modal resposivo 480px */
    .modal-content {
        padding: 20px 15px;
    }
    
    .modal-content form input, 
    .modal-content form select {
        padding: 14px;
    }

    /*Modal confirmação resposivo 480px */
      .custom-confirm-modal {
        padding: 10px;
    }
    
    .custom-confirm-modal-header {
        padding: 18px 15px;
    }
    
    .custom-confirm-modal-header h3 {
        font-size: 16px;
    }
    
    .custom-confirm-modal-body {
        padding: 20px 15px;
    }
    
    .custom-confirm-modal-body p {
        font-size: 14px;
        line-height: 1.5;
    }
    
    .custom-confirm-modal-footer {
        padding: 18px 15px;
        gap: 8px;
    }
    
    .custom-confirm-btn-cancel,
    .custom-confirm-btn-ok {
        padding: 11px 14px;
        font-size: 13px;
    }
    
    .custom-confirm-modal-header::after {
        width: 30px;
        height: 3px;
        bottom: -8px;
    }

}
/*Reposinvidade tela muito pequena para o modal de confirmação*/
@media screen and (max-width: 360px) {
    .custom-confirm-modal-header {
        padding: 15px 12px;
    }
    
    .custom-confirm-modal-header h3 {
        font-size: 15px;
    }
    
    .custom-confirm-modal-body {
        padding: 18px 12px;
    }
    
    .custom-confirm-modal-body p {
        font-size: 13px;
    }
    
    .custom-confirm-modal-footer {
        padding: 15px 12px;
    }
    
    .custom-confirm-btn-cancel,
    .custom-confirm-btn-ok {
        padding: 10px 12px;
        font-size: 12px;
    }
}

/*----------FIM  CODIGO RESPONSIVIDADE*/

/*----------------------------- INICIO CODIGO TELA LOGIN-------------------------------------------*/
/* Estilos para centralizar a página de login sem afetar o index */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #eef2f5;
}

/* Estilos para o container de login */
.login-container {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-container h2 {
    margin-bottom: 1.5rem;
    color: #333;
}

.login-container input {
    width: 90%;
    padding: 10px;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.login-container button {
    width: 100%;
    padding: 10px;
    background-color: #4299e1;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.login-container button:hover {
    background-color: #3182ce;
}

.error-message {
    color: #d9534f;
    margin-top: 1rem;
    font-size: 0.9rem;
}
/*--------------------Fim codigo tela de login---------------------*/

/*------------COMEÇO CODGO DE CARREGAR ta tabela ------------*/
/* Adicione ao seu style.css */
/* === LOADING OVERLAY === */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    flex-direction: column;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e3e3e3;
    border-top: 4px solid #4299e1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

#loading-overlay p {
    color: #4a5568;
    margin: 20px 0 0;
    font-size: 16px;
    font-weight: 500;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/*------------FIM CODGO DE CARREGAR ta tabela ------------*/

/* Transição suave para o container principal */
.container {
    transition: opacity 0.3s ease;
}


/* ===== ANIMAÇÕES ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== PAGINAÇÃO ===== */
.pagination-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 25px;
  padding: 15px;
  background-color: #f8fafc;
  border-radius: 8px;
  flex-wrap: wrap;
  gap: 15px;
  position: relative; /* Alterado de fixed para relative */
  bottom: auto; /* Remove posicionamento fixo */
  left: auto;
  right: auto;
  width: auto;
  max-width: 100%;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
}

.pagination-buttons {
  display: flex;
  align-items: center;
  gap: 15px;
}

.pagination-btn {
  padding: 10px 16px;
  background-color: #4299e1;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.pagination-btn:hover:not(:disabled) {
  background-color: #3182ce;
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(66, 153, 225, 0.3);
}

.pagination-btn:disabled {
  background-color: #cbd5e0;
  color: #718096;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.page-info {
  font-weight: 600;
  color: #4a5568;
  min-width: 80px;
  text-align: center;
  padding: 8px 12px;
  background: white;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.page-size-selector {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-size-selector label {
  font-size: 14px;
  color: #4a5568;
  font-weight: 500;
}

.page-size-selector select {
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background-color: white;
  font-size: 14px;
  cursor: pointer;
}

.page-size-selector select:focus {
  outline: none;
  border-color: #4299e1;
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
}

/* Responsividade da paginação */
@media screen and (max-width: 768px) {
  .pagination-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .pagination-buttons {
    justify-content: center;
  }
  
  .page-size-selector {
    justify-content: center;
    margin-top: 0;
  }
}

@media screen and (max-width: 480px) {
  .pagination-buttons {
    flex-direction: column;
    gap: 10px;
  }
  
  .pagination-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Ajuste para a nova coluna na responsividade */
@media screen and (max-width: 768px) {
  tbody td:nth-child(4)::before { /* Empresa - 4ª coluna */
    content: "Empresa:";
    font-weight: bold;
    text-align: left;
    color: #2c5282;
    margin-right: 15px;
  }
  
  /* Ajuste para a mensagem de nenhum cliente encontrado */
  tbody tr td[colspan="9"] {
    display: table-cell;
    text-align: center;
    padding: 20px;
    color: #666;
  }
}

/* Ajuste para telas muito pequenas */
@media screen and (max-width: 480px) {
  tbody td:nth-child(4)::before { /* Empresa */
    content: "Empresa:";
  }
}

/* style.css */

/* ===== TABELA DE HISTÓRICO DENTRO DO MODAL ===== */
.honorarios-table-container {
    overflow-x: auto; /* Garante a responsividade em telas pequenas */
    max-height: 400px; /* Limita a altura e adiciona rolagem se o conteúdo for grande */
    overflow-y: auto;
    margin-top: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.honorarios-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.honorarios-table th {
    background-color: #f8fafc;
    padding: 12px 15px;
    font-size: 14px;
    color: #4a5568;
    font-weight: 600;
    border-bottom: 2px solid #e2e8f0;
}

.honorarios-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e2e8f0;
    color: #4a5568;
    font-size: 14px;
}

.honorarios-table tbody tr:last-child td {
    border-bottom: none; /* Remove a borda do último item */
}

.honorarios-table tbody tr:hover {
    background-color: #f7fafc;
}

/* Estilo para os 'badges' de status dentro da tabela */
.honorarios-status-badge {
    padding: 5px 10px;
    border-radius: 16px;
    font-weight: 600;
    font-size: 12px;
    display: inline-block;
}

/* Reutilizando as cores de status que você já tem */
.status-Enviado { background-color: #c6f6d5; color: #276749; }
.status-Pendente { background-color: #fefcbf; color: #744210; }
.status-Erro { background-color: #fed7d7; color: #9b2c2c; }

/* Adiciona o estilo para o menu abrir para cima ("dropup") */
.actions-menu.open-upward {
    top: auto; /* Remove o posicionamento fixo no topo */
    bottom: 100%; /* Posiciona a base do menu na altura total do seu contêiner */
    margin-bottom: 5px; /* Adiciona um pequeno espaço para não colar no botão */
}