/* ==========================================================================
   ICU Project Presentations — design system
   Colours taken from the university crest: navy shield and mint panel.
   ========================================================================== */
:root {
  --navy-900: #1b2350;
  --navy-800: #232d63;
  --navy-700: #2e3a74;
  --navy-600: #38457a;
  --navy-100: #e8ebf5;
  --navy-50:  #f3f5fb;
  --mint-500: #5fb39f;
  --mint-400: #8cc8b8;
  --mint-100: #e3f3ee;
  --ink:      #141a33;
  --muted:    #646b85;
  --line:     #e3e6ef;
  --bg:       #f5f7fb;
  --surface:  #ffffff;
  --success:  #2a8c76;
  --success-bg: #e6f4f0;
  --warning:  #b7791f;
  --warning-bg: #fdf4e3;
  --danger:   #c2413b;
  --danger-bg: #fdecea;
  --info:     var(--navy-600);
  --info-bg:  var(--navy-50);
  --radius:   16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(20, 26, 51, .06);
  --shadow:   0 1px 3px rgba(20, 26, 51, .06), 0 8px 24px rgba(20, 26, 51, .06);
  --shadow-lg: 0 20px 50px rgba(20, 26, 51, .18);

  --bs-body-font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--bg);
  --bs-primary: var(--navy-600);
  --bs-primary-rgb: 56, 69, 122;
  --bs-link-color: var(--navy-600);
  --bs-link-color-rgb: 56, 69, 122;
  --bs-link-hover-color: var(--navy-900);
  --bs-border-color: var(--line);
  --bs-secondary-color: var(--muted);
}

body { background: var(--bg); color: var(--ink); min-height: 100vh; display: flex; flex-direction: column; -webkit-font-smoothing: antialiased; }
body > main { flex: 1; }
h1, h2, h3, h4, h5, h6 { color: var(--ink); font-weight: 700; letter-spacing: -.01em; }
.text-secondary { color: var(--muted) !important; }
.font-mono, code { font-family: ui-monospace, 'SF Mono', Consolas, monospace; }
code { color: var(--navy-700); background: var(--navy-50); padding: .1em .4em; border-radius: 6px; font-size: .85em; }
.min-w-0 { min-width: 0; }
a { text-underline-offset: 3px; }
::selection { background: var(--mint-100); }

/* ---------- Buttons & form controls ---------- */
.btn { font-weight: 600; border-radius: 12px; padding: .6rem 1.1rem; }
.btn-lg { padding: .85rem 1.4rem; font-size: 1rem; border-radius: 14px; }
.btn-sm { padding: .35rem .7rem; border-radius: 9px; font-size: .82rem; }
.btn i { margin-right: .15rem; }
.btn-brand { background: var(--navy-600); border-color: var(--navy-600); color: #fff; box-shadow: 0 6px 16px rgba(56, 69, 122, .25); }
.btn-brand:hover, .btn-brand:focus-visible { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.btn-primary { --bs-btn-bg: var(--navy-600); --bs-btn-border-color: var(--navy-600); --bs-btn-hover-bg: var(--navy-800); --bs-btn-hover-border-color: var(--navy-800); --bs-btn-active-bg: var(--navy-900); }
.btn-outline-primary { --bs-btn-color: var(--navy-600); --bs-btn-border-color: #c9cfe3; --bs-btn-hover-bg: var(--navy-600); --bs-btn-hover-border-color: var(--navy-600); --bs-btn-active-bg: var(--navy-700); }
.btn-success { --bs-btn-bg: var(--success); --bs-btn-border-color: var(--success); --bs-btn-hover-bg: #237764; --bs-btn-hover-border-color: #237764; --bs-btn-active-bg: #1d6555; box-shadow: 0 6px 16px rgba(42, 140, 118, .25); }
.btn-outline-secondary { --bs-btn-color: var(--muted); --bs-btn-border-color: var(--line); --bs-btn-hover-bg: var(--navy-50); --bs-btn-hover-color: var(--ink); --bs-btn-hover-border-color: #cfd4e2; }
.btn-glass { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.25); backdrop-filter: blur(6px); }
.btn-glass:hover { background: rgba(255,255,255,.22); color: #fff; }
.btn-icon { width: 40px; height: 40px; display: inline-grid; place-items: center; padding: 0; border-radius: 12px; color: var(--muted); border: 1px solid var(--line); background: var(--surface); }
.btn-icon:hover { color: var(--ink); background: var(--navy-50); }

.form-control, .form-select { border-radius: 12px; border-color: #d9dde8; padding: .65rem .9rem; }
.form-control-lg { border-radius: 14px; }
.form-control:focus, .form-select:focus { border-color: var(--mint-500); box-shadow: 0 0 0 4px rgba(95, 179, 159, .2); }
.form-label { font-weight: 600; font-size: .9rem; margin-bottom: .4rem; }
.form-text { color: var(--muted); }
.form-check-input:checked { background-color: var(--success); border-color: var(--success); }
.form-check-input:focus { box-shadow: 0 0 0 4px rgba(95, 179, 159, .2); border-color: var(--mint-500); }

.alert { border: 0; border-radius: var(--radius-sm); }
.alert-success { background: var(--success-bg); color: #1d5f50; }
.alert-danger { background: var(--danger-bg); color: #8c2a25; }
.alert-warning { background: var(--warning-bg); color: #7a5112; }
.alert-info, .alert-primary { background: var(--info-bg); color: var(--navy-800); }
.alert-light { background: var(--surface); }
.flash-stack { padding-top: 1.25rem; }
.flash-stack .alert { box-shadow: var(--shadow-sm); }

.badge { font-weight: 600; border-radius: 8px; padding: .38em .6em; }
.text-bg-success { background: var(--success-bg) !important; color: #1d5f50 !important; }
.text-bg-warning { background: var(--warning-bg) !important; color: #855a14 !important; }
.text-bg-danger { background: var(--danger-bg) !important; color: #9b2f29 !important; }
.text-bg-secondary { background: #eceef4 !important; color: #4d546c !important; }
.text-bg-info { background: var(--info-bg) !important; color: var(--navy-700) !important; }

/* ---------- Brand ---------- */
.brand-logo { width: 46px; height: 46px; object-fit: contain; background: #fff; border-radius: 50%; padding: 3px; box-shadow: 0 2px 8px rgba(0,0,0,.15); flex-shrink: 0; }
.brand-logo.sm { width: 30px; height: 30px; padding: 2px; box-shadow: none; }

/* ---------- Public: navigation & hero ---------- */
.site-nav { position: absolute; inset: 0 0 auto 0; z-index: 10; padding: 1rem 0; }
.site-brand { display: flex; align-items: center; gap: .75rem; color: #fff; text-decoration: none; }
.site-brand small { color: rgba(255,255,255,.7); font-size: .78rem; }
.site-brand:hover { color: #fff; }

.hero-band {
  position: relative; overflow: hidden; color: #fff;
  padding: 7.5rem 0 5.5rem;
  background:
    radial-gradient(900px 400px at 85% -10%, rgba(140, 200, 184, .35), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgba(95, 179, 159, .25), transparent 60%),
    linear-gradient(135deg, var(--navy-900) 0%, var(--navy-700) 55%, var(--navy-600) 100%);
}
.hero-band::after {
  content: ""; position: absolute; inset: 0; opacity: .07; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.6) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.6) 1px, transparent 1px);
  background-size: 44px 44px; -webkit-mask-image: linear-gradient(180deg, #000, transparent 85%); mask-image: linear-gradient(180deg, #000, transparent 85%);
}
.hero-band .container { position: relative; z-index: 1; }
.eyebrow { display: inline-flex; gap: .45rem; align-items: center; font-size: .8rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--mint-400); background: rgba(140, 200, 184, .12); border: 1px solid rgba(140, 200, 184, .3); padding: .35rem .75rem; border-radius: 999px; }
.hero-title { color: #fff; font-size: clamp(2.1rem, 4.5vw, 3.4rem); font-weight: 800; line-height: 1.08; letter-spacing: -.025em; margin: 1.1rem 0 1rem; }
.hero-lead { font-size: 1.1rem; color: rgba(255,255,255,.8); max-width: 34rem; }
.hero-steps { list-style: none; padding: 0; margin: 1.75rem 0 0; display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; }
.hero-steps li { display: flex; align-items: center; gap: .55rem; color: rgba(255,255,255,.85); font-size: .92rem; font-weight: 500; }
.hero-steps span { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font-size: .78rem; font-weight: 700; background: var(--mint-400); color: var(--navy-900); }

.search-card { background: var(--surface); color: var(--ink); border-radius: 22px; padding: 1.75rem; box-shadow: var(--shadow-lg); max-width: 480px; margin-left: auto; }
.search-card-head { display: flex; align-items: center; gap: .9rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.search-logo { width: 54px; height: 54px; object-fit: contain; }
.search-field { position: relative; }
.search-field > i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 1.15rem; z-index: 2; }
.search-field .form-control { padding-left: 2.8rem; font-weight: 600; letter-spacing: .02em; }
@media (max-width: 991.98px) { .search-card { margin: 0 auto; } }

.page-body { padding-top: 2.5rem; padding-bottom: 3rem; }

/* ---------- Public: results ---------- */
.notice { display: flex; gap: .9rem; align-items: flex-start; padding: 1rem 1.25rem; border-radius: var(--radius-sm); margin-bottom: 1.5rem; }
.notice > i { font-size: 1.3rem; line-height: 1.2; }
.notice-success { background: var(--success-bg); color: #1d5f50; }
.notice-danger { background: var(--danger-bg); color: #8c2a25; }

.student-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.student-head h2 { font-size: 1.6rem; }
.student-head .text-secondary i { color: var(--mint-500); }
.avatar-lg { width: 58px; height: 58px; border-radius: 18px; display: inline-grid; place-items: center; font-size: 1.5rem; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--navy-600), var(--mint-500)); flex-shrink: 0; }

.project-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); height: 100%; padding: 1.5rem; position: relative; overflow: hidden; }
.project-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--line); }
.project-card.tone-success::before { background: var(--success); }
.project-card.tone-primary::before { background: linear-gradient(90deg, var(--navy-600), var(--mint-500)); }
.project-card.tone-warning::before { background: #e2a93b; }
.project-card.tone-info::before { background: var(--info); }
.project-card.tone-danger::before { background: var(--danger); }
.pc-head { display: flex; align-items: flex-start; gap: .9rem; margin-bottom: 1.4rem; }
.pc-index { font-weight: 800; font-size: .85rem; color: var(--navy-600); background: var(--navy-50); border-radius: 10px; padding: .45rem .55rem; line-height: 1; }
.pc-course { font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--mint-500); }
.pc-title { font-size: 1.12rem; font-weight: 700; line-height: 1.3; margin-top: .15rem; }

.mode-pill { display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; font-size: .78rem; font-weight: 700; padding: .35rem .7rem; border-radius: 999px; }
.mode-pill.sm { font-size: .72rem; padding: .25rem .55rem; }
.mode-pill.online { background: var(--mint-100); color: #2b7a67; }
.mode-pill.physical { background: var(--navy-100); color: var(--navy-700); }

.stepper { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); position: relative; }
.step { display: flex; flex-direction: column; align-items: center; text-align: center; position: relative; padding: 0 .2rem; }
.step:not(:last-child)::after { content: ""; position: absolute; top: 15px; left: calc(50% + 18px); right: calc(-50% + 18px); height: 2px; background: var(--line); }
.step.done:not(:last-child)::after { background: var(--success); }
.step-dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: .85rem; background: #f0f2f7; color: #a3a9bd; border: 2px solid var(--line); position: relative; z-index: 1; }
.step.done .step-dot { background: var(--success); border-color: var(--success); color: #fff; }
.step.current .step-dot { background: #fff; border-color: var(--navy-600); color: var(--navy-600); box-shadow: 0 0 0 4px rgba(56, 69, 122, .12); }
.step.blocked .step-dot { background: var(--danger-bg); border-color: #f3c2bf; color: var(--danger); }
.step.todo .step-dot i { font-size: .45rem; }
.step-label { font-size: .74rem; font-weight: 700; margin-top: .45rem; color: var(--ink); }
.step-sub { font-size: .7rem; color: var(--muted); line-height: 1.25; }
.step.blocked .step-sub { color: var(--danger); }

.date-tile { display: flex; align-items: center; gap: 1rem; padding: 1rem; border-radius: 14px; background: var(--navy-50); border: 1px solid var(--navy-100); margin-bottom: 1rem; }
.date-tile.confirmed { background: var(--success-bg); border-color: #c3e3da; }
.date-cal { width: 62px; flex-shrink: 0; border-radius: 12px; overflow: hidden; background: #fff; box-shadow: var(--shadow-sm); text-align: center; border: 1px solid var(--line); }
.date-cal .m { display: block; background: var(--navy-600); color: #fff; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: .2rem 0; }
.date-cal .d { display: block; font-size: 1.6rem; font-weight: 800; color: var(--ink); line-height: 1.4; }
.date-tile.confirmed .date-cal .m { background: var(--success); }
.date-day { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.date-full { font-size: 1.15rem; font-weight: 800; }
.confirmed-stamp { color: var(--success); font-weight: 700; font-size: .85rem; white-space: nowrap; }

.pc-message { display: flex; gap: .75rem; align-items: flex-start; padding: .85rem 1rem; border-radius: 12px; font-size: .92rem; }
.pc-message > i { font-size: 1.1rem; line-height: 1.3; }
.pc-message.tone-success { background: var(--success-bg); color: #1d5f50; }
.pc-message.tone-primary { background: var(--navy-50); color: var(--navy-800); }
.pc-message.tone-warning { background: var(--warning-bg); color: #7a5112; }
.pc-message.tone-info { background: var(--info-bg); color: var(--navy-800); }
.pc-message.tone-danger { background: var(--danger-bg); color: #8c2a25; }
.pc-message a { color: inherit; font-weight: 700; }

.confirm-box { margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px dashed var(--line); }
.confirm-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: .6rem; }
.mode-options { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.mode-option { display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem; border-radius: 14px; border: 2px solid var(--line); cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; background: #fff; margin: 0; }
.mode-option > i:first-child { font-size: 1.4rem; color: var(--navy-600); }
.mode-option span { display: flex; flex-direction: column; line-height: 1.25; flex: 1; }
.mode-option small { color: var(--muted); font-size: .78rem; }
.mode-option .tick { color: var(--success); opacity: 0; transition: opacity .15s; }
.mode-option:hover { border-color: #c9cfe3; }
.btn-check:checked + .mode-option { border-color: var(--success); background: var(--success-bg); box-shadow: 0 0 0 4px rgba(42, 140, 118, .12); }
.btn-check:checked + .mode-option .tick { opacity: 1; }
.btn-check:focus-visible + .mode-option { box-shadow: 0 0 0 4px rgba(95, 179, 159, .3); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.panel-head { padding: 1rem 1.25rem; font-weight: 700; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: .5rem; }
.panel-head i { color: var(--mint-500); }
.panel-body { padding: 1.5rem; }
.claim-list { list-style: none; margin: 0; padding: 0; }
.claim-list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.claim-list li:last-child { border-bottom: 0; }
.status-chip { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 600; padding: .35rem .7rem; border-radius: 999px; }
.status-chip.warning { background: var(--warning-bg); color: #855a14; }
.status-chip.danger { background: var(--danger-bg); color: #9b2f29; }

.empty-state { text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 2.5rem 1.5rem; box-shadow: var(--shadow); max-width: 720px; margin: 0 auto; }
.empty-state h2 { font-size: 1.25rem; margin: 0 auto .6rem; max-width: 30rem; }
.empty-icon { width: 64px; height: 64px; border-radius: 20px; display: inline-grid; place-items: center; font-size: 1.6rem; background: var(--danger-bg); color: var(--danger); }

.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; }
.info-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow-sm); }
.info-card h3 { font-size: 1.1rem; margin: 1rem 0 .4rem; }
.info-card p { color: var(--muted); margin: 0; }
.info-icon { width: 48px; height: 48px; border-radius: 14px; display: inline-grid; place-items: center; font-size: 1.35rem; flex-shrink: 0; }
.info-icon.physical { background: var(--navy-100); color: var(--navy-600); }
.info-icon.online { background: var(--mint-100); color: #2b7a67; }
.info-icon.help { background: var(--warning-bg); color: var(--warning); }

.claim-panel { scroll-margin-top: 1rem; }
.claim-intro { display: flex; gap: 1rem; align-items: flex-start; padding: 1.5rem; background: linear-gradient(135deg, var(--navy-50), #fff); border-bottom: 1px solid var(--line); }
.claim-intro h2 { font-size: 1.3rem; margin-bottom: .3rem; }
.claim-intro p { color: var(--muted); }
.form-section { font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mint-500); display: flex; align-items: center; gap: .75rem; }
.form-section::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: 1.75rem 1rem; border: 2px dashed #cfd4e2; border-radius: 14px; background: var(--navy-50); cursor: pointer; text-align: center; transition: border-color .15s, background .15s; width: 100%; font-weight: 600; }
.dropzone i { font-size: 1.8rem; color: var(--navy-600); }
.dropzone small { color: var(--muted); font-weight: 500; }
.dropzone:hover { border-color: var(--mint-500); background: var(--mint-100); }
.dropzone.has-file { border-style: solid; border-color: var(--success); background: var(--success-bg); }
.dropzone.is-invalid { border-color: var(--danger); background: var(--danger-bg); }

.days-section { margin-top: 3rem; scroll-margin-top: 1rem; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 1.25rem; }
.section-head h2 { font-size: 1.5rem; margin-bottom: .2rem; }
.day-card { display: flex; gap: 1rem; align-items: flex-start; height: 100%; padding: 1.1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: inherit; text-decoration: none; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s, border-color .15s; }
.day-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #cfd4e2; color: inherit; }
.day-card.active { border: 2px solid var(--navy-600); box-shadow: 0 0 0 4px rgba(56, 69, 122, .1); }
.day-card.mine .date-cal .m { background: var(--success); }
.day-name { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.day-course { font-weight: 700; line-height: 1.3; margin: .15rem 0 .5rem; }
.day-meta { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; font-size: .82rem; }
.mine-flag { margin-top: .5rem; font-size: .78rem; font-weight: 700; color: var(--success); }
#roster { scroll-margin-top: 1rem; }
.roster-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, var(--navy-50), #fff); }
.roster-head h3 { font-size: 1.25rem; }
.count-badge { display: inline-flex; align-items: center; gap: .4rem; background: var(--navy-600); color: #fff; font-weight: 700; font-size: .85rem; padding: .45rem .85rem; border-radius: 999px; }
.roster-table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; background: #fafbfd; padding: .8rem 1.5rem; }
.roster-table td { padding: .8rem 1.5rem; border-color: var(--line); }
.roster-table tr.is-me td { background: var(--success-bg); }
.you-tag { font-size: .7rem; font-weight: 700; background: var(--success); color: #fff; padding: .15rem .5rem; border-radius: 999px; margin-left: .35rem; vertical-align: middle; }

.site-footer { background: var(--navy-900); color: rgba(255,255,255,.7); padding: 1.75rem 0; font-size: .88rem; margin-top: auto; }

/* ---------- Admin: shell ---------- */
body.has-shell { display: block; }
.admin-shell { display: flex; min-height: 100vh; }
.sidebar { width: 264px; flex-shrink: 0; background: var(--navy-900); color: rgba(255,255,255,.75); }
@media (min-width: 992px) { .sidebar { position: sticky; top: 0; height: 100vh; } }
.sidebar.offcanvas-lg { --bs-offcanvas-width: 280px; --bs-offcanvas-bg: var(--navy-900); }
.sidebar-inner { display: flex; flex-direction: column; height: 100%; padding: 1.25rem 1rem; overflow-y: auto; position: relative; width: 100%; }
.sidebar-brand { display: flex; align-items: center; gap: .75rem; color: #fff; text-decoration: none; padding: .25rem .5rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: .5rem; }
.sidebar-brand small { color: rgba(255,255,255,.55); font-size: .75rem; }
.sidebar-brand:hover { color: #fff; }
.sidebar-nav { flex: 1; }
.nav-group { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: rgba(255,255,255,.4); padding: 1rem .75rem .4rem; }
.sidebar-link { display: flex; align-items: center; gap: .75rem; padding: .62rem .75rem; border-radius: 10px; color: rgba(255,255,255,.75); text-decoration: none; font-weight: 500; font-size: .92rem; margin-bottom: 2px; transition: background .15s, color .15s; }
.sidebar-link i { font-size: 1.05rem; width: 20px; text-align: center; }
.sidebar-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar-link.active { background: rgba(140, 200, 184, .16); color: #fff; }
.sidebar-link.active i { color: var(--mint-400); }
.sidebar-foot { border-top: 1px solid rgba(255,255,255,.08); padding-top: 1rem; margin-top: 1rem; }
.user-chip { display: flex; align-items: center; gap: .65rem; background: rgba(255,255,255,.06); border-radius: 12px; padding: .6rem .75rem; color: #fff; }
.user-chip .avatar { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--mint-400); color: var(--navy-900); font-weight: 800; flex-shrink: 0; }
.sidebar-public { display: block; color: rgba(255,255,255,.55); text-decoration: none; padding: .75rem .5rem 0; }
.sidebar-public:hover { color: #fff; }

.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .75rem; padding: .85rem 1.5rem; background: rgba(245, 247, 251, .88); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-title { font-weight: 700; font-size: 1.05rem; flex: 1; }
.topbar-search { align-items: center; gap: .5rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 .85rem; width: 320px; }
.topbar-search:focus-within { border-color: var(--mint-500); box-shadow: 0 0 0 4px rgba(95, 179, 159, .2); }
.topbar-search i { color: var(--muted); }
.topbar-search input { border: 0; outline: 0; padding: .55rem 0; width: 100%; background: transparent; font-size: .9rem; }
.topbar .dot { position: absolute; top: 8px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); border: 2px solid #fff; }
.admin-content { padding: 1.75rem 1.5rem 3rem; flex: 1; }
@media (min-width: 1200px) { .admin-content { padding: 2rem 2.25rem 3rem; } }
body.admin .flash-stack { padding-top: 0; margin-bottom: 1rem; }

/* Admin: content components */
.admin .card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.admin .card-header { background: var(--surface); border-bottom: 1px solid var(--line); padding: .95rem 1.25rem; }
.admin .card-footer { background: #fafbfd; border-top: 1px solid var(--line); }
.admin .card-body { padding: 1.25rem; }
.admin h1.h3 { font-weight: 800; letter-spacing: -.02em; }
.admin .table { font-size: .88rem; margin-bottom: 0; --bs-table-hover-bg: #f7f8fc; }
.admin .table > thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; background: #fafbfd; border-bottom: 1px solid var(--line); padding: .75rem 1rem; white-space: nowrap; }
.admin .table > tbody td { padding: .75rem 1rem; border-color: #eef0f5; vertical-align: middle; }
.admin .table-light { --bs-table-bg: #fafbfd; }
.admin .list-group-item { border-color: var(--line); padding: .85rem 1.25rem; }
.admin .btn-group .btn { border-radius: 10px !important; margin-left: 4px; }
.admin .status-list { display: grid; grid-template-columns: max-content 1fr; gap: .6rem 1.25rem; }
.admin .status-list dt { font-weight: 600; color: var(--muted); font-size: .88rem; }
.admin .status-list dd { margin: 0; }
.title-cell { max-width: 170px; }
@media (min-width: 1600px) { .title-cell { max-width: 280px; } }

.stat-card { display: block; text-decoration: none; border: 1px solid var(--line) !important; border-radius: var(--radius) !important; box-shadow: var(--shadow-sm) !important; transition: transform .15s, box-shadow .15s; color: inherit; background: var(--surface); }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow) !important; color: inherit; }
.stat-card .card-body { display: flex; gap: 1rem; align-items: flex-start; }
.stat-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem; flex-shrink: 0; }
.stat-icon.navy { background: var(--navy-100); color: var(--navy-600); }
.stat-icon.mint { background: var(--mint-100); color: #2b7a67; }
.stat-icon.amber { background: var(--warning-bg); color: var(--warning); }
.stat-icon.green { background: var(--mint-100); color: var(--success); }
.stat-icon.red { background: var(--danger-bg); color: var(--danger); }
.stat-icon.blue { background: var(--navy-100); color: var(--navy-600); }
.stat-value { font-size: 1.85rem; font-weight: 800; line-height: 1.05; color: var(--ink); letter-spacing: -.02em; }
.stat-label { color: var(--muted); font-size: .82rem; font-weight: 600; }
.stat-sub { color: var(--muted); font-size: .78rem; }

.load-bar { height: 8px; background: #eceef4; border-radius: 99px; overflow: hidden; min-width: 80px; }
.load-bar > span { display: block; height: 100%; background: var(--navy-600); }
.load-bar > span.manual { background: var(--mint-500); }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .3rem; vertical-align: middle; }

.sticky-actions { position: sticky; bottom: 0; background: #fff; z-index: 5; }
.receipt-preview { max-height: 420px; object-fit: contain; background: var(--navy-50); }
.reset-option { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.reset-option:has(input:checked) { border-color: var(--navy-600) !important; box-shadow: 0 0 0 4px rgba(56, 69, 122, .1) !important; }
.reset-option.border-danger:has(input:checked) { border-color: var(--danger) !important; box-shadow: 0 0 0 4px rgba(194, 65, 59, .12) !important; }
.modal-content { border: 0; border-radius: 20px; box-shadow: var(--shadow-lg); }
.modal-header, .modal-footer { border-color: var(--line); }

/* ---------- Auth (sign in / setup) ---------- */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
@media (min-width: 992px) { .auth-page { grid-template-columns: 1.1fr 1fr; } }
.auth-aside { display: none; position: relative; overflow: hidden; color: #fff; padding: 3rem; background: radial-gradient(700px 400px at 100% 0%, rgba(140, 200, 184, .35), transparent 60%), linear-gradient(135deg, var(--navy-900), var(--navy-600)); }
@media (min-width: 992px) { .auth-aside { display: flex; flex-direction: column; justify-content: space-between; } }
.auth-aside h2 { color: #fff; font-size: 2.2rem; font-weight: 800; letter-spacing: -.02em; max-width: 26rem; }
.auth-aside p { color: rgba(255,255,255,.75); max-width: 28rem; }
.auth-aside .crest { width: 120px; height: 120px; background: #fff; border-radius: 50%; padding: 8px; box-shadow: var(--shadow-lg); }
.auth-form-wrap { display: flex; align-items: center; justify-content: center; padding: 2.5rem 1.25rem; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .brand-logo { width: 64px; height: 64px; }
.auth-card h1 { font-size: 1.7rem; font-weight: 800; margin: 1.25rem 0 .35rem; }
body.admin:not(.has-shell) .flash-stack { position: fixed; top: 1rem; right: 1rem; z-index: 50; max-width: 420px; }

/* ---------- Print ---------- */
@media print {
  .sidebar, .topbar, .no-print, .site-footer, .site-nav { display: none !important; }
  body, .admin-content { background: #fff; padding: 0; }
  .card, .panel { box-shadow: none !important; border: 0 !important; }
}

/* ---------- Small screens ---------- */
@media (max-width: 575.98px) {
  .hero-band { padding: 6.5rem 0 3.5rem; }
  .search-card { padding: 1.25rem; border-radius: 18px; }
  .project-card { padding: 1.15rem; }
  .pc-head { flex-wrap: wrap; }
  .stepper { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .step-sub { display: none; }
  .step:not(:last-child)::after { left: calc(50% + 15px); right: calc(-50% + 15px); }
  .step-dot { width: 28px; height: 28px; }
  .mode-options { grid-template-columns: 1fr; }
  .site-brand .d-block { font-size: .85rem; }
  .admin-content { padding: 1.25rem 1rem 2.5rem; }
}

/* Banner shrinks once a student has searched, so their results come first */
.hero-band.compact { padding: 6.25rem 0 2.5rem; }
.hero-band.compact .hero-title { font-size: clamp(1.7rem, 3vw, 2.3rem); margin: .8rem 0 .5rem; }
.hero-band.compact .hero-lead, .hero-band.compact .hero-steps, .hero-band.compact .search-card-head { display: none; }
.hero-band.compact .search-card label { margin-top: 0 !important; }
.hero-band.compact .search-card { padding: 1.25rem 1.5rem; }

/* ==========================================================================
   Motion — subtle and purposeful; disabled for people who prefer less motion
   ========================================================================== */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.12); } 100% { transform: scale(1); opacity: 1; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes drift { 0%, 100% { background-position: 0% 0%, 100% 100%, 0 0; } 50% { background-position: 10% 6%, 92% 96%, 0 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slide-down { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

.hero-band { background-size: 140% 140%, 140% 140%, 100% 100%; animation: drift 18s ease-in-out infinite; }
.hero-band .col-lg-6:first-child > * { animation: rise .6s cubic-bezier(.2, .7, .2, 1) both; }
.hero-band .col-lg-6:first-child > :nth-child(2) { animation-delay: .06s; }
.hero-band .col-lg-6:first-child > :nth-child(3) { animation-delay: .12s; }
.hero-band .col-lg-6:first-child > :nth-child(4) { animation-delay: .18s; }
.search-card { animation: rise .7s .15s cubic-bezier(.2, .7, .2, 1) both; }

.student-head, .empty-state, .panel, .info-card, .section-head { animation: rise .55s cubic-bezier(.2, .7, .2, 1) both; }
.info-card:nth-child(2) { animation-delay: .08s; }
.info-card:nth-child(3) { animation-delay: .16s; }
#results .row > div { animation: rise .55s cubic-bezier(.2, .7, .2, 1) both; }
#results .row > div:nth-child(2) { animation-delay: .1s; }
#results .row > div:nth-child(3) { animation-delay: .2s; }
.days-section .row > div { animation: rise .45s cubic-bezier(.2, .7, .2, 1) both; }
.days-section .row > div:nth-child(2) { animation-delay: .04s; }
.days-section .row > div:nth-child(3) { animation-delay: .08s; }
.days-section .row > div:nth-child(4) { animation-delay: .12s; }
.days-section .row > div:nth-child(5) { animation-delay: .16s; }
.days-section .row > div:nth-child(6) { animation-delay: .2s; }
.days-section .row > div:nth-child(n+7) { animation-delay: .24s; }

/* Progress tracker fills in step by step */
.step.done .step-dot { animation: pop .45s cubic-bezier(.2, .7, .2, 1) both; }
.step:nth-child(2) .step-dot { animation-delay: .12s; }
.step:nth-child(3) .step-dot { animation-delay: .24s; }
.step:nth-child(4) .step-dot { animation-delay: .36s; }
.step:nth-child(5) .step-dot { animation-delay: .48s; }
.step.done:not(:last-child)::after { transform-origin: left; animation: grow .4s ease-out both; }
.step:nth-child(1)::after { animation-delay: .1s; }
.step:nth-child(2)::after { animation-delay: .22s; }
.step:nth-child(3)::after { animation-delay: .34s; }
.step:nth-child(4)::after { animation-delay: .46s; }
.step.current .step-dot { animation: fade .3s .3s both; }
.confirmed-stamp i { display: inline-block; animation: pop .5s .55s cubic-bezier(.2, .7, .2, 1) both; }

/* Hover and press feedback */
.btn { transition: transform .12s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease, color .15s ease; }
.btn:not(:disabled):hover { transform: translateY(-1px); }
.btn:not(:disabled):active { transform: translateY(0) scale(.98); }
.project-card, .info-card { transition: box-shadow .2s ease, transform .2s ease; }
.project-card:hover, .info-card:hover { box-shadow: 0 1px 3px rgba(20, 26, 51, .06), 0 14px 34px rgba(20, 26, 51, .09); }
.info-card:hover { transform: translateY(-2px); }
.mode-option { transition: border-color .15s, background .15s, box-shadow .15s, transform .12s; }
.mode-option:active { transform: scale(.98); }
.sidebar-link { transition: background .15s, color .15s, padding-left .15s; }
.sidebar-link:hover { padding-left: 1rem; }
.flash-stack .alert { animation: slide-down .35s ease-out both; }
.admin-content > * { animation: fade .35s ease-out both; }
.modal.fade .modal-dialog { transition: transform .25s cubic-bezier(.2, .7, .2, 1); }

/* Buttons show a spinner while their form submits */
.btn.is-loading { pointer-events: none; opacity: .85; }
.btn.is-loading i { display: none; }
.btn.is-loading::before { content: ""; display: inline-block; width: 1em; height: 1em; margin-right: .5rem; vertical-align: -.15em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
html { scroll-behavior: smooth; }

/* Bootstrap makes .offcanvas-lg transparent on large screens, so the sidebar colour lives on its inner layer */
.sidebar-inner { background: var(--navy-900); min-height: 100vh; }
@media (min-width: 992px) { .sidebar-inner { height: 100vh; } }

/* ---------- Receipt check (OCR) on the payment form ---------- */
.receipt-check { margin-top: 1rem; border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.15rem; background: var(--surface); animation: rise .35s ease-out both; }
.rc-head { display: flex; align-items: center; gap: .8rem; }
.rc-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--navy-100); color: var(--navy-600); font-size: 1.15rem; flex-shrink: 0; }
.receipt-check.is-busy .rc-icon i { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.rc-title { font-weight: 700; }
.rc-sub { font-size: .85rem; color: var(--muted); }
.rc-progress { height: 4px; background: #eceef4; border-radius: 99px; overflow: hidden; margin: .85rem 0 .25rem; }
.rc-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--navy-600), var(--mint-500)); transition: width .3s ease; }
.rc-steps { list-style: none; padding: 0; margin: .6rem 0 0; display: grid; gap: .45rem; }
.rc-steps li { display: flex; align-items: flex-start; gap: .6rem; font-size: .88rem; color: var(--muted); }
.rc-steps li i { width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; margin-top: 1px; border: 2px solid var(--line); display: grid; place-items: center; font-style: normal; font-size: .7rem; }
.rc-steps li.is-active { color: var(--ink); }
.rc-steps li.is-active i { border-color: var(--navy-600); border-right-color: transparent; animation: spin .8s linear infinite; }
.rc-steps li.is-done { color: var(--ink); }
.rc-steps li.is-done i { background: var(--success); border-color: var(--success); animation: pop .35s ease-out both; }
.rc-steps li.is-done i::before { content: "✓"; color: #fff; font-weight: 700; }
.rc-steps li.is-fail { color: var(--danger); font-weight: 600; }
.rc-steps li.is-fail i { background: var(--danger); border-color: var(--danger); }
.rc-steps li.is-fail i::before { content: "✕"; color: #fff; font-weight: 700; }
.rc-steps li.is-warn i { background: var(--warning-bg); border-color: #e2a93b; }
.rc-steps li.is-warn i::before { content: "!"; color: var(--warning); font-weight: 800; }
.rc-steps li.is-skip i { border-style: dashed; }
.rc-message { margin-top: .85rem; padding: .75rem .95rem; border-radius: 10px; font-size: .9rem; animation: rise .3s ease-out both; }
.rc-message.tone-success { background: var(--success-bg); color: #1d5f50; }
.rc-message.tone-info { background: var(--navy-50); color: var(--navy-800); }
.rc-message.tone-warning { background: var(--warning-bg); color: #7a5112; }
.rc-message.tone-danger { background: var(--danger-bg); color: #8c2a25; }
@keyframes nudge { 0%, 100% { transform: none; } 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.rc-message.rc-attention { animation: nudge .4s ease-in-out; box-shadow: 0 0 0 3px rgba(226, 169, 59, .35); }

/* ---------- Presentation calendar & countdown ---------- */
.countdown { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 1.5rem 1.75rem; margin-bottom: 1.5rem; border-radius: var(--radius); color: #fff; position: relative; overflow: hidden;
  background: radial-gradient(500px 220px at 100% 0%, rgba(140, 200, 184, .35), transparent 60%), linear-gradient(135deg, var(--navy-900), var(--navy-600)); box-shadow: var(--shadow); animation: rise .5s cubic-bezier(.2, .7, .2, 1) both; }
.countdown-label { font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mint-400); }
.countdown-date { font-size: 1.45rem; font-weight: 800; margin: .15rem 0; }
.countdown-meta { font-size: .88rem; color: rgba(255,255,255,.75); }
.countdown-clock { display: flex; gap: .6rem; }
.cd-unit { min-width: 64px; text-align: center; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15); border-radius: 14px; padding: .55rem .5rem; }
.cd-unit span { display: block; font-size: 1.5rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cd-unit small { display: block; font-size: .68rem; color: rgba(255,255,255,.7); text-transform: uppercase; letter-spacing: .05em; }
.cd-unit.big { min-width: 104px; background: var(--mint-400); border-color: var(--mint-400); color: var(--navy-900); }
.cd-unit.big span { font-size: 2.3rem; }
.cd-unit.big small { color: var(--navy-800); font-weight: 700; }
.cd-unit span.tick { animation: tick .35s ease-out; }
@keyframes tick { from { opacity: .3; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.countdown-today { font-size: 1.2rem; font-weight: 800; color: var(--mint-400); }

.cal-legend { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; font-size: .82rem; color: var(--muted); margin-bottom: .75rem; }
.cal-legend .lg { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: .35rem; vertical-align: -1px; }
.cal-legend .lg.physical { background: var(--navy-600); }
.cal-legend .lg.online { background: var(--mint-500); }
.cal-legend .lg.mine { background: #fff; box-shadow: inset 0 0 0 2px var(--warning); }

.calendar { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; margin-bottom: 1.5rem; animation: rise .5s .1s cubic-bezier(.2, .7, .2, 1) both; }
.cal-title { font-size: 1.15rem; font-weight: 800; margin-bottom: .9rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .45rem; }
.cal-wd { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); text-align: center; padding-bottom: .25rem; }
.cal-cell { min-height: 112px; border-radius: 12px; background: #fafbfd; border: 1px solid #eef0f5; padding: .5rem .55rem; display: flex; flex-direction: column; gap: .15rem; position: relative; color: inherit; text-decoration: none; }
.cal-cell.blank { background: transparent; border-color: transparent; }
.cal-num { font-weight: 700; font-size: .95rem; color: #9aa0b4; }
.cal-cell.today { border: 2px solid var(--navy-600); }
.cal-cell.today .cal-num::after { content: "Today"; margin-left: .35rem; font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--navy-600); }
.cal-cell.event { color: #fff; border: 0; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; box-shadow: var(--shadow-sm); }
.cal-cell.event.physical { background: linear-gradient(160deg, var(--navy-600), var(--navy-800)); }
.cal-cell.event.online { background: linear-gradient(160deg, #6cbca8, #3f9a85); }
.cal-cell.event:hover { transform: translateY(-3px); box-shadow: var(--shadow); color: #fff; }
.cal-cell.event .cal-num { color: #fff; font-size: 1.15rem; }
.cal-course { font-weight: 800; font-size: .9rem; line-height: 1.1; }
.cal-mode, .cal-count { font-size: .72rem; opacity: .9; white-space: nowrap; }
.cal-left { margin-top: auto; font-size: .7rem; font-weight: 700; background: rgba(255,255,255,.18); border-radius: 999px; padding: .1rem .5rem; align-self: flex-start; white-space: nowrap; }
.cal-cell.mine { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--warning); }
.cal-star { position: absolute; top: .5rem; right: .55rem; color: #ffd27a; font-size: .85rem; animation: pop .5s .4s both; }
.cal-cell.active { outline: 3px solid var(--mint-400); outline-offset: 2px; }
.cal-cell.past { opacity: .45; }
.cal-cell.past.event { filter: grayscale(.6); }

@media (max-width: 767.98px) {
  .calendar { padding: .85rem .6rem; }
  .cal-grid { gap: .25rem; }
  .cal-cell { min-height: 64px; padding: .3rem; border-radius: 9px; align-items: center; text-align: center; }
  .cal-num { font-size: .8rem; }
  .cal-cell.event .cal-num { font-size: .95rem; }
  .cal-course { font-size: .62rem; }
  .cal-mode span, .cal-count { display: none; }
  .cal-mode { font-size: .75rem; }
  .cal-left { display: none; }
  .cal-star { top: .2rem; right: .25rem; font-size: .6rem; }
  .cal-cell.today .cal-num::after { display: none; }
  .countdown { padding: 1.25rem; }
  .countdown-clock { width: 100%; }
  .cd-unit { flex: 1; min-width: 0; }
  .cd-unit.big { flex: 1.6; }
}
@media (max-width: 575.98px) {
  .date-tile { flex-wrap: wrap; }
  .date-tile > .flex-grow-1 { flex-basis: 0; min-width: 0; }
  .confirmed-stamp { flex-basis: 100%; padding-left: calc(62px + 1rem); margin-top: -.35rem; }
}

/* ---------- Project reviews ---------- */
.review-toggles { display: inline-flex; gap: .3rem; }
.review-dot { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; font-size: .78rem; font-weight: 700; border: 2px solid var(--line); background: #fff; color: var(--muted); padding: 0; transition: transform .12s, background .15s, border-color .15s; }
button.review-dot:not(:disabled):hover { border-color: var(--success); color: var(--success); transform: scale(1.08); }
.review-dot.done { background: var(--success); border-color: var(--success); color: #fff; }
button.review-dot.done:not(:disabled):hover { background: #237764; color: #fff; }
.review-dot:disabled { opacity: .45; cursor: not-allowed; }
.review-toggles.compact .review-dot { width: 24px; height: 24px; font-size: .7rem; }
tr.not-final td { color: var(--muted); }
.print-only { display: none; }
@media print { .print-only { display: inline; } }

.review-track { border: 1px solid var(--line); border-radius: 14px; padding: .85rem 1rem; margin-bottom: 1rem; background: #fafbfd; }
.review-track.complete { background: var(--success-bg); border-color: #c3e3da; }
.rt-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; }
.rt-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.rt-label i { color: var(--navy-600); }
.rt-count { font-size: .8rem; font-weight: 700; color: var(--navy-700); }
.review-track.complete .rt-count { color: var(--success); }
.rt-steps { list-style: none; padding: 0; margin: 0 0 .6rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.rt-steps li { display: flex; align-items: center; gap: .5rem; padding: .45rem .55rem; border-radius: 10px; background: #fff; border: 1px solid var(--line); }
.rt-dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 700; flex-shrink: 0; background: #f0f2f7; color: #9aa0b4; }
.rt-steps li.done .rt-dot { background: var(--success); color: #fff; animation: pop .4s ease-out both; }
.rt-steps li.next { border-color: var(--navy-600); }
.rt-steps li.next .rt-dot { background: #fff; color: var(--navy-600); box-shadow: inset 0 0 0 2px var(--navy-600); }
.rt-text { font-size: .8rem; font-weight: 700; line-height: 1.15; display: flex; flex-direction: column; }
.rt-text small { font-weight: 500; color: var(--muted); font-size: .7rem; }
.rt-note { font-size: .8rem; color: var(--muted); }
.review-track.complete .rt-note { color: #1d5f50; font-weight: 600; }
.roster-note { display: flex; gap: .5rem; align-items: flex-start; padding: .7rem 1.5rem; font-size: .85rem; color: var(--muted); background: #fafbfd; border-bottom: 1px solid var(--line); }
@media (max-width: 575.98px) { .rt-steps { gap: .3rem; } .rt-steps li { flex-direction: column; text-align: center; gap: .25rem; padding: .4rem .2rem; } }

/* ---------- Secure sign-in & account ---------- */
.password-field { position: relative; }
.password-field .form-control { padding-right: 3rem; }
.btn-reveal { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); width: 36px; height: 36px; border-radius: 10px; }
.btn-reveal:hover { background: var(--navy-50); color: var(--ink); }
.otp-input { letter-spacing: .5em; font-size: 1.4rem; font-weight: 700; }
.btn-signout { border: 0; background: transparent; color: rgba(255,255,255,.75); width: 32px; height: 32px; border-radius: 8px; }
.btn-signout:hover { background: rgba(255,255,255,.12); color: #fff; }
.user-chip-sub { color: rgba(255,255,255,.55); font-size: .7rem; }
.setup-steps { padding-left: 1.1rem; display: grid; gap: 1rem; }
.setup-steps li::marker { font-weight: 800; color: var(--navy-600); }
.qr-wrap { display: inline-block; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 14px; margin: .75rem 0 .5rem; box-shadow: var(--shadow-sm); }
.qr-wrap img, .qr-wrap canvas { display: block; }
.setup-key { display: inline-block; font-size: .95rem; letter-spacing: .08em; padding: .35rem .6rem; margin-top: .25rem; user-select: all; }

/* ==========================================================================
   Admin: readability and tables that always fit the screen
   ========================================================================== */
/* Selects keep room for their arrow (the shared padding above would remove it) */
.form-select { padding-right: 2.4rem; text-overflow: ellipsis; }
.form-select-sm { padding-right: 2rem; }

/* Slightly larger, clearer text throughout the dashboard */
.admin .table { font-size: .92rem; }
.admin .table > thead th { font-size: .74rem; color: #555c76; }
.admin .badge { font-size: .76rem; padding: .4em .65em; }
.admin .small, .admin small { font-size: .85rem; }
.admin .mode-pill.sm { font-size: .76rem; }
.admin .text-secondary { color: #5a6180 !important; }
.stat-label { font-size: .86rem; color: #4d546c; }
.stat-sub { font-size: .8rem; }

/* Dashboard stat cards: as many per row as fit comfortably */
.stat-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 576px) { .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1400px) { .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Segmented filter tabs (Pending / Verified / ...) that wrap instead of overflowing */
.seg-tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.seg-tabs .btn { border: 0; border-radius: 9px !important; margin: 0; box-shadow: none; }
.seg-tabs .btn-outline-secondary { color: var(--muted); background: transparent; }
.seg-tabs .btn-outline-secondary:hover { background: var(--navy-50); color: var(--ink); }

/* Project filters: a grid that reflows without squashing labels */
.filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; align-items: end; }
.filter-grid .form-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.filter-search { grid-column: span 2; }
.filter-buttons { display: flex; gap: .5rem; grid-column: span 2; }
.filter-buttons .btn { flex: 1; }
@media (max-width: 400px) { .filter-search, .filter-buttons { grid-column: 1 / -1; } }

/* Table cells */
.check-col { width: 44px; }
.cell-name { font-size: .98rem; }
.cell-title { font-size: .85rem; color: var(--ink); margin-top: .3rem; max-width: 300px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.status-mini { display: grid; grid-template-columns: max-content auto; gap: .35rem .6rem; align-items: center; margin: 0; white-space: nowrap; }
.status-mini dt { font-weight: 500; font-size: .82rem; color: #5a6180; }
.status-mini dd { margin: 0; }
.action-stack { display: inline-flex; flex-direction: column; align-items: stretch; gap: .4rem; }
.action-stack form { margin: 0; }
.action-stack .btn { width: 100%; white-space: nowrap; }

/* Below a width set per table, each row becomes a card: nothing is cut off or hidden */
.stack-wrap { container-type: inline-size; }
@container (max-width: 940px) {
  .stack-lg thead { display: none; }
  .stack-lg, .stack-lg tbody { display: block; }
  .stack-lg tr { background: var(--surface); display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .9rem 1.25rem; padding: 1rem 1.15rem; border-bottom: 1px solid var(--line); position: relative; }
  .stack-lg td { display: block; padding: 0 !important; border: 0 !important; text-align: left !important; background: transparent !important; box-shadow: none !important; }
  .stack-lg td[data-label]::before { content: attr(data-label); display: block; font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #5a6180; margin-bottom: .3rem; }
  .stack-lg td.cell-main, .stack-lg td.cell-actions, .stack-lg td[colspan] { grid-column: 1 / -1; }
  .stack-lg td.cell-main { padding-right: 2.25rem !important; }
  .stack-lg td.check-col { position: absolute; top: 1rem; right: 1.15rem; width: auto; }
  .stack-lg .action-stack { flex-direction: row; flex-wrap: wrap; }
  .stack-lg .action-stack .btn { width: auto; }
  .stack-lg .cell-title { max-width: none; }
}
@container (max-width: 760px) {
  .stack-md thead { display: none; }
  .stack-md, .stack-md tbody { display: block; }
  .stack-md tr { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem 1.25rem; padding: .9rem 1.15rem; border-bottom: 1px solid var(--line); }
  .stack-md td { display: block; padding: 0 !important; border: 0 !important; text-align: left !important; background: transparent !important; }
  .stack-md td[data-label]::before { content: attr(data-label); display: block; font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #5a6180; margin-bottom: .25rem; }
  .stack-md td.cell-main, .stack-md td.cell-full, .stack-md td.cell-actions, .stack-md td[colspan] { grid-column: 1 / -1; }
  .stack-md td.cell-num { display: none; }
}
@container (max-width: 520px) {
  .stack-sm thead { display: none; }
  .stack-sm, .stack-sm tbody { display: block; }
  .stack-sm tr { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem 1rem; padding: .85rem 1.15rem; border-bottom: 1px solid var(--line); }
  .stack-sm td { display: block; padding: 0 !important; border: 0 !important; }
  .stack-sm td[data-label]::before { content: attr(data-label); display: block; font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #5a6180; margin-bottom: .2rem; }
  .stack-sm td.cell-main, .stack-sm td.cell-full { grid-column: 1 / -1; }
}
@media print { .stack-wrap { container-type: normal; } }

/* The bulk-action bar wraps neatly on narrow screens */
.sticky-actions .form-select { max-width: 100%; }
@media (max-width: 575.98px) { .sticky-actions .form-select, .sticky-actions .btn { width: 100% !important; } }
.schedule-pick { max-width: 320px; }
@media (max-width: 575.98px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
  .stat-card .card-body { flex-direction: column; gap: .6rem; padding: 1rem; }
  .stat-icon { width: 38px; height: 38px; font-size: 1.05rem; }
  .stat-value { font-size: 1.6rem; }
}

/* Student page without decorative icons */
.search-field.no-icon .form-control { padding-left: 1rem; }
.info-card h3 { margin-top: 0; }
.info-card { border-top: 3px solid var(--mint-400); }

/* ==========================================================================
   Admin without icons: text controls, colour accents instead of icon tiles
   ========================================================================== */
.btn-text { font-weight: 600; font-size: .88rem; color: var(--navy-700); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: .5rem .9rem; display: inline-flex; align-items: center; gap: .4rem; }
.btn-text:hover { background: var(--navy-50); color: var(--ink); }
.count-dot { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--danger); color: #fff; font-size: .72rem; font-weight: 700; display: inline-grid; place-items: center; }
.btn-signout { width: auto; height: auto; padding: .35rem .6rem; font-size: .75rem; font-weight: 600; white-space: nowrap; border: 1px solid rgba(255,255,255,.18); }
.btn-reveal { width: auto; height: 32px; padding: 0 .65rem; font-size: .78rem; font-weight: 700; }
.password-field .form-control { padding-right: 4.25rem; }
.topbar-search { padding: 0 1rem; }
.sidebar-link { padding-left: 1rem; position: relative; }
.sidebar-link.active::before { content: ""; position: absolute; left: 0; top: 22%; bottom: 22%; width: 3px; border-radius: 3px; background: var(--mint-400); }

/* Stat cards: a coloured top edge stands in for the old icon */
.stat-card { position: relative; overflow: hidden; }
.stat-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--navy-600); }
.stat-card.tone-green::before, .stat-card.tone-mint::before { background: var(--mint-500); }
.stat-card.tone-amber::before { background: #e0a43a; }
.stat-card.tone-red::before { background: var(--danger); }
.stat-card .card-body { padding-top: 1.35rem; }

/* ==========================================================================
   Pop-ups: confirmation dialog, Assign Day window, notifications
   ========================================================================== */
body.pop-open { overflow: hidden; }
.pop-backdrop { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 1rem;
  background: rgba(20, 26, 51, .45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity .22s ease; }
.pop-backdrop.is-in { opacity: 1; }
.pop-backdrop.is-out { opacity: 0; }
.pop-card { width: 100%; max-width: 420px; background: var(--surface); border-radius: 24px; padding: 2rem 1.75rem 1.5rem; text-align: center;
  box-shadow: 0 30px 80px rgba(20, 26, 51, .35); position: relative; overflow: hidden;
  transform: translateY(18px) scale(.94); transition: transform .3s cubic-bezier(.2, .9, .3, 1.25); }
.pop-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: linear-gradient(90deg, var(--navy-600), var(--mint-400)); }
.pop-card.is-danger::before { background: linear-gradient(90deg, var(--danger), #f0a19c); }
.pop-backdrop.is-in .pop-card { transform: none; }
.pop-backdrop.is-out .pop-card { transform: translateY(10px) scale(.97); }
.pop-mark { width: 64px; height: 64px; margin: 0 auto 1rem; border-radius: 50%; display: grid; place-items: center; background: var(--navy-50); position: relative; }
.pop-mark::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--navy-100); animation: pop-ring 1.6s ease-out infinite; }
.pop-mark span { font-size: 1.9rem; font-weight: 800; color: var(--navy-600); line-height: 1; animation: pop .45s .1s ease-out both; }
.pop-card.is-danger .pop-mark { background: var(--danger-bg); }
.pop-card.is-danger .pop-mark::after { border-color: #f6cfcc; }
.pop-card.is-danger .pop-mark span { color: var(--danger); }
.pop-title { font-size: 1.3rem; font-weight: 800; margin-bottom: .5rem; }
.pop-text { color: var(--muted); margin-bottom: 1.5rem; line-height: 1.55; }
.pop-actions { display: flex; gap: .75rem; }
.pop-actions .btn { flex: 1; padding: .75rem 1rem; }
@keyframes pop-ring { 0% { transform: scale(.9); opacity: 1; } 100% { transform: scale(1.35); opacity: 0; } }

/* Bootstrap modals (Assign Day) */
.modal-backdrop.show { opacity: 1; background: rgba(20, 26, 51, .45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.modal-content { border-radius: 24px; overflow: hidden; box-shadow: 0 30px 80px rgba(20, 26, 51, .35); }
.modal-header { background: linear-gradient(135deg, var(--navy-800), var(--navy-600)); color: #fff; border: 0; padding: 1.25rem 1.5rem; position: relative; }
.modal-header::after { content: ""; position: absolute; inset: auto 0 0 0; height: 3px; background: linear-gradient(90deg, var(--mint-400), transparent); }
.modal-header .modal-title { color: #fff; font-weight: 800; }
.modal-header .btn-close { filter: invert(1) grayscale(1) brightness(2); opacity: .8; }
.modal-body { padding: 1.5rem; }
.modal-footer { background: #fafbfd; padding: 1rem 1.5rem; }
.modal-footer .btn { min-width: 120px; }
.modal.fade .modal-dialog { transform: translateY(24px) scale(.95); transition: transform .32s cubic-bezier(.2, .9, .3, 1.2); }
.modal.show .modal-dialog { transform: none; }
#assignModal .js-student { font-size: 1.1rem; }

/* Notifications (admin) */
body.has-shell .flash-stack { position: fixed; top: 1rem; right: 1rem; z-index: 1900; width: min(420px, calc(100vw - 2rem)); display: flex; flex-direction: column; gap: .6rem; margin: 0; padding: 0; pointer-events: none; }
.alert.toast-note { pointer-events: auto; margin: 0; background: var(--surface); color: var(--ink); border-radius: 16px; padding: 1rem 2.75rem 1.1rem 1.1rem;
  box-shadow: 0 18px 45px rgba(20, 26, 51, .2); border-left: 5px solid var(--success); position: relative; overflow: hidden; animation: toast-in .45s cubic-bezier(.2, .9, .3, 1.2) both; }
.alert.toast-note.alert-danger { border-left-color: var(--danger); }
.alert.toast-note.alert-warning { border-left-color: #e0a43a; }
.alert.toast-note.alert-info { border-left-color: var(--navy-600); }
.alert.toast-note .btn-close { position: absolute; top: .8rem; right: .8rem; padding: .5rem; }
.toast-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--mint-400); transform-origin: left; animation: toast-time 7s linear forwards; }
.alert.toast-note.is-paused .toast-bar { animation-play-state: paused; }
.alert.toast-note.is-leaving { animation: toast-out .4s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateX(40px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(40px); } }
@keyframes toast-time { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) {
  .pop-card, .modal.fade .modal-dialog { transition: none; }
  .pop-mark::after, .toast-bar, .alert.toast-note { animation: none; }
}
.user-chip { flex-wrap: wrap; }
.user-chip > form { width: 100%; }
.btn-signout { width: 100%; padding: .4rem; }
body.has-shell .flash-stack { top: 5rem; }
.modal-body { background: var(--surface); }

/* Sign-in page: one crest, centred on the brand panel (moves above the form on phones) */
.auth-brand { text-align: center; display: flex; flex-direction: column; align-items: center; }
.auth-brand h2 { margin: 1rem auto .75rem; }
.auth-brand p { margin: 0 auto; }
.auth-aside > .small { text-align: center; }
.crest-wrap { position: relative; width: 168px; height: 168px; display: grid; place-items: center; margin-bottom: 1.5rem; animation: rise .6s cubic-bezier(.2, .7, .2, 1) both; }
.crest-wrap::before { content: ""; position: absolute; inset: -18px; border-radius: 50%; background: radial-gradient(circle, rgba(140, 200, 184, .35), transparent 70%); }
.crest-wrap::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid rgba(140, 200, 184, .45); animation: pop-ring 2.8s ease-out infinite; }
.auth-aside .crest { position: relative; z-index: 1; width: 168px; height: 168px; padding: 10px; box-shadow: 0 20px 50px rgba(0, 0, 0, .35); }
.auth-uni { font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--mint-400); }
.auth-card .auth-mobile-logo { width: 84px; height: 84px; padding: 5px; box-shadow: var(--shadow); display: block; margin: 0 auto; }
.auth-card h1 { text-align: center; }
.auth-card > .text-secondary { text-align: center; }
@media (min-width: 992px) { .auth-card .auth-mobile-logo { display: none; } .auth-card h1 { margin-top: 0; } }
@media (prefers-reduced-motion: reduce) { .crest-wrap, .crest-wrap::after { animation: none; } }
.auth-aside > .small { margin-left: auto; margin-right: auto; }

/* ==========================================================================
   Phones: tidy header, hero and forms
   ========================================================================== */
@media (max-width: 575.98px) {
  .site-nav { padding: .75rem 0; }
  .site-brand { gap: .6rem; min-width: 0; }
  .site-brand .brand-logo { width: 40px; height: 40px; }
  .site-brand .lh-sm { min-width: 0; }
  .site-brand .d-block { font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .site-brand small { display: none; }
  .site-nav .btn-glass { white-space: nowrap; flex-shrink: 0; margin-left: .75rem; padding: .4rem .75rem; }
  .hero-band { padding-top: 5.25rem; padding-bottom: 2.75rem; }
  .hero-band.compact { padding-top: 5rem; padding-bottom: 1.75rem; }
  .hero-band .eyebrow { font-size: .7rem; padding: .3rem .65rem; }
  .hero-title { font-size: 2rem; }
  .hero-lead { font-size: 1rem; }
  .search-card-head { display: none; }
  .search-card label { margin-top: 0 !important; }
  .info-grid { gap: .75rem; }
  .info-card { padding: 1.15rem 1.25rem; }
  .claim-panel .btn-lg[type=submit] { width: 100%; }
  .claim-intro { padding: 1.15rem 1.25rem; }
  .student-head h2 { font-size: 1.4rem; }
  .countdown { padding: 1.25rem; }
  .cal-grid .cal-cell { min-height: 54px; }
  .site-footer .container { text-align: center; align-items: center; }
}

/* ---------- Admin: Reviews page ---------- */
.review-search-row { display: flex; gap: .6rem; flex-wrap: wrap; }
.review-search-row .form-control { flex: 1 1 240px; font-weight: 600; letter-spacing: .02em; }
.review-card { border-top: 4px solid var(--danger) !important; }
.review-card.tone-warning { border-top-color: #e0a43a !important; }
.review-card.tone-success { border-top-color: var(--success) !important; }
.review-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.review-course { font-size: .74rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--mint-500); }
.review-title { font-size: 1.05rem; }
.review-state { display: inline-block; font-weight: 700; font-size: .85rem; padding: .45rem .9rem; border-radius: 999px; white-space: nowrap; }
.review-state.sm { font-size: .76rem; padding: .3rem .7rem; }
.review-state.success { background: var(--success-bg); color: #1d5f50; }
.review-state.warning { background: var(--warning-bg); color: #855a14; }
.review-state.danger { background: var(--danger-bg); color: #9b2f29; }
.review-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1rem 1.25rem !important; }
.review-row.is-done { background: #f7fbfa; }
.review-row .review-dot { width: 34px; height: 34px; font-size: .9rem; flex-shrink: 0; }
.review-word { font-size: .76rem; font-weight: 700; margin-left: .4rem; padding: .15rem .55rem; border-radius: 999px; background: #eceef4; color: #4d546c; vertical-align: middle; }
.review-row.is-done .review-word { background: var(--success-bg); color: #1d5f50; }
.review-tick { display: flex; gap: .5rem; flex-wrap: wrap; }
.review-tick .form-control { width: 220px; }
.review-tally { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
.tally-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: .9rem 1rem; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .85rem; display: flex; flex-direction: column; transition: border-color .15s, box-shadow .15s, transform .15s; }
.tally-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); color: var(--ink); }
.tally-card.active { border-color: var(--navy-600); box-shadow: 0 0 0 3px rgba(56, 69, 122, .12); color: var(--ink); }
.tally-num { font-size: 1.6rem; font-weight: 800; color: var(--ink); line-height: 1.1; }
@media (max-width: 575.98px) {
  .review-tally { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review-search-row .btn { flex: 1; }
  .review-tick, .review-tick .form-control { width: 100%; }
  .review-tick .btn { width: 100%; }
}
.pager { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
@media (max-width: 575.98px) {
  .site-brand .d-block { white-space: normal; overflow: visible; line-height: 1.2; font-size: .8rem; }
  .review-toggles.compact .review-dot { width: 32px; height: 32px; font-size: .82rem; }
  .review-toggles { gap: .45rem; }
  .schedule-pick { max-width: none; width: 100% !important; }
  .admin h1.h3 { font-size: 1.45rem; }
  .pager .btn { min-width: 96px; }
}
@media (max-width: 575.98px) {
  .admin .btn-sm { min-height: 38px; padding: .45rem .85rem; }
  .admin .row-check, .admin #selectAll { width: 1.4em; height: 1.4em; }
}

/* ==========================================================================
   Phones, round two: compact cards, bottom tabs, bottom-sheet windows
   ========================================================================== */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(255,255,255,.94); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
  padding: .35rem .35rem calc(.35rem + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px rgba(20, 26, 51, .06); }
.tabbar a { position: relative; display: flex; align-items: center; justify-content: center; gap: .25rem; min-height: 46px; border-radius: 12px; font-size: .78rem; font-weight: 700; color: var(--muted); text-decoration: none; transition: background .15s, color .15s; }
.tabbar a.active { color: var(--navy-800); background: var(--navy-50); }
.tabbar a.active::before { content: ""; position: absolute; top: -.35rem; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--mint-500); }
.tabbar .count-dot { min-width: 17px; height: 17px; font-size: .64rem; padding: 0 4px; }
@media (max-width: 991.98px) {
  body.has-shell .admin-content { padding-bottom: calc(5.5rem + env(safe-area-inset-bottom)); }
  .sticky-actions { bottom: calc(58px + env(safe-area-inset-bottom)); }
  .topbar .btn-text[href="claims.php"] { display: none; }
  .topbar { padding: .7rem 1rem; }
  body.has-shell .flash-stack { top: auto; bottom: calc(5rem + env(safe-area-inset-bottom)); right: .75rem; left: .75rem; width: auto; }
}

/* Label/value lists stack instead of running off the screen */
@media (max-width: 575.98px) {
  .admin .status-list { grid-template-columns: 1fr; gap: .15rem; }
  .admin .status-list dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; margin-top: .6rem; }
  .admin .status-list dt:first-child { margin-top: 0; }
  .admin .status-list dd { min-width: 0; overflow-wrap: anywhere; }
  .admin .status-list dd .badge { white-space: normal; text-align: left; }
  .admin .status-list dd form, .admin .status-list dd .d-flex { flex-wrap: wrap; }
  .admin .status-list .form-select { max-width: 100%; }
  .admin code { overflow-wrap: anywhere; white-space: normal; }
}

/* Stacked table rows: two columns of short facts, full width for the main line and buttons */
@media (max-width: 575.98px) {
  .stack-wrap .table-stack tr { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: .8rem 1rem !important; padding: 1rem !important; }
  .stack-wrap .table-stack td.cell-main, .stack-wrap .table-stack td.cell-full, .stack-wrap .table-stack td.cell-actions, .stack-wrap .table-stack td[colspan] { grid-column: 1 / -1; }
  .stack-wrap .table-stack td[data-label="Status"] .status-mini { white-space: normal; }
  .stack-wrap .table-stack td[data-label="Status"], .stack-wrap .table-stack td[data-label="References"], .stack-wrap .table-stack td[data-label="Details"] { grid-column: 1 / -1; }
  .stack-wrap .table-stack td[data-label]::before { font-size: .68rem; margin-bottom: .2rem; }
  .stack-wrap .table-stack .cell-main a.fw-semibold { font-size: 1.02rem; }
  .stack-wrap .table-stack .cell-actions .action-stack { width: 100%; }
  .stack-wrap .table-stack .cell-actions .btn { flex: 1; }
  .admin .card:has(> .stack-wrap) { border-radius: 18px; }
}

/* Project filters fold away on phones */
@media (max-width: 767.98px) {
  .filters-card:not(.is-open) { display: none; }
  .js-filter-toggle { justify-content: center; min-height: 46px; }
  .js-filter-toggle::after { content: "+"; font-weight: 800; margin-left: .4rem; }
  .js-filter-toggle.is-open::after { content: "–"; }
}

/* Long abstracts fold to a few lines */
.abstract-text.js-fold { max-height: 9.5em; overflow: hidden; position: relative; }
.abstract-text.js-fold::after { content: ""; position: absolute; inset: auto 0 0 0; height: 3em; background: linear-gradient(transparent, var(--surface)); }
.abstract-text.js-fold.is-open { max-height: none; }
.abstract-text.js-fold.is-open::after { display: none; }

/* Assign Day window slides up from the bottom on phones */
@media (max-width: 575.98px) {
  .modal-dialog { margin: 0; position: fixed; left: 0; right: 0; bottom: 0; max-width: none; }
  .modal-content { border-radius: 24px 24px 0 0; max-height: 92vh; }
  .modal-body { overflow-y: auto; }
  .modal.fade .modal-dialog { transform: translateY(100%); transition: transform .35s cubic-bezier(.2, .9, .3, 1); }
  .modal.show .modal-dialog { transform: none; }
  .modal-header::before { content: ""; position: absolute; top: 7px; left: 50%; width: 42px; height: 4px; margin-left: -21px; border-radius: 4px; background: rgba(255,255,255,.45); }
  .modal-footer { padding-bottom: calc(1rem + env(safe-area-inset-bottom)); flex-wrap: nowrap; }
  .modal-footer .btn { flex: 1; min-width: 0; }
  .pop-card { padding: 1.75rem 1.25rem 1.25rem; }
}

/* Headings and page headers on phones */
@media (max-width: 575.98px) {
  .admin .d-flex.flex-wrap.justify-content-between > .seg-tabs { width: 100%; }
  .seg-tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .seg-tabs::-webkit-scrollbar { display: none; }
  .seg-tabs .btn { white-space: nowrap; flex-shrink: 0; }
  .admin form[action="actions.php"] .btn-brand, .admin .d-flex.flex-wrap.gap-2 > form > .btn { white-space: nowrap; }
  .admin-content > .d-flex.flex-wrap.justify-content-between.align-items-end > .d-flex { width: 100%; display: grid !important; grid-template-columns: 1fr 1fr; }
  .admin-content > .d-flex.flex-wrap.justify-content-between.align-items-end > .d-flex .btn { width: 100%; }
}
@media (max-width: 575.98px) {
  .dash-actions { width: 100%; display: grid !important; grid-template-columns: 1fr 1fr; }
  .dash-actions .btn { width: 100%; padding-left: .5rem; padding-right: .5rem; }
  .stack-wrap .table-stack td[data-label="Status"] { order: 5; }
  .stack-wrap .table-stack td.cell-actions { order: 6; }
  .modal-footer .btn { white-space: normal; padding: .7rem .5rem; font-size: .92rem; }
}
@media (max-width: 575.98px) {
  .stack-wrap .table-stack td.cell-main { order: 0; }
  .stack-wrap .table-stack td[data-label="Project"] { order: 1; grid-column: 1 / -1; }
  .stack-wrap .table-stack td[data-label="Student no."] { order: 2; }
  .stack-wrap .table-stack td[data-label="Confirmed"] { order: 3; }
  .stack-wrap .table-stack td[data-label="Reviews"] { order: 4; }
  .stack-wrap .table-stack td[data-label="Reference"] { grid-column: 1 / -1; }
  .stack-wrap .table-stack td.cell-actions > .btn { width: 100%; }
}
@media (max-width: 575.98px) {
  .stack-wrap .table-stack td[data-label="Status"]:not(:has(.status-mini)) { grid-column: auto; order: 2; }
  .stack-wrap .table-stack td[data-label="Paid"] { order: 1; }
  .stack-wrap .table-stack td[data-label="References"] { order: 3; }
}
