/* =====================================================
       PAGE HEADER
    ===================================================== */

.monitoring-page {
    padding-bottom: 1rem;
}

.page-icon-badge {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    background: linear-gradient(135deg, #0F766E 0%, #14B8A6 100%);
    box-shadow: 0 10px 22px rgba(15, 118, 110, .28);
    flex-shrink: 0;
}

.page-title {
    font-weight: 800;
    letter-spacing: -.4px;
    color: var(--text-main, #0f172a);
    font-size: 1.45rem;
}

.page-subtitle {
    color: var(--text-muted, #64748b);
    font-size: .88rem;
}

/* =====================================================
       BUTTON
    ===================================================== */

.btn-gradient {
    background: linear-gradient(135deg, #0F766E 0%, #14B8A6 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: .85rem;
    padding: .6rem 1.1rem;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    box-shadow: 0 8px 20px rgba(15, 118, 110, .28);
    transition: all .2s ease;
}

.btn-gradient:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(15, 118, 110, .35);
}

.btn-gradient:disabled {
    opacity: .75;
    transform: none;
}

.btn-gradient .bi-arrow-clockwise.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* =====================================================
       MONITOR CARD (KPI)
    ===================================================== */

.monitor-card {
    border: 1px solid rgba(226, 232, 240, .9);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 4px 18px rgba(15, 23, 42, .05);
    transition: all .25s ease;
    position: relative;
    overflow: hidden;
}

.monitor-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.monitor-card.accent-success::before {
    background: #16A34A;
}

.monitor-card.accent-info::before {
    background: #0EA5E9;
}

.monitor-card.accent-primary::before {
    background: #6366F1;
}

.monitor-card.accent-warning::before {
    background: #F59E0B;
}

.monitor-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 32px rgba(15, 23, 42, .10);
}

.monitor-label {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: #94A3B8;
}

.monitor-value {
    font-weight: 800;
    font-size: 1.45rem;
    letter-spacing: -.5px;
    color: #0f172a;
}

.monitor-hint {
    font-size: .74rem;
    color: #94A3B8;
    font-weight: 500;
}

.monitor-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

/* =====================================================
       SUMMARY CARD
    ===================================================== */

.summary-card {
    border: 1px solid rgba(226, 232, 240, .9);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 4px 18px rgba(15, 23, 42, .04);
    transition: all .25s ease;
}

.summary-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 26px rgba(15, 23, 42, .09);
}

.summary-label {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: #94A3B8;
}

.summary-value {
    font-weight: 800;
    font-size: 2rem;
    letter-spacing: -1px;
}

.summary-icon {
    font-size: 2.2rem;
    opacity: .85;
}

/* =====================================================
       TABLE CARD
    ===================================================== */

.table-card {
    border: 1px solid rgba(226, 232, 240, .9);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 18px rgba(15, 23, 42, .05);
    background: #fff;
}

.table-card-header {
    background: #F8FAFC;
    border-bottom: 1px solid #E2E8F0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
}

.table-card-header h5 {
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -.3px;
}

/* =====================================================
       MODEL TABLE
    ===================================================== */

.model-table thead th {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: #64748B;
    background: #F8FAFC;
    border-bottom: 1px solid #E2E8F0;
    padding: .9rem 1.25rem;
    white-space: nowrap;
}

.model-table tbody td {
    padding: 1rem 1.25rem;
    font-size: .88rem;
    color: #334155;
    border-bottom: 1px solid #F1F5F9;
    vertical-align: middle;
}

.model-table tbody tr:last-child td {
    border-bottom: none;
}

.model-table tbody tr:hover {
    background: #F8FAFC;
}

.model-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.05rem;
    flex-shrink: 0;
    box-shadow: 0 6px 14px rgba(15, 23, 42, .12);
}

.model-name {
    font-weight: 700;
    color: #0f172a;
    font-size: .9rem;
}

.category-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 600;
    background: #F1F5F9;
    color: #475569;
    border: 1px solid #E2E8F0;
}

.category-badge .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .4px;
    border: 1px solid transparent;
}

.status-badge .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.status-ready {
    background: #DCFCE7;
    color: #166534;
    border-color: #BBF7D0;
}

.status-ready .dot {
    background: #16A34A;
}

.status-loading {
    background: #FEF3C7;
    color: #92400E;
    border-color: #FDE68A;
}

.status-loading .dot {
    background: #F59E0B;
    animation: pulse 1.2s infinite;
}

.status-error {
    background: #FEE2E2;
    color: #991B1B;
    border-color: #FECACA;
}

.status-error .dot {
    background: #DC2626;
}

.status-unknown {
    background: #F1F5F9;
    color: #475569;
    border-color: #E2E8F0;
}

.status-unknown .dot {
    background: #64748B;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .35;
    }
}

.metric-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: .78rem;
    font-weight: 700;
    background: #EEF2FF;
    color: #4338CA;
    border: 1px solid #E0E7FF;
}

.time-cell {
    font-size: .8rem;
    color: #64748B;
    font-variant-numeric: tabular-nums;
}

/* =====================================================
       INFO CARD
    ===================================================== */

.info-card {
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    padding: 1.1rem;
    background: #fff;
    transition: all .2s ease;
}

.info-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
}

.info-card h6 {
    font-weight: 700;
    margin: .75rem 0 .5rem;
    font-size: .92rem;
}

.info-card ul {
    padding-left: 1.1rem;
    margin: 0;
}

.info-card ul li {
    font-size: .82rem;
    color: #64748B;
    margin-bottom: 3px;
}

.info-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}

.info-success .info-icon {
    background: #DCFCE7;
    color: #16A34A;
}

.info-success h6 {
    color: #166534;
}

.info-danger .info-icon {
    background: #FEE2E2;
    color: #DC2626;
}

.info-danger h6 {
    color: #991B1B;
}

.info-warning .info-icon {
    background: #FEF3C7;
    color: #D97706;
}

.info-warning h6 {
    color: #92400E;
}

.info-primary .info-icon {
    background: #DBEAFE;
    color: #2563EB;
}

.info-primary h6 {
    color: #1E40AF;
}

/* =====================================================
       AUTO REFRESH
    ===================================================== */

.auto-refresh {
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

.auto-refresh-bar {
    height: 5px;
    border-radius: 999px;
    background: #E2E8F0;
    overflow: hidden;
}

.auto-refresh-progress {
    height: 100%;
    width: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #0F766E, #14B8A6);
    transition: width 1s linear;
}

/* =====================================================
    HEADER ACTIONS (tombol + auto refresh)
    ===================================================== */

.header-actions {

    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .55rem;

    min-width: 260px;

}

/* ---------- AUTO REFRESH INFO ---------- */

.auto-refresh-info {

    width: 100%;
    max-width: 260px;

}

.auto-refresh-info .auto-refresh-bar {

    height: 5px;
    border-radius: 999px;
    background: #E2E8F0;
    overflow: hidden;
    margin-bottom: .4rem;

}

.auto-refresh-info .auto-refresh-progress {

    height: 100%;
    width: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #0F766E, #14B8A6);
    transition: width 1s linear;

}

.auto-refresh-text {

    display: flex;
    justify-content: space-between;
    align-items: center;

    font-size: .74rem;
    color: #94A3B8;
    font-weight: 500;

    gap: .5rem;

}

.auto-refresh-text .fw-bold {

    color: #0F766E !important;

}

.auto-refresh-status {

    display: inline-flex;
    align-items: center;
    gap: 4px;

    padding: 2px 8px;
    border-radius: 999px;

    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .3px;

    background: #F1F5F9;
    color: #64748B;
    border: 1px solid #E2E8F0;

    transition: all .25s ease;

}

.auto-refresh-status.is-loading {

    background: #FEF3C7;
    color: #92400E;
    border-color: #FDE68A;

}

/* =====================================================
       DARK MODE
    ===================================================== */

body.dark-mode .monitor-card,
body.dark-mode .summary-card,
body.dark-mode .table-card,
body.dark-mode .info-card {
    background: #1E293B;
    border-color: #334155;
}

body.dark-mode .monitor-card:hover,
body.dark-mode .summary-card:hover,
body.dark-mode .info-card:hover {
    box-shadow: 0 12px 28px rgba(0, 0, 0, .35);
}

body.dark-mode .monitor-value,
body.dark-mode .page-title,
body.dark-mode .model-name,
body.dark-mode .table-card-header h5 {
    color: #F1F5F9;
}

body.dark-mode .table-card-header {
    background: #0F172A;
    border-bottom-color: #334155;
}

body.dark-mode .model-table thead th {
    background: #0F172A;
    color: #94A3B8;
    border-bottom-color: #334155;
}

body.dark-mode .model-table tbody td {
    color: #CBD5E1;
    border-bottom-color: #1E293B;
}

body.dark-mode .model-table tbody tr:hover {
    background: #0F172A;
}

body.dark-mode .category-badge {
    background: #0F172A;
    color: #CBD5E1;
    border-color: #334155;
}

body.dark-mode .auto-refresh-bar {
    background: #334155;
}

/* =====================================================
       RESPONSIVE
    ===================================================== */

@media (max-width: 575.98px) {
    .page-icon-badge {
        width: 46px;
        height: 46px;
        font-size: 1.25rem;
    }

    .page-title {
        font-size: 1.15rem;
    }

    .monitor-value {
        font-size: 1.2rem;
    }

    .summary-value {
        font-size: 1.6rem;
    }

    .model-table tbody td,
    .model-table thead th {
        padding: .75rem .9rem;
    }
}