/* Renew Coder Institute - soft white + brand cyan (#02B9FA).
   Calm surfaces, light tints, readable text. Works on phone, tablet and desktop. */
:root {
  --brand: #02B9FA;
  --brand-hover: #00a8e6;
  --brand-dark: #0a6b94;      /* readable cyan for links / text on white */
  --brand-ink: #04364b;       /* text on top of cyan buttons */
  --brand-soft: #e6f7fe;
  --brand-softer: #f2fbff;
  --bg: #f4fafd;
  --card: #ffffff;
  --border: #d9eaf3;
  --text: #1b3646;
  --muted: #5b7686;
  --danger: #d64550;
  --success: #1f9d6b;
  --warning: #d98a1c;
  --shadow: 0 1px 2px rgba(18, 74, 104, .05), 0 6px 18px rgba(18, 74, 104, .05);
  --shadow-lift: 0 10px 28px rgba(18, 74, 104, .12);
  --ease: cubic-bezier(.2, .7, .2, 1);
  /* older names still used by a few pages */
  --navy: var(--text);
  --accent: var(--brand);
  --accent-dark: var(--brand-dark);
  --accent-soft: var(--brand-soft);
  --primary: var(--brand);
  --primary-dark: var(--brand-dark);
  --primary-light: var(--brand-soft);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  background: linear-gradient(180deg, #eaf8fe 0, var(--bg) 320px) no-repeat, var(--bg);
  color: var(--text);
  line-height: 1.5;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.container { max-width: 1180px; margin: 0 auto; padding: 26px 20px 64px; }
.container.narrow { max-width: 480px; padding-top: 40px; }
.narrow-wrap { max-width: 520px; margin: 0 auto; }
.wide-wrap { max-width: 860px; margin: 0 auto; }
a { color: var(--brand-dark); }

/* ---------- Motion ---------- */
@keyframes fadeUp   { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes popIn    { from { opacity: 0; transform: scale(.97) translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes slideDown{ from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes grow     { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.container > * { animation: fadeUp .4s var(--ease) backwards; }
.container > *:nth-child(2) { animation-delay: .04s; }
.container > *:nth-child(3) { animation-delay: .08s; }
.container > *:nth-child(4) { animation-delay: .12s; }
.container > *:nth-child(n+5) { animation-delay: .16s; }

/* ---------- Top bar ---------- */
.topbar {
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 8px 20px;
  padding-top: calc(8px + env(safe-area-inset-top, 0px));
  position: sticky; top: 0; z-index: 30;
}
@media (min-width: 1181px) {
  /* line the menu up with the page column on wide screens */
  .topbar { padding-left: calc((100% - 1180px) / 2 + 20px); padding-right: calc((100% - 1180px) / 2 + 20px); }
}
@media (min-width: 721px) {
  /* public pages: logo and menu share one row */
  .topbar.single { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
  .topbar.single nav { margin-top: 0; }
}
.topbar-row { display: flex; align-items: center; justify-content: space-between; }
.brand { font-weight: 800; font-size: 1.08rem; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand-logo { width: 34px; height: 34px; border-radius: 50%; display: block; box-shadow: 0 0 0 1px var(--border); }
.nav-toggle {
  display: none; background: #fff; border: 1px solid var(--border); color: var(--text);
  border-radius: 12px; font-size: 1.2rem; padding: 7px 14px; cursor: pointer;
}
.nav-toggle:active { transform: scale(.95); }
.topbar nav { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; margin-top: 6px; }
.topbar nav a {
  padding: 8px 11px; border-radius: 12px; color: var(--muted); text-decoration: none;
  font-size: .88rem; font-weight: 600;
  transition: background .15s var(--ease), color .15s var(--ease), transform .1s var(--ease);
}
.topbar nav a:hover { background: var(--brand-softer); color: var(--brand-dark); }
.topbar nav a:active { transform: scale(.96); }
.topbar nav a.active { background: var(--brand-soft); color: var(--brand-dark); }
.topbar nav a.nav-cta { background: var(--brand); color: var(--brand-ink); margin-left: 6px; }
.topbar nav a.nav-cta:hover { background: var(--brand-hover); color: var(--brand-ink); }
.ni { display: none; }
.nav-badge { background: var(--danger); color: #fff; border-radius: 999px; font-size: .68rem; padding: 1px 7px; margin-left: 4px; font-weight: 700; }
.user-box { display: flex; align-items: center; gap: 12px; font-size: .86rem; color: var(--muted); margin-left: auto; padding: 8px 10px; }
.user-box em { font-style: normal; color: var(--brand-dark); font-weight: 700; }

h1 { font-size: 1.6rem; margin: 0 0 18px; font-weight: 800; letter-spacing: -.02em; color: var(--text); }
h2 { font-size: 1.08rem; margin: 0 0 12px; font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: 1rem; margin: 0 0 8px; }
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.muted { color: var(--muted); font-size: .9rem; }
.lead { color: var(--muted); font-size: 1.05rem; margin: 0 0 18px; }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 18px;
  padding: 22px; margin-bottom: 20px; box-shadow: var(--shadow);
}
.card > h2:first-child, .card > .card-head:first-child h2 { margin-top: 0; }
.card.soft { background: var(--brand-softer); box-shadow: none; }

/* ---------- Dashboard tiles ---------- */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 22px; }
.tile {
  background: var(--card); border: 1px solid var(--border); border-radius: 18px;
  padding: 20px 12px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; text-decoration: none; color: var(--text); text-align: center; min-height: 116px;
  font-weight: 700; font-size: .93rem; box-shadow: var(--shadow);
  -webkit-tap-highlight-color: transparent;
  animation: popIn .4s var(--ease) backwards;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
}
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: var(--brand); }
.tile:active { transform: scale(.97); }
.tile-icon {
  width: 52px; height: 52px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.5rem; line-height: 1; background: var(--brand-soft); color: var(--brand-dark);
  transition: transform .25s var(--ease);
}
.tile:hover .tile-icon { transform: scale(1.08) rotate(-4deg); }
.tile-grid > .tile:nth-child(8n+2) .tile-icon { background: #e4f7ee; }
.tile-grid > .tile:nth-child(8n+3) .tile-icon { background: #fff3da; }
.tile-grid > .tile:nth-child(8n+4) .tile-icon { background: #fdebf0; }
.tile-grid > .tile:nth-child(8n+5) .tile-icon { background: #eeeafd; }
.tile-grid > .tile:nth-child(8n+6) .tile-icon { background: #dff5f3; }
.tile-grid > .tile:nth-child(8n+7) .tile-icon { background: #ffeedd; }
.tile-grid > .tile:nth-child(8n+8) .tile-icon { background: #e7effe; }
.tile-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); box-shadow: 0 8px 20px rgba(2, 185, 250, .28); }
.tile-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.tile-primary .tile-icon { background: rgba(255, 255, 255, .55); color: var(--brand-ink); }
.tile-grid > .tile:nth-child(1) { animation-delay: .05s; }
.tile-grid > .tile:nth-child(2) { animation-delay: .09s; }
.tile-grid > .tile:nth-child(3) { animation-delay: .13s; }
.tile-grid > .tile:nth-child(4) { animation-delay: .17s; }
.tile-grid > .tile:nth-child(5) { animation-delay: .21s; }
.tile-grid > .tile:nth-child(6) { animation-delay: .25s; }
.tile-grid > .tile:nth-child(n+7) { animation-delay: .29s; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card {
  background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--brand); border-radius: 16px;
  padding: 16px 20px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.stat-card:nth-child(4n+2) { border-left-color: #54c29a; }
.stat-card:nth-child(4n+3) { border-left-color: #f0b44c; }
.stat-card:nth-child(4n+4) { border-left-color: #9b8cf0; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.stat-num { font-size: 1.65rem; font-weight: 800; letter-spacing: -.02em; }
.stat-label { color: var(--muted); font-size: .84rem; font-weight: 600; }
.stat-card.stat-danger { border-left-color: var(--danger); }
.stat-card.stat-danger .stat-num { color: var(--danger); }

/* ---------- Tabs ---------- */
.tabbar { display: flex; width: fit-content; max-width: 100%; flex-wrap: wrap; gap: 2px; background: var(--brand-soft); padding: 4px; border-radius: 14px; margin-bottom: 18px; }
.tab {
  padding: 9px 16px; border-radius: 11px; color: var(--muted); text-decoration: none; font-weight: 700; font-size: .9rem;
  transition: background .18s var(--ease), color .18s var(--ease), box-shadow .18s var(--ease);
}
.tab:hover { color: var(--brand-dark); }
.tab.active { background: #fff; color: var(--brand-dark); box-shadow: var(--shadow); }

/* ---------- Forms ---------- */
form label { display: flex; flex-direction: column; gap: 5px; font-size: .84rem; color: var(--muted); margin-bottom: 16px; font-weight: 600; }
form input, form select, form textarea {
  padding: 11px 13px; border: 1.5px solid var(--border); border-radius: 12px; font-size: 1rem;
  font-family: inherit; color: var(--text); background: #fff; min-height: 46px; font-weight: 400; width: 100%;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
form input[type="checkbox"], form input[type="radio"] { width: auto; min-height: 0; }
form input:hover, form select:hover, form textarea:hover { border-color: #b9d8e8; }
form input:focus, form select:focus, form textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(2, 185, 250, .16); }
form textarea { min-height: 84px; resize: vertical; }
form input:disabled, form select:disabled, form textarea:disabled { background: #f1f7fa; color: var(--muted); }
.inline-form { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.inline-form label { margin-bottom: 0; min-width: 150px; flex: 1 1 160px; }
.inline-form input, .inline-form select { width: 100%; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; align-items: end; }
.form-grid label { margin-bottom: 0; }
.form-grid .wide { grid-column: 1 / -1; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }   /* spam trap */

/* ---------- Big touch choices ---------- */
.field-group { margin-bottom: 18px; }
.field-label { display: block; font-size: .84rem; color: var(--muted); margin-bottom: 8px; font-weight: 700; }
.big-choice, .mode-choice, .chip-grid { display: flex; gap: 10px; flex-wrap: wrap; border: none; padding: 0; margin: 0; }
.mode-choice legend { font-size: .84rem; color: var(--muted); padding: 0 0 8px; font-weight: 700; }
.big-tile, .radio-tile {
  flex: 1 1 140px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border: 2px solid var(--border); border-radius: 16px; padding: 16px 12px; cursor: pointer; text-align: center;
  min-height: 62px; font-weight: 700; font-size: .92rem; background: #fff; color: var(--text);
  transition: transform .12s var(--ease), border-color .15s var(--ease), background .15s var(--ease), box-shadow .15s var(--ease);
}
.big-tile:hover, .radio-tile:hover { border-color: #a9d6ea; }
.big-tile:active, .radio-tile:active { transform: scale(.97); }
.radio-tile { flex-direction: row; justify-content: flex-start; text-align: left; min-height: 52px; gap: 10px; padding: 12px 14px; }
.chip-grid .radio-tile { flex: 0 1 auto; min-height: 44px; padding: 8px 14px; border-radius: 999px; font-weight: 600; }
.big-tile-icon { font-size: 1.6rem; }
.big-tile input, .radio-tile input[type="radio"] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.radio-tile input[type="checkbox"] { accent-color: var(--brand); width: 18px; height: 18px; }
.big-tile:has(input:checked), .radio-tile:has(input:checked) {
  border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); box-shadow: 0 4px 14px rgba(2, 185, 250, .16);
}

/* ---------- Buttons ---------- */
.btn, .btn-secondary {
  display: inline-block; padding: 12px 22px; border-radius: 12px; border: none; font-size: .95rem; font-weight: 700;
  cursor: pointer; text-decoration: none; min-height: 46px; line-height: 1.2; text-align: center; font-family: inherit;
  transition: transform .12s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
.btn { background: var(--brand); color: var(--brand-ink); box-shadow: 0 4px 12px rgba(2, 185, 250, .28); }
.btn:hover { background: var(--brand-hover); box-shadow: 0 6px 18px rgba(2, 185, 250, .36); transform: translateY(-1px); }
.btn:active, .btn-secondary:active { transform: scale(.97); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-lg { padding: 15px 28px; font-size: 1.02rem; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-secondary { background: var(--brand-soft); color: var(--brand-dark); }
.btn-secondary:hover { background: #d3f0fc; }
.btn-ghost { background: #fff; color: var(--brand-dark); border: 1.5px solid var(--border); }
.btn-ghost:hover { border-color: var(--brand); }
.btn-link { background: none; border: none; color: var(--brand-dark); cursor: pointer; text-decoration: none; font-size: .87rem; padding: 6px 8px; font-weight: 700; border-radius: 8px; font-family: inherit; transition: background .15s var(--ease); }
.btn-link:hover { background: var(--brand-soft); }
.btn-link.danger { color: var(--danger); }
.btn-link.danger:hover { background: #fdecee; }
.inline { display: inline; }
.export-links { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Tables ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 12px; }
.table { width: 100%; border-collapse: collapse; min-width: 640px; }
.table th, .table td { padding: 12px 10px; border-bottom: 1px solid var(--border); text-align: left; font-size: .9rem; vertical-align: top; }
.table th { color: var(--muted); font-weight: 700; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; background: var(--brand-softer); }
.table th:first-child { border-top-left-radius: 10px; }
.table th:last-child { border-top-right-radius: 10px; }
.table tbody tr { transition: background .15s var(--ease); }
.table tbody tr:hover { background: var(--brand-softer); }
.table tr.row-overdue { background: #fff6f6; }
.table tr.row-overdue:hover { background: #ffeeee; }
.actions { white-space: nowrap; }
.sub { display: block; color: var(--muted); font-size: .78rem; margin-top: 2px; }
.cell-val { display: block; }

.badge { padding: 4px 11px; border-radius: 999px; font-size: .76rem; font-weight: 700; display: inline-block; white-space: nowrap; }
.badge-paid { background: #dff6ea; color: #17714d; }
.badge-soon { background: var(--brand-soft); color: var(--brand-dark); }
.badge-urgent, .badge-partial { background: #fff1d6; color: #8a5a0a; }
.badge-overdue { background: #fde6e8; color: #a5303a; }
.badge-status-new { background: #fff1d6; color: #8a5a0a; }
.badge-status-contacted { background: var(--brand-soft); color: var(--brand-dark); }
.badge-status-converted, .badge-status-admitted { background: #dff6ea; color: #17714d; }
.badge-status-closed, .badge-status-rejected { background: #e9eff3; color: #4b5f6c; }
.badge-att-present { background: #dff6ea; color: #17714d; }
.badge-att-absent { background: #fde6e8; color: #a5303a; }
.badge-att-late { background: #fff1d6; color: #8a5a0a; }
.badge-att-leave { background: var(--brand-soft); color: var(--brand-dark); }

.paid-bar { height: 5px; border-radius: 99px; background: #e4eff5; overflow: hidden; margin: 6px 0 3px; min-width: 90px; }
.paid-bar > span { display: block; height: 100%; background: var(--success); border-radius: 99px; transform-origin: left; animation: grow .8s var(--ease) backwards; }
.pay-panel { display: inline-block; vertical-align: top; }
.pay-panel summary { cursor: pointer; list-style: none; color: var(--brand-dark); font-weight: 700; font-size: .87rem; padding: 6px 8px; border-radius: 8px; transition: background .15s var(--ease); }
.pay-panel summary::-webkit-details-marker { display: none; }
.pay-panel summary:hover, .pay-panel[open] summary { background: var(--brand-soft); }
.pay-body { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 4px; padding: 12px; min-width: 230px; border: 1px solid var(--border); border-radius: 14px; background: #fff; white-space: normal; text-align: left; animation: slideDown .22s var(--ease); }
.pay-body select, .pay-body input { min-height: 40px; padding: 8px 10px; font-size: .9rem; }

.flash { padding: 12px 16px; border-radius: 14px; margin-bottom: 16px; font-size: .92rem; font-weight: 600; animation: slideDown .3s var(--ease) backwards; }
.flash.success { background: #dff6ea; color: #17714d; }
.flash.error { background: #fde6e8; color: #a5303a; }
.error { color: var(--danger); }

/* ---------- Public site: hero, action boxes, info, footer ---------- */
.hero {
  position: relative; overflow: hidden; text-align: center; padding: 46px 22px 40px; margin-bottom: 24px;
  background: radial-gradient(circle at 85% 10%, rgba(2, 185, 250, .20), transparent 45%), linear-gradient(180deg, #fff 0%, var(--brand-softer) 100%);
  border: 1px solid var(--border); border-radius: 26px; box-shadow: var(--shadow);
}
.hero-logo { width: 84px; height: 84px; border-radius: 50%; box-shadow: 0 0 0 1px var(--border), 0 10px 26px rgba(2, 185, 250, .25); margin: 0 auto 14px; display: block; }
.hero h1 { font-size: clamp(1.7rem, 4.5vw, 2.5rem); margin: 0 0 8px; }
.hero h1 span { color: var(--brand-dark); }
.hero p { max-width: 620px; margin: 0 auto 22px; color: var(--muted); font-size: 1.05rem; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-bottom: 26px; }
.action-card {
  display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--text);
  background: var(--card); border: 1px solid var(--border); border-radius: 22px; padding: 24px 22px 20px; box-shadow: var(--shadow);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
  animation: popIn .45s var(--ease) backwards;
}
.action-card:nth-child(2) { animation-delay: .06s; } .action-card:nth-child(3) { animation-delay: .12s; } .action-card:nth-child(4) { animation-delay: .18s; }
.action-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); border-color: var(--brand); }
.action-card:active { transform: scale(.98); }
.action-icon { width: 58px; height: 58px; border-radius: 18px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.8rem; background: var(--brand-soft); }
.action-card:nth-child(2) .action-icon { background: #fff3da; }
.action-card:nth-child(3) .action-icon { background: #e4f7ee; }
.action-card:nth-child(4) .action-icon { background: #eeeafd; }
.action-card h3 { font-size: 1.15rem; margin: 4px 0 0; }
.action-card p { margin: 0; color: var(--muted); font-size: .92rem; flex: 1; }
.action-go { color: var(--brand-dark); font-weight: 800; font-size: .92rem; }
.action-card.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); box-shadow: 0 12px 28px rgba(2, 185, 250, .3); }
.action-card.primary p, .action-card.primary .action-go { color: var(--brand-ink); }
.action-card.primary .action-icon { background: rgba(255, 255, 255, .6); }
.action-card.primary:hover { background: var(--brand-hover); }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-bottom: 24px; }
.info-card { background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 20px 22px; box-shadow: var(--shadow); }
.info-card h3 { font-size: 1.02rem; margin-bottom: 10px; }
.info-card ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: .93rem; }
.info-card li { margin-bottom: 4px; }
.price-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: .94rem; }
.price-row:last-child { border-bottom: 0; }
.price-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 0 32px; }
.price-row strong { color: var(--brand-dark); white-space: nowrap; }
.site-footer { border-top: 1px solid var(--border); background: #fff; margin-top: 10px; }
.site-footer .inner { max-width: 1180px; margin: 0 auto; padding: 26px 20px 30px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 22px; font-size: .9rem; color: var(--muted); }
.site-footer h4 { margin: 0 0 8px; color: var(--text); font-size: .95rem; }
.site-footer a { color: var(--brand-dark); text-decoration: none; font-weight: 600; }
.site-footer a:hover { text-decoration: underline; }
.site-footer .copy { grid-column: 1 / -1; border-top: 1px solid var(--border); padding-top: 14px; font-size: .8rem; }
.steps { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 18px; padding: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; display: flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--muted); font-weight: 600; }
.steps li::before { content: counter(s); width: 24px; height: 24px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: .8rem; }

/* fee panel on the admission form */
.fee-box { border: 1.5px dashed #a9d6ea; border-radius: 16px; padding: 16px 16px 4px; margin-bottom: 18px; background: var(--brand-softer); }
.fee-box h3 { margin-bottom: 12px; }
.fee-note { color: var(--muted); font-size: .86rem; margin: -4px 0 14px; }
.inline-check { display: flex; flex-direction: row; align-items: center; gap: 10px; margin-bottom: 14px; font-size: .92rem; color: var(--text); font-weight: 600; }
.inline-check input { width: 18px; height: 18px; accent-color: var(--brand); }

/* ---------- Slot-wise schedule ---------- */
.slot { margin-bottom: 26px; }
.slot-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; padding-left: 12px; border-left: 4px solid var(--brand); }
.slot-time { font-size: 1.15rem; font-weight: 800; letter-spacing: -.01em; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.slot-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 16px 18px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
}
.slot-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: var(--brand); }
.slot-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.slot-card-actions { display: flex; gap: 2px; flex-wrap: wrap; margin-left: -8px; }
.att-chips { display: flex; gap: 6px; flex-wrap: wrap; font-size: .82rem; }
.pill { font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: #e9eff3; color: #4b5f6c; white-space: nowrap; }
.pill-course { background: var(--brand-soft); color: var(--brand-dark); }
.pill-tuition { background: #fff1d6; color: #8a5a0a; }
.roster summary, .slot-add summary { cursor: pointer; font-weight: 700; color: var(--brand-dark); font-size: .88rem; }
.slot-add summary { font-size: .95rem; }
.roster ul { margin: 8px 0 0; padding-left: 18px; font-size: .88rem; }
.roster li { margin-bottom: 3px; }
.tile-grid > .tile:nth-child(1), .slot-grid > .slot-card { animation: popIn .4s var(--ease) backwards; }

/* ---------- Print ---------- */
.print-actions { margin-bottom: 16px; }
@media print {
  .no-print, .print-actions, .topbar, .site-footer { display: none !important; }
  .slot-card { box-shadow: none; break-inside: avoid; }
  .print-sheet .table { min-width: 0; }
  body { background: #fff; }
  .container > * { animation: none; }
}

/* ---------- Phones & small tablets ---------- */
@media (max-width: 720px) {
  .container { padding: 16px 14px 64px; }
  h1 { font-size: 1.4rem; }
  .nav-toggle { display: inline-block; }
  .topbar nav { display: none; flex-direction: column; align-items: stretch; gap: 3px; margin-top: 10px; padding-bottom: 6px; }
  .topbar nav.open { display: flex; animation: slideDown .25s var(--ease); }
  .topbar nav a { padding: 14px; border-radius: 12px; font-size: 1rem; }
  .ni { display: inline-block; width: 1.7em; }
  .topbar nav a.nav-cta { margin-left: 0; }
  .user-box { margin-left: 0; margin-top: 8px; flex-direction: column; align-items: flex-start; gap: 6px; border-top: 1px solid var(--border); padding-top: 10px; }
  .page-head { flex-direction: column; align-items: stretch; }
  .page-head .btn, .page-head .btn-secondary { text-align: center; }
  .inline-form { flex-direction: column; align-items: stretch; }
  .inline-form label { min-width: 0; width: 100%; flex: none; }
  .tile-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .tile { min-height: 108px; padding: 16px 8px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .stat-card { padding: 14px 16px; }
  .tabbar { width: 100%; }
  .tab { flex: 1; text-align: center; padding: 10px 8px; }
  .export-links { width: 100%; }
  .export-links a, .export-links button { flex: 1; text-align: center; }
  .card { padding: 18px; border-radius: 16px; }
  .hero { padding: 32px 16px 28px; border-radius: 22px; }
  .hero-actions .btn, .hero-actions .btn-ghost { flex: 1 1 100%; }
  .action-grid { grid-template-columns: 1fr; gap: 12px; }
  .action-card { flex-direction: row; flex-wrap: wrap; align-items: center; padding: 18px; }
  .action-card h3 { flex: 1; margin: 0; }
  .action-card p { flex: 1 1 100%; }
  .action-icon { width: 50px; height: 50px; font-size: 1.5rem; }
  .big-tile, .radio-tile { flex: 1 1 100%; }
  .chip-grid .radio-tile { flex: 0 1 auto; }

  /* Tables become one card per row (labels are added by the script in footer.php) */
  .table.stackable { min-width: 0; }
  .table.stackable thead { display: none; }
  .table.stackable tbody, .table.stackable tr { display: block; }
  .table.stackable tr { border: 1px solid var(--border); border-radius: 16px; margin-bottom: 12px; padding: 4px 14px; background: #fff; box-shadow: var(--shadow); }
  .table.stackable tr:hover { background: #fff; }
  .table.stackable tr.row-overdue { background: #fff6f6; }
  .table.stackable td { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; border: 0; border-bottom: 1px dashed var(--border); padding: 9px 0; text-align: right; }
  .table.stackable td:last-child { border-bottom: 0; }
  .table.stackable td::before { content: attr(data-label); color: var(--muted); font-weight: 700; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; text-align: left; flex: 0 0 34%; padding-top: 2px; }
  .table.stackable td.span-all { display: block; text-align: center; }
  .table.stackable td.span-all .cell-val { flex: none; }
  .table.stackable td.span-all::before { display: none; }
  .table.stackable .cell-val { flex: 1; text-align: right; min-width: 0; overflow-wrap: anywhere; }
  .table.stackable td.actions { white-space: normal; flex-direction: column; align-items: stretch; gap: 4px; }
  .table.stackable td.actions .cell-val { display: flex; flex-wrap: wrap; gap: 4px 2px; justify-content: flex-start; text-align: left; }
  .table.stackable td.actions::before { flex: none; }
  .table.stackable td.span-all .cell-val { text-align: center; }
  /* the table card already frames each row, so drop the outer box on phones */
  .card:has(> .table-scroll > .table.stackable), .card:has(> .card-head + .table-scroll > .table.stackable) { background: transparent; border: 0; box-shadow: none; padding: 0; }
  .table-scroll { overflow-x: visible; }
  .pay-body { min-width: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
