/* =========================
   Base / Reset
========================= */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: 'Barlow', sans-serif; color: #333; background: #f7f9fc; }

/* Util */
.hidden { display: none !important; }

/* =========================
   Botões padrão (usados em todo o site)
========================= */
.btn {
  display: inline-block;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity .2s ease;
  line-height: 1.4;
}
.btn:hover { opacity: .9; }
.btn-primary  { background: #6c2bd9; color: #fff; }
.btn-secondary{ background: #eeeeee; color: #333; }
.btn-danger   { background: #ff5c5c; color: #fff; }
.btn-warning  { background: #ffc107; color: #212529; }

/* =========================
   LOGIN (index.php)
   -> Estilos isolados: só aplicam quando o <body> tem .login-body
========================= */
.login-body {
  background: linear-gradient(135deg, #fff0e6, #e6f0ff);
  min-height: 100vh;
  display: grid;
  place-items: center;
}
.login-container {
  background: #fff;
  width: 340px;
  padding: 36px 28px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
  text-align: center;
}
.login-logo {
  width: 160px;
  max-width: 90%;
  margin: 4px auto 12px auto;
  display: block;
}
.login-container h2 {
  margin: 6px 0 6px 0;
  font-weight: 600;
  color: #222;
  font-size: 18px;
}
.login-container .sub {
  margin: 0 0 18px 0;
  font-size: 14px;
  color: #666;
}

.login-container form input[type="email"],
.login-container form input[type="password"] {
  width: 100%;
  padding: 11px 12px;
  border: 2px solid #007bff;
  border-radius: 10px;
  font-size: 15px;
  outline: none;
  margin-bottom: 12px;
  background: #f7fbff;
}
.login-container form input[type="email"]:focus,
.login-container form input[type="password"]:focus {
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0,123,255,.12);
}
.login-container form button[type="submit"] {
  width: 100%;
  margin-top: 4px;
}
.login-error {
  background: #ffebeb;
  color: #b00000;
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 12px;
}
.login-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 12px;
  color: #6c2bd9;
  text-decoration: none;
}

/* =========================
   PAINEL (painel.php)
========================= */
.painel-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px;
  background: #fff;
  border-right: 1px solid #e6e6e6;
  padding: 20px 12px;
}
.sidebar img {
  width: 140px;
  display: block;
  margin: 0 auto 22px auto;
}
.sidebar a {
  display: block;
  padding: 10px 14px;
  border-radius: 8px;
  text-decoration: none;
  color: #333;
  font-weight: 500;
  margin-bottom: 8px;
}
.sidebar a:hover, .sidebar a.active {
  background: #e7d7fb;
  color: #6c2bd9;
}

.painel-conteudo { flex: 1; padding: 30px; }
.topbar {
  background: #fff;
  padding: 14px 22px;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 18px;
}
.painel-conteudo h1 { margin: 10px 0 16px 0; }

.filtros-form { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.filtros-form input, .filtros-form select {
  padding: 10px; border: 1px solid #cfcfcf; border-radius: 8px; font-size: 14px;
}

.painel-tabela {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
}
.painel-tabela th, .painel-tabela td {
  padding: 12px; font-size: 14px; border-bottom: 1px solid #eee; text-align: left;
}
.painel-tabela th { background: #f5f6f8; }

.badge {
  padding: 4px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; text-transform: uppercase;
}
.badge.sucesso  { background: #d4edda; color: #155724; }
.badge.erro     { background: #f8d7da; color: #721c24; }
.badge.pendente { background: #fff3cd; color: #856404; }

/* Modal */
.painel-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 9999; display: none;
}
.painel-modal-content {
  background: #fff; width: 90%; max-width: 820px; margin: 8vh auto; padding: 26px;
  border-radius: 10px; position: relative;
}
.modal-fechar { position: absolute; right: 14px; top: 10px; font-size: 22px; cursor: pointer; }

/* Ordenação visual (setinhas) */
.painel-tabela th[data-sort] { cursor: pointer; user-select: none; }
.painel-tabela th .sort-indicator { margin-left: 6px; opacity:.55; font-size: 12px; }
.painel-tabela th.sort-asc  .sort-indicator::after { content: "▲"; }
.painel-tabela th.sort-desc .sort-indicator::after { content: "▼"; }
/* --- Cards / Tipografia do conteúdo --- */
.card {
  background: #fff;
  border-radius: 12px;
  padding: 22px;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.page-title { margin: 4px 0 8px 0; font-size: 22px; font-weight: 700; }
.muted { color: #666; margin: 0 0 14px 0; }
.link { color: #6c2bd9; font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }

/* --- Alertas --- */
.alert {
  border-radius: 10px;
  padding: 12px 14px;
  margin: 12px 0 18px 0;
  border: 1px solid transparent;
  font-size: 14px;
}
.alert-success {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}
.alert-error {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

/* --- Formulário --- */
.form-group { margin: 14px 0 18px 0; }
.form-label { display:block; margin-bottom: 8px; }
.help { color:#777; font-size:12px; display:block; margin-top:6px; }

/* --- Input de arquivo estilizado --- */
.file-input {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.file-input input[type="file"] { display: none; }
.file-name { font-size: 14px; color: #555; }
.btn-success { background:#10b981; color:#fff; border:1px solid #0ea371; }
.btn-success:hover { filter: brightness(0.95); }

