/* ============================================================================
 * assets/css/elencoOBJ.css — stile della finestra ElencoOBJ
 * Tutte le classi hanno prefisso "eo-": nessun conflitto con Bootstrap 3 /
 * main2.css / elenco.css già presenti in Ideaimpresa.
 * ========================================================================== */
.eo-finestra {
  --eo-arancio: #E87722;
  --eo-arancio-scuro: #c45f12;
  --eo-arancio-chiaro: #fff3e8;
  --eo-arancio-sel: #ffe3c9;
  --eo-scuro: #262a31;
  --eo-scuro-2: #343943;
  --eo-testo: #1f2329;
  --eo-testo-2: #5d6470;
  --eo-bordo: #dde1e7;
  --eo-bordo-2: #eceff3;
  --eo-sfondo: #ffffff;
  --eo-sfondo-2: #f6f7f9;
  --eo-rosso: #c0392b;
  --eo-verde: #1e8e4e;
  --eo-riga-h: 32px;

  position: fixed;
  z-index: 1035;
  display: flex;
  flex-direction: column;
  min-width: 480px;
  min-height: 320px;
  background: var(--eo-sfondo);
  color: var(--eo-testo);
  border: 1px solid #c9ced6;
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(20, 24, 31, .28), 0 2px 8px rgba(20, 24, 31, .12);
  font: 13px/1.35 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  overflow: hidden;
  outline: none;
}
.eo-finestra *, .eo-finestra *::before, .eo-finestra *::after { box-sizing: border-box; }
.eo-finestra.eo-max { left: 6px !important; top: 6px !important; width: calc(100vw - 12px) !important; height: calc(100vh - 12px) !important; border-radius: 6px; }
.eo-finestra.eo-mod-standalone { left: 0 !important; top: 0 !important; width: 100vw !important; height: 100vh !important; border: 0; border-radius: 0; box-shadow: none; min-width: 0; }
.eo-finestra.eo-compatta { --eo-riga-h: 25px; font-size: 12px; }

/* reset dei margini/pesi che Bootstrap 3 applica a label, table, button, input */
.eo-finestra label { font-weight: normal; margin: 0; display: inline-flex; align-items: center; gap: 6px; max-width: none; }
.eo-finestra table { margin: 0; border-collapse: separate; border-spacing: 0; background: transparent; }
.eo-finestra button { font: inherit; color: inherit; line-height: 1.2; }
.eo-finestra input, .eo-finestra select { font: inherit; color: var(--eo-testo); }
.eo-finestra input[type=checkbox], .eo-finestra input[type=radio] { margin: 0; width: 15px; height: 15px; accent-color: var(--eo-arancio); cursor: pointer; }
.eo-finestra p { margin: 0 0 6px; }
.eo-finestra hr { margin: 4px 0; border: 0; border-top: 1px solid var(--eo-bordo-2); }
.eo-ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.eo-spazio { flex: 1 1 auto; }
.eo-muto { color: var(--eo-testo-2); font-size: 12px; }
.eo-link { background: none; border: 0; padding: 0 2px; color: var(--eo-arancio-scuro); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; font-size: 12px; }
.eo-link:hover { color: var(--eo-arancio); }

/* ---------- testata (barra del titolo, trascinabile) ---------- */
.eo-testata {
  flex: none; display: flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 6px 0 12px;
  background: var(--eo-scuro); color: #fff;
  border-bottom: 3px solid var(--eo-arancio);
  cursor: move; user-select: none; touch-action: none;
}
.eo-max .eo-testata, .eo-mod-standalone .eo-testata { cursor: default; }
.eo-logo { display: inline-flex; width: 24px; height: 24px; align-items: center; justify-content: center; border-radius: 5px; background: var(--eo-arancio); }
.eo-logo .eo-ico { width: 15px; height: 15px; stroke-width: 2.4; }
.eo-titolo { font-weight: 600; font-size: 14px; letter-spacing: .2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eo-conteggio { font-size: 12px; color: #b9c0cb; white-space: nowrap; }
.eo-wbtn { width: 32px; height: 28px; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 0; border-radius: 5px; color: #cfd5dd; cursor: pointer; }
.eo-wbtn:hover { background: var(--eo-scuro-2); color: #fff; }
.eo-btn-chiudi:hover { background: var(--eo-rosso); }

/* ---------- toolbar ---------- */
.eo-toolbar { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 10px; background: var(--eo-sfondo-2); border-bottom: 1px solid var(--eo-bordo); }
.eo-gruppo { display: inline-flex; gap: 2px; padding-left: 10px; border-left: 1px solid var(--eo-bordo); }
.eo-cerca { position: relative; flex: 0 1 320px; min-width: 180px; }
.eo-cerca .eo-ico { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--eo-testo-2); pointer-events: none; }
.eo-cerca input { width: 100%; height: 30px; padding: 4px 10px 4px 31px; border: 1px solid var(--eo-bordo); border-radius: 6px; background: #fff; outline: none; }
.eo-cerca input:focus { border-color: var(--eo-arancio); box-shadow: 0 0 0 3px rgba(232, 119, 34, .18); }
.eo-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; min-width: 30px; padding: 0 7px; background: transparent; border: 1px solid transparent; border-radius: 6px; color: var(--eo-testo); cursor: pointer; white-space: nowrap; }
.eo-btn:hover:not(:disabled) { background: #fff; border-color: var(--eo-bordo); }
.eo-btn:active:not(:disabled) { transform: translateY(1px); }
.eo-btn:disabled { opacity: .45; cursor: default; }
.eo-btn.eo-con-testo { padding: 0 10px; }
.eo-btn.eo-primario { background: var(--eo-arancio); border-color: var(--eo-arancio); color: #fff; }
.eo-btn.eo-primario:hover:not(:disabled) { background: var(--eo-arancio-scuro); border-color: var(--eo-arancio-scuro); }
.eo-btn.eo-pericolo { color: var(--eo-rosso); }
.eo-btn.eo-pericolo:hover { background: #fdecea; border-color: #f2c4bf; }
.eo-btn.eo-pericolo-pieno { background: var(--eo-rosso); border-color: var(--eo-rosso); color: #fff; }
.eo-finestra button:focus-visible, .eo-finestra input:focus-visible, .eo-finestra select:focus-visible { outline: 2px solid var(--eo-arancio); outline-offset: 1px; }

/* ---------- chip dei filtri attivi ---------- */
.eo-chips { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 10px; border-bottom: 1px solid var(--eo-bordo-2); background: #fffaf5; }
.eo-chips[hidden] { display: none; }
.eo-chip { display: inline-flex; align-items: stretch; border: 1px solid #f3c9a6; background: var(--eo-arancio-chiaro); border-radius: 14px; overflow: hidden; max-width: 420px; }
.eo-chip-t { background: none; border: 0; padding: 3px 4px 3px 11px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #6b3a12; }
.eo-chip-x { background: none; border: 0; padding: 0 7px 0 3px; cursor: pointer; color: #9a5a26; display: inline-flex; align-items: center; }
.eo-chip-x:hover { color: var(--eo-rosso); }
.eo-chip-x .eo-ico { width: 13px; height: 13px; }

/* ---------- corpo e tabella ---------- */
.eo-corpo { position: relative; flex: 1 1 auto; overflow: auto; background: #fff; }
.eo-tabella { width: 100%; font-variant-numeric: tabular-nums; }
.eo-tabella.eo-fissa { table-layout: fixed; width: max-content; min-width: 100%; }
.eo-tabella thead th {
  position: sticky; top: 0; z-index: 2;
  height: 36px; padding: 0 4px 0 8px;
  background: #eef0f3; color: #3a404a;
  border-bottom: 1px solid #cfd4db; border-right: 1px solid var(--eo-bordo-2);
  font-weight: 600; font-size: 12px; text-align: left; vertical-align: middle; white-space: nowrap;
}
.eo-tabella thead th.eo-num { text-align: right; }
.eo-tabella thead th.eo-filtrata { background: #fde6d2; }
.eo-th-in { display: flex; align-items: center; gap: 2px; min-width: 0; }
.eo-num .eo-th-in { justify-content: flex-end; }
.eo-th-titolo { flex: 0 1 auto; min-width: 0; display: inline-flex; align-items: center; gap: 3px; background: none; border: 0; padding: 4px 2px; cursor: pointer; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eo-th-titolo:hover { color: var(--eo-arancio-scuro); }
.eo-th-titolo sup { font-size: 9px; color: var(--eo-arancio-scuro); }
.eo-ico-ord { width: 13px; height: 13px; color: var(--eo-arancio); stroke-width: 2.6; }
.eo-th-filtro { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; padding: 0; background: none; border: 0; border-radius: 4px; color: #9aa1ab; cursor: pointer; opacity: 0; }
.eo-th-filtro .eo-ico { width: 13px; height: 13px; }
.eo-tabella thead th:hover .eo-th-filtro, .eo-th-filtro:focus-visible { opacity: 1; }
.eo-th-filtro:hover { background: #dfe3e8; color: var(--eo-testo); }
.eo-filtrata .eo-th-filtro { opacity: 1; color: var(--eo-arancio-scuro); }
.eo-resizer { position: absolute; top: 0; right: -4px; width: 8px; height: 100%; cursor: col-resize; z-index: 3; touch-action: none; }
.eo-resizer:hover { background: linear-gradient(90deg, transparent 3px, var(--eo-arancio) 3px, var(--eo-arancio) 5px, transparent 5px); }
.eo-th-sel, .eo-td-sel { text-align: center !important; padding: 0 !important; }
.eo-th-n, .eo-td-n { text-align: right; color: var(--eo-testo-2); }
.eo-th-apri, .eo-td-apri { padding: 0 !important; text-align: center; }

.eo-tabella tbody td {
  height: var(--eo-riga-h); padding: 2px 8px;
  border-bottom: 1px solid var(--eo-bordo-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 420px;
  vertical-align: middle;
}
.eo-tabella.eo-fissa tbody td { max-width: none; }
.eo-tabella tbody tr { cursor: default; }
.eo-tabella tbody tr:nth-child(even) td { background: #fafbfc; }
.eo-tabella tbody tr:hover td { background: #f1f4f8; }
.eo-tabella tbody tr.eo-sel td { background: var(--eo-arancio-sel); }
.eo-tabella tbody tr.eo-sel:hover td { background: #ffd8b3; }
.eo-tabella tbody tr.eo-sel td:first-child { box-shadow: inset 3px 0 0 var(--eo-arancio); }
.eo-tabella tbody tr.eo-cursore td { box-shadow: inset 0 1px 0 #9aa6b6, inset 0 -1px 0 #9aa6b6; }
.eo-tabella tbody tr.eo-cursore.eo-sel td:first-child { box-shadow: inset 3px 0 0 var(--eo-arancio), inset 0 1px 0 #9aa6b6, inset 0 -1px 0 #9aa6b6; }
.eo-tabella td.eo-num { text-align: right; }
.eo-td-n { font-size: 11px; }
.eo-apri, .eo-az { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 24px; padding: 0; background: none; border: 0; border-radius: 4px; color: #8a919b; cursor: pointer; }
.eo-apri:hover, .eo-az:hover { background: var(--eo-arancio); color: #fff; }
.eo-td-azioni { text-align: center; padding: 0 4px !important; }
.eo-td-edit { padding: 1px 4px !important; }
.eo-edit { width: 100%; height: calc(var(--eo-riga-h) - 6px); padding: 1px 6px; border: 1px dashed transparent; border-radius: 4px; background: transparent; text-align: inherit; transition: background .3s, border-color .3s; }
.eo-edit:hover { border-color: #c3c9d1; background: #fff; }
.eo-edit:focus { border-color: var(--eo-arancio); background: #fff; outline: none; }
.eo-edit.eo-salvo { background: #fff8e1; }
.eo-edit.eo-ok { border-color: var(--eo-verde); background: #e8f6ee; }
.eo-edit.eo-ko { border-color: var(--eo-rosso); background: #fdecea; }
.eo-tabella tfoot td { position: sticky; bottom: 0; z-index: 2; height: 32px; padding: 2px 8px; background: #eef0f3; border-top: 2px solid #cfd4db; font-weight: 700; white-space: nowrap; }
.eo-tot-lbl { text-transform: uppercase; font-size: 11px; color: var(--eo-testo-2); letter-spacing: .4px; }
.eo-vuoto { padding: 48px 20px; text-align: center; color: var(--eo-testo-2); }
.eo-vuoto .eo-ico { width: 34px; height: 34px; color: #c4cad3; margin-bottom: 8px; }
.eo-vuoto p { font-size: 14px; margin-bottom: 12px; }
.eo-vuoto .eo-btn { border-color: var(--eo-bordo); }

/* ---------- piede: selezione, paginazione ---------- */
.eo-piede { flex: none; display: flex; align-items: center; gap: 14px; min-height: 40px; padding: 4px 12px; background: var(--eo-sfondo-2); border-top: 1px solid var(--eo-bordo); }
.eo-piede-sel { flex: 1 1 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eo-pager { display: inline-flex; align-items: center; gap: 2px; }
.eo-pager button { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; background: none; border: 1px solid transparent; border-radius: 5px; cursor: pointer; }
.eo-pager button:hover:not(:disabled) { background: #fff; border-color: var(--eo-bordo); }
.eo-pager button:disabled { opacity: .35; cursor: default; }
.eo-pager span { padding: 0 6px; white-space: nowrap; }
.eo-pager input { width: 48px; height: 26px; text-align: center; border: 1px solid var(--eo-bordo); border-radius: 5px; }
.eo-perpag { flex: 1 1 0; justify-content: flex-end; white-space: nowrap; color: var(--eo-testo-2); }
.eo-perpag select { height: 26px; border: 1px solid var(--eo-bordo); border-radius: 5px; background: #fff; padding: 0 4px; }

/* ---------- maniglia di ridimensionamento ---------- */
.eo-maniglia { position: absolute; right: 0; bottom: 0; width: 16px; height: 16px; cursor: nwse-resize; touch-action: none; z-index: 5;
  background: linear-gradient(135deg, transparent 50%, #b5bcc6 50%, #b5bcc6 58%, transparent 58%, transparent 70%, #b5bcc6 70%, #b5bcc6 78%, transparent 78%); }
.eo-max .eo-maniglia, .eo-mod-standalone .eo-maniglia { display: none; }

/* ---------- caricamento, toast, conferma ---------- */
.eo-caricamento { position: absolute; left: 0; right: 0; top: 40px; bottom: 0; z-index: 20; display: flex; align-items: flex-start; justify-content: center; padding-top: 120px; background: rgba(255, 255, 255, .45); }
.eo-caricamento[hidden] { display: none; }
.eo-spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #f1d6bf; border-top-color: var(--eo-arancio); animation: eo-giro .7s linear infinite; }
@keyframes eo-giro { to { transform: rotate(360deg); } }
.eo-toasts { position: absolute; right: 14px; bottom: 52px; z-index: 40; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; pointer-events: none; }
.eo-toast { max-width: 420px; padding: 9px 14px; border-radius: 6px; background: var(--eo-scuro); color: #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, .2); opacity: 1; transition: opacity .4s, transform .4s; pointer-events: auto; }
.eo-toast-err { background: var(--eo-rosso); }
.eo-toast.eo-via { opacity: 0; transform: translateY(6px); }
.eo-conferma { position: absolute; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: rgba(30, 34, 40, .35); }
.eo-conferma-box { width: min(440px, 90%); padding: 20px; border-radius: 8px; background: #fff; box-shadow: 0 16px 40px rgba(0, 0, 0, .3); border-top: 4px solid var(--eo-arancio); }
.eo-conferma-box p { font-size: 14px; margin-bottom: 16px; }
.eo-conferma-box div { display: flex; justify-content: flex-end; gap: 8px; }
.eo-conferma-box .eo-btn:not(.eo-primario):not(.eo-pericolo-pieno) { border-color: var(--eo-bordo); }

/* ---------- popover (filtri, colonne, viste, menu) ---------- */
.eo-pop { position: absolute; z-index: 30; min-width: 220px; max-width: 360px; background: #fff; border: 1px solid #cfd4db; border-radius: 8px; box-shadow: 0 12px 32px rgba(20, 24, 31, .22); }
.eo-pop-tit { display: flex; align-items: center; gap: 6px; padding: 9px 12px; font-weight: 600; border-bottom: 1px solid var(--eo-bordo-2); }
.eo-pop-tit .eo-ico { color: var(--eo-arancio); }
.eo-pop-corpo { padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow: auto; }
.eo-pop-piede { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-top: 1px solid var(--eo-bordo-2); background: var(--eo-sfondo-2); border-radius: 0 0 8px 8px; }
.eo-pop-piede .eo-btn:not(.eo-primario) { border-color: var(--eo-bordo); background: #fff; }
.eo-pop input[type=text], .eo-pop input[type=search], .eo-pop input[type=date], .eo-pop select { width: 100%; height: 30px; padding: 3px 8px; border: 1px solid var(--eo-bordo); border-radius: 5px; background: #fff; }
.eo-pop input:focus, .eo-pop select:focus { border-color: var(--eo-arancio); outline: none; box-shadow: 0 0 0 3px rgba(232, 119, 34, .15); }
.eo-pop-filtro { width: 300px; }
.eo-intervallo { display: flex; gap: 8px; }
.eo-intervallo label { flex: 1; flex-direction: column; align-items: stretch; gap: 3px; font-size: 12px; color: var(--eo-testo-2); }
.eo-rapidi { display: flex; flex-wrap: wrap; gap: 4px; }
.eo-rapidi button { padding: 3px 8px; font-size: 11px; background: var(--eo-sfondo-2); border: 1px solid var(--eo-bordo); border-radius: 12px; cursor: pointer; }
.eo-rapidi button:hover { border-color: var(--eo-arancio); color: var(--eo-arancio-scuro); }
.eo-radio { display: flex; gap: 16px; }
.eo-opz-azioni { display: flex; gap: 8px; align-items: center; }
.eo-opz-n { margin-left: auto; font-size: 12px; color: var(--eo-arancio-scuro); font-weight: 600; }
.eo-opzioni { max-height: 230px; overflow: auto; border: 1px solid var(--eo-bordo-2); border-radius: 5px; padding: 4px; }
.eo-opzioni label { display: flex; padding: 4px 6px; border-radius: 4px; cursor: pointer; }
.eo-opzioni label:hover { background: var(--eo-arancio-chiaro); }
.eo-opzioni label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eo-errore { color: var(--eo-rosso); font-size: 12px; }
.eo-riga { display: flex; gap: 6px; align-items: center; }
.eo-lista-col, .eo-lista-viste { list-style: none; margin: 0; padding: 0; }
.eo-lista-col li { display: flex; align-items: center; gap: 4px; padding: 3px 4px; border-radius: 4px; border-top: 2px solid transparent; }
.eo-lista-col li:hover { background: var(--eo-sfondo-2); }
.eo-lista-col li.eo-sopra { border-top-color: var(--eo-arancio); }
.eo-lista-col li.eo-trascina { opacity: .4; }
.eo-drag { cursor: grab; color: #a3aab4; display: inline-flex; }
.eo-lista-viste li { display: flex; align-items: center; }
.eo-vista { flex: 1; text-align: left; background: none; border: 0; padding: 6px 8px; border-radius: 4px; cursor: pointer; }
.eo-vista:hover { background: var(--eo-arancio-chiaro); }
.eo-x { background: none; border: 0; color: #a3aab4; cursor: pointer; padding: 4px; display: inline-flex; }
.eo-x:hover { color: var(--eo-rosso); }
.eo-menu { min-width: 200px; padding: 4px; }
.eo-menu-voci { display: flex; flex-direction: column; }
.eo-menu-voci button { text-align: left; background: none; border: 0; padding: 7px 10px; border-radius: 5px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eo-menu-voci button:hover:not(:disabled) { background: var(--eo-arancio-chiaro); }
.eo-menu-voci button:disabled { opacity: .45; cursor: default; }

/* ---------- dock delle finestre ridotte a icona ---------- */
.eo-dock { position: fixed; left: 12px; bottom: 12px; z-index: 1034; display: flex; gap: 8px; flex-wrap: wrap; font: 13px/1.2 "Segoe UI", system-ui, Arial, sans-serif; }
.eo-dock:empty { display: none; }
.eo-dock-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 0; border-left: 4px solid #E87722; border-radius: 6px; background: #262a31; color: #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); cursor: pointer; }
.eo-dock-chip:hover { background: #343943; }
.eo-dock-chip b { background: #E87722; border-radius: 9px; padding: 1px 7px; font-size: 11px; }
.eo-dock-chip .eo-ico { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* ---------- schermi stretti ---------- */
@media (max-width: 760px) {
  .eo-finestra:not(.eo-mod-standalone) { left: 0 !important; top: 0 !important; width: 100vw !important; height: 100vh !important; border-radius: 0; min-width: 0; }
  .eo-gruppo { border-left: 0; padding-left: 0; }
  .eo-cerca { flex: 1 1 100%; }
  .eo-perpag { display: none; }
  .eo-maniglia { display: none; }
}
@media print {
  .eo-finestra { position: static; box-shadow: none; border: 0; height: auto !important; }
  .eo-toolbar, .eo-piede, .eo-testata .eo-wbtn, .eo-maniglia, .eo-chips { display: none !important; }
  .eo-corpo { overflow: visible; }
}
