:root {
  --ink-900: #141414;
  --ink-800: #1f1f1f;
  --lime: #c2ce30;
  --lime-text: #6e7a16;
  --lime-bg: #f6f8e3;
  --border: #e2e2e2;
  --whatsapp: #25d366;
  --danger: #c0392b;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink-900);
  background: #f7f7f5;
}
a { color: inherit; }
input, select, textarea, button { font-family: inherit; font-size: 0.92rem; }

/* ---- login ---- */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink-900);
  padding: 20px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 8px;
  padding: 36px 32px;
}
.login-logo {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}
.login-logo span { color: var(--lime-text); }
.login-sub { color: #666; font-size: 0.85rem; margin-bottom: 26px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.78rem; font-weight: 600; margin-bottom: 6px; color: #444; }
.field input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: none;
}
.field input:focus { border-color: var(--ink-900); }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 6px;
  border: 1px solid var(--ink-900);
  background: var(--ink-900);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { background: #000; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; color: var(--ink-900); }
.btn-ghost:hover { background: #f0f0f0; }
.btn-danger { border-color: var(--danger); background: #fff; color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.form-error {
  background: #fdecea;
  color: var(--danger);
  border: 1px solid #f5c6c0;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 0.82rem;
  margin-bottom: 16px;
  display: none;
}
.form-error.show { display: block; }

/* ---- dashboard shell ---- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px;
  flex: none;
  background: var(--ink-900);
  color: #fff;
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
}
.sidebar-logo { font-family: var(--mono); font-weight: 700; text-transform: uppercase; padding: 0 10px 22px; font-size: 0.98rem; }
.sidebar-logo span { color: var(--lime); }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 2px;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active { background: var(--lime); color: var(--ink-900); }
.sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.12); }
.sidebar-email { font-size: 0.72rem; color: rgba(255,255,255,0.5); padding: 0 12px 10px; word-break: break-all; }

.main { flex: 1; min-width: 0; padding: 28px 34px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; flex-wrap: wrap; gap: 12px; }
.page-head h1 { font-size: 1.4rem; margin: 0 0 4px; }
.page-head p { margin: 0; color: #666; font-size: 0.88rem; }

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar input[type="search"], .toolbar select {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}
.toolbar input[type="search"] { min-width: 240px; flex: 1; }

.card { background: #fff; border: 1px solid var(--border); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.03em; color: #777; font-weight: 600; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafafa; }
.thumb { width: 40px; height: 40px; border-radius: 4px; object-fit: cover; background: #f0f0f0; display: block; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; }
.badge-ativo { background: var(--lime-bg); color: var(--lime-text); }
.badge-inativo { background: #f0f0f0; color: #888; }
.badge-novo { background: #e8f0fe; color: #1a56db; }
.link-btn { background: none; border: none; color: #1a56db; cursor: pointer; font-size: 0.85rem; font-weight: 600; padding: 0; }
.link-btn:hover { text-decoration: underline; }
.muted { color: #888; }
.pagination { display: flex; justify-content: center; gap: 6px; padding: 16px; }
.pagination button { padding: 6px 12px; border: 1px solid var(--border); border-radius: 6px; background: #fff; cursor: pointer; }
.pagination button.active { background: var(--ink-900); color: #fff; border-color: var(--ink-900); }
.pagination button:disabled { opacity: 0.4; cursor: default; }

/* ---- modal/form ---- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 50;
  display: flex; align-items: flex-start; justify-content: center; padding: 30px 16px; overflow-y: auto;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: #fff; border-radius: 10px; width: 100%; max-width: 640px;
  padding: 26px 28px; margin-bottom: 30px;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-head h2 { font-size: 1.15rem; margin: 0; }
.modal-close { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: #888; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.field-sm label { display: block; font-size: 0.75rem; font-weight: 600; margin-bottom: 5px; color: #444; }
.field-sm input, .field-sm select, .field-sm textarea {
  width: 100%; padding: 9px 10px; border: 1px solid var(--border); border-radius: 6px; outline: none;
}
.field-sm textarea { resize: vertical; min-height: 70px; font-family: var(--sans); }
.field-sm input:focus, .field-sm select:focus, .field-sm textarea:focus { border-color: var(--ink-900); }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.section-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; color: #888; margin: 18px 0 8px; letter-spacing: 0.03em; }
.variant-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: 8px; margin-bottom: 8px; align-items: center; }
.variant-row input { padding: 8px 9px; border: 1px solid var(--border); border-radius: 6px; }
.icon-btn { background: none; border: 1px solid var(--border); border-radius: 6px; width: 32px; height: 32px; cursor: pointer; color: #888; flex: none; }
.icon-btn:hover { color: var(--danger); border-color: var(--danger); }
.img-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.img-grid .img-item { position: relative; width: 68px; height: 68px; }
.img-grid img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.img-grid .img-remove {
  position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--danger); color: #fff; border: 2px solid #fff; font-size: 0.7rem; cursor: pointer; line-height: 1;
}
.upload-btn {
  width: 68px; height: 68px; border: 1.5px dashed var(--border); border-radius: 6px;
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: #999; font-size: 1.3rem;
  background: #fafafa;
}
.upload-btn:hover { border-color: var(--ink-900); color: var(--ink-900); }
.modal-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.toast {
  position: fixed; bottom: 20px; right: 20px; background: var(--ink-900); color: #fff;
  padding: 12px 18px; border-radius: 8px; font-size: 0.85rem; z-index: 100; opacity: 0; transform: translateY(8px);
  transition: 0.2s;
}
.toast.show { opacity: 1; transform: translateY(0); }

.hero-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.hero-card-admin { padding: 18px; }
.hero-card-admin .thumb-wide { width: 100%; height: 130px; object-fit: cover; border-radius: 6px; background: #f0f0f0; margin-bottom: 12px; }

.loading-row td { text-align: center; padding: 30px; color: #999; }
.empty-state { text-align: center; padding: 50px 20px; color: #999; }

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; align-items: center; padding: 12px 16px; overflow-x: auto; }
  .sidebar-logo, .sidebar-foot { display: none; }
  .nav-item { white-space: nowrap; margin-bottom: 0; }
  .main { padding: 18px; }
  .form-grid { grid-template-columns: 1fr; }
}
