/* ============================================================
   layout.css — SPU-LMS 2.0 BOLD
   Navbar dark impatto, sidebar con colori vividi, login cinematica.
   ============================================================ */

/* ─── APP SHELL ─── */
.app-shell {
  display: grid;
  grid-template-rows: 120px 1fr;
  grid-template-columns: 160px 1fr;
  grid-template-areas: "navbar navbar" "sidebar main";
  min-height: 100vh;
}

/* ─── NAVBAR ─── */
.navbar {
  grid-area: navbar;
  background: #ffffff;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: stretch;
  padding: 0;
  z-index: var(--z-navbar);
  position: sticky; top: 0;
  border-bottom: 3px solid #c9a84c;
  box-shadow: 0 2px 14px rgba(15,32,68,0.06);
  animation: slideDown 0.35s both;
  overflow: hidden;
}
/* Blocco navy diagonale a sinistra col logo */
.navbar > .navbar__brand {
  background: linear-gradient(135deg, var(--color-navy-dark), var(--color-navy));
  height: 100%;
  display: flex; align-items: center;
  padding: 0 52px 0 28px;
  justify-self: start;
  clip-path: polygon(0 0, 100% 0, calc(100% - 36px) 100%, 0 100%);
  min-width: 320px;
}
/* Zona centrale bianca: nav orizzontale */
.navbar__center {
  background: #ffffff;
  height: 100%;
  display: flex; align-items: center; justify-content: flex-start;
  padding: 0 0 0 24px;
  position: relative; z-index: 2;
}
.navbar__nav {
  display: flex; align-items: center; gap: 2px;
}
.navbar__nav-link {
  color: #5a6680;
  font-size: 13px; font-weight: 600;
  padding: 9px 15px;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
  position: relative;
}
.navbar__nav-link:hover { color: var(--color-navy); background: #eef1f7; }
.navbar__nav-link--active { color: var(--color-navy); background: #eef1f7; }
.navbar__nav-link--active::after {
  content: '';
  position: absolute; left: 15px; right: 15px; bottom: 3px;
  height: 2px; background: #c9a84c; border-radius: 2px;
}
/* Fascia destra: avatar */
.navbar > .navbar__right {
  background: transparent;
  height: 100%;
  display: flex; align-items: center; justify-content: flex-end;
  gap: var(--space-3);
  padding-right: 28px;
  justify-self: end;
}
/* Avatar cliccabile navbar desktop */
.navbar__avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-navy), var(--color-navy-dark));
  color: #c9a84c;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px;
  border: 2px solid #c9a84c;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.navbar__avatar:hover { transform: scale(1.06); box-shadow: 0 4px 14px rgba(201,168,76,0.4); }

.navbar__brand {
  display: flex; align-items: center; gap: var(--space-1);
  text-decoration: none;
}
.navbar__logo {
  height: 110px; width: auto;
  transition: transform var(--transition-bounce);
}
.navbar__logo:hover {
  transform: scale(1.04);
  filter: drop-shadow(0 4px 16px rgba(201,168,76,0.6));
}
.navbar__title { display: none; }

.navbar__right { display: flex; align-items: center; gap: var(--space-2); padding-right: 16px; }
.navbar__tool { position: relative; border-radius: 8px; transition: background .15s; }
.navbar__tool:hover { background: #eef1f7; }
.navbar__tool-badge {
  display: none; position: absolute; top: 2px; right: 2px;
  background: #c0392b; color: #fff; font-size: 9px; font-weight: 700;
  min-width: 15px; height: 15px; border-radius: 8px; padding: 0 3px;
  align-items: center; justify-content: center; border: 1.5px solid #fff;
}

.navbar__edition {
  font-size: 10px; font-weight: var(--font-weight-black);
  color: var(--color-gold);
  text-transform: uppercase; letter-spacing: var(--letter-spacing-widest);
  background: rgba(201,168,76,0.12);
  padding: 5px 12px; border-radius: var(--radius-full);
  border: 1px solid rgba(201,168,76,0.3);
}

.navbar__user-name {
  font-size: var(--font-size-sm); color: rgba(255,255,255,0.8);
  font-weight: var(--font-weight-medium);
}

.navbar__logout {
  font-size: 11px; font-weight: var(--font-weight-semibold);
  color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-md);
  padding: 6px 12px; cursor: pointer;
  transition: all var(--transition-fast);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.navbar__logout:hover {
  color: #fff;
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.25);
}

/* ─── SIDEBAR ─── */
.sidebar {
  grid-area: sidebar;
  background: var(--color-white);
  border-right: 1px solid var(--color-border);
  padding: 10px 0;
  overflow-y: auto;
  position: sticky; top: 0;
  height: calc(100vh - 120px);
  animation: slideInLeft 0.35s 0.05s both;
}

.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 2px; }

.sidebar__section { margin-bottom: var(--space-2); }

.sidebar__section-label {
  font-size: 10px; font-weight: var(--font-weight-black);
  text-transform: uppercase; letter-spacing: var(--letter-spacing-widest);
  color: var(--color-text-light);
  padding: 0 var(--space-6); margin-bottom: var(--space-3);
}

.sidebar__nav { display: flex; flex-direction: column; }

.sidebar__link {
  display: flex; align-items: center; gap: var(--space-1);
  padding: 7px 12px;
  font-size: var(--font-size-sm); font-weight: var(--font-weight-medium);
  color: var(--color-text-muted);
  text-decoration: none; cursor: pointer;
  transition: all var(--transition-fast);
  border-left: 3px solid transparent;
  margin: 1px var(--space-3);
  border-radius: var(--radius-md);
}
.sidebar__link:hover {
  background: var(--color-surface);
  color: var(--color-navy);
  text-decoration: none;
  border-left-color: transparent;
}
.sidebar__link--active {
  background: linear-gradient(90deg, rgba(30,58,110,0.08) 0%, rgba(30,58,110,0.04) 100%);
  color: var(--color-navy);
  border-left-color: var(--color-navy);
  font-weight: var(--font-weight-semibold);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-left: 0;
}

.sidebar__link-icon {
  font-size: 16px; width: 20px; text-align: center; flex-shrink: 0;
  transition: transform var(--transition-spring);
}
.sidebar__link:hover .sidebar__link-icon,
.sidebar__link--active .sidebar__link-icon {
  transform: scale(1.2);
}
.sidebar__link--active .sidebar__link-icon { color: var(--color-navy); }

/* ─── MAIN ─── */
.main-content {
  grid-area: main;
  padding: var(--space-5) var(--space-6);
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
  background: var(--color-bg);
  animation: fadeIn 0.4s 0.1s both;
}
/* Faculty dashboard ha il proprio wrapper con padding interno */
.main-content[style*="padding:0"] { padding: 0 !important; }

.page-header {
  margin-bottom: var(--space-2);
  animation: fadeIn 0.4s 0.15s both;
}
.page-header__title {
  font-size: var(--font-size-2xl); font-weight: var(--font-weight-black);
  color: var(--color-navy-dark); letter-spacing: var(--letter-spacing-tight);
}
.page-header__subtitle {
  font-size: var(--font-size-sm); color: var(--color-text-muted); margin-top: 4px;
}

/* ─── GRID ─── */
.grid-cols-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-1); }
.grid-cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-1); }
.grid-cols-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-1); }
.grid-cols-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--space-1); }

/* Stagger children */
.grid-cols-2 > *:nth-child(1), .grid-cols-3 > *:nth-child(1), .grid-cols-4 > *:nth-child(1) { animation: fadeIn 0.4s 0.1s both; }
.grid-cols-2 > *:nth-child(2), .grid-cols-3 > *:nth-child(2), .grid-cols-4 > *:nth-child(2) { animation: fadeIn 0.4s 0.16s both; }
.grid-cols-2 > *:nth-child(3), .grid-cols-3 > *:nth-child(3), .grid-cols-4 > *:nth-child(3) { animation: fadeIn 0.4s 0.22s both; }
.grid-cols-4 > *:nth-child(4) { animation: fadeIn 0.4s 0.28s both; }

/* ─── LOGIN ─── */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 460px;
}

.login-left {
  background: var(--color-navy-dark);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: var(--space-16);
  position: relative; overflow: hidden;
}

/* Pattern geometrico sfondo */
.login-left::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(201,168,76,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201,168,76,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* Cerchio grande gold */
.login-left::after {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border: 1px solid rgba(201,168,76,0.08);
  border-radius: 50%;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  /* NO borderPulse loop */
}

.login-left__content {
  position: relative; z-index: 1;
  text-align: center;
  animation: fadeIn 0.8s both;
}

.login-left__logo {
  width: 260px; height: auto;
  margin: 0 auto var(--space-10);
  animation: fadeIn 0.8s both;
  filter: drop-shadow(0 16px 40px rgba(201,168,76,0.5));
}

.login-left__tagline {
  font-size: var(--font-size-lg); font-weight: var(--font-weight-light);
  color: rgba(255,255,255,0.65);
  line-height: var(--line-height-loose);
  max-width: 360px; font-style: italic;
  animation: fadeIn 0.8s 0.3s both;
}

.login-left__edition {
  margin-top: var(--space-8);
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-size: 10px; font-weight: var(--font-weight-black);
  color: var(--color-gold);
  text-transform: uppercase; letter-spacing: var(--letter-spacing-widest);
  background: rgba(201,168,76,0.08);
  padding: var(--space-2) var(--space-6);
  border-radius: var(--radius-full);
  border: 1px solid rgba(201,168,76,0.2);
  animation: fadeIn 0.8s 0.5s both;
}

.login-left__colors {
  display: flex; gap: var(--space-1); justify-content: center;
  margin-top: var(--space-6);
  animation: fadeIn 0.8s 0.7s both;
}

.login-left__color-dot {
  width: 10px; height: 10px; border-radius: 50%;
  animation: fadeIn 0.8s both;
}

.login-right {
  background: var(--color-white);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 100vh;
  padding: var(--space-12) var(--space-10);
  box-shadow: -12px 0 48px rgba(0,0,0,0.15);
  animation: slideInRight 0.5s 0.15s both;
  position: relative;
}

/* Linea oro verticale sinistra del form */
.login-right::before {
  content: '';
  position: absolute; top: 20%; left: 0; bottom: 20%;
  width: 3px;
  background: linear-gradient(180deg, transparent, var(--color-gold), transparent);
}

.login-form-wrap { width: 100%; max-width: 340px; }

.login-form-wrap__heading {
  font-size: var(--font-size-2xl); font-weight: var(--font-weight-black);
  color: var(--color-navy-dark); margin-bottom: var(--space-2);
  letter-spacing: var(--letter-spacing-tight);
}
.login-form-wrap__sub {
  font-size: var(--font-size-sm); color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}
.login-form { display: flex; flex-direction: column; gap: var(--space-1); }

.login-footer {
  margin-top: auto; padding-top: var(--space-8);
  text-align: center; font-size: var(--font-size-xs);
  color: var(--color-text-light);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 1024px) {
  .app-shell { grid-template-columns: 140px 1fr; }
  .main-content { padding: var(--space-2); }
  .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .app-shell { grid-template-columns: 1fr; grid-template-rows: 60px 1fr; grid-template-areas: "navbar" "main"; }

  .sidebar { display: none; position: fixed; top: 60px; left: 0; bottom: 0; width: 260px; z-index: var(--z-dropdown); box-shadow: var(--shadow-xl); }
  .sidebar--open { display: block; }
  .main-content { padding: var(--space-2); }
  .login-page { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .login-left { padding: var(--space-2) var(--space-6); min-height: 200px; }
  .login-left__logo { width: 140px; margin-bottom: var(--space-2); }
  .login-left__tagline { display: none; }
  .login-right { padding: var(--space-2) var(--space-5); justify-content: flex-start; }
  .grid-cols-2,.grid-cols-3,.grid-cols-4 { grid-template-columns: 1fr; }
  .toast-container { bottom: var(--space-4); right: var(--space-4); left: var(--space-4); max-width: 100%; width: auto; }
}


/* ═══════════════════════════════════════════════════
   MOBILE NAVIGATION v2.0 — SPU-LMS nuovo layout
   Layout: navbar logo+ham | hero con avatar | griglia 2×2 settimane colorate
   ═══════════════════════════════════════════════════ */

/* ── Animazioni ── */
@keyframes spu-fadeUp   { from { opacity:0; transform:translateY(14px); } to { opacity:1; transform:translateY(0); } }
@keyframes spu-scaleIn  { from { opacity:0; transform:scale(0.93); } to { opacity:1; transform:scale(1); } }
@keyframes spu-slideDown{ from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:translateY(0); } }
@keyframes spu-pulse    { 0%,100%{ box-shadow:0 0 0 0 rgba(30,58,110,0.4); } 60%{ box-shadow:0 0 0 7px rgba(30,58,110,0); } }
@keyframes spu-dot-blink{ 0%,100%{ opacity:1; } 50%{ opacity:0.3; } }

/* ── HAMBURGER BUTTON (navbar desktop e mobile) ── */
#btn-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 9px;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  flex-direction: column;
  gap: 4px;
  transition: background 0.15s;
}
#btn-hamburger:active { background: rgba(255,255,255,0.2); }
#btn-hamburger span {
  display: block;
  width: 16px;
  height: 1.8px;
  background: rgba(255,255,255,0.85);
  border-radius: 2px;
  transition: all 0.25s;
  transform-origin: center;
}

/* ── BOTTOM NAV BAR ── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: var(--z-navbar);
  background: var(--color-white);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.09);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bottom-nav__inner {
  display: flex;
  align-items: stretch;
  height: 68px;
}

/* Tab standard */
.bottom-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.bottom-nav__item:active { background: var(--color-surface); }

/* Indicatore attivo — linea in cima */
.bottom-nav__item--active::before {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 2.5px;
  background: var(--color-navy);
  border-radius: 0 0 3px 3px;
}

.bottom-nav__icon {
  font-size: 1.5rem;
  line-height: 1;
  color: #5a6680;
  transition: color 0.15s, transform 0.2s;
}
.bottom-nav__item--active .bottom-nav__icon {
  color: var(--color-navy);
  transform: scale(1.12);
}

.bottom-nav__label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #5a6680;
  transition: color 0.15s;
}
.bottom-nav__item--active .bottom-nav__label { color: var(--color-navy); }

/* Badge contatore */
.bottom-nav__badge {
  position: absolute;
  top: 5px;
  right: calc(50% - 17px);
  background: var(--color-gold);
  color: var(--color-navy-dark);
  font-size: 7px;
  font-weight: 900;
  min-width: 13px;
  height: 13px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 2px;
}

/* ── TAB LPP CENTRALE — bubble allineata (no rialzo) ── */
.bottom-nav__item--lpp {
  flex: 1;
  position: relative;
  top: 0;
}
.bottom-nav__item--lpp .bottom-nav__lpp-bubble {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--color-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  margin-bottom: 1px;
  transition: transform 0.2s;
}
.bottom-nav__item--lpp:active .bottom-nav__lpp-bubble { transform: scale(0.92); }
.bottom-nav__item--lpp .bottom-nav__icon { color: var(--color-gold); font-size: 1.25rem; }
.bottom-nav__item--lpp .bottom-nav__label { color: var(--color-navy); font-weight: 800; }
.bottom-nav__item--lpp.bottom-nav__item--active .bottom-nav__lpp-bubble { background: var(--color-gold); }
.bottom-nav__item--lpp.bottom-nav__item--active .bottom-nav__icon { color: var(--color-navy-dark); }

/* ── WEEK CARDS — 4 colori tematici ── */
.week-card-colored {
  border-radius: 16px;
  padding: 14px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  border: none;
  transition: transform 0.18s, opacity 0.18s;
}
.week-card-colored:active { transform: scale(0.96); }
.week-card-colored::after {
  content: '';
  position: absolute;
  right: -16px; bottom: -16px;
  width: 70px; height: 70px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
}

/* W1 — verde mediterraneo */
.week-card-colored--w1 { background: linear-gradient(135deg, #1a6e4e 0%, #0f4a33 100%); }
/* W2 — blu navy (live) */
.week-card-colored--w2 { background: linear-gradient(135deg, #1e3a6e 0%, #0f2044 100%); box-shadow: 0 4px 20px rgba(30,58,110,0.35); }
/* W3 — viola geopolitica */
.week-card-colored--w3 { background: linear-gradient(135deg, #5b2d8e 0%, #3d1d6e 100%); opacity: 0.72; }
/* W4 — oro ONU */
.week-card-colored--w4 { background: linear-gradient(135deg, #7a5c1e 0%, #5a400d 100%); opacity: 0.72; }

.week-card-colored__num {
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.55);
  margin-bottom: 5px;
}
.week-card-colored__title {
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 10px;
  position: relative; z-index: 1;
}
.week-card-colored__badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 7px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  position: relative; z-index: 1;
}
.week-badge--done  { background: rgba(255,255,255,0.18); color: #fff; }
.week-badge--live  { background: rgba(255,255,255,0.95); color: #1e3a6e; animation: spu-pulse 2s infinite; }
.week-badge--soon  { background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.65); }
.week-badge__dot   { width: 5px; height: 5px; border-radius: 50%; background: #e74c3c; animation: spu-dot-blink 1.2s infinite; flex-shrink: 0; }

/* Griglia 2×2 per le settimane su mobile */
.weeks-grid-2x2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

/* ── PAGE HEADER — pagine interne ── */
.page-header-inner {
  background: var(--color-navy-dark);
  padding: 20px 16px 14px;
  animation: spu-slideDown 0.3s both;
}
.page-header-inner__main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.page-header-inner__left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.page-header-inner__back {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: rgba(255,255,255,0.45);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
}
.page-header-inner__title {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1;
}
.page-header-inner__sub {
  font-size: 9px;
  color: rgba(255,255,255,0.38);
  margin-top: 2px;
}
.page-header-inner__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  flex-shrink: 0;
}
.page-header-inner__logo {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  text-decoration: none;
}
.page-header-inner__logo-text { line-height: 1.25; text-align: right; }
.page-header-inner__logo-name {
  font-size: 10px;
  font-weight: 800;
  color: rgba(255,255,255,0.88);
  letter-spacing: 0.01em;
}
.page-header-inner__logo-sub {
  font-size: 8px;
  font-weight: 600;
  color: rgba(201,168,76,0.82);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.page-header-inner__ham {
  width: 34px; height: 34px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 9px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px; cursor: pointer;
  transition: background 0.15s;
}
.page-header-inner__ham:active { background: rgba(255,255,255,0.2); }
.page-header-inner__ham span {
  display: block;
  width: 16px; height: 1.8px;
  background: rgba(255,255,255,0.85);
  border-radius: 2px;
}

/* Tab filtro nelle pagine interne */
.page-tabs {
  display: flex;
  background: rgba(255,255,255,0.07);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.page-tab {
  flex: 1;
  text-align: center;
  font-size: 9px;
  font-weight: 700;
  padding: 5px 0;
  border-radius: 8px;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  transition: all 0.2s;
  background: none;
  border: none;
}
.page-tab--active { background: rgba(255,255,255,0.13); color: #fff; }

/* ── HERO CARD (dashboard) ── */
.hero-card-mobile {
  margin: 12px 12px 0;
  background: linear-gradient(135deg, #1e3a6e 0%, #0f2044 100%);
  border-radius: 20px;
  padding: 16px;
  position: relative;
  overflow: hidden;
  animation: spu-scaleIn 0.4s 0.05s both;
}
.hero-card-mobile::before {
  content: '';
  position: absolute;
  right: -30px; top: -30px;
  width: 120px; height: 120px;
  background: rgba(201,168,76,0.07);
  border-radius: 50%;
}
.hero-card-mobile__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative; z-index: 1;
}
.hero-card-mobile__info { flex: 1; min-width: 0; }
.hero-card-mobile__greeting {
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.hero-card-mobile__name {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  margin-top: 1px;
}
.hero-card-mobile__sub {
  font-size: 9px;
  color: rgba(255,255,255,0.4);
  margin-top: 2px;
}
.hero-card-mobile__avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8e44ad, #6c3483);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800; color: #fff;
  border: 2.5px solid rgba(255,255,255,0.25);
  flex-shrink: 0; margin-left: 12px;
  cursor: pointer;
  animation: spu-pulse 2.5s 1s infinite;
  text-transform: uppercase;
}
.hero-card-mobile__stats {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  position: relative; z-index: 1;
}
.hero-card-mobile__stat {
  flex: 1;
  background: rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,0.08);
}
.hero-card-mobile__stat-val {
  font-size: 18px;
  font-weight: 800;
  color: var(--color-gold);
  line-height: 1;
}
.hero-card-mobile__stat-label {
  font-size: 8px;
  color: rgba(255,255,255,0.4);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 3px;
}

/* ── STAGGER ANIMATIONS per sezioni ── */
.spu-anim-1 { animation: spu-fadeUp 0.35s 0.08s both; }
.spu-anim-2 { animation: spu-fadeUp 0.35s 0.14s both; }
.spu-anim-3 { animation: spu-fadeUp 0.35s 0.20s both; }
.spu-anim-4 { animation: spu-fadeUp 0.35s 0.26s both; }
.spu-anim-5 { animation: spu-fadeUp 0.35s 0.32s both; }

/* ── RESPONSIVE @media mobile ── */
@media (max-width: 768px) {
  /* Layout senza sidebar */
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    grid-template-areas: "navbar" "main";
  }
  .sidebar { display: none !important; }

  /* Padding bottom per bottom-nav */
  .main-content {
    padding: 0 10px calc(90px + env(safe-area-inset-bottom, 0px)) 10px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Griglia 1 colonna → settimane usano weeks-grid-2x2 separata */
  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 { grid-template-columns: 1fr; }

  /* Mostra bottom-nav e hamburger */
  .bottom-nav  { display: block; }
  #btn-hamburger { display: flex !important; }

  /* ── Navbar mobile OPZIONE B: logo sx + nome testo + hamburger dx ── */
  .navbar {
    grid-template-columns: auto 1fr auto !important;
    background: #1e3a6e !important;
    box-shadow: 0 1px 0 rgba(201,168,76,0.4), 0 2px 12px rgba(0,0,0,0.25) !important;
    height: 100px !important;
    min-height: 100px !important;
    align-items: center !important;
  }
  .navbar__edition   { display: none !important; }
  .navbar__user-name { display: none !important; }
  .navbar .avatar    { display: none !important; }
  .navbar__logout    { display: none !important; }
  /* Brand sx: logo + testo */
  .navbar > .navbar__brand {
    background: transparent !important;
    clip-path: none !important;
    min-width: 0 !important;
    padding: 0 12px !important;
    height: 100px !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
  }
  .navbar__brand .navbar__logo {
    display: block !important;
    height: 90px !important;
    width: auto !important;
  }
  /* Logo mobile: il PNG sorgente ha margini trasparenti larghi (~45% area inutile).
     Il wrapper "zooma" sulla parte visibile del logo, ingrandendola davvero
     invece di limitarsi a scalare un contenitore con molto spazio vuoto. */
  .navbar__logo-wrap {
    display: block !important;
    width: 209px !important;
    height: 70px !important;
    overflow: hidden !important;
    position: relative !important;
    flex-shrink: 0 !important;
  }
  .navbar__logo-wrap .navbar__logo {
    position: absolute !important;
    top: -29px !important;
    left: -26px !important;
    width: 263px !important;
    height: 126px !important;
    max-width: none !important;
  }
  .navbar__brand .navbar__title {
    display: flex !important;
    flex-direction: column !important;
  }
  .navbar__brand .navbar__title::before {
    content: "Summer Peace";
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    letter-spacing: .02em;
  }
  .navbar__brand .navbar__title::after {
    content: "University";
    font-size: 9px;
    font-weight: 600;
    color: #c9a84c;
    letter-spacing: .06em;
    text-transform: uppercase;
  }
  /* Center: nascosto su mobile — nav links vanno nell'hamburger */
  .navbar__center {
    display: none !important;
  }
  /* Destra: hamburger */
  .navbar > .navbar__right {
    background: transparent !important;
    padding-right: 12px !important;
  }
  .navbar__right { display: flex; align-items: center; gap: 6px; margin-left: auto; }

  /* ── Back button dentro la fascia navy a sinistra ── */
  #spu-back-btn {
    position: static !important;
    top: auto !important; left: auto !important;
    padding: 8px 14px !important;
    background: rgba(255,255,255,0.1) !important;
    border: 1px solid rgba(201,168,76,0.5) !important;
    color: #c9a84c !important;
    box-shadow: none !important;
    font-size: 12px !important;
    white-space: nowrap;
  }
  #spu-back-btn span { color: #c9a84c !important; }

  /* Hamburger discreto su navy — più grande */
  #btn-hamburger {
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    width: 52px !important;
    height: 52px !important;
    gap: 7px !important;
  }
  #btn-hamburger:active { background: none !important; }
  #btn-hamburger span {
    background: #fff !important;
    width: 32px !important;
    height: 3.5px !important;
    border-radius: 2px !important;
  }

  /* ── Hero card studente — Variante A: bianca, bordo oro, avatar navy+oro ── */
  .hero-card-mobile {
    margin: 0 -10px !important;
    background: #fff !important;
    border-radius: 0 !important;
    border-bottom: 3px solid #c9a84c !important;
    padding: 18px 16px !important;
  }
  .hero-card-mobile::before { display: none !important; }
  .hero-card-mobile__greeting { color: #9aa4b6 !important; font-weight: 700 !important; }
  .hero-card-mobile__name { color: #0f2044 !important; font-size: 22px !important; }
  .hero-card-mobile__sub { color: #7a869a !important; font-size: 11px !important; }
  .hero-card-mobile__avatar {
    background: linear-gradient(135deg, #1e3a6e, #0f2044) !important;
    color: #c9a84c !important;
    border: 2.5px solid #c9a84c !important;
    width: 50px !important; height: 50px !important;
    animation: none !important;
  }
  .hero-card-mobile__stat {
    background: #f4f6fb !important;
    border: 1px solid #e6eaf2 !important;
  }
  .hero-card-mobile__stat-val { color: #1e3a6e !important; }
  .hero-card-mobile__stat:first-child .hero-card-mobile__stat-val { color: #c9a84c !important; }
  .hero-card-mobile__stat-label { color: #9aa4b6 !important; font-weight: 700 !important; }

  /* Version badge nascosto su mobile */
  #spu-version-badge { display: none !important; }

  /* Toast sopra bottom-nav */
  .toast-container {
    bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    right: 12px; left: 12px;
    max-width: 100%; width: auto;
  }
  .page-header { margin-bottom: 6px; padding-top: 16px; }
  .page-header__title { font-size: 1.4rem; }
}

@media (max-width: 380px) {
  .main-content { padding: 6px 8px calc(68px + env(safe-area-inset-bottom, 0px)); }
  .bottom-nav__inner { height: 56px; }
  .bottom-nav__label { font-size: 7.5px; }
}


/* ═══════════════════════════════════════════════════
   DESKTOP LAYOUT v2.0 — navbar pulita, sidebar compatta
   ═══════════════════════════════════════════════════ */

/* Navbar — no edition pill, solo logo + search + user */
.navbar__edition { display: none !important; }

/* Sidebar link — più compatta */
.sidebar__link-icon {
  font-size: 14px;
  flex-shrink: 0;
  width: 16px;
  text-align: center;
}

/* ── STAT CARDS — orizzontali compatte ── */
.stat-card-h {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.stat-card-h__icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-card-h__body { flex: 1; min-width: 0; }
.stat-card-h__val {
  font-size: 18px; font-weight: 800;
  color: var(--color-navy-dark);
  letter-spacing: -0.02em; line-height: 1;
}
.stat-card-h__label {
  font-size: 9px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--color-text-light); margin-top: 3px;
}
.stat-card-h__delta {
  font-size: 9px; font-weight: 600;
  margin-top: 4px; display: inline-flex;
  align-items: center; gap: 2px;
  padding: 1px 6px; border-radius: 99px;
}
.delta-up { background: var(--color-success-bg); color: var(--color-success); }
.delta-neutral { background: rgba(30,58,110,0.08); color: var(--color-navy); }

/* ── COURSE PROGRESS ── */
.course-progress {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  padding: 10px 16px;
}
.course-progress__top {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 8px;
}
.course-progress__label {
  font-size: 11.5px; font-weight: 700; color: var(--color-navy-dark);
}
.course-progress__meta {
  font-size: 10px; color: var(--color-text-light);
}
.course-progress__days {
  font-size: 9.5px; font-weight: 700;
  color: var(--color-navy);
  background: rgba(30,58,110,0.08);
  padding: 2px 8px; border-radius: 99px;
}
.course-progress__track {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px; margin-bottom: 6px;
}
.course-progress__seg {
  height: 6px; border-radius: 3px;
  background: var(--color-border-light);
  overflow: hidden; position: relative;
}
.course-progress__fill {
  position: absolute; top: 0; left: 0; bottom: 0;
  border-radius: 3px;
}
.course-progress__labels {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.course-progress__week-lbl {
  display: flex; align-items: center; gap: 4px;
  font-size: 9px; font-weight: 600;
  color: var(--color-text-light);
}
.course-progress__week-lbl--done  { color: var(--color-success); }
.course-progress__week-lbl--live  { color: var(--color-navy); font-weight: 700; }
.cp-dot {
  width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0;
}

/* ── WEEK PROGRAMME BLOCKS — istituzionale ── */
.week-programme-block {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  overflow: hidden;
  margin-bottom: 12px;
}
.week-programme-block:last-child { margin-bottom: 0; }

/* Accent laterale colore settimana */
.wpb--w1 { border-left: 3px solid var(--color-success); }
.wpb--w2 { border-left: 3px solid var(--color-navy); }
.wpb--w3 { border-left: 3px solid var(--color-purple); }
.wpb--w4 { border-left: 3px solid var(--color-warning); }

.wpb__header {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 11px 18px;
  border-bottom: 1px solid var(--color-border-light);
  background: var(--color-white);
}
.wpb__header-left { display: flex; align-items: center; gap: 12px; }
.wpb__num {
  font-size: 9.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--color-text-light); white-space: nowrap;
}
.wpb__sep { width: 1px; height: 14px; background: var(--color-border); }
.wpb__title {
  font-size: 13px; font-weight: 700;
  color: var(--color-navy-dark); letter-spacing: -0.01em;
}
.wpb__status {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 9px; font-weight: 700;
  padding: 3px 10px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.07em;
  white-space: nowrap;
}
.wpb__status--done { background: var(--color-success-bg); color: var(--color-success); border: 1px solid rgba(46,204,113,0.3); }
.wpb__status--live { background: var(--color-navy-dark); color: #fff; }
.wpb__status--soon { background: var(--color-surface); color: var(--color-text-light); border: 1px solid var(--color-border); }

/* Day header */
.wpb__day {
  display: flex; align-items: center; gap: 14px;
  padding: 6px 18px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border-light);
  border-top: 1px solid var(--color-border-light);
}
.wpb__day-name {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: #374151; white-space: nowrap;
}
.wpb__day-date {
  font-size: 10px; color: var(--color-text-light); font-weight: 500;
}
.wpb__day-line { flex: 1; height: 1px; background: var(--color-border); }

/* Session row */
.wpb__sess {
  display: grid;
  grid-template-columns: 52px 1fr 170px 90px;
  align-items: center;
  gap: 14px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--color-bg);
  cursor: pointer;
  transition: background var(--transition-fast);
}
.wpb__sess:last-child { border-bottom: none; }
.wpb__sess:hover { background: var(--color-surface); }

.wpb__time {
  font-size: 11px; font-weight: 700;
  color: var(--color-navy-dark);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.wpb__main { min-width: 0; }
.wpb__sess-title {
  font-size: 12px; font-weight: 600;
  color: var(--color-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wpb__sess-sub {
  font-size: 10px; color: var(--color-text-light); margin-top: 2px;
}
.wpb__fac { min-width: 0; }
.wpb__fac-name {
  font-size: 11px; font-weight: 600; color: #374151;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wpb__fac-uni {
  font-size: 9.5px; color: var(--color-text-light); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Session type badge */
.wpb__badge {
  font-size: 9px; font-weight: 700;
  padding: 4px 0; border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.06em;
  text-align: center; width: 90px; flex-shrink: 0;
  border: 1px solid transparent;
}
.wpb__badge--lecture   { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.wpb__badge--lab       { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.wpb__badge--talk      { background: #faf5ff; color: #7e22ce; border-color: #e9d5ff; }
.wpb__badge--cerimonia { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.wpb__badge--forum     { background: #fefce8; color: #a16207; border-color: #fef08a; }
.wpb__badge--online    { background: #f0f9ff; color: #0369a1; border-color: #bae6fd; }
.wpb__badge--soon      { background: var(--color-surface); color: var(--color-text-light); border-color: var(--color-border); }

.wpb__soon-msg {
  padding: 14px 18px;
  font-size: 11px; color: var(--color-text-light);
  font-style: italic;
}

/* Live dot */
.live-pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: #ef4444; display: inline-block;
  animation: spu-dot-blink 1.2s infinite;
}


/* ── Desktop: restringe main-content del ~10% con padding laterale ── */
@media (min-width: 769px) {
  .main-content {
    padding-left: calc(var(--space-6) + 3%);
    padding-right: calc(var(--space-6) + 3%);
  }
  /* Anti scroll orizzontale: blindo lo shell e la main */
  html, body { overflow-x: hidden; max-width: 100%; }
  .app-shell { max-width: 100vw; overflow-x: hidden; }
  .main-content, main { min-width: 0; overflow-x: hidden; max-width: 100%; }
  /* La navbar centrale: se il menu è troppo lungo, scrolla DENTRO la navbar */
  .navbar { overflow: hidden; }
  .navbar__center {
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
  }
  .navbar__center::-webkit-scrollbar { height: 4px; }
  .navbar__center::-webkit-scrollbar-thumb { background: rgba(15,32,68,0.2); border-radius: 2px; }
  .navbar__nav { flex-wrap: nowrap; }
  /* Le griglie a 2 colonne delle pagine sessione collassano se non c'è spazio */
  .session-grid, .two-col-grid { min-width: 0; }
  .session-grid > *, .two-col-grid > * { min-width: 0; }

  /* ── Scroll solo del contenuto: navbar e sidebar SEMPRE fisse ── */
  html, body { height: 100%; overflow: hidden; }
  .app-shell {
    height: 100vh;
    min-height: 0;
    overflow: hidden;
  }
  .sidebar {
    height: 100%;
    overflow-y: auto;
  }
  .main-content, main.main-content {
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* ── WEEK CARDS — ingrandite, con trame, su desktop ── */
  .dashboard-section { padding: 24px 32px 0; }

  .week-card-colored {
    padding: 24px;
    min-height: 170px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
  .week-card-colored__num {
    font-size: 13px;
    margin-bottom: 8px;
  }
  .week-card-colored__title {
    font-size: 22px;
    line-height: 1.3;
    margin-bottom: 0;
  }
  .week-card-colored__badge {
    font-size: 12px;
    padding: 5px 14px;
    gap: 6px;
    letter-spacing: 0.08em;
  }
  .week-badge__dot {
    width: 7px;
    height: 7px;
  }
  .week-card-colored::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.16;
    pointer-events: none;
  }
  .week-card-colored--w1::before {
    background-image:
      radial-gradient(circle at 20% 30%, #fff 0 3px, transparent 4px),
      radial-gradient(circle at 60% 70%, #fff 0 4px, transparent 5px),
      radial-gradient(circle at 85% 20%, #fff 0 2px, transparent 3px),
      radial-gradient(circle at 40% 90%, #fff 0 3px, transparent 4px);
    background-size: 90px 90px;
  }
  .week-card-colored--w2::before {
    background-image:
      linear-gradient(rgba(255,255,255,0.5) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255,255,255,0.5) 1px, transparent 1px);
    background-size: 28px 28px;
  }
  .week-card-colored--w3::before {
    background-image:
      radial-gradient(circle at 75% 25%, transparent 0 18px, rgba(255,255,255,0.5) 19px, transparent 20px),
      radial-gradient(circle at 75% 25%, transparent 0 32px, rgba(255,255,255,0.35) 33px, transparent 34px);
  }
  .week-card-colored--w4::before {
    background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.55) 0 2px, transparent 2px 16px);
  }

  /* ── MY ASSIGNMENTS — griglia di card colorate con trame ── */
  .assignments-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
  }
  .assignments-list .asgn-row {
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    min-height: 150px;
    padding: 20px;
    border: none;
    position: relative;
    overflow: hidden;
  }
  .assignments-list .asgn-row::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.16;
    pointer-events: none;
  }
  .assignments-list .asgn-row > * { position: relative; z-index: 1; }
  .assignments-list .asgn-body { width: 100%; flex: 1; }
  .assignments-list .asgn-nm {
    font-size: 16px;
    white-space: normal;
    color: #fff;
    margin-top: 8px;
  }
  .assignments-list .asgn-mt {
    font-size: 12px;
    color: rgba(255,255,255,0.65);
  }
  .assignments-list .asgn-ic {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.16);
  }
  .assignments-list .asgn-ic i { color: #fff; font-size: 18px; }
  .assignments-list .asgn-status {
    background: rgba(255,255,255,0.16);
    color: #fff;
    font-size: 12px;
    padding: 5px 12px;
  }

  .asgn-row--pm1 { background: linear-gradient(135deg, #1a6e4e 0%, #0f4a33 100%); }
  .asgn-row--pm1::before {
    background-image:
      radial-gradient(circle at 20% 30%, #fff 0 3px, transparent 4px),
      radial-gradient(circle at 70% 75%, #fff 0 3px, transparent 4px);
    background-size: 70px 70px;
  }
  .asgn-row--pm2 { background: linear-gradient(135deg, #1e3a6e 0%, #0f2044 100%); }
  .asgn-row--pm2::before {
    background-image:
      linear-gradient(rgba(255,255,255,0.5) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255,255,255,0.5) 1px, transparent 1px);
    background-size: 22px 22px;
  }
  .asgn-row--pm3 { background: linear-gradient(135deg, #5b2d8e 0%, #3d1d6e 100%); }
  .asgn-row--pm3::before {
    background-image:
      radial-gradient(circle at 80% 20%, transparent 0 14px, rgba(255,255,255,0.5) 15px, transparent 16px),
      radial-gradient(circle at 80% 20%, transparent 0 26px, rgba(255,255,255,0.35) 27px, transparent 28px);
  }
  .asgn-row--pm4 { background: linear-gradient(135deg, #7a5c1e 0%, #5a400d 100%); }
  .asgn-row--pm4::before {
    background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.5) 0 2px, transparent 2px 14px);
  }
  .asgn-row--lpp { background: linear-gradient(135deg, #c0392b 0%, #7c2417 100%); }
  .asgn-row--lpp::before {
    background-image: repeating-linear-gradient(-45deg, rgba(255,255,255,0.45) 0 2px, transparent 2px 12px);
  }
  .asgn-row--wp { background: linear-gradient(135deg, #2980b9 0%, #1a4f6e 100%); }
  .asgn-row--wp::before {
    background-image: radial-gradient(circle, rgba(255,255,255,0.45) 1px, transparent 1.5px);
    background-size: 14px 14px;
  }
}


/* ═══════════════════════════════════════════════════
   INVITI — toolbar di ricerca e badge protocollo (SOLO DESKTOP)
   ═══════════════════════════════════════════════════ */
@media (min-width: 769px) {
  .inv-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin: var(--space-4) 0 var(--space-5);
  }
  .inv-toolbar__search { position: relative; flex: 1; max-width: 360px; }
  .inv-toolbar__search-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    opacity: 0.45; font-size: 14px; pointer-events: none;
  }
  .inv-toolbar__search .form-input { padding-left: 38px; }
  .inv-toolbar__count {
    font-size: var(--font-size-xs); color: var(--color-text-muted);
    font-weight: var(--font-weight-semibold); white-space: nowrap;
  }
  .inv-gen-cell { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
  .inv-gen-btn { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
  .inv-prot-badge {
    font-size: 10px; color: var(--color-text-muted); font-weight: var(--font-weight-semibold);
    letter-spacing: 0.02em; min-height: 12px;
  }
}

/* ═══════════════════════════════════════════════════
   INVITI — tipografia ingrandita e animazioni (SOLO DESKTOP)
   Scoped a #inv-list / #inviti-main per non toccare le tabelle
   condivise con Students/Faculty (stessa classe .table).
   ═══════════════════════════════════════════════════ */
@media (min-width: 769px) {
  @keyframes invFadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  @keyframes invRowIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  @keyframes invBadgePop {
    0%   { transform: scale(0.8); opacity: 0.4; }
    55%  { transform: scale(1.18); }
    100% { transform: scale(1); opacity: 1; }
  }

  /* Hub — card categorie */
  #inviti-main .inv-cat-btn {
    animation: invFadeUp 0.45s ease both;
    transition: transform .25s cubic-bezier(.34,1.56,.64,1), box-shadow .25s ease;
  }
  #inviti-main .inv-cat-btn:hover { box-shadow: 0 18px 44px rgba(0,0,0,0.24); }
  #inviti-main .inv-cat-btn:nth-child(1) { animation-delay: .02s; }
  #inviti-main .inv-cat-btn:nth-child(2) { animation-delay: .07s; }
  #inviti-main .inv-cat-btn:nth-child(3) { animation-delay: .12s; }
  #inviti-main .inv-cat-btn:nth-child(4) { animation-delay: .17s; }

  /* Toolbar ricerca — più grande e con focus morbido */
  .inv-toolbar__search .form-input {
    font-size: 15px;
    padding-top: 13px;
    padding-bottom: 13px;
    border-radius: var(--radius-lg);
    transition: box-shadow .2s ease, border-color .2s ease;
  }
  .inv-toolbar__search .form-input:focus {
    box-shadow: 0 0 0 4px rgba(30,58,110,0.09);
  }
  .inv-toolbar__search-icon { font-size: 15px; }
  .inv-toolbar__count { font-size: 13px; }

  /* Tabella Inviti — testi ingranditi, righe più ariose, entrata animata */
  #inv-list .table-wrapper { animation: invFadeUp 0.4s ease both; }
  #inv-list .table th {
    font-size: 12px;
    padding: 16px var(--space-4);
  }
  #inv-list .table td {
    font-size: 15px;
    padding: 18px var(--space-4);
  }
  #inv-list .table td strong { font-size: 16px; }
  #inv-list .table tbody tr {
    animation: invRowIn 0.35s ease both;
  }
  #inv-list .table tbody tr:hover td {
    background: rgba(30,58,110,0.045);
  }

  /* Bottoni Invitation/Embassy — più leggibili, con lift al passaggio mouse */
  #inv-list .btn--outline.btn--sm {
    font-size: 13px;
    padding: 9px 18px;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  }
  #inv-list .btn--outline.btn--sm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(30,58,110,0.20);
  }

  /* Badge protocollo — più leggibile, "pop" quando si aggiorna */
  .inv-prot-badge {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--color-text-muted);
    transition: color .3s ease;
  }
  .inv-prot-badge--updated {
    color: #8a6820;
    animation: invBadgePop 0.45s ease;
  }
}


/* ═══════════════════════════════════════════════════
   LETTERE — overlay anteprima + invio (SOLO DESKTOP)
   Condiviso da Inviti / Studenti / Docenti tramite js/shared/lettere.js
   ═══════════════════════════════════════════════════ */
@media (min-width: 769px) {
  .lettere-overlay {
    position: fixed; inset: 0; z-index: var(--z-modal);
    background: rgba(15,32,68,0.6);
    display: flex; align-items: center; justify-content: center;
    padding: 32px; animation: fadeIn 0.2s ease both;
  }
  .lettere-overlay__panel {
    background: #fff; border-radius: var(--radius-xl);
    width: 100%; max-width: 1080px; height: 88vh;
    display: flex; flex-direction: column; overflow: hidden;
    box-shadow: var(--shadow-xl);
  }
  .lettere-overlay__header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 24px; border-bottom: 1px solid var(--color-border);
    background: var(--color-navy); color: #fff;
  }
  .lettere-overlay__title { font-size: 16px; font-weight: 800; }
  .lettere-overlay__sub { font-size: 12px; color: rgba(255,255,255,0.75); margin-top: 2px; }
  .lettere-overlay__header .btn--ghost { color: #fff; border-color: rgba(255,255,255,0.35); }
  .lettere-overlay__header .btn--ghost:hover { background: rgba(255,255,255,0.12); color: #fff; }
  .lettere-overlay__body { flex: 1; display: flex; min-height: 0; }
  .lettere-overlay__preview { flex: 1; background: #525659; min-width: 0; }
  .lettere-overlay__preview iframe { width: 100%; height: 100%; border: none; }
  .lettere-overlay__send {
    width: 340px; flex-shrink: 0; padding: 22px; overflow-y: auto;
    border-left: 1px solid var(--color-border); background: var(--color-surface);
  }
  .lettere-overlay__send-title {
    font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.07em;
    color: #9aa4b6; margin-bottom: 16px;
  }
  .lettere-checkbox { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--color-text); cursor: pointer; }
  .lettere-checkbox input { margin-top: 2px; }
}

/* ═══════════════════════════════════════════════════
   INVITI — nome cliccabile verso la scheda dettaglio (SOLO DESKTOP)
   ═══════════════════════════════════════════════════ */
@media (min-width: 769px) {
  .inv-name-link {
    background: none; border: none; padding: 0; cursor: pointer;
    font-size: inherit; font-family: inherit; font-weight: 700;
    color: var(--color-navy); text-align: left;
    text-decoration: underline; text-decoration-color: transparent;
    transition: text-decoration-color .15s ease, color .15s ease;
  }
  .inv-name-link:hover { color: var(--color-navy-light, #2c4e8a); text-decoration-color: currentColor; }
}
