/* ============================================================
   STATUS — Live Incident Board
   ============================================================ */

.status-section {
    /* پالت خنثی/طوسی هماهنگ با تیم */
    --soft-green: rgba(160, 170, 180, 0.85);
    --soft-green-line: var(--line-px);
    --soft-green-glow: rgba(160, 170, 180, 0.22);
    --soft-green-tint: rgba(160, 170, 180, 0.06);
    padding: 60px 0;
    position: relative;
    z-index: 1;
}

[data-theme="light"] .status-section {
    --soft-green: rgba(90, 100, 110, 0.85);
    --soft-green-line: var(--line-px);
    --soft-green-glow: rgba(90, 100, 110, 0.22);
    --soft-green-tint: rgba(90, 100, 110, 0.06);
}

/* ============================================================
   TITLE BLOCK — کادر وسط‌چین، هم‌سبک با هدر بخش تیم
   ============================================================ */
.status-title-block {
    text-align: center;
    margin: 0 0 34px;
    padding: 46px 0;
    position: relative;
}

/* خط افقی بالا و پایین کادر — تا لبه‌های صفحه */
.status-title-block::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(-1 * var(--line-ext));
    right: calc(-1 * var(--line-ext));
    border-top: 1px solid var(--line-border);
    border-bottom: 1px solid var(--line-border);
    pointer-events: none;
    z-index: 1;
}

/* خطوط عمودی دو طرف کادر، روی لبه‌های محتوا */
.status-title-block::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    border-left: 1px solid var(--soft-green-line);
    border-right: 1px solid var(--soft-green-line);
    pointer-events: none;
    z-index: 1;
}

.status-title-block h2 {
    font-size: 2.35rem;
    letter-spacing: -1.2px;
}

.status-title-block.center p {
    margin: 10px auto 0;
    max-width: 560px;
    font-size: 0.92rem;
}

.status-board {
    border: 1px solid var(--soft-green-line) !important;
    margin-top: 8px;
    position: relative;
    overflow: visible;
    z-index: 2;
}

/* Top edge rules run out to both page edges */
.status-board::before,
.status-board::after {
    content: '';
    position: absolute;
    top: -1px;
    height: 1px;
    background: var(--soft-green-line) !important;
    opacity: 1;
    pointer-events: none;
    z-index: 1;
}

.status-board::before { left: 100%; right: calc(-1 * var(--line-ext)); }
.status-board::after { right: 100%; left: calc(-1 * var(--line-ext)); }

/* Frame corner nodes */
.status-node {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--soft-green);
    box-shadow: 0 0 7px var(--soft-green-glow);
    z-index: 6;
    pointer-events: none;
}

.status-node.tl { top: -3px; left: -3px; }
.status-node.tr { top: -3px; right: -3px; }
.status-node.bl { bottom: -3px; left: -3px; }
.status-node.br { bottom: -3px; right: -3px; }

/* ====== هدر بالا (خلاصه وضعیت) ====== */
.status-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 28px;
    border-bottom: 1px solid var(--line-border);
    gap: 16px;
    flex-wrap: wrap;
}

/* Header rule runs out to both page edges */
.status-header::before,
.status-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    height: 1px;
    background: var(--soft-green-line) !important;
    opacity: 1;
    pointer-events: none;
    z-index: 2;
}

.status-header::after { right: 100%; left: calc(-1 * var(--line-ext)); }
.status-header::before { left: 100%; right: calc(-1 * var(--line-ext)); }

.status-header .sh-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-header .sh-title {
    font-family: 'Vazirmatn', 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text);
}

.status-header .sh-sub {
    font-family: 'Vazirmatn', 'Inter', sans-serif;
    font-size: 0.95rem;
    color: var(--text-muted);
    opacity: 0.7;
}

.status-header .sh-right {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Vazirmatn', 'Inter', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* LED چشمک‌زن — خنثی */
.status-led {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--soft-green);
    box-shadow: 0 0 8px var(--soft-green-glow);
    animation: led-pulse 1.5s ease-in-out infinite;
    flex: 0 0 auto;
}

.status-led.danger {
    background: #ff5f56;
    box-shadow: 0 0 8px #ff5f56;
    animation-duration: 0.8s;
}

.status-led.warning {
    background: #ffbd2e;
    box-shadow: 0 0 8px #ffbd2e;
    animation-duration: 1s;
}

@keyframes led-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.4; transform: scale(0.85); }
}

/* ====== هر ردیف سرویس ====== */
.status-item {
    position: relative;
    border-bottom: 1px solid var(--line-border);
    transition: background 0.3s ease;
    overflow: visible;
}
.status-item:last-child { border-bottom: none; }

/* Every row rule runs out to both page edges */
.status-item::before,
.status-item::after {
    content: '';
    position: absolute;
    bottom: -1px;
    height: 1px;
    background: var(--soft-green-line) !important;
    opacity: 1;
    pointer-events: none;
    z-index: 2;
}

.status-item::before { left: 100%; right: calc(-1 * var(--line-ext)); }
.status-item::after { right: 100%; left: calc(-1 * var(--line-ext)); }

/* خط اسکن متحرک حذف شد — داخل باکس استاتوس هیچ لایه‌ی خاکستری نمی‌ماند */
/* ====== دکمه ردیف ====== */
.status-row {
    width: 100%;
    background: transparent;
    border: none;
    padding: 20px 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 18px;
    text-align: left;
    font-family: 'Vazirmatn', 'Inter', sans-serif;
    color: var(--text);
    transition: background 0.3s ease;
    position: relative;
    z-index: 1;
}
.status-row:hover { background: transparent; }

/* هیچ پس‌زمینه‌ی خاکستری داخل باکس استاتوس نمی‌ماند —
   همه هم‌رنگ پس‌زمینه‌ی سایت */
.status-board,
.status-header,
.status-item,
.status-item.active,
.status-row,
.status-detail {
    background-color: transparent;
}

.status-row .sr-num {
    font-family: 'Vazirmatn', 'Inter', sans-serif;
    font-size: 1.1rem;
    color: var(--text-muted);
    opacity: 0.5;
    flex: 0 0 auto;
    letter-spacing: 0.5px;
    min-width: 28px;
    transition: opacity 0.3s ease;
}
.status-item.active .sr-num { opacity: 1; }

.status-row .sr-name {
    flex: 1;
    min-width: 0;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.2px;
    line-height: 1.3;
}

.status-row .sr-server {
    display: block;
    font-family: 'Vazirmatn', 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-muted);
    opacity: 0.6;
    letter-spacing: 0.3px;
    margin-top: 2px;
}

/* بج وضعیت */
.status-badge {
    font-family: 'Vazirmatn', 'Inter', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 1px;
    padding: 4px 10px;
    border: 1px solid;
    text-transform: uppercase;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
}

.status-badge.danger {
    color: #ff5f56;
    border-color: rgba(255, 95, 86, 0.4);
    background: rgba(255, 95, 86, 0.06);
}
.status-badge.warning {
    color: #ffbd2e;
    border-color: rgba(255, 189, 46, 0.4);
    background: rgba(255, 189, 46, 0.06);
}
/* ok — سبز حذف شد، خنثی شد */
.status-badge.ok {
    color: var(--text-muted);
    border-color: rgba(160, 170, 180, 0.35);
    background: rgba(160, 170, 180, 0.05);
}

/* نقطه چشمک‌زن داخل بج */
.status-badge::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    animation: led-pulse 1.5s ease-in-out infinite;
}

/* ====== جزئیات (باز شونده) ====== */
.status-detail {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.status-item.active .status-detail {
    max-height: 400px;
}

.status-detail-inner {
    padding: 0 28px 22px 74px;
    display: flex;
    gap: 16px;
}

/* خط عمودی کنار متن — خنثی (سبز حذف شد) */
.status-detail-inner::before {
    content: '';
    flex: 0 0 auto;
    width: 2px;
    background: rgba(160, 170, 180, 0.45);
    opacity: 0.8;
    align-self: stretch;
    margin-top: 2px;
    border-radius: 1px;
}

.status-item[data-severity="danger"] .status-detail-inner::before { background: #ff5f56; }
.status-item[data-severity="warning"] .status-detail-inner::before { background: #ffbd2e; }

.status-detail .sd-text {
    flex: 1;
    font-size: 0.88rem;
    line-height: 1.85;
    color: var(--text);
    opacity: 0.7;
    margin: 0;
}

.status-detail .sd-time {
    display: block;
    margin-top: 12px;
    font-family: 'Vazirmatn', 'Inter', sans-serif;
    font-size: 0.95rem;
    color: var(--text-muted);
    opacity: 0.7;
    letter-spacing: 0.5px;
}
.status-detail .sd-time::before {
    content: '⏱ ';
    color: var(--text-muted);
    margin-right: 4px;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
    .status-header {
        padding: 14px 18px;
    }
    .status-header .sh-title { font-size: 0.75rem; }
    .status-header .sh-sub { font-size: 0.85rem; }
    .status-header .sh-right { font-size: 0.65rem; }

    .status-row {
        padding: 16px 18px;
        gap: 12px;
    }
    .status-row .sr-name { font-size: 0.88rem; }
    .status-badge { font-size: 0.72rem; padding: 3px 8px; }

    .status-detail-inner {
        padding: 0 18px 18px 46px;
        gap: 12px;
    }
    .status-detail .sd-text { font-size: 0.82rem; line-height: 1.75; }
}

@media (max-width: 480px) {
    .status-section { padding: 45px 0; }

    .status-row {
        padding: 14px 14px;
        flex-wrap: wrap;
    }
    .status-row .sr-name { font-size: 0.85rem; }
    .status-row .sr-server { font-size: 0.78rem; }
    .status-badge { font-size: 0.68rem; padding: 2px 7px; }

    .status-detail-inner {
        padding: 0 14px 16px 32px;
    }
    .status-detail .sd-text { font-size: 0.78rem; }
}

/* ============================================================
   TITLE BLOCK — Responsive
   ============================================================ */
@media (max-width: 768px) {
    .status-title-block {
        padding: 34px 0;
        margin-bottom: 26px;
    }
    .status-title-block h2 { font-size: 1.9rem; }
}

@media (max-width: 480px) {
    .status-title-block {
        padding: 28px 0;
    }
    .status-title-block h2 { letter-spacing: -0.6px; }
    .status-title-block.center p { font-size: 0.82rem; }
}