/* ─── Reset + base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color: #1f2937;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  min-height: 100vh;
}

:root {
  --honey-500: #f59e0b;
  --honey-600: #d97706;
  --honey-700: #b45309;
  --honey-800: #92400e;
  --bg-card: #ffffff;
  --border: #e5e7eb;
  --text: #1f2937;
  --muted: #6b7280;
  --danger: #dc2626;
  --success: #16a34a;
}

.hidden { display: none !important; }

.full-center {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* ─── Splash ───────────────────────────────────────────────────── */
.splash-card { text-align: center; }
.brand-mark { width: 96px; height: 96px; display: block; margin: 0 auto; }
.brand-mark-login { width: 88px; height: 88px; margin-bottom: 14px; }
.brand-mark-top { width: 28px; height: 28px; vertical-align: middle; }
.splash-title { font-size: 32px; font-weight: 800; color: var(--honey-800); margin: 16px 0 4px; }
.splash-sub { color: var(--muted); }

/* ─── Login ────────────────────────────────────────────────────── */
.login-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.08);
}
.login-card { text-align: center; }
.login-title { font-size: 28px; font-weight: 800; text-align: center; margin: 0 0 4px; color: var(--honey-800); }
.login-sub { text-align: center; color: var(--muted); margin: 0 0 24px; font-size: 14px; }

.login-error {
  background: #fee2e2; color: #991b1b;
  border: 1px solid #fca5a5;
  padding: 10px 12px; border-radius: 8px;
  font-size: 13px; margin-bottom: 16px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; width: 100%; padding: 12px 16px;
  border: none; border-radius: 10px;
  font-size: 15px; font-weight: 600;
  cursor: pointer; transition: opacity 0.15s, transform 0.05s;
}
.btn:hover { opacity: 0.92; }
.btn:active { transform: scale(0.99); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-google { background: #fff; color: #1f2937; border: 1px solid var(--border); }
.btn-primary { background: var(--honey-600); color: #fff; }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }

.login-divider {
  text-align: center; margin: 18px 0;
  position: relative; color: var(--muted); font-size: 12px;
}
.login-divider::before, .login-divider::after {
  content: ''; position: absolute; top: 50%;
  width: 42%; height: 1px; background: var(--border);
}
.login-divider::before { left: 0; }
.login-divider::after { right: 0; }
.login-divider span { background: var(--bg-card); padding: 0 10px; position: relative; z-index: 1; }

.field-label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--muted); margin: 12px 0 6px; text-transform: uppercase; letter-spacing: 0.3px;
}
input[type=email], input[type=password], input[type=text] {
  width: 100%; padding: 11px 14px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 15px; font-family: inherit;
  background: #fafafa;
}
input[type=email]:focus, input[type=password]:focus {
  outline: none; border-color: var(--honey-500); background: #fff;
}

#emailForm .btn-primary { margin-top: 18px; }

.login-foot {
  font-size: 12px; color: var(--muted);
  text-align: center; margin-top: 22px; line-height: 1.5;
}

/* ─── Gate "sem plano" ─────────────────────────────────────────── */
.noplan-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 48px 44px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.08);
  text-align: center;
}
.noplan-emoji { font-size: 64px; margin-bottom: 12px; }
.noplan-title { font-size: 26px; font-weight: 800; color: var(--honey-800); margin: 0 0 8px; }
.noplan-sub { color: var(--text); margin: 0 0 24px; line-height: 1.6; }

.noplan-userbox {
  background: #fef3c7; padding: 12px 16px;
  border-radius: 10px; margin: 0 0 24px;
}
.noplan-userlabel { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.3px; }
.noplan-user { font-size: 14px; font-weight: 600; margin-top: 2px; word-break: break-all; }

.noplan-alert {
  display: flex; align-items: flex-start; gap: 12px;
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 10px;
  padding: 14px 16px;
  text-align: left;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.5;
  color: #78350f;
}
.noplan-alert-icon { font-size: 22px; line-height: 1; flex-shrink: 0; }
.noplan-alert-body strong { color: #92400e; }

.noplan-steps {
  text-align: left;
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 24px;
}
.noplan-steps h3 { margin: 0 0 10px; font-size: 14px; color: var(--honey-800); }
.noplan-steps ol { margin: 0; padding-left: 22px; line-height: 1.8; font-size: 14px; }

.link-btn {
  background: none; border: none; padding: 0;
  color: var(--honey-700); cursor: pointer;
  text-decoration: underline; font-size: inherit; font-family: inherit;
}

/* ─── Dashboard (preview) ──────────────────────────────────────── */
.top-bar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 14px 32px;
  display: flex; justify-content: space-between; align-items: center;
  position: sticky; top: 0; z-index: 10;
}
.brand {
  font-size: 18px; font-weight: 800; color: var(--honey-800);
  display: flex; align-items: center; gap: 10px;
}
.pro-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff; font-size: 10px; font-weight: 800;
  padding: 3px 8px; border-radius: 99px; letter-spacing: 0.5px;
}
.user-area { display: flex; align-items: center; gap: 16px; font-size: 14px; }
.user-area .btn { width: auto; padding: 8px 14px; font-size: 13px; }

.main-content { padding: 32px; max-width: 1200px; margin: 0 auto; }

.welcome-card {
  background: #fff; border-radius: 16px;
  padding: 48px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.05);
}
.welcome-card h1 { margin: 0 0 12px; color: var(--honey-800); font-size: 26px; }
.welcome-card .muted { color: var(--muted); }
.welcome-card .small { font-size: 13px; }
.feat-list {
  list-style: none; padding: 0; margin: 20px 0;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
.feat-list li {
  background: #fef3c7; border-radius: 8px;
  padding: 12px 16px; font-size: 14px;
}

/* ─── Painel Admin ─────────────────────────────────────────────── */
.admin-header-row { display:flex; justify-content:space-between; align-items:center; margin-bottom: 24px; gap: 16px; }
.admin-header-row h1 { margin: 0; font-size: 22px; color: var(--honey-800); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.tab { background: none; border: none; padding: 10px 18px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; font-family: inherit; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--honey-700); border-bottom-color: var(--honey-600); }
.tab-content { display: none; }
.tab-content.active { display: block; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

.panel { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); border: 1px solid var(--border); }
.panel h2 { margin: 0 0 16px; font-size: 16px; color: var(--honey-800); }
.panel .form-row { margin-bottom: 14px; }
.panel label { display: block; font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.3px; }
.panel input[type=text], .panel textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; font-family: inherit; resize: vertical; background: #fafafa; }
.panel input[type=text]:focus, .panel textarea:focus { outline: none; border-color: var(--honey-500); background: #fff; }
.panel textarea { min-height: 90px; }
.panel .hint { font-size: 11px; color: var(--muted); margin-top: 4px; }
.panel button.btn-primary { width: 100%; margin-top: 6px; }
.panel-list { max-height: 480px; overflow-y: auto; }
.checkbox-group { display: flex; flex-wrap: wrap; gap: 10px 16px; padding: 8px 0 2px; }
.checkbox-group label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; text-transform: none; letter-spacing: normal; color: var(--text); cursor: pointer; margin-bottom: 0; }
.checkbox-group input[type=checkbox] { width: 15px; height: 15px; cursor: pointer; accent-color: var(--honey-600); }

.item { padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; background: #fafafa; }
.item .q { font-weight: 600; font-size: 14px; color: var(--text); margin-bottom: 4px; }
.item .a { font-size: 12.5px; color: var(--muted); max-height: 60px; overflow: hidden; line-height: 1.5; }
.item .meta { display: flex; gap: 10px; font-size: 11px; color: var(--muted); margin-top: 6px; align-items: center; }
.item .src-tag { background: #fef3c7; color: var(--honey-800); padding: 1px 7px; border-radius: 99px; font-size: 10px; font-weight: 600; }
.item .del-btn { background: none; border: 1px solid var(--border); border-radius: 6px; width: 26px; height: 26px; cursor: pointer; color: var(--danger); font-size: 12px; padding: 0; }
.item .edit-btn { margin-left: auto; background: none; border: 1px solid var(--border); border-radius: 6px; width: 26px; height: 26px; cursor: pointer; color: var(--honey-700, #b45309); font-size: 12px; padding: 0; }
.empty { text-align: center; padding: 28px; color: var(--muted); font-size: 14px; }

.badge-need { background: #fee2e2; color: #991b1b; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; }
.badge-rag { background: #dbeafe; color: #1e40af; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; }
.badge-faq { background: #dcfce7; color: #166534; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; }
.badge-fallback { background: #fef3c7; color: #92400e; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; }

.toast-area { position: fixed; top: 20px; right: 20px; z-index: 9999; max-width: 360px; }
.toast { background: #1f2937; color: #fff; padding: 12px 16px; border-radius: 8px; margin-bottom: 8px; font-size: 13.5px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); animation: slideIn 0.3s ease; }
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.user-area .btn { white-space: nowrap; }
