/* HallBeat presentation layer: Flow palette, school-operations density. */
:root {
  color-scheme: light;
  --hallbeat-navy: #0b132b;
  --hallbeat-ink: #16223b;
  --hallbeat-blue: #2563eb;
  --hallbeat-paper: #f4f7fc;
  --hallbeat-line: rgba(29, 53, 87, 0.14);
}

body {
  background-color: var(--hallbeat-paper);
  background-image:
    linear-gradient(rgba(29, 53, 87, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29, 53, 87, 0.035) 1px, transparent 1px);
  background-size: 36px 36px;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.08), transparent 34%),
    linear-gradient(315deg, rgba(14, 159, 110, 0.055), transparent 28%);
}

/* Authentication */
.auth-gate {
  background: transparent;
}

.auth-gate-panel {
  width: min(500px, 100%);
  padding: 40px;
  border: 1px solid var(--hallbeat-line);
  border-top: 4px solid var(--hallbeat-blue);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-lg);
}

.auth-gate-mark {
  width: 64px;
  height: 64px;
  margin-bottom: 20px;
  border-radius: 8px;
  background: transparent;
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.2);
}

.auth-gate-mark img {
  width: 64px;
  height: 64px;
}

.auth-gate-panel .label {
  color: var(--hallbeat-blue);
  font-family: var(--font-sans);
  letter-spacing: 0.08em;
}

.auth-gate-panel h1 {
  margin-top: 10px;
  color: var(--text-primary);
  font-size: 44px;
  line-height: 1.02;
  letter-spacing: 0;
}

.auth-gate-panel p {
  color: var(--text-secondary);
}

/* Product shell */
.workspace-app {
  padding-left: 64px;
}

.workspace-app.auth-locked {
  padding-left: 0;
}

.workspace-header {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 90;
  width: 64px;
  min-height: 100vh;
  padding: 10px 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 8px;
  border-right: 1px solid rgba(255, 255, 255, 0.09);
  border-bottom: 0;
  background: linear-gradient(180deg, #0b132b, #16223b);
  box-shadow: 2px 0 18px rgba(11, 19, 43, 0.18);
  transition: width 180ms var(--ease);
}

.workspace-header:hover,
.workspace-header:focus-within {
  width: 224px;
}

.workspace-header.rail-auto-collapsed,
.workspace-header.rail-auto-collapsed:hover,
.workspace-header.rail-auto-collapsed:focus-within {
  width: 64px;
}

.brand-block {
  width: 208px;
  min-width: 0;
  padding: 4px 6px 10px;
  gap: 10px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  flex: 0 0 40px;
}

.brand-mark img {
  width: 40px;
  height: 40px;
}

.brand-title {
  color: #fff;
  font-size: 17px;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand-subtitle {
  color: #93c5fd;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
}

.brand-copy,
.rail-label,
.rail-user-label {
  min-width: 0;
  opacity: 0;
  transition: opacity 120ms var(--ease);
}

.workspace-header:hover .brand-copy,
.workspace-header:focus-within .brand-copy,
.workspace-header:hover .rail-label,
.workspace-header:focus-within .rail-label,
.workspace-header:hover .rail-user-label,
.workspace-header:focus-within .rail-user-label {
  opacity: 1;
}

.workspace-header.rail-auto-collapsed .brand-copy,
.workspace-header.rail-auto-collapsed .rail-label,
.workspace-header.rail-auto-collapsed .rail-user-label {
  opacity: 0;
}

.workspace-tabs {
  width: 100%;
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  padding: 6px 0;
  overflow-x: hidden;
  overflow-y: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.workspace-tab {
  width: 100%;
  min-height: 44px;
  padding: 10px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  border-radius: 8px;
  color: #cbd5e9;
  letter-spacing: 0;
  white-space: nowrap;
}

.workspace-tab:hover {
  color: #fff;
  background: rgba(96, 165, 250, 0.12);
}

.workspace-tab.active {
  color: #fff;
  background: var(--hallbeat-blue);
  box-shadow: none;
}

.workspace-tab-external {
  color: #93c5fd;
  box-shadow: none;
}

.workspace-tab-external:hover {
  color: #fff;
  background: rgba(37, 99, 235, 0.28);
}

.rail-icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  background: currentColor;
  -webkit-mask-image: var(--rail-icon);
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: 20px 20px;
  mask-image: var(--rail-icon);
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: 20px 20px;
}

.rail-icon-users { --rail-icon: url('/img/icons/users.svg'); }
.rail-icon-route { --rail-icon: url('/img/icons/route.svg'); }
.rail-icon-calendar { --rail-icon: url('/img/icons/calendar-days.svg'); }
.rail-icon-flow { --rail-icon: url('/img/icons/workflow.svg'); }
.rail-icon-student { --rail-icon: url('/img/icons/user-round.svg'); }
.rail-icon-settings { --rail-icon: url('/img/icons/settings.svg'); }
.rail-icon-account { --rail-icon: url('/img/icons/circle-user-round.svg'); }
.rail-icon-kiosk { --rail-icon: url('/img/icons/monitor-smartphone.svg'); }
.rail-icon-logout { --rail-icon: url('/img/icons/log-out.svg'); }
.rail-icon-bell { --rail-icon: url('/img/icons/bell.svg'); }

.workspace-meta {
  width: 100%;
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.workspace-meta .pill,
.workspace-meta .btn {
  width: 100%;
  min-height: 44px;
  padding: 10px;
  justify-content: flex-start;
  gap: 12px;
  border-radius: 8px;
  overflow: hidden;
  border-color: transparent;
  background: transparent;
  color: #cbd5e9;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-meta .workspace-account:hover {
  background: rgba(255, 255, 255, 0.055);
}

.workspace-meta .btn:hover {
  border-color: transparent;
  background: rgba(96, 165, 250, 0.12);
  color: #fff;
}

.workspace-meta .rail-signout:hover {
  background: rgba(220, 38, 38, 0.18);
  color: #fecaca;
}

.rail-user-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.rail-notifications {
  position: relative;
}

.rail-notifications.has-notifications {
  color: #fff;
  background: rgba(37, 99, 235, 0.3);
}

.notification-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #16223b;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.notification-drawer {
  position: fixed;
  z-index: 120;
  top: 12px;
  bottom: 12px;
  left: 72px;
  width: min(390px, calc(100vw - 88px));
  overflow: auto;
  border: 1px solid var(--hallbeat-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(11, 19, 43, 0.24);
}

.notification-drawer-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--hallbeat-line);
  background: #fff;
}

.notification-drawer-head h2 {
  margin-top: 3px;
  font-size: 20px;
  letter-spacing: 0;
}

.icon-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--hallbeat-line);
  border-radius: 7px;
  background: #fff;
  color: var(--text-secondary);
  cursor: pointer;
}

.notification-close-icon {
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: url('/img/icons/x.svg') center / 18px no-repeat;
  mask: url('/img/icons/x.svg') center / 18px no-repeat;
}

.notification-list {
  display: flex;
  flex-direction: column;
}

.notification-item {
  padding: 18px;
  border-bottom: 1px solid var(--hallbeat-line);
}

.notification-item-head,
.notification-route,
.notification-empty {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.notification-student {
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 750;
}

.notification-route {
  margin-top: 13px;
  padding: 11px 12px;
  border-left: 3px solid var(--hallbeat-blue);
  background: #eff6ff;
  color: var(--text-secondary);
  font-size: 13px;
}

.notification-route strong {
  color: var(--text-primary);
}

.notification-note {
  margin-top: 10px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.45;
}

.notification-actions {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.notification-empty {
  padding: 28px 18px;
  color: var(--text-secondary);
}

.workspace-main {
  width: min(1540px, calc(100% - 28px));
  padding-top: 14px;
}

.hero-panel {
  min-height: 62px;
  padding: 12px 16px;
  border-color: var(--hallbeat-line);
  border-left: 4px solid var(--hallbeat-blue);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-sm);
}

.hero-copy h1,
.admin-hero h2,
.admin-sidebar-head h3,
.admin-workspace-head h3,
.admin-card-head h3 {
  color: var(--text-primary);
  letter-spacing: 0;
}

.hero-copy p {
  color: var(--text-secondary);
}

.teacher-shell {
  gap: 14px;
}

.teacher-sidebar,
.teacher-stage {
  gap: 12px;
}

.side-card,
.stage-card,
.admin-sidebar,
.admin-workspace {
  border-color: var(--hallbeat-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
}

.side-card {
  padding: 14px;
  box-shadow: var(--shadow-sm);
}

.stage-card {
  background: #fff;
  box-shadow: var(--shadow-md);
}

.side-card h2,
.side-card strong {
  color: var(--text-primary);
}

.side-card .label,
.label {
  font-family: var(--font-sans);
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.summary-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat,
.card,
.card-inner {
  border-color: var(--hallbeat-line);
  background: #fff;
}

.stat-clickable:hover {
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.1);
}

.pill,
.quick-btn,
.chip {
  background: var(--bg-raised);
}

.input,
.select {
  border-color: var(--border-strong);
  background: #fff;
  color: var(--text-primary);
}

.input:focus,
.select:focus {
  border-color: var(--hallbeat-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn {
  border-radius: 7px;
  background: #fff;
  color: var(--text-secondary);
}

.btn:hover {
  border-color: rgba(37, 99, 235, 0.34);
  background: var(--accent-soft);
  color: var(--accent);
}

.btn-primary,
.chip-active {
  border-color: var(--hallbeat-blue);
  background: var(--hallbeat-blue);
  color: #fff;
}

.btn-primary:hover {
  border-color: #1d4ed8;
  background: #1d4ed8;
  color: #fff;
}

.badge-ok {
  color: var(--ok);
}

.badge-warn {
  color: var(--warn);
  background: var(--warn-soft);
}

.badge-danger {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: var(--danger-border);
}

.badge-neutral {
  color: var(--text-secondary);
  background: #eef3fb;
}

.modal-backdrop {
  background: rgba(11, 19, 43, 0.58);
}

.modal-panel,
.idle-modal {
  border-color: var(--hallbeat-line);
  border-radius: 8px;
  background: #fff;
  color: var(--text-primary);
}

.lock-screen {
  background-color: var(--hallbeat-paper);
  background-image:
    linear-gradient(rgba(29, 53, 87, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29, 53, 87, 0.04) 1px, transparent 1px);
  background-size: 36px 36px;
}

.lock-panel {
  border-top: 4px solid var(--hallbeat-blue);
  border-radius: 8px;
  background: #fff;
}

.lock-panel h2 {
  color: var(--text-primary);
  letter-spacing: 0;
}

.lock-panel p {
  color: var(--text-secondary);
}

/* Admin surfaces used to contain dark-only hard-coded fills. */
.admin-view-as-bar,
.admin-view-as-bar.is-active {
  border-color: rgba(37, 99, 235, 0.26);
  border-radius: 8px;
  background: #eff6ff;
  box-shadow: var(--shadow-sm);
}

.admin-nav-button,
.admin-card,
.admin-dropzone,
.admin-output,
.admin-list-row {
  border-color: var(--hallbeat-line);
  background: #f8faff;
  color: var(--text-primary);
}

.admin-nav-button:hover,
.admin-nav-button.active,
.admin-list-row-active {
  border-color: rgba(37, 99, 235, 0.28);
  background: #eff6ff;
  box-shadow: none;
}

.admin-nav-button.active em {
  color: var(--hallbeat-blue);
}

.admin-workspace-head {
  border-bottom-color: var(--hallbeat-line);
}

.admin-editor-status {
  border-color: rgba(37, 99, 235, 0.24);
  border-radius: 8px;
  background: #eff6ff;
}

.admin-drag-handle,
.admin-copy,
.admin-field,
.admin-dropzone,
.admin-output {
  color: var(--text-secondary);
}

.btn-danger-soft {
  color: var(--danger);
}

/* Kiosk keeps the same product language at touch-screen scale. */
.kiosk-screen {
  background-color: var(--hallbeat-paper);
  background-image:
    linear-gradient(rgba(29, 53, 87, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29, 53, 87, 0.035) 1px, transparent 1px);
  background-size: 36px 36px;
}

.kiosk-header,
.kiosk-student,
.kiosk-dest,
.kiosk-out-strip,
.kiosk-result {
  border-color: var(--hallbeat-line);
  border-radius: 8px;
  background: #fff;
}

.kiosk-header {
  border-top: 4px solid var(--hallbeat-blue);
  box-shadow: var(--shadow-sm);
}

.kiosk-logo {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: transparent;
}

.kiosk-logo img {
  width: 46px;
  height: 46px;
}

.kiosk-search {
  border-radius: 8px;
  background: #fff;
}

.kiosk-student:hover,
.kiosk-dest:hover {
  border-color: var(--accent-border);
  background: #eff6ff;
}

.kiosk-student-out {
  border-color: var(--warn-border);
  background: #fffbeb;
}

.kiosk-result-ok {
  border-color: var(--ok-border);
  background: #f0fdf4;
}

.kiosk-result-warn {
  border-color: var(--warn-border);
  background: #fffbeb;
}

.kiosk-result-danger {
  border-color: var(--danger-border);
  background: #fef2f2;
}

/* Roster and student records */
.section-item,
.summary-strip .stat,
.roster-mini-stat,
.current-class-switcher-card,
.current-class-roster-card,
.my-classes-bottom,
.student-roster-card,
.hallway-card,
.student-card-stat,
.student-switcher-bar,
.student-directory-collapsed {
  border-color: var(--hallbeat-line);
  background: #f8faff;
}

.section-item:hover,
.student-roster-card:hover,
.hallway-card:hover {
  border-color: rgba(37, 99, 235, 0.28);
  background: #eff6ff;
}

.section-item.active,
.pass-focus-card,
.student-directory-item-selected {
  border-color: rgba(37, 99, 235, 0.3);
  background: #eff6ff;
  box-shadow: none;
}

.summary-strip .stat {
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.student-tabs {
  border-color: var(--hallbeat-line);
  background: #eef3fb;
}

.student-tab {
  background: transparent;
}

.student-tab:hover {
  background: rgba(37, 99, 235, 0.08);
}

.student-tab.active {
  background: var(--hallbeat-blue);
  color: #fff;
  box-shadow: none;
}

/* Scheduling was the darkest legacy area; keep its hierarchy on light paper. */
.schedule-panel,
.schedule-master-column,
.talon-command-center,
.activity-builder-panel,
.activity-block-builder,
.activity-mini-row,
.talon-board-card,
.schedule-summary-card,
.schedule-block-card,
.schedule-roster-row,
.schedule-student-pick,
.schedule-health-item,
.schedule-detail-grid div,
.talon-board-metrics div,
.talon-board-stats div {
  border-color: var(--hallbeat-line);
  border-radius: 8px;
  background: #fff;
  color: var(--text-primary);
}

.schedule-panel,
.talon-command-center,
.activity-builder-panel {
  box-shadow: var(--shadow-sm);
}

.talon-command-center {
  border-top: 4px solid var(--hallbeat-blue);
}

.activity-builder-panel {
  border-top: 4px solid var(--warn);
}

.schedule-view-pill {
  border-color: var(--hallbeat-line);
  background: #f8faff;
  color: var(--text-secondary);
}

.schedule-view-pill:hover {
  border-color: rgba(37, 99, 235, 0.28);
  background: #eff6ff;
}

.schedule-view-pill.active {
  border-color: var(--hallbeat-blue);
  background: var(--hallbeat-blue);
  color: #fff;
}

.talon-board-card {
  box-shadow: var(--shadow-md);
}

.talon-board-card.is-open,
.schedule-block-card.schedule-block-current {
  border-color: rgba(37, 99, 235, 0.36);
  box-shadow: inset 4px 0 0 var(--hallbeat-blue);
}

.talon-board-kicker {
  color: var(--hallbeat-blue);
}

.talon-capacity-orb,
.activity-count-orb {
  border-color: rgba(37, 99, 235, 0.2);
  border-radius: 8px;
  background: #eff6ff;
}

.talon-fill-bar {
  background: #e7ebf2;
  border-color: var(--hallbeat-line);
}

.talon-fill-bar span {
  background: var(--hallbeat-blue);
}

.talon-board-rule {
  border-color: rgba(14, 159, 110, 0.2);
  background: #edf6f4;
}

.schedule-date-pill,
.schedule-block-time {
  border-color: rgba(37, 99, 235, 0.2);
  background: #eff6ff;
  color: var(--hallbeat-blue);
}

@media (max-width: 900px) {
  .workspace-app {
    padding-left: 0;
  }

  .workspace-header {
    position: sticky;
    inset: auto;
    width: 100%;
    min-height: 0;
    padding: 8px 10px;
    overflow: visible;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  }

  .workspace-header:hover,
  .workspace-header:focus-within {
    width: 100%;
  }

  .workspace-header.rail-auto-collapsed,
  .workspace-header.rail-auto-collapsed:hover,
  .workspace-header.rail-auto-collapsed:focus-within {
    width: 100%;
  }

  .brand-block {
    width: auto;
    padding: 0;
  }

  .brand-copy,
  .workspace-header .rail-label {
    opacity: 1;
  }

  .workspace-header.rail-auto-collapsed .brand-copy,
  .workspace-header.rail-auto-collapsed .rail-label,
  .workspace-header.rail-auto-collapsed .rail-user-label {
    opacity: 1;
  }

  .brand-subtitle {
    display: none;
  }

  .workspace-tabs {
    order: 3;
    width: 100%;
    flex: 0 0 auto;
    flex-direction: row;
    padding: 5px 0 0;
    overflow-x: auto;
    overflow-y: hidden;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .workspace-tab {
    width: auto;
    min-height: 40px;
    padding: 8px 10px;
  }

  .workspace-meta {
    width: auto;
    margin: 0 0 0 auto;
    padding: 0;
    flex-direction: row;
    border-top: 0;
  }

  .workspace-meta .workspace-account {
    display: none;
  }

  .workspace-meta .btn {
    width: 40px;
    min-height: 40px;
    padding: 10px;
  }

  .workspace-meta .rail-label {
    display: none;
  }

  .notification-drawer {
    top: 72px;
    right: 10px;
    bottom: 10px;
    left: 10px;
    width: auto;
  }
}

@media (max-width: 760px) {
  .auth-gate-panel {
    padding: 28px 22px;
  }

  .auth-gate-panel h1 {
    font-size: 34px;
  }

  .workspace-main {
    width: min(100%, calc(100% - 16px));
    padding-top: 10px;
  }

  .hero-panel {
    padding: 14px;
  }

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

  .stage-card,
  .side-card {
    border-radius: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .workspace-header,
  .brand-copy,
  .rail-label,
  .rail-user-label {
    transition: none;
  }
}
