/* ---------- Login (poster/premiere gate: stesso wash dorato del topbar) ---------- */
.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; }
#passwordInput {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 11px 14px; font-size: 14px; color: var(--text-primary);
}
#passwordInput: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); }

/* ---------- Shared shell (mirrors dashboard, poster-style topbar) ---------- */
.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 di navigazione ---------- */
.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%);
}
.sidebar .brand-text { overflow: hidden; white-space: nowrap; }
.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-size: 22px; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
:root[data-theme="dark"] .sidebar-team-value { text-shadow: 0 0 14px var(--cinema-glow); }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) .sidebar-team-value { text-shadow: 0 0 14px var(--cinema-glow); } }
.sidebar.collapsed .sidebar-team { padding: 10px 4px; text-align: center; }
.sidebar.collapsed .sidebar-team-label { display: none; }
.sidebar.collapsed .sidebar-team-value { font-size: 12px; }
.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);
  background-image: radial-gradient(ellipse 820px 220px at 12% 0%, var(--cinema-gold-soft), transparent 65%);
  border-bottom: 1px solid var(--border); 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; }
.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; }
.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; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.live-indicator { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--status-good); background: var(--status-good-bg); padding: 6px 10px; border-radius: 999px; }
.live-indicator.offline { color: var(--status-critical); background: var(--status-critical-bg); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.8s infinite; }
.live-indicator:not(.offline) .live-dot { box-shadow: 0 0 6px currentColor; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.role-badge { font-size: 12px; font-weight: 600; color: var(--text-secondary); background: var(--surface-2); border: 1px solid var(--border); padding: 6px 12px; border-radius: 999px; }
.admin-link { font-size: 12px; text-decoration: none; color: var(--text-secondary); border: 1px solid var(--border); padding: 6px 12px; border-radius: 999px; }
.admin-link:hover { border-color: var(--border-strong); color: var(--text-primary); }
.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; }

/* ---------- Badge di stato + pallini colorati (mirror di dashboard/style.css: qui mancavano) ---------- */
.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); }

.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 (mirror di dashboard/style.css: qui mancavano, usate dal pannello reparto del manager) ---------- */
.kpi-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.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-value { font-family: var(--font-mono); font-size: 27px; 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; }

/* ---------- Notifiche ---------- */
.notif-wrap { position: relative; }
#notifBtn { position: relative; }
.notif-badge {
  position: absolute; top: -5px; right: -5px; background: var(--status-critical); color: #fff;
  font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; padding: 0 3px; line-height: 1;
}
.notif-panel {
  position: absolute; top: calc(100% + 8px); right: 0; width: 340px; max-height: 420px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-pop); z-index: 50; display: flex; flex-direction: column; overflow: hidden;
}
.notif-panel-head { padding: 12px 16px; font-size: 13px; font-weight: 700; border-bottom: 1px solid var(--border); }
.notif-list { overflow-y: auto; }
.notif-row { display: flex; gap: 10px; padding: 10px 16px; cursor: pointer; border-bottom: 1px solid var(--border); transition: background .1s; }
.notif-row:last-child { border-bottom: none; }
.notif-row:hover { background: var(--surface-2); }
.notif-row .icon { font-size: 16px; flex-shrink: 0; }
.notif-row .body { flex: 1; min-width: 0; }
.notif-row .titolo { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-row .dettaglio { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.notif-empty { padding: 24px 16px; text-align: center; font-size: 12px; color: var(--text-muted); }

.content { flex: 1; padding: 24px 28px 40px; max-width: 1440px; width: 100%; margin: 0 auto; }

/* ---------- Tabs ---------- */
.tab-panel[hidden] { display: none; }

.project-tag { font-size: 12px; color: var(--text-secondary); display: inline-block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.app-count-badge { font-size: 12px; font-weight: 600; color: var(--brand); background: rgba(42,120,214,0.12); border-radius: 999px; padding: 3px 10px; }
.trip-group-badge { font-size: 10px; font-weight: 600; color: var(--series-7); background: rgba(74,58,167,0.12); border-radius: 999px; padding: 2px 7px; margin-left: 4px; }
.piani-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.piano-tag { font-size: 10px; color: var(--text-secondary); background: var(--surface-2); border-radius: 6px; padding: 2px 7px; white-space: nowrap; }
.piano-editor-row { display: grid; grid-template-columns: 1fr 120px 32px; gap: 8px; align-items: center; margin-bottom: 6px; }
.piano-editor-row input { width: 100%; }
.piano-remove-btn { background: var(--status-critical-bg); color: var(--status-critical); border: none; border-radius: 8px; width: 30px; height: 30px; cursor: pointer; font-size: 14px; }
.app-picker-list { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; background: var(--surface-2); border-radius: 9px; padding: 10px; }
.app-picker-row { display: grid; grid-template-columns: 22px 1fr 170px 140px; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 8px; }
.app-picker-row.checked { background: var(--surface-raised); }
.form-field .app-picker-row label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-primary); cursor: pointer; margin: 0; }
.app-picker-row .muted { color: var(--text-muted); font-size: 11px; }
.app-picker-row select, .app-picker-row input { font-size: 11px; padding: 6px 8px; }
.hours-total { font-variant-numeric: tabular-nums; font-weight: 600; }
.hours-total.met { color: var(--status-good); }
.mini-avatar-stack { display: flex; }
.mini-avatar-stack .avatar { width: 24px; height: 24px; font-size: 9px; border-radius: 50%; border: 2px solid var(--surface); margin-left: -7px; }
.mini-avatar-stack .avatar:first-child { margin-left: 0; }

.member-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; max-height: 200px; overflow-y: auto; background: var(--surface-2); border-radius: 9px; padding: 10px; }
.form-field .member-picker label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-primary); cursor: pointer; }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.search-wrap { flex: 1; min-width: 220px; }
.toolbar input[type="search"], .toolbar select { background: var(--surface); border: 1px solid var(--border); color: var(--text-primary); border-radius: 10px; padding: 9px 12px; font-size: 13px; width: 100%; }
.toolbar select { width: auto; }
.toolbar input:focus, .toolbar select:focus { outline: none; border-color: var(--brand); }
.result-count { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.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); }
.small-btn { background: var(--surface); border: 1px solid var(--border); color: var(--text-secondary); border-radius: 10px; padding: 9px 14px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.small-btn:hover { border-color: var(--border-strong); color: var(--text-primary); }
.csv-hint { font-size: 11.5px; color: var(--text-muted); margin: -10px 0 16px; }
.csv-hint code { background: var(--surface-2); border-radius: 4px; padding: 1px 5px; }

/* ---------- Table ---------- */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-card); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.admin-table td { padding: 10px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--surface-2); }
.row-emp { display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.row-name { font-weight: 600; font-size: 13px; }
.row-id { font-size: 11px; color: var(--text-muted); }
.row-dept { font-size: 12px; }
.row-role { font-size: 11px; color: var(--text-secondary); }
.inline-select { background: var(--surface-2); border: 1px solid var(--border); color: var(--text-primary); border-radius: 8px; padding: 6px 8px; font-size: 12px; max-width: 180px; }
.inline-select:focus { outline: none; border-color: var(--brand); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.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); }

.status-select { font-weight: 600; }
.status-select.st-in_turno { color: var(--status-good); }
.status-select.st-in_pausa { color: #8a5a00; }
:root[data-theme="dark"] .status-select.st-in_pausa { color: var(--status-warning); }
.status-select.st-smontato { color: var(--text-secondary); }
.status-select.st-assente { color: var(--status-critical); }
.status-select.st-ferie { color: var(--series-7); }
.status-select.st-manutenzione { color: var(--status-critical); font-style: italic; }

.empty-state { padding: 50px 20px; text-align: center; color: var(--text-secondary); }

/* ---------- Modal / Form ---------- */
.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: 680px; 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: 20px; }

.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; }

.week-editor { display: flex; gap: 6px; }
.week-editor .form-field { flex: 1; }
.week-editor label { text-align: center; }

.modal-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 6px; border-top: 1px solid var(--border); margin-top: 4px; }
.modal-actions .left { display: flex; gap: 8px; }
.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); }

.note-list { display: flex; flex-direction: column; gap: 8px; max-height: 160px; overflow-y: auto; margin-bottom: 10px; }
.note-item { background: var(--surface-2); border-radius: 8px; padding: 8px 10px; font-size: 12px; }
.note-item .meta { color: var(--text-muted); font-size: 11px; margin-bottom: 2px; }
.add-note-row { display: flex; gap: 8px; }
.add-note-row input { flex: 1; }

.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; }

/* ---------- Timeline/Gantt produzioni ---------- */
.timeline-legend { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-bottom: 12px; }
.timeline-legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); }
.timeline-list { display: flex; flex-direction: column; gap: 8px; }
.timeline-row {
  display: flex; flex-direction: column; gap: 8px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 12px 16px; box-shadow: var(--shadow-card); transition: border-color .12s, box-shadow .14s, transform .14s;
}
.timeline-row:hover { border-color: var(--border-strong); box-shadow: var(--shadow-pop); transform: translateY(-1px); }
.timeline-row-head { display: flex; align-items: center; gap: 10px; }
.timeline-row-head .icon { font-size: 16px; width: 22px; text-align: center; }
.timeline-row-head .nome { font-size: 13px; font-weight: 600; }
.timeline-row-head .sub { font-size: 11px; color: var(--text-muted); }
.timeline-row-head .status-badge { margin-left: auto; }
.timeline-bar-wrap { display: flex; align-items: center; gap: 10px; }
.timeline-date { font-size: 10px; color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; width: 62px; }
.timeline-date.end { text-align: right; }
.timeline-bar { position: relative; flex: 1; height: 20px; background: var(--gridline); border-radius: 5px; overflow: hidden; }
.timeline-bar-empty { display: flex; align-items: center; padding-left: 10px; font-size: 11px; color: var(--text-muted); background: transparent; }
.timeline-seg { position: absolute; top: 0; bottom: 0; }
.timeline-seg.seg-neutral { background: var(--status-neutral); opacity: .55; }
.timeline-seg.seg-good { background: var(--status-good); }
.timeline-seg.seg-warning { background: var(--status-warning); }
.timeline-seg.seg-critical { background: var(--status-critical); }
.timeline-seg.seg-info { background: var(--series-7); }
.timeline-today { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text-primary); z-index: 2; }

@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
  .week-editor { flex-wrap: wrap; }
  .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-group-label,
  .sidebar:not(.collapsed) .sidebar-link-label { display: none; }
  .sidebar:not(.collapsed) .sidebar-team { padding: 10px 4px; text-align: center; }
  .sidebar:not(.collapsed) .sidebar-team-value { font-size: 12px; }
  .sidebar:not(.collapsed) .sidebar-link { justify-content: center; padding: 9px 4px; }
}

/* ---------- Request-list (bacheca/OKR/clima, mancava in admin — vedi lezione Checkpoint 7/14) ---------- */
.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; }
.hours-progress-track { position: relative; height: 8px; background: var(--gridline); border-radius: 6px; overflow: hidden; }
.hours-progress-fill { position: absolute; inset: 0 auto 0 0; background: var(--brand); border-radius: 6px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-head h3 { margin: 0; font-size: 15px; }

/* ---------- Fase 5: Contabilità Generale ---------- */
.bilancio-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; margin-top: 16px; }
.bilancio-row {
  display: flex; justify-content: space-between; align-items: center; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 12px 16px; font-size: 13px;
}
.bilancio-row strong { font-variant-numeric: tabular-nums; }

/* ---------- Fase 5: Media Review ---------- */
.media-review-list { display: flex; flex-direction: column; gap: 12px; }
.media-review-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px 16px; box-shadow: var(--shadow-card); }
.media-review-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 10px; }
.media-review-commenti { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; max-height: 160px; overflow-y: auto; }
.media-review-commento { font-size: 12.5px; background: var(--surface-1); border-radius: 8px; padding: 6px 10px; }
.media-review-commento-form { display: flex; gap: 8px; }
.media-review-commento-form input[name="testo"] { flex: 1; }
.media-review-commento-form input, .media-review-commento-form select {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font-size: 12.5px; color: var(--text);
}

/* ---------- Visibilità sezioni/tab (Impostazioni) ---------- */
#visibilitaTabList { display: flex; flex-direction: column; gap: 10px; max-width: 640px; }
.visibilita-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 16px; }
.visibilita-group-head { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; }
.visibilita-group-head input { width: 16px; height: 16px; }
.visibilita-tabs { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 10px 0 2px 26px; }
.visibilita-tab-item { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-secondary); cursor: pointer; }
.visibilita-tab-item input { width: 14px; height: 14px; }

/* ---------- Fase 6: Dashboard Predittiva ---------- */
.insight-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.insight-col h3 { font-size: 14px; margin: 0 0 10px; }

/* ---------- Fase 6: Mappa produzioni ---------- */
#mappaContainer { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px; }
.mappa-svg { width: 100%; height: auto; }
.mappa-grid { stroke: var(--border); stroke-width: 1; opacity: .5; }
.mappa-punto circle { fill: var(--brand); stroke: var(--surface); stroke-width: 2; }
.mappa-punto.cliente circle { fill: var(--cinema-gold, #caa14d); }
.mappa-punto text { font-size: 11px; fill: var(--text); font-weight: 600; }
.mappa-legend { display: flex; gap: 20px; margin-top: 10px; font-size: 12.5px; color: var(--text-muted); }

/* ---------- Fase 6: Assistente conversazionale ---------- */
.assistente-chat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px;
  height: 400px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px;
}
.assistente-msg { max-width: 70%; padding: 9px 14px; border-radius: 14px; font-size: 13px; line-height: 1.5; }
.assistente-msg.utente { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.assistente-msg.assistente { align-self: flex-start; background: var(--surface-1); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.assistente-form { display: flex; gap: 10px; }
.assistente-form input { flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; color: var(--text); }

/* ---------- Fase 6: Bacheca Kanban ---------- */
.kanban-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.kanban-col { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px; min-height: 200px; }
.kanban-col-head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; padding: 4px 6px 10px; }
.kanban-col-head span { color: var(--text-muted); font-weight: 500; }
.kanban-col-body { display: flex; flex-direction: column; gap: 8px; }
.kanban-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; box-shadow: var(--shadow-card); }
.kanban-card .titolo { font-size: 12.5px; font-weight: 600; }
.kanban-card .sub { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.kanban-card-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 8px; }
.kanban-card-actions button {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 6px; width: 24px; height: 24px;
  cursor: pointer; font-size: 12px; color: var(--text);
}
.kanban-card-actions button:hover { border-color: var(--border-strong); }

/* ---------- Fase 6: Gamification / Badge ---------- */
.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-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; }

/* ---------- Kudos wall (Checkpoint 20) ---------- */
.kudos-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-top: 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-card-head .row-name, .kudos-card-head .row-id { flex: 1; }
.kudos-card-head button { margin-left: auto; }

/* ---------- Colloqui 1:1 (Checkpoint 39, dato privato del manager) ---------- */
.colloqui-layout { display: flex; gap: 20px; align-items: flex-start; margin-top: 4px; }
.colloqui-people { width: 300px; flex-shrink: 0; display: flex; flex-direction: column; gap: 8px; max-height: 70vh; overflow-y: auto; }
.colloqui-person { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 12px; cursor: pointer; transition: border-color .12s, transform .12s; text-align: left; }
.colloqui-person:hover { transform: translateY(-1px); border-color: var(--border-strong); }
.colloqui-person.active { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.colloqui-person .avatar-sm { width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.colloqui-person .info { flex: 1; min-width: 0; }
.colloqui-person .info .nome { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.colloqui-person .info .sub { font-size: 10.5px; color: var(--text-muted); }
.colloqui-person .followup-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--status-warning); flex-shrink: 0; }
.colloqui-detail { flex: 1; min-width: 0; }
.colloqui-note-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 14px; margin-bottom: 10px; }
.colloqui-note-item .meta { font-size: 11px; color: var(--text-muted); margin-bottom: 6px; display: flex; justify-content: space-between; gap: 8px; }
.colloqui-note-item .testo { font-size: 13px; white-space: pre-wrap; }
.colloqui-note-item .followup { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); font-size: 12px; display: flex; align-items: center; gap: 8px; }
.colloqui-note-item .followup.completata { opacity: .6; text-decoration: line-through; }
.colloqui-form { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px; margin-bottom: 18px; }
.colloqui-form .form-grid { margin-bottom: 10px; }
@media (max-width: 900px) {
  .colloqui-layout { flex-direction: column; }
  .colloqui-people { width: 100%; max-height: 240px; }
}

/* ---------- 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-msg { margin: 10px 0 0; font-size: 13px; color: var(--text-secondary); font-style: italic; }

/* ============ War Room — Centro di Comando (2026-08-11) ============ */
.warroom-badge {
  margin-left: auto; background: var(--status-critical); color: #fff; font-size: 10px; font-weight: 800;
  border-radius: 999px; min-width: 17px; height: 17px; padding: 0 5px; display: flex; align-items: center; justify-content: center;
}
.warroom-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.warroom-card {
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--text-muted); border-radius: var(--radius-md);
  padding: 14px 16px; cursor: pointer; box-shadow: var(--shadow-card); transition: transform .1s ease;
}
.warroom-card:hover { transform: translateY(-2px); }
.warroom-card.grav-media { border-left-color: var(--status-info, #3b82f6); }
.warroom-card.grav-alta { border-left-color: var(--status-warning, #d97706); }
.warroom-card.grav-critica, .warroom-card.grav-estrema { border-left-color: var(--status-critical); }
.warroom-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.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-card-titolo { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.warroom-card-sub { font-size: 11.5px; color: var(--text-muted); margin-bottom: 8px; }
.warroom-card-moduli { font-size: 14px; }

.warroom-moduli-check { display: flex; flex-wrap: wrap; gap: 10px 18px; font-size: 12.5px; }
.warroom-moduli-check label { display: flex; align-items: center; gap: 6px; }

.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-membri-list { display: flex; flex-direction: column; gap: 6px; }
.warroom-membro-riga { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.warroom-membro-nome { flex: 1; font-size: 12.5px; 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; }

/* ---- War Room "super lavoro": SLA, esercitazione, sub-navigazione, analytics, playbook, contatti (2026-08-11) ---- */
.warroom-subnav { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 18px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.warroom-subnav-btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary); border-radius: 999px;
  padding: 6px 14px; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.warroom-subnav-btn.active { background: var(--brand, #2563eb); border-color: var(--brand, #2563eb); color: #fff; }
.warroom-subview { min-height: 60px; }

.warroom-card.esercitazione { border-left-color: #7c3aed; border-style: dashed; }
.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-analytics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 18px; }
.warroom-analytics-bars { display: flex; flex-direction: column; gap: 8px; }
.warroom-analytics-bar-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.warroom-analytics-bar-label { width: 130px; flex-shrink: 0; color: var(--text-secondary); }
.warroom-analytics-bar-track { flex: 1; height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.warroom-analytics-bar-fill { height: 100%; background: var(--brand, #2563eb); border-radius: 999px; }
.warroom-analytics-bar-count { width: 26px; text-align: right; font-weight: 700; color: var(--text-primary); }

.warroom-playbook-list { display: flex; flex-direction: column; gap: 14px; }
.warroom-playbook-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px 16px; }
.warroom-playbook-card h4 { margin: 0 0 8px; font-size: 13px; }
.warroom-playbook-card textarea { width: 100%; min-height: 90px; font-size: 12.5px; }
.warroom-playbook-hint { font-size: 10.5px; color: var(--text-muted); margin: 6px 0 8px; }

.warroom-rapporto-box { background: var(--surface-1); border-radius: 8px; padding: 12px 14px; margin-top: 10px; 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); }
.warroom-contatto-categoria { font-size: 10px; font-weight: 700; text-transform: uppercase; background: var(--surface-2); color: var(--text-secondary); border-radius: 999px; padding: 2px 8px; }
