/* ===== Stili condivisi da tutte le pagine (menu, icone, campi titolo) ===== */

/* --- Menu di navigazione --- */
#mainNav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
  padding: 6px 12px;
  font-family: Helvetica, sans-serif;
  position: relative;
  z-index: 900;
}
#mainNav a.nav-link,
#mainNav .nav-group > button {
  background: none;
  border: none;
  color: #333;
  font-size: 14px;
  font-weight: bold;
  padding: 8px 14px;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}
#mainNav a.nav-link:hover,
#mainNav .nav-group > button:hover,
#mainNav .nav-group.open > button { background: #f0f4f8; }
#mainNav .active,
#mainNav .nav-group.current > button { color: #0078d7; box-shadow: inset 0 -2px 0 #0078d7; }
#mainNav .nav-group { position: relative; }
#mainNav .nav-group > button .caret { font-size: 10px; margin-left: 4px; }
#mainNav .nav-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 170px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  padding: 4px;
  margin-top: 4px;
}
#mainNav .nav-group.open .nav-menu { display: block; }
#mainNav .nav-menu a {
  display: block;
  padding: 8px 12px;
  color: #333;
  text-decoration: none;
  font-size: 14px;
  border-radius: 4px;
  white-space: nowrap;
}
#mainNav .nav-menu a:hover { background: #f0f4f8; }
#mainNav .nav-menu a.active { color: #0078d7; font-weight: bold; box-shadow: none; }

/* --- Icone nei pulsanti --- */
.btn-icon {
  width: 15px;
  height: 15px;
  vertical-align: -3px;
  margin-right: 6px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --- Lente nella casella di ricerca --- */
#searchInput {
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='16.5' y1='16.5' x2='21' y2='21'/%3E%3C/svg%3E") no-repeat 8px center / 15px;
  padding-left: 30px !important;
}

/* --- Titolo serie modificabile --- */
.title-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid transparent !important;
  background: transparent;
  font: inherit;
  font-size: 14px;
  padding: 3px 4px !important;
  border-radius: 3px;
}
/* sottolineatura tratteggiata: si capisce che è modificabile anche su iPad (senza mouse) */
.title-input:not([readonly]) { border-bottom: 1px dashed #b5b5b5 !important; cursor: text; }
.title-input:not([readonly]):hover { border-color: #ccc !important; border-bottom-style: solid !important; background: #fff; }
.title-input:not([readonly]):focus { border-color: #0078d7 !important; background: #fff; outline: none; }
.title-input[readonly] { cursor: default; }

/* --- Elementi riservati: nascosti finché il ruolo non è verificato --- */
.hide-admin-cols thead { display: none; }

/* --- Ombre --- */
#mainNav { box-shadow: 0 2px 6px rgba(0,0,0,0.05); }
#mainNav .nav-menu { box-shadow: 0 8px 24px rgba(0,0,0,0.14); }

.top-bar button,
#userArea button,
.small-btn,
.action-btn,
.modal-content button,
#btnReport,
#modalReport button {
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.top-bar button:hover,
#userArea button:hover,
.small-btn:hover,
.action-btn:hover,
.modal-content button:hover,
#btnReport:hover,
#modalReport button:hover {
  box-shadow: 0 3px 8px rgba(0,0,0,0.22);
  transform: translateY(-1px);
}

#seriesTable, #filmTable, #supTable {
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.modal-content,
#modalReport .modalContent { box-shadow: 0 12px 40px rgba(0,0,0,0.25); }

#searchInput { box-shadow: inset 0 1px 2px rgba(0,0,0,0.06); }

/* badge del ruolo nascosto finché non è caricato (niente "pillola" vuota) */
.badge:empty { display: none; }

/* --- Il mio account --- */
#userArea #btnAccount { background-color: #0078d7; margin-right: 6px; }
#userArea #btnAccount:hover { background-color: #005ea3; }
#accountModal {
  display: none; position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.45); justify-content: center; align-items: center;
  font-family: Helvetica, sans-serif;
}
#accountModal .acc-box {
  position: relative; background: #fff; border-radius: 8px; padding: 22px 24px;
  width: 380px; max-width: calc(100% - 32px); box-sizing: border-box; text-align: left;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}
#accountModal h2 { margin: 0 0 6px; font-size: 20px; }
#accountModal h3 { margin: 18px 0 8px; font-size: 15px; }
#accountModal .acc-close { position: absolute; right: 14px; top: 8px; font-size: 24px; color: #999; cursor: pointer; }
#accountModal .acc-close:hover { color: #333; }
#accountModal .acc-note { margin: 0 0 8px; color: #b35c00; font-size: 14px; }
#accountModal .acc-note:empty { display: none; }
#accountModal .acc-current { font-size: 14px; color: #555; }
#accountModal input { display: block; width: 100%; box-sizing: border-box; padding: 8px; margin: 0 0 8px; font-size: 14px; border: 1px solid #ccc; border-radius: 4px; }
#accountModal button { background: #0078d7; color: #fff; border: none; border-radius: 4px; padding: 8px 16px; font-weight: bold; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,0.18); }
#accountModal button:hover { background: #005ea3; }
#accountModal .acc-msg { margin-top: 14px; font-size: 14px; }
#accountModal .acc-msg.ok { color: #1e7e34; }
#accountModal .acc-msg.err { color: #c9302c; }

/* voce "Passa a Webmaster / Torna a Direzione" in fondo ad Amministrazione */
#mainNav .nav-menu a.nav-role-switch { border-top: 1px solid #eee; margin-top: 4px; padding-top: 10px; color: #6f42c1; font-weight: bold; border-radius: 0 0 4px 4px; }
#mainNav .nav-menu a.nav-role-switch:hover { background: #f3effa; }

/* --- Zona utente: nome con il ruolo sotto, poi i pulsanti --- */
#userArea { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
#userArea .user-id { display: flex; flex-direction: column; align-items: flex-end; margin-right: 8px; line-height: 1.2; }
#userArea .user-id #greeting { margin: 0; }
#userArea .user-id .badge {
  margin: 3px 0 0;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: bold;
  border-radius: 8px;
  letter-spacing: 0.3px;
}
#userArea #btnAccount { margin-right: 0; }

/* --- Colonna Archivio: spunta verde tonda o conteggio episodi --- */
.arch-check { width: 20px; height: 20px; vertical-align: middle; }
.arch-check circle { fill: #28a745; }
.arch-check polyline { fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.arch-count { font-size: 12px; color: #666; font-variant-numeric: tabular-nums; white-space: nowrap; }
.arch-count.full { color: #1e7e34; font-weight: bold; }

/* --- Modal Episodi: pulsante Aggiorna --- */
.small-btn.green { background: #5cb85c; color: #fff; border: none; }
.small-btn.green:hover { background: #449d44; }
.small-btn:disabled { opacity: 0.6; cursor: wait; }
/* pulsanti neutri (Aggiorna, N° episodi): solo bordo */
.small-btn.neutro { background: transparent; color: #222; border: 1px solid #222; box-shadow: none; }
.small-btn.neutro:hover { background: rgba(0,0,0,0.06); }

/* --- Menu del profilo (clic sul nome): Il mio account, Aspetto, Logout --- */
#userArea { position: relative; }
#userArea .user-id.cliccabile { cursor: pointer; padding: 4px 8px; border-radius: 8px; transition: background 0.15s; }
#userArea .user-id.cliccabile:hover, #userArea .user-id.cliccabile.aperto { background: #f0f4f8; }
#userArea .user-id.cliccabile #greeting::after { content: "▾"; font-size: 10px; margin-left: 5px; color: #888; }
#menuProfilo {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 1500; width: 270px; text-align: left;
  background: #fff; border: 1px solid #ddd; border-radius: 12px; box-shadow: 0 12px 34px rgba(0,0,0,0.16); overflow: hidden;
  font-family: Helvetica, sans-serif;
}
#menuProfilo > button { display: flex; align-items: center; gap: 8px; width: 100%; border: none; background: none; padding: 12px 14px; font-size: 14px; color: #222; cursor: pointer; text-align: left; box-shadow: none; border-radius: 0; font-weight: normal; }
#menuProfilo > button:hover { background: #f0f4f8; transform: none; box-shadow: none; }
#menuProfilo > button .btn-icon { margin-right: 0; }
#menuProfilo .mp-tema { padding: 10px 14px 12px; border-top: 1px solid #eee; }
#menuProfilo .mp-titolo { font-size: 12px; font-weight: bold; color: #666; margin-bottom: 6px; }
#menuProfilo .mp-seg { display: flex; background: #eef1f4; border-radius: 8px; padding: 2px; gap: 2px; }
#menuProfilo .mp-seg button { flex: 1; border: none; background: none; padding: 6px 4px; border-radius: 6px; font-size: 13px; color: #333; cursor: pointer; box-shadow: none; }
#menuProfilo .mp-seg button.on { background: #fff; color: #0078d7; font-weight: bold; box-shadow: 0 1px 3px rgba(0,0,0,0.15); }
#menuProfilo .mp-nota { font-size: 11px; color: #888; margin-top: 6px; }
#menuProfilo .mp-notifiche .mp-nota { margin: 0 0 6px; }
#menuProfilo .mp-seg button:disabled { opacity: 0.45; cursor: default; }

/* --- Note di versione (clic sul footer) --- */
footer.footer-cliccabile { cursor: pointer; }
footer.footer-cliccabile:hover { text-decoration: underline; }
#noteVersione { display: none; position: fixed; inset: 0; z-index: 2100; background: rgba(0,0,0,0.45); justify-content: center; align-items: center; font-family: Helvetica, sans-serif; }
#noteVersione .nv-box { position: relative; background: #fff; border-radius: 12px; padding: 16px 28px 22px; width: 460px; max-width: calc(100% - 32px); max-height: 80vh; overflow: auto; box-sizing: border-box; text-align: center; box-shadow: 0 12px 40px rgba(0,0,0,0.25); }
#noteVersione .nv-chiudi { position: absolute; right: 16px; top: 16px; font-size: 24px; line-height: 1; color: #999; cursor: pointer; }
#noteVersione .nv-chiudi:hover { color: #333; }
#noteVersione .nv-logo { width: 260px; margin: -20px auto -16px; display: block; }   /* l'immagine ha spazio vuoto incorporato sopra e sotto: logo e versione si leggono insieme */
#noteVersione .nv-versione { font-size: 15px; font-weight: bold; color: #0078d7; }
#noteVersione .nv-beta { display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 9px; background: #fff3cd; color: #8a6100; font-size: 10px; font-weight: bold; text-transform: uppercase; letter-spacing: 0.4px; vertical-align: 2px; }
#noteVersione .nv-data { font-size: 12px; color: #888; margin-top: 2px; }
#noteVersione .nv-descr { font-size: 11px; color: #333; margin: 12px 0 6px; line-height: 1.3; }
#noteVersione .nv-vuoto { color: #888; }
#noteVersione .nv-punti { display: inline-block; text-align: left; margin: 0; padding-left: 20px; }
#noteVersione .nv-punti li { margin: 0; }
#noteVersione .nv-riga .nv-punti { display: block; margin-top: 3px; }
#noteVersione .nv-titolo { margin: 14px 0 6px; padding-top: 12px; border-top: 1px solid #eee; font-size: 10px; font-weight: bold; color: #666; text-transform: uppercase; letter-spacing: 0.4px; text-align: left; }
#noteVersione .nv-elenco { text-align: left; }
#noteVersione .nv-riga { padding: 6px 0; border-bottom: 1px solid #f2f2f2; font-size: 10px; color: #444; }
#noteVersione .nv-riga:last-child { border-bottom: none; }
#noteVersione .nv-riga b { color: #0078d7; margin-right: 8px; }
#noteVersione .nv-quando { color: #999; font-size: 10px; }
#noteVersione .nv-riga div { margin-top: 3px; }


/* righe alternate delle tabelle: bianco / grigio chiaro (il tema scuro le ridefinisce in tema-scuro.css) */
tbody tr:not(.changed):nth-child(even) td { background: #e9ebef; }

/* finestra Annotazioni (serie e film): intestazione come la finestra Episodi */
.annot-testa { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 28px 12px 0; text-align: left; }
.annot-testa .title-line { font-size: 20px; font-weight: bold; line-height: 1.2; overflow-wrap: anywhere; }
.annot-testa .season-line { font-size: 14px; font-weight: normal; color: #555; margin-top: 2px; }
.annot-testa #btnFirma { flex: none; }

/* --- Scaricato tolto: finestra della motivazione --- */
#dlgMotivo { position: fixed; inset: 0; z-index: 2200; background: rgba(0,0,0,0.45); display: flex; align-items: center; justify-content: center; font-family: Helvetica, sans-serif; }
#dlgMotivo .dm-box { background: #fff; border-radius: 12px; width: 380px; max-width: calc(100% - 32px); padding: 18px 20px 16px; box-shadow: 0 12px 40px rgba(0,0,0,0.25); text-align: left; }
#dlgMotivo #dmTitolo { font-size: 17px; font-weight: bold; color: #222; }
#dlgMotivo .dm-cosa { font-size: 13px; color: #666; margin-top: 3px; }
#dlgMotivo .dm-scelte { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 10px; }
#dlgMotivo .dm-scelte label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #222; cursor: pointer; }
#dlgMotivo #dmNumero { display: block; width: 100%; box-sizing: border-box; margin-top: 14px; border: 1px solid #ccc; border-radius: 8px; padding: 8px 10px; font-size: 16px; font-family: inherit; }
#dlgMotivo textarea { width: 100%; box-sizing: border-box; border: 1px solid #ccc; border-radius: 8px; padding: 7px 9px; font-size: 13px; font-family: inherit; resize: none; }
#dlgMotivo .dm-piede { display: flex; justify-content: space-between; margin-top: 12px; }
#dlgMotivo .dm-piede button { border: 1px solid #ccc; background: #fff; color: #333; border-radius: 6px; padding: 7px 16px; font-size: 14px; font-weight: bold; cursor: pointer; box-shadow: none; }
#dlgMotivo .dm-piede .dm-ok { background: #0078d7; border-color: #0078d7; color: #fff; }
#dlgMotivo .dm-piede .dm-ok:disabled { opacity: 0.45; cursor: default; }

/* --- Campanella "Notifiche" del Manager e finestrella sotto --- */
.nt-titolo { font-size: 15px; font-weight: bold; color: #222; padding: 12px 14px 4px; }
.nt-sotto { font-size: 11px; color: #888; padding: 0 14px 6px; }
.nt-vuoto { font-size: 13px; color: #888; padding: 6px 14px 14px; }
.nt-voce { padding: 10px 14px; border-top: 1px solid #eee; }
.nt-cosa { font-size: 13px; font-weight: bold; color: #222; }
.nt-motivo { font-size: 12px; color: #c46a00; margin-top: 2px; }
.nt-chi { font-size: 11px; color: #888; margin-top: 2px; }
.nt-azioni { margin-top: 8px; }
.nt-voce button { border: 1px solid #0078d7; background: #0078d7; color: #fff; border-radius: 6px; padding: 5px 14px; font-size: 12px; font-weight: bold; cursor: pointer; box-shadow: none; }
.nt-firma { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.nt-firma input { flex: 1; min-width: 0; border: 1px solid #ccc; border-radius: 6px; padding: 5px 8px; font-size: 13px; }
.nt-errore { width: 100%; font-size: 11px; color: #d9534f; }
.nt-errore:empty { display: none; }
.nt-approvato { margin-top: 8px; font-size: 12px; font-weight: bold; color: #1e7e34; }
.nt-tutte { display: block; padding: 10px 14px; border-top: 1px solid #eee; font-size: 13px; color: #0078d7; text-decoration: none; text-align: center; }
.nt-tutte:hover { background: #f0f4f8; }
/* la zona password compare solo dopo "Approva"; i pulsanti non prendono lo stile rosso di Logout (#userArea button) */
.nt-firma[hidden], .nt-azioni[hidden] { display: none !important; }
/* firma: password su tutta la riga, sotto i due quadratini ✓ ✕ */
.nt-firma { flex-wrap: wrap !important; align-items: center; justify-content: center; }
.nt-firma input { flex: 1 1 100% !important; }
.nt-firma .nt-errore { flex-basis: 100%; }
.nt-voce .nt-firma .nt-q, td.firma .nt-firma .nt-q { flex: 0 0 auto; width: 26px; height: 26px; padding: 0 !important; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; line-height: 1; border-radius: 6px; }
.nt-voce .nt-firma .nt-annulla { background: transparent; color: #0078d7; }

/* pallino del Manager: autorizzazioni da fare */
#mainNav .nav-group > button { position: relative; }
#mainNav .pl-punto { position: absolute; top: 4px; right: 2px; width: 8px; height: 8px; border-radius: 50%; background: #d9534f; }
#mainNav .pl-num { display: inline-block; margin-left: 8px; min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 9px; background: #d9534f; color: #fff; font-size: 11px; font-weight: bold; line-height: 18px; text-align: center; vertical-align: 1px; }
#mainNav .pl-punto[hidden], #mainNav .pl-num[hidden] { display: none; }

/* --- 4.2: titoli in attesa del Manager --- */
.tag-attesa { display: inline-block; margin: 4px 0 0; padding: 2px 8px; border-radius: 10px; background: #fff3e0; color: #c46a00; font-size: 11px; font-weight: bold; white-space: nowrap; }
.tag-attesa.elim { background: #fdecea; color: #c9302c; }
td > .tag-attesa { display: table; }
#episodesTable td > .tag-attesa { margin: 4px auto 0; }
/* tabella episodi più larga SOLO se c'è una scritta "In attesa…" */
#episodesTable:has(.tag-attesa) th:nth-child(1) { width: 20% !important; }
#episodesTable:has(.tag-attesa) th:nth-child(2) { width: 62% !important; }
#episodesTable:has(.tag-attesa) th:nth-child(3) { width: 18% !important; }
/* nelle tabelle la scritta va a capo invece di allargare la colonna */
td > .tag-attesa { white-space: normal; max-width: 100%; box-sizing: border-box; text-align: center; line-height: 1.25; font-size: 10px; }
tr.bloccata td { opacity: 0.6; }
tr.bloccata td:first-child { opacity: 1; }
tr.bloccata .switch, tr.bloccata select, tr.bloccata button { pointer-events: none; }
.switch input:disabled + .slider { cursor: not-allowed; }
.nt-azione { font-size: 12px; font-weight: bold; color: #333; margin-top: 2px; }

/* 4.2: "Torna a Home" tolto (c'è il menu in alto); "Aggiorna" neutro (solo bordo) in tutte le pagine */
#btnHome { display: none !important; }
html body #btnRefresh { background: transparent !important; color: #222 !important; border: 1px solid #222 !important; box-shadow: none !important; }
html body #btnRefresh:hover { background: rgba(0,0,0,0.06) !important; }

/* lingua piccola accanto ai titoli nel cruscotto della Home */
.dash-lingua { font-size: 10px; font-weight: 600; color: #888; border: 1px solid #ccc; border-radius: 4px; padding: 0 4px; margin-left: 2px; white-space: nowrap; vertical-align: 1px; }
html[data-tema="scuro"] .dash-lingua { color: #9a9aa0; border-color: #48484a; }

/* 4.2.3: bubble del reparto dei TeamLeader (accanto a quella blu del ruolo) */
#userArea .badge-riga { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
#userArea .badge-riga .badge { margin-top: 3px; }
#userArea .badge-reparto { color: #fff; }
#userArea .user-id .badge { white-space: nowrap; }
.badge-reparto.r-download { background: #2e9d58 !important; }
.badge-reparto.r-file { background: #e08a00 !important; }
.badge-reparto.r-upload { background: #7a5af5 !important; }
.badge-reparto.r-link { background: #0a9bb0 !important; }
.badge-reparto.r-sito { background: #d6407a !important; }
.badge-reparto.r-segreteria { background: #5f7488 !important; }   /* 4.3.1: Deputy Manager "segreteria" */
.badge-reparto.r-assistant { background: #a0662f !important; }   /* 4.3.1: Deputy Manager "assistant" */

/* --- Finestre "Aggiungi serie" / "Aggiungi film" (PC): campi moderni, tutti larghi uguale --- */
#addSeriesModal .modal-content > input, #addSeriesModal .modal-content > select,
#addSeriesModal .row-inline, #addFilmModal .modal-content > input, #addFilmModal .modal-content > select,
#addSeriesModal .lingua-nuovo, #addFilmModal .lingua-nuovo { width: 100% !important; box-sizing: border-box !important; margin-left: 0 !important; margin-right: 0 !important; }
#addSeriesModal .row-inline { display: flex; gap: 10px; margin-top: 0; margin-bottom: 0; padding: 0; }
#addSeriesModal .field-small { flex: 1 1 0; min-width: 0; }
#addSeriesModal input:not([type="checkbox"]), #addSeriesModal select,
#addFilmModal input:not([type="checkbox"]), #addFilmModal select {
  display: block; width: 100%; box-sizing: border-box; margin: 6px 0; height: 38px; padding: 0 12px;
  font: 14px Helvetica, Arial, sans-serif; color: #222; background-color: #fff;
  border: 1px solid #cfcfd4; border-radius: 8px; outline: none; box-shadow: none;
  -webkit-appearance: none; appearance: none; transition: border-color .15s, box-shadow .15s;
}
#addSeriesModal select, #addFilmModal select {
  padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23888' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
#addSeriesModal input::placeholder, #addFilmModal input::placeholder { color: #999; }
#addSeriesModal input:not([type="checkbox"]):focus, #addSeriesModal select:focus,
#addFilmModal input:not([type="checkbox"]):focus, #addFilmModal select:focus { border-color: #0078d7; box-shadow: 0 0 0 3px rgba(0,120,215,.15); }
#addSeriesModal .lingua-nuovo, #addFilmModal .lingua-nuovo { margin-top: 6px !important; margin-bottom: 10px !important; border-color: #cfcfd4; padding: 8px 12px 6px; }
#addSeriesModal #saveSeriesBtn, #addFilmModal #saveFilmBtn { margin-top: 4px; }
html[data-tema="scuro"] #addSeriesModal select, html[data-tema="scuro"] #addFilmModal select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23999' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important; background-position: right 12px center !important;
}
html[data-tema="scuro"] #addSeriesModal input:not([type="checkbox"]):focus, html[data-tema="scuro"] #addSeriesModal select:focus,
html[data-tema="scuro"] #addFilmModal input:not([type="checkbox"]):focus, html[data-tema="scuro"] #addFilmModal select:focus { border-color: var(--sc-blu) !important; }
html[data-tema="scuro"] #addSeriesModal .lingua-nuovo, html[data-tema="scuro"] #addFilmModal .lingua-nuovo { border-color: var(--sc-bordo); }

/* ===== 4.3 CONVERSIONI HANDBRAKE (conversioni.js): sezione nelle annotazioni, menu dei preset, elenco ===== */
.cv-sezione { width: 95%; margin: 4px auto 6px; text-align: left; }
.cv-sezione[hidden] { display: none; }
.cv-sezione .cv-testa { font-size: 13px; font-weight: bold; color: #555; margin: 6px 0 6px; }
.cv-sezione .cv-nuova { display: flex; gap: 8px; align-items: stretch; }
.cv-sezione .cv-errore { font-size: 12px; color: #d9534f; margin-top: 4px; }
.cv-sezione .cv-errore:empty { display: none; }
/* menu a cascata */
.cv-menu { position: relative; flex: 1 1 auto; min-width: 0; width: auto; }
.cv-sezione .cv-menu .cv-scelta, .cv-menu .cv-scelta { width: 100%; height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 10px; margin: 0;
  background: #fff; color: #888; border: 1px solid #ccc; border-radius: 8px; font-size: 14px; font-weight: normal; cursor: pointer; text-align: left; }
.cv-menu .cv-scelta.ha-valore { color: #222; }
.cv-menu .cv-scelta:hover { background: #fff; border-color: #999; }
.cv-menu.aperto .cv-scelta, .cv-menu .cv-scelta:focus-visible { border-color: #0078d7; box-shadow: 0 0 0 3px rgba(0,120,215,.18); outline: none; }
.cv-menu .cv-valore { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-menu .cv-freccia { color: #888; font-size: 12px; }
.cv-menu .cv-pannello { position: absolute; left: 0; top: calc(100% + 4px); z-index: 2000; min-width: 190px; padding: 4px; background: #fff; border: 1px solid #d0d0d0; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.cv-menu .cv-pannello[hidden], .cv-menu .cv-sotto[hidden] { display: none; }
.cv-menu .cv-gruppo { position: relative; }
.cv-sezione .cv-menu .cv-cat, .cv-sezione .cv-menu .cv-p, .cv-menu .cv-cat, .cv-menu .cv-p { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 16px; margin: 0; padding: 6px 10px;
  background: transparent; color: #222; border: none; border-radius: 5px; font-size: 13px; font-weight: normal; text-align: left; white-space: nowrap; cursor: pointer; }
.cv-menu .cv-dx { color: #888; font-size: 11px; }
.cv-sezione .cv-menu .cv-cat:hover, .cv-sezione .cv-menu .cv-gruppo.aperto > .cv-cat, .cv-sezione .cv-menu .cv-p:hover,
.cv-menu .cv-cat:hover, .cv-menu .cv-gruppo.aperto > .cv-cat, .cv-menu .cv-p:hover { background: #0078d7; color: #fff; }
.cv-menu .cv-gruppo.aperto > .cv-cat .cv-dx, .cv-menu .cv-cat:hover .cv-dx { color: #fff; }
.cv-menu .cv-p.scelto { font-weight: bold; }
.cv-menu .cv-p.scelto::after { content: '✓'; }
.cv-menu .cv-sotto { position: absolute; left: calc(100% + 4px); top: 0; min-width: 250px; max-height: 70vh; overflow-y: auto; padding: 4px; background: #fff; border: 1px solid #d0d0d0; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.cv-menu .cv-gruppo.a-sinistra > .cv-sotto { left: auto; right: calc(100% + 4px); }
.cv-sezione .cv-segna, .cv-sezione button.cv-segna { flex: none; width: auto; margin: 0; padding: 0 14px; height: 34px; background: #0078d7; color: #fff; border: none; border-radius: 8px; font-size: 13px; font-weight: bold; cursor: pointer; }
.cv-sezione .cv-segna:hover { background: #005ea3; }
.cv-sezione .cv-segna:disabled { opacity: .45; cursor: default; background: #0078d7; }
/* elenco delle prove (annotazioni e pagina Conversioni) */
.cv-elenco { margin-top: 8px; max-height: 210px; overflow-y: auto; border-top: 1px solid #e3e3e3; }
.cv-voce { display: grid; grid-template-columns: 1fr auto; column-gap: 14px; align-items: center; padding: 7px 2px; border-bottom: 1px solid #e3e3e3; }
.cv-voce > .cv-titolo, .cv-voce > .cv-preset, .cv-voce > .cv-chi { grid-column: 1; }
.cv-voce > .cv-azioni, .cv-voce > .cv-firma, .cv-voce > .cv-esito { grid-column: 2; grid-row: 1 / span 3; }
.cv-voce .cv-titolo { font-size: 14px; font-weight: bold; }
.cv-voce .cv-preset { font-size: 13px; font-weight: bold; color: #222; }
.cv-voce .cv-tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 9px; background: #fff1d6; color: #a35a00; font-size: 11px; font-weight: bold; vertical-align: 1px; }
.cv-voce .cv-chi { font-size: 11px; color: #888; margin-top: 2px; }
.cv-voce .cv-azioni { display: flex; gap: 6px; }
.cv-voce .cv-azioni[hidden], .cv-voce .cv-firma[hidden] { display: none; }
.cv-voce .cv-azioni button, .cv-voce .cv-firma .cv-ok { width: auto; margin: 0; padding: 5px 12px; border: 1px solid #1e7e34; background: #1e7e34; color: #fff; border-radius: 6px; font-size: 12px; font-weight: bold; cursor: pointer; }
.cv-voce .cv-azioni .cv-fallito, .cv-voce .cv-firma.fallito .cv-ok { border-color: #d9534f; background: #d9534f; }
.cv-voce .cv-azioni button:hover { filter: brightness(.92); }
.cv-voce .cv-firma { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; width: 210px; }
.cv-voce .cv-firma input, .cv-sezione .cv-voce .cv-firma input { flex: 1 1 0; min-width: 0; width: auto; margin: 0; box-sizing: border-box; border: 1px solid #ccc; border-radius: 6px; padding: 5px 8px; font-size: 13px; }
.cv-voce .cv-firma .cv-q { flex: 0 0 28px; width: 28px; height: 28px; padding: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.cv-voce .cv-firma .cv-annulla { margin: 0; border: 1px solid #ccc; background: #fff; color: #555; border-radius: 6px; cursor: pointer; }
.cv-voce .cv-firma .cv-ok:disabled { opacity: .5; }
.cv-voce .cv-errore { width: 100%; font-size: 11px; color: #d9534f; }
.cv-voce .cv-errore:empty { display: none; }
.cv-voce .cv-esito { font-size: 12px; font-weight: bold; text-align: right; }
.cv-voce .cv-esito small { display: block; font-weight: normal; color: #888; font-size: 11px; }
.cv-voce .cv-esito.corretto { color: #1e7e34; }
.cv-voce .cv-esito.fallito { color: #d9534f; }
.cv-voce .cv-esito.in-prova { color: #a35a00; }

/* --- 4.2.4: elenco dei titoli mentre si scrive (saghe), al posto del datalist che su iPad non si apre --- */
.dlm-sugg { margin: 4px 0 0; border: 1px solid #cfcfd4; border-radius: 8px; background: #fff; overflow: hidden; max-height: 260px; overflow-y: auto; box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.dlm-sugg[hidden] { display: none !important; }
.dlm-sugg button { display: block; width: 100%; text-align: left; border: none; border-bottom: 1px solid #eee; background: none; padding: 9px 12px; font: 14px Helvetica, Arial, sans-serif; color: #222; cursor: pointer; box-shadow: none; margin: 0; border-radius: 0; }
.dlm-sugg button:last-child { border-bottom: none; }
.dlm-sugg button:hover, .dlm-sugg button.on { background: #eaf3fd; color: #0078d7; }
html[data-tema="scuro"] .dlm-sugg { background: var(--sc-superficie-2) !important; border-color: var(--sc-bordo) !important; }
html[data-tema="scuro"] .dlm-sugg button { color: var(--sc-testo) !important; border-bottom-color: var(--sc-bordo) !important; background: none !important; }
html[data-tema="scuro"] .dlm-sugg button:hover, html[data-tema="scuro"] .dlm-sugg button.on { background: rgba(10,132,255,.18) !important; color: #fff !important; }
/* 4.3: annotazioni di film e serie TV larghe uguali (prima film 420px, serie 500px) */
#annotationsModal .modal-content { width: 680px; max-width: 95%; box-sizing: border-box; }
#annotationsModal textarea { width: 100% !important; min-height: 240px; box-sizing: border-box; }
#annotationsModal .cv-sezione { width: 100%; }
#annotationsModal .annot-testa { width: auto !important; margin: 0 28px 12px 0 !important; }

/* ===== 4.3.1: test legati al fornitore, film scaricato in attesa del test, Fallito con motivo ===== */
.tag-attesa.test { background: #fff1d6; color: #a35a00; }
.cv-voce .cv-tag.scaricato { background: #e3f2fd; color: #0b5cad; }
.cv-voce > .cv-motivi { grid-column: 1 / -1; grid-row: 4; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; margin-top: 6px; font-size: 12px; }
.cv-voce > .cv-motivi[hidden] { display: none; }
.cv-voce .cv-motivi-testa { width: 100%; font-weight: bold; color: #c9302c; }
.cv-voce .cv-motivi label { display: inline-flex; gap: 5px; align-items: center; cursor: pointer; }
.cv-voce .cv-motivi input { width: auto; margin: 0; }
.cv-voce .cv-esito.fornitore_cambiato { color: #888; }
.cv-vecchi { margin-top: 8px; opacity: .6; }
.cv-vecchi-testa { font-size: 11px; font-weight: bold; color: #777; text-transform: uppercase; letter-spacing: .3px; padding: 4px 2px; border-bottom: 1px solid #e3e3e3; }
/* 4.3.1: nome utente nascosto accanto alle password (solo per il Portachiavi di Apple) */
.dlm-utente { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; border: 0 !important; opacity: 0 !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; pointer-events: none !important; }

/* 4.3.1: finestra episodi – con i titoli lunghi (American Horror Story, Code Lyoko Evolution, Desperate Housewives…)
   "Aggiorna" e "N° episodi" andavano su due righe. Ora i pulsanti restano sempre su una riga:
   la finestra è un po' più larga e, se serve, va a capo il titolo, mai i pulsanti. */
.episodes-modal .modal-content { width: 760px !important; max-width: 95% !important; }
.episodes-modal .episodes-header h2 { flex: 1 1 auto; min-width: 0; }
.episodes-modal .episodes-header .controls { flex: 0 0 auto; flex-wrap: nowrap; }
.episodes-modal .episodes-header .controls button { white-space: nowrap; flex: 0 0 auto; }

/* ===== 4.4: test di conversione per episodio ===== */
/* annotazioni dell'episodio: finestra dentro la finestra Episodi (sopra di essa), larga come quelle delle stagioni */
#epAnnotModal { z-index: 1100; }
#epAnnotModal .modal-content { width: 680px; max-width: 95%; box-sizing: border-box; margin-top: 6%; }
#epAnnotModal textarea { width: 100% !important; min-height: 200px; box-sizing: border-box; padding: 6px; font-size: 14px; resize: none; }
#epAnnotModal .cv-sezione { width: 100%; }
#epAnnotModal .annot-testa { width: auto !important; margin: 0 28px 12px 0 !important; }
#epAnnotModal .ep-firma { flex: none; background: #fff; color: #444; border: 1px solid #bbb; padding: 5px 12px; font-size: 13px; font-weight: bold; border-radius: 4px; cursor: pointer; }
#epAnnotModal .ep-firma:hover { background: #f2f2f2; border-color: #888; }
/* colonna Annotazioni degli episodi: Fornitore più stretto */
#episodesTable th:nth-child(2) { width: 46% !important; }
#episodesTable th:nth-child(4), #episodesTable td:nth-child(4) { width: 12%; text-align: center; }
#episodesTable:has(.tag-attesa) th:nth-child(1) { width: 18% !important; }
#episodesTable:has(.tag-attesa) th:nth-child(2) { width: 46% !important; }
#episodesTable:has(.tag-attesa) th:nth-child(3) { width: 16% !important; }
#episodesTable select { max-width: 100%; }
.ep-note-btn { position: relative; }
.ep-note-btn.ha-note::after { content: ''; position: absolute; top: -4px; right: -4px; width: 10px; height: 10px; border-radius: 50%; background: red; pointer-events: none; }
/* test sostituito da un test di stagione, o stagione finita con esiti diversi: grigio */
.cv-voce .cv-esito.saltato, .cv-voce .cv-esito.misto { color: #888; }
.cv-voce.saltata { opacity: .6; }
.cv-voce.cv-misti .cv-preset { color: #777; font-style: italic; }
