body.admin-body { background: var(--cream-dark); }

.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 240px; flex: none; background: var(--navy-dark); color: rgba(255,255,255,0.85);
  padding: 1.6rem 1.2rem; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.admin-sidebar .brand-text strong { color: #fff; }
.admin-sidebar .brand-text small { color: rgba(255,255,255,0.55); }
.admin-sidebar a.back-link { display: inline-block; margin: 1.4rem 0 1.6rem; font-size: 0.85rem; color: var(--gold-light); }
.admin-nav { display: flex; flex-direction: column; gap: 0.2rem; }
.admin-nav a {
  color: rgba(255,255,255,0.78); padding: 0.65em 0.8em; border-radius: 8px; font-size: 0.92rem; font-weight: 500;
  display: flex; align-items: center; justify-content: space-between;
}
.admin-nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.admin-nav a.active { background: var(--gold); color: var(--navy-dark); }
.admin-nav .count { background: rgba(255,255,255,0.15); border-radius: 999px; padding: 0.05em 0.55em; font-size: 0.75rem; }
.admin-nav a.active .count { background: rgba(0,0,0,0.15); }

.admin-main { flex: 1; padding: 2.2rem 2.6rem 4rem; max-width: 980px; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.8rem; }
.admin-topbar h1 { margin: 0; }
.logout-form button {
  background: none; border: 1px solid var(--line); border-radius: 999px; padding: 0.5em 1.1em;
  font-weight: 600; color: var(--navy); cursor: pointer; font-size: 0.85rem;
}
.logout-form button:hover { background: #fff; }

.admin-card { background: #fff; border-radius: var(--radius); padding: 1.8rem; box-shadow: var(--shadow); margin-bottom: 1.6rem; }
.admin-card h2 { font-size: 1.15rem; margin-bottom: 1.2rem; }
.field-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem 1.4rem; }
.field { display: flex; flex-direction: column; gap: 0.35em; margin-bottom: 1rem; }
.field.full { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: 0.85rem; color: var(--navy); }
.field .hint { font-weight: 400; color: var(--muted); font-size: 0.78rem; }
.field input, .field textarea, .field select {
  font-family: var(--font-body); font-size: 0.95rem; padding: 0.65em 0.8em;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--cream);
  width: 100%;
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--gold); border-color: var(--gold); }

.repeater-item { border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 1rem 1.2rem; margin-bottom: 1rem; position: relative; background: var(--cream); }
.repeater-item .remove-btn {
  position: absolute; top: 0.6rem; right: 0.6rem; background: #fff; border: 1px solid var(--line);
  color: #b3413e; border-radius: 999px; width: 26px; height: 26px; cursor: pointer; font-size: 0.9rem; line-height: 1;
}
.repeater-item .remove-btn:hover { background: #fdeceb; }
.add-btn {
  background: transparent; border: 1.5px dashed var(--navy); color: var(--navy); border-radius: var(--radius-sm);
  padding: 0.6em 1.1em; font-weight: 600; cursor: pointer; font-size: 0.88rem; margin-top: 0.3rem;
}
.add-btn:hover { background: rgba(27,42,74,0.06); }

.save-row { display: flex; justify-content: flex-end; margin-top: 1.5rem; }
.flash-msg {
  background: #e4f3ea; color: var(--green); border: 1px solid #bfe3cd; padding: 0.9em 1.2em;
  border-radius: var(--radius-sm); margin-bottom: 1.4rem; font-weight: 500;
}
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.2rem; }
.dash-tile {
  background: #fff; border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 0.4rem;
}
.dash-tile strong { font-family: var(--font-head); font-size: 1.15rem; color: var(--navy); }
.dash-tile span { color: var(--muted); font-size: 0.88rem; }

.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--navy-dark); }
.login-card { background: #fff; border-radius: var(--radius); padding: 2.5rem; width: 100%; max-width: 380px; box-shadow: var(--shadow-lg); }
.login-card h1 { font-size: 1.4rem; }
.login-error { background: #fdeceb; color: #b3413e; padding: 0.8em 1em; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: 0.9rem; }

.messages-list { display: flex; flex-direction: column; gap: 1rem; }
.message-item { background: #fff; border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); }
.message-item.unread { border-left: 4px solid var(--gold); }
.message-meta { display: flex; justify-content: space-between; font-size: 0.82rem; color: var(--muted); margin-bottom: 0.6rem; }
.message-actions { display: flex; gap: 0.6rem; margin-top: 0.9rem; }
.message-actions button {
  border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 0.4em 1em;
  font-size: 0.8rem; font-weight: 600; cursor: pointer; color: var(--navy);
}
.message-actions button:hover { background: var(--cream-dark); }

@media (max-width: 860px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; height: auto; position: relative; }
  .admin-main { padding: 1.6rem 1.2rem 3rem; }
  .field-grid { grid-template-columns: 1fr; }
}

/* Room-grid editor */
.admin-grid { width: 100%; min-width: 720px; border-collapse: collapse; margin-bottom: 1.25rem; }
.admin-grid th {
  text-align: left; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 0.4rem 0.5rem; color: #1B2A4A;
}
.admin-grid td { padding: 0.25rem; vertical-align: top; }
.admin-grid td textarea { width: 100%; min-width: 7rem; font-size: 0.85rem; }
.grid-scroll { overflow-x: auto; }
