/* Front-end UI for CGL shortcodes */
.cgl-wrap { max-width: 100%; font-size: var(--cgl-font-size, 16px); font-family: var(--cgl-font-family, inherit); font-weight: var(--cgl-font-weight, 400); }
.cgl-select { margin: 0.5rem 0 1rem; padding: 0.35rem 0.5rem; width: 100%; max-width: 520px; }
.cgl-card { border: 1px solid #dcdcde; background: #fff; padding: 12px; margin: 12px 0; border-radius: 8px; }
.cgl-meta { display:flex; flex-wrap:wrap; gap:10px; margin: 6px 0 10px; font-size: 0.95em; }
.cgl-meta div { padding: 2px 0; }
.cgl-table { width: 100%; border-collapse: collapse; }
.cgl-table th, .cgl-table td { border: 1px solid #dcdcde; padding: 6px 8px; }
.cgl-table th { background: #f6f7f7; text-align: left; }
.cgl-right { text-align:right; }
.cgl-btn { display:inline-block; padding: 6px 10px; border: 1px solid #2271b1; background:#2271b1; color:#fff; border-radius: 6px; cursor:pointer; text-decoration:none; font-size: 0.95em; }
.cgl-btn:disabled { opacity:0.6; cursor:not-allowed; }
.cgl-link { color:#2271b1; cursor:pointer; text-decoration:underline; }

.cgl-modal-backdrop { position: fixed; inset:0; background: rgba(0,0,0,0.55); display:none; z-index: 9999; }
.cgl-modal { position: absolute; left: 50%; top: 8%; transform: translateX(-50%); width: min(980px, 94vw); background:#fff; border-radius: 12px; overflow:hidden; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.cgl-modal-header { padding: 12px 14px; background:#0a1f44; color:#fff; display:flex; align-items:center; justify-content:space-between; gap:10px; }
.cgl-modal-title { font-size: 16px; font-weight: 600; }
.cgl-modal-close { background: transparent; border: 0; color:#fff; font-size: 22px; cursor:pointer; line-height: 1; }
.cgl-modal-body { padding: 12px 14px; max-height: 78vh; overflow:auto; }
.cgl-badge { display:inline-block; padding:2px 8px; border-radius: 999px; background:#f0f0f1; font-size: 12px; }


/* Bootstrap-like button for "Dettagli" (works even if Bootstrap isn't loaded) */
.cgl-btn-dettagli, .btn.cgl-btn-dettagli {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #0d6efd;
  background: #0d6efd;
  color: #fff !important;
  text-decoration: none !important;
  font-size: 0.9rem;
  line-height: 1.2;
}
.cgl-btn-dettagli:hover, .btn.cgl-btn-dettagli:hover {
  filter: brightness(0.95);
}

/* Header row color */
.cgl-table thead th {
  background: #77dd77 !important;
  color: #0b2b0b;
  font-weight: 700;
}

/* Alternating row colors (soft) */
.cgl-table tbody tr:nth-child(odd) td { background: #ffffff; }
.cgl-table tbody tr:nth-child(even) td { background: #f7fbf7; }

/* TOT column: red + bold */
.cgl-table td.cgl-tot, .cgl-table td.cgl-tot strong {
  color: #c00000;
  font-weight: 800;
}

.btn.btn-secondary:hover, .cgl-btn-stampa:hover { filter: brightness(0.95); }

/* Stampa button uses primary style like Dettagli */
.cgl-btn-stampa, .btn.cgl-btn-stampa, .btn.btn-primary.cgl-btn-stampa {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #0d6efd;
  background: #0d6efd;
  color: #fff !important;
  text-decoration: none !important;
  font-size: 0.9rem;
  line-height: 1.2;
}
.cgl-btn-stampa:hover, .btn.cgl-btn-stampa:hover { filter: brightness(0.95); }
