/* =========================================================
   eHealth SMS Gateway
   CSS complet corrigé — layout stable devices/services
   ========================================================= */

/* =========================
   BASE PAGE
   ========================= */

.ehealth-page {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px 10px 28px;
    box-sizing: border-box;
}

.ehealth-page h1 {
    margin: 0 0 8px;
    font-size: 2rem;
    line-height: 1.2;
    color: #1f2937;
}

.ehealth-subtitle {
    margin: 0;
    color: #5b6472;
    font-size: 0.98rem;
    line-height: 1.5;
}

.ehealth-page strong {
    color: #1f2937;
}

/* =========================
   TOPBAR / ACTIONS
   ========================= */

.ehealth-topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.gateway-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

#gateway-check-status {
    display: inline-block;
    min-height: 20px;
    color: #555;
    font-size: 0.95rem;
}

/* =========================
   BUTTON
   ========================= */

#btn-check-gateway,
.btn-check-gateway {
    appearance: none;
    border: 1px solid #cfd6df;
    background: linear-gradient(to bottom, #ffffff, #f6f8fb);
    color: #1f2937;
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.96rem;
    line-height: 1.2;
    transition: all 0.18s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

#btn-check-gateway:hover,
.btn-check-gateway:hover {
    background: linear-gradient(to bottom, #ffffff, #eef3f8);
    border-color: #b8c3cf;
    transform: translateY(-1px);
}

#btn-check-gateway:active,
.btn-check-gateway:active {
    transform: translateY(0);
}

#btn-check-gateway:disabled,
.btn-check-gateway:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* =========================
   META GLOBAL
   ========================= */

.ehealth-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 24px;
    align-items: center;
    margin-bottom: 20px;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid #e7edf4;
    border-radius: 14px;
    color: #334155;
    font-size: 0.95rem;
}

/* =========================
   DOMAIN SUMMARY
   ========================= */

.ehealth-domain-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 22px 0;
}

.domain-card {
    padding: 16px 18px;
    border-radius: 16px;
    border: 1px solid #d9e4f2;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.domain-device {
    background: linear-gradient(135deg, #f0fff5, #ffffff);
    border-color: #bde8c8;
}

.domain-service {
    background: linear-gradient(135deg, #f3f7ff, #ffffff);
    border-color: #bfd3ff;
}

.domain-title {
    font-weight: 800;
    font-size: 17px;
    color: #172033;
}

.domain-desc {
    color: #526173;
    font-size: 13px;
}

/* =========================
   SECTION TITLES
   ========================= */

.ehealth-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 18px 0 14px;
    padding: 14px 16px;
    border: 1px solid #dce7f5;
    border-radius: 14px;
    background: #f8fbff;
}

.ehealth-section-title h2 {
    margin: 0;
    font-size: 20px;
    color: #1f2937;
}

.ehealth-section-title p {
    margin: 4px 0 0;
    color: #5b6b7d;
    font-size: 13px;
}

/* =========================
   GRIDS
   ========================= */

.ehealth-grid,
.ehealth-grid-services {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 22px;
    align-items: stretch;
}

/* =========================
   CARDS
   ========================= */

.health-card {
    background: #ffffff;
    border: 1px solid #e6ebf2;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
    box-sizing: border-box;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.health-card-wide {
    grid-column: auto;
    width: 100%;
    max-width: 100%;
}

.health-card-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
}

.health-card-header h2 {
    margin: 0 0 6px;
    font-size: 1.15rem;
    color: #1f2937;
    line-height: 1.25;
}

.health-status-line {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 4px;
}

/* =========================
   ICONS
   ========================= */

.health-icon-wrap {
    width: 52px;
    min-width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
    background: #f8fafc;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.health-icon {
    font-size: 1.45rem;
    line-height: 1;
}

/* =========================
   DETAILS
   ========================= */

.health-details {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 9px 0;
    border-bottom: 1px dashed #e5e7eb;
    min-width: 0;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: #475569;
    min-width: 115px;
    flex-shrink: 0;
}

.detail-row span:last-child {
    text-align: right;
    color: #111827;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.db-stack {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

.db-stack .detail-label {
    min-width: 160px;
}

.db-stack .detail-row span:last-child {
    max-width: 55%;
    white-space: normal;
}

/* =========================
   ROOT CAUSE
   ========================= */

.root-cause-box {
    margin-top: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #fafbfd;
    border: 1px solid #e7edf4;
}

.root-cause-title {
    font-weight: 700;
    color: #334155;
    margin-bottom: 6px;
    font-size: 0.94rem;
}

.root-cause-text {
    color: #4b5563;
    font-size: 0.95rem;
    line-height: 1.5;
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

/* =========================
   BADGES
   ========================= */

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 0.87rem;
    font-weight: 700;
    line-height: 1.1;
    border: 1px solid transparent;
    white-space: nowrap;
}

.badge-neutral {
    background: #f3f4f6;
    color: #374151;
    border-color: #e5e7eb;
}

.badge-green {
    background: #eaf8ee;
    color: #176534;
    border-color: #bfe4c8;
}

.badge-yellow {
    background: #fff8d9;
    color: #8a6d00;
    border-color: #eadc8c;
}

.badge-orange {
    background: #fff0e2;
    color: #b45309;
    border-color: #f5c89d;
}

.badge-red {
    background: #fdeaea;
    color: #b42318;
    border-color: #f1b2b2;
}

.badge-purple {
    background: #7b2cbf;
    color: #ffffff;
    border-color: #6d23ad;
}

/* =========================
   STATUS COLORS
   ========================= */

.status-neutral {
    background: #f8fafc;
    border-color: #e5e7eb;
    color: #64748b;
}

.status-green {
    background: #eaf8ee;
    border-color: #bfe4c8;
    color: #176534;
}

.status-yellow {
    background: #fff8d9;
    border-color: #eadc8c;
    color: #8a6d00;
}

.status-orange {
    background: #fff0e2;
    border-color: #f5c89d;
    color: #b45309;
}

.status-red {
    background: #fdeaea;
    border-color: #f1b2b2;
    color: #b42318;
}

.status-purple {
    background: #f3e8ff;
    border-color: #c084fc;
    color: #6b21a8;
}

/* =========================
   CARD STATUS BACKGROUND
   ========================= */

.health-card.status-green {
    background: #eaf8ee;
    border-color: #bfe4c8;
}

.health-card.status-yellow {
    background: #fff8d9;
    border-color: #eadc8c;
}

.health-card.status-orange {
    background: #fff0e2;
    border-color: #f5c89d;
}

.health-card.status-red {
    background: #fdeaea;
    border-color: #f1b2b2;
}

.health-card.status-purple {
    background: #f3e8ff;
    border-color: #c084fc;
}

/* =========================
   MODALS
   ========================= */

#customModal button,
#confirmYes,
#confirmNo {
    appearance: none;
    border: 1px solid #cfd6df;
    background: #fff;
    color: #1f2937;
    padding: 9px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.18s ease;
}

#customModal button:hover,
#confirmYes:hover,
#confirmNo:hover {
    background: #f5f7fa;
}

/* =========================
   CARD TOOLTIP MOBILE
   ========================= */

.card-tooltip-overlay {
    display: none;
}

.card-tooltip-overlay.is-card-open {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.38);
    z-index: 100000;
    pointer-events: auto;
}

.card-tooltip-panel {
    display: none;
}

.card-tooltip-overlay.is-card-open .card-tooltip-panel {
    display: block;
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(92vw, 520px);
    max-height: 82vh;
    overflow: auto;
    background: #ffffff;
    color: #111827;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
    padding: 16px;
    z-index: 100001;
    pointer-events: auto;
}

.card-tooltip-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.card-tooltip-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: #1f2937;
}

.card-tooltip-close {
    appearance: none;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #111827;
    border-radius: 10px;
    width: 34px;
    height: 34px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.card-tooltip-content .health-details {
    display: grid !important;
    gap: 10px;
    margin-bottom: 16px;
}

.card-tooltip-content .detail-row {
    display: flex !important;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 9px 0;
    border-bottom: 1px dashed #e5e7eb;
}

.card-tooltip-content .detail-row:last-child {
    border-bottom: none;
}

.card-tooltip-content .root-cause-box {
    display: block !important;
}

.card-tooltip-panel.status-green {
    background: linear-gradient(180deg, #f3fbf5 0%, #e6f6ea 100%);
    border: 1px solid #bfe4c8;
}

.card-tooltip-panel.status-yellow {
    background: linear-gradient(180deg, #fffdf1 0%, #fff7cf 100%);
    border: 1px solid #eadc8c;
}

.card-tooltip-panel.status-orange {
    background: linear-gradient(180deg, #fff8f2 0%, #ffe8d1 100%);
    border: 1px solid #f5c89d;
}

.card-tooltip-panel.status-red {
    background: linear-gradient(180deg, #fff6f6 0%, #fde7e7 100%);
    border: 1px solid #f1b2b2;
}

.card-tooltip-panel.status-purple {
    background: linear-gradient(180deg, #faf5ff 0%, #f3e8ff 100%);
    border: 1px solid #c084fc;
}

.card-tooltip-panel.status-neutral {
    background: #ffffff;
    border: 1px solid #e5e7eb;
}

/* =========================
   TABLET
   ========================= */

@media (max-width: 1200px) {
    .ehealth-grid,
    .ehealth-grid-services {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 992px) {
    .ehealth-page {
        padding: 16px 8px 24px;
    }

    .detail-label {
        min-width: 105px;
    }

    .db-stack .detail-label {
        min-width: 140px;
    }

    .db-stack .detail-row span:last-child {
        max-width: 60%;
    }
}

/* =========================
   MOBILE COMPACT
   ========================= */

@media (max-width: 768px) {
    .ehealth-page {
        padding: 12px 6px 20px;
    }

    .ehealth-page h1 {
        font-size: 1.55rem;
    }

    .ehealth-subtitle {
        font-size: 0.94rem;
    }

    .ehealth-topbar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 14px;
    }

    .gateway-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 8px;
    }

    #btn-check-gateway,
    .btn-check-gateway {
        width: 100%;
        justify-content: center;
    }

    #gateway-check-status {
        display: block;
        width: 100%;
        margin-left: 0 !important;
        font-size: 0.9rem;
    }

    .ehealth-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 12px;
        border-radius: 14px;
        margin-bottom: 14px;
    }

    .ehealth-domain-summary {
        grid-template-columns: 1fr;
        gap: 12px;
        margin: 16px 0;
    }

    .domain-card {
        padding: 14px;
    }

    .ehealth-section-title {
        align-items: flex-start;
        flex-direction: column;
        padding: 12px 14px;
    }

    .ehealth-section-title h2 {
        font-size: 17px;
    }

    .ehealth-grid,
    .ehealth-grid-services {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        margin-bottom: 16px;
    }

    .health-card,
    .health-card-wide {
        min-height: 110px;
        padding: 12px;
        border-radius: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    .health-card-header {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        margin-bottom: 0;
    }

    .health-icon-wrap {
        width: 44px;
        min-width: 44px;
        height: 44px;
        border-radius: 12px;
        margin: 0 auto;
    }

    .health-icon {
        font-size: 1.35rem;
    }

    .health-card-header h2 {
        margin: 0;
        font-size: 13px;
        font-weight: 700;
        letter-spacing: 0.7px;
        line-height: 1.15;
        text-align: center;
    }

    .health-details,
    .health-card > .root-cause-box,
    #wifiDebugBox {
        display: none !important;
    }

    .health-card .health-status-line,
    .health-card .badge {
        display: none !important;
    }

    #globalStatusBadge,
    #deviceGlobalStatusBadge,
    #serviceGlobalStatusBadge {
        display: inline-flex !important;
    }

    .mobile-expand-card {
        cursor: pointer;
    }

    .mobile-expand-card.is-card-open {
        outline: 2px solid rgba(59, 130, 246, 0.22);
        outline-offset: 2px;
    }

    .health-card:active {
        transform: scale(0.97);
    }
}

/* =========================
   SMALL MOBILE
   ========================= */

@media (max-width: 480px) {
    .ehealth-page {
        padding: 14px 4px 20px;
    }

    .ehealth-grid,
    .ehealth-grid-services {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .health-card,
    .health-card-wide {
        min-height: 104px;
        padding: 10px;
        border-radius: 14px;
    }

    .health-card-header h2 {
        font-size: 12px;
    }

    .health-icon-wrap {
        width: 42px;
        min-width: 42px;
        height: 42px;
    }

    .card-tooltip-overlay.is-card-open .card-tooltip-panel {
        width: min(94vw, 520px);
        padding: 14px;
        border-radius: 16px;
    }

    .card-tooltip-title {
        font-size: 1rem;
    }
}

/* =========================
   PULSE CRITICAL
   ========================= */

.health-card.status-red {
    animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.015);
    }
    100% {
        transform: scale(1);
    }
}

.card-purple {
    background: #f5edff;
    border-color: #c9a7ff;
}

.card-purple .badge {
    background: #7b2cff;
    color: #fff;
}

/***************************************************************
 * PATCH CSS — eHealth SMS Gateway
 * À ajouter à la fin de css/style_ehealth_sms_gateway.css
 ***************************************************************/

/* Couleur purple : supervision Omada KO mais Internet encore OK */
.badge-purple {
    background: #7c3aed;
    color: #fff;
}

.status-purple {
    border-color: #7c3aed !important;
    box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.18), 0 10px 24px rgba(124, 58, 237, 0.12);
}

.health-icon-wrap.status-purple {
    background: rgba(124, 58, 237, 0.12);
    color: #7c3aed;
}

/* Résumé des 3 domaines */
.ehealth-domain-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 18px 0 22px;
}

.domain-card {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 16px;
    padding: 14px 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.domain-title {
    font-weight: 700;
    margin-bottom: 6px;
    color: #0f172a;
}

.domain-desc {
    font-size: 0.92rem;
    color: #64748b;
    margin-bottom: 10px;
    line-height: 1.35;
}

.ehealth-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 24px 0 12px;
}

.ehealth-section-title h2 {
    margin: 0;
    font-size: 1.2rem;
}

/* MR110 désactivé : visuel non bloquant */
.health-card.is-disabled {
    opacity: 0.72;
    filter: grayscale(0.15);
}

/* Root cause multi-lignes côté GSM/debug */
.root-cause-text {
    white-space: pre-line;
}

@media (max-width: 992px) {
    .ehealth-domain-summary {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .health-card.compact .health-details,
    .health-card.compact .root-cause-box {
        display: none;
    }

    .health-card.compact {
        min-height: 130px;
        height: auto;
    }

    .health-card.compact .health-card-header {
        justify-content: center;
        text-align: center;
        flex-direction: column;
        gap: 8px;
    }

    .health-card.compact h2 {
        font-size: 13px;
        line-height: 1.2;
        text-align: center;
        word-break: normal;
    }
}

@media (max-width: 768px) {
    #vhCard.compact #vhList {
        display: none !important;
    }

    #vhCard.compact .vh-diagnostic-row {
        display: flex !important;
    }

    #vhCard.compact .root-cause-box {
        display: none !important;
    }

    #vhCard.compact.expanded .root-cause-box,
    #vhCard.compact.is-expanded .root-cause-box,
    #vhCard.compact.open .root-cause-box {
        display: block !important;
    }

    #vhCard.compact {
        height: auto !important;
        min-height: 150px !important;
    }
}

#gatewayHistoryCard {
    max-width: 600px;
}

/* =========================
   LOG HISTORY STYLING
========================= */

.detail-row {
    padding: 8px 10px;
    border-bottom: 1px dashed #ddd;
    font-size: 13px;
}

.log-red {
    background: rgba(255, 0, 0, 0.08);
    border-left: 4px solid #e53935;
}

.log-orange {
    background: rgba(255, 165, 0, 0.08);
    border-left: 4px solid #fb8c00;
}

.log-green {
    background: rgba(0, 200, 0, 0.08);
    border-left: 4px solid #43a047;
}

.log-neutral {
    background: #fafafa;
}

/* =========================
   PARTIE 4 — HISTORIQUE
========================= */

.ehealth-history-wrapper {
    max-width: 1100px;
    margin: 0 auto 24px auto;
}

.ehealth-history-wrapper .ehealth-section-title {
    width: 100%;
    margin-bottom: 10px;
}

.ehealth-grid-history {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
}

#gatewayHistoryCard {
    width: 100%;
    max-width: none;
    margin: 0;
}

#gatewayHistoryCard .detail-row {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 12px;
    align-items: start;
}

#gatewayHistoryCard .detail-label {
    white-space: nowrap;
}

#gatewayHistoryCard .health-details span:last-child {
    text-align: left;
}

/* En mode GSM, le bloc "Ouvrir Omada" ne doit jamais apparaître */
@media (max-width: 768px) {
    #omadaAccessBox {
        display: none !important;
    }
}


/* =========================================================
   DEVICE CARDS — CONTRASTE VISUEL AMÉLIORÉ
   ========================================================= */

/* GREEN */
.health-card.status-green {
    background: linear-gradient(135deg, #dff6e7, #f8fff9);
    border: 1px solid #59b87a;
    box-shadow: 0 6px 18px rgba(46, 139, 87, 0.10);
}

.health-card.status-green .health-icon-wrap {
    background: #eefcf2;
    border-color: #59b87a;
}

.health-card.status-green .badge {
    background: #2e8b57;
    color: #fff;
}

/* ORANGE */
.health-card.status-orange {
    background: linear-gradient(135deg, #fff1dd, #fffaf4);
    border: 1px solid #e18a1d;
    box-shadow: 0 6px 18px rgba(225, 138, 29, 0.12);
}

.health-card.status-orange .health-icon-wrap {
    background: #fff7eb;
    border-color: #e18a1d;
}

.health-card.status-orange .badge {
    background: #cc6f00;
    color: #fff;
}

/* RED */
.health-card.status-red {
    background: linear-gradient(135deg, #ffe3e3, #fff8f8);
    border: 1px solid #d64545;
    box-shadow: 0 8px 24px rgba(185, 28, 28, 0.14);
}

.health-card.status-red .health-icon-wrap {
    background: #fff1f1;
    border-color: #d64545;
}

.health-card.status-red .badge {
    background: #b91c1c;
    color: #fff;
}


/* =========================================================
   MODE PUBLIC DEVICES — ehealth.yogakwetu.be
   ========================================================= */

body.devices-public .domain-management,
body.devices-public .domain-service {
    display: none !important;
}

body.devices-public .ehealth-domain-summary {
    grid-template-columns: 1fr;
}

body.devices-public #omadaCard,
body.devices-public #er605Card,
body.devices-public #ovhCard,
body.devices-public #wireguardCard,
body.devices-public #gsmCard,
body.devices-public #postfixCard,
body.devices-public #fail2banCard,
body.devices-public #dovecotCard,
body.devices-public #vpsBackupCard,
body.devices-public #mosquittoCard,
body.devices-public #noderedCard,
body.devices-public #meshchatCard,
body.devices-public #phpmyadminCard,
body.devices-public #smsStatsCard,
body.devices-public #calDbCard,
body.devices-public #vhCard,
body.devices-public #servicesHistoryCard {
    display: none !important;
}

body.devices-public .root-cause-box {
    display: none !important;
}

body.devices-public .ehealth-page {
    max-width: 900px;
}

body.devices-public .ehealth-subtitle {
    font-size: 1rem;
}

body.devices-public .ehealth-grid,
body.devices-public .ehealth-grid-services {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.devices-public #gateway-check-status {
    font-weight: 700;
    color: #2563eb;
}

@media (max-width: 768px) {
    body.devices-public .ehealth-grid,
    body.devices-public .ehealth-grid-services {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.devices-public .ehealth-page h1 {
        font-size: 1.4rem;
    }
}


/* =========================================================
   SWITCH LAN 24 PORTS — FRONT-END VISUEL
   ========================================================= */
.ehealth-switch-title p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 0.92rem;
    line-height: 1.35;
}

.switch24-card {
    margin-bottom: 24px;
    overflow: hidden;
}

.switch24-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.switch24-name {
    font-weight: 800;
    color: #0f172a;
    font-size: 1.08rem;
}

.switch24-subtitle,
.switch24-updated {
    color: #64748b;
    font-size: 0.9rem;
    margin-top: 4px;
}

.switch24-led-summary {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    color: #475569;
    font-size: 0.86rem;
}

.switch24-led-summary span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #f8fafc;
}

.switch24-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.75), 0 0 8px rgba(15, 23, 42, 0.22);
}

.switch24-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 18px;
    align-items: stretch;
}

.switch24-faceplate {
    background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
    border: 1px solid #0f172a;
    border-radius: 18px;
    padding: 16px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 14px 28px rgba(15, 23, 42, 0.16);
}

.switch24-brand-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
    color: #e5e7eb;
}

.switch24-brand {
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.82rem;
}

.switch24-ports-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 9px;
}

.switch24-port {
    appearance: none;
    position: relative;
    border: 1px solid #334155;
    background: linear-gradient(180deg, #f8fafc 0%, #cbd5e1 100%);
    color: #0f172a;
    border-radius: 8px;
    min-height: 58px;
    padding: 7px 5px 6px;
    cursor: pointer;
    display: grid;
    gap: 4px;
    align-content: center;
    text-align: center;
    box-shadow: inset 0 -3px 0 rgba(15, 23, 42, 0.16), 0 5px 12px rgba(0, 0, 0, 0.18);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.switch24-port:hover,
.switch24-port.is-selected {
    transform: translateY(-2px);
    border-color: #93c5fd;
    box-shadow: inset 0 -3px 0 rgba(15, 23, 42, 0.16), 0 0 0 3px rgba(59, 130, 246, 0.22), 0 10px 18px rgba(0, 0, 0, 0.22);
}

.switch24-port-led {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #94a3b8;
    box-shadow: 0 0 8px rgba(148, 163, 184, 0.7);
}

.switch24-port-number {
    font-weight: 900;
    font-size: 0.88rem;
    line-height: 1;
}

.switch24-port-label {
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.switch24-port-ip {
    color: #475569;
    font-size: 0.64rem;
    line-height: 1;
}

.switch24-port.status-green .switch24-port-led,
.switch24-dot.status-green {
    background: #22c55e;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.85);
}

.switch24-port.status-orange .switch24-port-led,
.switch24-dot.status-orange {
    background: #f97316;
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.85);
}

.switch24-port.status-red .switch24-port-led,
.switch24-dot.status-red {
    background: #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.85);
}

.switch24-port.status-purple .switch24-port-led,
.switch24-dot.status-purple {
    background: #8b5cf6;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.85);
}

.switch24-port.status-neutral {
    opacity: 0.68;
    filter: grayscale(0.2);
}

.switch24-port.status-neutral .switch24-port-led,
.switch24-dot.status-neutral {
    background: #94a3b8;
    box-shadow: 0 0 7px rgba(148, 163, 184, 0.55);
}

.switch24-panel {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 18px;
    padding: 14px;
    min-width: 0;
}

.switch24-panel-title {
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 10px;
}

.switch24-panel-content .detail-row {
    background: transparent;
}

@media (max-width: 992px) {
    .switch24-body {
        grid-template-columns: 1fr;
    }

    .switch24-ports-grid {
        grid-template-columns: repeat(8, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .switch24-header,
    .switch24-brand-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .switch24-led-summary {
        justify-content: flex-start;
    }

    .switch24-faceplate {
        padding: 12px;
        border-radius: 16px;
    }

    .switch24-ports-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
    }

    .switch24-port {
        min-height: 62px;
    }

    .switch24-panel .detail-row,
    .switch24-panel-content .detail-row {
        display: flex !important;
    }
}

@media (max-width: 480px) {
    .switch24-ports-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .switch24-port-label {
        font-size: 0.65rem;
    }
}

/* =========================================================
   PATCH SWITCH LAN — Style Cisco Catalyst, 24 ports sur 3 lignes
   À conserver en fin de fichier pour surcharger le layout précédent
   ========================================================= */

.switch24-card {
    border-color: #d8e2ef;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.switch24-header {
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.switch24-name {
    font-size: 1.2rem;
    letter-spacing: -0.01em;
}

.switch24-body {
    grid-template-columns: minmax(0, 1fr) 310px;
    gap: 20px;
}

.switch24-faceplate {
    position: relative;
    overflow: hidden;
    min-height: 520px;
    padding: 18px 18px 22px;
    border-radius: 18px;
    border: 1px solid #111827;
    background:
        radial-gradient(circle at 12% 10%, rgba(255, 255, 255, 0.13), transparent 24%),
        linear-gradient(180deg, #252b2f 0%, #171d21 42%, #11171b 100%);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.13),
        inset 0 -1px 0 rgba(0,0,0,0.55),
        0 16px 34px rgba(15, 23, 42, 0.22);
}

.switch24-faceplate::before {
    content: "CISCO";
    position: absolute;
    left: 24px;
    top: 44px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.86rem;
    font-weight: 900;
    letter-spacing: 0.16em;
}

.switch24-faceplate::after {
    content: "Catalyst 2960-X Series";
    position: absolute;
    right: 26px;
    bottom: 20px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.switch24-brand-row {
    min-height: 70px;
    margin-bottom: 12px;
    padding-left: 98px;
    padding-right: 14px;
    align-items: flex-start;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}

.switch24-brand {
    color: #f8fafc;
    font-size: 0.88rem;
    letter-spacing: 0.02em;
    line-height: 1.35;
}

.switch24-brand::after {
    content: "\A Catalyst 2960-X 24TC-L";
    white-space: pre;
    display: block;
    color: rgba(226, 232, 240, 0.84);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    margin-top: 4px;
}

.switch24-updated {
    color: #aeb9c7;
    font-size: 0.84rem;
    text-align: right;
}

.switch24-ports-grid {
    grid-template-columns: repeat(8, minmax(86px, 1fr));
    gap: 14px 16px;
    padding: 18px 12px 58px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.025));
}

.switch24-port {
    min-height: 118px;
    padding: 12px 8px 10px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: #e5e7eb;
    box-shadow: none;
    align-content: start;
    gap: 6px;
}

.switch24-port::before {
    content: "";
    display: block;
    width: 58px;
    height: 50px;
    margin: 20px auto 6px;
    border-radius: 3px;
    border: 3px solid #aeb7bf;
    background:
        linear-gradient(90deg, rgba(255,255,255,0.10) 0 3px, transparent 3px 7px) 50% 36px / 34px 9px no-repeat,
        linear-gradient(180deg, #0a0d0f 0%, #151a1d 52%, #07090a 100%);
    box-shadow:
        inset 0 0 0 2px rgba(255,255,255,0.08),
        0 2px 5px rgba(0,0,0,0.55);
}

.switch24-port:hover,
.switch24-port.is-selected {
    transform: translateY(-2px);
    border-color: rgba(59, 130, 246, 0.72);
    background: rgba(59, 130, 246, 0.12);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.20), 0 10px 20px rgba(0,0,0,0.20);
}

.switch24-port-led {
    top: 42px;
    right: calc(50% - 30px);
    width: 11px;
    height: 8px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.35);
}

.switch24-port-number {
    position: absolute;
    top: 10px;
    left: 0;
    right: 0;
    color: #dbeafe;
    font-size: 0.98rem;
    letter-spacing: 0.03em;
}

.switch24-port.status-green .switch24-port-number {
    color: #86efac;
}

.switch24-port.status-orange .switch24-port-number {
    color: #fdba74;
}

.switch24-port.status-red .switch24-port-number {
    color: #fca5a5;
}

.switch24-port.status-neutral .switch24-port-number {
    color: #e5e7eb;
}

.switch24-port-label {
    min-height: 30px;
    color: #f8fafc;
    font-size: 0.72rem;
    line-height: 1.15;
    text-shadow: 0 1px 1px rgba(0,0,0,0.35);
    -webkit-line-clamp: 2;
}

.switch24-port-ip {
    color: #cbd5e1;
    font-size: 0.7rem;
    line-height: 1.15;
}

.switch24-port.status-neutral {
    opacity: 0.9;
    filter: none;
}

.switch24-port.status-neutral .switch24-port-label,
.switch24-port.status-neutral .switch24-port-ip {
    color: #d1d5db;
}

.switch24-panel {
    border-radius: 18px;
    border-color: #dbe4ef;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 8px 22px rgba(15,23,42,0.05);
}

.switch24-panel-title {
    font-size: 1.05rem;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
}

.switch24-panel-content .detail-row {
    padding: 10px 8px;
}

.switch24-led-summary span {
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(15,23,42,0.05);
}

@media (max-width: 1200px) {
    .switch24-body {
        grid-template-columns: 1fr;
    }

    .switch24-faceplate {
        min-height: auto;
    }
}

@media (max-width: 992px) {
    .switch24-ports-grid {
        grid-template-columns: repeat(6, minmax(82px, 1fr));
    }
}

@media (max-width: 768px) {
    .switch24-header,
    .switch24-brand-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .switch24-brand-row {
        padding-left: 0;
        padding-top: 64px;
    }

    .switch24-faceplate::before {
        top: 24px;
    }

    .switch24-updated {
        text-align: left;
    }

    .switch24-ports-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 10px;
        padding: 14px 8px 52px;
    }

    .switch24-port {
        min-height: 112px;
    }
}

@media (max-width: 480px) {
    .switch24-ports-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .switch24-port {
        min-height: 106px;
        padding-left: 4px;
        padding-right: 4px;
    }

    .switch24-port::before {
        width: 50px;
        height: 45px;
    }

    .switch24-port-label {
        font-size: 0.66rem;
    }
}


/* =========================================================
   eHealth — Switch Cisco Catalyst 24 ports / 3 lignes
   À placer à la fin de style_ehealth_sms_gateway.css
   ========================================================= */

.ehealth-switch-card {
    border: 1px solid #f59e0b;
    background: #fff7ed;
    border-radius: 18px;
    padding: 18px;
    margin: 22px 0;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.ehealth-switch-header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.ehealth-switch-header h2 {
    margin: 0 0 4px;
    font-size: 1.25rem;
    color: #0f172a;
}

.ehealth-switch-subtitle {
    margin: 0;
    color: #64748b;
    font-size: 0.92rem;
}

.switch-status-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.switch-legend-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid #dbe3ee;
    font-size: 0.86rem;
    color: #334155;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.switch-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
    box-shadow: 0 0 8px currentColor;
}

.switch-dot.ok { background: #22c55e; color: #22c55e; }
.switch-dot.warning { background: #f97316; color: #f97316; }
.switch-dot.down { background: #ef4444; color: #ef4444; }
.switch-dot.free { background: #94a3b8; color: #94a3b8; }

.ehealth-switch-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 276px;
    gap: 18px;
    align-items: stretch;
}

.cisco-switch-shell {
    background:
        radial-gradient(circle at 15% 10%, rgba(255,255,255,0.10), transparent 28%),
        linear-gradient(145deg, #2c3438, #111820 55%, #090f16);
    border: 1px solid #020617;
    border-radius: 16px;
    padding: 18px 16px 20px;
    color: #e5e7eb;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.10),
        0 12px 28px rgba(15,23,42,0.28);
    overflow: hidden;
}

.cisco-switch-top {
    display: grid;
    grid-template-columns: 64px 1fr auto;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
}

.cisco-logo {
    font-weight: 900;
    letter-spacing: 4px;
    font-size: 0.95rem;
}

.cisco-title {
    font-weight: 800;
    font-size: 1rem;
    color: #f8fafc;
}

.cisco-model {
    margin-top: 5px;
    font-size: 0.82rem;
    color: #cbd5e1;
}

.cisco-updated {
    font-size: 0.82rem;
    color: #cbd5e1;
    white-space: nowrap;
}

.cisco-ports-panel {
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 12px;
    padding: 14px 12px 16px;
    background: rgba(15, 23, 42, 0.26);
}

.switch-ports-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(68px, 1fr));
    column-gap: 14px;
    row-gap: 18px;
}

.switch-port {
    min-width: 0;
    text-align: center;
    cursor: pointer;
    border-radius: 10px;
    padding: 5px 4px 8px;
    color: #e5e7eb;
    transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.switch-port:hover {
    transform: translateY(-2px);
    background: rgba(255,255,255,0.06);
}

.switch-port.is-selected {
    outline: 1px solid #3b82f6;
    background: rgba(59,130,246,0.13);
    box-shadow: 0 0 0 1px rgba(59,130,246,0.35);
}

.switch-port-number {
    font-weight: 900;
    font-size: 1rem;
    line-height: 1;
    margin-bottom: 6px;
}

.switch-port.status-ok .switch-port-number { color: #6ee7b7; }
.switch-port.status-warning .switch-port-number { color: #fdba74; }
.switch-port.status-down .switch-port-number { color: #fca5a5; }
.switch-port.status-free .switch-port-number { color: #cbd5e1; }

.rj45-port {
    position: relative;
    width: 54px;
    height: 44px;
    margin: 0 auto 7px;
    border: 2px solid #cbd5e1;
    border-radius: 3px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.08), transparent 32%),
        #020617;
    box-shadow:
        inset 0 0 0 2px rgba(255,255,255,0.06),
        inset 0 -8px 12px rgba(0,0,0,0.75),
        0 2px 6px rgba(0,0,0,0.55);
}

.rj45-port::before {
    content: "";
    position: absolute;
    top: 5px;
    left: 5px;
    width: 8px;
    height: 6px;
    border-radius: 1px;
    background: rgba(255,255,255,0.35);
}

.rj45-port::after {
    content: "";
    position: absolute;
    bottom: 7px;
    left: 10px;
    width: 3px;
    height: 10px;
    background: rgba(255,255,255,0.18);
}

.port-led {
    position: absolute;
    top: 7px;
    right: 5px;
    width: 15px;
    height: 8px;
    border-radius: 999px;
    background: #94a3b8;
    box-shadow: 0 0 8px rgba(148,163,184,0.8);
}

.switch-port.status-ok .port-led {
    background: #22c55e;
    box-shadow: 0 0 12px rgba(34,197,94,0.95);
}

.switch-port.status-warning .port-led {
    background: #f97316;
    box-shadow: 0 0 12px rgba(249,115,22,0.95);
}

.switch-port.status-down .port-led {
    background: #ef4444;
    box-shadow: 0 0 12px rgba(239,68,68,0.95);
}

.switch-port.status-free .port-led {
    background: #94a3b8;
    box-shadow: 0 0 8px rgba(148,163,184,0.65);
}

.switch-port-label {
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1.15;
    min-height: 28px;
    color: #f8fafc;
    overflow-wrap: anywhere;
}

.switch-port-ip {
    margin-top: 4px;
    font-size: 0.7rem;
    color: #cbd5e1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cisco-vents {
    display: grid;
    grid-template-columns: repeat(24, 1fr);
    gap: 6px;
    margin-top: 14px;
}

.cisco-vents span {
    display: block;
    height: 5px;
    border-radius: 999px;
    background: #020617;
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.10);
}

.cisco-series {
    text-align: right;
    margin-top: 10px;
    font-weight: 700;
    color: #cbd5e1;
    font-size: 0.82rem;
}

.switch-port-detail {
    background: #f8fafc;
    border: 1px solid #dbe3ee;
    border-radius: 16px;
    padding: 16px;
    color: #0f172a;
}

.switch-port-detail h3 {
    margin: 0 0 12px;
    font-size: 1.05rem;
    color: #0f172a;
}

.switch-detail-row {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px dashed #cbd5e1;
    font-size: 0.82rem;
}

.switch-detail-label {
    font-weight: 800;
    color: #475569;
}

.switch-detail-value {
    text-align: right;
    color: #0f172a;
    overflow-wrap: anywhere;
}

@media (max-width: 1100px) {
    .ehealth-switch-layout {
        grid-template-columns: 1fr;
    }

    .switch-port-detail {
        max-width: none;
    }
}

@media (max-width: 900px) {
    .switch-ports-grid {
        grid-template-columns: repeat(4, minmax(66px, 1fr));
    }

    .cisco-switch-top {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .cisco-updated {
        white-space: normal;
    }
}

@media (max-width: 520px) {
    .ehealth-switch-card {
        padding: 14px;
    }

    .ehealth-switch-header {
        flex-direction: column;
    }

    .switch-status-legend {
        justify-content: flex-start;
    }

    .cisco-switch-shell {
        padding: 14px 10px 16px;
    }

    .switch-ports-grid {
        grid-template-columns: repeat(3, minmax(62px, 1fr));
        column-gap: 8px;
        row-gap: 14px;
    }

    .rj45-port {
        width: 48px;
        height: 40px;
    }

    .switch-port-label {
        font-size: 0.68rem;
    }

    .switch-port-ip {
        font-size: 0.64rem;
    }
}

/* =========================================================
   PATCH FINAL — Switch LAN Cisco 24 ports / 3 lignes lisibles
   Corrige le port 08/16/24 coupé en réduisant les largeurs
   et en donnant plus de place au switch.
   À conserver tout à la fin du fichier CSS.
   ========================================================= */

.switch24-card {
    overflow: visible !important;
}

.switch24-body {
    grid-template-columns: minmax(0, 1fr) 280px !important;
    gap: 14px !important;
    align-items: stretch !important;
}

.switch24-faceplate {
    min-width: 0 !important;
    overflow: hidden !important;
    padding: 16px 14px 20px !important;
}

.switch24-brand-row {
    padding-left: 86px !important;
    padding-right: 8px !important;
    min-height: 64px !important;
}

.switch24-faceplate::before {
    left: 22px !important;
}

.switch24-ports-grid {
    grid-template-columns: repeat(8, minmax(58px, 1fr)) !important;
    column-gap: 7px !important;
    row-gap: 14px !important;
    padding: 14px 8px 52px !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
}

.switch24-port {
    min-width: 0 !important;
    min-height: 108px !important;
    padding: 10px 3px 8px !important;
    gap: 4px !important;
}

.switch24-port::before {
    width: 46px !important;
    height: 40px !important;
    margin: 18px auto 5px !important;
    border-width: 2px !important;
}

.switch24-port-led {
    top: 38px !important;
    right: calc(50% - 24px) !important;
    width: 10px !important;
    height: 7px !important;
}

.switch24-port-number {
    top: 8px !important;
    font-size: 0.9rem !important;
}

.switch24-port-label {
    min-height: 28px !important;
    font-size: 0.64rem !important;
    line-height: 1.12 !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
}

.switch24-port-ip {
    max-width: 100% !important;
    font-size: 0.61rem !important;
    line-height: 1.1 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.switch24-panel {
    width: 280px !important;
    min-width: 0 !important;
    padding: 13px !important;
}

.switch24-panel-content .detail-row {
    grid-template-columns: 85px 1fr !important;
    gap: 8px !important;
    padding: 9px 4px !important;
}

.switch24-panel-content .detail-label,
.switch24-panel-content .switch-detail-label {
    min-width: 0 !important;
}

.switch24-panel-content .detail-row span:last-child,
.switch24-panel-content .switch-detail-value {
    text-align: right !important;
    overflow-wrap: anywhere !important;
}

@media (min-width: 1201px) {
    .ehealth-page {
        max-width: 1280px !important;
    }
}

@media (max-width: 1200px) {
    .switch24-body {
        grid-template-columns: 1fr !important;
    }

    .switch24-panel {
        width: auto !important;
    }

    .switch24-ports-grid {
        grid-template-columns: repeat(8, minmax(58px, 1fr)) !important;
    }
}

@media (max-width: 900px) {
    .switch24-ports-grid {
        grid-template-columns: repeat(4, minmax(58px, 1fr)) !important;
        column-gap: 8px !important;
        row-gap: 12px !important;
    }
}

@media (max-width: 768px) {
    .switch24-brand-row {
        padding-left: 0 !important;
        padding-top: 58px !important;
    }

    .switch24-faceplate::before {
        top: 24px !important;
    }

    .switch24-port {
        min-height: 104px !important;
    }
}

@media (max-width: 480px) {
    .switch24-ports-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .switch24-port::before {
        width: 44px !important;
        height: 38px !important;
    }

    .switch24-port-label {
        font-size: 0.62rem !important;
    }

    .switch24-port-ip {
        font-size: 0.58rem !important;
    }
}


/* =========================================================
   PATCH — Switch LAN : empêcher le détail de sortir du frame
   ========================================================= */

.switch24-card {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.switch24-body {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 270px) !important;
    gap: 14px !important;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.switch24-faceplate {
    min-width: 0;
    max-width: 100%;
}

.switch24-panel {
    min-width: 0;
    max-width: 270px;
    box-sizing: border-box;
    overflow-wrap: anywhere;
}

.switch24-panel-content .detail-row {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 8px;
}

.switch24-panel-content .detail-row span:last-child,
.switch24-panel-content .detail-row .detail-value {
    text-align: right;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* réduit légèrement la largeur nécessaire côté switch */
.switch24-ports-grid {
    grid-template-columns: repeat(8, minmax(72px, 1fr)) !important;
    gap: 12px 12px !important;
}

.switch24-port {
    padding-left: 4px !important;
    padding-right: 4px !important;
}

.switch24-port::before {
    width: 50px !important;
    height: 43px !important;
}

/* En dessous de 1150px, le panneau détail passe sous le switch */
@media (max-width: 1150px) {
    .switch24-body {
        grid-template-columns: 1fr !important;
    }

    .switch24-panel {
        max-width: 100%;
    }
}



/* =========================================================
   PATCH — Cisco SF300-24 : 24 Fast + 4 Gigabit + 2 SFP
   À conserver tout à la fin du fichier
   ========================================================= */

.ehealth-switch-title h2 {
    letter-spacing: -0.01em;
}

.switch24-name {
    font-size: 1.12rem;
}

.switch24-body {
    grid-template-columns: minmax(0, 1fr) minmax(238px, 270px) !important;
    gap: 14px !important;
    max-width: 100%;
}

.switch24-faceplate {
    position: relative;
    min-width: 0;
    max-width: 100%;
    min-height: 548px;
    padding: 16px 16px 22px !important;
    overflow: hidden;
}

.switch24-faceplate::before {
    content: "CISCO";
    position: absolute;
    left: 24px;
    top: 42px;
    color: rgba(255,255,255,0.92);
    font-size: 0.9rem;
    font-weight: 900;
    letter-spacing: 0.18em;
}

.switch24-faceplate::after {
    content: "SF300-24 — 24 FE + 4 GE + 2 SFP";
    position: absolute;
    right: 24px;
    bottom: 18px;
    color: rgba(226,232,240,0.88);
    font-size: 0.82rem;
    font-weight: 800;
}

.switch24-brand-row {
    min-height: 64px;
    padding-left: 92px;
    padding-right: 8px;
    margin-bottom: 12px;
    align-items: flex-start;
    border-bottom: 1px solid rgba(255,255,255,0.14);
}

.switch24-brand {
    color: #f8fafc;
    line-height: 1.35;
}

.switch24-brand::after {
    content: "\A Cisco SF300-24 Managed Switch";
    display: block;
    white-space: pre;
    color: rgba(226,232,240,0.84);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    margin-top: 4px;
}

.switch24-updated {
    color: #cbd5e1;
    text-align: right;
}

.switch24-ports-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(68px, 1fr)) !important;
    grid-auto-rows: minmax(96px, auto);
    gap: 12px 12px !important;
    padding: 14px 10px 78px;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.018));
    max-width: 100%;
    box-sizing: border-box;
}

/* Les 4 ports Gigabit occupent une ligne dédiée */
.switch24-port-gigabit:nth-of-type(25) {
    grid-column: 1 / 3;
}

.switch24-port-gigabit:nth-of-type(26) {
    grid-column: 3 / 5;
}

.switch24-port-gigabit:nth-of-type(27) {
    grid-column: 5 / 7;
}

.switch24-port-gigabit:nth-of-type(28) {
    grid-column: 7 / 9;
}

/* Les 2 ports SFP occupent une dernière zone dédiée */
.switch24-port-sfp:nth-of-type(29) {
    grid-column: 3 / 5;
}

.switch24-port-sfp:nth-of-type(30) {
    grid-column: 5 / 7;
}

.switch24-port {
    min-width: 0;
    min-height: 94px !important;
    padding: 10px 4px 8px !important;
    border-radius: 10px;
    color: #e5e7eb;
    background: transparent !important;
    box-shadow: none !important;
    border: 1px solid transparent !important;
    align-content: start;
}

.switch24-port:hover,
.switch24-port.is-selected {
    border-color: rgba(59,130,246,0.78) !important;
    background: rgba(59,130,246,0.13) !important;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.20), 0 10px 20px rgba(0,0,0,0.20) !important;
}

.switch24-port::before {
    content: "";
    display: block;
    width: 46px !important;
    height: 38px !important;
    margin: 20px auto 6px;
    border-radius: 3px;
    border: 2px solid #aeb7bf;
    background:
        linear-gradient(90deg, rgba(255,255,255,0.12) 0 3px, transparent 3px 7px) 50% 29px / 30px 7px no-repeat,
        linear-gradient(180deg, #0a0d0f 0%, #151a1d 52%, #07090a 100%);
    box-shadow:
        inset 0 0 0 2px rgba(255,255,255,0.06),
        0 2px 5px rgba(0,0,0,0.55);
}

.switch24-port-gigabit::before {
    width: 52px !important;
    height: 42px !important;
    border-color: #60a5fa;
}

.switch24-port-sfp::before {
    width: 66px !important;
    height: 28px !important;
    margin-top: 26px;
    border-radius: 5px;
    border-color: #c084fc;
    background:
        linear-gradient(90deg, rgba(255,255,255,0.16), rgba(255,255,255,0.04)),
        linear-gradient(180deg, #101827 0%, #05070b 100%);
}

.switch24-port-led {
    top: 40px !important;
    right: calc(50% - 25px) !important;
    width: 10px !important;
    height: 7px !important;
    border-radius: 4px !important;
    border: 1px solid rgba(255,255,255,0.35);
}

.switch24-port-gigabit .switch24-port-led {
    right: calc(50% - 29px) !important;
}

.switch24-port-sfp .switch24-port-led {
    top: 44px !important;
    right: calc(50% - 36px) !important;
}

.switch24-port-number {
    position: absolute;
    top: 9px;
    left: 0;
    right: 0;
    color: #e5e7eb;
    font-size: 0.92rem;
    font-weight: 900;
    line-height: 1;
}

.switch24-port-gigabit .switch24-port-number {
    color: #93c5fd;
}

.switch24-port-sfp .switch24-port-number {
    color: #d8b4fe;
}

.switch24-port.status-green .switch24-port-number {
    color: #86efac;
}

.switch24-port.status-orange .switch24-port-number {
    color: #fdba74;
}

.switch24-port.status-red .switch24-port-number {
    color: #fca5a5;
}

.switch24-port-label {
    min-height: 28px;
    color: #f8fafc !important;
    font-size: 0.68rem !important;
    font-weight: 800;
    line-height: 1.12;
    text-shadow: 0 1px 1px rgba(0,0,0,0.35);
    overflow-wrap: anywhere;
}

.switch24-port-ip {
    color: #cbd5e1 !important;
    font-size: 0.64rem !important;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.switch24-panel {
    max-width: 270px;
    min-width: 0;
    box-sizing: border-box;
}

.switch24-panel-content .detail-row {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 8px;
}

.switch24-panel-content .detail-row span:last-child {
    text-align: right;
    overflow-wrap: anywhere;
    word-break: break-word;
}

@media (max-width: 1150px) {
    .switch24-body {
        grid-template-columns: 1fr !important;
    }

    .switch24-panel {
        max-width: 100%;
    }
}

@media (max-width: 900px) {
    .switch24-faceplate {
        min-height: auto;
    }

    .switch24-brand-row {
        padding-left: 0;
        padding-top: 58px;
        flex-direction: column;
        gap: 6px;
    }

    .switch24-faceplate::before {
        top: 24px;
    }

    .switch24-updated {
        text-align: left;
    }

    .switch24-ports-grid {
        grid-template-columns: repeat(4, minmax(64px, 1fr)) !important;
        grid-auto-rows: minmax(94px, auto);
    }

    .switch24-port-gigabit:nth-of-type(25),
    .switch24-port-gigabit:nth-of-type(26),
    .switch24-port-gigabit:nth-of-type(27),
    .switch24-port-gigabit:nth-of-type(28),
    .switch24-port-sfp:nth-of-type(29),
    .switch24-port-sfp:nth-of-type(30) {
        grid-column: auto;
    }
}

@media (max-width: 520px) {
    .switch24-ports-grid {
        grid-template-columns: repeat(3, minmax(60px, 1fr)) !important;
        gap: 10px 8px !important;
    }

    .switch24-port {
        min-height: 90px !important;
    }

    .switch24-port-label {
        font-size: 0.62rem !important;
    }

    .switch24-port-ip {
        font-size: 0.6rem !important;
    }
}


/* ==========================================
   SF300 : ligne Gigabit + SFP
   ========================================== */

.switch24-uplink-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,.12);
}

.switch24-port-gigabit,
.switch24-port-sfp {
    min-height: 82px;
}

.switch24-port-gigabit {
    border-color: rgba(0,180,255,.55);
}

.switch24-port-sfp {
    border-color: rgba(255,210,0,.55);
}

/* =========================================================
   PATCH FINAL — Mode GSM : masquer le switch SF300 graphique
   ---------------------------------------------------------
   Objectif :
   - Ne pas afficher le switch Cisco SF300 en mode smartphone/GSM.
   - Conserver le reste de l'eHealth en mode cartes compactes.
   - Éviter un rendu illisible des 30 ports sur petit écran.
   ========================================================= */

@media (max-width: 768px) {

    /* Titre de section du switch */
    .ehealth-switch-title {
        display: none !important;
    }

    /* Carte complète du switch SF300 */
    #switch24Card,
    .switch24-card {
        display: none !important;
    }

    /* Sécurité supplémentaire : masque aussi les sous-blocs si un ancien CSS force l'affichage */
    .switch24-header,
    .switch24-body,
    .switch24-faceplate,
    .switch24-ports-grid,
    .switch24-uplink-row,
    .switch24-panel,
    #switch24PortsGrid,
    #switch24UplinkGrid,
    #switch24InfoPanel {
        display: none !important;
    }
}

/* En mode public devices, on masque aussi le switch pour garder une vue légère */
body.devices-public .ehealth-switch-title,
body.devices-public #switch24Card,
body.devices-public .switch24-card {
    display: none !important;
}

/* ==========================================================
   Port configuré (enabled=1)
   ========================================================== */

.switch24-port.is-configured .switch24-port-number,
.switch24-port.is-configured .switch24-port-label,
.switch24-port.is-configured .switch24-port-ip {
    color: #ffd84d !important;
    font-weight: 700;
}

/* léger halo */

.switch24-port.is-configured .switch24-port-number,
.switch24-port.is-configured .switch24-port-label {
    text-shadow: 0 0 6px rgba(255,216,77,0.35);
}

