/* ---------- Login (mirror di admin/style.css: stesso wash dorato "premiere") ---------- */
.login-screen {
  min-height: 100%; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse 640px 320px at 50% -10%, var(--cinema-gold-soft), transparent 60%),
    radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--brand) 14%, var(--page)), var(--page) 60%);
  padding: 20px;
}
.login-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 36px 32px; width: 100%; max-width: 360px; text-align: center; box-shadow: var(--shadow-pop);
}
:root[data-theme="dark"] .login-card { box-shadow: var(--shadow-pop), 0 0 60px -20px var(--cinema-glow); }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) .login-card { box-shadow: var(--shadow-pop), 0 0 60px -20px var(--cinema-glow); } }
.brand-mark.lg { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 16px; font-size: 24px;
  background: linear-gradient(135deg, var(--series-1), var(--series-7)); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800;
  box-shadow: var(--shadow-card), inset 0 0 0 1px rgba(255,255,255,0.18); }
.login-card h1 { font-size: 19px; margin: 0 0 6px; }
.login-card p { font-size: 13px; color: var(--text-secondary); margin: 0 0 20px; }
#loginForm { display: flex; flex-direction: column; gap: 10px; }
#codeInput {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 11px 14px; font-size: 18px; color: var(--text-primary); text-align: center;
  font-family: var(--font-mono); letter-spacing: .18em; text-transform: uppercase;
}
#codeInput:focus { outline: none; border-color: var(--brand); }
#loginForm button {
  background: linear-gradient(135deg, var(--brand), var(--brand-strong)); color: #fff; border: none; border-radius: 10px; padding: 11px; font-size: 14px;
  font-weight: 600; cursor: pointer; transition: filter .12s, transform .12s;
}
#loginForm button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.login-error { color: var(--status-critical); font-size: 12px; margin-top: 12px; }
.back-link { display: inline-block; margin-top: 18px; font-size: 12px; color: var(--text-muted); text-decoration: none; }
.back-link:hover { color: var(--text-primary); }

/* ---------- Login con passkey (2026-08-10) ---------- */
.passkey-login-btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, var(--series-1), var(--series-7)); color: #fff; border: none; border-radius: 10px;
  padding: 12px; font-size: 13.5px; font-weight: 700; cursor: pointer; margin-bottom: 16px;
  transition: filter .12s, transform .12s;
}
.passkey-login-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.passkey-login-btn:disabled { opacity: .6; cursor: default; transform: none; }
.login-divider { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ---------- Gestione passkey nel Profilo (2026-08-10) ---------- */
.passkey-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.passkey-item { display: flex; align-items: center; gap: 10px; background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; }
.passkey-item-icon { font-size: 18px; }
.passkey-item-main { flex: 1; }
.passkey-item-nome { font-size: 13px; font-weight: 600; }
.passkey-item-meta { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

/* ---------- Shell (sidebar + topbar, mirror di dashboard/admin) ---------- */
.app { min-height: 100vh; display: flex; flex-direction: row; align-items: stretch; }
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.sidebar {
  width: 232px; flex-shrink: 0; display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--border);
  position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 21;
  transition: width .16s ease;
}
.sidebar.collapsed { width: 68px; }
.sidebar-brand {
  display: flex; align-items: center; gap: 12px; padding: 18px 20px 14px; flex-shrink: 0;
  background-image: radial-gradient(ellipse 300px 140px at 20% 0%, var(--cinema-gold-soft), transparent 65%);
}
.brand-mark { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, var(--series-1), var(--series-7)); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; box-shadow: var(--shadow-card), inset 0 0 0 1px rgba(255,255,255,0.18); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; overflow: hidden; white-space: nowrap; }
.brand-text strong { font-size: 15px; font-weight: 800; letter-spacing: .03em; }
:root[data-theme="dark"] .brand-text strong { text-shadow: 0 0 18px var(--cinema-glow); }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) .brand-text strong { text-shadow: 0 0 18px var(--cinema-glow); } }
.brand-text span { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin-top: 1px; }
.sidebar.collapsed .brand-text { display: none; }
.sidebar-team {
  margin: 0 16px 16px; padding: 12px 14px; border-radius: var(--radius-md);
  background: var(--surface-2); border: 1px solid var(--border); flex-shrink: 0;
}
.sidebar-team-label { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); margin-bottom: 4px; white-space: nowrap; overflow: hidden; }
.sidebar-team-value { font-family: var(--font-mono); font-weight: 700; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar.collapsed .sidebar-team { padding: 10px 4px; text-align: center; }
.sidebar.collapsed .sidebar-team-label, .sidebar.collapsed .sidebar-team-value { display: none; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 4px 12px 16px; }
.sidebar-group { margin-bottom: 14px; }
.sidebar-group-label { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); padding: 6px 10px 4px; white-space: nowrap; }
.sidebar.collapsed .sidebar-group-label { display: none; }
.sidebar-link {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: none; border: none; border-radius: 10px; padding: 9px 10px; margin-bottom: 2px;
  font-size: 13px; color: var(--text-secondary); cursor: pointer; white-space: nowrap;
}
.sidebar-link:hover { background: var(--surface-2); color: var(--text-primary); }
.sidebar-link.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-strong)); color: #fff;
  box-shadow: inset 3px 0 0 var(--cinema-gold), 0 2px 10px -4px color-mix(in srgb, var(--brand) 55%, transparent);
}
.sidebar.collapsed .sidebar-link.active { box-shadow: inset 0 0 0 2px var(--cinema-gold), 0 2px 10px -4px color-mix(in srgb, var(--brand) 55%, transparent); }
.sidebar-link-icon { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; }
.sidebar.collapsed .sidebar-link-label { display: none; }
.sidebar.collapsed .sidebar-link { justify-content: center; padding: 9px 4px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px; background: var(--surface); border-bottom: 1px solid var(--border);
  background-image: radial-gradient(ellipse 820px 220px at 12% 0%, var(--cinema-gold-soft), transparent 65%);
  position: sticky; top: 0; z-index: 20;
}
.topbar::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: repeating-linear-gradient(90deg, var(--cinema-gold) 0 6px, transparent 6px 13px);
  opacity: .5; pointer-events: none;
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar-title { font-size: 15px; font-weight: 700; letter-spacing: .01em; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.icon-btn { border: 1px solid var(--border); background: var(--surface-2); border-radius: 10px; width: 34px; height: 34px; cursor: pointer; font-size: 15px; }
.logout-btn { background: var(--status-critical-bg); color: var(--status-critical); border: 1px solid transparent; border-radius: 10px; padding: 8px 14px; font-size: 12px; font-weight: 600; cursor: pointer; }

.content { flex: 1; padding: 24px 28px 40px; max-width: 1100px; width: 100%; margin: 0 auto; }
.footer { padding: 14px 28px; text-align: center; font-size: 12px; color: var(--text-muted); border-top: 1px solid var(--border); }

/* ---------- KPI ---------- */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px 16px 14px; box-shadow: var(--shadow-card); }
.kpi-label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; }
.kpi-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-good { background: var(--status-good); } .dot-warning { background: var(--status-warning); }
.dot-neutral { background: var(--status-neutral); } .dot-critical { background: var(--status-critical); }
.dot-info { background: var(--series-7); } .dot-total { background: var(--brand); }
.kpi-value { font-family: var(--font-mono); font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
:root[data-theme="dark"] .kpi-value { text-shadow: 0 0 16px color-mix(in srgb, var(--brand) 35%, transparent); }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) .kpi-value { text-shadow: 0 0 16px color-mix(in srgb, var(--brand) 35%, transparent); } }
.kpi-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ---------- Sezione profilo ---------- */
.profile-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-card); margin-bottom: 20px; }
.profile-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.profile-avatar { width: 64px; height: 64px; border-radius: 16px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 22px; flex-shrink: 0; box-shadow: var(--shadow-card), inset 0 0 0 1px rgba(255,255,255,0.18); }
.profile-head h2 { margin: 0 0 4px; font-size: 20px; }
.profile-head p { margin: 0; font-size: 13px; color: var(--text-secondary); }
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.info-item .label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 3px; }
.info-item .value { font-size: 13px; font-weight: 600; }
.panel-title { font-size: 14px; font-weight: 700; margin: 0 0 14px; }
.hours-progress-track { position: relative; height: 10px; background: var(--gridline); border-radius: 6px; overflow: hidden; margin-bottom: 6px; }
.hours-progress-fill { position: absolute; inset: 0 auto 0 0; background: var(--brand); border-radius: 6px; }
.hours-progress-fill.over-budget { background: var(--status-critical); }

/* ---------- Fase 5: OKR personali, key result inline ---------- */
.okr-kr-input {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 6px; padding: 3px 8px;
  font-size: 12px; color: var(--text); font-variant-numeric: tabular-nums;
}

/* ---------- Fase 6: Kanban self, badge, chat ---------- */
.kanban-colonna-select {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font-size: 12.5px; color: var(--text);
}
.badge-catalogo { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.badge-card { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 16px; }
.badge-card.non-ottenuto { opacity: .4; filter: grayscale(1); }
.badge-icona { font-size: 26px; }
.badge-card .titolo { font-size: 13px; font-weight: 700; }
.badge-card .sub { font-size: 11.5px; color: var(--text-muted); }
.badge-count { margin-left: auto; background: var(--surface-1); border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700; }

/* ============ Chat interna — riscritta da zero (2026-08-11) ============ */
.chat-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; height: 74dvh; }
.chat-sidebar { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-card); }
.chat-sidebar-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 14px 10px; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.chat-sidebar-search { padding: 0 12px 10px; flex-shrink: 0; }
.chat-sidebar-search input {
  width: 100%; background: var(--surface-1); border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 12px; font-size: 12.5px; color: var(--text); font-family: inherit;
}
.chat-conv-list { flex: 1; overflow-y: auto; border-top: 1px solid var(--border); }

.chat-avatar {
  position: relative; width: 40px; height: 40px; min-width: 40px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; color: #fff; font-weight: 700; font-size: 13.5px; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}
.chat-avatar.sm { width: 32px; height: 32px; min-width: 32px; font-size: 11.5px; }
.chat-avatar.chat-avatar-gruppo { background: var(--brand); font-size: 16px; }
.chat-avatar-dot {
  position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid var(--surface); background: var(--text-muted);
}
.chat-avatar-dot.online { background: var(--status-good); }
.chat-avatar-dot.offline { background: var(--text-muted); opacity: .6; }

.chat-conv-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--border); }
.chat-conv-item:hover { background: var(--surface-1); }
.chat-conv-item.active { background: var(--brand); }
.chat-conv-item.active .chat-conv-item-nome, .chat-conv-item.active .chat-conv-item-anteprima, .chat-conv-item.active .chat-conv-item-ora { color: #fff; }
.chat-conv-item.active .chat-conv-item-anteprima { opacity: .85; }
.chat-conv-item-testi { flex: 1; min-width: 0; }
.chat-conv-item-riga1 { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.chat-conv-item-nome { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-conv-item-ora { font-size: 10.5px; color: var(--text-muted); flex-shrink: 0; }
.chat-conv-item-riga2 { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: 2px; }
.chat-conv-item-anteprima { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-conv-item.non-letta .chat-conv-item-nome { font-weight: 800; }
.chat-conv-item.non-letta .chat-conv-item-anteprima { color: var(--text); font-weight: 600; }
.chat-badge-nonletti {
  background: var(--brand); color: #fff; font-size: 10.5px; font-weight: 800; border-radius: 999px;
  min-width: 18px; height: 18px; padding: 0 5px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.chat-main { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-card); }
.chat-main-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--text-muted); text-align: center; padding: 24px; }
.chat-main-empty-icon { font-size: 40px; opacity: .5; }
.chat-main-active { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat-main-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.chat-main-head-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.chat-main-head-testi { min-width: 0; }
.chat-main-nome { font-size: 13.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-main-sottotitolo { font-size: 11.5px; color: var(--text-muted); }
.chat-ricerca-msg { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.chat-ricerca-msg input { flex: 1; background: var(--surface-1); border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; font-size: 12.5px; color: var(--text); font-family: inherit; }

.chat-messaggi { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 3px; }
.chat-day-divider { display: flex; align-items: center; justify-content: center; margin: 14px 0 10px; }
.chat-day-divider span {
  background: var(--surface-1); color: var(--text-muted); font-size: 10.5px; font-weight: 700; text-transform: capitalize;
  padding: 4px 12px; border-radius: 999px;
}
.chat-bubble { position: relative; max-width: 68%; background: var(--surface-1); border: 1px solid var(--border); border-radius: 16px; padding: 9px 14px 8px; align-self: flex-start; margin-top: 8px; }
.chat-bubble.raggruppato { margin-top: 2px; border-top-left-radius: 6px; }
.chat-bubble.mio { align-self: flex-end; background: var(--brand); color: #fff; border-color: transparent; }
.chat-bubble.mio.raggruppato { border-top-right-radius: 6px; }
.chat-autore { font-size: 10.5px; font-weight: 700; opacity: .7; margin-bottom: 2px; }
.chat-testo { font-size: 13px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.chat-testo-eliminato { font-size: 12.5px; font-style: italic; opacity: .6; }
.chat-bubble.eliminato { background: transparent; border-style: dashed; }
.chat-bubble.mio.eliminato { background: transparent; border: 1px dashed rgba(255,255,255,.4); color: var(--text); }
.chat-meta { display: flex; align-items: center; justify-content: flex-end; gap: 5px; margin-top: 3px; }
.chat-ora { font-size: 10px; opacity: .55; }
.chat-modificato { font-size: 10px; opacity: .55; font-style: italic; }
.chat-spunta { font-size: 12px; opacity: .65; letter-spacing: -2px; }
.chat-spunta.letto { opacity: 1; color: #7dd3fc; }

/* ---------- Azioni bolla: rispondi, modifica, elimina, reagisci ---------- */
/* Posizionata FUORI dalla bolla, nel margine laterale libero (a destra per i
   messaggi altrui, a sinistra per i propri) — mai sopra al contenuto: un
   primo tentativo la sovrapponeva all'angolo in alto della bolla e finiva
   per intercettare i click su un allegato/immagine posizionato lì (scoperto
   in verifica: un clic sull'anteprima immagine non arrivava mai a segno).
   Griglia 2×2 invece di una colonna singola di 4: una colonna alta ~100px
   centrata su una bolla corta (tipico di messaggi brevi consecutivi, es.
   "Ciao"/"Come va") sporgeva così tanto sopra e sotto da sovrapporsi alle
   barre azioni dei messaggi adiacenti — un quadrato compatto di ~54px
   riduce drasticamente questa sovrapposizione senza perdere nessuna azione.
   opacity sempre > 0 (non solo su :hover): su touch non esiste uno stato
   hover affidabile — nasconderle del tutto le renderebbe inutilizzabili da mobile. */
.chat-bubble-actions {
  position: absolute; top: 50%; transform: translateY(-50%); display: grid; grid-template-columns: repeat(2, auto); gap: 1px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 2px; box-shadow: var(--shadow-card);
  opacity: .75; transition: opacity .12s ease;
}
.chat-bubble:not(.mio) .chat-bubble-actions { left: calc(100% + 6px); }
.chat-bubble.mio .chat-bubble-actions { right: calc(100% + 6px); }
.chat-bubble:hover .chat-bubble-actions, .chat-bubble:focus-within .chat-bubble-actions { opacity: 1; z-index: 2; }
.chat-reply-btn {
  width: 24px; height: 24px; line-height: 24px; text-align: center;
  border: none; background: transparent; opacity: .65; cursor: pointer; font-size: 12.5px; border-radius: 7px; color: var(--text); padding: 0;
}
.chat-reply-btn:hover { opacity: 1; background: var(--surface-1); }
.chat-edit-form { display: flex; flex-direction: column; gap: 6px; }
.chat-edit-textarea {
  background: rgba(255,255,255,.92); color: #111; border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 10px; font-size: 13px; font-family: inherit; line-height: 1.4; resize: none; overflow-y: hidden; min-width: 180px;
}
.chat-edit-actions { display: flex; gap: 6px; justify-content: flex-end; }
.chat-edit-actions .row-btn { padding: 4px 10px; font-size: 11px; }
.chat-quote {
  border-left: 3px solid var(--brand); background: rgba(0,0,0,.05); border-radius: 6px; padding: 4px 8px;
  margin-bottom: 6px; cursor: pointer;
}
.chat-quote:hover { background: rgba(0,0,0,.09); }
.chat-quote-autore { font-size: 11px; font-weight: 700; opacity: .8; }
.chat-quote-testo { font-size: 11.5px; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-quote-mancante { font-style: italic; }
.chat-bubble.mio .chat-quote { border-left-color: rgba(255,255,255,.7); background: rgba(255,255,255,.15); }
.chat-bubble.mio .chat-quote:hover { background: rgba(255,255,255,.22); }
.chat-bubble.highlight { animation: vicorp-chat-flash 1.1s ease; }
@keyframes vicorp-chat-flash {
  0% { box-shadow: 0 0 0 2px var(--brand); }
  70% { box-shadow: 0 0 0 2px var(--brand); }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ---------- Reazioni rapide ---------- */
.chat-reazioni { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.chat-reazione-pill {
  display: inline-flex; align-items: center; gap: 3px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 1px 7px; font-size: 11.5px; cursor: pointer; color: var(--text);
}
.chat-bubble.mio .chat-reazione-pill { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.3); color: #fff; }
.chat-reazione-pill.mia { border-color: var(--brand); background: var(--brand-soft, rgba(79,70,229,.15)); }
.chat-reazione-picker {
  position: absolute; bottom: calc(100% + 4px); left: 8px; display: flex; gap: 3px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 5px; box-shadow: var(--shadow-card); z-index: 5;
}
.chat-reazione-picker button { border: none; background: transparent; font-size: 17px; cursor: pointer; padding: 3px 5px; border-radius: 8px; line-height: 1; }
.chat-reazione-picker button:hover { background: var(--surface-1); }

.chat-typing-indicator { padding: 0 16px 6px; font-size: 11.5px; font-style: italic; color: var(--text-muted); flex-shrink: 0; }

.chat-reply-preview { display: flex; align-items: center; gap: 8px; background: var(--surface-1); border: 1px solid var(--border); border-left: 3px solid var(--brand); border-radius: 8px; padding: 7px 10px; margin: 0 14px 8px; font-size: 12px; flex-shrink: 0; }
.chat-reply-preview-testo { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-reply-preview-close { background: none; border: none; cursor: pointer; font-size: 15px; color: var(--text-muted); line-height: 1; padding: 2px; }
.chat-allegato-dimensione { color: var(--text-muted); }
.chat-messaggio-form { display: flex; gap: 10px; padding: 12px; border-top: 1px solid var(--border); align-items: flex-end; flex-shrink: 0; }
.chat-messaggio-form textarea {
  flex: 1; background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px;
  color: var(--text); font-family: inherit; font-size: 13px; line-height: 1.4; resize: none; overflow-y: hidden;
}
.chat-messaggio-form .btn, .chat-messaggio-form .icon-btn { flex-shrink: 0; }

/* ---------------- Allegati in chat ---------------- */
.chat-allegato-img { display: block; max-width: 220px; max-height: 220px; border-radius: 10px; margin-top: 4px; cursor: pointer; }
.chat-allegato-file {
  display: flex; align-items: center; gap: 8px; background: rgba(0,0,0,.05); border-radius: 8px; padding: 8px 10px; margin-top: 4px;
  text-decoration: none; color: inherit;
}
.chat-bubble.mio .chat-allegato-file { background: rgba(255,255,255,.15); }
.chat-allegato-file:hover { filter: brightness(0.97); }
.chat-bubble.mio .chat-allegato-file:hover { filter: brightness(1.1); }
.chat-allegato-file-icona { font-size: 20px; flex-shrink: 0; }
.chat-allegato-file-info { flex: 1; min-width: 0; }
.chat-allegato-file-nome { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-allegato-file-dimensione { font-size: 10.5px; opacity: .7; }

/* ---------------- Lightbox immagini (allegati chat) ---------------- */
.img-lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,.86); z-index: 300; display: flex; align-items: center; justify-content: center; padding: 24px;
}
.img-lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.img-lightbox-close {
  position: absolute; top: 18px; right: 22px; background: rgba(255,255,255,.12); border: none; color: #fff; width: 36px; height: 36px;
  border-radius: 50%; font-size: 16px; cursor: pointer;
}
.img-lightbox-close:hover { background: rgba(255,255,255,.22); }

/* ---------------- Modal "Nuova conversazione": tab diretta/gruppo ---------------- */
.chat-nuova-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.chat-nuova-tab {
  flex: 1; padding: 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-1); color: var(--text);
  font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.chat-nuova-tab.active { background: var(--brand); color: #fff; border-color: transparent; }
.chat-nuova-ricerca {
  width: 100%; background: var(--surface-1); border: 1px solid var(--border); border-radius: 999px; padding: 8px 14px;
  font-size: 12.5px; color: var(--text); font-family: inherit; margin-bottom: 10px;
}
.chat-persona-list { max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.chat-persona-riga { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.chat-persona-riga:hover { background: var(--surface-1); }
.chat-persona-info { flex: 1; min-width: 0; }
.chat-persona-info .titolo { font-size: 12.5px; font-weight: 700; }
.chat-persona-info .sub { font-size: 11px; color: var(--text-muted); }
.chat-persona-check { opacity: 0; color: var(--brand); font-weight: 800; }
.chat-persona-list.multi .chat-persona-riga.selezionata { background: var(--surface-1); }
.chat-persona-list.multi .chat-persona-riga.selezionata .chat-persona-check { opacity: 1; }

/* ---------- Liste richieste (ferie / note spese) ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-head h3 { margin: 0; font-size: 15px; }
.primary-btn { background: linear-gradient(135deg, var(--brand), var(--brand-strong)); color: #fff; border: none; border-radius: 10px; padding: 10px 16px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: filter .12s, transform .12s; }
.primary-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.request-list { display: flex; flex-direction: column; gap: 8px; }
.request-row {
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 12px 16px; box-shadow: var(--shadow-card); transition: transform .14s, border-color .12s, box-shadow .14s;
}
.request-row:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow-pop); }
.request-icon { font-size: 20px; width: 30px; text-align: center; }
.request-main .titolo { font-size: 13px; font-weight: 600; }
.request-main .sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.request-importo { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.request-actions { display: flex; gap: 6px; }
.empty-hint { padding: 40px 20px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* ---------- Status badge (mirror) ---------- */
.status-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.status-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-good { color: var(--status-good); background: var(--status-good-bg); }
.badge-warning { color: #8a5a00; background: var(--status-warning-bg); }
:root[data-theme="dark"] .badge-warning { color: var(--status-warning); }
.badge-neutral { color: var(--text-secondary); background: var(--status-neutral-bg); }
.badge-critical { color: var(--status-critical); background: var(--status-critical-bg); }
.badge-info { color: var(--series-7); background: rgba(74,58,167,0.12); }

/* ---------- Modal / form (mirror) ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 24px; }
.modal { background: var(--surface); border-radius: var(--radius-lg); max-width: 520px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-pop); border: 1px solid var(--border); }
.modal-header { display: flex; gap: 14px; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-header h2 { margin: 0; font-size: 17px; }
.modal-close { margin-left: auto; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; width: 32px; height: 32px; cursor: pointer; }
.modal-body { padding: 20px 24px 26px; display: flex; flex-direction: column; gap: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-field { display: flex; flex-direction: column; gap: 5px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }
.form-field input, .form-field select, .form-field textarea {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-primary);
  border-radius: 9px; padding: 9px 11px; font-size: 13px; font-family: inherit;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { outline: none; border-color: var(--brand); }
.form-field textarea { resize: vertical; min-height: 60px; }
.form-field textarea.autogrow { resize: none; overflow-y: hidden; min-height: 38px; line-height: 1.4; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 6px; border-top: 1px solid var(--border); margin-top: 4px; }
.btn { border: none; border-radius: 10px; padding: 10px 18px; font-size: 13px; font-weight: 600; cursor: pointer; }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-strong)); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--surface-2); color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text-primary); }
.btn-danger { background: var(--status-critical-bg); color: var(--status-critical); }
.btn-danger:hover { filter: brightness(1.08); }
.row-btn { border: 1px solid var(--border); background: var(--surface-2); border-radius: 8px; padding: 6px 10px; font-size: 11px; cursor: pointer; color: var(--text-secondary); }
.row-btn:hover { border-color: var(--border-strong); color: var(--text-primary); }
.row-btn.danger:hover { color: var(--status-critical); border-color: var(--status-critical); }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--text-primary); color: var(--page); padding: 10px 18px; border-radius: 999px; font-size: 12px; z-index: 200; box-shadow: var(--shadow-pop); opacity: 0; transition: opacity .2s; }
.toast.show { opacity: 1; }
.toast.error { background: var(--status-critical); color: #fff; }

@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .content { padding: 16px; }
  .topbar { padding: 12px 16px; }
  .sidebar:not(.collapsed) { width: 68px; }
  .sidebar:not(.collapsed) .brand-text,
  .sidebar:not(.collapsed) .sidebar-team-label,
  .sidebar:not(.collapsed) .sidebar-team-value,
  .sidebar:not(.collapsed) .sidebar-group-label,
  .sidebar:not(.collapsed) .sidebar-link-label { display: none; }
  .sidebar:not(.collapsed) .sidebar-link { justify-content: center; padding: 9px 4px; }
}

.csv-hint { font-size: 11.5px; color: var(--text-muted); margin: -4px 0 16px; }

/* ---------- Ricerca globale / command palette (Checkpoint 43) ---------- */
.palette-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(2px); display: flex; align-items: flex-start; justify-content: center; z-index: 200; padding: 12vh 24px 24px; }
.palette { background: var(--surface); border-radius: var(--radius-lg); max-width: 620px; width: 100%; max-height: 70vh; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-pop); border: 1px solid var(--border); }
.palette-input { border: none; border-bottom: 1px solid var(--border); background: transparent; color: var(--text-primary); font-size: 16px; padding: 16px 18px; outline: none; }
.palette-results { overflow-y: auto; flex: 1; }
.palette-row { display: flex; align-items: center; gap: 12px; padding: 10px 18px; cursor: pointer; }
.palette-row:hover, .palette-row.active { background: var(--surface-2); }
.palette-row .icon { font-size: 17px; width: 24px; text-align: center; flex-shrink: 0; }
.palette-row .body { flex: 1; min-width: 0; }
.palette-row .titolo { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-row .sub { font-size: 11px; color: var(--text-muted); }
.palette-row .kind { font-size: 10px; color: var(--text-muted); background: var(--surface-2); border-radius: 999px; padding: 2px 8px; flex-shrink: 0; }
.palette-empty { padding: 24px 18px; text-align: center; color: var(--text-muted); font-size: 13px; }
.palette-hint { padding: 8px 18px; font-size: 10.5px; color: var(--text-muted); border-top: 1px solid var(--border); }

/* ---------- Kudos (Checkpoint 20) ---------- */
.kudos-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.kudos-tab { padding: 7px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-1); color: var(--text-secondary); font-size: 13px; font-weight: 600; cursor: pointer; }
.kudos-tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.kudos-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.kudos-card { background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.kudos-card-head { display: flex; align-items: center; gap: 10px; }
.kudos-icon { font-size: 20px; flex-shrink: 0; }
.kudos-msg { margin: 10px 0 0; font-size: 13px; color: var(--text-secondary); font-style: italic; }

/* ---------- Prenotazione trasferte self-service (2026-08-10) ---------- */
.travel-search-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.travel-options-block { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.travel-options-title { font-size: 12.5px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .03em; }
.travel-option {
  display: flex; align-items: center; gap: 14px; background: var(--surface-1); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 12px 14px; cursor: pointer; transition: border-color .15s, background .15s;
}
.travel-option:hover { border-color: var(--border-strong); }
.travel-option.selected { border-color: var(--brand); background: var(--surface-2); }
.travel-option-main { flex: 1; min-width: 0; }
.travel-option-title { font-weight: 700; font-size: 13.5px; }
.travel-option-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.travel-option-legs { font-size: 11.5px; color: var(--text-secondary); margin-top: 4px; display: flex; flex-direction: column; gap: 2px; }
.travel-option-price { font-weight: 800; font-size: 15px; color: var(--brand); flex-shrink: 0; text-align: right; }
.travel-option-price small { display: block; font-weight: 600; font-size: 10.5px; color: var(--text-muted); }
.travel-trip-summary { background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; font-size: 12.5px; color: var(--text-secondary); line-height: 1.6; }
.travel-policy-hint { font-size: 11.5px; color: var(--text-muted); background: var(--surface-2); border-radius: 8px; padding: 8px 12px; }

/* ============ Fase 7 (2026-08-11) ============ */
.pulse-opzioni { display: flex; gap: 10px; flex-wrap: wrap; }
.pulse-opzione {
  display: flex; flex-direction: column; align-items: center; gap: 4px; background: var(--surface-1); border: 2px solid var(--border);
  border-radius: 14px; padding: 14px 18px; cursor: pointer; font-size: 24px; color: var(--text); min-width: 84px;
}
.pulse-opzione span { font-size: 11px; font-weight: 600; color: var(--text-secondary); }
.pulse-opzione:hover { border-color: var(--border-strong); }
.pulse-opzione.selezionata { border-color: var(--brand); background: var(--surface-2); }

.welfare-riga { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.welfare-riga label { font-size: 13px; }
.welfare-input { width: 90px; background: var(--surface-1); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; color: var(--text); font-family: inherit; text-align: right; }
.welfare-totale-riga { display: flex; justify-content: space-between; gap: 8px; padding: 12px 0 4px; font-size: 13px; }

.carriera-livello-card {
  background: linear-gradient(135deg, var(--brand), var(--series-7)); color: #fff; border-radius: var(--radius-md);
  padding: 20px 22px; box-shadow: var(--shadow-card);
}
.carriera-livello-badge { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.carriera-livello-card p { margin: 0; font-size: 13px; opacity: .92; }

.ilmioanno-hero { display: flex; align-items: center; gap: 16px; }

/* ============ War Room — self-service (2026-08-11) ============ */
.warroom-detail { max-width: 640px; }
.warroom-detail-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.warroom-detail h4 { margin: 18px 0 8px; font-size: 13px; }
.warroom-gravita-badge {
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-secondary);
}
.warroom-gravita-badge.grav-critica, .warroom-gravita-badge.grav-estrema { background: var(--status-critical-bg); color: var(--status-critical); }
.warroom-gravita-badge.grav-alta { background: rgba(217,119,6,.15); color: #d97706; }
.warroom-stato-badge { font-size: 11px; font-weight: 600; }
.warroom-timeline { display: flex; flex-direction: column; gap: 6px; max-height: 240px; overflow-y: auto; background: var(--surface-1); border-radius: 8px; padding: 10px 12px; }
.warroom-timeline-riga { font-size: 12px; line-height: 1.5; }
.warroom-timeline-ora { color: var(--text-muted); font-size: 10.5px; margin-right: 6px; }
.warroom-membri-list { display: flex; flex-direction: column; gap: 6px; }
.warroom-membro-riga { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; }
.warroom-membro-nome { font-size: 12.5px; font-weight: 600; }

/* ---- War Room "super lavoro": SLA, esercitazione, rapporto di chiusura (2026-08-11) ---- */
.warroom-esercitazione-badge {
  font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 2px 7px; border-radius: 999px;
  background: rgba(124,58,237,.15); color: #7c3aed;
}
.warroom-sla-badge { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.warroom-sla-badge.sla-ok { background: rgba(16,185,129,.15); color: #10b981; }
.warroom-sla-badge.sla-avviso { background: rgba(217,119,6,.15); color: #d97706; }
.warroom-sla-badge.sla-scaduto { background: var(--status-critical-bg); color: var(--status-critical); }
.warroom-rapporto-box { background: var(--surface-1); border-radius: 8px; padding: 12px 14px; margin: 10px 0; font-size: 12.5px; display: flex; flex-direction: column; gap: 6px; }
.warroom-rapporto-box strong { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); }
