/* Little Montessorians — shared app/admin design system */
:root {
  --cream: #faf6f0;
  --linen: #f3ede4;
  --peach: #f0dfd0;
  --terracotta: #c2623d;
  --terracotta-soft: #d4845f;
  --terracotta-ink: #8a472f;
  --sage: #7e9471;
  --sage-soft: #a3b898;
  --sage-ink: #5c6f54;
  --gold: #c49a3c;
  --gold-soft: #d9b96e;
  --gold-ink: #8a6a1f;
  --sky: #7ba7c2;
  --charcoal: #2c2825;
  --ink-soft: #5a514b;
  --warm-gray: #8c8279;
  --border: rgba(44, 40, 37, 0.12);
  --shadow: rgba(73, 52, 31, 0.14);
  --serif: 'Young Serif', Georgia, serif;
  --sans: 'Nunito', 'Avenir Next', 'Segoe UI', sans-serif;
  --r-sm: 0.75rem;
  --r-md: 1.1rem;
  --r-lg: 1.6rem;
  --pill: 999px;
}

* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  background: var(--cream);
  color: var(--charcoal);
  line-height: 1.55;
  font-size: 15px;
}
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: var(--terracotta-ink); }

h1, h2, h3, .serif { font-family: var(--serif); font-weight: 400; line-height: 1.2; }

/* ---------- phone frame (desktop preview of the mobile apps) ---------- */
.phone-stage {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem 1rem;
  background:
    radial-gradient(1100px 500px at 15% 0%, rgba(196, 154, 60, 0.10), transparent 60%),
    radial-gradient(900px 600px at 90% 100%, rgba(126, 148, 113, 0.13), transparent 60%),
    var(--linen);
}
.phone {
  width: 393px; height: 824px; max-height: calc(100vh - 3rem);
  background: var(--cream);
  border-radius: 54px;
  border: 10px solid #221e1b;
  box-shadow: 0 36px 80px -24px rgba(44, 40, 37, 0.5), 0 0 0 2px rgba(255,255,255,0.35) inset;
  overflow: hidden;
  position: relative;
  display: flex; flex-direction: column;
}
.phone::before { /* notch */
  content: ''; position: absolute; top: 9px; left: 50%; transform: translateX(-50%);
  width: 118px; height: 30px; background: #221e1b; border-radius: 18px; z-index: 60;
}
.stage-label {
  position: fixed; top: 1.1rem; left: 1.4rem; z-index: 5;
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--warm-gray); display: flex; gap: 0.6rem; align-items: center;
}
.stage-label img { width: 26px; height: 26px; }
@media (max-width: 460px) {
  .phone-stage { padding: 0; }
  .phone { width: 100%; height: 100vh; max-height: none; border-radius: 0; border: 0; }
  .stage-label { display: none; }
}

/* ---------- app chrome ---------- */
.app-status {
  height: 50px; flex: none;
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 0 26px 4px;
  font-size: 13px; font-weight: 700; color: var(--charcoal);
}
.app-header {
  flex: none;
  padding: 8px 20px 12px;
  display: flex; align-items: center; gap: 12px;
}
.app-header h1 { font-size: 1.45rem; }
.app-header .sub { font-size: 12.5px; color: var(--warm-gray); }
.app-header .spacer { flex: 1; }
.app-body { flex: 1; overflow-y: auto; padding: 4px 16px 110px; scrollbar-width: none; }
.app-body::-webkit-scrollbar { display: none; }

.tabbar {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 50;
  display: flex; justify-content: space-around; align-items: stretch;
  padding: 10px 8px calc(16px + env(safe-area-inset-bottom, 8px));
  background: linear-gradient(to top, var(--cream) 70%, rgba(250,246,240,0));
}
.tabbar a {
  flex: 1; text-align: center; text-decoration: none;
  color: var(--warm-gray); font-size: 10.5px; font-weight: 700; letter-spacing: 0.02em;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 0; border-radius: var(--r-md);
  transition: color 160ms ease;
}
.tabbar a .ticon { font-size: 21px; line-height: 1; filter: grayscale(1) opacity(0.55); transition: filter 160ms ease, transform 160ms ease; }
.tabbar a.active { color: var(--terracotta-ink); }
.tabbar a.active .ticon { filter: none; transform: translateY(-1px); }
.tabbar .fab {
  flex: none; width: 58px; height: 58px; margin: -14px 6px 0;
  border-radius: 50%; border: 0; background: var(--terracotta); color: #fff;
  font-size: 30px; line-height: 1; font-weight: 700; align-self: flex-start;
  box-shadow: 0 12px 26px -8px rgba(194, 98, 61, 0.65), 0 0 0 5px var(--cream);
  transition: transform 150ms ease, background 150ms ease;
}
.tabbar .fab:hover { transform: translateY(-3px) rotate(90deg); background: var(--terracotta-soft); }
.tabbar .fab:active { transform: translateY(-1px); }

/* ---------- shared components ---------- */
.avatar { border-radius: 50%; object-fit: cover; flex: none; }
.avatar-text {
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; letter-spacing: 0.02em;
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: 0 10px 26px -18px var(--shadow);
  margin-bottom: 14px;
}
.card.tight { padding: 12px 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--terracotta); color: #fff; border: 0;
  border-radius: var(--pill); padding: 11px 22px;
  font-weight: 800; font-size: 14.5px; letter-spacing: 0.01em;
  box-shadow: 0 10px 20px -10px rgba(194, 98, 61, 0.55);
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); background: var(--terracotta-soft); }
.btn:active { transform: translateY(0); }
.btn.sage { background: var(--sage); box-shadow: 0 10px 20px -10px rgba(126, 148, 113, 0.55); }
.btn.sage:hover { background: var(--sage-soft); }
.btn.ghost { background: transparent; color: var(--terracotta-ink); box-shadow: none; border: 1.5px solid var(--terracotta-soft); }
.btn.small { padding: 7px 14px; font-size: 13px; }
.btn.tiny { padding: 4px 11px; font-size: 12px; box-shadow: none; }
.btn.ghost.sage { color: var(--sage-ink); border-color: var(--sage-soft); background: transparent; }
.btn.ghost.sage:hover { background: rgba(126, 148, 113, 0.1); }
.btn:disabled { opacity: 0.5; pointer-events: none; }
.btn.block { width: 100%; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: var(--pill); padding: 3px 11px;
  font-size: 11.5px; font-weight: 800; letter-spacing: 0.03em;
  background: var(--linen); color: var(--ink-soft); border: 1px solid var(--border);
  white-space: nowrap;
}
.chip.presented { background: #f5e9d6; color: var(--gold-ink); border-color: rgba(196,154,60,0.35); }
.chip.practicing { background: #f4e0d3; color: var(--terracotta-ink); border-color: rgba(194,98,61,0.3); }
.chip.mastered { background: #e4eadf; color: var(--sage-ink); border-color: rgba(126,148,113,0.4); }
.chip.new { background: #e8f0f5; color: #3f6b87; }
.chip.contacted { background: #f5e9d6; color: var(--gold-ink); }
.chip.toured { background: #f4e0d3; color: var(--terracotta-ink); }
.chip.offered { background: #ece4f1; color: #6b4f86; }
.chip.enrolled, .chip.confirmed, .chip.present, .chip.completed { background: #e4eadf; color: var(--sage-ink); }
.chip.declined, .chip.cancelled, .chip.absent { background: #efe9e4; color: var(--warm-gray); }
.chip.requested, .chip.scheduled { background: #e8f0f5; color: #3f6b87; }
.chip.tour { background: #fff; color: var(--terracotta-ink); border-color: rgba(194,98,61,0.35); }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--warm-gray); margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1.5px solid var(--border); border-radius: var(--r-md);
  background: #fff; padding: 11px 14px; font-size: 15px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.field textarea { min-height: 88px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--terracotta-soft);
  box-shadow: 0 0 0 3px rgba(194, 98, 61, 0.15);
}

.seg {
  display: flex; background: var(--linen); border-radius: var(--pill);
  padding: 4px; gap: 4px; margin: 6px 0 14px;
  border: 1px solid var(--border);
}
.seg button {
  flex: 1; border: 0; background: transparent; border-radius: var(--pill);
  padding: 8px 4px; font-size: 12.5px; font-weight: 800; color: var(--warm-gray);
  transition: all 160ms ease; white-space: nowrap;
}
.seg button.active { background: #fff; color: var(--charcoal); box-shadow: 0 4px 10px -4px var(--shadow); }

.list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 4px; border-bottom: 1px solid var(--border);
}
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .name { font-weight: 800; font-size: 14.5px; }
.list-row .meta { font-size: 12.5px; color: var(--warm-gray); }

.empty {
  text-align: center; color: var(--warm-gray); padding: 38px 20px; font-size: 14px;
}
.empty .big { font-size: 34px; margin-bottom: 8px; }

.section-title {
  font-size: 12px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--warm-gray); margin: 20px 4px 10px;
  display: flex; align-items: center; gap: 8px;
}
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* feed */
.post { padding: 0; overflow: hidden; }
.post .post-head { display: flex; align-items: center; gap: 10px; padding: 13px 15px 10px; }
.post .post-head .who { flex: 1; }
.post .post-head .who b { font-size: 14px; display: block; }
.post .post-head .who span { font-size: 12px; color: var(--warm-gray); }
.post .post-photo { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.post .post-body { padding: 12px 15px 14px; font-size: 14.5px; }
.post .post-actions { display: flex; gap: 14px; padding: 0 15px 13px; align-items: center; }
.post .like-btn { background: none; border: 0; font-size: 13.5px; font-weight: 800; color: var(--warm-gray); display: flex; gap: 6px; align-items: center; padding: 0; }
.post .like-btn.liked { color: var(--terracotta); }

/* chat */
.bubble-row { display: flex; margin-bottom: 10px; }
.bubble-row.mine { justify-content: flex-end; }
.bubble {
  max-width: 78%; padding: 10px 14px; border-radius: 20px;
  font-size: 14.5px; background: #fff; border: 1px solid var(--border);
  border-bottom-left-radius: 6px;
}
.bubble-row.mine .bubble {
  background: var(--terracotta); color: #fff; border: 0;
  border-bottom-left-radius: 20px; border-bottom-right-radius: 6px;
}
.bubble .at { display: block; font-size: 10.5px; opacity: 0.65; margin-top: 3px; }
.chat-compose {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 50;
  display: flex; gap: 8px; padding: 12px 14px calc(18px + env(safe-area-inset-bottom, 6px));
  background: linear-gradient(to top, var(--cream) 75%, rgba(250,246,240,0));
}
.chat-compose input {
  flex: 1; border: 1.5px solid var(--border); border-radius: var(--pill);
  padding: 11px 18px; background: #fff;
}
.chat-compose input:focus { outline: none; border-color: var(--terracotta-soft); }
.chat-compose button {
  width: 46px; height: 46px; flex: none; border-radius: 50%;
  background: var(--terracotta); color: #fff; border: 0; font-size: 19px;
}

/* toast + modal */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translate(-50%, 24px);
  background: var(--charcoal); color: var(--cream);
  border-radius: var(--pill); padding: 11px 22px; font-size: 14px; font-weight: 700;
  opacity: 0; pointer-events: none; transition: all 240ms ease; z-index: 200;
  max-width: 86vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.toast-err { background: var(--terracotta-ink); }
.phone .toast { position: absolute; }

.modal-back {
  position: fixed; inset: 0; background: rgba(44, 40, 37, 0.45);
  display: none; align-items: flex-end; justify-content: center; z-index: 150;
  backdrop-filter: blur(2px);
}
.phone .modal-back { position: absolute; }
.modal-back.open { display: flex; }
.modal {
  background: var(--cream); width: 100%; max-width: 560px;
  border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 20px 20px 30px;
  max-height: 86%; overflow-y: auto;
  animation: sheet-up 260ms cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal h2 { font-size: 1.25rem; margin-bottom: 14px; }
.modal .modal-close { float: right; background: var(--linen); border: 0; border-radius: 50%; width: 32px; height: 32px; font-size: 15px; }

/* login screens */
.login-wrap {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  padding: 34px 30px 60px;
}
.login-wrap .logo { width: 84px; margin: 0 auto 18px; }
.login-wrap h1 { text-align: center; font-size: 1.6rem; margin-bottom: 4px; }
.login-wrap .sub { text-align: center; color: var(--warm-gray); font-size: 13.5px; margin-bottom: 28px; }
.demo-hint {
  margin-top: 22px; background: var(--linen); border: 1px dashed var(--border);
  border-radius: var(--r-md); padding: 12px 14px; font-size: 12.5px; color: var(--ink-soft);
}
.demo-hint b { display: block; margin-bottom: 4px; }
.demo-hint code { background: #fff; padding: 1px 6px; border-radius: 6px; font-size: 11.5px; }

/* stat tiles */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 6px; }
.tile {
  background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 14px 16px; box-shadow: 0 10px 26px -18px var(--shadow);
}
.tile .num { font-family: var(--serif); font-size: 1.9rem; line-height: 1.1; }
.tile .lbl { font-size: 11.5px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--warm-gray); margin-top: 2px; }
.tile.terra .num { color: var(--terracotta-ink); }
.tile.sage .num { color: var(--sage-ink); }
.tile.gold .num { color: var(--gold-ink); }
.tile.sky .num { color: #3f6b87; }

/* account menu overlay (shared, self-contained) */
.lm-account-back { position: fixed; inset: 0; background: rgba(44, 40, 37, 0.5); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; z-index: 400; }
.lm-account-card { background: var(--cream); border-radius: var(--r-lg); padding: 22px; width: 340px; max-width: 90vw;
  position: relative; box-shadow: 0 30px 60px -20px rgba(44, 40, 37, 0.5); animation: sheet-up 220ms ease; }
.lm-account-card .lm-x { position: absolute; top: 12px; right: 12px; background: var(--linen); border: 0; border-radius: 50%; width: 30px; height: 30px; font-size: 14px; }
