/* ==============================================
   ADMIN BIDARTIGOS – Estilos unificados
   (tela de login, painel, modais, responsivo)
============================================== */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #fafafa;
  color: #111;
  line-height: 1.5;
  min-height: 100vh;
}

/* ===== TELA DE LOGIN ===== */
.login-screen {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: #f5f5f5;
}

.login-box {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 24px;
  padding: 2rem 2rem 2.5rem;
  text-align: center;
  max-width: 380px;
  width: 90%;
  box-shadow: 0 8px 24px rgba(0,0,0,0.04);
}

.login-box h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #111;
}

.login-box p {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.login-box input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 12px;
  font-size: 1rem;
  margin-bottom: 1rem;
  outline: none;
  transition: border 0.15s;
}

.login-box input:focus {
  border-color: #111;
}

.login-box button {
  width: 100%;
  padding: 0.75rem;
  background: #111;
  color: #fff;
  border: none;
  border-radius: 40px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.login-box button:hover {
  background: #333;
}

.login-error {
  color: #c62828;
  font-size: 0.85rem;
  margin-top: 0.75rem;
}

/* ===== PAINEL ADMIN ===== */
.admin-panel {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.admin-header {
  background: #fff;
  border-bottom: 1px solid #eaeaea;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.admin-header h1 {
  font-size: 1.2rem;
  font-weight: 600;
}

.header-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.header-actions a {
  color: #444;
  font-size: 0.9rem;
  text-decoration: none;
}

.btn-outline {
  background: none;
  border: 1px solid #ccc;
  padding: 0.4rem 1rem;
  border-radius: 40px;
  cursor: pointer;
  font-size: 0.85rem;
  color: #555;
  transition: all 0.2s;
}

.btn-outline:hover {
  background: #f5f5f5;
  border-color: #999;
}

/* ===== ABAS ===== */
.tabs {
  display: flex;
  gap: 0.5rem;
  padding: 0 1.5rem;
  margin-top: 1rem;
  border-bottom: 1px solid #ddd;
  padding-bottom: 0.5rem;
}

.tab-btn {
  background: none;
  border: none;
  font-size: 1rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
  color: #555;
}

.tab-btn.active {
  background: #111;
  color: white;
}

/* ===== CONTEÚDO PRINCIPAL ===== */
.admin-main {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  width: 100%;
}

.form-section, .list-section {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 24px;
  padding: 1.8rem;
  margin-bottom: 2rem;
}

.form-section h2, .list-section h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1.2rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid #f0f0f0;
}

/* ===== FORMULÁRIOS ===== */
.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
  color: #333;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="url"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.7rem;
  border: 1px solid #ccc;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border 0.15s;
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: #111;
}

/* ===== EDITOR ===== */
.editor-toolbar {
  display: flex;
  gap: 0.3rem;
  padding: 0.5rem;
  background: #f5f5f5;
  border: 1px solid #ccc;
  border-bottom: none;
  border-radius: 16px 16px 0 0;
  flex-wrap: wrap;
}

.editor-toolbar button {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 0.35rem 0.7rem;
  font-size: 0.9rem;
  cursor: pointer;
  color: #333;
  transition: all 0.1s;
}

.editor-toolbar button:hover {
  background: #e9e9e9;
}

.editor-content {
  min-height: 250px;
  max-height: 500px;
  overflow-y: auto;
  padding: 1rem;
  border: 1px solid #ccc;
  border-radius: 0 0 16px 16px;
  background: #fff;
  font-family: 'Charter', Georgia, serif;
  font-size: 1rem;
  line-height: 1.6;
  outline: none;
}

/* ===== FONTES ===== */
.source-item {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  align-items: center;
}

.source-item .source-input {
  flex: 1;
  padding: 0.6rem;
  border: 1px solid #ccc;
  border-radius: 12px;
  font-size: 0.9rem;
}

.btn-remove-source {
  background: none;
  border: 1px solid #e0c0c0;
  color: #c62828;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
}

.btn-add-source {
  background: none;
  border: 1px dashed #aaa;
  padding: 0.5rem 1rem;
  border-radius: 40px;
  cursor: pointer;
  font-size: 0.85rem;
  color: #555;
  margin-top: 0.3rem;
}

.btn-add-source:hover {
  border-color: #333;
  color: #111;
}

/* ===== BOTÕES PRINCIPAIS ===== */
.btn-primary {
  background: #111;
  color: #fff;
  border: none;
  padding: 0.7rem 1.6rem;
  border-radius: 40px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #333;
}

/* ===== STATUS ===== */
.form-status {
  margin-top: 0.8rem;
  font-size: 0.9rem;
  padding: 0.5rem;
  border-radius: 12px;
}

.form-status.success {
  background: #e8f5e9;
  color: #2e7d32;
}

.form-status.error {
  background: #ffebee;
  color: #c62828;
}

/* ===== LISTA DE ARTIGOS ===== */
.admin-article-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 0;
  border-bottom: 1px solid #f0f0f0;
  gap: 1rem;
}

.admin-article-info {
  flex: 1;
}

.admin-article-info strong {
  font-size: 0.95rem;
  display: block;
}

.category-badge {
  color: #888;
  font-size: 0.8em;
  margin-left: 0.3rem;
}

.article-date-small {
  font-size: 0.75rem;
  color: #999;
}

.article-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-edit, .btn-delete {
  background: none;
  border: 1px solid #ccc;
  border-radius: 40px;
  padding: 0.35rem 0.8rem;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
}

.btn-edit:hover {
  background: #f0f0f0;
}

.btn-delete {
  border-color: #e0c0c0;
  color: #c62828;
}

.btn-delete:hover {
  background: #ffebee;
}

/* ===== AUTORES (lista) ===== */
.author-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eee;
  padding: 0.8rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.author-info {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.author-avatar-small {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.verified-badge {
  background: #e8f0fe;
  color: #1a73e8;
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 20px;
}

.author-id {
  font-size: 0.7rem;
  color: #888;
}

.author-actions button {
  margin-left: 0.5rem;
  background: #f0f0f0;
  border: none;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  cursor: pointer;
}

/* ===== MODAIS (código e matemática) ===== */
.modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: #fff;
  margin: auto;
  padding: 1.8rem;
  border-radius: 24px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  position: relative;
}

.modal-content h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.modal-content label {
  display: block;
  margin-top: 0.8rem;
  margin-bottom: 0.3rem;
  font-weight: 500;
}

.modal-content input,
.modal-content textarea {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid #ccc;
  border-radius: 12px;
  font-family: monospace;
  font-size: 0.9rem;
}

.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 0.8rem;
  margin-top: 1.2rem;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 1.5rem;
  cursor: pointer;
  color: #888;
}

.modal-close:hover {
  color: #000;
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 600px) {
  .admin-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .tabs {
    padding: 0 1rem;
  }
  .admin-main {
    padding: 1.5rem 1rem;
  }
  .form-section, .list-section {
    padding: 1.2rem;
  }
  .author-item {
    flex-direction: column;
    align-items: flex-start;
  }
  .author-actions {
    align-self: flex-end;
  }
}