/* Sacred Roots Admin – Dashboard */

:root {
  --green:   #5E6D55;
  --green-d: #3F4939;
  --purple:  #393744;
  --beige:   #F7F1E9;
  --gray:    #767574;
  --border:  #e2e2e2;
  --radius:  10px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Poppins', sans-serif;
  font-size: .875rem;
  color: #111;
  background: #f4f4f2;
  -webkit-font-smoothing: antialiased;
}

/* ── Login ──────────────────────────────────────────────── */

.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--purple);
  padding: 20px;
}

.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px 28px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

.login-header { text-align: center; margin-bottom: 28px; }

.login-logo {
  width: 52px; height: 52px;
  background: var(--green);
  color: #fff;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Caudex', serif;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.login-header h1 { font-family: 'Caudex', serif; font-size: 1.4rem; color: var(--purple); }
.login-header span { font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; color: var(--gray); }

.login-form .field { margin-bottom: 18px; }

.login-form label {
  display: block;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #333;
  margin-bottom: 7px;
}

.login-form input {
  width: 100%;
  padding: 13px 14px;
  border: 2px solid #ccc;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1.1rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.login-form input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(94,109,85,.15); }

.btn-login {
  width: 100%;
  padding: 15px;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  box-shadow: 0 4px 14px rgba(94,109,85,.35);
  transition: background .2s, box-shadow .2s;
}
.btn-login:hover { background: var(--green-d); box-shadow: 0 4px 16px rgba(94,109,85,.45); }

#pw-login {
  border: 2px solid var(--green);
  border-radius: var(--radius);
  padding: 20px 18px 16px;
  background: #fbfbf9;
}

.login-error { color: #c0392b; font-size: .82rem; text-align: center; margin-top: 12px; }

/* ── Top bar ────────────────────────────────────────────── */

.topbar {
  height: 52px;
  background: var(--purple);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Caudex', serif;
  font-size: .95rem;
}

.topbar-logo {
  width: 30px; height: 30px;
  background: var(--green);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .68rem;
  font-weight: 700;
  flex-shrink: 0;
}

.topbar-right { display: flex; align-items: center; gap: 10px; }

.topbar-link { color: rgba(255,255,255,.6); text-decoration: none; font-size: .78rem; }
.topbar-link:hover { color: #fff; }

.topbar-logout {
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.8);
  border: none;
  border-radius: 6px;
  padding: 7px 14px;
  font-family: inherit;
  font-size: .78rem;
  cursor: pointer;
}

/* ── Dashboard ──────────────────────────────────────────── */

.dashboard-body { background: #f4f4f2; min-height: 100vh; }

.dashboard {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.dashboard-header {
  margin-bottom: 20px;
}

.dashboard-header h1 {
  font-family: 'Caudex', serif;
  font-size: 1.4rem;
  color: var(--purple);
  margin-bottom: 4px;
}

.dashboard-header p {
  font-size: .8rem;
  color: var(--gray);
}

.loading { color: var(--gray); font-size: .85rem; padding: 16px 0; }
.load-error { color: #c0392b; font-size: .85rem; }

/* ── Page grid ──────────────────────────────────────────── */

.page-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.page-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: box-shadow .15s;
}
.page-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,.07); }

.page-card-info { flex: 1; min-width: 0; }

.page-card-label {
  font-weight: 600;
  font-size: .88rem;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-card-slug {
  font-size: .75rem;
  color: var(--gray);
  margin-top: 2px;
}

.page-card-modified {
  font-size: .72rem;
  color: #aaa;
  margin-top: 3px;
}

.page-card-btn {
  padding: 8px 16px;
  background: none;
  border: 1.5px solid var(--green);
  border-radius: var(--radius);
  color: var(--green);
  font-family: inherit;
  font-size: .78rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .15s, color .15s;
}
.page-card-btn:hover { background: var(--green); color: #fff; }

@media (min-width: 600px) {
  .dashboard { padding: 32px 24px 64px; }
  .page-grid { display: grid; grid-template-columns: 1fr 1fr; }
}

@media (min-width: 900px) {
  .page-grid { grid-template-columns: 1fr 1fr 1fr; }
}

/* ── Mobile ─────────────────────────────────────────────── */

@media (max-width: 640px) {
  /* Stack the top bar: brand on its own row, links in a scrollable strip below */
  .topbar {
    height: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 14px;
  }
  .topbar-brand { font-size: .92rem; }
  .topbar-brand span { white-space: nowrap; }
  .topbar-right {
    gap: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }
  .topbar-right::-webkit-scrollbar { display: none; }
  .topbar-link, .topbar-logout { white-space: nowrap; flex-shrink: 0; }
}
