/* Centro RAL — tema light: primario #003568, secondario nero */

:root {
  --primary: #003568;
  --primary-hover: #00264c;
  --primary-wash: rgba(0, 53, 104, 0.08);
  --primary-ring: rgba(0, 53, 104, 0.35);
  --navy: var(--primary);
  --navy-deep: var(--primary-hover);
  --navy-wash: var(--primary-wash);
  --ink: #0a0a0a;
  --ink-soft: #3d3d3d;
  --ink-mute: #6b6b6b;
  --ink-faint: #9a9a9a;
  --paper: #f3f5f7;
  --blotter: #eceff2;
  --ticket: #ffffff;
  --rule: rgba(10, 10, 10, 0.08);
  --rule-strong: rgba(10, 10, 10, 0.14);
  --focus: var(--primary);
  --danger: #9b1c1c;
  --danger-wash: rgba(155, 28, 28, 0.1);
  --seal: var(--danger);
  --brass: var(--primary);
  --forest: #1f6b3a;
  --lift: 0 1px 2px rgba(10, 10, 10, 0.04);
  --lift-hover: 0 4px 12px rgba(10, 10, 10, 0.08);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --font-display: "Source Sans 3", ui-sans-serif, system-ui, sans-serif;
  --font-ui: "Source Sans 3", ui-sans-serif, system-ui, sans-serif;
  --radius-sm: 8px;
  --radius-md: 10px;
  --space: 8px;
  --aside-width: 15.5rem;
  --topbar-h: 3.5rem;
  --tabbar-h: 4rem;
}

html {
  color-scheme: light;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.app-shell {
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  background: var(--paper);
  color: var(--ink);
  overflow-x: clip;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0, 53, 104, 0.12);
}

.font-display {
  font-family: var(--font-display);
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transform: translateY(-180%);
  transition: transform 140ms var(--ease-out);
}

.skip-link:focus {
  transform: none;
}

.skip-link:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.safe-area-pb {
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
}

/* Quiz a schermo intero: barra alta/bassa nel flusso, scorre solo il contenuto */
.quiz-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
}
.quiz-topbar {
  flex-shrink: 0;
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
.quiz-main {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0.75rem max(0.75rem, env(safe-area-inset-right, 0px)) calc(5.5rem + env(safe-area-inset-bottom, 0px)) max(0.75rem, env(safe-area-inset-left, 0px));
}
.quiz-bottombar {
  /* Fissa al viewport: resta raggiungibile anche se il contenitore flex
     supera l'altezza visibile (quirk 100dvh in alcuni browser mobile/in-app). */
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  min-height: 4rem;
  padding: 0.75rem max(0.75rem, env(safe-area-inset-right, 0px)) max(0.75rem, env(safe-area-inset-bottom, 0px)) max(0.75rem, env(safe-area-inset-left, 0px));
}
.quiz-question,
.quiz-option-text {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ——— Shell ——— */

.app-aside,
.app-mobile-panel,
.app-topbar {
  background: var(--ticket);
  color: var(--ink);
}

.app-aside {
  width: var(--aside-width);
  border-right: 1px solid var(--rule);
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  max-height: 100dvh;
}

.app-aside-brand {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--rule);
}

.app-mark {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  text-decoration: none;
}

.app-mark--topbar {
  max-width: calc(100% - 7rem);
}

.app-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
}

.app-logo--sidebar {
  max-width: 11.5rem;
}

.app-logo--topbar {
  max-height: 2rem;
  width: auto;
}

.app-logo--auth {
  max-width: 13.75rem;
  margin: 0 auto;
}

.app-mark:hover .app-logo {
  opacity: 0.92;
}

.app-mark:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

.app-mark-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  color: var(--primary);
}

.app-mark-name {
  font-family: var(--font-ui);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--primary);
}

.app-mark-sub {
  margin: 8px 0 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.app-aside-nav {
  padding: 12px 10px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
  min-height: 40px;
  transition: background 140ms var(--ease-out), color 140ms var(--ease-out);
}

.app-topbar .nav-link,
.app-aside-brand .nav-link {
  width: auto;
}

.nav-link:hover {
  background: var(--blotter);
  color: var(--ink);
}

.nav-link.is-active {
  background: var(--primary-wash);
  color: var(--primary);
  font-weight: 600;
}

.nav-link:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.nav-link:active {
  transform: scale(0.98);
}

.nav-sub {
  margin: 2px 0 6px 8px;
  padding-left: 10px;
  border-left: 1px solid var(--rule);
}

.nav-sub .nav-link {
  font-size: 13px;
  font-weight: 500;
  min-height: 36px;
  color: var(--ink-mute);
}

.nav-sub .nav-link.is-active {
  color: var(--primary);
  background: transparent;
  font-weight: 600;
}

.nav-chevron {
  color: var(--ink-faint);
  transition: transform 180ms var(--ease-out);
}

.app-aside-foot {
  padding: 12px 10px calc(16px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--rule);
}

.app-aside-user {
  padding: 4px 10px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
}

.app-topbar {
  height: var(--topbar-h);
  border-bottom: 1px solid var(--rule);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

.app-desktop-topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--topbar-h);
  padding: 0 24px;
  border-bottom: 1px solid var(--rule);
  background: var(--ticket);
}

.app-desktop-topbar__right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Ricerca globale admin */
.admin-search {
  position: relative;
}

.admin-search__bar {
  position: relative;
  display: flex;
  align-items: center;
}

.admin-search__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 9999px;
  border: 1px solid var(--rule-strong);
  background: var(--blotter);
  color: var(--ink-mute);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 180ms var(--ease-out), border-color 180ms var(--ease-out), color 180ms var(--ease-out), opacity 160ms var(--ease-out);
}

.admin-search__trigger:hover,
.admin-search.is-open .admin-search__trigger {
  background: #fff;
  border-color: var(--primary);
  color: var(--ink);
}

.admin-search__kbd {
  margin-left: 0.35rem;
  padding: 0.1rem 0.35rem;
  border-radius: 0.35rem;
  border: 1px solid var(--rule);
  background: #fff;
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-mute);
  line-height: 1.2;
}

/* Desktop: barra che si espande alla larghezza del pannello */
.admin-search--desktop {
  width: auto;
  max-width: min(28rem, calc(100vw - 12rem));
}

.admin-search--desktop .admin-search__bar {
  width: 9.75rem;
  min-height: 34px;
  border-radius: 9999px;
  border: 1px solid var(--rule-strong);
  background: var(--blotter);
  overflow: hidden;
  transition:
    width 260ms cubic-bezier(0.23, 1, 0.32, 1),
    background 180ms var(--ease-out),
    border-color 180ms var(--ease-out),
    border-radius 220ms var(--ease-out),
    box-shadow 220ms var(--ease-out);
}

.admin-search--desktop.is-open .admin-search__bar {
  display: flex;
  align-items: center;
  width: min(28rem, calc(100vw - 12rem));
  border-radius: 0.75rem;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px var(--primary-wash);
  overflow: visible;
}

.admin-search--desktop .admin-search__trigger {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: inherit;
  z-index: 2;
  justify-content: flex-start;
}

.admin-search--desktop.is-open .admin-search__trigger {
  position: relative;
  inset: auto;
  left: auto;
  top: auto;
  bottom: auto;
  z-index: 1;
  flex: 0 0 auto;
  width: auto;
  height: 34px;
  min-height: 34px;
  padding: 0 0.35rem 0 0.75rem;
  opacity: 1;
  pointer-events: none;
  color: rgb(148 163 184);
  gap: 0;
}

.admin-search--desktop.is-open .admin-search__trigger-label,
.admin-search--desktop.is-open .admin-search__kbd {
  display: none;
}

.admin-search--desktop .admin-search__input {
  position: absolute;
  inset: 0;
  width: 100%;
  min-height: 34px;
  border: 0;
  border-radius: inherit;
  background: transparent;
  padding: 0.4rem 0.9rem;
  font-size: 0.875rem;
  color: rgb(51 65 85);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms var(--ease-out) 40ms;
}

.admin-search--desktop.is-open .admin-search__input {
  position: relative;
  inset: auto;
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  padding: 0.4rem 0.85rem 0.4rem 0.25rem;
  opacity: 1;
  pointer-events: auto;
}

.admin-search--desktop .admin-search__trigger svg {
  margin-left: 0.1rem;
  flex-shrink: 0;
  display: block;
}

.admin-search__panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: min(28rem, calc(100vw - 2rem));
  max-height: min(70vh, 28rem);
  overflow: auto;
  padding: 0.75rem;
  border-radius: 0.9rem;
  border: 1px solid var(--rule);
  background: #fff;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
  z-index: 60;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 180ms var(--ease-out), transform 220ms cubic-bezier(0.23, 1, 0.32, 1);
}

.admin-search.is-open .admin-search__panel:not([hidden]) {
  opacity: 1;
  transform: translateY(0);
}

.admin-search--desktop .admin-search__panel {
  width: 100%;
}

.admin-search--mobile .admin-search__panel {
  position: fixed;
  top: calc(var(--topbar-h) + 8px);
  left: 1rem;
  right: 1rem;
  width: auto;
}

.admin-search--mobile .admin-search__input {
  display: block;
  width: 100%;
  border-radius: 0.65rem;
  border: 1px solid rgb(203 213 225);
  padding: 0.55rem 0.75rem;
  font-size: 0.875rem;
  color: rgb(51 65 85);
}

.admin-search--mobile .admin-search__input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-wash);
}

.admin-search--desktop .admin-search__input:focus {
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  .admin-search--desktop .admin-search__bar,
  .admin-search--desktop .admin-search__input,
  .admin-search__panel {
    transition: none;
  }
}

.admin-search__hint,
.admin-search__empty {
  margin: 0.65rem 0 0;
  font-size: 0.8125rem;
  color: rgb(148 163 184);
}

.admin-search__group {
  margin: 0.75rem 0 0.35rem;
  padding: 0 0.35rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgb(148 163 184);
}

.admin-search__history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.35rem;
}

.admin-search__history-head .admin-search__group {
  margin: 0;
}

.admin-search__clear {
  border: 0;
  background: transparent;
  padding: 0.15rem 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgb(148 163 184);
  cursor: pointer;
  border-radius: 0.35rem;
}

.admin-search__clear:hover {
  color: rgb(185 28 28);
  background: rgb(254 242 242);
}

.admin-search__row {
  display: flex;
  align-items: stretch;
  gap: 0.15rem;
}

.admin-search__row .admin-search__item {
  flex: 1;
  min-width: 0;
}

.admin-search__remove {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  margin: 0.15rem 0;
  border: 0;
  border-radius: 0.45rem;
  background: transparent;
  color: rgb(148 163 184);
  cursor: pointer;
}

.admin-search__remove:hover {
  background: rgb(254 242 242);
  color: rgb(185 28 28);
}

.admin-search__item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.55rem 0.65rem;
  border-radius: 0.55rem;
  text-decoration: none;
  color: inherit;
}

.admin-search__item:hover,
.admin-search__item:focus-visible {
  background: rgb(238 242 255);
  outline: none;
}

.admin-search__item-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: rgb(30 41 59);
}

.admin-search__item-sub {
  font-size: 0.75rem;
  color: rgb(148 163 184);
}

.app-overlay {
  background: rgba(10, 10, 10, 0.4);
}

.app-tabbar {
  display: none;
}

.app-shell--student .app-tabbar {
  display: flex;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  align-items: stretch;
  justify-content: space-around;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  min-height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding: 4px max(4px, env(safe-area-inset-left, 0px)) calc(4px + env(safe-area-inset-bottom, 0px)) max(4px, env(safe-area-inset-right, 0px));
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--rule);
}

.app-tabbar-item {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  min-height: 44px;
  padding: 4px 0;
  color: var(--ink-mute);
  text-decoration: none;
  border-radius: 10px;
  transition: color 140ms var(--ease-out), background 140ms var(--ease-out);
}

.app-tabbar-item:hover {
  color: var(--primary);
  background: var(--primary-wash);
}

.app-tabbar-item.is-active {
  color: var(--primary);
}

.app-tabbar-item:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.app-tabbar-item:active {
  transform: scale(0.96);
}

.app-tabbar-icon-wrap {
  position: relative;
  display: flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
}

.app-tabbar-icon {
  width: 24px;
  height: 24px;
}

.app-tabbar-item.is-active .app-tabbar-icon {
  stroke-width: 2;
}

.app-tabbar-label {
  font-size: clamp(9px, 2.5vw, 11px);
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.15;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-tabbar-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 1rem;
  height: 1rem;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 1rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.app-hero {
  background: var(--primary);
  color: #fff;
  border-radius: 16px;
  padding: 22px 20px 20px;
  margin-bottom: 20px;
  border: 0;
}

.app-hero .dash-kicker {
  color: rgba(255, 255, 255, 0.72);
}

.app-hero .dash-title {
  color: #fff;
}

.app-hero .dash-lede {
  color: rgba(255, 255, 255, 0.86);
}

.app-hero .dash-date {
  color: rgba(255, 255, 255, 0.7);
}

.app-hero .bacheca-link {
  color: #fff;
  font-weight: 650;
}

.app-hero .bacheca-link:hover {
  text-decoration: underline;
}

.app-shortcuts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 24px;
}

.app-shortcut {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 14px 6px 12px;
  background: var(--ticket);
  border: 1px solid var(--rule);
  border-radius: 14px;
  text-decoration: none;
  color: var(--ink);
  font-size: 11px;
  font-weight: 650;
  text-align: center;
  transition: border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out), transform 120ms var(--ease-out);
}

.app-shortcut:hover {
  border-color: var(--primary);
  box-shadow: var(--lift);
  color: var(--ink);
}

.app-shortcut:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.app-shortcut:active {
  transform: scale(0.97);
}

.app-shortcut-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--primary-wash);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-shortcut-icon svg {
  width: 22px;
  height: 22px;
}

.app-shortcut-label {
  line-height: 1.2;
}

.app-tile {
  display: block;
  background: var(--ticket);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
  transition: border-color 160ms var(--ease-out);
}

a.app-tile:hover {
  border-color: var(--primary);
}

.app-tile:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.app-tile-k {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0;
}

.app-tile-v {
  margin: 6px 0 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.app-tile-m {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--ink-mute);
}

.app-tile--warn .app-tile-k {
  color: #9a5b12;
}

.app-page-head {
  margin-bottom: 20px;
}

.app-page-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin: 0;
  color: var(--ink);
  text-wrap: balance;
}

.app-page-lede {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--ink-mute);
  text-wrap: pretty;
}

.app-sheet {
  background: var(--ticket);
  border: 1px solid var(--rule);
  border-radius: 14px;
  overflow: hidden;
}

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

.app-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 12px 16px;
  text-decoration: none;
  color: inherit;
  border-top: 1px solid var(--rule);
}

.app-list-row:first-child {
  border-top: 0;
}

a.app-list-row:hover {
  background: var(--primary-wash);
}

.app-list-row:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.app-list-row-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.app-list-row-meta {
  font-size: 13px;
  color: var(--ink-mute);
  margin-top: 2px;
}

.app-list-chevron {
  color: var(--ink-faint);
  flex-shrink: 0;
}

.app-test {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 18px 16px;
  background: var(--ticket);
  border: 1px solid var(--rule);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  min-height: 44px;
  transition: border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out), transform 120ms var(--ease-out);
}

.app-test:hover {
  border-color: var(--primary);
  box-shadow: var(--lift);
}

.app-test:active {
  transform: scale(0.98);
}

.app-test:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.app-test-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.app-test-meta {
  font-size: 13px;
  color: var(--ink-mute);
}

.app-test--primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.app-test--primary .app-test-name,
.app-test--primary .app-test-meta {
  color: #fff;
}

.app-test--primary .app-test-meta {
  opacity: 0.82;
}

.app-test--muted {
  background: var(--blotter);
  color: var(--ink-faint);
  pointer-events: none;
}

.app-notice {
  position: relative;
  background: var(--ticket);
  border: 1px solid var(--rule);
  border-radius: 14px;
  overflow: hidden;
}

.app-notice-hit {
  display: block;
  padding: 14px 16px;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.app-notice:has(.app-notice-action) .app-notice-hit {
  padding-bottom: 8px;
}

.app-notice-action {
  position: relative;
  z-index: 1;
  padding: 0 16px 14px;
}

.app-notice:hover {
  border-color: rgba(0, 53, 104, 0.22);
}

.app-notice-hit:hover h3 {
  color: var(--primary);
}

.app-notice-hit:focus-visible {
  outline: none;
}

.app-notice:has(.app-notice-hit:focus-visible) {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.app-notice.is-unread {
  background: var(--primary-wash);
  border-color: rgba(0, 53, 104, 0.28);
  box-shadow: inset 4px 0 0 var(--primary);
}

.app-notice.is-unread h3 {
  font-weight: 700;
}

@media (min-width: 768px) {
  .app-shell--student .app-tabbar {
    display: none;
  }
}

.app-main,
#main-content {
  min-width: 0;
}

@media (max-width: 767px) {
  .app-shell--student #main-content {
    padding-bottom: calc(1.25rem + var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  }

  .app-shell--student .pwa-banner {
    bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: 16px;
  }
}

.app-mobile-panel {
  overscroll-behavior: contain;
  padding-left: env(safe-area-inset-left, 0px);
}

.app-main {
  scroll-margin-top: calc(var(--topbar-h) + 12px);
}

.notice-bell-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  min-width: 40px;
  padding: 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 140ms var(--ease-out), color 140ms var(--ease-out);
}

.notice-bell-btn:hover {
  background: var(--blotter);
  color: var(--ink);
}

.notice-bell-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.notice-bell-count {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 1.125rem;
  height: 1.125rem;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.notice-bell-panel {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 8px;
  width: min(calc(100vw - 2rem), 22rem);
  z-index: 50;
  overflow: hidden;
  background: var(--ticket);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  box-shadow: var(--lift-hover);
  overscroll-behavior: contain;
}

.notice-bell-panel a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.pwa-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 16px 16px 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  background: var(--ink);
  color: #fff;
  box-shadow: 0 -8px 24px rgba(10, 10, 10, 0.12);
}

.pwa-banner-close {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
}

.pwa-banner-close svg {
  width: 18px;
  height: 18px;
}

.pwa-banner-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.pwa-banner-close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -4px;
}

.pwa-banner-inner {
  max-width: 26rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 4px 36px 0 4px;
}

.pwa-banner-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.pwa-banner-copy {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.72);
  text-wrap: pretty;
}

.pwa-banner-steps {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.pwa-banner-steps li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.92);
}

.pwa-banner-steps strong {
  font-weight: 700;
  color: #fff;
}

.pwa-banner-step-icon {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.pwa-banner-step-icon svg {
  width: 18px;
  height: 18px;
}

.pwa-banner-actions {
  display: flex;
  align-items: stretch;
  margin-top: 14px;
}

.pwa-banner .stamp {
  min-height: 40px;
  width: 100%;
}

.pwa-banner .stamp--ghost {
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.pwa-banner .stamp--ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* ——— Dashboard ——— */

.dash {
  max-width: 68rem;
  margin: 0 auto;
}

.letterhead,
.dash-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
  padding-bottom: 24px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--rule);
}

.letterhead-kicker,
.dash-kicker {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0 0 6px;
}

.letterhead-title,
.dash-title {
  font-family: var(--font-ui);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  text-wrap: balance;
  margin: 0;
  color: var(--ink);
}

.letterhead-lede,
.dash-lede {
  margin: 8px 0 0;
  font-size: 15px;
  color: var(--ink-soft);
  text-wrap: pretty;
  max-width: 38rem;
}

.letterhead-date,
.dash-date {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-mute);
  text-align: right;
  white-space: nowrap;
}

.register,
.stat-strip {
  display: grid;
  grid-template-columns: 1fr;
  background: var(--ticket);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  overflow: hidden;
}

@media (min-width: 480px) {
  .stat-strip--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-strip--2 .stat-cell {
    border-top: 1px solid var(--rule);
    border-left: 1px solid var(--rule);
  }

  .stat-strip--2 .stat-cell:nth-child(2n + 1) {
    border-left: 0;
  }

  .stat-strip--2 .stat-cell:nth-child(-n + 2) {
    border-top: 0;
  }

  .stat-strip--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-strip--4 .stat-cell {
    border-top: 1px solid var(--rule);
    border-left: 1px solid var(--rule);
  }

  .stat-strip--4 .stat-cell:nth-child(2n + 1) {
    border-left: 0;
  }

  .stat-strip--4 .stat-cell:nth-child(-n + 2) {
    border-top: 0;
  }
}

.register-cell,
.stat-cell {
  display: block;
  padding: 20px 22px 18px;
  text-decoration: none;
  color: inherit;
  border-top: 1px solid var(--rule);
  min-width: 0;
  transition: background 160ms var(--ease-out);
}

.stat-cell__top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.stat-cell__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  border-radius: 0.75rem;
  background: var(--primary-wash);
  color: var(--primary);
}

.stat-cell__icon svg {
  width: 1.15rem;
  height: 1.15rem;
}

.stat-cell__meta {
  min-width: 0;
  flex: 1;
}

.stat-cell:hover .stat-cell__icon {
  background: #fff;
}

.register-cell:first-child,
.stat-cell:first-child {
  border-top: 0;
}

.register-cell:hover,
.stat-cell:hover {
  background: var(--primary-wash);
}

.register-cell:focus-visible,
.stat-cell:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.register-k,
.stat-k {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-mute);
  margin: 0;
}

.register-v,
.stat-v {
  font-family: var(--font-ui);
  font-size: 2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--ink);
  margin: 8px 0 0;
}

.register-go,
.stat-go {
  display: inline-block;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}

.stamp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  transition: background 140ms var(--ease-out), transform 120ms var(--ease-out), color 140ms var(--ease-out);
}

.stamp:hover {
  background: var(--primary-hover);
  color: #fff;
}

.stamp:active {
  transform: scale(0.97);
}

.stamp:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.stamp--ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--rule-strong);
}

.stamp--ghost:hover {
  background: var(--blotter);
  color: var(--ink);
}

.action-btns {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  border: 1px solid rgba(0, 53, 104, 0.32);
  cursor: pointer;
  white-space: nowrap;
  transition: background 140ms var(--ease-out), border-color 140ms var(--ease-out), color 140ms var(--ease-out), transform 120ms var(--ease-out);
}

.btn-outline:hover {
  background: var(--primary-wash);
  border-color: rgba(0, 53, 104, 0.5);
  color: var(--primary);
  text-decoration: none;
}

.btn-outline:active {
  transform: scale(0.98);
}

.btn-outline:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn-outline--sm {
  min-height: 30px;
  padding: 0 11px;
  font-size: 12px;
  border-radius: 8px;
}

.btn-outline--muted {
  color: var(--ink-mute);
  border-color: var(--rule-strong);
}

.btn-outline--muted:hover {
  background: var(--blotter);
  border-color: var(--rule-strong);
  color: var(--ink);
}

.btn-outline--danger {
  color: #b91c1c;
  border-color: rgba(185, 28, 28, 0.35);
}

.btn-outline--danger:hover {
  background: #fef2f2;
  border-color: rgba(185, 28, 28, 0.5);
  color: #991b1b;
}

.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid #16a34a;
  background: #25d366;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 140ms var(--ease-out), border-color 140ms var(--ease-out), transform 140ms var(--ease-out);
}

.btn-whatsapp:hover {
  background: #1ebe57;
  border-color: #15803d;
  color: #fff;
}

.btn-whatsapp:focus-visible {
  outline: 2px solid #16a34a;
  outline-offset: 2px;
}

.btn-whatsapp:active {
  transform: scale(0.98);
}

.btn-whatsapp--sm {
  min-height: 30px;
  padding: 0 11px;
  font-size: 12px;
  border-radius: 8px;
}

button.btn-outline {
  font-family: inherit;
}

.section-label {
  font-size: 13px;
  font-weight: 650;
  color: var(--ink);
  margin: 0 0 10px;
}

.docket,
.course-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  background: var(--ticket);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  min-width: 0;
  transition: border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}

.docket:hover,
.course-card:hover {
  border-color: var(--primary);
  box-shadow: var(--lift);
}

.docket:focus-visible,
.course-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.docket-body,
.course-card-body {
  padding: 18px 20px 16px;
  min-width: 0;
}

.docket-kicker,
.course-card-kicker {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 6px;
}

.docket-title,
.course-card-title {
  font-family: var(--font-ui);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  text-wrap: balance;
  margin: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.docket-meta,
.course-card-meta {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
}

.docket-meta-k,
.course-card-meta-k {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-mute);
  margin: 0;
}

.docket-meta-v,
.course-card-meta-v {
  margin: 2px 0 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.docket-go,
.course-card-go {
  display: inline-block;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}

.docket-stub,
.course-card-affordance {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  color: var(--ink-faint);
  border-left: 1px solid var(--rule);
}

.docket:hover .docket-stub,
.course-card:hover .course-card-affordance {
  color: var(--primary);
}

.docket-notch {
  display: none;
}

.bacheca {
  background: var(--ticket);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: 16px 18px 12px;
  scroll-margin-top: calc(var(--topbar-h) + 16px);
}

.bacheca-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.bacheca-title {
  font-size: 13px;
  font-weight: 650;
  color: var(--ink);
  letter-spacing: 0;
  text-transform: none;
  margin: 0;
}

.bacheca-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}

.bacheca-link:hover {
  text-decoration: underline;
}

.bacheca-link:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 2px;
}

.bacheca-item {
  display: block;
  padding: 12px 0;
  border-top: 1px solid var(--rule);
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.bacheca-item:first-of-type {
  border-top: 0;
  padding-top: 4px;
}

.bacheca-item:hover .bacheca-item-title {
  color: var(--primary);
}

.bacheca-item:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.bacheca-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  overflow-wrap: anywhere;
}

.bacheca-item-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
}

.bacheca-unread {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
  margin-right: 6px;
  vertical-align: middle;
}

.badge-seal {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--danger-wash);
  color: var(--danger);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.prep {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  padding: 18px 20px;
  background: var(--ticket);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
}

.prep-k {
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  margin: 0 0 8px;
}

.prep-stats {
  display: flex;
  gap: 28px;
}

.prep-stat-v {
  font-family: var(--font-ui);
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
}

.prep-stat-k {
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-mute);
}

.ledger {
  background: var(--ticket);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.ledger-head {
  padding: 14px 18px 10px;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
}

.ledger-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 18px;
  border-top: 1px solid var(--rule);
  text-decoration: none;
  color: inherit;
  min-width: 0;
  transition: background 140ms var(--ease-out);
}

.ledger-row:hover {
  background: var(--primary-wash);
}

.ledger-row:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.ledger-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-when {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-mute);
  white-space: nowrap;
  flex-shrink: 0;
}

.empty-sheet {
  background: var(--ticket);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  text-align: left;
}

.empty-notice {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--ticket);
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 40px 24px 36px;
  box-shadow: var(--lift);
}

.empty-notice-icon {
  display: flex;
  width: 56px;
  height: 56px;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  border-radius: 16px;
  background: var(--primary-wash);
  color: var(--primary);
}

.empty-notice-icon svg {
  width: 26px;
  height: 26px;
}

.empty-notice-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.empty-notice p {
  margin: 8px 0 0;
  max-width: 28ch;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.empty-sheet p {
  margin: 0;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.empty-sheet .stamp {
  margin-top: 16px;
}

.empty-sheet--error {
  border-color: rgba(155, 28, 28, 0.28);
  background: #fffafa;
}

.empty-sheet--error p {
  color: var(--danger);
}

@media (min-width: 768px) {
  .app-desktop-topbar {
    display: flex;
  }
}

@media (min-width: 640px) {
  .register,
  .stat-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

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

  .register-cell,
  .stat-cell {
    border-top: 0;
    border-left: 1px solid var(--rule);
  }

  .register-cell:first-child,
  .stat-cell:first-child {
    border-left: 0;
  }

  /* Griglia 3 colonne: bordi tra le righe + niente doppio bordo a sinistra */
  .stat-strip:not(.stat-strip--2):not(.stat-strip--4) .stat-cell:nth-child(3n + 1) {
    border-left: 0;
  }

  .stat-strip:not(.stat-strip--2):not(.stat-strip--4) .stat-cell:nth-child(n + 4) {
    border-top: 1px solid var(--rule);
  }

  .stat-strip--2 .stat-cell {
    border-top: 0;
    border-left: 1px solid var(--rule);
  }

  .stat-strip--2 .stat-cell:first-child {
    border-left: 0;
  }

  .stat-strip--4 .stat-cell {
    border-top: 0;
    border-left: 1px solid var(--rule);
  }

  .stat-strip--4 .stat-cell:nth-child(2n + 1) {
    border-left: 1px solid var(--rule);
  }

  .stat-strip--4 .stat-cell:nth-child(4n + 1) {
    border-left: 0;
  }

  .stat-strip--4 .stat-cell:nth-child(n + 5) {
    border-top: 1px solid var(--rule);
  }

  .letterhead-title,
  .dash-title {
    font-size: 2rem;
  }
}

@media (max-width: 639px) {
  .letterhead-date,
  .dash-date {
    text-align: left;
    white-space: normal;
  }

  .letterhead-title,
  .dash-title {
    font-size: 1.5rem;
  }

  .register-v,
  .stat-v {
    font-size: 1.75rem;
  }
}

/* Tailwind indigo (#4f46e5) → primary #003568 */
.bg-indigo-50,
.file\:bg-indigo-50::file-selector-button {
  background-color: var(--primary-wash) !important;
}
.bg-indigo-100,
.hover\:bg-indigo-100:hover {
  background-color: var(--primary-wash) !important;
}
.bg-indigo-600 {
  background-color: var(--primary) !important;
}
.hover\:bg-indigo-700:hover {
  background-color: var(--primary-hover) !important;
}
.text-indigo-200 {
  color: rgba(255, 255, 255, 0.78) !important;
}
.text-indigo-600,
.file\:text-indigo-700::file-selector-button,
.text-indigo-700 {
  color: var(--primary) !important;
}
.hover\:text-indigo-600:hover,
.hover\:text-indigo-700:hover {
  color: var(--primary) !important;
}
.border-indigo-200 {
  border-color: rgba(0, 53, 104, 0.22) !important;
}
.border-indigo-300,
.hover\:border-indigo-300:hover {
  border-color: rgba(0, 53, 104, 0.35) !important;
}
.border-indigo-600 {
  border-color: var(--primary) !important;
}
.focus\:border-indigo-500:focus {
  border-color: var(--primary) !important;
}
.focus\:ring-indigo-500:focus,
.focus\:ring-indigo-500\/20:focus {
  --tw-ring-color: rgba(0, 53, 104, 0.35);
}

@media (prefers-reduced-motion: reduce) {
  .skip-link,
  .nav-link,
  .stamp,
  .btn-outline,
  .docket,
  .course-card,
  .register-cell,
  .stat-cell,
  .nav-chevron,
  .notice-bell-btn,
  .ledger-row,
  .mobile-panel,
  .app-tabbar-item,
  .app-shortcut,
  .app-test {
    transition: none;
  }

  .docket:hover,
  .docket:active,
  .course-card:hover,
  .stamp:active,
  .btn-outline:active,
  .nav-link:active,
  .register-cell:active,
  .stat-cell:active,
  .app-tabbar-item:active,
  .app-shortcut:active,
  .app-test:active {
    transform: none;
  }
}

/* Editor WYSIWYG (Quill) e contenuti HTML corsi */
.rich-editor {
  border: 1px solid rgb(203 213 225);
  border-radius: 0.75rem;
  overflow: hidden;
  background: #fff;
}

.rich-editor .ql-toolbar.ql-snow {
  border: 0;
  border-bottom: 1px solid rgb(226 232 240);
  background: rgb(248 250 252);
  font-family: inherit;
}

.rich-editor .ql-container.ql-snow {
  border: 0;
  font-family: inherit;
  font-size: 0.875rem;
}

.rich-editor .ql-editor {
  min-height: 17.5rem;
  line-height: 1.6;
  color: rgb(51 65 85);
}

.rich-editor .ql-editor.ql-blank::before {
  color: rgb(148 163 184);
  font-style: normal;
}

.rich-text-content p {
  margin: 0 0 0.75rem;
}

.rich-text-content p:last-child {
  margin-bottom: 0;
}

.rich-text-content h2,
.rich-text-content h3 {
  color: rgb(30 41 59);
  font-weight: 600;
  margin: 1.25rem 0 0.5rem;
}

.rich-text-content h2 {
  font-size: 1.125rem;
}

.rich-text-content h3 {
  font-size: 1rem;
}

.rich-text-content ul,
.rich-text-content ol {
  margin: 0 0 0.75rem 1.25rem;
  padding: 0;
}

.rich-text-content li {
  margin-bottom: 0.25rem;
}

.rich-text-content blockquote {
  margin: 0 0 0.75rem;
  padding: 0.5rem 0 0.5rem 1rem;
  border-left: 3px solid rgba(0, 53, 104, 0.25);
  color: rgb(71 85 105);
}

.rich-text-content a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Elenco checkbox ricercabile (studenti / classi / corsi): altezza fissa + scroll */
.checklist-scroll {
  max-height: min(20rem, 50vh);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.member-dialog {
  margin: auto;
  border: 0;
  padding: 0;
}

.member-dialog--wide {
  max-width: 36rem;
}

.member-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.member-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgb(241 245 249);
}

.member-dialog__title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: rgb(30 41 59);
}

.member-dialog__subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: rgb(100 116 139);
}

.member-dialog__close {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin: -0.25rem -0.25rem 0 0;
  padding: 0;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: rgb(100 116 139);
  cursor: pointer;
  transition: background 140ms var(--ease-out), color 140ms var(--ease-out);
}

.member-dialog__close:hover {
  background: rgb(241 245 249);
  color: rgb(51 65 85);
}

.member-dialog__close:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.member-dialog__body {
  padding: 1.25rem;
}

.member-dialog__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.875rem 1.25rem 1.25rem;
  border-top: 1px solid rgb(241 245 249);
}

.member-dialog__footer--split {
  justify-content: space-between;
}

.app-modal__panel {
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
  overflow: hidden;
}

.enrolled-row {
  transition: background 140ms var(--ease-out);
}

.add-row.hidden {
  display: none;
}

.user-avatar {
  display: block;
  border-radius: 9999px;
  object-fit: cover;
  flex-shrink: 0;
}

.user-avatar--sm {
  width: 2rem;
  height: 2rem;
}

.user-avatar--md {
  width: 2.5rem;
  height: 2.5rem;
}

.user-avatar--lg {
  width: 4rem;
  height: 4rem;
}

.user-avatar--xl {
  width: 6rem;
  height: 6rem;
}

.user-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgb(224 231 255);
  color: rgb(67 56 202);
  font-weight: 600;
  line-height: 1;
}

.user-avatar--sm.user-avatar-fallback {
  font-size: 0.6875rem;
}

.user-avatar--md.user-avatar-fallback,
.user-avatar--lg.user-avatar-fallback {
  font-size: 0.875rem;
}

.user-avatar--xl.user-avatar-fallback {
  font-size: 1.25rem;
}

.user-avatar-link {
  display: inline-flex;
  border-radius: 9999px;
  transition: opacity 140ms var(--ease-out);
}

.user-avatar-link:hover {
  opacity: 0.88;
}

.app-aside-user-link {
  color: inherit;
  text-decoration: none;
  border-radius: 0.75rem;
  padding: 0.25rem;
  margin: -0.25rem;
  transition: background 140ms var(--ease-out);
}

.app-aside-user-link:hover {
  background: rgb(241 245 249);
}

.app-aside-user-link .app-aside-user {
  margin: 0;
}

/* Selettore corso (group button) */
.course-seg {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 0;
  width: auto;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border: 1px solid rgb(203 213 225);
  border-radius: 0.75rem;
  background: #fff;
  vertical-align: top;
}

.course-seg::-webkit-scrollbar {
  display: none;
}

.course-seg__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
  padding: 0.5rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgb(71 85 105);
  text-decoration: none;
  border-right: 1px solid rgb(226 232 240);
  background: #fff;
  white-space: nowrap;
  transition: background 140ms var(--ease-out), color 140ms var(--ease-out);
}

.course-seg__btn:last-child {
  border-right: 0;
}

.course-seg__btn:hover {
  background: rgb(248 250 252);
  color: rgb(30 41 59);
}

.course-seg__btn.is-active {
  background: var(--primary);
  color: #fff;
}

.course-seg__btn.is-active:hover {
  background: var(--primary-hover);
  color: #fff;
}

.course-seg__btn--date {
  position: relative;
  cursor: pointer;
  gap: 0.5rem;
  border: 0;
  font: inherit;
  appearance: none;
}

.course-seg__btn--date .course-seg__date-label {
  font-variant-numeric: tabular-nums;
}

.date-nav {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}

.date-picker-pop {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  z-index: 40;
  width: 17.5rem;
  padding: 0.75rem;
  background: #fff;
  border: 1px solid rgb(226 232 240);
  border-radius: 1rem;
  box-shadow: 0 18px 40px -16px rgb(15 23 42 / 0.28);
}

.date-picker-pop.hidden {
  display: none;
}

.date-picker-pop__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.date-picker-pop__title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: rgb(30 41 59);
  text-align: center;
  flex: 1;
}

.date-picker-pop__nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: rgb(71 85 105);
  cursor: pointer;
}

.date-picker-pop__nav:hover {
  background: rgb(241 245 249);
  color: rgb(30 41 59);
}

.date-picker-pop__weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.15rem;
  margin-bottom: 0.35rem;
}

.date-picker-pop__weekdays span {
  text-align: center;
  font-size: 0.6875rem;
  font-weight: 600;
  color: rgb(148 163 184);
  line-height: 1.5rem;
}

.date-picker-pop__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.15rem;
}

.date-picker-pop__day {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  border: 0;
  border-radius: 0.55rem;
  background: transparent;
  color: rgb(51 65 85);
  font-size: 0.8125rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.date-picker-pop__day.is-empty {
  visibility: hidden;
  pointer-events: none;
}

.date-picker-pop__day:hover {
  background: rgb(241 245 249);
}

.date-picker-pop__day.is-today {
  box-shadow: inset 0 0 0 1px rgb(203 213 225);
}

.date-picker-pop__day.is-selected {
  background: var(--primary);
  color: #fff;
}

.date-picker-pop__day.is-selected:hover {
  background: var(--primary-hover);
  color: #fff;
}

.date-picker-pop__foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgb(241 245 249);
}

.course-seg__pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 9999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1;
}

.course-seg__btn.is-active .course-seg__pill {
  background: #fff;
  color: #b91c1c;
}

/* Pill su tab corso (evita override del text-indigo del tab attivo) */
[role="tablist"] .course-seg__pill {
  background: #dc2626;
  color: #fff;
  flex-shrink: 0;
}
.student-search {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  width: 100%;
  max-width: 28rem;
}

.student-search__input {
  display: block;
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid rgb(203 213 225);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: rgb(51 65 85);
  background: #fff;
}

.student-search__input:focus {
  outline: 2px solid rgb(99 102 241 / 0.35);
  outline-offset: 1px;
  border-color: rgb(129 140 248);
}

.student-search select {
  width: 100%;
}

/* Combobox studenti (select + ricerca unificate) */
.student-combo {
  position: relative;
  width: 100%;
  max-width: 28rem;
}

.student-combo__native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.student-combo__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid rgb(203 213 225);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: rgb(51 65 85);
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.student-combo__trigger.is-placeholder .student-combo__label {
  color: rgb(148 163 184);
}

.student-combo.is-open .student-combo__trigger,
.student-combo__trigger:focus-visible {
  outline: 2px solid rgb(99 102 241 / 0.35);
  outline-offset: 1px;
  border-color: rgb(129 140 248);
}

.student-combo__label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-combo__chevron {
  flex-shrink: 0;
  color: rgb(148 163 184);
  display: inline-flex;
}

.student-combo.is-open .student-combo__chevron {
  transform: rotate(180deg);
}

.student-combo__panel {
  position: absolute;
  z-index: 40;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid rgb(226 232 240);
  border-radius: 0.875rem;
  box-shadow: 0 12px 28px rgb(15 23 42 / 0.12);
  overflow: hidden;
}

.student-combo__search {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgb(226 232 240);
  padding: 0.65rem 0.85rem;
  font-size: 0.875rem;
  color: rgb(51 65 85);
  background: rgb(248 250 252);
}

.student-combo__search:focus {
  outline: none;
  background: #fff;
}

.student-combo__list {
  max-height: 14rem;
  overflow-y: auto;
  padding: 0.35rem;
}

.student-combo__option {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 0.55rem;
  background: transparent;
  padding: 0.5rem 0.65rem;
  font-size: 0.875rem;
  color: rgb(51 65 85);
  cursor: pointer;
}

.student-combo__option:hover,
.student-combo__option:focus-visible {
  background: rgb(238 242 255);
  outline: none;
}

.student-combo__option.is-selected {
  background: rgb(224 231 255);
  color: rgb(67 56 202);
  font-weight: 600;
}

.student-combo__empty {
  margin: 0;
  padding: 0.85rem;
  font-size: 0.8125rem;
  color: rgb(148 163 184);
  text-align: center;
}

/* Ordinamento colonne tabelle */
.table-sort__th {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.table-sort__th::after {
  content: '↕';
  display: inline-block;
  margin-left: 0.35em;
  opacity: 0.28;
  font-size: 0.75em;
  vertical-align: middle;
}

.table-sort__th:hover::after,
.table-sort__th:focus-visible::after {
  opacity: 0.7;
}

.table-sort__th.is-sorted-asc::after {
  content: '↑';
  opacity: 1;
  color: rgb(79 70 229);
}

.table-sort__th.is-sorted-desc::after {
  content: '↓';
  opacity: 1;
  color: rgb(79 70 229);
}

.table-sort__th:focus-visible {
  outline: 2px solid rgb(99 102 241 / 0.45);
  outline-offset: 2px;
}

/* Tab pagina corso: scroll orizzontale su mobile */
.app-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-bottom: 1px solid var(--rule);
  margin: 0 0 20px;
  scroll-padding-inline: 12px;
}

.app-tabs::-webkit-scrollbar {
  display: none;
}

.app-tabs-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  min-height: 44px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-mute);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.app-tabs-item:hover {
  color: var(--ink);
}

.app-tabs-item.is-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.app-tabs-item:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.aula-hero {
  margin: 8px 0 20px;
}

.aula-hero-k {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}

.aula-hero-course {
  margin: 0 0 6px;
  font-size: 0.9375rem;
  font-weight: 650;
  line-height: 1.35;
  color: var(--primary);
  text-wrap: pretty;
}

.aula-hero-title {
  margin: 0;
  font-size: clamp(2rem, 7.2vw, 2.85rem);
  font-weight: 750;
  letter-spacing: -0.045em;
  line-height: 1.12;
  color: var(--ink);
  text-wrap: balance;
}

/* Tabelle: card su mobile, tabella da md in su */
.data-stack {
  display: grid;
  gap: 10px;
}

.data-card {
  background: var(--ticket);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 14px 16px;
}

.data-card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.data-card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.data-card-meta {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--ink-mute);
}

.data-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  font-size: 14px;
}

.data-card-k {
  color: var(--ink-mute);
  font-size: 12px;
  font-weight: 600;
}

.data-card-v {
  color: var(--ink);
  font-weight: 600;
  text-align: right;
}

.lesson-card {
  display: grid;
  grid-template-columns: 4.25rem minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  background: var(--ticket);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 14px;
}

.lesson-card-cal {
  text-align: center;
  background: var(--primary-wash);
  color: var(--primary);
  border-radius: 10px;
  padding: 8px 4px;
}

.lesson-card-dow {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.lesson-card-day {
  display: block;
  margin-top: 2px;
  font-size: 16px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.lesson-card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.lesson-card-extra {
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}

.lesson-card-topic {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.4;
  white-space: pre-wrap;
}

.lesson-card-topic-k {
  display: block;
  margin-bottom: 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.lesson-card-meta {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--ink-mute);
}

.lesson-card.is-past {
  opacity: 0.72;
}

.data-table-wrap {
  display: none;
  background: var(--ticket);
  border: 1px solid var(--rule);
  border-radius: 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 768px) {
  .data-stack {
    display: none;
  }

  .data-table-wrap {
    display: block;
  }
}
