/* ────────────────────────────────────────────────────────────────────
   BioChemicalls Admin — paleta (alinhada ao site cliente)
   ──────────────────────────────────────────────────────────────────── */
:root {
  --primary:        #1a3a5c;
  --primary-dark:   #0f2540;
  --primary-light:  #2e6db4;
  --accent:         #e8590c;
  --accent-hover:   #d14e0a;
  --bg:             #f5f7fa;
  --surface:        #ffffff;
  --border:         #e5e9f0;
  --text:           #1f2937;
  --text-muted:     #64748b;
  --success:        #16a34a;
  --warning:        #d97706;
  --danger:         #dc2626;
  --radius:         8px;
  --shadow-sm:      0 1px 2px rgba(15, 37, 64, 0.05);
  --shadow:         0 4px 12px rgba(15, 37, 64, 0.08);
  --shadow-lg:      0 12px 32px rgba(15, 37, 64, 0.15);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}
a { color: var(--primary-light); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Layout shell ──────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--primary-dark);
  color: #fff;
  padding: 20px 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar__brand {
  display: flex; align-items: center; gap: 10px;
  padding: 0 20px 20px; border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar__brand img { width: 36px; height: 36px; object-fit: contain; background: #fff; border-radius: 6px; padding: 4px; }
.sidebar__brand span { font-weight: 700; font-size: 15px; line-height: 1.2; }
.sidebar nav { padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a {
  color: rgba(255,255,255,.75);
  padding: 10px 14px;
  border-radius: 6px;
  display: flex; align-items: center; gap: 10px;
  font-weight: 500;
  transition: all .15s;
  text-decoration: none;
}
.sidebar nav a svg { width: 18px; height: 18px; flex-shrink: 0; stroke-width: 2; }
.btn svg { width: 16px; height: 16px; }
.sidebar nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar nav a.is-active { background: var(--accent); color: #fff; }
.sidebar nav .group-title { padding: 16px 14px 6px; color: rgba(255,255,255,.4); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px; background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 5;
}
.topbar__title { font-size: 18px; font-weight: 700; color: var(--primary-dark); }
.topbar__user { display: flex; align-items: center; gap: 12px; }
.topbar__user .name { font-weight: 600; }
.topbar__user .role { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--primary-light); color: #fff; text-transform: uppercase; letter-spacing: .04em; }

.content { padding: 28px; flex: 1; max-width: 100%; }

/* ─── Cards ─────────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card__header { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card__title { font-size: 16px; font-weight: 700; margin: 0; color: var(--primary-dark); }
.card__body { padding: 22px; }

/* ─── Buttons ───────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: var(--radius); font-weight: 600; font-size: 14px; cursor: pointer; border: 1px solid transparent; transition: all .15s; text-decoration: none; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); text-decoration: none; }
.btn-secondary { background: var(--primary); color: #fff; }
.btn-secondary:hover:not(:disabled) { background: var(--primary-dark); text-decoration: none; }
.btn-outline { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-outline:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { filter: brightness(.92); text-decoration: none; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ─── Forms ─────────────────────────────────────────────────────── */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--text); }
.field .hint { display: block; font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.input, .select, .textarea {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 14px; font-family: inherit; background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(46,109,180,.12);
}
.textarea { resize: vertical; min-height: 96px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 768px) { .row { grid-template-columns: 1fr; } }

/* ─── Tables ────────────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); padding: 10px 14px; border-bottom: 1px solid var(--border); }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(46,109,180,.03); }

/* ─── Badges ────────────────────────────────────────────────────── */
.badge { display: inline-flex; padding: 3px 10px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; border-radius: 999px; }
.badge-published { background: #dcfce7; color: #166534; }
.badge-draft     { background: #f1f5f9; color: #475569; }
.badge-scheduled { background: #fef3c7; color: #92400e; }
.badge-admin     { background: #fee2e2; color: #991b1b; }
.badge-editor    { background: #e0e7ff; color: #3730a3; }

/* ─── Flash ─────────────────────────────────────────────────────── */
.flash { padding: 12px 18px; border-radius: var(--radius); margin-bottom: 18px; font-weight: 500; }
.flash-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.flash-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.flash-info    { background: #e0f2fe; color: #075985; border: 1px solid #bae6fd; }

/* ─── Login ─────────────────────────────────────────────────────── */
.login-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-light) 100%);
  padding: 24px;
}
.login-card {
  background: var(--surface); padding: 40px; border-radius: 14px;
  box-shadow: var(--shadow-lg); width: 100%; max-width: 400px;
}
.login-card .brand { text-align: center; margin-bottom: 28px; }
.login-card .brand img { width: 64px; height: 64px; border-radius: 12px; padding: 6px; background: var(--primary); object-fit: contain; }
.login-card .brand h1 { font-size: 20px; margin: 14px 0 4px; color: var(--primary-dark); }
.login-card .brand p { margin: 0; color: var(--text-muted); font-size: 13px; }

/* ─── Stats grid ────────────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { background: var(--surface); padding: 18px; border-radius: var(--radius); border: 1px solid var(--border); }
.stat__label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.stat__value { font-size: 28px; font-weight: 800; color: var(--primary-dark); }

/* ─── SEO Assistant ─────────────────────────────────────────────── */
.seo-card { padding: 18px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); }
.seo-snippet { background: #fff; padding: 14px; border-radius: 6px; border: 1px solid var(--border); margin: 12px 0; }
.seo-snippet .url { color: #006621; font-size: 13px; }
.seo-snippet .title { color: #1a0dab; font-size: 18px; font-weight: 400; margin: 4px 0; line-height: 1.3; }
.seo-snippet .desc { color: #545454; font-size: 13px; line-height: 1.45; }
.seo-check { display: flex; align-items: flex-start; gap: 8px; padding: 6px 0; font-size: 13px; }
.seo-check .dot { flex-shrink: 0; width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; }
.seo-check.ok .dot       { background: var(--success); }
.seo-check.warning .dot  { background: var(--warning); }
.seo-check.error .dot    { background: var(--danger); }
