/* ============================================================
   OMNIA — style.css
   Stili BASE COMUNI condivisi da tutte le pagine.
   Caricato globalmente da MY_Controller (prima dei CSS di pagina).
   Qui vanno SOLO regole riusabili trasversalmente: pulsanti, modali,
   helper form, contenitori grafici, badge/pill. Gli stili specifici di
   una singola pagina restano nel rispettivo file CSS.
   ============================================================ */

/* -------------------------------------------------- Pulsanti (.abtn) --- */
.abtn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px; border: none; border-radius: 10px;
  font-weight: 800; font-size: 0.85rem; color: #fff; cursor: pointer;
  box-shadow: 0 6px 16px -6px rgba(0,0,0,0.3); text-decoration: none;
  transition: transform .06s, filter .15s; line-height: 1; white-space: nowrap;
}
.abtn:hover { filter: brightness(1.08); }
.abtn:active { transform: translateY(1px); }
.abtn--dark    { background: #1e293b; }
.abtn--blue    { background: #2563eb; }
.abtn--green   { background: #059669; }
.abtn--teal    { background: #14b8a6; }
.abtn--violet  { background: #7c3aed; }
.abtn--fuchsia { background: linear-gradient(135deg,#d946ef,#a21caf); }
.abtn--amber   { background: linear-gradient(135deg,#f59e0b,#d97706); }
.abtn--sm { padding: 7px 14px; font-size: 0.72rem; border-radius: 7px; box-shadow: none; }

/* -------------------------------------------------- Modali (.omodal) --- */
.omodal { position: fixed; inset: 0; background: rgba(13,20,36,0.7); backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center; z-index: 1000;
  padding: 40px 16px; overflow-y: auto; }
.omodal[hidden] { display: none; }
.omodal__panel { background: #f8fafc; border-radius: 16px; width: min(920px, 96vw);
  overflow: hidden; box-shadow: 0 30px 60px -12px rgba(0,0,0,0.5); }
.omodal__panel--wide { width: min(1100px, 97vw); }
.omodal__head { background: #0d1424; color: #fff; padding: 20px 24px;
  display: flex; justify-content: space-between; align-items: center; border-bottom: 4px solid #2563eb; }
.omodal__head h2 { font-size: 1.3rem; font-weight: 800; margin: 0; }
.omodal__head span { font-size: 11px; color: #94a3b8; text-transform: uppercase; letter-spacing: .08em; }
.omodal__head--blue { border-bottom-color: #2563eb; }
.omodal__head--fuchsia { border-bottom-color: #d946ef; }
.omodal__head--sky { border-bottom-color: #38bdf8; }
.omodal__x { background: #334155; border: none; color: #fff; width: 34px; height: 34px;
  border-radius: 50%; cursor: pointer; font-size: 15px; line-height: 1; }
.omodal__x:hover { background: #475569; }
.omodal__body { padding: 24px; }
.omodal__foot { padding: 16px 24px; background: #fff; border-top: 1px solid #eef0f3; display: flex; justify-content: flex-end; }
.omodal__foot .abtn { font-size: 1rem; padding: 14px 22px; }

/* ------------------------------------------------ Helper form comuni --- */
.fw { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 700; color: #475569; }
.fw input, .fw select,
.om-grid input, .om-grid select {
  padding: 11px 12px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 0.9rem;
  font-weight: 400; color: #1e293b; background: #fff; width: 100%; }
.fw input:focus, .fw select:focus,
.om-grid input:focus, .om-grid select:focus { outline: none; border-color: #2563eb; }
.om-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.om-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 700; color: #475569; }
.om-check { flex-direction: row !important; align-items: center; gap: 8px; }
.om-check input { width: auto !important; }
.om-sub { font-size: 11px; color: #94a3b8; font-weight: 400; }
@media (max-width: 620px) { .om-grid { grid-template-columns: 1fr; } }

/* -------------------------------------- Contenitori grafici (Chart.js) --- */
/* Altezza FISSA per evitare il loop di resize di Chart.js
   (responsive + maintainAspectRatio:false) che allunga la pagina. */
.chart-box { position: relative; width: 100%; }
.chart-box canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
.chart-box--main { height: 320px; margin-top: 8px; }
.chart-box--mini { height: 150px; margin-top: 8px; }

/* -------------------------------------------------- Badge / pill comuni --- */
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.pill--ok  { background: #dcfce7; color: #166534; }
.pill--off { background: #fee2e2; color: #991b1b; }
.minichip { display: inline-block; padding: 2px 8px; margin: 2px; border-radius: 6px; background: #eff6ff; color: #2563eb; font-size: 11px; font-weight: 700; }
.btn-icon { border: none; background: none; cursor: pointer; font-size: 15px; padding: 4px 6px; color: #64748b; border-radius: 6px; }
.btn-icon:hover { background: #f1f5f9; }
.btn-icon.btn-danger { color: #dc2626; }
