/* ============================================================
   HARDWARE & INVENTORY — DESKTOP STYLING (>= 768px)
   ============================================================ */

/* 1. Lifecycle Stage Nav Pills */
.nav-pills .nav-link {
    font-size: 0.86rem;
    padding: 0.45rem 0.95rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background-color: #ffffff;
    color: #475569;
    transition: all 0.15s ease-in-out;
}

.nav-pills .nav-link:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
}

.nav-pills .nav-link.active {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(13, 110, 253, 0.25);
}

.nav-pills .nav-link.active .badge {
    background-color: #ffffff !important;
    color: #0d6efd !important;
}

/* 2. Filter Bar Adjustments */
.card .form-select-sm,
.card .form-control-sm {
    border-radius: 6px;
    border-color: #cbd5e1;
}

.card .form-select-sm:focus,
.card .form-control-sm:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

/* 3. Table Rows & Action Workflow Buttons */
.table thead th {
    background-color: #f8fafc;
    color: #64748b;
    font-size: 0.75rem;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    white-space: nowrap;
    border-bottom: 1px solid #e2e8f0;
}

.table tbody tr {
    transition: background-color 0.15s ease;
}

.table tbody td code {
    font-size: 0.82rem;
    background-color: #f1f5f9;
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
    color: #0f172a;
}

.table .btn-group-sm > .btn {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.55rem;
    border-radius: 6px;
}

.table-danger {
    background-color: #fff5f5 !important;
}

/* ============================================================
   RESPONSIVE MOBILE ADAPTATIONS (< 768px)
   ============================================================ */

@media (max-width: 767.98px) {
    /* 1. Header and Command Buttons Stacking */
    .d-flex.justify-content-between.align-items-center.mb-3 {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.75rem;
    }

    .d-flex.justify-content-between.align-items-center.mb-3 .btn-group {
        display: flex;
        flex-wrap: wrap;
        width: 100%;
    }

    .d-flex.justify-content-between.align-items-center.mb-3 .btn-group > .btn {
        flex: 1 1 calc(50% - 0.25rem);
        font-size: 0.78rem;
        padding: 0.4rem 0.5rem;
        text-align: center;
    }

    /* 2. Lifecycle Pills: Horizontal Touch Scrolling */
    ul.nav-pills.mb-3 {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 6px;
    }

    ul.nav-pills.mb-3 .nav-item {
        white-space: nowrap;
        flex-shrink: 0;
    }

    ul.nav-pills.mb-3 .nav-link {
        font-size: 0.8rem;
        padding: 0.35rem 0.65rem;
    }

    /* 3. Filter Bar Full-Width Stacking */
    form[action*="router_list"] .col-md-2,
    form[action*="router_list"] .col-md-3 {
        width: 100% !important;
    }

    form[action*="router_list"] .d-flex.align-items-end {
        width: 100% !important;
        margin-top: 0.35rem;
    }

    form[action*="router_list"] button[type="submit"],
    form[action*="router_list"] a.btn-outline-secondary {
        flex: 1;
        padding: 0.45rem;
    }

    /* 4. Table Lateral Dragging */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }

    .table-responsive table {
        min-width: 820px; /* Locks table columns to prevent squishing on narrow screens */
    }

    /* 5. Touch Friendly Actions */
    .table .btn-group {
        display: flex;
        gap: 2px;
    }
}