/* Wishlist LiveViewer — aggiunte a lamina-ui.css (moduli, galleria, commenti, telefono).
   Stessa palette: un solo blu per i dati, verde/ambra/rosso solo per significato. */

[hidden] { display: none !important; }
a { color: var(--xp-blue); }
.xp-menubar a.xp-menu-item, .xp-dropdown a.xp-dd-item, .xp-menubar a.xp-user { color: var(--xp-text); text-decoration: none; }
.xp-menubar .xp-menu > .xp-menu-item.active { background: #dfe6f0; font-weight: 700; }
a.xp-bb-tile, a.xp-nav-btn, a.xp-crumb-seg, a.xp-btn { color: inherit; text-decoration: none; }
a.xp-btn { display: inline-flex; align-items: center; justify-content: center; }
a.xp-btn.primary { color: #fff; }
.xp-bottombar .xp-bb-tile svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
/* logo e marchio LiveViewer: "Live" blu, "Viewer" nero, come nell'app */
.lv-logo { width: 46px; height: 46px; flex: none; }
.xp-brand .xp-brand-name { color: var(--xp-text); }
.lv-live { color: var(--xp-blue); }
.xp-crumb .xp-nav-btn.home { display: grid; place-items: center; }
.lv-casa { width: 22px; height: 22px; fill: #fff; }
.lv-login-brand { display: flex; align-items: center; gap: 10px; }
.lv-login-brand img { flex: none; }
.lv-login-brand .lv-live { color: #6fa1ea; }
.lv-login-brand small { font-weight: 400; font-size: 14px; opacity: .8; margin-left: auto; }

/* pagine */
.xp-app { grid-template-columns: minmax(0, 1fr); } /* 1fr = minmax(auto,1fr): la colonna crescerebbe col contenuto */
.lv-toolbar { flex-wrap: wrap; row-gap: 4px; height: auto; min-height: 36px; padding: 5px 4px; }
.lv-filtri { flex-wrap: wrap; gap: 6px; }
.lv-filtri select, .lv-filtri input { height: 24px; border: 1px solid var(--xp-border); background: #fff; padding: 0 4px; }
.lv-filtri input[type=search] { width: 220px; }
.lv-panel-flush { margin-top: 0; flex: 1; min-height: 160px; }
.lv-tabella td.lv-c-titolo { white-space: normal; min-width: 240px; }
.lv-tabella td.lv-c-titolo a { color: var(--xp-text); text-decoration: none; }
.lv-tabella tr.lv-cliccabile { cursor: pointer; }
.lv-tabella tr.lv-disattivo td { color: var(--xp-text-muted); }
.lv-tabella td.lv-azioni { white-space: normal; }
.lv-vuoto { padding: 20px; color: var(--xp-text-muted); font-weight: 700; text-align: center; }
.lv-box { background: #fff; border: 1px solid var(--xp-border); padding: 12px 14px; margin-top: 8px; }
.lv-sezione { font-weight: 700; margin: 12px 0 4px; padding-bottom: 3px; border-bottom: 1px solid var(--xp-border); }
.lv-sezione:first-child { margin-top: 0; }

/* record strip del dettaglio */
.lv-rec { flex-wrap: wrap; }
.lv-rec .xp-field { min-width: 120px; padding: 0 10px; }
.lv-rec .lv-rec-titolo { flex: 1 1 320px; font-size: var(--xp-fs-lg); font-weight: 700; color: var(--xp-text); white-space: normal; height: auto; min-height: 30px; }
.lv-gestione { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; background: var(--xp-bg-2); border: 1px solid var(--xp-border); padding: 8px 10px; margin-top: 6px; }
.lv-gestione label { display: flex; flex-direction: column; font-weight: 700; font-size: var(--xp-fs-sm); gap: 2px; }
.lv-gestione select, .lv-gestione input { height: 26px; border: 1px solid var(--xp-border); background: #fff; padding: 0 4px; min-width: 130px; color: var(--xp-blue); font-weight: 700; }
.lv-tabs-wrap { margin-top: 8px; }
.lv-tabs-wrap .xp-tab-panel .lv-box { margin-top: 0; border-top: 0; }
.lv-testo { white-space: pre-wrap; word-break: break-word; line-height: 1.45; font-size: 14px; }

/* immagini */
.lv-galleria { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.lv-galleria:empty { display: none; }
.lv-thumb { position: relative; margin: 0; width: 180px; height: 130px; border: 1px solid var(--xp-border); background: var(--xp-bg); display: grid; place-items: center; overflow: hidden; }
.lv-thumb img { max-width: 100%; max-height: 100%; cursor: zoom-in; }
.lv-thumb-x { position: absolute; top: 4px; right: 4px; min-width: 24px; padding: 0 6px; }
.lv-allega, .lv-drop { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.lv-drop { border: 2px dashed var(--xp-border); padding: 14px; background: var(--xp-bg); }
.lv-drop.over { border-color: var(--xp-blue-sel); background: #e6edf7; }
.lv-allega label.xp-btn, .lv-drop label.xp-btn { cursor: pointer; }
.lv-lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: grid; place-items: center; z-index: 100; cursor: zoom-out; padding: 16px; }
.lv-lightbox img { max-width: 100%; max-height: 100%; background: #fff; }

/* commenti */
.lv-commento { border-bottom: 1px solid var(--xp-bg-3); padding: 8px 0; }
.lv-commento-head { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; }
.lv-commento-head .xp-btn { margin-left: auto; }
.lv-commento-form { margin-top: 10px; }
.xp-btn.lv-mini { height: 22px; min-width: 0; padding: 0 8px; font-size: var(--xp-fs-sm); }

/* moduli */
.lv-form { display: flex; flex-direction: column; gap: 10px; max-width: 900px; }
.lv-form label { display: flex; flex-direction: column; gap: 3px; font-weight: 700; }
.lv-form input:not([type=checkbox]):not([type=file]), .lv-form select, .lv-form textarea {
  border: 1px solid var(--xp-border); background: #fff; padding: 5px 7px; font: inherit; font-weight: 400; color: var(--xp-text);
}
.lv-form input:focus, .lv-form select:focus, .lv-form textarea:focus, .lv-gestione input:focus, .lv-gestione select:focus, .lv-filtri input:focus {
  outline: 0; border-color: var(--xp-blue-sel); box-shadow: inset 0 0 0 1px var(--xp-blue-sel);
}
.lv-form textarea { resize: vertical; min-height: 70px; line-height: 1.4; }
.lv-form small { font-weight: 400; }
.lv-form-grande { max-width: none; }
.lv-riga { display: flex; flex-wrap: wrap; gap: 12px; }
.lv-riga > label { flex: 1 1 180px; }
.lv-riga-fondo { align-items: flex-end; }
.lv-riga-fondo > .xp-btn { height: 28px; }
.lv-check-inline { flex-direction: row !important; font-weight: 700; }
.lv-errore { color: #fff; background: var(--xp-red); padding: 6px 10px; font-weight: 700; }
.lv-btn-wide { width: 100%; height: 32px; }
.lv-chat-trovate { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; background: var(--xp-bg); border: 1px solid var(--xp-border); padding: 8px 10px; }
.lv-chat-trovate p { margin: 0; font-weight: 700; }
.lv-note-normale { font-weight: 400 !important; line-height: 1.5; }
.lv-note-normale ol { margin: 0 0 8px; padding-left: 20px; }
.xp-note.lv-box { padding: 0; margin-top: 10px; max-width: 900px; min-height: 0; }

/* sidebar: conteggi per stato (cliccabili = filtro) */
.lv-sb-stati { list-style: none; margin: 10px 0 0; padding: 0; }
.lv-sb-stati li { display: flex; justify-content: space-between; gap: 8px; padding: 5px 6px; cursor: pointer; border: 1px solid transparent; }
.lv-sb-stati li:hover { background: #e6edf7; }
.lv-sb-stati li.selected { border-color: var(--xp-blue-sel); background: var(--xp-row-b); }

/* avvisi */
.lv-toast { position: fixed; left: 50%; bottom: calc(var(--xp-h-bottom) + 14px); transform: translateX(-50%); background: var(--xp-nav); color: #fff;
  padding: 8px 16px; font-weight: 700; z-index: 90; border: 1px solid #000; max-width: calc(100vw - 32px); }
.lv-toast.err { background: var(--xp-red); }

/* login */
.lv-login-body { overflow: auto; }
.lv-login-hero { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.lv-login-panel { width: 100%; max-width: 380px; }
.lv-login-panel .lv-form label { color: #fff; }
.lv-login-panel .lv-form input { height: 34px; font-size: 16px; }

/* ---------- telefono e tablet stretti ---------- */
.xp-app { height: 100vh; height: 100dvh; }
@media (max-width: 760px) {
  :root { --xp-h-header: 48px; }
  .xp-header { padding: 0 12px; }
  .xp-brand .xp-brand-name { font-size: 18px; }
  .lv-logo { width: 34px; height: 34px; }
  .xp-header-right { display: none; }
  .xp-menubar { overflow-x: auto; }
  .xp-menubar .xp-menu > .xp-menu-item { padding: 0 10px; white-space: nowrap; }
  .xp-sidebar { display: none; }
  .xp-main { padding: 6px 8px 12px; }
  .xp-crumb .xp-crumb-seg { padding: 0 14px 0 12px; max-width: 60vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .lv-filtri { width: 100%; }
  .lv-filtri select, .lv-filtri input[type=search] { flex: 1 1 45%; width: auto; min-width: 0; height: 32px; font-size: 16px; }
  .xp-toolbar .xp-tb-title { flex: 1 1 auto; }
  .lv-tabella .lv-c-aut, .lv-tabella .lv-c-data, .lv-tabella .lv-c-n, .lv-tabella .lv-c-ver { display: none; }
  .lv-tabella td.lv-c-titolo { min-width: 0; }
  .lv-tabella tbody td { white-space: normal; }
  .xp-table tbody tr.group td { padding-left: 10px; }
  .lv-form input:not([type=checkbox]):not([type=file]), .lv-form select, .lv-form textarea, .lv-gestione input, .lv-gestione select { font-size: 16px; }
  .lv-gestione label { flex: 1 1 45%; }
  .lv-gestione select, .lv-gestione input { min-width: 0; height: 32px; }
  .lv-thumb { width: calc(50% - 5px); }
  .xp-btn { height: 30px; min-width: 0; }
  .xp-menubar .xp-tools { flex: none; }
  .lv-toolbar .xp-tb-left { padding-left: 0; }
  .lv-rec .xp-field { flex: 1 1 calc(50% - 8px); min-width: 0; padding: 0 8px; }
  .lv-rec .lv-rec-titolo { flex-basis: 100%; }
  .xp-record { padding: 4px 0; }
  .lv-gestione { gap: 8px; }
  .lv-gestione label { flex: 1 1 calc(50% - 8px); min-width: 0; }
  .lv-gestione select, .lv-gestione input { width: 100%; }
  .lv-gestione .xp-btn { flex: 1 1 100%; }
  .xp-tabs { gap: 2px; }
  .xp-tab { padding: 6px 10px; flex: 1 1 auto; text-align: center; }
  .lv-box { padding: 10px; }
  .lv-thumb-x { height: 26px; }
}
