*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-size: clamp(16px, 2vw, 18px);
}

.fa,
.fas,
.far,
.fal,
.fad,
.fab {
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900 !important;
}
.far {
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 400 !important;
}
.fab {
  font-family: "Font Awesome 6 Brands" !important;
  font-weight: 400 !important;
}

input, button, select, textarea, h1, h2, h3, h4, h5, h6, p, a {
  font-family: 'Montserrat', sans-serif;
}

textarea{
  resize: none;
  padding: 12px 14px;
  border: 1px solid #ccc;
  border-radius: 12px;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}

textarea:focus {
  border-color: #585CFF;
  box-shadow: 0 0 8px rgba(88, 92, 255, 0.3);
}

button{
  font-size: clamp(14px, 2vw, 16px) !important
}

html, body {
  font-family: 'Montserrat', sans-serif;
  height: 100%;
  background: linear-gradient(135deg, #f0f0f5 0%, #e6f0ff 100%);
  overflow: hidden;
  padding-bottom: 50px;
}

a {
  color: #003366;
  text-decoration: underline;
  transition: color 0.3s ease;
}
a:hover {
  color: #0055aa;
}

header {
    position: fixed;
    top:0;
    left:0;
    width:100%;
    height:80px;
    color: #fff;
    background: #0070C0;
    z-index:1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

.header-content {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "left center right";
    align-items: center;
    height: 100%;
    padding: 0 20px;
}

.header-left {
    grid-area: left;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-left: 10px;
}

.header-center {
    grid-area: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    text-align: left;
}

.header-actions {
    grid-area: right;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    position: relative;
    margin-left: 10px;
}

.logo_premify {
    height: 50px;
    object-fit: contain;
}

.logo {
    height: 60px;
    object-fit: contain;
}

.header-text {
    display:flex;
    flex-direction:column;
}

.header-text h1 {
    margin:0;
    font-size:26px;
    font-weight:700;
}

.header-text p {
    margin:0;
    font-size:20px;
    font-weight:400;
}

.admin-menu {
  display: none;
  position: absolute;
  top: 110%;
  left: 0;
  background: white;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
  min-width: 200px;
  overflow: hidden;
  z-index: 2000;
}

.admin-menu a {
  display: block;
  padding: 10px 14px;
  color: #333;
  font-size: 15px;
  text-decoration: none;
  transition: background 0.2s;
}
.admin-menu a:hover {
  background: #f0f4ff;
  color: #003366;
}

#usuariosContainer {
  max-height: 60vh;
  overflow-y: auto;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fafafa;
  padding: 10px;
}

#usuariosContainer::-webkit-scrollbar {
  width: 6px;
}
#usuariosContainer::-webkit-scrollbar-thumb {
  background-color: #ccc;
  border-radius: 3px;
}
#usuariosContainer::-webkit-scrollbar-thumb:hover {
  background-color: #999;
}

  .input-with-icon {
    position: relative;
    margin: 10px auto 20px;
    width: 80%;
  }

  .input-with-icon i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
  }

  .input-with-icon input {
    width: 100%;
    padding: 8px 8px 8px 32px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 14px;
  }

  .input-with-icon input:focus {
    outline: none;
    border-color: #2ecc71;
  }

.log-item {
    background-color: #f9f9f9;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
}
.log-item:hover {
    background-color: #f0f0f0;
}

.log-actions {
    display: flex;
    gap: 8px;
}

.small-btn {
    padding: 6px 10px;
    font-size: 13px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.small-btn:hover {
    transform: scale(1.05);
}

.small-btn:not(.danger) {
    background: #0070C0;
    color: white;
}
.small-btn:not(.danger):hover {
    background: #0090C0;
}

.small-btn.danger {
    background-color: #e74c3c;
    color: white;
}
.small-btn.danger:hover {
    background-color: #c0392b;
}

.small-btn.success {
  background-color: #28a745 !important;
  color: white;
}
.small-btn.success:hover {
  background-color: #218838!important;
}

.usuario-item.inativo {
  background-color: #e7dada;
}

.logs-modal {
    display: none; 
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 15, 15, 0.6);
    backdrop-filter: blur(6px);
    justify-content: center;
    align-items: center;
}

.logs-modal-content {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
    padding: 24px 28px;
    width: 100%;
    max-width: 850px;
    margin: auto;
    position: relative;
    animation: slideUp 0.25s ease-out;
}

.logs-modal-header {
  margin-top: 15px;
  background-color: #b3bfd8;
  color: #fff !important;
  padding: 5px 10px;
  border-radius: 6px;
}

.prompt-modal-content {
  background-color: #fff;
  width: 80%;
  max-width: 800px;
  max-height: 70vh;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  padding: 20px;
  overflow: hidden;
}

.prompt-body {
  flex: 1;
  overflow-y: auto;
  margin-top: 10px;
}

#promptModalTextarea {
  width: 100%;
  min-height: 500px;
  font-family: monospace;
  font-size: 14px;
  line-height: 1.4em;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 10px;
  resize: none;
  box-sizing: border-box;
}

#promptModalTextarea:focus {
  border: 3px solid #585CFF;
  box-shadow: 0 0 8px rgba(88, 92, 255, 0.3);
  outline: none;
}

.prompt-footer {
  text-align: right;
  margin-top: 10px;
  border-top: 1px solid #eee;
  padding-top: 10px;
  background: white;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logs-container {
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 6px;
}

.logs-modal-content h2,
.logs-modal-content h3 {
    text-align: center;
    color: #222;
    margin-bottom: 18px;
    font-family: "Montserrat", sans-serif;
}

hr {
    border: none;
    border-top: 1px solid #eee;
    margin: 20px 0;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #585CFF;
    box-shadow: 0 0 0 2px rgba(63, 185, 80, 0.2);
    outline: none;
}

textarea {
    resize: vertical;
}

.error-message {
    color: red;
    font-size: 13px;
    display: none;
    margin-top: 4px;
}

.input-erro {
  border-color: red;
}

select:disabled, input:disabled, textarea:disabled, button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}


.menu-btn {
    width: 100%;
    padding: 12px;
    background: #0070C0;
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s;
}

.menu-btn:hover {
    background: #0090C0;
    transform: translateY(-2px);
}

.menu-btn.admin-menu-btn {
  background: #0090C0;
}

.menu-btn.admin-menu-btn:hover {
  background: #00B0C0;
}

.logs-close-btn {
    position: absolute;
    right: 16px;
    top: 12px;
    font-size: 26px;
    cursor: pointer;
    color: #666;
    border: none;
    background: transparent;
    transition: color 0.2s;
}

.logs-close-btn:hover {
    color: #000;
}

.logs-modal-content input:focus,
.logs-modal-content select:focus {
  border-color: #585CFF;
  box-shadow: 0 0 8px rgba(88, 92, 255, 0.3);
}

footer {
    position: fixed;
    bottom:0;
    left:0;
    width:100%;
    height:40px;
    background: #0070C0;
    color:white;
    font-weight: 400;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:14px;
    z-index:1000;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

#main-container {
  margin-top:60px;
  margin-bottom:40px;  
  display: none;
  height: calc(100vh - 100px);
  padding: 20px;
  gap: 20px;
  overflow: hidden;
}

.content-columns {
  display: flex;
  flex: 1;
  gap: 20px;
}

.dash-column,
#chat-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  background: linear-gradient(145deg, #f2f2f7, #e6f0ff);
  padding: 20px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dash-column iframe {
  width: 100%;
  flex: 1;
  min-height: 0;
  aspect-ratio: 16/9;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border: none;
}

#upload-panel {
  width: 300px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  padding: 20px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#upload-panel h3 {
  margin-bottom: 6px;
  color: #003366;
}

#upload-panel p {
  color: #555;
  margin-bottom: 15px;
}

#upload-panel input[type="file"] {
  margin-bottom: 12px;
  width: 100%;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid #ccc;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
  transition: all 0.3s ease;
  box-sizing: border-box;
}
#upload-panel input:focus {
  border-color: #0055aa;
  box-shadow: 0 0 8px rgba(0,85,170,0.3);
}

#upload-panel button {
  background: #0070C0;
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
}
#upload-panel button:hover {
  background: #0090C0;
  transform: translateY(-2px);
}

#upload-result {
    margin-top: 20px;
    display: none;
    flex-direction: column;
    gap: 8px;
}

.msg-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
}

.msg-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
}


#chat-column {
  flex: 2;
  min-height: 0;
}

#chat-container {
  flex-grow: 1;
  padding: 20px;
  background: #dedee4;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  background: linear-gradient(145deg, #f2f2f7, #e6f0ff);
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  max-height: 100vh;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.message {
  max-width: 90%;
  padding: 10px 16px;
  border-radius: 20px;
  line-height: 1.6;
  word-wrap: break-word;
  animation: fadeInUp 0.4s ease-out;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.message.user {
  background: #003366;
  color: white;
  align-self: flex-end;
  border-radius: 20px 2px 20px 20px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.message.bot {
  background: #e9eef7;
  color: #333;
  align-self: flex-start;
  border-radius: 2px 20px 20px 20px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

form {
  display: flex;
  padding-top: 10px;
}

#pergunta {
  flex: 1;
  padding: 14px 16px;
  border: 1px solid #ccc;
  border-radius: 12px;
  outline: none;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
  transition: all 0.3s ease;
}
#pergunta:focus {
  border-color: #0055aa;
  box-shadow: 0 0 10px rgba(0,85,170,0.3);
}

#chat-container::-webkit-scrollbar {
  width: 6px;
}
#chat-container::-webkit-scrollbar-thumb {
  background-color: rgba(0,85,170,0.5);
  border-radius: 3px;
}

#login-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: #0070C0;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 20px;
}

#login-form, #reset-form {
  background: #fff;
  padding: 0 30px 30px 30px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  text-align: left;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#reset-form { display: none; }

#login-form h2, #reset-form h2 {
  margin-bottom: 20px;
  color: #003366;
  font-size: 20px;
  text-align: center;
}

.login-links {
  text-align: center;
}

#login-form input, #reset-form input {
  margin-bottom: 15px;
  padding: 12px 15px;
  border: 1px solid #ccc;
  border-radius: 12px;
  outline: none;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
  transition: all 0.3s ease;
}
#login-form input:focus, #reset-form input:focus {
  border-color: #0055aa;
  box-shadow: 0 0 8px rgba(0,85,170,0.3);
}

#login-form button, #reset-form button {
  background: #0070C0;
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}
#login-form button:hover, #reset-form button:hover {
  background: #0090C0;
  transform: translateY(-2px);
}

#login-form .logo-form {
  display: block;
  margin-left: 25%;
  max-width: 150px;
}

#login-error, #register-error, #reset-error, #funcao-error {
  color: red;
  margin-top: 10px;
  font-size: clamp(14px, 2vw, 16px);
  text-align: center;
  font-weight: 600;
}

#link-cadastrar, #link-resetar {
 font-size: clamp(14px, 2vw, 16px);
}

#user-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 20px;
}
#user-name {
  text-align: center;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rotating {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

  #btn-atualizar-container {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 10px 16px;
    border-radius: 8px;
    background-color: #f5f5f5;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transition: background-color 0.3s;
  }

  #btn-atualizar-container:hover {
    background-color: #e0e0e0;
  }
  #btn-atualizar {
    font-size: 20px;
    color: #003366;
  }

#fileInput {
  display: none;
}

.custom-file-label {
  background: #0070C0;
  color: white;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: smaller;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.3s ease;
}

.custom-file-label:hover {
  background: #0090C0;
}

.file-list-placeholder {
  margin-top: 10px;
  font-size: 14px;
  color: #555;
  max-height: 80px;
  overflow-y: auto;
  word-break: break-word;
  padding: 6px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background-color: #f9f9f9;
}

.logs-close-btn {
  color: #bbb;
  float: right;
  font-size: 22px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
}
.logs-close-btn:hover {
  color: #555;
  transform: rotate(90deg) scale(1.1);
}

.logs-card {
  background: linear-gradient(135deg, #f8fafc, #e0f2fe);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.logs-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(0,0,0,0.12);
}

.logs-timestamp {
  font-size: 10px;
  color: #6b7280;
  margin-bottom: 8px;
}

.logs-prompt {
  font-weight: 700;
  font-size: 15px;
  color: #111827;
  margin-bottom: 6px;
}

.logs-resposta {
  font-weight: 500;
  font-size: 14px;
  color: #374151;
  margin-bottom: 6px;
  line-height: 1.4;
}

.logs-racionalizacao {
  font-weight: 600;
  font-size: 14px;
  color: #1676a3;
  border-top: 1px solid rgba(22, 43, 163, 0.25);
  padding-top: 4px;
  margin-top: 4px;
}

#anexosContainer {
  font-family: Arial, sans-serif;
  margin-top: 10px;
}

.sem-anexos {
  color: #666;
  font-style: italic;
}

.erro {
  color: red;
  font-weight: bold;
}

.anexo-item {
  border: 1px solid #ccc;
  padding: 15px;
  margin-bottom: 12px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: all 0.2s ease;
  cursor: pointer;
}

.anexo-item.ativo {
  background-color: #d4edda;
}

.anexo-item.inativo {
  background-color: #f8d7da;
}

.anexo-nome {
  font-size: 1.1em;
}

.anexo-data {
  color: #555;
}

.status {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.85em;
  font-weight: bold;
}

.status-ativo {
  background: #c3e6cb;
  color: green;
}

.status-inativo {
  color: red;
}

.log-item.inativo {
    background-color: #f0f0f0;;
}

.status.inativo {
    font-size: 0.9em;
    color: rgb(179, 31, 31);
    margin-left: 8px;
}

.dots {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.dots span {
  display: inline-block;
  animation: bounceColor 1s infinite;
  font-weight: 600;
  font-size: 18px;
  color: #2663EB; 
}

.dots span:nth-child(1) { animation-delay: 0s; }
.dots span:nth-child(2) { animation-delay: 0.2s; }
.dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounceColor {
  0%, 80%, 100% {
    transform: translateY(0);
    color: #2663EB;
  }
  40% {
    transform: translateY(-10px);
    color: #9134EA;
  }
}



@media (max-width: 1024px) {
  #upload-panel { width: 100%; max-width: 280px; }
}

@media (max-width: 768px) {
  #main-container { flex-direction: column; height: 100%; padding: 0; }
  #upload-panel, .dash-column, .header-actions { display: none; }
  .content-columns { flex-direction: column; }
  #chat-column { flex-direction: column; height: 100vh; max-height: 100vh; overflow: hidden; width: 100vw; flex-grow: 1; }
  #chat-container { flex: 1; overflow-y: auto; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; width: 100%; max-width: 700px; margin: auto; border-radius: 0; background: #f5f2f0; }
  #chat-form { flex-shrink: 0; padding: 12px; background: #fff; border-top: 1px solid #ccc; position: sticky; bottom: 0; box-shadow: 0 -2px 6px rgba(0,0,0,0.1); z-index: 10; }
  #pergunta { font-size: 17px; padding: 14px; border-radius: 14px; }
  .message { font-size: 1.1rem; max-width: 100%; }
}
