/* =====================================================================
   Delight Academy theme — additions to the design system (base.css) for the
   WordPress build: paging, gates, notification centre, gradebook, register,
   check lists, WooCommerce/WordPress pages, PWA install banner.
   ===================================================================== */

/* ---------- utilities ---------- */
.hide-sm { display: initial; }
.text-red { color: var(--red, #c0392b); }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-4 { margin-top: 28px; } .mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 20px; } .mb-4 { margin-bottom: 28px; }
.wrap { flex-wrap: wrap; } .gap-2 { gap: 12px; } .gap-3 { gap: 18px; }
.loader p { margin-top: 10px; text-align: center; }
.list-item .grow > b { display: block; font-size: .9rem; color: var(--ink); }
.list-item .grow > span { display: block; }
.list-item time { white-space: nowrap; }
a.list-item { text-decoration: none; color: inherit; }
a.list-item:hover { background: var(--bg-soft, #f6f8fc); }
.list-item .icon-box { flex: none; }
.notif-row.unread { background: var(--blue-soft, #eef4ff); }
.notif-foot { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px; font-size: .82rem; font-weight: 600; border-top: 1px solid var(--line); color: var(--blue); text-decoration: none; }
.notif-foot svg { width: 14px; height: 14px; }
.notif time { display: block; font-size: .7rem; color: var(--muted); margin-top: 2px; }
.gate .empty { padding: 48px 24px; }
.gate .empty p { max-width: 520px; margin-left: auto; margin-right: auto; }
.sched-row.is-cancelled { opacity: .6; }
.sched-row .sa { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.kpis .kpi .icon-box { flex: none; }

/* ---------- forms ---------- */
.check-list { display: grid; gap: 6px; max-height: 300px; overflow: auto; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.check-list .lbl { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 6px 0 2px; font-weight: 600; }
.check-list .check { margin: 0; }
.field.hide { display: none; }
.field label small { font-weight: 400; }
input[type="file"].input { padding: 8px 12px; }
.inbox-search { padding: 8px 12px; border-bottom: 1px solid var(--line); }
.inbox-search .input { padding-left: 38px; }
.thread-reply label.btn { align-self: center; }
.thread-item .pill-count { margin-left: auto; }
.check-list label.check span small { color: var(--muted); }

/* ---------- tables ---------- */
.table.gradebook th, .table.gradebook td { white-space: nowrap; }
.table.gradebook th a { color: inherit; text-decoration: none; }
.kv-table th { text-align: left; width: 240px; font-weight: 600; color: var(--muted); font-size: .85rem; }
.kv-table td { font-size: .9rem; }
.table td .flex { align-items: center; }
.rec-row .btn { flex: none; }
.an-card.is-pinned { border-left: 4px solid var(--navy); }
.media-thumb.is-video { background: #0b1b3a; color: #fff; }
.section-title { font-size: 1.1rem; margin: 0 0 12px; }
.alist .arow { display: grid; grid-template-columns: 160px minmax(0, 1fr) 90px; gap: 10px; padding: 10px 20px; border-bottom: 1px solid var(--line); font-size: .85rem; align-items: center; }
.alist .arow:last-child { border-bottom: 0; }
.alist .am-who { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alist .am-time { color: var(--muted); text-align: right; font-size: .78rem; }
.timeline .tl-item { padding: 8px 0; border-bottom: 1px solid var(--line); }
.timeline .tl-item:last-child { border-bottom: 0; }
.timeline .tl-item b { display: block; font-size: .85rem; }
.dropdown-menu button.danger { color: var(--red, #c0392b); }
.subj-hero { display: grid; grid-template-columns: minmax(0, 1fr); padding: 0; margin-bottom: 20px; }
.subj-hero-img { position: absolute; inset: 0; }
.subj-hero-img img { width: 100%; height: 100%; object-fit: cover; }
.subj-hero-in { position: relative; z-index: 1; padding: 34px 28px; color: #fff; }
.subj-hero-in .cls-kick { color: rgba(255, 255, 255, .8); }
.subj-hero-in small.muted { color: rgba(255, 255, 255, .7); }
.ov-stat b { font-size: 1.35rem; }
.settings-grid .wp-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; }
.wp-actions { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.att-subj .ring { flex: none; }

/* ---------- WordPress / WooCommerce pages ---------- */
.wp-page { padding: 48px 0 72px; background: var(--bg, #f4f6fb); min-height: 60vh; }
.wp-page-card { padding: 32px; }
.wp-page-title { margin: 0 0 18px; font-size: 1.6rem; }
.wp-content { font-size: .95rem; line-height: 1.7; }
.wp-content h2, .wp-content h3 { margin: 24px 0 10px; }
.wp-content table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.wp-content th, .wp-content td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: .9rem; }
.wp-content .button, .wp-content button, .wp-content input[type="submit"] { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 12px; border: 0; background: var(--blue); color: #fff; font-weight: 600; font-family: inherit; cursor: pointer; }
.wp-content input[type="text"], .wp-content input[type="email"], .wp-content input[type="tel"], .wp-content input[type="password"], .wp-content select, .wp-content textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; font-family: inherit; font-size: .95rem; }
.wp-content .woocommerce-message, .wp-content .woocommerce-info, .wp-content .woocommerce-error { padding: 12px 16px; border-radius: 12px; background: var(--blue-soft, #eef4ff); margin: 0 0 16px; list-style: none; }
.wp-content .woocommerce-error { background: #fdecec; color: #9b2c2c; }
.wp-content .woocommerce-MyAccount-navigation ul { list-style: none; padding: 0; display: flex; gap: 10px; flex-wrap: wrap; }
.wp-content .woocommerce-MyAccount-navigation a { display: inline-block; padding: 8px 14px; border-radius: 10px; background: var(--bg-soft, #f6f8fc); text-decoration: none; font-weight: 600; font-size: .85rem; }
.wp-content #payment ul.payment_methods { list-style: none; padding: 0; }
.wp-content #payment li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.wp-content #order_review { margin-top: 16px; }
.wp-content .screen-reader-text { position: absolute; left: -9999px; }

/* ---------- PWA install banner ---------- */
.pwa-banner { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 900; display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; background: #fff; box-shadow: 0 12px 40px rgba(11, 27, 58, .18); border: 1px solid var(--line); max-width: 560px; margin: 0 auto; animation: pwaIn .35s ease; }
.pwa-banner .icon-box { flex: none; }
.pwa-banner .grow b { display: block; font-size: .92rem; }
.pwa-banner .grow span { display: block; font-size: .8rem; color: var(--muted); }
.pwa-banner .btn-icon { flex: none; }
body.has-tabbar .pwa-banner { bottom: 78px; }
@keyframes pwaIn { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.pwa-steps { padding-left: 18px; font-size: .9rem; }
.pwa-steps li { margin-bottom: 8px; }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .hide-sm { display: none !important; }
  .page-head { flex-direction: column; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1 1 auto; justify-content: center; }
  .alist .arow { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .alist .am-time { text-align: left; }
  .kv-table th { width: 140px; }
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .toolbar { flex-wrap: wrap; }
  .toolbar .select, .toolbar .search { width: 100%; }
  .sched-row .sa { justify-content: flex-start; }
  .subj-hero-in { padding: 24px 18px; }
  .pwa-banner { left: 10px; right: 10px; bottom: 10px; }
  .wp-page-card { padding: 20px 16px; }
}

/* admin overview stat grid */
.ov-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .ov-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Messages: attachment name under the reply box */
.reply-file { padding: 0 16px 10px; min-height: 0; }
.reply-file:empty { display: none; }

/* Notices & announcements */
.an-tabs { flex-wrap: wrap; }
.an-card { position: relative; }
.an-card .an-top { display: flex; gap: 14px; align-items: flex-start; }
.an-card .an-badges { margin-bottom: 6px; }
.an-card .an-title { margin: 0; font-size: 1.08rem; line-height: 1.35; }
.an-card .an-body { white-space: pre-line; margin: 14px 0 0; color: var(--ink-2); line-height: 1.65; }
.an-card .an-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.an-card.kind-important { border-left: 4px solid var(--red); }
.an-card.kind-reminder { border-left: 4px solid var(--amber); }
.an-card.kind-payment { border-left: 4px solid var(--green); }
.an-card.kind-meeting { border-left: 4px solid var(--blue); }
.an-card.is-focus { box-shadow: 0 0 0 3px var(--blue-100), var(--shadow-md); }
.icon-box.amber { background: var(--amber-50, #FFF7E6); color: var(--amber); }
.an-people { display: flex; flex-wrap: wrap; gap: 8px; min-height: 36px; padding: 8px 0 10px; }
.an-people .chip { display: inline-flex; align-items: center; gap: 6px; padding-right: 6px; }
.an-people .chip button { border: 0; background: none; padding: 0; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); cursor: pointer; }
.an-people .chip button:hover { background: var(--red-50, #FDECEC); color: var(--red); }
.an-people .chip button svg { width: 12px; height: 12px; }
.an-results { display: grid; gap: 4px; margin-top: 8px; max-height: 220px; overflow: auto; }
.an-hit { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 1px solid var(--line-2); background: #fff; border-radius: 10px; padding: 8px 10px; cursor: pointer; font: inherit; color: var(--ink); }
.an-hit:hover { border-color: var(--blue); background: var(--blue-50); }
.an-hit .txt { display: grid; flex: 1; min-width: 0; }
.an-hit .avatar { flex: none; }
.an-hit small { color: var(--muted); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-hit > svg { width: 16px; height: 16px; color: var(--blue); flex: none; }

/* Legal pages (/terms/, /privacy/) and the in-form reader */
.legal-page { padding-top: 36px; }
.legal-tabs { display: flex; gap: 8px; margin: 0 0 18px; }
.legal-tabs a { padding: 9px 16px; border-radius: var(--r-pill); border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: .9rem; color: var(--ink-2); text-decoration: none; }
.legal-tabs a.active, .legal-tabs a:hover { background: var(--blue); border-color: var(--blue); color: #fff; }
.legal-doc { max-width: 820px; margin: 0 auto; }
.legal-doc .legal-title { font-size: clamp(1.6rem, 3vw, 2.1rem); margin: 0 0 6px; letter-spacing: -.02em; }
.legal-doc .legal-meta { color: var(--muted); font-size: .85rem; margin: 0 0 18px; }
.legal-doc .legal-intro { font-size: 1.02rem; color: var(--ink-2); line-height: 1.7; padding: 14px 18px; background: var(--blue-50); border-radius: 12px; margin: 0 0 8px; }
.legal-doc h2 { font-size: 1.08rem; margin: 26px 0 8px; }
.legal-doc p { line-height: 1.7; color: var(--ink-2); margin: 0 0 12px; }
.modal .legal-doc { max-width: none; }
.modal .legal-doc .legal-title { font-size: 1.3rem; }
.footer .bottom a { color: inherit; opacity: .8; }
.footer .bottom a:hover { opacity: 1; }

/* Checkbox options inside a form field: inherit the .check look, not the field-label look */
.field > label.check, .field label.check { display: inline-flex; align-items: flex-start; gap: 10px; font-weight: 500; font-size: .9rem; margin: 12px 0 0; color: var(--ink-2); }
.field label.check input { margin-top: 2px; }

/* ---------- Invoices (student + office) — the same layout is printed via S.printInvoice ---------- */
.inv-sheet { font-size: .88rem; }
.inv-top { display: flex; justify-content: space-between; gap: 24px; border-bottom: 2px solid var(--navy); padding-bottom: 16px; }
.inv-logo { height: 42px; width: auto; }
.inv-addr { margin-top: 8px; color: var(--muted); line-height: 1.5; font-size: .82rem; }
.inv-meta { text-align: right; }
.inv-title { font-size: 1.5rem; font-weight: 800; color: var(--navy); text-transform: uppercase; letter-spacing: .06em; }
.inv-meta table { margin: 6px 0 8px auto; border-collapse: collapse; }
.inv-meta th { text-align: left; color: var(--muted); font-weight: 500; padding: 2px 12px 2px 0; }
.inv-meta td { text-align: right; font-weight: 600; }
.inv-status { display: inline-block; padding: 3px 10px; border-radius: var(--r-pill); font-size: .74rem; font-weight: 700; background: var(--amber-50); color: #9A5B00; }
.inv-status.s-paid { background: var(--green-50); color: #0B7A4B; }
.inv-status.s-overdue { background: var(--red-50); color: #B42318; }
.inv-status.s-pending { background: var(--blue-50); color: #0B5A94; }
.inv-status.s-waived, .inv-status.s-cancelled { background: var(--bg); color: var(--muted); }
.inv-parties { display: flex; flex-wrap: wrap; gap: 20px; padding: 16px 0; }
.inv-parties > div { flex: 1 1 170px; }
.inv-parties h4, .inv-pay h4 { margin: 0 0 6px; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.inv-parties p { margin: 0; line-height: 1.55; }
.inv-lines { width: 100%; border-collapse: collapse; margin-top: 4px; }
.inv-lines th { background: var(--navy); color: #fff; text-align: left; padding: 9px 10px; font-size: .78rem; }
.inv-lines td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.inv-lines .r { text-align: right; }
.inv-lines tfoot td { border: 0; padding: 6px 10px; }
.inv-lines tfoot .due td { font-size: 1rem; font-weight: 800; border-top: 2px solid var(--navy); padding-top: 10px; }
.inv-muted { color: var(--muted); font-size: .8rem; }
.inv-pay { margin-top: 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg); }
.inv-pay p { margin: 4px 0; }
.inv-pay table { border-collapse: collapse; margin: 6px 0; }
.inv-pay th { text-align: left; color: var(--muted); font-weight: 500; padding: 2px 14px 2px 0; }
.inv-pay td { font-weight: 600; }
.inv-pay.paid { background: var(--green-50); border-color: #bfe6d2; }
@media (max-width: 600px) {
  .inv-top { flex-direction: column; gap: 12px; }
  .inv-meta, .inv-title { text-align: left; }
  .inv-meta table { margin-left: 0; }
  .inv-meta td { text-align: left; }
}

/* ---------- Fee management (admin) ---------- */
.fee-std { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 28px; }
.fee-std .amt { font-size: 1.9rem; font-weight: 800; color: var(--navy); line-height: 1.1; }
.fee-std .amt small { font-size: .8rem; font-weight: 500; color: var(--muted); margin-left: 4px; }
.fee-std .lbl { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 4px; }
.fee-std .facts { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: .86rem; color: var(--ink-2); }
.fee-std .facts b { color: var(--ink); }
.fee-std .acts { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.fee-arr { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 18px; border-bottom: 1px solid var(--line-2); background: var(--bg); font-size: .88rem; }
.fee-arr .grow { flex: 1 1 200px; }
.subj-pick .choice:has(input:disabled) { cursor: default; }
.chips-inline { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Ask Delight assistant: typing indicator (● ● ●) shown for about 3 seconds before each answer ---------- */
.am.typing { font-style: normal; padding: 13px 16px; justify-self: start; }
.typing-dots { display: inline-flex; align-items: center; gap: 5px; height: 12px; }
.typing-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted-2); animation: typingDot 1.2s infinite ease-in-out; }
.typing-dots i:nth-child(2) { animation-delay: .18s; }
.typing-dots i:nth-child(3) { animation-delay: .36s; }
@keyframes typingDot { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-4px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .typing-dots i { animation: none; opacity: .7; } }
.asst-form .btn:disabled { opacity: .55; }
/* Leave room under portal pages so the last row of a table can scroll clear of the Ask Delight button. */
body.has-asst #app { padding-bottom: 76px; }
