.system-health-page {
    display: grid;
    gap: 18px;
}

/* Genel section */
.system-health-page .admin-page {
    margin: 0;
    padding: 20px 22px;
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.05);
}

.system-health-page .admin-page__header,
.system-health-page .admin-page__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.system-health-page .admin-page__header h1,
.system-health-page .admin-page__head h1 {
    margin: 0 0 6px;
    color: #0f172a;
    font-size: 24px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.system-health-page .admin-page__header p,
.system-health-page .admin-page__head p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.65;
}

/* Grid */
.system-health-page .admin-card-grid,
.system-health-page .card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}

/* Kart */
.system-health-page .admin-card,
.system-health-page .card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    padding: 18px 18px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

.system-health-page .admin-card::before,
.system-health-page .card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #cbd5e1;
}

/* Basit durum tonlari */
.system-health-page .admin-card:nth-child(3n + 1)::before,
.system-health-page .card:nth-child(3n + 1)::before {
    background: #60a5fa;
}

.system-health-page .admin-card:nth-child(3n + 2)::before,
.system-health-page .card:nth-child(3n + 2)::before {
    background: #34d399;
}

.system-health-page .admin-card:nth-child(3n)::before,
.system-health-page .card:nth-child(3n)::before {
    background: #f59e0b;
}

.system-health-page .admin-card h2,
.system-health-page .admin-card h3,
.system-health-page .card h2,
.system-health-page .card h3 {
    margin: 0;
    color: #0f172a;
    font-size: 17px;
    line-height: 1.35;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.system-health-page .admin-card p,
.system-health-page .card p {
    margin: 0;
    color: #475569;
    font-size: 14px;
    line-height: 1.65;
    word-break: break-word;
}

.system-health-page .admin-card strong,
.system-health-page .card strong {
    color: #0f172a;
    font-weight: 700;
}

/* Badge altyapisi */
.system-health-page .system-health-badge,
.system-health-page .health-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #0f172a;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.system-health-page .system-health-badge.is-success,
.system-health-page .health-badge.is-success,
.system-health-page .health-badge--ok {
    background: #dcfce7;
    border-color: #bbf7d0;
    color: #166534;
}

.system-health-page .system-health-badge.is-warning,
.system-health-page .health-badge.is-warning,
.system-health-page .health-badge--warn {
    background: #fef3c7;
    border-color: #fde68a;
    color: #92400e;
}

.system-health-page .system-health-badge.is-danger,
.system-health-page .health-badge.is-danger,
.system-health-page .health-badge--error {
    background: #fee2e2;
    border-color: #fecaca;
    color: #991b1b;
}

/* Liste */
.system-health-page .admin-card ul,
.system-health-page .card ul {
    margin: 0;
    padding-left: 18px;
    color: #475569;
    font-size: 14px;
    line-height: 1.65;
}

.system-health-page .admin-card li,
.system-health-page .card li {
    margin: 0 0 6px;
    word-break: break-word;
}

.system-health-page .admin-card li:last-child,
.system-health-page .card li:last-child {
    margin-bottom: 0;
}

/* Butonlar */
.system-health-page .admin-card button,
.system-health-page .card button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid #dbe4ee;
    border-radius: 12px;
    background: #f8fafc;
    color: #0f172a;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.04);
}

.system-health-page .admin-card button:hover,
.system-health-page .card button:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
    box-shadow: 0 8px 18px rgba(59, 130, 246, 0.12);
}

.system-health-page .admin-card button:active,
.system-health-page .card button:active {
    transform: translateY(1px);
}

/* Test butonlari */
.system-health-page button[data-room-test] {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.system-health-page button[data-room-test]:hover {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1d4ed8;
}

/* Manuel aksiyonlar */
.system-health-page button[data-debug-action="refresh"] {
    background: #ecfdf5;
    border-color: #bbf7d0;
    color: #166534;
}

.system-health-page button[data-debug-action="refresh"]:hover {
    background: #dcfce7;
    border-color: #86efac;
}

.system-health-page button[data-debug-action="reset-heartbeat"] {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #c2410c;
}

.system-health-page button[data-debug-action="reset-heartbeat"]:hover {
    background: #ffedd5;
    border-color: #fdba74;
}

.system-health-page button[data-debug-action="clear-queue"],
.system-health-page button[data-debug-action="clear-presence"] {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.system-health-page button[data-debug-action="clear-queue"]:hover,
.system-health-page button[data-debug-action="clear-presence"]:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

/* Tablo */
.system-health-page .admin-card table,
.system-health-page .card table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
    background: #ffffff;
}

.system-health-page .admin-card thead th,
.system-health-page .card thead th {
    padding: 12px 14px;
    background: #f8fafc;
    color: #334155;
    font-size: 13px;
    font-weight: 800;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.system-health-page .admin-card tbody td,
.system-health-page .card tbody td {
    padding: 12px 14px;
    color: #475569;
    font-size: 14px;
    line-height: 1.55;
    border-bottom: 1px solid #edf2f7;
    vertical-align: top;
}

.system-health-page .admin-card tbody tr:hover,
.system-health-page .card tbody tr:hover {
    background: #f8fafc;
}

/* Genel kartlarda tablo tasmasin */
.system-health-page .admin-card,
.system-health-page .card {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Son satir bosluklari */
.system-health-page .admin-card p + p,
.system-health-page .card p + p {
    margin-top: 2px;
}

/* Summary */
.system-health-page .system-health-summary,
.system-health-page .system-health-summary-card {
    display: grid;
    gap: 16px;
}

.system-health-page .system-health-summary-card {
    padding: 20px 22px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}

.system-health-page .system-health-summary-card__head,
.system-health-page .system-health-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.system-health-page .system-health-summary-card__head h2,
.system-health-page .system-health-card__head h2 {
    margin: 0;
    color: #0f172a;
    font-size: 18px;
    line-height: 1.3;
}

.system-health-page .system-health-summary-card__meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.system-health-page .system-health-summary-card__meta div {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.system-health-page .system-health-summary-card__meta span {
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}

.system-health-page .system-health-summary-card__meta strong {
    color: #0f172a;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

/* Wide kart */
.system-health-page .admin-card--wide,
.system-health-page .card--wide {
    grid-column: 1 / -1;
}

/* Son eleman */
.system-health-page .admin-card > *:last-child,
.system-health-page .card > *:last-child {
    margin-bottom: 0;
}

/* -------------------------------------------------- */
/* ODA ICI CANLI LOG - PHP yapisina gore ozel alan    */
/* Son section: <section class="admin-page">          */
/* -------------------------------------------------- */

.system-health-page > .admin-page:last-of-type .admin-card-grid {
    grid-template-columns: minmax(0, 1fr);
}

.system-health-page > .admin-page:last-of-type .admin-card {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    padding: 0;
    border-radius: 20px;
}

.system-health-page > .admin-page:last-of-type .admin-card::before {
    width: 100%;
    height: 4px;
    left: 0;
    right: 0;
    top: 0;
    bottom: auto;
    background: linear-gradient(90deg, #2563eb 0%, #14b8a6 100%);
}

.system-health-page > .admin-page:last-of-type .admin-card table {
    width: 100%;
    min-width: 1160px;
    border-collapse: collapse;
    table-layout: auto;
    margin-top: 0;
}

.system-health-page > .admin-page:last-of-type .admin-card thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8fafc;
    white-space: nowrap;
    box-shadow: inset 0 -1px 0 #e2e8f0;
}

.system-health-page > .admin-page:last-of-type .admin-card th,
.system-health-page > .admin-page:last-of-type .admin-card td {
    padding: 13px 14px;
    text-align: left;
    vertical-align: top;
}

.system-health-page > .admin-page:last-of-type .admin-card tbody tr:nth-child(even) {
    background: #fcfdff;
}

.system-health-page > .admin-page:last-of-type .admin-card tbody tr:hover {
    background: #eff6ff;
}

.system-health-page > .admin-page:last-of-type .admin-card th:nth-child(1),
.system-health-page > .admin-page:last-of-type .admin-card td:nth-child(1) {
    min-width: 160px;
}

.system-health-page > .admin-page:last-of-type .admin-card th:nth-child(2),
.system-health-page > .admin-page:last-of-type .admin-card td:nth-child(2) {
    min-width: 140px;
    font-weight: 700;
    color: #0f172a;
}

.system-health-page > .admin-page:last-of-type .admin-card th:nth-child(3),
.system-health-page > .admin-page:last-of-type .admin-card td:nth-child(3) {
    min-width: 130px;
}

.system-health-page > .admin-page:last-of-type .admin-card th:nth-child(4),
.system-health-page > .admin-page:last-of-type .admin-card td:nth-child(4) {
    min-width: 110px;
}

.system-health-page > .admin-page:last-of-type .admin-card th:nth-child(5),
.system-health-page > .admin-page:last-of-type .admin-card td:nth-child(5) {
    min-width: 160px;
}

.system-health-page > .admin-page:last-of-type .admin-card th:nth-child(6),
.system-health-page > .admin-page:last-of-type .admin-card td:nth-child(6) {
    min-width: 320px;
    word-break: break-word;
}

/* Test + Debug kartlarinda biraz daha temiz boşluk */
.system-health-page > .admin-page:nth-of-type(3) .admin-card {
    gap: 12px;
}

.system-health-page > .admin-page:nth-of-type(3) .admin-card p button {
    width: 100%;
}

/* İlk alan baslik rozeti gibi */
.system-health-page > .admin-page:first-of-type .admin-page__header p {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}

/* RTL */
html[dir="rtl"] .system-health-page .admin-page__header,
html[dir="rtl"] .system-health-page .admin-page__head,
html[dir="rtl"] .system-health-page .system-health-summary-card__head,
html[dir="rtl"] .system-health-page .system-health-card__head,
body.is-rtl .system-health-page .admin-page__header,
body.is-rtl .system-health-page .admin-page__head,
body.is-rtl .system-health-page .system-health-summary-card__head,
body.is-rtl .system-health-page .system-health-card__head {
    direction: rtl;
}

html[dir="rtl"] .system-health-page .admin-card::before,
html[dir="rtl"] .system-health-page .card::before,
body.is-rtl .system-health-page .admin-card::before,
body.is-rtl .system-health-page .card::before {
    left: auto;
    right: 0;
}

html[dir="rtl"] .system-health-page > .admin-page:last-of-type .admin-card th,
html[dir="rtl"] .system-health-page > .admin-page:last-of-type .admin-card td,
body.is-rtl .system-health-page > .admin-page:last-of-type .admin-card th,
body.is-rtl .system-health-page > .admin-page:last-of-type .admin-card td {
    text-align: right;
}

/* Responsive */
@media (max-width: 1280px) {
    .system-health-page .admin-card-grid,
    .system-health-page .card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .system-health-page > .admin-page:last-of-type .admin-card table {
        min-width: 1050px;
    }
}

@media (max-width: 820px) {
    .system-health-page .admin-page {
        padding: 18px 16px;
    }

    .system-health-page .admin-card-grid,
    .system-health-page .card-grid,
    .system-health-page .system-health-summary-card__meta {
        grid-template-columns: 1fr;
    }

    .system-health-page .admin-page__header,
    .system-health-page .admin-page__head,
    .system-health-page .system-health-summary-card__head,
    .system-health-page .system-health-card__head {
        flex-direction: column;
        align-items: stretch;
    }

    .system-health-page .admin-card table,
    .system-health-page .card table {
        min-width: 680px;
    }

    .system-health-page > .admin-page:last-of-type .admin-card table {
        min-width: 920px;
    }
}

@media (max-width: 560px) {
    .system-health-page {
        gap: 14px;
    }

    .system-health-page .admin-page__header h1,
    .system-health-page .admin-page__head h1 {
        font-size: 21px;
    }

    .system-health-page .admin-card,
    .system-health-page .card {
        padding: 16px 14px 14px;
        border-radius: 16px;
    }

    .system-health-page .admin-card h2,
    .system-health-page .admin-card h3,
    .system-health-page .card h2,
    .system-health-page .card h3 {
        font-size: 16px;
    }

    .system-health-page > .admin-page:last-of-type .admin-card {
        padding: 0;
    }

    .system-health-page > .admin-page:last-of-type .admin-card table {
        min-width: 860px;
    }
}