/* ==========================================================================
   STRUTTURA SEZIONI & TITOLI
   ========================================================================== */
.status-section {
    display: block;
    margin-top: 36px;
    margin-bottom: 24px;
    clear: both;
    position: relative;
}

.section-heading {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 16px 0;
    padding: 0;
    line-height: 1.4;
    color: #ffffff;
}

/* ==========================================================================
   GRIGLIE DASHBOARD
   ========================================================================== */
.status-grid-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.status-grid-services {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

/* ==========================================================================
   CARD METRICHE HARDWARE (DATO CHIAVE SINGOLO)
   ========================================================================== */
.metric-card {
    min-height: 0 !important;
    height: auto !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    text-align: center;
    box-sizing: border-box;
}

.metric-label {
    font-size: 0.85rem;
    color: var(--text-muted, #888);
    margin-bottom: 6px;
}

.metric-value {
    font-size: 1.6rem;
    font-weight: 700;
}

.metric-sub {
    font-size: 0.8rem;
    color: #8da2b5;
    margin-top: 4px;
}

/* Classi utilità testo per metriche */
.text-success {
    color: #28a745 !important;
}

.text-danger {
    color: #dc3545 !important;
}

.text-warning {
    color: #ffc107 !important;
}

/* ==========================================================================
   CARD SERVIZI APPLICATIVI (COMPATTI)
   ========================================================================== */
.service-card {
    min-height: 0 !important;
    height: auto !important;
    padding: 16px 18px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    gap: 12px !important;
    box-sizing: border-box;
}

.service-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 !important;
}

.service-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #e0e6ed;
}

.service-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    margin: 0 !important;
}

.service-key-data {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.2;
    color: #ffffff;
}

.service-key-desc {
    font-size: 0.8rem;
    color: #8da2b5;
    margin-top: 2px;
}

/* ==========================================================================
   INDICATORI & BADGE TELEMETRIA
   ========================================================================== */
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.status-online {
    background-color: #28a745;
    box-shadow: 0 0 6px rgba(40, 167, 69, 0.6);
}

.status-offline {
    background-color: #dc3545;
    box-shadow: 0 0 6px rgba(220, 53, 69, 0.6);
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.badge-success {
    background-color: rgba(40, 167, 69, 0.18) !important;
    color: #28a745 !important;
    border: 1px solid rgba(40, 167, 69, 0.35) !important;
}

.badge-warning {
    background-color: rgba(255, 193, 7, 0.18) !important;
    color: #ffc107 !important;
    border: 1px solid rgba(255, 193, 7, 0.35) !important;
}

.badge-danger {
    background-color: rgba(220, 53, 69, 0.18) !important;
    color: #dc3545 !important;
    border: 1px solid rgba(220, 53, 69, 0.35) !important;
}

.badge-secondary {
    background-color: rgba(108, 117, 125, 0.18) !important;
    color: #adb5bd !important;
    border: 1px solid rgba(108, 117, 125, 0.35) !important;
}

/* ==========================================================================
   TABELLA CONTAINER DOCKER & SENSORI RF
   ========================================================================== */
.table-container.card-gateway {
    min-height: 0 !important;
    height: auto !important;
    padding: 16px 20px !important;
    margin-top: 8px !important;
    overflow-x: auto;
}

.status-table {
    width: 100%;
    border-collapse: collapse;
}

.status-table th, 
.status-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    vertical-align: middle;
}

.status-table th {
    font-size: 0.85rem;
    color: var(--text-muted, #8da2b5);
    font-weight: 600;
}

.container-name {
    font-family: monospace;
    font-weight: 600;
}

.last-update-text {
    font-size: 0.8rem;
    color: var(--text-muted, #888);
    margin-top: 14px;
    text-align: right;
}

/* ==========================================================================
   CARD MONITORAGGIO FILE E SERVIZI (COMPATTO & BILANCIATO)
   ========================================================================== */
.file-monitor-card {
    min-height: 0 !important;
    height: auto !important;
    padding: 16px 20px !important;
    margin-top: 18px !important;
    margin-bottom: 24px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    box-sizing: border-box;
}

.file-monitor-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #e2e8f0;
    margin: 0 0 12px 0 !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
}

.file-monitor-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 0 !important;
    padding: 0 !important;
}

.file-monitor-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 10px 14px;
}

.file-name {
    font-size: 0.85rem;
    color: #e0e6ed;
    font-weight: 500;
}

/* Adattamento responsive griglia file monitor */
@media (max-width: 992px) {
    .file-monitor-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .file-monitor-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   DIAGNOSTICA & ALLARMI CUMULUS MX
   ========================================================================== */
.cumulus-diag-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 14px 18px;
    margin-top: 24px !important;
    margin-bottom: 18px !important;
    transition: all 0.3s ease;
}

.cumulus-diag-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.cumulus-diag-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    color: #e2e8f0;
}

.cumulus-diag-badges {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cumulus-diag-error {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(239, 68, 68, 0.25);
    font-size: 0.85rem;
    color: #f87171;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==========================================================================
   STATI DINAMICI MODEM RIPETITORE (IDLE / RX / TX)
   ========================================================================== */

/* IDLE: Ripetitore pronto e in ascolto (Verde) */
.status-idle {
    background-color: #28a745;
    box-shadow: 0 0 6px rgba(40, 167, 69, 0.6);
}

/* RX: Ricezione RF in corso (Giallo/Ambra pulsante) */
.status-rx {
    background-color: #ffc107;
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.8);
    animation: pulse-rx 1.2s infinite ease-in-out;
}

/* TX: Trasmissione verso RF in corso (Rosso vivo pulsante) */
.status-tx {
    background-color: #ef4444;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.9);
    animation: pulse-tx 1.0s infinite ease-in-out;
}

/* Animazioni di pulsazione */
@keyframes pulse-rx {
    0%   { transform: scale(1);   box-shadow: 0 0 4px rgba(255, 193, 7, 0.5); }
    50%  { transform: scale(1.3); box-shadow: 0 0 14px rgba(255, 193, 7, 0.9); }
    100% { transform: scale(1);   box-shadow: 0 0 4px rgba(255, 193, 7, 0.5); }
}

@keyframes pulse-tx {
    0%   { transform: scale(1);   box-shadow: 0 0 4px rgba(239, 68, 68, 0.6); }
    50%  { transform: scale(1.35); box-shadow: 0 0 16px rgba(239, 68, 68, 1); }
    100% { transform: scale(1);   box-shadow: 0 0 4px rgba(239, 68, 68, 0.6); }
}