/* ==============================================
   ADMIN BIDARTIGOS – Estilos completos e melhorados
   (login, painel, modais, listbox, responsivo, dark mode)
============================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f7fafc;
  color: #1a202c;
  line-height: 1.5;
  min-height: 100vh;
  transition: background 0.2s, color 0.2s;
}

/* ===== TELA DE LOGIN ===== */
.login-screen {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(145deg, #f5f7fb, #e9edf2);
  padding: 1rem;
}
.login-box {
  background: #ffffff;
  border-radius: 32px;
  padding: 2.5rem 2rem 2.8rem;
  text-align: center;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 20px 40px -12px rgba(0,0,0,0.08), 0 8px 20px -8px rgba(0,0,0,0.04);
  border: 1px solid rgba(255,255,255,0.5);
  transition: box-shadow 0.3s;
}
.login-box:hover {
  box-shadow: 0 24px 48px -12px rgba(0,0,0,0.12);
}
.login-box h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #0f172a;
  letter-spacing: -0.3px;
}
.login-box p {
  color: #64748b;
  font-size: 0.95rem;
  margin-bottom: 1.8rem;
}
.login-box input {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  font-size: 1rem;
  margin-bottom: 1rem;
  outline: none;
  transition: all 0.2s;
  background: #f8fafc;
}
.login-box input:focus {
  border-color: #0D8F81;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(13,143,129,0.08);
}
.login-box button {
  width: 100%;
  padding: 0.8rem;
  background: #0D8F81;
  color: #fff;
  border: none;
  border-radius: 40px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 0.25rem;
}
.login-box button:hover {
  background: #0a6e63;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(13,143,129,0.25);
}
.login-error {
  color: #dc2626;
  font-size: 0.85rem;
  margin-top: 0.75rem;
}

/* ===== PAINEL ADMIN ===== */
.admin-panel {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f7fafc;
  transition: background 0.2s;
}
.admin-header {
  background: #ffffff;
  border-bottom: 1px solid #eaeef2;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  transition: background 0.2s, border-color 0.2s;
}
.admin-header h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.3px;
}
.header-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}
.header-actions a {
  color: #475569;
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 0.2s;
}
.header-actions a:hover {
  color: #0f172a;
}

/* ===== BOTÕES ===== */
.btn-outline {
  background: transparent;
  border: 1.5px solid #cbd5e1;
  padding: 0.4rem 1.2rem;
  border-radius: 40px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  color: #475569;
  transition: all 0.2s;
}
.btn-outline:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}
.btn-primary {
  background: #0D8F81;
  color: #fff;
  border: none;
  padding: 0.7rem 1.8rem;
  border-radius: 40px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.btn-primary:hover {
  background: #0a6e63;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(13,143,129,0.25);
}
.btn-primary:active {
  transform: translateY(0);
}
.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}
.btn-primary:disabled::after {
  content: " ⏳";
}
.btn-draft {
  background: #e2e8f0;
  color: #1e293b;
  border: none;
  padding: 0.7rem 1.8rem;
  border-radius: 40px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.btn-draft:hover {
  background: #cbd5e1;
  transform: translateY(-1px);
}
.btn-add-source {
  background: #f1f5f9;
  color: #475569;
  border: 1px dashed #cbd5e1;
  padding: 0.4rem 1.2rem;
  border-radius: 30px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}
.btn-add-source:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}
.btn-remove-source {
  background: transparent;
  border: 1px solid #fecaca;
  color: #b91c1c;
  padding: 0.3rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-remove-source:hover {
  background: #fef2f2;
}

/* ===== ABAS ===== */
.tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.4rem;
  background: #f1f5f9;
  border-radius: 16px;
  margin: 1rem 2rem 0;
  border-bottom: none;
  flex-wrap: wrap;
}
.tab-btn {
  flex: 1 1 auto;
  background: transparent;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.tab-btn:hover {
  background: rgba(255,255,255,0.6);
  color: #0f172a;
}
.tab-btn.active {
  background: #ffffff;
  color: #0D8F81;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.tab-btn.active:hover {
  background: #ffffff;
}

/* ===== CONTEÚDO PRINCIPAL ===== */
.admin-main {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 2rem 4rem;
  width: 100%;
}
.form-section,
.list-section {
  background: #ffffff;
  border: 1px solid #eef2f6;
  border-radius: 24px;
  padding: 2rem;
  margin-bottom: 2rem;
  transition: box-shadow 0.25s, transform 0.15s;
}
.form-section:hover,
.list-section:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.04);
}
.form-section h2,
.list-section h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1.2rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid #f1f5f9;
  color: #0f172a;
}

/* ===== FORMULÁRIOS ===== */
.form-group {
  margin-bottom: 1.2rem;
}
.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
  color: #334155;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s;
  background: #fcfcfd;
  color: #1e293b;
  resize: vertical;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: #0D8F81;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(13,143,129,0.06);
}
.form-group textarea {
  min-height: 80px;
}
.form-group-checkbox {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 1rem 0;
}
.form-group-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #0D8F81;
  cursor: pointer;
}
.form-group-checkbox label {
  font-weight: 400;
  color: #334155;
  cursor: pointer;
}

/* ----- SELECTS MELHORADOS (listbox) ----- */
.form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 16px;
  padding-right: 2.8rem;
  cursor: pointer;
  transition: all 0.2s;
}
.form-group select:hover {
  border-color: #94a3b8;
}
.form-group select option {
  padding: 0.5rem;
  background: #ffffff;
  color: #1e293b;
}
.form-group select:focus option:checked {
  background: #0D8F81;
  color: #fff;
}
/* Estilo para o select no modo escuro */
body.dark-mode .form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}
/* Melhora o hover e focus dos selects */
.form-group select:focus {
  border-color: #0D8F81;
  box-shadow: 0 0 0 4px rgba(13,143,129,0.06);
}
.form-group select option {
  padding: 8px 12px;
}

/* ===== EDITOR ===== */
.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding: 0.6rem 0.8rem;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px 16px 0 0;
  border-bottom: none;
}
.editor-toolbar button,
.editor-toolbar select {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
  cursor: pointer;
  color: #334155;
  transition: all 0.15s;
}
.editor-toolbar button:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
}
.html-mode-btn.active {
  background: #0D8F81 !important;
  color: #fff !important;
  border-color: #0D8F81 !important;
}
.editor-content {
  min-height: 280px;
  max-height: 500px;
  overflow-y: auto;
  padding: 1.2rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 0 0 16px 16px;
  background: #ffffff;
  font-family: 'Charter', Georgia, serif;
  font-size: 1rem;
  line-height: 1.7;
  outline: none;
  transition: border-color 0.2s;
}
.editor-content:focus-within {
  border-color: #0D8F81;
}

/* ===== FONTES ===== */
.source-item {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
  align-items: center;
}
.source-item .source-input {
  flex: 1;
  padding: 0.6rem 1rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  font-size: 0.9rem;
  background: #fcfcfd;
  transition: border-color 0.2s;
}
.source-item .source-input:focus {
  border-color: #0D8F81;
  outline: none;
}
.btn-remove-source {
  background: transparent;
  border: 1px solid #fecaca;
  color: #b91c1c;
  padding: 0.3rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
}
.btn-remove-source:hover {
  background: #fef2f2;
}

/* ===== LISTA DE ARTIGOS / FRASES / AUTORES ===== */
.admin-article-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  gap: 1rem;
  transition: background 0.15s;
  border-radius: 8px;
}
.admin-article-item:hover {
  background: #f8fafc;
}
.admin-article-info {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.admin-article-info strong {
  font-weight: 600;
  color: #0f172a;
  font-size: 0.95rem;
}
.admin-article-info .category-badge {
  background: #f1f5f9;
  padding: 0.2rem 0.7rem;
  border-radius: 20px;
  font-size: 0.7rem;
  color: #475569;
}
.admin-article-info .article-date-small {
  font-size: 0.7rem;
  color: #94a3b8;
}
.article-actions {
  display: flex;
  gap: 0.5rem;
}
.article-actions button {
  padding: 0.25rem 1rem;
  border: none;
  border-radius: 30px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-edit {
  background: #e6f0ff;
  color: #1a5d9c;
}
.btn-edit:hover {
  background: #cce4ff;
}
.btn-delete {
  background: #fee9e7;
  color: #b91c1c;
}
.btn-delete:hover {
  background: #fdd4d0;
}

/* ----- SCROLL PERSONALIZADO ----- */
#admin-articles-list,
#admin-phrases-list,
#authors-list {
  max-height: 400px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f1f5f9;
}
#admin-articles-list::-webkit-scrollbar,
#admin-phrases-list::-webkit-scrollbar,
#authors-list::-webkit-scrollbar {
  width: 6px;
}
#admin-articles-list::-webkit-scrollbar-track,
#admin-phrases-list::-webkit-scrollbar-track,
#authors-list::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 10px;
}
#admin-articles-list::-webkit-scrollbar-thumb,
#admin-phrases-list::-webkit-scrollbar-thumb,
#authors-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}
#admin-articles-list::-webkit-scrollbar-thumb:hover,
#admin-phrases-list::-webkit-scrollbar-thumb:hover,
#authors-list::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ===== STATUS / MENSAGENS ===== */
.form-status {
  padding: 0.7rem 1.2rem;
  border-radius: 16px;
  font-weight: 500;
  font-size: 0.9rem;
  margin-top: 1rem;
}
.form-status.success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}
.form-status.error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.form-status.info {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

/* ===== PREVIEW PANE ===== */
.preview-pane {
  background: #ffffff;
  border: 1px solid #eef2f6;
  border-radius: 20px;
  padding: 1.5rem;
  margin-top: 2rem;
  max-height: 500px;
  overflow-y: auto;
  transition: background 0.2s, border-color 0.2s;
}
.preview-pane h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 1rem;
}
#preview-content {
  font-family: 'Charter', Georgia, serif;
  font-size: 1.05rem;
  line-height: 1.6;
  color: #1a202c;
}
#preview-content h1 {
  font-size: 2rem;
  font-weight: 700;
}
#preview-content .meta {
  color: #64748b;
  font-size: 0.9rem;
  font-family: -apple-system, sans-serif;
}
#preview-content .summary {
  background: #f8fafc;
  padding: 1rem;
  border-radius: 12px;
  margin: 1rem 0;
  font-style: italic;
}
#preview-content .tags span {
  display: inline-block;
  background: #f1f5f9;
  padding: 0.2rem 0.7rem;
  border-radius: 20px;
  font-size: 0.75rem;
  color: #475569;
  margin-right: 0.3rem;
}
#preview-content .image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}
#preview-content .image-grid img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  object-fit: cover;
  aspect-ratio: 4/3;
}

/* ===== MODAIS ===== */
.modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15,23,42,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modalFade 0.2s ease;
}
@keyframes modalFade {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}
.modal-content {
  background: #ffffff;
  padding: 2rem 2rem 2.5rem;
  border-radius: 28px;
  width: 90%;
  max-width: 520px;
  box-shadow: 0 24px 48px -12px rgba(0,0,0,0.25);
  position: relative;
}
.modal-content h3 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 1rem;
  color: #0f172a;
}
.modal-content label {
  display: block;
  margin-top: 0.8rem;
  margin-bottom: 0.3rem;
  font-weight: 500;
  color: #334155;
  font-size: 0.9rem;
}
.modal-content input,
.modal-content textarea {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  font-family: monospace;
  font-size: 0.9rem;
  background: #fcfcfd;
  transition: border-color 0.2s;
}
.modal-content input:focus,
.modal-content textarea:focus {
  border-color: #0D8F81;
  outline: none;
}
.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 0.8rem;
  margin-top: 1.5rem;
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  color: #94a3b8;
  transition: color 0.2s;
  background: none;
  border: none;
}
.modal-close:hover {
  color: #0f172a;
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 768px) {
  .admin-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding: 1rem 1.2rem;
  }
  .tabs {
    margin: 0.5rem 1rem 0;
    padding: 0.3rem;
    gap: 0.15rem;
  }
  .tab-btn {
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
  }
  .admin-main {
    padding: 1.5rem 1rem;
  }
  .form-section,
  .list-section {
    padding: 1.2rem;
  }
  .admin-article-item {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .article-actions {
    justify-content: flex-end;
  }
  .modal-content {
    padding: 1.5rem;
    width: 95%;
  }
  .login-box {
    padding: 2rem 1.5rem;
  }
}
@media (max-width: 480px) {
  .form-group input,
  .form-group textarea,
  .form-group select {
    padding: 0.6rem 0.8rem;
    font-size: 0.9rem;
  }
  .btn-primary,
  .btn-draft {
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
  }
  .admin-article-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
  }
  .admin-article-info strong {
    font-size: 0.9rem;
  }
}

/* ==============================================
   MODO ESCURO (completo para admin)
============================================== */
body.dark-mode {
  background: #0a0c10;
  color: #eaeef2;
}
body.dark-mode .login-screen {
  background: #0f1117;
}
body.dark-mode .login-box {
  background: #11161d;
  border-color: #2a2f36;
}
body.dark-mode .login-box h2 {
  color: #eaeef2;
}
body.dark-mode .login-box p {
  color: #9aa2b0;
}
body.dark-mode .login-box input {
  background: #1e2a36;
  border-color: #3f5568;
  color: #e0e4e8;
}
body.dark-mode .login-box input:focus {
  border-color: #85b0df;
  background: #1e2a36;
}
body.dark-mode .admin-panel {
  background: #0a0c10;
}
body.dark-mode .admin-header {
  background: #11161d;
  border-color: #2a2f36;
}
body.dark-mode .admin-header h1 {
  color: #eaeef2;
}
body.dark-mode .header-actions a {
  color: #9aa2b0;
}
body.dark-mode .header-actions a:hover {
  color: #eaeef2;
}
body.dark-mode .btn-outline {
  border-color: #3f5568;
  color: #9aa2b0;
}
body.dark-mode .btn-outline:hover {
  background: #1e2a36;
  border-color: #85b0df;
}
body.dark-mode .tabs {
  background: #161b22;
}
body.dark-mode .tab-btn {
  color: #9aa2b0;
}
body.dark-mode .tab-btn:hover {
  background: rgba(255,255,255,0.05);
  color: #eaeef2;
}
body.dark-mode .tab-btn.active {
  background: #1e2a36;
  color: #85b0df;
}
body.dark-mode .form-section,
body.dark-mode .list-section {
  background: #11161d;
  border-color: #2a2f36;
}
body.dark-mode .form-section h2,
body.dark-mode .list-section h2 {
  border-bottom-color: #2a2f36;
  color: #eaeef2;
}
body.dark-mode .form-group label {
  color: #cbd5e1;
}
body.dark-mode .form-group input,
body.dark-mode .form-group textarea,
body.dark-mode .form-group select {
  background: #1e2a36;
  border-color: #3f5568;
  color: #e0e4e8;
}
body.dark-mode .form-group input:focus,
body.dark-mode .form-group textarea:focus,
body.dark-mode .form-group select:focus {
  border-color: #85b0df;
  box-shadow: 0 0 0 4px rgba(133,176,223,0.08);
}
body.dark-mode .form-group select option {
  background: #1e2a36;
  color: #e0e4e8;
}
body.dark-mode .form-group-checkbox label {
  color: #cbd5e1;
}
body.dark-mode .btn-draft {
  background: #2d3748;
  color: #e2e8f0;
}
body.dark-mode .btn-draft:hover {
  background: #4a5568;
}
body.dark-mode .btn-add-source {
  background: #1e2a36;
  border-color: #3f5568;
  color: #9aa2b0;
}
body.dark-mode .btn-add-source:hover {
  background: #2d3748;
}
body.dark-mode .editor-toolbar {
  background: #161b22;
  border-color: #2a2f36;
}
body.dark-mode .editor-toolbar button,
body.dark-mode .editor-toolbar select {
  background: #1e2a36;
  border-color: #3f5568;
  color: #e0e4e8;
}
body.dark-mode .editor-toolbar button:hover {
  background: #2d3748;
}
body.dark-mode .editor-content {
  background: #11161d;
  color: #e2e8f0;
  border-color: #2a2f36;
}
body.dark-mode .editor-content:focus-within {
  border-color: #85b0df;
}
body.dark-mode .admin-article-item {
  border-bottom-color: #2a2f36;
}
body.dark-mode .admin-article-item:hover {
  background: #161b22;
}
body.dark-mode .admin-article-info strong {
  color: #eaeef2;
}
body.dark-mode .admin-article-info .category-badge {
  background: #1e2a36;
  color: #9aa2b0;
}
body.dark-mode .admin-article-info .article-date-small {
  color: #6b7a8a;
}
body.dark-mode .btn-edit {
  background: #1a2a3a;
  color: #8ab4f8;
}
body.dark-mode .btn-edit:hover {
  background: #2a3a4e;
}
body.dark-mode .btn-delete {
  background: #3a1a1a;
  color: #feb2b2;
}
body.dark-mode .btn-delete:hover {
  background: #4a2a2a;
}
body.dark-mode .modal-content {
  background: #11161d;
}
body.dark-mode .modal-content h3 {
  color: #eaeef2;
}
body.dark-mode .modal-content label {
  color: #cbd5e1;
}
body.dark-mode .modal-content input,
body.dark-mode .modal-content textarea {
  background: #1e2a36;
  border-color: #3f5568;
  color: #e0e4e8;
}
body.dark-mode .modal-content input:focus,
body.dark-mode .modal-content textarea:focus {
  border-color: #85b0df;
}
body.dark-mode .modal-close {
  color: #6b7a8a;
}
body.dark-mode .modal-close:hover {
  color: #eaeef2;
}
body.dark-mode .preview-pane {
  background: #11161d;
  border-color: #2a2f36;
}
body.dark-mode .preview-pane h3 {
  color: #9aa2b0;
}
body.dark-mode #preview-content {
  color: #e2e8f0;
}
body.dark-mode #preview-content h1 {
  color: #eaeef2;
}
body.dark-mode #preview-content .meta {
  color: #9aa2b0;
}
body.dark-mode #preview-content .summary {
  background: #161b22;
  color: #cbd5e1;
}
body.dark-mode #preview-content .tags span {
  background: #1e2a36;
  color: #9aa2b0;
}
body.dark-mode .form-status.success {
  background: #1a3a2a;
  color: #9ae6b4;
  border-color: #276749;
}
body.dark-mode .form-status.error {
  background: #3a1a1a;
  color: #feb2b2;
  border-color: #9b2c2c;
}
body.dark-mode .form-status.info {
  background: #1a2a3a;
  color: #90cdf4;
  border-color: #2a69ac;
}
body.dark-mode #admin-articles-list,
body.dark-mode #admin-phrases-list,
body.dark-mode #authors-list {
  scrollbar-color: #3f5568 #1e2a36;
}
body.dark-mode #admin-articles-list::-webkit-scrollbar-track,
body.dark-mode #admin-phrases-list::-webkit-scrollbar-track,
body.dark-mode #authors-list::-webkit-scrollbar-track {
  background: #1e2a36;
}
body.dark-mode #admin-articles-list::-webkit-scrollbar-thumb,
body.dark-mode #admin-phrases-list::-webkit-scrollbar-thumb,
body.dark-mode #authors-list::-webkit-scrollbar-thumb {
  background: #3f5568;
}
body.dark-mode #admin-articles-list::-webkit-scrollbar-thumb:hover,
body.dark-mode #admin-phrases-list::-webkit-scrollbar-thumb:hover,
body.dark-mode #authors-list::-webkit-scrollbar-thumb:hover {
  background: #5a7a9a;
}

/* ==============================================
   ABA DE AUTORES – DESIGN MELHORADO
============================================== */
#authors-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.25rem 0;
  max-height: 500px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f1f5f9;
}
#authors-list::-webkit-scrollbar {
  width: 6px;
}
#authors-list::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 10px;
}
#authors-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}
#authors-list::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.author-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  border: 1px solid #eef2f6;
  border-radius: 16px;
  padding: 0.8rem 1.2rem;
  transition: all 0.2s ease;
  gap: 1rem;
  flex-wrap: wrap;
}
.author-item:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
  transform: translateY(-1px);
}

.author-info {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex: 1;
  min-width: 180px;
}
.author-avatar-small {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #eef2f6;
  transition: border-color 0.2s;
  flex-shrink: 0;
}
.author-item:hover .author-avatar-small {
  border-color: #0D8F81;
}

.author-info strong {
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
}
.author-info .verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: #e6f0ff;
  color: #1a5d9c;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15rem 0.6rem;
  border-radius: 20px;
  border: 1px solid #bfdbfe;
  white-space: nowrap;
}
.author-id {
  font-size: 0.7rem;
  color: #94a3b8;
  font-family: monospace;
  background: #f1f5f9;
  padding: 0.1rem 0.6rem;
  border-radius: 12px;
}

.author-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}
.author-actions button {
  padding: 0.3rem 1rem;
  border: none;
  border-radius: 30px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-edit-author {
  background: #e6f0ff;
  color: #1a5d9c;
}
.btn-edit-author:hover {
  background: #cce4ff;
  transform: translateY(-1px);
}
.btn-delete-author {
  background: #fee9e7;
  color: #b91c1c;
}
.btn-delete-author:hover {
  background: #fdd4d0;
  transform: translateY(-1px);
}

body.dark-mode .author-item {
  background: #11161d;
  border-color: #2a2f36;
}
body.dark-mode .author-item:hover {
  border-color: #4a627a;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
body.dark-mode .author-info strong {
  color: #eaeef2;
}
body.dark-mode .author-info .verified-badge {
  background: #1a2a3a;
  color: #8ab4f8;
  border-color: #2a4a6a;
}
body.dark-mode .author-id {
  background: #1e2a36;
  color: #6b7a8a;
}
body.dark-mode .btn-edit-author {
  background: #1a2a3a;
  color: #8ab4f8;
}
body.dark-mode .btn-edit-author:hover {
  background: #2a3a4e;
}
body.dark-mode .btn-delete-author {
  background: #3a1a1a;
  color: #feb2b2;
}
body.dark-mode .btn-delete-author:hover {
  background: #4a2a2a;
}
body.dark-mode #authors-list::-webkit-scrollbar-track {
  background: #1e2a36;
}
body.dark-mode #authors-list::-webkit-scrollbar-thumb {
  background: #3f5568;
}
body.dark-mode #authors-list::-webkit-scrollbar-thumb:hover {
  background: #5a7a9a;
}

@media (max-width: 640px) {
  .author-item {
    flex-direction: column;
    align-items: stretch;
    padding: 0.8rem 1rem;
  }
  .author-info {
    flex-wrap: wrap;
    gap: 0.4rem;
  }
  .author-actions {
    justify-content: flex-end;
    margin-top: 0.2rem;
  }
  .author-avatar-small {
    width: 36px;
    height: 36px;
  }
}

/* ==============================================
   ABA DE DESTAQUE – MELHORIAS
============================================== */
#current-featured-display {
  background: #f8fafc;
  border: 1px solid #eef2f6;
  border-radius: 16px;
  padding: 0.8rem 1.2rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
#current-featured-display strong {
  font-weight: 600;
  color: #0f172a;
}
#current-featured-text {
  font-weight: 500;
  color: #0D8F81;
}
#clear-featured-btn {
  background: transparent;
  border: 1px solid #fecaca;
  color: #b91c1c;
  border-radius: 30px;
  padding: 0.2rem 1rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}
#clear-featured-btn:hover {
  background: #fef2f2;
}

.featured-autocomplete {
  width: 100%;
  padding: 0.7rem 1rem 0.7rem 2.5rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  font-size: 0.95rem;
  background: #fcfcfd url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat 0.8rem center;
  background-size: 18px;
  transition: all 0.2s;
}
.featured-autocomplete:focus {
  border-color: #0D8F81;
  background-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(13,143,129,0.06);
  outline: none;
}
.featured-autocomplete::-webkit-calendar-picker-indicator {
  opacity: 0;
  width: 0;
  padding: 0;
}

.featured-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 16px;
  padding-right: 2.8rem;
  cursor: pointer;
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  font-size: 0.95rem;
  background-color: #fcfcfd;
}
.featured-select:focus {
  border-color: #0D8F81;
  box-shadow: 0 0 0 4px rgba(13,143,129,0.06);
  outline: none;
}

body.dark-mode #current-featured-display {
  background: #1e2a36;
  border-color: #2a2f36;
}
body.dark-mode #current-featured-display strong {
  color: #eaeef2;
}
body.dark-mode #current-featured-text {
  color: #85b0df;
}
body.dark-mode #clear-featured-btn {
  border-color: #5a2a2a;
  color: #feb2b2;
}
body.dark-mode #clear-featured-btn:hover {
  background: #3a1a1a;
}
body.dark-mode .featured-autocomplete {
  background-color: #1e2a36;
  border-color: #3f5568;
  color: #e0e4e8;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
}
body.dark-mode .featured-autocomplete:focus {
  border-color: #85b0df;
  background-color: #1e2a36;
}
body.dark-mode .featured-select {
  background-color: #1e2a36;
  border-color: #3f5568;
  color: #e0e4e8;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}
body.dark-mode .featured-select:focus {
  border-color: #85b0df;
}

.phrase-mini-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.phrase-mini-toolbar button {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
  cursor: pointer;
}

.phrase-editor {
  min-height: 70px;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
  color: #111;
  outline: none;
}

.phrase-editor:empty::before {
  content: attr(data-placeholder);
  color: #888;
}

.phrase-editor a {
  color: #0D8F81;
  font-weight: 700;
  text-decoration: none;
}

.phrase-editor a:hover {
  text-decoration: underline;
}

.phrase-preview a {
  color: #0D8F81;
  font-weight: 800;
  text-decoration: none;
  border-bottom: 2px solid rgba(13, 143, 129, 0.35);
}

.phrase-preview a:hover {
  border-bottom-color: #0D8F81;
}
#phrase-image-url,
#phrase-placement {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #dcdcdc;
  border-radius: 10px;
  font-size: 14px;
  background: #fff;
  transition: all 0.2s ease;
}

#phrase-image-url:focus,
#phrase-placement:focus {
  outline: none;
  border-color: #0D8F81;
  box-shadow: 0 0 0 3px rgba(13, 143, 129, 0.12);
}

/* ==============================================
   ABA DICIONÁRIO FINANCEIRO
============================================== */

.admin-token-box {
  background: #f8fafc;
  border: 1px solid #eef2f6;
  border-radius: 18px;
  padding: 1rem;
  margin-bottom: 1.4rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: end;
}

.admin-token-box small,
#dictionary-char-counter {
  display: block;
  color: #64748b;
  font-size: 0.78rem;
  margin-top: 0.35rem;
}

.dictionary-admin-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.dictionary-admin-search input {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  background: #fcfcfd;
  color: #1e293b;
  transition: all 0.2s;
}

.dictionary-admin-search input:focus {
  border-color: #0D8F81;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(13,143,129,0.06);
}

#admin-dictionary-list {
  max-height: 460px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f1f5f9;
}

#admin-dictionary-list::-webkit-scrollbar {
  width: 6px;
}

#admin-dictionary-list::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 10px;
}

#admin-dictionary-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

.dictionary-admin-item {
  align-items: flex-start;
}

.dictionary-term-info {
  align-items: flex-start;
  flex-direction: column;
}

.dictionary-term-info p {
  width: 100%;
  color: #64748b;
  font-size: 0.88rem;
  margin-top: 0.25rem;
}

body.dark-mode .admin-token-box,
body.dark-mode .dictionary-admin-search input {
  background: #111827;
  border-color: #1e2a36;
  color: #e5e7eb;
}

body.dark-mode .admin-token-box small,
body.dark-mode #dictionary-char-counter,
body.dark-mode .dictionary-term-info p {
  color: #9ca3af;
}

body.dark-mode #admin-dictionary-list {
  scrollbar-color: #3f5568 #1e2a36;
}

@media (max-width: 640px) {
  .admin-token-box,
  .dictionary-admin-search {
    grid-template-columns: 1fr;
  }
}
