:root {
  --mcu-primary: #1e5b8a;
  --mcu-primary-dark: #123f61;
  --mcu-bg: #f4f6f9;
  --mcu-card: #ffffff;
  --mcu-success: #1f9d55;
  --mcu-success-bg: #e8f7ee;
  --mcu-warning: #b8860b;
  --mcu-warning-bg: #fdf3dc;
  --mcu-danger: #c0392b;
  --mcu-danger-bg: #fdecea;
  --mcu-muted-bg: #eef0f3;
  --mcu-text-muted: #6b7280;
  --mcu-border: #e3e7ec;
}

body {
  background-color: var(--mcu-bg);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color: #22282f;
}

a { text-decoration: none; }

/* ---------- Top bar / brand ---------- */
.mcu-brand {
  font-weight: 600;
  color: var(--mcu-primary);
  font-size: 1.05rem;
}
.mcu-brand-wrap img { flex-shrink: 0; }
.mcu-brand-wrap.mcu-brand-stacked { width: 100%; }
.mcu-navbar {
  background: var(--mcu-card);
  border-bottom: 1px solid var(--mcu-border);
}

/* ---------- Sidebar ---------- */
.mcu-sidebar {
  background: var(--mcu-card);
  border-right: 1px solid var(--mcu-border);
  min-height: 100vh;
}
.mcu-sidebar .nav-link {
  color: #3b4552;
  padding: .55rem .9rem;
  border-radius: .5rem;
  font-size: .92rem;
  display: flex;
  align-items: center;
  gap: .55rem;
}
.mcu-sidebar .nav-link.active,
.mcu-sidebar .nav-link:hover {
  background: #eaf2f8;
  color: var(--mcu-primary);
}
.mcu-sidebar .nav-section-label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--mcu-text-muted);
  padding: .8rem .9rem .2rem;
}

/* ---------- Cards ---------- */
.mcu-card {
  background: var(--mcu-card);
  border: 1px solid var(--mcu-border);
  border-radius: .75rem;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.mcu-stat-card {
  background: var(--mcu-card);
  border: 1px solid var(--mcu-border);
  border-radius: .75rem;
  padding: 1.1rem 1.3rem;
}
.mcu-stat-card .stat-value { font-size: 1.9rem; font-weight: 700; line-height: 1; }
.mcu-stat-card .stat-label { color: var(--mcu-text-muted); font-size: .85rem; margin-top: .35rem; }

/* ---------- Status badges ---------- */
.badge-status { font-weight: 600; padding: .4em .7em; border-radius: .5rem; }

/* ---------- Compliance icons / pills used in the check table ---------- */
.pill-btn {
  border: 1px solid var(--mcu-border);
  background: #fff;
  border-radius: 2rem;
  padding: .3rem .65rem;
  font-size: .82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  cursor: pointer;
  min-width: 92px;
  justify-content: center;
}
.pill-compliant, .pill-present { background: var(--mcu-success-bg); color: var(--mcu-success); border-color: #cdeedb; }
.pill-issue, .pill-late { background: var(--mcu-warning-bg); color: var(--mcu-warning); border-color: #f3e2b3; }
.pill-absent { background: var(--mcu-danger-bg); color: var(--mcu-danger); border-color: #f5cdc7; }
.pill-na, .pill-excused { background: var(--mcu-muted-bg); color: var(--mcu-text-muted); border-color: var(--mcu-border); }

.status-dot { width: .55rem; height: .55rem; border-radius: 50%; display: inline-block; }
.status-dot-not_started { background: #adb5bd; }
.status-dot-draft { background: #1e5b8a; }
.status-dot-submitted { background: #b8860b; }
.status-dot-approved { background: #1f9d55; }
.status-dot-returned { background: #c0392b; }

/* ---------- Check table ---------- */
.check-table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--mcu-text-muted); white-space: nowrap; }
.check-table td { vertical-align: middle; }
.check-table .student-name { font-weight: 600; }

/* ---------- Responsive check row: table on md+, stacked card on mobile ----------
   .check-row is a plain block wrapper so the optional .issue-details panel always
   sits on its own full-width line below the fields, regardless of breakpoint.
   .check-row-fields is the flex row that becomes table-like columns on md+. */
.check-row-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem .75rem;
}
.check-row-fields .check-field { flex: 1 1 100%; min-width: 0; }
.check-row-fields .check-field .mobile-label {
  display: block;
  font-size: .78rem;
  color: var(--mcu-text-muted);
  font-weight: 600;
  margin-bottom: .15rem;
}
.check-row .student-name { font-weight: 600; }
.check-row-fields select.check-select { width: 100%; }

/* Table-style layout needs real horizontal room for 8 status columns, so it only
   kicks in at a wide tablet-landscape/desktop width; narrower tablets keep the
   touch-friendly stacked card layout used on phones. */
@media (min-width: 992px) {
  .check-row-fields { flex-wrap: nowrap; }
  .check-row-fields .check-field { flex: 1 1 0; }
  .check-row-fields .check-field.col-name { flex: 1.15 1 0; }
  .check-row-fields .check-field .mobile-label { display: none; }
  .check-row-fields select.check-select { font-size: .8rem; padding-left: .4rem; padding-right: 1.4rem; }
}

/* row highlighting for rows with an issue or flagged for follow up */
tr.row-flagged { background: #fff8ec; }

/* ---------- Mobile student cards (Daily Check on small screens) ---------- */
.student-check-card {
  background: #fff;
  border: 1px solid var(--mcu-border);
  border-radius: .75rem;
  padding: .9rem 1rem;
  margin-bottom: .75rem;
}
.student-check-card .field-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .4rem 0;
  border-bottom: 1px dashed var(--mcu-border);
}
.student-check-card .field-row:last-of-type { border-bottom: none; }
.student-check-card .field-label { font-size: .82rem; color: var(--mcu-text-muted); font-weight: 600; }

/* ---------- Sticky action bar (mobile morning check) ---------- */
.sticky-action-bar {
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 1px solid var(--mcu-border);
  padding: .65rem .9rem;
  display: flex;
  gap: .5rem;
  z-index: 20;
  box-shadow: 0 -2px 8px rgba(16,24,40,.05);
}

/* ---------- Buttons ---------- */
.btn-mcu-primary {
  background: var(--mcu-primary);
  border-color: var(--mcu-primary);
  color: #fff;
}
.btn-mcu-primary:hover { background: var(--mcu-primary-dark); border-color: var(--mcu-primary-dark); color: #fff; }

/* ---------- Login page ---------- */
.mcu-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #eef3f8 0%, var(--mcu-bg) 100%);
}
.mcu-login-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 1rem;
  border: 1px solid var(--mcu-border);
  padding: 2.1rem 2rem;
  box-shadow: 0 8px 24px rgba(16,24,40,.08);
}

/* ---------- Installation wizard ---------- */
.mcu-install-wrap {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 3.5rem;
  padding-bottom: 3.5rem;
  background: linear-gradient(180deg, #eef3f8 0%, var(--mcu-bg) 100%);
}
.mcu-install-card {
  width: 100%;
  max-width: 560px;
  background: #fff;
  border-radius: 1rem;
  border: 1px solid var(--mcu-border);
  padding: 2.1rem 2rem;
  box-shadow: 0 8px 24px rgba(16,24,40,.08);
}
.mcu-install-steps {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: .5rem;
}
.mcu-install-steps li {
  flex: 1;
  text-align: center;
  font-size: .78rem;
  color: var(--mcu-text-muted);
}
.mcu-install-step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--mcu-bg);
  border: 1px solid var(--mcu-border);
  margin: 0 auto .3rem;
  font-weight: 600;
  font-size: .82rem;
}
.mcu-install-steps li.active .mcu-install-step-num {
  background: var(--mcu-primary);
  border-color: var(--mcu-primary);
  color: #fff;
}
.mcu-install-steps li.done .mcu-install-step-num {
  background: #e7f5ec;
  border-color: #34a853;
  color: #1e7e34;
}
.mcu-install-steps li.active .mcu-install-step-label { color: var(--mcu-primary); font-weight: 600; }
.mcu-install-step-label { display: block; }
.mcu-install-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  background: #e7f5ec;
  color: #1e7e34;
  font-size: 1.6rem;
  font-weight: 700;
}
@media (max-width: 575.98px) {
  .mcu-install-step-label { display: none; }
}

/* ---------- Touch friendliness on small screens ---------- */
@media (max-width: 767.98px) {
  .btn { min-height: 42px; }
  .pill-btn { min-height: 40px; }
}

/* ---------- Print ---------- */
@media print {
  .no-print { display: none !important; }
  .mcu-sidebar, .mcu-navbar, .sticky-action-bar { display: none !important; }
  body { background: #fff; }
}
