/* ============================================================
   CALL INTERACTION HISTORY LEDGER — DESKTOP & CORE
   ============================================================ */

/* 1. Ticket Status Badges */
.badge-ticket-open {
    background-color: #fef2f2 !important;
    color: #dc2626 !important;
    border: 1px solid #fecaca !important;
    font-weight: 700;
    font-size: 0.72rem;
    padding: 0.28rem 0.65rem;
    border-radius: 9999px;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.15s ease-in-out;
}

.badge-ticket-open:hover {
    background-color: #fee2e2 !important;
    color: #b91c1c !important;
    border-color: #fca5a5 !important;
}

.badge-ticket-closed {
    background-color: #ecfdf5 !important;
    color: #059669 !important;
    border: 1px solid #a7f3d0 !important;
    font-weight: 700;
    font-size: 0.72rem;
    padding: 0.28rem 0.65rem;
    border-radius: 9999px;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.15s ease-in-out;
}

.badge-ticket-closed:hover {
    background-color: #d1fae5 !important;
    color: #047857 !important;
    border-color: #6ee7b7 !important;
}

/* 2. Filter Inputs & Controls */
.card .form-select-sm,
.card .form-control-sm {
    border-radius: 6px;
    border-color: #cbd5e1;
    font-size: 0.8rem;
}

.card .form-select-sm:focus,
.card .form-control-sm:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* 3. Table Rows & Note Truncation */
.table thead th {
    background-color: #f8fafc;
    color: #64748b;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    white-space: nowrap;
    border-bottom: 1px solid #e2e8f0;
}

.table tbody td {
    vertical-align: middle;
}

.table tbody td .text-truncate {
    display: block;
    max-width: 320px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================================
   RESPONSIVE MOBILE ADAPTATIONS (< 768px)
   ============================================================ */
@media (max-width: 767.98px) {
    /* Header layout */
    .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 a.btn {
        width: 100%;
        text-align: center;
    }

    /* Filter Form Stacking */
    form[action*="call_history"] .col-md-2,
    form[action*="call_history"] .col-md-3,
    form[action*="call_history"] .col-md-1 {
        width: 100% !important;
    }

    form[action*="call_history"] button[type="submit"] {
        padding: 0.45rem;
        margin-top: 0.25rem;
    }

    /* Lateral Table Scrolling */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }

    .table-responsive table {
        min-width: 860px; /* Locks table columns to prevent squishing */
    }

    /* Badges in lists */
    .badge-ticket-open,
    .badge-ticket-closed {
        font-size: 0.68rem;
        padding: 0.2rem 0.5rem;
    }
}