/*
  ClassCare visual identity
  Colours of the Ghana public-school uniform (cocoa brown + sunflower yellow), chalkboard green,
  and the Adinkra Nkonsonkonson chain ("we are linked together") as the one decorative motif.
*/
@font-face { font-family: "Bricolage"; src: url("fonts/bricolage-grotesque-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Bricolage"; src: url("fonts/bricolage-grotesque-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("fonts/figtree-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("fonts/figtree-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --cocoa: #3B2314; --cocoa-2: #5A3A24; --cocoa-soft: #EFE6DF;
  --sun: #F5B700; --sun-2: #DDA400; --sun-soft: #FFF3CC;
  --chalk: #1E5B45; --chalk-2: #164534; --chalk-soft: #E2F0E9;
  --brick: #B23A2E; --brick-soft: #FBE7E4;
  --sky: #245C9C; --sky-soft: #E4EDF8;
  --ink: #23272B; --muted: #5E6670; --line: #DCE1DA; --paper: #F4F6F1; --white: #FFFFFF;
  --r-lg: 18px; --r-md: 12px; --r-sm: 8px;
  --display: "Bricolage", "Segoe UI", system-ui, sans-serif;
  --body: "Figtree", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 17px/1.55 var(--body); color: var(--ink); background: var(--paper); }
a { color: var(--chalk); text-underline-offset: 3px; }
a:hover { color: var(--chalk-2); }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--white); padding: .5rem 1rem; z-index: 99; }
.skip:focus { left: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 22px; height: 22px; flex: none; }

/* ---------- Type */
h1, h2, h3 { font-family: var(--display); color: var(--cocoa); line-height: 1.15; margin: 0; }
h1 { font-weight: 800; font-size: clamp(1.7rem, 1.2rem + 2vw, 2.4rem); letter-spacing: -0.02em; margin-bottom: 1rem; }
h2 { font-weight: 600; font-size: 1.3rem; letter-spacing: -0.01em; margin: 1.75rem 0 .75rem; }
h3 { font-weight: 600; font-size: 1.08rem; margin: 1rem 0 .4rem; }
p { margin: 0 0 .75rem; max-width: 70ch; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.money, .stat { font-variant-numeric: tabular-nums lining-nums; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 70ch; }

/* ---------- Header + chain strip (the one bold element) */
.masthead { background: var(--cocoa); color: var(--white); }
.masthead-inner { max-width: 1120px; margin: 0 auto; display: flex; align-items: center; gap: 1rem; padding: .7rem 1rem; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--white); text-decoration: none; min-width: 0; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-family: var(--display); font-weight: 800; font-size: 1.15rem; letter-spacing: -0.01em; color: var(--sun); line-height: 1.1; }
.brand-class { font-size: .82rem; color: #E8D9CC; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 44vw; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: .4rem; }
.top-actions a, .top-actions .link { color: var(--white); text-decoration: none; display: inline-flex; align-items: center; gap: .35rem; padding: .4rem .55rem; border-radius: 999px; font-size: .95rem; }
.top-actions a:hover, .top-actions .link:hover { background: var(--cocoa-2); color: var(--white); }
.bell { position: relative; }
.bell .count { position: absolute; top: 0; right: 0; background: var(--sun); color: var(--cocoa); border-radius: 999px; font-size: .68rem; font-weight: 700; padding: 0 5px; line-height: 1.45; }
.me-name { display: none; }
.top-actions .top-signout { display: none; }
.sheet .sheet-signout { padding: .9rem .5rem; font-size: 1rem; color: var(--brick); text-decoration: none; font-weight: 700; }
.chain { height: 16px; background: var(--sun) url("chain.svg") repeat-x left center; }

/* ---------- Section tabs (desktop) */
.tabs { background: var(--white); border-bottom: 1px solid var(--line); display: none; }
.tabs-inner { max-width: 1120px; margin: 0 auto; display: flex; align-items: stretch; padding: 0 .5rem; }
.tabs a { display: flex; align-items: center; gap: .45rem; padding: .85rem .8rem .75rem; color: var(--muted); text-decoration: none; font-weight: 700; font-size: .95rem; border-bottom: 4px solid transparent; }
.tabs a:hover { color: var(--cocoa); }
.tabs a[aria-current="page"] { color: var(--cocoa); border-bottom-color: var(--sun); }
.tabs .icon { width: 19px; height: 19px; display: none; }
.tabs .desk .icon { display: block; }
@media (min-width: 1240px) { .tabs .icon { display: block; } }
.desk { margin-left: auto; position: relative; display: flex; align-items: center; }
.desk summary { white-space: nowrap; list-style: none; cursor: pointer; display: flex; align-items: center; gap: .45rem; padding: .45rem .85rem; margin: .4rem 0; border-radius: 999px; background: var(--chalk); color: var(--white); font-weight: 700; font-size: .92rem; }
.desk summary::-webkit-details-marker { display: none; }
.desk[open] summary { background: var(--chalk-2); }
.desk-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 40; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: 0 18px 40px -18px rgba(59, 35, 20, .45); padding: .5rem; width: 290px; columns: 1; }
.desk-menu a { display: block; padding: .5rem .7rem; border-radius: var(--r-sm); color: var(--ink); text-decoration: none; font-weight: 400; border: 0; }
.desk-menu a:hover, .desk-menu a[aria-current="page"] { background: var(--chalk-soft); color: var(--chalk-2); }
.desk-menu .group { font-size: .8rem; color: var(--muted); padding: .55rem .7rem .2rem; }

/* ---------- Page */
.content { max-width: 1120px; margin: 0 auto; padding: 1.25rem 1rem 6rem; }
.content.narrow { max-width: 480px; padding-top: 0; }

/* ---------- Mobile bottom bar + sheet */
.bottomnav { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: var(--white); border-top: 1px solid var(--line); z-index: 25; padding-bottom: env(safe-area-inset-bottom); }
.bottomnav a, .bottomnav summary { flex: 1; text-align: center; padding: .45rem 0 .5rem; font-size: .72rem; color: var(--muted); text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 2px; font-weight: 700; cursor: pointer; list-style: none; }
.bottomnav summary::-webkit-details-marker { display: none; }
.bottomnav a[aria-current="page"] { color: var(--cocoa); }
.bottomnav a[aria-current="page"] .icon { color: var(--cocoa); background: var(--sun); border-radius: 999px; padding: 2px 12px; width: 46px; box-sizing: content-box; height: 20px; }
.bottomnav .more-wrap { flex: 1; display: flex; }
.bottomnav details { flex: 1; display: flex; }
.sheet { position: fixed; left: 0; right: 0; bottom: 60px; max-height: 72vh; overflow-y: auto; background: var(--white); border-radius: var(--r-lg) var(--r-lg) 0 0; box-shadow: 0 -20px 40px -20px rgba(59, 35, 20, .5); padding: 1rem 1rem 1.5rem; text-align: left; }
.sheet a { display: flex; align-items: center; gap: .7rem; padding: .7rem .5rem; color: var(--ink); font-size: 1rem; font-weight: 400; flex-direction: row; text-decoration: none; border-bottom: 1px solid var(--line); }
.sheet .group { font-size: .82rem; color: var(--muted); margin: 1rem .5rem .25rem; }

@media (min-width: 960px) {
  .tabs { display: block; }
  .bottomnav { display: none; }
  .me-name { display: inline; }
  .top-actions .top-signout { display: inline; }
  .brand-class { max-width: 520px; font-size: .9rem; }
  .content { padding: 2rem 1.25rem 3rem; }
}

/* ---------- Surfaces: panels hold related content; lists are plain sheets with dividers */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.15rem 1.25rem; margin-bottom: 1rem; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.narrow-card { max-width: 480px; }
.grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: .75rem 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }

/* ---------- Home: Akwaaba banner + dues slip */
.welcome { display: grid; gap: 1rem; grid-template-columns: 1fr; margin-bottom: 1.5rem; align-items: stretch; }
@media (min-width: 820px) { .welcome { grid-template-columns: 1.4fr 1fr; } }
.welcome-text { padding: .5rem 0; }
.welcome-text .hello { font-family: var(--display); font-weight: 800; font-size: clamp(2.2rem, 1.4rem + 3.6vw, 3.6rem); line-height: .98; letter-spacing: -0.035em; color: var(--cocoa); margin: 0 0 .6rem; }
.welcome-text .hello span { display: block; color: var(--chalk); }
.welcome-text p { color: var(--muted); font-size: 1.02rem; }
.slip { background: var(--cocoa); color: var(--white); border-radius: var(--r-lg); padding: 1.25rem 1.35rem; position: relative; overflow: hidden; }
.slip::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 12px; background: var(--sun) url("chain.svg") repeat-x left center; background-size: auto 12px; }
.slip-label { color: #E8D9CC; font-size: .92rem; margin: 0; }
.slip .slip-amount { font-family: var(--display); font-weight: 800; font-size: 2.6rem; letter-spacing: -0.03em; color: var(--sun); line-height: 1.1; margin: .1rem 0 .4rem; }
.slip p { color: #F1E8E0; }
.slip .actions { margin-bottom: .6rem; }
.slip .slip-title { color: var(--white); margin: .2rem 0 .8rem; font-size: 1.35rem; }
.slip-account { font-family: var(--display); font-weight: 600; font-size: 1.15rem; color: var(--sun); background: var(--cocoa-2); border-radius: var(--r-md); padding: .85rem 1rem; margin-bottom: .9rem; }
.slip { padding-bottom: 1.75rem; }
h2.flush { margin-top: 0; }
.slip .btn-secondary { background: transparent; color: var(--white); border-color: #8C6A54; }
.slip .btn-secondary:hover { background: var(--cocoa-2); }

/* Executive desk strip on home */
.deskbar { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.5rem; }
.deskbar a { display: inline-flex; align-items: baseline; gap: .45rem; padding: .5rem .85rem; border-radius: 999px; background: var(--white); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: .95rem; }
.deskbar a strong { font-family: var(--display); font-size: 1.1rem; color: var(--cocoa); }
.deskbar a.hot { background: var(--sun-soft); border-color: #F0D27A; }
.deskbar a:hover { border-color: var(--cocoa); }

/* Date tile for meetings and events */
.dated { display: flex; gap: .9rem; align-items: flex-start; }
.datetile { flex: none; width: 54px; text-align: center; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); background: var(--white); }
.datetile .m { display: block; background: var(--chalk); color: var(--white); font-size: .72rem; font-weight: 700; padding: 2px 0; }
.datetile .d { display: block; font-family: var(--display); font-weight: 800; font-size: 1.45rem; color: var(--cocoa); line-height: 1.25; }
.dated .title { font-weight: 700; color: var(--ink); text-decoration: none; }
.dated .title:hover { text-decoration: underline; }

/* Category dot for notices */
.cat { display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; color: var(--muted); }
.cat::before { content: ""; width: 8px; height: 8px; border-radius: 99px; background: var(--chalk); }
.cat-urgent::before { background: var(--brick); }
.cat-welfare::before { background: var(--sun-2); }
.cat-finance::before { background: var(--cocoa); }
.cat-events::before, .cat-meetings::before { background: var(--sky); }

/* ---------- Stats */
.stat { font-family: var(--display); font-size: 1.9rem; font-weight: 800; color: var(--cocoa); letter-spacing: -0.02em; }
.stat-label { color: var(--muted); font-size: .92rem; }

/* ---------- Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--white); }
th, td { text-align: left; padding: .65rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; font-size: .95rem; }
th { font-size: .85rem; font-weight: 700; color: var(--muted); background: var(--white); border-bottom: 2px solid var(--line); }
tbody tr:hover { background: #FAFBF8; }
td.num, th.num { text-align: right; }

/* ---------- Badges */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .55rem .12rem .45rem; border-radius: 999px; font-size: .8rem; font-weight: 700; text-transform: capitalize; white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 99px; background: currentColor; }
.badge-ok { background: var(--chalk-soft); color: var(--chalk-2); }
.badge-warn { background: var(--sun-soft); color: #7A5600; }
.badge-bad { background: var(--brick-soft); color: var(--brick); }
.badge-info { background: var(--sky-soft); color: var(--sky); }
.badge-muted { background: #ECEEEA; color: var(--muted); }

/* ---------- Alerts */
.alert { padding: .8rem 1rem; border-radius: var(--r-md); margin-bottom: 1rem; border-left: 5px solid; background: var(--white); }
.alert-success { border-color: var(--chalk); background: var(--chalk-soft); color: var(--chalk-2); }
.alert-error { border-color: var(--brick); background: var(--brick-soft); color: #7E241B; }
.alert-info { border-color: var(--sky); background: var(--sky-soft); color: #1B4373; }
.alert-warn { border-color: var(--sun-2); background: var(--sun-soft); color: #5E4300; }
.warn-box { border-left: 5px solid var(--sun-2); background: var(--sun-soft); color: #5E4300; padding: .85rem 1rem; border-radius: var(--r-md); margin: 1rem 0; }
.warn-box a { color: var(--cocoa); font-weight: 700; }
.offline { position: sticky; top: 0; z-index: 60; margin: 0; border-radius: 0; }

/* ---------- Forms */
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 700; margin-bottom: .3rem; font-size: .95rem; color: var(--cocoa); }
.field.checkbox label { font-weight: 400; color: var(--ink); display: flex; gap: .55rem; align-items: flex-start; }
input[type=checkbox], input[type=radio] { accent-color: var(--chalk); width: 1.1rem; height: 1.1rem; margin-top: .2rem; }
input[type=text], input[type=password], input[type=email], input[type=tel], input[type=date], input[type=datetime-local], input[type=number], input[type=url], input[type=search], input[type=file], select, textarea {
  width: 100%; padding: .7rem .8rem; border: 1.5px solid #C9D0C6; border-radius: var(--r-sm); font: inherit; font-size: 1rem; background: var(--white); color: var(--ink); }
input:focus, select:focus, textarea:focus { border-color: var(--chalk); outline: 3px solid var(--chalk-soft); outline-offset: 0; }
textarea { min-height: 6.5rem; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--brick); }
.error { color: var(--brick); font-size: .88rem; margin: .3rem 0 0; }
.hint { color: var(--muted); font-size: .88rem; margin: .3rem 0 0; }
.req { color: var(--brick); }
fieldset { border: 0; padding: 0; margin: 0 0 1rem; }

/* ---------- Buttons: yellow = main action, outline = secondary, brick = destructive */
.btn, button.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; background: var(--sun); color: var(--cocoa); border: 2px solid var(--sun); border-radius: 999px; padding: .6rem 1.2rem; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn:hover { background: var(--sun-2); border-color: var(--sun-2); color: var(--cocoa); }
.btn-secondary, button.btn-secondary { background: var(--white); color: var(--cocoa); border-color: #C9BCB1; }
.btn-secondary:hover { background: var(--cocoa-soft); border-color: var(--cocoa); }
.btn-danger, button.btn-danger { background: var(--white); color: var(--brick); border-color: var(--brick); }
.btn-danger:hover { background: var(--brick); color: var(--white); border-color: var(--brick); }
.btn-small { padding: .35rem .8rem; font-size: .88rem; }
button[disabled] { opacity: .55; cursor: progress; }
.link { background: none; border: 0; padding: 0; color: var(--chalk); cursor: pointer; font: inherit; text-decoration: underline; text-underline-offset: 3px; }
.inline { display: inline; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .8rem 0; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: .75rem; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }

/* ---------- Misc */
.empty { padding: 2rem 1.25rem; color: var(--muted); background: var(--white); border: 2px dashed var(--line); border-radius: var(--r-lg); text-align: center; }
.pill-nav { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.pill-nav a { padding: .35rem .85rem; border-radius: 999px; background: var(--white); border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: .9rem; font-weight: 700; }
.pill-nav a[aria-current="true"] { background: var(--cocoa); color: var(--sun); border-color: var(--cocoa); }
.code { font-family: ui-monospace, Consolas, monospace; background: var(--sun-soft); color: var(--cocoa); padding: .15rem .45rem; border-radius: 6px; letter-spacing: .08em; }
.copy-row { display: flex; gap: .5rem; } .copy-row input { flex: 1; }
details { margin: .5rem 0; }
summary { cursor: pointer; font-weight: 700; color: var(--chalk); }
details.card > summary { font-family: var(--display); font-weight: 600; font-size: 1.08rem; color: var(--cocoa); }
progress { width: 100%; height: 12px; accent-color: var(--chalk); }

/* ---------- Sign-in page */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr; background: var(--paper); }
.auth-side { background: var(--cocoa); color: var(--white); padding: 2rem 1.5rem 2.25rem; position: relative; }
.auth-side::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 16px; background: var(--sun) url("chain.svg") repeat-x left center; }
.auth-side .big { font-family: var(--display); font-weight: 800; color: var(--sun); font-size: clamp(2.4rem, 1.6rem + 4vw, 4.4rem); line-height: .95; letter-spacing: -0.04em; margin: 1rem 0 .75rem; }
.auth-side p { color: #F1E8E0; max-width: 34ch; font-size: 1.05rem; }
.auth-main { padding: 1.75rem 1.25rem 3rem; display: flex; justify-content: center; align-items: flex-start; }
.auth-main .card { width: 100%; max-width: 420px; }
@media (min-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr 1fr; }
  .auth-side { padding: 4rem 3.5rem; display: flex; flex-direction: column; justify-content: center; }
  .auth-side::after { left: auto; top: 0; width: 16px; height: auto; background-repeat: repeat-y; background-image: url("chain-v.svg"); }
  .auth-main { align-items: center; padding: 3rem; }
}

/* ---------- Receipt (printable) */
.receipt { max-width: 640px; margin: 2rem auto; background: #fff; padding: 2rem; border-radius: var(--r-lg); border: 1px solid var(--line); border-top: 16px solid var(--sun); }

@media (prefers-reduced-motion: no-preference) {
  .welcome-text .hello { animation: rise .5s ease-out both; }
  @keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}
@media print { .masthead, .chain, .tabs, .bottomnav, .no-print { display: none !important; } body { background: #fff; } .content { padding: 0; } }
