/* Os Traquinas — admin (gestão) styles. Playful brand, calm and clear. */
:root {
  --coral: #ff6f61;
  --yellow: #ffc94d;
  --teal: #2bb8a3;
  --green: #6fbf5b;
  --ink: #2d2a3a;
  --muted: #6b6780;
  --bg: #fbf7f0;
  --card: #ffffff;
  --line: #ece6dc;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(45, 42, 58, 0.08);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

a { color: var(--teal); }

/* ---------- layout ---------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  background: var(--ink);
  color: #fff;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar__brand {
  font-weight: 800;
  font-size: 1.15rem;
  margin: 4px 8px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar__brand span { color: var(--yellow); }
.sidebar a.navlink {
  color: #d9d6e6;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 600;
  display: flex;
  gap: 10px;
  align-items: center;
}
.sidebar a.navlink:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.sidebar a.navlink.is-active { background: var(--coral); color: #fff; }
.sidebar__spacer { flex: 1; }
.sidebar__foot { font-size: 0.8rem; color: #9c98ad; padding: 0 8px; }
.sidebar form { margin: 0; }
.sidebar .logout {
  width: 100%;
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}
.sidebar .logout:hover { background: rgba(255,255,255,0.2); }

.content { flex: 1; padding: 32px 40px; max-width: 1000px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; gap: 16px; }
.page-head h1 { margin: 0; font-size: 1.6rem; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

/* ---------- cards / grid ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.stat strong { font-size: 2rem; display: block; }
.stat span { color: var(--muted); font-weight: 600; font-size: 0.9rem; }
.stat--coral { border-top: 4px solid var(--coral); }
.stat--teal { border-top: 4px solid var(--teal); }
.stat--green { border-top: 4px solid var(--green); }
.stat--yellow { border-top: 4px solid var(--yellow); }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 22px;
}
.panel h2 { margin-top: 0; font-size: 1.15rem; }

/* ---------- table ---------- */
table.list { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table.list th, table.list td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); }
table.list th { background: #f3eee5; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
table.list tr:last-child td { border-bottom: 0; }
table.list td.actions { text-align: right; white-space: nowrap; }

/* ---------- badges ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; }
.badge--green { background: #e3f3dd; color: #3d7a2c; }
.badge--grey { background: #ece9e2; color: #6b6780; }
.badge--coral { background: #ffe2de; color: #c64536; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 0; cursor: pointer; font-weight: 700; font-size: 0.92rem;
  padding: 10px 16px; border-radius: 12px; text-decoration: none;
  background: #efeae1; color: var(--ink);
}
.btn:hover { filter: brightness(0.97); }
.btn--primary { background: var(--coral); color: #fff; }
.btn--teal { background: var(--teal); color: #fff; }
.btn--ghost { background: transparent; border: 1px solid var(--line); }
.btn--danger { background: #ffe2de; color: #c64536; }
.btn--sm { padding: 6px 12px; font-size: 0.84rem; border-radius: 9px; }
.inline-form { display: inline; margin: 0; }

/* ---------- forms ---------- */
form.stack { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 700; font-size: 0.9rem; }
.field input[type="text"],
.field input[type="email"],
.field input[type="url"],
.field input[type="number"],
.field input[type="password"],
.field input[type="date"],
.field input[type="file"],
.field textarea,
.field select,
.stack input, .stack textarea, .stack select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  background: #fff;
}
.field .help { color: var(--muted); font-size: 0.82rem; }
.field .errors { color: #c64536; font-size: 0.85rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 12px; margin-top: 8px; }

/* gallery formset rows */
.gallery-rows { display: flex; flex-direction: column; gap: 12px; }
.gallery-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 80px auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: #fdfbf7;
}
.gallery-row img.thumb { max-height: 48px; border-radius: 6px; }

/* ---------- messages ---------- */
.messages { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-direction: column; gap: 8px; }
.messages li { padding: 12px 16px; border-radius: 12px; font-weight: 600; }
.messages li.success { background: #e3f3dd; color: #3d7a2c; }
.messages li.error { background: #ffe2de; color: #c64536; }
.messages li.info { background: #fff3d6; color: #8a6b1f; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { background: var(--card); border-radius: 20px; box-shadow: var(--shadow); padding: 34px; width: 100%; max-width: 380px; }
.login-card h1 { margin: 0 0 4px; font-size: 1.4rem; }
.login-card p.sub { margin: 0 0 20px; color: var(--muted); }
.login-card .brand-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 4px; }

@media (max-width: 720px) {
  .layout { flex-direction: column; }
  .sidebar { width: auto; height: auto; position: static; flex-direction: row; flex-wrap: wrap; }
  .sidebar__spacer { display: none; }
  .content { padding: 22px 18px; }
  .form-grid, .gallery-row { grid-template-columns: 1fr; }
}
