/* ==========================================================================
   MGM UNIVERSITY CONVOCATION MANAGEMENT SYSTEM
   Institutional Visual Identity Stylesheet
   Primary Reference: MGM University 6th Convocation Invitation
   ========================================================================== */

:root {
  /* Official Academic Color Palette */
  --brand: #5A321F;
  --brand-dark: #3F2418;
  --brand-deep: #2A170F;
  --gold: #C99545;
  --gold-light: #E4C58F;
  --gold-soft: #F9F2E7;
  --cream: #F7EBDD;
  --bg: #FBF7F0;
  --bg-subtle: #F5EFE6;
  --card: #FFFFFF;
  --ink: #30251F;
  --ink-dark: #1F1713;
  --muted: #756B63;
  --muted-light: #9B9188;
  --line: #E4D8C8;
  --line-strong: #D2C4B1;

  /* State / Functional Accents */
  --ok: #E5F4EB;
  --okink: #1B6E38;
  --okborder: #A8DEB9;

  --bad: #FEEAEA;
  --badink: #991B1B;
  --badborder: #F8B4B4;

  --amber: #FEF3C7;
  --amberink: #854D0E;
  --amberborder: #FCD34D;

  --info: #EFF6FF;
  --infoink: #1E40AF;
  --infoborder: #BFDBFE;

  /* Elevation & Geometry */
  --shadow-xs: 0 1px 2px rgba(63, 36, 24, 0.04);
  --shadow-sm: 0 2px 6px rgba(63, 36, 24, 0.06);
  --shadow-md: 0 6px 18px rgba(63, 36, 24, 0.09);
  --shadow-lg: 0 12px 32px rgba(63, 36, 24, 0.12);
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;

  /* Typography Stacks */
  --font-serif: Georgia, "Times New Roman", Garamond, serif;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
}

/* Reset & Box Model */
*, *::before, *::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font: 16px/1.55 var(--font-sans);
  color: var(--ink);
  background-color: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  color: var(--brand-dark);
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 0.8rem;
}

h1 {
  font-size: 1.9rem;
  letter-spacing: 0.01em;
  border-bottom: 2px solid var(--cream);
  padding-bottom: 0.4rem;
}

h2 {
  font-size: 1.35rem;
  margin-top: 1.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

h3 {
  font-size: 1.15rem;
}

/* Breadcrumb & Navigation Links */
a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--gold);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 0.8rem;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
}

.back-link:hover {
  color: var(--brand);
  border-color: var(--gold);
  background: var(--gold-soft);
}

/* ==========================================================================
   Global Header & Bar
   ========================================================================== */
.bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.4rem;
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 100%);
  color: #FFFFFF;
  box-shadow: var(--shadow-md);
  border-bottom: 2px solid var(--gold);
  gap: 1rem;
}

.bar .brand,
.bar .brand-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: #FFFFFF;
  flex: 1;
}

.header-logo {
  height: 44px;
  width: auto;
  max-width: 190px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.25));
}

.header-logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-text,
.header-title-block {
  display: flex;
  flex-direction: column;
}

.brand-university,
.header-title-main {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #FFFFFF;
  text-transform: uppercase;
  line-height: 1.1;
}

.brand-subtitle,
.header-title-sub {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--gold-light);
  letter-spacing: 0.04em;
  margin-top: 0.15rem;
}

.user-group {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.who {
  font-size: 0.9rem;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.role-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--gold);
  color: var(--brand-deep);
  border: 1px solid var(--gold-light);
}

.bar form {
  margin: 0;
}

button.link {
  background: none;
  border: 0;
  color: var(--gold-light);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

button.link:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.12);
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */
main {
  max-width: 68rem;
  width: 100%;
  margin: 0 auto;
  padding: 1.6rem 1.2rem;
  flex: 1;
}

/* Institutional Footer */
.app-footer {
  margin-top: auto;
  background: var(--cream);
  border-top: 1px solid var(--line);
  padding: 1.2rem 1.4rem;
  font-size: 0.88rem;
  color: var(--muted);
  text-align: center;
}

.app-footer p {
  margin: 0.25rem 0;
}

.footer-brand {
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--brand-dark);
}

/* ==========================================================================
   Alerts, Flashes, & Status Banners
   ========================================================================== */
.flash {
  padding: 0.85rem 1.2rem;
  border-radius: var(--radius);
  margin: 0 0 1.2rem;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  box-shadow: var(--shadow-xs);
}

.flash.ok {
  background: var(--ok);
  color: var(--okink);
  border-color: var(--okborder);
}

.flash.bad {
  background: var(--bad);
  color: var(--badink);
  border-color: var(--badborder);
}

.banner {
  padding: 1.1rem 1.3rem;
  border-radius: var(--radius-lg);
  font-size: 1.55rem;
  font-weight: 800;
  text-align: center;
  margin: 1.2rem 0;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-sm);
  border: 2px solid transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.banner.blue {
  background: var(--info);
  color: var(--infoink);
  border-color: var(--infoborder);
}

.banner.green {
  background: var(--ok);
  color: var(--okink);
  border-color: var(--okborder);
}

.banner.amber {
  background: var(--amber);
  color: var(--amberink);
  border-color: var(--amberborder);
}

.banner.red {
  background: var(--bad);
  color: var(--badink);
  border-color: var(--badborder);
}

.banner.locked {
  border: 3px solid var(--badink);
}

/* ==========================================================================
   Cards & Surfaces
   ========================================================================== */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.3rem;
  display: grid;
  gap: 0.85rem;
  box-shadow: var(--shadow-xs);
}

.narrow {
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
}

/* ==========================================================================
   Form Controls
   ========================================================================== */
label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--brand-dark);
}

input, select {
  font: inherit;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: #FFFFFF;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 149, 69, 0.22);
}

button {
  font: inherit;
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #FFFFFF;
  color: var(--brand-dark);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-xs);
}

button:hover {
  background: var(--bg-subtle);
  border-color: var(--gold);
  color: var(--brand);
}

button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

button.big {
  padding: 0.9rem 1.5rem;
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #FFFFFF;
  border: 1px solid var(--brand-deep);
  font-weight: 700;
  font-size: 1.05rem;
  box-shadow: var(--shadow-sm);
}

button.big:hover {
  background: linear-gradient(180deg, var(--brand-dark) 0%, var(--brand-deep) 100%);
  color: var(--gold-light);
  box-shadow: var(--shadow-md);
}

button.danger {
  background: var(--bad);
  color: var(--badink);
  border-color: var(--badborder);
}

button.danger:hover {
  background: var(--badink);
  color: #FFFFFF;
  border-color: var(--badink);
}

button.button, a.button {
  display: inline-block;
  font: inherit;
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #FFFFFF;
  color: var(--brand-dark);
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  box-shadow: var(--shadow-xs);
  transition: all 0.15s ease;
}

button.button:hover, a.button:hover {
  background: var(--gold-soft);
  border-color: var(--gold);
  color: var(--brand);
}

a.button.small, button.small {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}

/* ==========================================================================
   Data Tables
   ========================================================================== */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

th {
  background: var(--cream);
  color: var(--brand-dark);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  padding: 0.75rem 0.9rem;
  text-align: left;
  border-bottom: 2px solid var(--line);
}

td {
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-size: 0.94rem;
  color: var(--ink);
}

tr:last-child td {
  border-bottom: 0;
}

tr:hover td {
  background-color: var(--gold-soft);
}

tr.off td {
  color: var(--muted-light);
  background-color: rgba(0, 0, 0, 0.02);
}

td.actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

td.actions form {
  display: flex;
  gap: 0.35rem;
  margin: 0;
}

td.num, th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Funnel bars */
.barcell {
  width: 40%;
}

.bar-fill {
  height: 0.9rem;
  background: linear-gradient(90deg, var(--gold) 0%, var(--brand) 100%);
  border-radius: var(--radius-sm);
  min-width: 2px;
}

/* ==========================================================================
   Grids & Navigation Tiles (Admin Home & Dashboards)
   ========================================================================== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 1.1rem;
  margin: 1.2rem 0;
}

.grid form {
  margin: 0;
}

.tile {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  padding: 1.5rem 1.2rem;
  text-align: center;
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: var(--brand-dark);
  text-decoration: none;
  box-shadow: var(--shadow-xs);
  transition: all 0.2s ease;
  min-height: 5.5rem;
}

.tile small {
  display: block;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.86rem;
  color: var(--muted);
  margin-top: 0.4rem;
}

.tile:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  box-shadow: var(--shadow-md);
  color: var(--brand);
}

.tile.primary {
  border: 2px solid var(--gold);
  background: linear-gradient(180deg, var(--gold-soft) 0%, #FFFFFF 100%);
  color: var(--brand-dark);
}

.spaced {
  margin-top: 1.4rem;
}

.muted {
  color: var(--muted);
}

/* ==========================================================================
   Operator Station Screens (Scanning & Confirm)
   ========================================================================== */
.scan-box {
  width: 100%;
  font-size: 1.7rem;
  padding: 1.1rem;
  border: 3px solid var(--gold);
  border-radius: var(--radius-lg);
  background: #FFFFFF;
  color: var(--brand-dark);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.06);
  text-align: center;
  letter-spacing: 0.04em;
}

.scan-box:focus {
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 4px rgba(201, 149, 69, 0.28);
}

.student {
  display: flex;
  gap: 1.5rem;
  background: #FFFFFF;
  border: 2px solid var(--gold-light);
  border-radius: var(--radius-lg);
  padding: 1.3rem;
  margin: 1.2rem 0;
  align-items: flex-start;
  box-shadow: var(--shadow-sm);
}

.student[hidden] {
  display: none;
}

.student img, #card-photo {
  width: 11rem;
  height: 14rem;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--bg-subtle);
  border: 2px solid var(--line);
  box-shadow: var(--shadow-xs);
}

.student-info {
  flex: 1;
}

.student h2, #card-name {
  margin: 0.2rem 0 0.6rem;
  font-size: 2.1rem;
  color: var(--brand-dark);
}

.student dl, #card-fields {
  margin: 0;
  display: grid;
  gap: 0.4rem;
  font-size: 1.15rem;
}

.student .field {
  display: flex;
  gap: 0.9rem;
}

.student dt {
  color: var(--muted);
  min-width: 9rem;
  font-weight: 500;
}

.student dd {
  margin: 0;
  font-weight: 700;
  color: var(--ink-dark);
}

button.confirm {
  display: block;
  width: 100%;
  padding: 1.4rem;
  font-size: 1.9rem;
  font-weight: 800;
  background: linear-gradient(180deg, #1B7F3B 0%, #14602C 100%);
  color: #FFFFFF;
  border: 0;
  border-radius: var(--radius-lg);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(27, 127, 59, 0.35);
  letter-spacing: 0.04em;
  transition: all 0.15s ease;
}

button.confirm:hover:not(:disabled) {
  background: linear-gradient(180deg, #14602C 0%, #0F4721 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(27, 127, 59, 0.45);
}

button.confirm[hidden] {
  display: none;
}

button.confirm:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.manual {
  margin-top: 1.6rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.8rem 1.1rem;
}

.manual summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
}

.manual-row {
  display: flex;
  gap: 0.75rem;
  margin: 0.8rem 0;
}

.manual-row input {
  flex: 1;
}

.camera-scan {
  margin-top: 1.4rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.8rem 1.1rem;
}

.camera-scan summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
}

.camera-view {
  margin: 0.8rem 0;
  max-width: 25rem;
}

.camera-view video {
  width: 100%;
  border-radius: var(--radius);
  background: #000000;
  border: 3px solid var(--gold);
}

.admin-station {
  max-width: 20rem;
  margin-bottom: 0.6rem;
}

/* Checkbox Markers */
.card-state {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--brand);
  margin: 0.2rem 0 0.6rem;
}

.markers {
  margin: 1.2rem 0;
  display: grid;
  gap: 0.75rem;
}

.markers[hidden] {
  display: none;
}

.marker {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-size: 1.35rem;
  padding: 0.9rem 1.2rem;
  background: #FFFFFF;
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: all 0.15s ease;
}

.marker:hover {
  border-color: var(--gold);
  background: var(--gold-soft);
}

.marker input {
  width: 1.9rem;
  height: 1.9rem;
  cursor: pointer;
}

.marker.done {
  opacity: 0.65;
  cursor: default;
  background: var(--bg-subtle);
  border-color: var(--line);
}

.marker:has(input[value="MONEY_RECEIVED"]),
.marker:has(input[value="MONEY_RETURNED"]),
.marker[data-key="MONEY_RECEIVED"],
.marker[data-key="MONEY_RETURNED"] {
  display: none !important;
}

/* ==========================================================================
   Stage Operator Screen
   ========================================================================== */
.led-status {
  margin: 0.3rem 0 1.2rem;
  color: var(--brand-dark);
  font-weight: 700;
  font-size: 1.05rem;
  padding: 0.5rem 0.8rem;
  background: var(--cream);
  border-radius: var(--radius);
  border-left: 4px solid var(--gold);
}

.takeover {
  background: linear-gradient(180deg, var(--badink) 0%, #7F1D1D 100%);
  color: #FFFFFF;
  border: 0;
  font-size: 1.4rem;
  font-weight: 800;
  padding: 1.1rem 1.5rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  letter-spacing: 0.04em;
}

.takeover[hidden] {
  display: none;
}

.stage-main {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.4rem;
  margin: 1.2rem 0;
  align-items: start;
}

.stage-main .stage-buttons {
  grid-template-columns: 1fr 1fr;
  margin: 0;
}

.stage-main #next {
  grid-column: 1 / -1;
  padding: 2.2rem 0.8rem;
  font-size: 2.2rem;
  background: linear-gradient(180deg, #1B7F3B 0%, #14602C 100%);
  box-shadow: 0 6px 18px rgba(27, 127, 59, 0.4);
}

.stage-main #next:hover:not(:disabled) {
  background: linear-gradient(180deg, #14602C 0%, #0F4721 100%);
}

.waiting h2 {
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  color: var(--brand-dark);
  text-transform: uppercase;
}

.waiting-list {
  list-style: decimal inside;
  display: grid;
  gap: 0.45rem;
  padding: 0;
  margin: 0 0 1.2rem;
}

.slot {
  background: #FFFFFF;
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.slot h2 {
  margin: 0.1rem 0 0.6rem;
  font-size: 1.05rem;
  letter-spacing: 0.12em;
  color: var(--muted);
  justify-content: center;
}

.slot-current {
  border: 3px solid var(--gold);
  background: linear-gradient(180deg, var(--gold-soft) 0%, #FFFFFF 30%);
}

.slot img, #current-photo {
  width: 100%;
  max-width: 15rem;
  height: 18rem;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--bg-subtle);
  border: 2px solid var(--gold-light);
  box-shadow: var(--shadow-sm);
}

.slot img[src=""] {
  visibility: hidden;
}

.slot-name {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--brand-dark);
  margin: 0.6rem 0 0;
  min-height: 2.2rem;
  overflow-wrap: anywhere;
}

.slot-current .slot-name {
  font-size: 2.2rem;
}

.stage-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.9rem;
  margin: 1.2rem 0;
}

/* Stage Controller Cards & Button Spacing */
.stage-controls-card,
.stage-tools-card {
  margin-top: 1.25rem;
  padding: 1.35rem 1.5rem;
  border-radius: var(--radius-lg);
  background: #FFFFFF;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.controls-heading,
.tools-heading {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--brand-dark);
  margin: 0 0 1.1rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.5rem;
}

.stage-buttons-grid {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  width: 100%;
}

.big-action {
  padding: 1.25rem 1.2rem;
  font-size: 1.35rem;
  font-weight: 800;
  border-radius: var(--radius-lg);
  border: 2px solid var(--line);
  background: #FFFFFF;
  color: var(--brand-dark);
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: all 0.15s ease;
  width: 100%;
}

.big-action:hover:not(:disabled) {
  border-color: var(--gold);
  transform: translateY(-1px);
}

.big-action.go {
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #FFFFFF;
  border: 0;
}

.big-action.go.primary-advance {
  width: 100%;
  padding: 1.35rem 1.5rem;
  text-align: center;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #FFFFFF;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(63, 36, 24, 0.25);
  transition: all 0.15s ease;
}

.big-action.go.primary-advance:hover:not(:disabled) {
  background: linear-gradient(180deg, #6E3F27 0%, var(--brand) 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(63, 36, 24, 0.3);
}

.advance-title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  display: block;
}

.advance-note {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  opacity: 0.92;
  margin-top: 0.4rem;
  display: block;
  font-weight: 500;
}

.secondary-controls-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  width: 100%;
}

.secondary-controls-row .button {
  width: 100%;
  padding: 0.75rem 0.6rem;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  justify-content: center;
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius);
}

.home-btn {
  background: linear-gradient(180deg, #DC2626 0%, #B91C1C 100%) !important;
  color: #FFFFFF !important;
  border: 1px solid #991B1B !important;
  gap: 0.3rem;
}

.home-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #EF4444 0%, #DC2626 100%) !important;
}

.big-action.home {
  background: linear-gradient(180deg, #B3261E 0%, #8C1D18 100%);
  color: #FFFFFF;
  border: 0;
}

.big-action small {
  display: block;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.82rem;
  margin-top: 0.3rem;
  opacity: 0.9;
}

.big-action:disabled, .stage-tools button:disabled, .tool-row button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* Skip & Search Tools */
.stage-tools {
  display: grid;
  gap: 0.9rem;
  margin-top: 1.2rem;
}

.tool,
.tool-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  width: 100%;
  margin-bottom: 0.75rem;
}

.tool-row:last-child {
  margin-bottom: 0;
}

.tool input,
.tool-row input {
  flex: 1;
  min-width: 0;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.95rem;
  background: #FFFFFF;
}

.tool-row input:focus {
  border-color: var(--gold);
  outline: none;
  box-shadow: 0 0 0 3px rgba(201, 149, 69, 0.2);
}

.tool-row button {
  padding: 0.7rem 1.4rem;
  font-weight: 700;
  font-size: 0.92rem;
  flex-shrink: 0;
  border-radius: var(--radius);
}

.results,
.results-list {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.6rem;
}

.result {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.6rem 0.9rem;
  box-shadow: var(--shadow-xs);
}

/* ==========================================================================
   Admin Statistics & Console
   ========================================================================== */
.stats {
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
}

.stat {
  display: block;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1rem 1.2rem;
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow-xs);
  transition: all 0.15s ease;
}

.stat:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.stat b {
  display: block;
  font-size: 2.1rem;
  line-height: 1.1;
  font-family: var(--font-serif);
  color: var(--brand-dark);
}

.stat span {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.3rem;
  display: block;
}

form.inline {
  display: flex;
  gap: 0.4rem;
  margin: 0;
}

form.inline input {
  min-width: 12rem;
}

.filters {
  grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr));
  align-items: end;
}

/* Big number display in preview cards */
.big-number {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--brand-dark);
  margin: 0.4rem 0 0;
  line-height: 1;
}

/* Danger Zone */
.danger-zone {
  border: 2px solid var(--badborder);
  background: #FFFBFB;
}

.danger-zone h2 {
  color: var(--badink);
  margin: 0 0 0.5rem;
}

.danger-zone ul {
  margin: 0.4rem 0;
  padding-left: 1.4rem;
}

button.big.danger {
  background: linear-gradient(180deg, var(--badink) 0%, #7F1D1D 100%);
  color: #FFFFFF;
  border: 0;
}

code.phrase {
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--badink);
  background: #FFFFFF;
  padding: 0.2rem 0.45rem;
  border: 1px solid var(--badborder);
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   Loading States & Spinners (Wired to static/busy.js)
   TEST CONTRACT: Preserves .is-busy, @keyframes busy-spin, .busy-note
   ========================================================================== */
.is-busy {
  cursor: progress;
}

button.is-busy, input.is-busy {
  opacity: 0.85;
}

button.is-busy::before, a.is-busy::before {
  content: "";
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  margin-right: 0.45em;
  vertical-align: -0.1em;
  border: 0.15em solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: busy-spin 0.8s linear infinite;
}

a.is-busy {
  pointer-events: none;
  color: var(--muted);
}

.busy-note {
  margin: 0.6rem 0 0;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: var(--gold-soft);
  color: var(--brand-dark);
  font-weight: 600;
  border: 1px solid var(--gold-light);
}

.busy-note.busy-error {
  background: var(--bad);
  color: var(--badink);
  border-color: var(--badborder);
}

@keyframes busy-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  button.is-busy::before, a.is-busy::before {
    animation-duration: 2.4s;
  }
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 840px) {
  .stage-main {
    grid-template-columns: 1fr;
  }

  .student {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .student .field {
    justify-content: center;
  }

  .bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
  }

  .user-group {
    justify-content: space-between;
  }

  .stage-buttons {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  main {
    padding: 1rem 0.75rem;
  }

  .banner {
    font-size: 1.25rem;
    padding: 0.8rem;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .stats {
    grid-template-columns: 1fr 1fr;
  }

  .scan-box {
    font-size: 1.3rem;
  }

  button.confirm {
    font-size: 1.4rem;
    padding: 1rem;
  }
}

/* ==========================================================================
   Admin Application Shell & Persistent Sidebar Navigation
   ========================================================================== */
.admin-layout-container {
  display: flex;
  min-height: calc(100vh - 65px);
  width: 100%;
  position: relative;
  background-color: var(--bg);
  align-items: stretch;
}

.sidebar-toggle-btn {
  display: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #FFFFFF;
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.5rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  margin-right: 0.6rem;
}

.sidebar-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--gold-light);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(31, 23, 19, 0.65);
  backdrop-filter: blur(2px);
  z-index: 998;
}

.admin-sidebar {
  width: 255px;
  min-width: 255px;
  max-width: 255px;
  flex-shrink: 0;
  background: #FFFFFF;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 8px rgba(63, 36, 24, 0.04);
  position: sticky;
  top: 0;
  height: calc(100vh - 65px);
  overflow-y: auto;
  z-index: 100;
}

.sidebar-header {
  padding: 1rem 1.15rem 0.85rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--gold-soft) 0%, #FFFFFF 100%);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.sidebar-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--brand-dark);
  letter-spacing: 0.02em;
}

.sidebar-subtitle {
  font-size: 0.74rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sidebar-nav {
  padding: 0.6rem 0.65rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.nav-section-label {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding: 0.75rem 0.6rem 0.2rem;
}

.sidebar-nav > .nav-section-label:first-child {
  padding-top: 0.1rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.48rem 0.65rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.nav-item:hover {
  background: var(--gold-soft);
  color: var(--brand-dark);
  border-color: var(--gold-light);
}

.nav-item.active {
  background: var(--gold-soft);
  color: var(--brand-dark);
  font-weight: 700;
  border-color: var(--gold-light);
  border-left: 4px solid var(--gold);
  box-shadow: var(--shadow-xs);
}

.nav-item.station-link {
  color: var(--brand-dark);
}

.nav-item.station-link:hover {
  background: var(--cream);
  border-color: var(--gold-light);
}

.nav-icon {
  flex-shrink: 0;
  color: var(--gold);
  transition: transform 0.15s ease, color 0.15s ease;
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
  color: var(--brand);
}

.admin-main-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.admin-main {
  flex: 1;
  padding: 1.8rem 2.2rem;
  width: 100%;
  max-width: 80rem;
  margin: 0;
  box-sizing: border-box;
}

.admin-footer {
  margin-top: auto;
  background: #FFFFFF;
  border-top: 1px solid var(--line);
  padding: 1rem 1.4rem;
  text-align: center;
}

/* ==========================================================================
   Operator Station Screens (Continuous Scan, Identity & Camera Overlay)
   ========================================================================== */
.station-container {
  max-width: 74rem;
  margin: 0 auto;
  padding: 0.8rem 1rem 2rem;
}

.station-identity-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 100%);
  color: #FFFFFF;
  padding: 0.9rem 1.4rem;
  border-radius: var(--radius-lg);
  border-bottom: 3px solid var(--gold);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.4rem;
  gap: 1rem;
}

.station-title-group,
.station-identity-meta {
  display: flex;
  flex-direction: column;
}

.station-inst-name,
.station-institution-label {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-light) !important;
  font-weight: 600;
}

.station-main-title,
.station-display-title,
.station-identity-banner h1 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0.15rem 0 0;
  color: #FFFFFF !important;
  letter-spacing: 0.02em;
}

.station-meta-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.station-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #FFFFFF;
}

.status-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 6px #10B981;
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.station-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 1.6rem;
  align-items: start;
}

.scanner-viewport-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.3rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.camera-stream-wrapper {
  position: relative;
  width: 100%;
  min-height: 290px;
  max-height: 380px;
  background: #0D0A08;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
}

.camera-stream-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.camera-viewfinder-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.viewfinder-frame {
  position: relative;
  width: 200px;
  height: 200px;
}

.reticle-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: var(--gold-light);
  border-style: solid;
}

.reticle-corner.top-left {
  top: 0;
  left: 0;
  border-width: 3px 0 0 3px;
  border-top-left-radius: 4px;
}

.reticle-corner.top-right {
  top: 0;
  right: 0;
  border-width: 3px 3px 0 0;
  border-top-right-radius: 4px;
}

.reticle-corner.bottom-left {
  bottom: 0;
  left: 0;
  border-width: 0 0 3px 3px;
  border-bottom-left-radius: 4px;
}

.reticle-corner.bottom-right {
  bottom: 0;
  right: 0;
  border-width: 0 3px 3px 0;
  border-bottom-right-radius: 4px;
}

.scan-laser-line {
  position: absolute;
  left: 6px;
  right: 6px;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--gold-light) 50%, transparent 100%);
  box-shadow: 0 0 8px var(--gold);
  animation: scan-laser 2.2s ease-in-out infinite;
}

@keyframes scan-laser {
  0% { top: 12%; opacity: 0.3; }
  50% { top: 88%; opacity: 1; }
  100% { top: 12%; opacity: 0.3; }
}

.camera-overlay-screen {
  position: absolute;
  inset: 0;
  background: rgba(27, 16, 11, 0.94);
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
  z-index: 10;
}

.overlay-dialog {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  max-width: 20rem;
}

.overlay-icon,
.dialog-icon {
  font-size: 2.4rem;
  margin-bottom: 0.2rem;
  color: var(--gold-light) !important;
  stroke: var(--gold-light) !important;
}

.overlay-title,
.dialog-title,
.camera-overlay-screen h3 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: #FFFFFF !important;
  margin: 0;
}

.overlay-subtitle,
.dialog-desc,
.camera-overlay-screen p {
  font-size: 0.9rem;
  color: var(--cream) !important;
  margin: 0;
  line-height: 1.4;
}

.btn-resume-camera,
.camera-overlay-screen .resume-btn,
.camera-overlay-screen button.button {
  margin-top: 0.5rem;
  padding: 0.75rem 1.6rem;
  font-weight: 700;
  font-size: 1rem;
  background: linear-gradient(180deg, var(--gold) 0%, #B88337 100%) !important;
  color: var(--brand-deep) !important;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(201, 149, 69, 0.35);
  transition: all 0.15s ease;
}

.btn-resume-camera:hover,
.camera-overlay-screen .resume-btn:hover,
.camera-overlay-screen button.button:hover {
  background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 100%) !important;
  transform: translateY(-1px);
}

.scanner-status-indicator {
  margin-top: 0.85rem;
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-weight: 600;
  text-align: center;
  border: 1px solid transparent;
}

.scanner-status-indicator.ready {
  background: var(--ok);
  color: var(--okink);
  border-color: var(--okborder);
}

.scanner-status-indicator.processing {
  background: var(--info);
  color: var(--infoink);
  border-color: var(--infoborder);
}

.scanner-status-indicator.paused {
  background: var(--amber);
  color: var(--amberink);
  border-color: var(--amberborder);
}

.scanner-status-indicator.error {
  background: var(--bad);
  color: var(--badink);
  border-color: var(--badborder);
}

.scan-helper-text {
  text-align: center;
  font-size: 0.86rem;
  color: var(--muted);
  margin: 0.6rem 0 0.2rem;
}

/* Last Scanned Graduate Feedback Panel */
.last-scan-panel {
  margin-top: 1.4rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.last-scan-card {
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-left: 4px solid var(--okink);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow-xs);
}

.last-scan-header {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.last-scan-content {
  display: flex;
  gap: 0.9rem;
  align-items: center;
}

.last-scan-photo {
  width: 48px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--bg-subtle);
  flex-shrink: 0;
}

.last-scan-info {
  flex: 1;
  min-width: 0;
}

.last-scan-name {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brand-dark);
  margin: 0 0 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.last-scan-details {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
}

.last-scan-status-badge {
  display: inline-block;
  margin-top: 0.3rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.76rem;
  font-weight: 700;
  background: var(--ok);
  color: var(--okink);
  border: 1px solid var(--okborder);
}

/* ==========================================================================
   Stage Manager Layout & Infinite Scroll Queue
   ========================================================================== */
.stage-manager-layout {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 1.6rem;
  align-items: start;
}

.current-graduate-card {
  background: #FFFFFF;
  border: 2px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.current-graduate-header {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand);
  margin-bottom: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.current-graduate-photo-frame {
  margin: 0 auto 1rem;
  width: 13rem;
  height: 16rem;
  border-radius: var(--radius);
  border: 3px solid var(--gold-light);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  background: var(--bg-subtle);
}

.current-graduate-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.current-graduate-name {
  font-family: var(--font-serif);
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--brand-dark);
  margin: 0 0 0.4rem;
  line-height: 1.15;
}

.current-graduate-prog {
  font-size: 1.15rem;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 0.8rem;
}

.stage-controls-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  margin-top: 1.2rem;
  box-shadow: var(--shadow-xs);
}

.stage-controls-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.8rem;
  margin-top: 0.8rem;
}

.stage-btn-next {
  grid-column: 1 / -1;
  padding: 1.6rem 1rem;
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(180deg, #1B7F3B 0%, #14602C 100%);
  color: #FFFFFF;
  border: 0;
  border-radius: var(--radius-lg);
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(27, 127, 59, 0.35);
  letter-spacing: 0.03em;
  transition: all 0.15s ease;
}

.stage-btn-next:hover:not(:disabled) {
  background: linear-gradient(180deg, #14602C 0%, #0F4721 100%);
  transform: translateY(-1px);
}

.stage-btn-secondary {
  padding: 0.85rem 0.65rem;
  font-size: 1.05rem;
  font-weight: 700;
  background: #FFFFFF;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--brand-dark);
  cursor: pointer;
  transition: all 0.15s ease;
}

.stage-btn-secondary:hover:not(:disabled) {
  background: var(--gold-soft);
  border-color: var(--gold);
}

.stage-btn-home {
  background: linear-gradient(180deg, #B3261E 0%, #8C1D18 100%);
  color: #FFFFFF;
  border: 0;
}

.waiting-queue-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.waiting-queue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--cream);
  padding-bottom: 0.6rem;
  margin-bottom: 0.8rem;
}

.waiting-queue-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--brand-dark);
  margin: 0;
}

.waiting-scroll-viewport {
  max-height: 520px;
  overflow-y: auto;
  padding-right: 0.4rem;
}

.stage-queue-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid var(--line);
  transition: background 0.15s ease;
}

.stage-queue-row:hover {
  background: var(--gold-soft);
}

.queue-num-badge {
  font-family: var(--font-serif);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--brand-dark);
  min-width: 2.2rem;
  text-align: center;
  background: var(--cream);
  padding: 0.25rem 0.4rem;
  border-radius: var(--radius-sm);
}

.queue-student-photo {
  width: 44px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-subtle);
  flex-shrink: 0;
}

.queue-student-details {
  flex: 1;
  min-width: 0;
}

.queue-student-name {
  font-weight: 700;
  font-size: 0.96rem;
  color: var(--brand-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0 0 0.15rem;
}

.queue-student-prog {
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.queue-scroll-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 1rem;
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 600;
}

.loader-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--gold-light);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: busy-spin 0.8s linear infinite;
}

/* ==========================================================================
   Responsive Shell Breakpoints
   ========================================================================== */
@media (max-width: 960px) {
  .sidebar-toggle-btn {
    display: inline-flex;
  }

  .admin-sidebar {
    position: fixed;
    top: 0;
    left: -290px;
    height: 100vh;
    width: 280px;
    max-width: 85vw;
    z-index: 1000;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-lg);
  }

  .admin-sidebar.open {
    transform: translateX(290px);
  }

  .sidebar-overlay.open {
    display: block;
  }

  .admin-main {
    padding: 1.2rem 1rem;
  }

  .station-grid {
    grid-template-columns: 1fr;
  }

  .stage-manager-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .station-identity-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .station-meta-group {
    width: 100%;
    justify-content: space-between;
  }
}

/* ==========================================================================
   Admin Page Headers, Quick Actions & Workspaces
   ========================================================================== */
.admin-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--cream);
  padding-bottom: 0.8rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.admin-page-title-group h1 {
  margin: 0 0 0.2rem;
  border: none;
  padding: 0;
  font-size: 1.75rem;
}

.admin-page-subtitle {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.admin-header-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--gold-soft);
  border: 1px solid var(--gold-light);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--brand-dark);
}

.live-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 6px #10B981;
  animation: pulse-dot 2s infinite ease-in-out;
}

.dashboard-quick-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.4rem;
}

.quick-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  background: #FFFFFF;
  border: 1px solid var(--line-strong);
  color: var(--brand-dark);
  text-decoration: none;
  box-shadow: var(--shadow-xs);
  transition: all 0.15s ease;
}

.quick-action-btn:hover {
  background: var(--gold-soft);
  border-color: var(--gold);
  transform: translateY(-1px);
}

.quick-action-btn.primary {
  background: linear-gradient(180deg, var(--gold-soft) 0%, #FFFFFF 100%);
  border: 1.5px solid var(--gold);
  color: var(--brand);
  font-weight: 700;
}

/* Reports Workspace Layout */
.reports-workspace-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.reports-subnav {
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1rem 0.8rem;
  box-shadow: var(--shadow-xs);
}

.reports-subnav-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brand-dark);
  padding: 0.2rem 0.6rem 0.6rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.8rem;
}

.reports-group-block {
  margin-bottom: 0.8rem;
}

.reports-group-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
  padding: 0.2rem 0.6rem;
}

.reports-group-items {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-top: 0.2rem;
}

.report-nav-link {
  display: block;
  padding: 0.4rem 0.6rem;
  font-size: 0.88rem;
  color: var(--ink);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.15s ease;
}

.report-nav-link:hover {
  background: var(--gold-soft);
  color: var(--brand-dark);
}

.report-nav-link.active {
  background: var(--gold-soft);
  color: var(--brand);
  font-weight: 700;
  border-left: 3px solid var(--gold);
}

.reports-content-pane {
  min-width: 0;
}

.filter-pill {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--line);
  background: #FFFFFF;
  color: var(--ink);
  transition: all 0.15s ease;
}

.filter-pill:hover {
  border-color: var(--gold);
  background: var(--gold-soft);
}

.filter-pill.active {
  background: var(--brand);
  color: #FFFFFF;
  border-color: var(--brand-dark);
}

/* Student Search Form & Card */
.student-search-card {
  padding: 1.25rem 1.5rem;
}

.student-search-form {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.search-input-group {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.search-input-group input {
  width: 100%;
  padding-left: 2.6rem;
  font-size: 1.05rem;
}

.search-input-group .search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

@media (max-width: 860px) {
  .reports-workspace-layout {
    grid-template-columns: 1fr;
  }
}

