/* Annabel's Grades PWA — "Logo Pastel" on clean white (same design family as the SeroTone app).
   Soft rounded cards, pale yellow/blush accents, charcoal text, green highlights. */
:root {
  --page: #ffffff;
  --page-soft: #fafafa;
  --ink: #2f2f33;
  --ink-dim: #6f6f76;
  --ink-faint: #9a9aa1;
  --highlight: #fbeec0;        /* soft yellow highlighter band */
  --yellow-soft: #fef3c7;     /* pale yellow accent */
  --heading-ink: #75590c;     /* deep gold */
  --green: #158052;
  --green-bright: #22b573;
  --green-soft: #e2f4e9;
  --red-soft: #fce9eb;
  --red-ink: #a33b47;
  --pink: #fff0f3;            /* blush surface */
  --hairline: #ececf0;
  --card: #ffffff;
  --track: #f1f0ea;
  --radius: 20px;
  --shadow: 0 1px 3px rgba(47, 47, 51, 0.06), 0 10px 28px rgba(47, 47, 51, 0.05);
  --ease: cubic-bezier(0.22, 0.9, 0.28, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Montserrat', -apple-system, 'Segoe UI', sans-serif;
  background: var(--page-soft);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  padding-bottom: calc(88px + env(safe-area-inset-bottom));
}
button { touch-action: manipulation; font: inherit; }
:focus { outline: none; }
:focus-visible { outline: 3px solid rgba(34, 181, 115, 0.55); outline-offset: 2px; border-radius: 10px; }

/* ---------- header ---------- */
.app-header {
  display: flex; align-items: center; gap: 12px;
  padding: calc(14px + env(safe-area-inset-top)) 20px 12px;
  background: var(--page);
  border-bottom: 1px solid var(--hairline);
}
.app-logo { width: 46px; height: 46px; border-radius: 13px; }
.app-title h1 { margin: 0; font-size: 21px; font-weight: 800; letter-spacing: 0.2px; }
.app-title p { margin: 0; font-size: 12.5px; color: var(--ink-dim); font-weight: 600; }

/* ---------- layout ---------- */
.view { max-width: 560px; margin: 0 auto; padding: 12px 16px 28px; }
.view-enter { animation: viewIn 0.28s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.loading, .empty { text-align: center; color: var(--ink-dim); padding: 40px 16px; }

/* ---------- section headings: letterspaced small caps, deep gold on yellow band ---------- */
.band {
  display: block; text-align: center;
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--heading-ink);
  background: var(--highlight);
  border-radius: 999px;
  padding: 8px 16px;
  margin: 26px auto 14px;
  width: fit-content; max-width: 100%;
  box-shadow: inset 0 0 0 1px rgba(117, 89, 12, 0.08), 0 3px 10px rgba(251, 238, 192, 0.55);
}
.band:first-child { margin-top: 6px; }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 8px 4px 2px; }
.greeting { margin: 0; font-size: 27px; font-weight: 800; letter-spacing: -0.01em; }
.hero-sub { margin: 4px 0 0; color: var(--ink-dim); font-size: 14.5px; font-weight: 500; }

.stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.stat-card {
  background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 12px; text-align: center;
}
.stat-card .stat-num { display: block; font-size: 34px; font-weight: 800; line-height: 1.1; }
.stat-card .stat-label { display: block; margin-top: 2px; font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-dim); }
.stat-card.good .stat-num { color: var(--green); }

/* missing-work banner: green when clear, blush red when something is missing */
.missing-banner {
  display: flex; align-items: center; gap: 12px;
  border-radius: var(--radius); padding: 16px 18px; margin-top: 14px;
  font-weight: 700; font-size: 16px; text-align: left;
  border: 1px solid var(--hairline); box-shadow: var(--shadow);
}
.missing-banner.clear { background: var(--green-soft); color: var(--green); }
.missing-banner.alert { background: var(--red-soft); color: var(--red-ink); }
.missing-banner .mb-icon { font-size: 24px; line-height: 1; flex: none; }
.missing-banner small { display: block; font-weight: 600; font-size: 13px; opacity: 0.85; }

/* ---------- class grade rows: one pastel bar per class, big number at the right ---------- */
.class-card {
  background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 12px;
  width: 100%; text-align: left; color: inherit; cursor: pointer; display: block;
}
.class-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.class-name { font-size: 18px; font-weight: 800; }
.class-grade { font-size: 30px; font-weight: 800; line-height: 1; }
.class-grade.pass { color: var(--green); font-size: 26px; }
.bar {
  height: 16px; border-radius: 999px; background: var(--track);
  margin-top: 10px; overflow: hidden;
}
.bar-fill { height: 100%; border-radius: 999px; transition: width 0.6s var(--ease); }
.class-note { margin-top: 8px; font-size: 13px; color: var(--ink-dim); font-weight: 600; }
.delta { font-weight: 800; }
.delta.up { color: var(--green); }
.delta.down { color: var(--red-ink); }

/* ---------- grades detail ---------- */
.detail-card {
  background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin-bottom: 12px;
}
.detail-card h3 { margin: 0 0 4px; font-size: 19px; font-weight: 800; }
.big-circle {
  width: 92px; height: 92px; border-radius: 50%; margin: 6px auto 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; font-weight: 800;
}
.detail-center { text-align: center; }
.detail-line { margin: 4px 0; color: var(--ink-dim); font-weight: 600; font-size: 14px; }
.history-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.history-chip {
  background: var(--page-soft); border: 1px solid var(--hairline); border-radius: 999px;
  padding: 5px 12px; font-size: 13px; font-weight: 700; color: var(--ink-dim);
}
.history-chip b { color: var(--ink); }

/* ---------- changes ---------- */
.change-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--hairline); border-radius: 16px;
  box-shadow: var(--shadow); padding: 12px 16px; margin-bottom: 10px;
  font-weight: 700; font-size: 15px;
}
.change-row .arrow { font-size: 18px; flex: none; }
.change-row .arrow.up { color: var(--green); }
.change-row .arrow.down { color: var(--red-ink); }

/* ---------- upcoming ---------- */
.event-row {
  display: flex; gap: 14px; align-items: center;
  background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 12px;
}
.event-date {
  flex: none; width: 64px; text-align: center;
  background: var(--yellow-soft); border-radius: 14px; padding: 8px 4px;
}
.event-date .dow { display: block; font-size: 11px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--heading-ink); }
.event-date .dnum { display: block; font-size: 24px; font-weight: 800; line-height: 1.15; }
.event-info h3 { margin: 0; font-size: 16.5px; font-weight: 800; }
.event-info p { margin: 2px 0 0; color: var(--ink-dim); font-weight: 600; font-size: 13.5px; }

/* ---------- attendance ---------- */
.att-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.att-grid .stat-card .stat-num { font-size: 40px; }
.att-note {
  background: var(--pink); border: 1px solid var(--hairline); border-radius: var(--radius);
  padding: 16px 18px; margin-top: 14px; font-weight: 600; color: var(--ink);
}
.att-note b { font-weight: 800; }

.foot-note { text-align: center; color: var(--ink-faint); font-size: 12.5px; font-weight: 600; margin-top: 22px; }

/* ---------- bottom tab bar: filled icons ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: space-around; align-items: stretch;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--hairline);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
}
.tab {
  flex: 1; background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--ink-faint); font-size: 11.5px; font-weight: 700;
  padding: 4px 2px; border-radius: 12px;
}
.tab .tab-icon { width: 26px; height: 26px; display: block; }
.tab .tab-icon svg { width: 100%; height: 100%; display: block; }
.tab.active { color: var(--green); }
}

/* ---------- notifications card (Web Push client) ---------- */
.notif-card {
  background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin-top: 26px; text-align: center;
}
.notif-card .inner-band { margin-top: 0; }
.notif-copy { margin: 4px 0 8px; color: var(--ink-dim); font-weight: 600; font-size: 14.5px; }
.notif-status { margin: 0 0 14px; font-weight: 700; font-size: 14.5px; }
.notif-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.notif-msg { margin: 12px 0 0; font-size: 13px; font-weight: 600; color: var(--ink-dim); min-height: 1.2em; }
.btn {
  font: inherit; font-weight: 700; border: none; cursor: pointer;
  background: var(--green-bright); color: #fff; border-radius: 999px;
  padding: 13px 22px; font-size: 15px; min-height: 48px; width: 100%; max-width: 340px;
  transition: transform 0.15s var(--ease), opacity 0.15s var(--ease);
}
.btn:active { transform: scale(0.97); }
.mini-btn {
  font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer;
  border: 1.5px solid var(--hairline); background: #fff; color: var(--ink-dim);
  border-radius: 999px; padding: 9px 16px; min-height: 44px;
  transition: transform 0.15s var(--ease), border-color 0.15s var(--ease);
}
.mini-btn:active { transform: scale(0.97); }
