/* Minimal app-level overrides to homogenize styles and replace inline styles used across templates */
:root {
    --card-bg: #f8f9fa;
    --muted-text: #6c757d;
}

.card-soft {
    background-color: var(--card-bg);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.detail-view { margin-bottom: 1.5rem; }
.detail-header-row { display:flex; justify-content:space-between; gap:1rem; align-items:flex-start; margin-bottom:1rem; }
.detail-meta { font-size:0.9rem; color:var(--muted-text); }
.muted { color: var(--muted-text); }

.actions { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid #eee; display:flex; gap:0.5rem; align-items:center; }
.float-right { margin-left: auto; }

.pdf-section, .email-section, .note-precedenti-container { background-color: var(--card-bg); padding: 1rem; border-radius: 8px; border: 1px solid #dee2e6; }

.pre-compact { background: var(--card-bg); padding: 0.75rem; border-radius: 4px; white-space: pre-wrap; word-wrap: break-word; }

/* Pre variants */
.pre-plain { background: transparent; padding: 0; border: none; margin: 0; color: #495057; }

/* Table utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.table-head-bg { background-color: #f8f9fa; }
.table-muted-row { background-color: #f8f9fa; font-weight: bold; }
.table-highlight { background-color: #e2f7e2; font-weight: bold; }

/* Inline helpers */
.inline-block { display: inline-block; }

.btn-icon { display:inline-flex; align-items:center; gap:0.4rem; }
.icon-action { background: none; border: none; padding: 0.25rem; margin: 0 2px; border-radius: 4px; cursor:pointer; }
.icon-action:hover { background:#e9ecef; color:#007bff; }

/* Utility helpers to replace repeated inline widths/margins */
.mb-1-25 { margin-bottom: 1.25rem; }
.mt-1-5 { margin-top: 1.5rem; }
.ml-0-5 { margin-left: 0.3125rem; } /* approx 5px */

/* Progress fill helper used by index pages */
.progress-fill { height: 12px; border-radius: 6px; display:block; }
.progress-fill.critical { background:#dc3545; }
.progress-fill.warning { background:#ffc107; }
.progress-fill.info { background:#17a2b8; }
.progress-fill.success { background:#28a745; }

/* Modal helpers for confirm dialogs created inline in JS */
.modal-confirm { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); background: white; padding: 20px; border: 1px solid #ddd; box-shadow: 0 4px 20px rgba(0,0,0,0.15); z-index: 10000; border-radius: 8px; }
.modal-confirm .btn { margin-left: 0.5rem; }

/* Full-screen overlay for modals created in JS */
.modal-overlay { position: fixed; top:0; left:0; width:100%; height:100%; display:flex; align-items:center; justify-content:center; background: rgba(0,0,0,0.5); z-index:1050; }

/* Utility HR spacing */
.hr-spaced { margin: 25px 0; border: 0; border-top: 1px solid #ececec; }

/* Timeline marker color variants */
.timeline-marker { position: absolute; left: -12px; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; color: white; }
.marker-creation { background-color: #28a745; }
.marker-state { background-color: #007bff; }
.marker-photo { background-color: #17a2b8; }
.marker-default { background-color: #6c757d; }

/* Sidebar logo helpers */
.sidebar-brand-icon img { max-height: 40px; max-width: 60px; display: block; }
.hide-icon { display: none; }

/* Badges (stato / urgenza) */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #fff;
}
.badge.urgenza_critico, .badge.urgenza_critico { background:#d9534f; }
.badge.urgenza_alto { background:#f0ad4e; }
.badge.urgenza_medio { background:#5cb85c; }
.badge.urgenza_basso { background:#17a2b8; }

/* generic stato badges (neutral fallback) */
.badge[class^="stato_"] { background:#6c757d; }

/* Mobile card list styling to match segnalazioni */
.mobile-cards-list, .mobile-cards-container { display:block; }
.mobile-cards-list .card, .mobile-cards-container .card { border-radius:8px; border:1px solid #e9ecef; padding:0.75rem; background:#fff; }
.mobile-card-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:0.5rem; }
.mobile-card-header .action-icons { display:flex; gap:0.5rem; }
.mobile-card .badge { margin-left:0.5rem; }

/* action icons group in table rows */
.action-icons { display:flex; gap:0.35rem; align-items:center; }
.actions-column .action-icons a, .action-icons button { display:inline-flex; }

/* small responsive tweaks for tables */
@media (max-width: 768px) {
    .d-none.d-md-block { display:none !important; }
    .d-block.d-md-none { display:block !important; }
}
