/* ============ TABLE TO CARDS ON SMALL SCREENS ============ */

@media (max-width: 768px) {
    thead th:not(.th-controls) {
        display: none;
    }

    thead th.th-controls {
        display: table-cell;
        border: none;
    }

    table.table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #dee2e6;
        border-radius: .5rem;
        padding: 0.75rem;
    }

    table.table tbody td {
        display: flex;
        justify-content: space-between;
        padding: .25rem .5rem;
        border-bottom: 1px dotted #eee;

        /* --- FIXES --- */
        flex-wrap: wrap;
        word-break: break-word;
        white-space: normal;
    }

    table.table tbody td:last-child {
        border-bottom: none;
    }

    table.table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #555;
        margin-right: .5rem;
    }

    /* Disable the variables that striped mode injects */
    .table-striped {
        --bs-table-striped-bg: transparent !important;
        --bs-table-striped-color: inherit !important;
    }

    .hidden-card-row {
        display: none !important;
    }
}
@media (max-width: 768px) {
    body {
        padding: 0.5rem;
    }
    h2 {
        font-size: 1.4rem;
    }
}

@media (min-width: 768px) {
    .token-cell {
        max-width: 1px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .modal-table-height {
        height: 18.75rem;
        /*overflow-y: auto;*/
    }

    .non-modal-table-height {
        min-height: 18.75rem;
        /*overflow-y: auto;*/
    }
}

.scrollable-modal-body {
    max-height: 65vh;
    overflow-y: auto;
}

@media (max-width: 575.98px) {
    .scrollable-modal-body {
        max-height: 100vh;
        overflow-y: auto;
    }
}

@media (min-width: 576px) and (max-width: 991.98px) {
    .modal-dialog {
        max-width: 90vw !important; /* or 90vw */
        width: auto !important;     /* grow */
        margin: 2rem auto !important;
    }
}

.status-strip {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    align-items: center;
}

.status-dot {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: 0 .3rem 0 0;
    font-size: 1.5rem;
    line-height: 1;
    user-select: none;
}

.status-dot.ok   {
    color: rgba(var(--bs-success-rgb), .8);
}
.status-dot.warn {
    color: rgba(var(--bs-warning-rgb), .8);
}
.status-dot.bad  {
    color: rgba(var(--bs-danger-rgb), .8);
}
.status-dot.neutral  {
    color: rgba(var(--bs-primary-rgb), .8);
}
.status-dot.off  {
    color: rgba(var(--bs-secondary-rgb), .8);
    opacity: .75;
}

.protocol-badge {
    display: inline-flex;
    align-items: center;
    padding: .15rem .45rem;
    border-radius: .4rem;
    font-size: .75rem;
    font-weight: 600;
    border: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    white-space: nowrap;
}

.protocol-badge i {
    font-size: .85rem;
}

/* Optional per-protocol accent */
.proto-http   {
    color: #0d6efd;
}
.proto-https  {
    color: #198754;
}
.proto-ssh    {
    color: #6f42c1;
}
.proto-sftp   {
    color: #6f42c1;
}
.proto-rdp    {
    color: #fd7e14;
}
.proto-vnc    {
    color: #dc3545;
}
.proto-telnet {
    color: #6c757d;
}
.verification-countdown {
    height: 4px;
    width: 100%;
    overflow: hidden;
    border-radius: 999px;
    background-color: rgba(0, 0, 0, 0.12);
}

.verification-countdown-bar {
    height: 100%;
    width: 100%;
    transform-origin: left center;
    animation: verification-countdown-shrink 120s linear forwards;
    background-color: currentColor;
    opacity: 0.65;
}

@keyframes verification-countdown-shrink {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}