/* Custom styles for EMAS with SB Admin 2 */

/* ===== PROFILE PAGE CUSTOM STYLES ===== */
/* Profile card enhancements */
.card-body .img-profile {
    transition: transform 0.2s ease-in-out;
}

.card-body .img-profile:hover {
    transform: scale(1.05);
}

/* Upload button enhancement */
.card-body label[for="fileAvatar"] {
    transition: all 0.2s ease-in-out;
}

.card-body label[for="fileAvatar"]:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* User Stats Table Styling */
.card .table-borderless tbody tr {
    transition: all 0.2s ease-in-out;
}

.card .table-borderless tbody tr:hover {
    background-color: rgba(78, 115, 223, 0.05);
    transform: translateX(4px);
}

.card .table-borderless tbody tr td:first-child {
    text-align: center;
}

.card .table-borderless tbody tr td:nth-child(2) {
    padding-left: 0;
}

.card .table-borderless tbody tr td:last-child {
    text-align: right;
    font-weight: 600;
}

/* ===== END PROFILE PAGE STYLES ===== */

/* Password Toggle Button Styling */
.input-group-append .btn-outline-secondary {
    border-color: #d1d3e2;
    color: #6e707e;
    transition: all 0.2s ease-in-out;
}

.input-group-append .btn-outline-secondary:hover {
    background-color: #4e73df;
    border-color: #4e73df;
    color: white;
    transform: scale(1.05);
}

.input-group-append .btn-outline-secondary:focus {
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
}

.input-group-append .btn-outline-secondary .fas {
    transition: all 0.2s ease-in-out;
}

.input-group-append .btn-outline-secondary:hover .fas {
    transform: scale(1.1);
}

/* ===== TENANT INFO PAGE CUSTOM STYLES ===== */
.info-section {
    background: linear-gradient(135deg, #f8f9fc 0%, #ffffff 100%);
    border-radius: 10px;
    padding: 1.5rem;
    border: 1px solid #e3e6f0;
    transition: all 0.3s ease;
}

.info-section:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.info-item {
    transition: all 0.2s ease;
}

.info-item:hover {
    background-color: rgba(78, 115, 223, 0.05);
    border-radius: 8px;
    padding: 0.5rem;
    margin: -0.5rem;
}

.info-value {
    margin-top: 0.5rem;
}

.form-label {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.border-left-primary {
    border-left: 4px solid #4e73df !important;
    transition: all 0.2s ease;
}

.border-left-primary:focus {
    border-left-color: #2e59d9 !important;
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
}

.stats-item {
    transition: all 0.2s ease;
    padding: 0.75rem;
    border-radius: 8px;
}

.stats-item:hover {
    background-color: rgba(40, 167, 69, 0.05);
    transform: translateX(5px);
}

.stats-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.stats-item:hover .stats-icon {
    transform: scale(1.1);
}

.stats-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-value {
    font-size: 1rem;
}

.badge-pill {
    font-size: 0.85rem;
    font-weight: 600;
}

.bg-gradient-success {
    background: linear-gradient(135deg, #1cc88a 0%, #13855c 100%) !important;
}

/* Enhanced form controls */
.input-group-text {
    border: none;
    background-color: #f8f9fc;
    color: #6e707e;
    transition: all 0.2s ease;
}

.input-group:focus-within .input-group-text {
    background-color: #4e73df;
    color: white;
}

/* Card enhancements */
.card {
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

.card-header {
    border-bottom: none;
}

/* Breadcrumb enhancements */
.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: #6e707e;
    font-weight: bold;
}

/* Button enhancements */
.btn-light {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #4e73df;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-light:hover {
    background: white;
    color: #224abe;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* ===== END TENANT INFO PAGE STYLES ===== */

/* Fix modal accessibility issues - Force higher z-index */
.modal-backdrop {
    z-index: 99999 !important;
}

.modal {
    z-index: 100000 !important;
}

/* Override inline styles from Angular UI Bootstrap */
.modal[style*="z-index"] {
    z-index: 100000 !important;
}

.modal-backdrop[style*="z-index"] {
    z-index: 99999 !important;
}

/* Force modal to be visible */
.modal.show {
    display: block !important;
}

/* Ensure modal backdrop is visible */
.modal-backdrop.show {
    opacity: 0.5 !important;
}

/* Ensure modal content is properly focused */
.modal:focus {
    outline: none;
}

/* Prevent background scrolling when modal is open */
body.modal-open {
    overflow: hidden;
}

/* ===== DATE RANGE PICKER CUSTOM STYLES =====-------------------------------------------------------*/

.daterangepicker .drp-buttons {
    clear: both;
    text-align: right;
    padding: 8px;
    border-top: 1px solid #ddd;
    display: block !important;
    line-height: 12px;
    background-color: #f8f9fc;
    white-space: nowrap;
}

/* Specific styling for daterangepicker buttons only */
.daterangepicker .drp-buttons .btn {
    display: inline-block !important;
    margin-left: 8px;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    letter-spacing: 0.5px;
    vertical-align: middle;
    float: none !important;
    white-space: nowrap;
    min-width: 60px;
    text-align: center !important;
    line-height: 1.2 !important;
}

.daterangepicker .drp-buttons .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.daterangepicker .drp-buttons .btn:active {
    transform: translateY(0);
}

/* Cancel button specific styling */
.daterangepicker .drp-buttons .btn.cancelBtn {
    background-color: #e74a3b !important;
    border-color: #e74a3b !important;
    color: #fff !important;
}

.daterangepicker .drp-buttons .btn.cancelBtn:hover {
    background-color: #e02424 !important;
    border-color: #e02424 !important;
    color: #fff !important;
}

.daterangepicker .drp-buttons .btn.cancelBtn:focus {
    box-shadow: 0 0 0 0.2rem rgba(231, 74, 59, 0.25) !important;
}

/* Apply/Select button specific styling */
.daterangepicker .drp-buttons .btn.applyBtn {
    background-color: #4e73df !important;
    border-color: #4e73df !important;
    color: #fff !important;
}

.daterangepicker .drp-buttons .btn.applyBtn:hover {
    background-color: #224abe !important;
    border-color: #224abe !important;
    color: #fff !important;
}

.daterangepicker .drp-buttons .btn.applyBtn:focus {
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25) !important;
}

/* Disabled state for daterangepicker buttons */
.daterangepicker .drp-buttons .btn:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

.daterangepicker .drp-buttons .btn:disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* Responsive styling for daterangepicker buttons */
@media (max-width: 576px) {
    .daterangepicker .drp-buttons {
        text-align: center;
        padding: 12px 8px;
        white-space: normal;
    }
    
    .daterangepicker .drp-buttons .btn {
        margin: 0 4px;
        font-size: 11px;
        padding: 8px 16px;
        min-width: 80px;
        display: inline-block !important;
    }
}

/* ===== CUSTOM TABLE STYLES ===== -------------------------------------------------------*/
.bg-red {
    background: linear-gradient(135deg, #e04a32 0%, #c0392b 100%) !important;
    color: #fff !important;
}
.bg-yellow {
    background: linear-gradient(135deg, #f4b942 0%, #e09c10 100%) !important;
    color: #fff !important;
}
.bg-light-blue {
    background: linear-gradient(135deg, #4a9fdc 0%, #357ab8 100%) !important;
    color: #fff !important;
}
.bg-green {
    background: linear-gradient(135deg, #19b86a 0%, #009150 100%) !important;
    color: #fff !important;
}
.bg-gray {
    background: linear-gradient(135deg, #d2d6de 0%, #b0b3b8 100%) !important;
    color: #000 !important;
}

.modal-dialog {
    margin: 1.75rem auto !important;
    max-width: 90% !important;
}

.text-color-normal {
    color: #000 !important;
}

/* Tenant Logo Modal - Smaller width */
.tenant-logo-modal .modal-dialog {
    max-width: 30vw !important;
    width: 100%;
}
.popup-30vw .modal-dialog {
    max-width: 30vw !important;
    width: 100%;
}

.popup-50vw .modal-dialog {
    max-width: 50vw !important;
    width: 100%;
}

/* Ensure modal content is visible */
.modal-content {
    background-color: #fff !important;
    border: 1px solid rgba(0, 0, 0, 0.2) !important;
    border-radius: 0.3rem !important;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Background images for login pages */
.bg-login-image {
    background: url('https://source.unsplash.com/K4mSJ7kc0As/600x800');
    background-position: center;
    background-size: cover;
}

.bg-register-image {
    background: url('https://source.unsplash.com/Mv9hjnEUHR4/600x800');
    background-position: center;
    background-size: cover;
}

.bg-password-image {
    background: url('https://source.unsplash.com/oWTW-jNGl9I/600x800');
    background-position: center;
    background-size: cover;
}

/* Override SB Admin 2 styles for better EMAS integration */
.sidebar-brand-icon i {
    color: #fff;
}

/* Custom button styles */
.btn-link {
    text-decoration: none;
}

.btn-link:hover {
    text-decoration: none;
}

/* Custom table styles */
.table th {
    background-color: #f8f9fc;
    border-color: #e3e6f0;
    font-weight: 600;
    color: #000;
}

.table td {
    border-color: #e3e6f0;
    vertical-align: middle;
    color: #000;
}

/* Custom form styles */
.form-control:focus {
    border-color: #4e73df;
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
}

/* Custom card styles */
.card {
    border: none;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

.card-header {
    background-color: #f8f9fc;
    border-bottom: 1px solid #e3e6f0;
}

/* Custom pagination styles */
.pagination .page-link {
    color: #4e73df;
    border-color: #e3e6f0;
}

.pagination .page-item.active .page-link {
    background-color: #4e73df;
    border-color: #4e73df;
}

.pagination .page-item.disabled .page-link {
    color: #858796;
    border-color: #e3e6f0;
}

/* Custom badge styles */
.badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.375rem 0.375rem;
}

/* Custom loading styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #4e73df;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Custom modal styles */
.modal-header {
    background-color: #f8f9fc;
    border-bottom: 1px solid #e3e6f0;
}

.modal-title {
    color: #ffffff !important;
    font-weight: 600;
}

/* Custom alert styles */
.alert {
    border: none;
    border-radius: 0.35rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* Custom dropdown styles */
.dropdown-menu {
    border: none;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

.dropdown-item:hover {
    background-color: #f8f9fc;
}

/* Custom input group styles */
.input-group-text {
    background-color: #f8f9fc;
    border-color: #e3e6f0;
    color: #000;
}

/* Custom breadcrumb styles */
.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin-bottom: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    color: #000;
}

/* Custom sidebar styles */
.sidebar .nav-item .nav-link {
    color: rgba(255, 255, 255, 1);
    font-weight: 500;
    padding: 16px 5px;
}

.sidebar .nav-item .nav-link:hover {
    color: #fff;
}

.sidebar .nav-item.active .nav-link {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

/* Sidebar heading - prevent wrap */
.sidebar .sidebar-heading {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

/* Sidebar divider - Full width */
.sidebar .sidebar-divider {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
}

/* Sidebar brand - prevent wrap */
.sidebar .sidebar-brand {
    white-space: nowrap;
    overflow: hidden;
    min-height: 70px;
}

.sidebar .sidebar-brand-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== SIDEBAR COLLAPSE MENU - ACCORDION STYLE ===== */

/* Nav link with collapse - parent item */
.sidebar .nav-item .nav-link {
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    gap: 0.5rem;
}

.sidebar .nav-item .nav-link > i:first-child {
    flex-shrink: 0;
    width: 1.5rem;
    text-align: center;
}

.sidebar .nav-item .nav-link > span {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar .nav-item .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Chevron icon */
.sidebar .nav-item .nav-link .fa-chevron-down {
    transition: transform 0.3s ease;
    margin-left: auto;
    font-size: 0.75rem;
    flex-shrink: 0;
    width: 1rem;
    text-align: center;
}

.sidebar .nav-item .nav-link .fa-chevron-down.fa-rotate-180 {
    transform: rotate(180deg);
}

/* Ensure nav link icon alignment */
.sidebar .nav-item .nav-link .fas,
.sidebar .nav-item .nav-link .far,
.sidebar .nav-item .nav-link .fab {
    flex-shrink: 0;
}

/* Collapse container - MUST be inline, not absolute! */
.sidebar .collapse {
    display: none;
    position: relative !important;
    width: 100% !important;
    left: auto !important;
    top: auto !important;
    background-color: rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease-in-out;
    overflow: hidden;
}

.sidebar .collapse.show {
    display: block !important;
    animation: slideDown 0.3s ease-out;
}

/* Slide down animation */
@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        max-height: 1000px;
        transform: translateY(0);
    }
}

/* Override CSS gốc: margin: 0 1rem → margin: 0 */
.sidebar .nav-item .collapse,
.sidebar .nav-item .collapsing {
    margin: 0 !important;
}

/* Collapse inner wrapper - REMOVE white background! */
.sidebar .collapse-inner {
    background-color: transparent !important;
    position: relative !important;
    width: 100% !important;
    padding: 0.5rem 0;
    margin: 0 !important;
    border-left: none !important;
    overflow: hidden !important; /* Ngăn menu con tràn ra ngoài khi hover */
    /* padding-left: 1rem; */
}

/* Force remove bg-white class on sidebar collapse */
.sidebar .collapse-inner.bg-white {
    background-color: transparent !important;
    background: transparent !important;
}

/* Remove rounded that might cause positioning issues */
.sidebar .collapse-inner.rounded {
    border-radius: 0 !important;
}

/* Collapse header - BRIGHTER for better visibility */
.sidebar .collapse-header {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.5rem 1rem;
    margin-bottom: 0.25rem;
}

/* Collapse items - menu items inside - BRIGHTER COLORS like mobile */
/* Override CSS gốc: padding: .5rem 1rem → padding: 16px 5px 16px 10px (thụt vào trái một chút) */
.sidebar .collapse-item {
    display: flex;
    align-items: center;
    padding: 16px 5px 16px 10px !important; /* Padding: top 16px, right 5px, bottom 16px, left 10px (thụt vào trái) */
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    border-radius: 0.35rem;
    transition: all 0.2s ease;
    position: relative;
    width: calc(100% - 20px) !important; /* Trừ 20px để thụt đều cả 2 bên */
    margin: 0 10px !important; /* Margin trái/phải 10px mỗi bên để thụt đều */
    font-weight: 400;
    box-sizing: border-box !important; /* Đảm bảo padding được tính trong width */
}

.sidebar .collapse-item:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    transform: translateX(3px);
}

.sidebar .collapse-item.active {
    background-color: rgba(139, 172, 255, 0.4);
    color: white;
    font-weight: 600;
    border-left: none !important;
    padding-left: 10px !important; /* Giữ padding-left 10px để thụt vào trái */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.sidebar .collapse-item i {
    /* margin-right: 0.65rem; */
    width: 1.2rem;
    text-align: center;
    font-size: 0.9rem;
}

.sidebar .collapse-item span {
    flex: 1;
    line-height: 1.3;
}

/* Active menu item styling */
.sidebar .nav-item.active > .nav-link {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: 600;
}

/* Hover effects for menu items */
.sidebar .nav-item .nav-link:hover .fa-chevron-down {
    transform: translateY(1px);
}

/* Custom topbar styles */
.topbar .navbar-search .form-control {
    background-color: #f8f9fc;
    border-color: #e3e6f0;
}

.topbar .navbar-search .form-control:focus {
    background-color: #fff;
}

/* Custom footer styles */
.sticky-footer {
    background-color: #fff;
    border-top: 1px solid #e3e6f0;
}

/* Custom scrollbar styles */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Custom responsive styles */
@media (max-width: 768px) {
    .card-header .d-flex {
        flex-direction: column;
        align-items: stretch;
    }
    
    .card-header .d-flex > div {
        margin-bottom: 0.5rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
}

/* Custom utility classes */
.text-success {
    color: #1cc88a !important;
}

.text-warning {
    color: #f6c23e !important;
}

.text-danger {
    color: #e74a3b !important;
}

.text-info {
    color: #36b9cc !important;
}

.bg-primary {
    background-color: #196BB4 !important;
}

.bg-success {
    background-color: #1cc88a !important;
}

.bg-warning {
    background-color: #f6c23e !important;
}

.bg-danger {
    background-color: #e74a3b !important;
}

.bg-info {
    background-color: #36b9cc !important;
}

/* Custom animation classes */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Custom print styles */
@media print {
    .sidebar,
    .topbar,
    .sticky-footer,
    .btn,
    .pagination {
        display: none !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
    
    .table {
        border-collapse: collapse !important;
    }
    
    .table th,
    .table td {
        border: 1px solid #ddd !important;
    }
}

/* Chart.js Styles for Enhanced Dashboard */
.chart-area {
    position: relative;
    height: 300px;
    width: 100%;
}

.chart-bar {
    position: relative;
    height: 300px;
    width: 100%;
}

.chart-pie {
    position: relative;
    height: 300px;
    width: 100%;
}

.chart-area canvas {
    max-height: 100%;
}

.chart-area .chart-area {
    position: relative;
    height: 100%;
    width: 100%;
}

.card-body .chart-area {
    min-height: 230px;
}

.chart-area .text-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.chart-area canvas {
    max-height: 100% !important;
}

.chart-area .chart {
    height: 100% !important;
}

.chart-area .chart.chart-area {
    height: 100% !important;
}

.chart-area .chart.chart-area canvas {
    height: 100% !important;
}

.chart-area .chart.chart-area canvas[height] {
    height: 100% !important;
}

.chart-area .chart.chart-area canvas[height="230"] {
    height: 100% !important;
}

/* ===== PAGINATION FRAMEWORK FOR SB ADMIN 2 ===== */
/* Framework for uib-pagination compatibility with SB Admin 2 */

/* Main pagination container -----------------------------------------------------------------*/
.pagination {
    display: flex;
    padding-left: 0;
    list-style: none;
    border-radius: 0;
    margin: 0;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
}

/* Pagination items */
.pagination > li {
    display: inline-block;
}

/* Pagination links - Circular design */
.pagination > li > a,
.pagination > li > span {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    margin: 0;
    line-height: 1;
    color: #000;
    background-color: #fff;
    border: 1px solid #e3e6f0;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
    font-weight: 500;
    font-size: 0.875rem;
    min-width: 2.5rem;
}

/* First item styling */
.pagination > li:first-child > a,
.pagination > li:first-child > span {
    border-radius: 50%;
}

/* Last item styling */
.pagination > li:last-child > a,
.pagination > li:last-child > span {
    border-radius: 50%;
}

/* Hover effects */
.pagination > li > a:hover,
.pagination > li > span:hover {
    z-index: 2;
    color: #4e73df;
    background-color: #f8f9fc;
    border-color: #4e73df;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(78, 115, 223, 0.15);
}

/* Focus effects */
.pagination > li > a:focus,
.pagination > li > span:focus {
    z-index: 3;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
}

/* Active state - Blue circular button */
.pagination > .active > a,
.pagination > .active > span,
.pagination > .active > a:hover,
.pagination > .active > span:hover,
.pagination > .active > a:focus,
.pagination > .active > span:focus {
    z-index: 3;
    color: #fff;
    background-color: #196BB4;
    border-color: #196BB4;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(78, 115, 223, 0.3);
    transform: translateY(-2px);
}

/* Disabled state */
.pagination > .disabled > span,
.pagination > .disabled > span:hover,
.pagination > .disabled > span:focus,
.pagination > .disabled > a,
.pagination > .disabled > a:hover,
.pagination > .disabled > a:focus {
    color: #000;
    pointer-events: none;
    background-color: #f8f9fc;
    border-color: #e3e6f0;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}

/* Small pagination */
.pagination-sm > li > a,
.pagination-sm > li > span {
    width: 2rem;
    height: 2rem;
    min-width: 2rem;
    font-size: 0.75rem;
}

/* Large pagination */
.pagination-lg > li > a,
.pagination-lg > li > span {
    width: 3rem;
    height: 3rem;
    min-width: 3rem;
    font-size: 1rem;
}

/* Pagination info text styling */
.pagination-info {
    color: #000;
    font-size: 0.875rem;
    margin: 0;
}

.pagination-info p {
    margin: 0;
    font-weight: 500;
}

/* Pagination container with flexbox */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding: 1rem 2rem;
    border-top: 1px solid #e3e6f0;
}

.pagination-container .pagination-info {
    flex: 1;
}

.pagination-container .pagination-wrapper {
    flex: 0 0 auto;
}

/* Pagination wrapper for better alignment */
.pagination-wrapper {
    display: flex;
    align-items: center;
}

/* Responsive pagination */
@media (max-width: 768px) {
    .pagination-container {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        text-align: center;
    }
    
    .pagination-container .pagination-info {
        order: 2;
    }
    
    .pagination-container .pagination-wrapper {
        order: 1;
        justify-content: center;
    }
    
    .pagination {
        gap: 0.25rem;
    }
    
    .pagination > li > a,
    .pagination > li > span {
        width: 2.25rem;
        height: 2.25rem;
        min-width: 2.25rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.2rem;
    }
    
    .pagination > li > a,
    .pagination > li > span {
        width: 2rem;
        height: 2rem;
        min-width: 2rem;
        font-size: 0.75rem;
    }
    
    .pagination-info {
        font-size: 0.8rem;
    }
}

/* Top tabs (Summary | Call n) – subtle underline indicator */
.top-tabs-modern .nav-tabs {
    border-bottom: none;
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;              /* keep tabs on one line */
    overflow-x: auto;               /* enable horizontal scroll */
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch; /* smooth scroll on mobile */
    scrollbar-width: thin;          /* firefox */
}

.top-tabs-modern .nav-tabs > li {
    flex: 0 0 auto;                 /* prevent shrinking so scrolling works */
}

.top-tabs-modern .nav-tabs > li > a {
    color: #3358d4;
    font-weight: 600;
    padding: 8px 16px;
    border: 1px solid transparent !important;
    border-radius: 999px !important;
    background: rgba(78, 115, 223, 0.08);
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.top-tabs-modern .nav-tabs > li > a:hover {
    background: rgba(78, 115, 223, 0.14);
    color: #224abe;
}

.top-tabs-modern .nav-tabs > li.active > a,
.top-tabs-modern .nav-tabs > li.active > a:focus,
.top-tabs-modern .nav-tabs > li.active > a:hover {
    color: #fff !important;
    border: 1px solid transparent !important;
    background: linear-gradient(135deg, #4e73df 0%, #224abe 100%) !important;
    box-shadow: 0 6px 14px rgba(34, 74, 190, 0.25);
}

.top-tabs-modern .nav-tabs > li.active {
    position: relative;
}

.top-tabs-modern .nav-tabs > li.active::after {
    display: none;
}

/* Background container to make the tab strip pop out */
.top-tabs-modern {
    background: linear-gradient(135deg, #f8faff 0%, #eef3ff 100%);
    border: 1px solid #e3e6f0;
    border-radius: 8px;
    padding: 10px 12px 4px 12px;
    box-shadow: 0 6px 18px rgba(28, 28, 51, 0.06);
    margin-bottom: 12px;
}

/* Optional: style the horizontal scrollbar for the tab row */
.top-tabs-modern .nav-tabs::-webkit-scrollbar { height: 6px; }
.top-tabs-modern .nav-tabs::-webkit-scrollbar-track { background: transparent; }
.top-tabs-modern .nav-tabs::-webkit-scrollbar-thumb {
    background: rgba(78, 115, 223, 0.3);
    border-radius: 6px;
}

/* Custom pagination icons for better UX */
.pagination > li > a[aria-label="Previous"],
.pagination > li > span[aria-label="Previous"] {
    position: relative;
}

.pagination > li > a[aria-label="Next"],
.pagination > li > span[aria-label="Next"] {
    position: relative;
}

/* Ellipsis styling */
.pagination > li > a[aria-label="..."],
.pagination > li > span[aria-label="..."] {
    color: #000;
    background-color: #f8f9fc;
    border-color: #e3e6f0;
    cursor: default;
    font-weight: 600;
    font-size: 0.75rem;
}

.pagination > li > a[aria-label="..."]:hover,
.pagination > li > span[aria-label="..."]:hover {
    background-color: #f8f9fc;
    border-color: #e3e6f0;
    color: #000;
    transform: none;
    box-shadow: none;
}

/* Animation for pagination transitions */
.pagination > li > a,
.pagination > li > span {
    transition: all 0.2s ease-in-out;
}

/* Focus ring for accessibility */
.pagination > li > a:focus-visible,
.pagination > li > span:focus-visible {
    outline: 2px solid #4e73df;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .pagination > li > a,
    .pagination > li > span {
        border-width: 2px;
    }
    
    .pagination > .active > a,
    .pagination > .active > span {
        border-width: 3px;
    }
}

/* ==========================
   CUSTOM BUTTON STYLES
   ========================== */

/* Logo Button - Custom Style */
.btn-logo-custom {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important; /* Green gradient */
    border: none;
    border-radius: 8px;
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-logo-custom::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-logo-custom:hover {
    background: linear-gradient(135deg, #20c997 0%, #17a2b8 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.4);
}

.btn-logo-custom:hover::before {
    left: 100%;
}

.btn-logo-custom:focus {
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.5);
}

.btn-logo-custom:disabled {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%) !important;
    transform: none;
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
    cursor: not-allowed;
}

.btn-logo-custom:disabled::before {
    display: none;
}

/* Edit Button - Custom Style */
.btn-edit-custom {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%) !important; /* Yellow gradient */
    border: none;
    border-radius: 8px;
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-edit-custom::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-edit-custom:hover {
    background: linear-gradient(135deg, #e0a800 0%, #d39e00 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 193, 7, 0.4);
}

.btn-edit-custom:hover::before {
    left: 100%;
}

.btn-edit-custom:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.5);
}

.btn-edit-custom:disabled {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%) !important;
    transform: none;
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
    cursor: not-allowed;
}

.btn-edit-custom:disabled::before {
    display: none;
}

/* Delete Button - Custom Style */
.btn-delete-custom {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important; /* Red gradient */
    border: none;
    border-radius: 8px;
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-delete-custom::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-delete-custom:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(220, 53, 69, 0.4);
}

.btn-delete-custom:hover::before {
    left: 100%;
}

.btn-delete-custom:focus {
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.5);
}

.btn-delete-custom:disabled {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%) !important;
    transform: none;
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
    cursor: not-allowed;
}

.btn-delete-custom:disabled::before {
    display: none;
}

/* View Button - Custom Style */
.btn-view-custom {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%) !important;
    border: none;
    border-radius: 8px;
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(116, 185, 255, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-view-custom::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-view-custom:hover {
    background: linear-gradient(135deg, #0984e3 0%, #0652dd 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(116, 185, 255, 0.4);
}

.btn-view-custom:hover::before {
    left: 100%;
}

.btn-view-custom:focus {
    box-shadow: 0 0 0 0.2rem rgba(116, 185, 255, 0.5);
}

.btn-view-custom:disabled {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%) !important;
    transform: none;
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
    cursor: not-allowed;
}

.btn-view-custom:disabled::before {
    display: none;
}

/* ==========================
   Monitor - Call Process styling
   ========================== */
.monitor-call-process-header h1 {
    font-weight: 700;
    letter-spacing: 0.2px;
}

/* Align header controls fully to the right */
.monitor-call-process-header .text-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.monitor-call-process-header .text-right .form-inline {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    gap: 10px;
}

.monitor-call-process-header .btn {
    white-space: nowrap;
}

.monitor-call-process #drpTime.btn {
    border: none;
    border-radius: 10px;
    padding: 10px 14px;
    font-weight: 600;
    background: linear-gradient(135deg, #f6c23e 0%, #e0a800 100%) !important;
    color: #1f2d3d;
    box-shadow: 0 6px 14px rgba(246, 194, 62, 0.35);
}

.monitor-call-process #drpTime.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(224, 168, 0, 0.4);
}

.monitor-call-process .btn.btn-success {
    border: none;
    border-radius: 10px;
    padding: 10px 16px;
    font-weight: 700;
    letter-spacing: 0.3px;
    background: linear-gradient(135deg, #1cc88a 0%, #13855c 100%) !important;
    box-shadow: 0 8px 18px rgba(28, 200, 138, 0.35);
}

.monitor-call-process .btn.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(28, 200, 138, 0.45);
}

/* Table overrides using modern framework */
.monitor-call-process .table-modern thead th {
    font-size: 0.8rem;
}

.monitor-call-process .table-modern tbody td,
.monitor-call-process .table-modern thead th {
    text-align: center;
}

.monitor-call-process .table-modern tbody tr:hover {
    transform: translateY(-1px);
}

.monitor-call-process .table-modern td a {
    color: #4e73df;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.15s ease, transform 0.15s ease;
    display: inline-block;
}

.monitor-call-process .table-modern td a:hover {
    color: #224abe;
    transform: translateY(-1px);
}

.monitor-call-process .table-modern tbody td:first-child span {
    font-weight: 600;
}

@media (max-width: 768px) {
    .monitor-call-process .table-modern thead th,
    .monitor-call-process .table-modern td {
        padding: 10px 8px;
        font-size: 0.8rem;
    }
    .monitor-call-process #drpTime.btn,
    .monitor-call-process .btn.btn-success {
        padding: 8px 12px;
        border-radius: 8px;
    }
}

/* Loading state for pagination */
.pagination.loading {
    opacity: 0.6;
    pointer-events: none;
}

.pagination.loading > li > a,
.pagination.loading > li > span {
    cursor: wait;
}

/* Success state for pagination (optional) */
.pagination-success > .active > a,
.pagination-success > .active > span {
    background-color: #1cc88a;
    border-color: #1cc88a;
}

/* Warning state for pagination (optional) */
.pagination-warning > .active > a,
.pagination-warning > .active > span {
    background-color: #f6c23e;
    border-color: #f6c23e;
    color: #fff;
}

/* Danger state for pagination (optional) */
.pagination-danger > .active > a,
.pagination-danger > .active > span {
    background-color: #e74a3b;
    border-color: #e74a3b;
}

/* Info state for pagination (optional) */
.pagination-info > .active > a,
.pagination-info > .active > span {
    background-color: #36b9cc;
    border-color: #36b9cc;
}

/* ===== MODERN TABLE FRAMEWORK FOR SB ADMIN 2 ===== */
/* Enhanced table styling for better visual appeal */

/* Modern table container ------------------------------------------------------*/
.table-modern {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

/* Table header styling */
.table-modern thead th {
    background: #196BB4;
    color: #fff;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.75rem 0.75rem;
    border: none;
    position: relative;
    white-space: nowrap;
    border-right: 2px solid #e3e6f0;
}

/* Table body styling */
.table-modern tbody tr {
    transition: all 0.2s ease-in-out;
    border-bottom: 1px solid #f8f9fc;
}

.table-modern tbody tr:hover {
    background-color: #f8f9fc;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.table-modern tbody tr:last-child {
    border-bottom: none;
}

/* Table cells */
.table-modern td {
    vertical-align: middle;
    border: none;
    color: #000;
    font-size: 0.875rem;
    line-height: 1.4;
}

/* Alternating row colors */
.table-modern tbody tr:nth-child(even) {
    background-color: #fafbfc;
}

.table-modern tbody tr:nth-child(even):hover {
    background-color: #f0f2f5;
}

/* Modern badge styling for level indicators */
.badge-modern {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background-color: #e3e6f0;
    color: #000;
    font-size: 0.75rem;
    font-weight: 600;
    margin: 0 0.25rem;
    border: 1px solid #d1d3e2;
    transition: all 0.2s ease-in-out;
}

/* Level text styling */
.level-text {
    color: #000;
    font-size: 0.8rem;
    font-weight: 500;
    margin: 0 0.25rem;
}

.level-value {
    color: #4e73df;
    font-weight: 600;
    font-size: 0.85rem;
    margin: 0 0.25rem;
}

/* Modern action buttons */
.btn-action {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 0.125rem;
    transition: all 0.2s ease-in-out;
    font-size: 0.875rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-action:active {
    transform: translateY(0);
}

.btn-action.btn-edit {
    background-color: #f6c23e;
    color: #fff;
}

.btn-action.btn-edit:hover {
    background-color: #f4b619;
}

.btn-action.btn-view {
    background-color: #36b9cc;
    color: #fff;
}

.btn-action.btn-view:hover {
    background-color: #2c9faf;
}

.btn-action.btn-delete {
    background-color: #e74a3b;
    color: #fff;
}

.btn-action.btn-delete:hover {
    background-color: #e02424;
}

/* Table responsive improvements - moved to line 5045+ for better control */
/* .table-responsive {
    overflow: hidden;
} */

/* Card improvements */
.card-modern {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    overflow: hidden;
}

.card-modern .card-header {
    background: linear-gradient(135deg, #f8f9fc 0%, #e3e6f0 100%);
    border-bottom: 1px solid #e3e6f0;
    padding: 1rem 1.5rem;
}

.card-modern .card-body {
    padding: 1.5rem;
}

/* Loading state for table */
.table-loading {
    opacity: 0.6;
    pointer-events: none;
}

.table-loading tbody tr {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Empty state styling */
.table-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #000;
}

.table-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Mobile responsive improvements */
@media (max-width: 768px) {
    .table-modern thead th,
    .table-modern td {
        padding: 0.75rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .btn-action {
        width: 2rem;
        height: 2rem;
        font-size: 0.8rem;
    }
    
    .badge-modern {
        width: 1.25rem;
        height: 1.25rem;
        font-size: 0.7rem;
    }
}

@media (max-width: 576px) {
    .table-modern thead th,
    .table-modern td {
        padding: 0.5rem 0.25rem;
        font-size: 0.75rem;
    }
    
    .btn-action {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 0.75rem;
        margin: 0 0.0625rem;
    }
    
    .level-text,
    .level-value {
        font-size: 0.75rem;
    }
}

/* Focus states for accessibility */
.table-modern tbody tr:focus-within {
    outline: 2px solid #4e73df;
    outline-offset: -2px;
}

.btn-action:focus {
    outline: 2px solid #4e73df;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .table-modern thead th {
        background: #000;
        color: #fff;
    }
    
    .table-modern tbody tr {
        border-bottom: 2px solid #000;
    }
    
    .btn-action {
        border: 2px solid currentColor;
    }
}

/* ===== MODERN RESPONSIVE SIDEBAR LAYOUT ===== */
html, body {
    height: 100%;
    overflow-x: hidden;
}

#wrapper {
    min-height: 100vh;
    position: relative;
}

/* ===== SIDEBAR BASE STYLES ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 14rem;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1050;
    transition: transform 0.3s ease-in-out, left 0.3s ease-in-out;
    background: linear-gradient(180deg, #196BB4 0%, #196BB4 100%);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.15);
}

/* Smooth scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* ===== CONTENT WRAPPER ===== */
#content-wrapper {
    margin-left: 14rem;
    min-height: 100vh;
    transition: margin-left 0.3s ease-in-out;
    width: calc(100% - 14rem);
}

/* ===== TOPBAR STICKY ===== */
.topbar {
    position: sticky !important;
    top: 0;
    z-index: 1030;
    background-color: #fff;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

/* ===== SIDEBAR COLLAPSED STATE (Desktop ONLY - > 768px) ===== */
/* THU NHỎ MENU (Desktop) - VẪN CÓ TEXT + MENU CON POPUP BÊN CẠNH */

@media (min-width: 769px) {
    /* Sidebar BÉ HƠN NỮA khi collapsed - CHỈ 5.5rem */
    body.sidebar-toggled .sidebar {
        width: 5.5rem !important;
    }

    body.sidebar-toggled #content-wrapper {
        margin-left: 5.5rem !important;
        width: calc(100% - 5.5rem) !important;
    }

    /* Menu items - Layout dọc, TEXT XUỐNG DÒNG */
    body.sidebar-toggled .sidebar .nav-item .nav-link {
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0.5rem 0.25rem !important;
        font-size: 0.65rem !important;
        gap: 0.2rem !important;
        white-space: normal !important;
        overflow: hidden !important;
        text-align: center !important;
        min-height: 3.5rem !important;
        line-height: 1.1 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Menu text - XUỐNG DÒNG, căn giữa */
    body.sidebar-toggled .sidebar .nav-item .nav-link span {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        word-wrap: break-word !important;
        word-break: break-word !important;
        white-space: normal !important;
        overflow: hidden !important;
        text-align: center !important;
        line-height: 1.1 !important;
        hyphens: auto !important;
        box-sizing: border-box !important;
    }
    
    /* Icons - ở trên cùng */
    body.sidebar-toggled .sidebar .nav-item .nav-link > i:first-child {
        display: block !important;
        width: 100% !important;
        margin: 0 0 0.25rem 0 !important;
        font-size: 1.1rem !important;
        text-align: center !important;
    }
    
    /* Chevron - ẨN đi */
    body.sidebar-toggled .sidebar .nav-item .nav-link .fa-chevron-down {
        display: none !important;
    }
    
    /* Logo "F88" - CHỈ HIỆN ICON, ẨN TEXT */
    body.sidebar-toggled .sidebar .sidebar-brand {
        padding: 1rem 0 !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }
    
    body.sidebar-toggled .sidebar .sidebar-brand-text,
    body.sidebar-toggled .sidebar .mx-3 {
        display: none !important;
    }
    
    body.sidebar-toggled .sidebar .sidebar-brand-icon {
        display: block !important;
        margin: 0 !important;
    }
    
    /* Tiêu đề heading "QUẢN LÝ DANH MỤC..." - ẨN HẾT */
    body.sidebar-toggled .sidebar .sidebar-heading {
        display: none !important;
    }
    
    /* Dividers - Full width */
    body.sidebar-toggled .sidebar .sidebar-divider {
        margin: 0.3rem 0 !important;
        width: 100% !important;
    }
    
    /* ===== MENU CON POPUP BÊN CẠNH (FLYOUT STYLE - CLICK TO SHOW) ===== */
    /* When sidebar is collapsed, sub-menus popup on CLICK */
    
    /* Parent menu item with sub-menu */
    body.sidebar-toggled .sidebar .nav-item {
        position: relative;
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }
    
    /* Hide accordion-style collapse by default */
    body.sidebar-toggled .sidebar .collapse {
        display: none !important;
    }
    
    /* Show flyout when nav-item has 'flyout-open' class (added by JavaScript) */
    body.sidebar-toggled .sidebar .nav-item.flyout-open .collapse {
        display: block !important;
        position: fixed !important;
        left: 6.5rem !important; /* Xuất hiện bên phải sidebar */
        top: auto !important; /* Sẽ được tính toán bởi JavaScript để căn giữa */
        width: 16rem !important;
        background: white !important;
        box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.3) !important;
        border-radius: 0.5rem !important;
        border: 1px solid #e3e6f0 !important;
        z-index: 1060 !important;
        margin: 0 !important;
        padding: 0.5rem 0 !important;
        animation: flyoutSlide 0.2s ease-out !important;
        transform: translateY(-50%) !important; /* Căn giữa theo chiều dọc */
    }
    
    /* Flyout animation */
    @keyframes flyoutSlide {
        from {
            opacity: 0;
            transform: translateX(-15px);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }
    
    /* Flyout inner wrapper - WHITE background */
    body.sidebar-toggled .sidebar .nav-item.flyout-open .collapse-inner {
        background: white !important;
        border-left: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* Flyout header - Blue color */
    body.sidebar-toggled .sidebar .nav-item.flyout-open .collapse-header {
        color: #4e73df !important;
        background: linear-gradient(135deg, #f8f9fc 0%, #eef2ff 100%) !important;
        font-size: 0.75rem !important;
        font-weight: 600 !important;
        padding: 0.6rem 1rem !important;
        margin-bottom: 0 !important;
        /* border-bottom: 2px solid #e3e6f0 !important; */
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
    }
    
    /* Flyout menu items - Dark text on white */
    body.sidebar-toggled .sidebar .nav-item.flyout-open .collapse-item {
        color: #5a5c69 !important;
        background: white !important;
        padding: 0.7rem 1rem !important;
        margin: 0.2rem 0.5rem !important;
        border-radius: 0.4rem !important;
        display: flex !important;
        align-items: center !important;
        font-size: 0.875rem !important;
        font-weight: 500 !important;
        transition: all 0.2s ease !important;
    }
    
    /* Flyout item hover */
    body.sidebar-toggled .sidebar .nav-item.flyout-open .collapse-item:hover {
        background-color: #f8f9fc !important;
        color: #196BB4 !important;
        transform: translateX(3px) !important;
    }
    
    /* Flyout item active */
    body.sidebar-toggled .sidebar .nav-item.flyout-open .collapse-item.active {
        background-color: #196BB4 !important;
        color: white !important;
        font-weight: 600 !important;
        box-shadow: 0 2px 8px rgba(78, 115, 223, 0.3) !important;
    }
    
    /* Flyout item icons */
    body.sidebar-toggled .sidebar .nav-item.flyout-open .collapse-item i {
        color: inherit !important;
        margin-right: 0.75rem !important;
        width: 1.25rem !important;
        font-size: 0.9rem !important;
        text-align: center !important;
    }
    
    /* Highlight parent menu when flyout is open */
    body.sidebar-toggled .sidebar .nav-item.flyout-open > .nav-link {
        background-color: rgba(255, 255, 255, 0.15) !important;
    }
}

/* ===== MOBILE BACKDROP OVERLAY ===== */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
}

.sidebar-backdrop.show {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

/* ===== MOBILE RESPONSIVE (< 768px) ===== */
@media (max-width: 768px) {
    /* Hide sidebar by default on mobile (when NOT toggled) */
    .sidebar {
        transform: translateX(-100%) !important;
        box-shadow: none !important;
        width: 75vw !important;
        min-width: 280px !important;
        max-width: 320px !important;
        left: 0 !important;
    }
    
    /* Content takes full width on mobile */
    #content-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    /* Show sidebar when toggled on mobile */
    body.sidebar-toggled .sidebar {
        transform: translateX(0) !important;
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.3) !important;
        width: 75vw !important;
        min-width: 280px !important;
        max-width: 320px !important;
        left: 0 !important;
    }
    
    /* Show backdrop when sidebar is open on mobile */
    body.sidebar-toggled .sidebar-backdrop {
        display: block;
        opacity: 1;
    }
    
    /* Always show text on mobile */
    .sidebar .nav-item .nav-link span,
    body.sidebar-toggled .sidebar .nav-item .nav-link span {
        display: inline !important;
        flex: 1 !important;
        min-width: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        font-size: 14px !important;
    }
    
    .sidebar .sidebar-brand .sidebar-brand-text,
    body.sidebar-toggled .sidebar .sidebar-brand .sidebar-brand-text {
        display: block !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }
    
    .sidebar .sidebar-heading,
    body.sidebar-toggled .sidebar .sidebar-heading {
        display: block !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }
    
    /* Nav link layout on mobile */
    .sidebar .nav-item .nav-link,
    body.sidebar-toggled .sidebar .nav-item .nav-link {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        flex-wrap: nowrap !important;
        gap: 0.4rem !important;
        text-align: left;
        padding: 0.85rem 0.75rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        font-size: 0.9rem !important;
    }
    
    /* Nav link icon on mobile - smaller to save space */
    .sidebar .nav-item .nav-link > i:first-child,
    body.sidebar-toggled .sidebar .nav-item .nav-link > i:first-child {
        flex-shrink: 0 !important;
        width: 1.2rem !important;
        margin-right: 0 !important;
        font-size: 0.9rem !important;
    }
    
    /* Chevron icon on mobile - smaller */
    .sidebar .nav-item .nav-link .fa-chevron-down,
    body.sidebar-toggled .sidebar .nav-item .nav-link .fa-chevron-down {
        flex-shrink: 0 !important;
        margin-left: auto !important;
        width: 0.85rem !important;
        font-size: 0.7rem !important;
    }
    
    /* Prevent body scroll when sidebar is open on mobile */
    body.sidebar-toggled {
        overflow: hidden;
    }
}

/* ===== VERY SMALL MOBILE (< 480px) ===== */
@media (max-width: 480px) {
    /* Sidebar MUST be hidden by default - override any auto-open */
    .sidebar {
        width: 75vw !important;
        min-width: 280px !important;
        max-width: 300px !important;
        transform: translateX(-100%) !important;
    }
    
    /* Show only when explicitly toggled */
    body.sidebar-toggled .sidebar {
        width: 75vw !important;
        min-width: 280px !important;
        max-width: 300px !important;
        transform: translateX(0) !important;
    }
    
    /* Ensure backdrop is clickable */
    .sidebar-backdrop {
        pointer-events: auto !important;
        cursor: pointer !important;
    }
    
    body.sidebar-toggled .sidebar-backdrop {
        display: block !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }
    
    /* Prevent any auto-open behavior */
    body:not(.sidebar-toggled) .sidebar {
        transform: translateX(-100%) !important;
    }
    
    /* Smaller font and padding on very small screens */
    .sidebar .nav-item .nav-link {
        font-size: 0.875rem !important;
        padding: 0.85rem 0.65rem !important;
    }
    
    .sidebar .sidebar-brand {
        font-size: 0.95rem !important;
        padding: 1rem 0.65rem !important;
    }
    
    .sidebar .sidebar-heading {
        font-size: 0.65rem !important;
        padding: 0.65rem !important;
    }
}

/* ===== MOBILE TOUCH IMPROVEMENTS ===== */
@media (max-width: 768px) {
    /* Larger touch targets on mobile */
    .sidebar .nav-item .nav-link {
        min-height: 48px;
        display: flex;
        align-items: center;
    }
    
    /* Improve tap highlight */
    .sidebar .nav-item .nav-link {
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
    }
    
    /* Better visual feedback on touch */
    .sidebar .nav-item .nav-link:active {
        background-color: rgba(255, 255, 255, 0.15);
        transform: scale(0.98);
        transition: all 0.1s ease;
    }
    
    /* Sidebar brand larger touch target */
    .sidebar .sidebar-brand {
        min-height: 60px;
    }
    
    /* ===== COLLAPSE MENU - ACCORDION STYLE FOR MOBILE ===== */
    
    /* Collapse container - inline accordion */
    .sidebar .collapse {
        display: none !important;
        position: relative !important;
        width: 100% !important;
        left: auto !important;
        top: auto !important;
        right: auto !important;
        background-color: rgba(0, 0, 0, 0.15) !important;
        padding: 0.5rem 0;
        margin: 0 !important;
        overflow: hidden;
    }
    
    .sidebar .collapse.show {
        display: block !important;
        animation: slideDown 0.3s ease-out;
    }
    
    /* Override CSS gốc: margin: 0 1rem → margin: 0 */
    .sidebar .nav-item .collapse,
    .sidebar .nav-item .collapsing {
        margin: 0 !important;
    }
    
    /* Collapse inner wrapper - NO white background! */
    .sidebar .collapse-inner {
        background-color: transparent !important;
        background: transparent !important;
        position: relative !important;
        width: 100% !important;
        padding: 0.25rem 0;
        margin: 0 !important;
        border-left: none !important;
        padding-left: 0 !important;
        overflow: hidden !important; /* Ngăn menu con tràn ra ngoài khi hover */
    }
    
    /* Force remove bg-white class */
    .sidebar .collapse-inner.bg-white {
        background-color: transparent !important;
        background: transparent !important;
    }
    
    /* Remove rounded */
    .sidebar .collapse-inner.rounded {
        border-radius: 0 !important;
    }
    
    /* Collapse header */
    .sidebar .collapse-header {
        font-size: 0.65rem !important;
        padding: 0.5rem 0.75rem !important;
        margin-bottom: 0.25rem !important;
        color: rgba(255, 255, 255, 0.6) !important;
    }
    
    /* Collapse items - touch-friendly */
    /* Override CSS gốc: padding: .5rem 1rem → padding: 16px 5px 16px 10px (thụt vào trái một chút) */
    .sidebar .collapse-item {
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
        padding: 16px 5px 16px 10px !important; /* Padding: top 16px, right 5px, bottom 16px, left 10px (thụt vào trái) */
        margin: 0 10px !important; /* Margin trái/phải 10px mỗi bên để thụt đều */
        font-size: 0.85rem !important;
        border-radius: 0.5rem !important;
        background-color: transparent !important;
        color: rgba(255, 255, 255, 0.85) !important;
        transition: all 0.2s ease !important;
        width: calc(100% - 20px) !important; /* Trừ 20px để thụt đều cả 2 bên */
        position: relative !important;
        box-sizing: border-box !important; /* Đảm bảo padding được tính trong width */
    }
    
    /* Collapse item hover */
    .sidebar .collapse-item:hover {
        background-color: rgba(255, 255, 255, 0.15) !important;
        color: white !important;
        transform: translateX(3px);
    }
    
    /* Collapse item active */
    .sidebar .collapse-item.active {
        background-color: rgba(255, 255, 255, 0.25) !important;
        color: white !important;
        font-weight: 600 !important;
        border-left: none !important;
        padding-left: 5px !important;
    }
    
    /* Collapse item icons */
    .sidebar .collapse-item i {
        margin-right: 0.65rem !important;
        width: 1.2rem !important;
        font-size: 0.9rem;
        text-align: center;
    }
    
    /* Collapse item text */
    .sidebar .collapse-item span {
        flex: 1;
        line-height: 1.3;
        white-space: normal;
    }
    
    /* Better spacing between nav items */
    .sidebar .nav-item {
        margin-bottom: 0.25rem;
    }
    
    /* Chevron icon improvements on mobile */
    .sidebar .nav-link .fa-chevron-down {
        transition: transform 0.3s ease !important;
        margin-left: auto;
        font-size: 0.75rem;
    }
    
    /* Rotate chevron when menu is expanded */
    .sidebar .nav-link[aria-expanded="true"] .fa-chevron-down {
        transform: rotate(180deg);
    }
    
    /* Ensure nav-link flex for proper chevron alignment */
    .sidebar .nav-item .nav-link {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        flex-wrap: nowrap !important;
        gap: 0.5rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
    }
    
    /* Nav link icon - don't shrink */
    .sidebar .nav-item .nav-link > i:first-child {
        flex-shrink: 0 !important;
        width: 1.5rem !important;
        margin-right: 0 !important;
    }
    
    /* Nav link text wrapper - can shrink, show ellipsis */
    .sidebar .nav-item .nav-link > span {
        flex: 1 !important;
        min-width: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        line-height: 1.3 !important;
    }
    
    /* Chevron icon - don't shrink, always visible */
    .sidebar .nav-item .nav-link .fa-chevron-down {
        flex-shrink: 0 !important;
        margin-left: auto !important;
        width: 1rem !important;
    }
    
    /* Scrollable sidebar on mobile if content is long */
    .sidebar {
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Sidebar divider on mobile - Full width */
    .sidebar .sidebar-divider {
        margin: 0.5rem 0 !important;
        width: 100% !important;
        border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
    }
    
    /* Sidebar heading on mobile */
    .sidebar .sidebar-heading {
        font-size: 0.65rem !important;
        padding: 0.5rem 1rem !important;
        color: rgba(255, 255, 255, 0.5) !important;
    }
}

/* ===== MEDIUM SCREENS (665px - 768px) - Responsive Mode ===== */
@media (min-width: 665px) and (max-width: 768px) {
    /* Sidebar visible - WIDER for better text display */
    .sidebar {
        width: 280px !important;
        min-width: 280px !important;
        position: fixed;
        left: 0;
    }
    
    #content-wrapper {
        margin-left: 280px !important;
        width: calc(100% - 280px) !important;
    }
    
    /* Ensure text doesn't wrap - COMPACT layout */
    .sidebar .nav-item .nav-link {
        display: flex !important;
        flex-wrap: nowrap !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        padding: 0.85rem 0.65rem !important;
        gap: 0.4rem !important;
        font-size: 0.875rem !important;
    }
    
    .sidebar .nav-item .nav-link span {
        flex: 1 !important;
        min-width: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }
    
    /* Icon smaller to save space */
    .sidebar .nav-item .nav-link > i:first-child {
        flex-shrink: 0 !important;
        width: 1.1rem !important;
        font-size: 0.85rem !important;
    }
    
    /* Chevron smaller */
    .sidebar .nav-item .nav-link .fa-chevron-down {
        flex-shrink: 0 !important;
        margin-left: auto !important;
        width: 0.8rem !important;
        font-size: 0.65rem !important;
    }
    
    /* Smaller font for headings */
    .sidebar .sidebar-heading {
        font-size: 0.7rem !important;
        padding: 0.5rem 0.65rem !important;
    }
    
    /* Sidebar brand - compact */
    .sidebar .sidebar-brand {
        padding: 1rem 0.65rem !important;
        font-size: 1rem !important;
    }
    
    /* Sidebar divider - Full width */
    .sidebar .sidebar-divider {
        margin: 0.5rem 0 !important;
        width: 100% !important;
    }
}

/* ===== TABLET & DESKTOP (> 768px) - BRIGHTER COLORS ===== */
@media (min-width: 768px) {
    /* Collapse header - brighter */
    .sidebar .collapse-header {
        color: rgba(255, 255, 255, 0.8) !important;
    }
    
    /* Collapse items - brighter text like mobile */
    .sidebar .collapse-item {
        color: rgba(255, 255, 255, 0.95) !important;
    }
    
    /* Active item - vivid highlight like mobile */
    .sidebar .collapse-item.active {
        background-color: rgba(139, 172, 255, 0.45) !important;
        color: white !important;
        font-weight: 600 !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2) !important;
    }
    
    /* Hover state - brighter */
    .sidebar .collapse-item:hover {
        background-color: rgba(255, 255, 255, 0.22) !important;
        color: white !important;
    }
}

/* ===== TABLET LANDSCAPE (768px - 992px) ===== */
@media (min-width: 768px) and (max-width: 992px) {
    .sidebar {
        width: 13rem;
    }
    
    #content-wrapper {
        margin-left: 13rem;
        width: calc(100% - 13rem);
    }
    
    body.sidebar-toggled .sidebar {
        width: 5rem;
    }
    
    body.sidebar-toggled #content-wrapper {
        margin-left: 5rem;
        width: calc(100% - 5rem);
    }
    
    /* Ensure text handling on tablet */
    .sidebar .nav-item .nav-link {
        white-space: nowrap !important;
        overflow: hidden !important;
    }
    
    .sidebar .nav-item .nav-link span {
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }
}

/* ===== DESKTOP (> 992px) - OPTIMIZE COLORS ===== */
@media (min-width: 992px) {
    /* Collapse inner - slightly darker background for depth */
    .sidebar .collapse.show {
        background-color: rgba(0, 0, 0, 0.08);
    }
    
    /* Ensure text is readable */
    .sidebar .collapse-item {
        font-size: 0.875rem;
    }
}

/* ===== SCRIPT CREATION MODAL STYLES - SPECIFIC CLASS ===== -------------------------------------------------------------*/

/* Form Controls - Modern Styling */
.script-creation-modal {
    color: #333333 !important;
}

.script-creation-modal .card-header {
    border-top: 3px solid #4e73df !important;
}

.script-creation-modal .form-control {
    transition: all 0.3s ease;

}

.script-creation-modal .form-control:focus {
    border: none;
    transform: translateY(-1px);
}

.script-creation-modal .input-group-text {
    background: linear-gradient(135deg, #f8f9fc 0%, #eaecf4 100%);
    border: 2px solid #e3e6f0;
    color: #333333 !important;
    border-radius: 8px;
}

/* Select Dropdowns - Fixed and Modern */
.script-creation-modal select.form-control {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23333333' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1rem;
    padding-right: 2.5rem;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.script-creation-modal select.form-control option {
    color: #333333 !important;
    background-color: #ffffff;
    padding: 0.5rem;
}

/* Textarea - Better Spacing */
.script-creation-modal textarea.form-control {
    resize: vertical;
    min-height: 80px;
    line-height: 1.6;
}

/* Card Styling - Modern Cards */
.script-creation-modal .card.shadow {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.script-creation-modal .card.shadow:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12) !important;
    transform: translateY(-2px);
}

/* Table Styling - Modern Table */
.script-creation-modal .table {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.script-creation-modal .table thead th {
    background: linear-gradient(135deg, #4e73df 0%, #224abe 100%);
    color: #ffffff !important;
    font-weight: 600;
    border: none;
    padding: 0.25rem 0.75rem;
    text-align: center;
}

.script-creation-modal .table tbody td {
    color: #333333 !important;
    font-weight: 500;
    border-color: #e3e6f0;
    vertical-align: middle;
}

.script-creation-modal .table tbody tr:nth-child(even) {
    background-color: rgba(248, 249, 252, 0.5);
}

.script-creation-modal .table tbody tr:hover {
    background-color: rgba(78, 115, 223, 0.05);
    transition: background-color 0.3s ease;
}

/* Button Styling - Modern Gradients */
.script-creation-modal .btn {
    border-radius: 8px;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    transition: all 0.3s ease;
    border: none;
    text-transform: none;
    letter-spacing: 0.5px;
}

/* Primary Button (Save) */
.script-creation-modal .btn-primary {
    background: linear-gradient(135deg, #4e73df 0%, #224abe 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(78, 115, 223, 0.3);
}

.script-creation-modal .btn-primary:hover {
    background: linear-gradient(135deg, #224abe 0%, #1a3a8f 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(78, 115, 223, 0.4);
}

.script-creation-modal .btn-primary:focus {
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
}

/* Secondary Button (Cancel) */
.script-creation-modal .btn-secondary {
    background: linear-gradient(135deg, #858796 0%, #6c757d 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(133, 135, 150, 0.3);
}

.script-creation-modal .btn-secondary:hover {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(133, 135, 150, 0.4);
}

/* Success Button (Add Criteria Group) */
.script-creation-modal .btn-success1 {
    background: linear-gradient(135deg, #1cc88a 0%, #13855c 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(28, 200, 138, 0.3);
}

.script-creation-modal .btn-success1:hover {
    background: linear-gradient(135deg, #13855c 0%, #0f6848 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(28, 200, 138, 0.4);
} */

/* Danger Button (Delete) */
.script-creation-modal .btn-danger {
    background: linear-gradient(135deg, #e74a3b 0%, #be2617 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(231, 74, 59, 0.3);
}

.script-creation-modal .btn-danger:hover {
    background: linear-gradient(135deg, #be2617 0%, #a51f12 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 74, 59, 0.4);
}

/* Small Buttons */
.script-creation-modal .btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
    border-radius: 6px;
}

/* Modal Footer - Clean */
.script-creation-modal .modal-footer {
    background: linear-gradient(135deg, #f8f9fc 0%, #eaecf4 100%);
    border-top: 1px solid #e3e6f0;
    padding: 1rem 1.5rem;
}

/* Form Group Spacing - Better Layout */
.script-creation-modal .form-group {
    margin-bottom: 1.5rem;
}

.script-creation-modal .form-group.row {
    margin-bottom: 1.5rem;
}

/* Row Spacing */
.script-creation-modal .row {
    margin-bottom: 1rem;
}

/* Smooth Animations */
.script-creation-modal .card.shadow {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom Scrollbar */
.script-creation-modal .modal-body::-webkit-scrollbar {
    width: 8px;
}

.script-creation-modal .modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.script-creation-modal .modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #4e73df 0%, #224abe 100%);
    border-radius: 4px;
}

.script-creation-modal .modal-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #224abe 0%, #1a3a8f 100%);
}

/* Responsive Design */
@media (max-width: 768px) {
    .script-creation-modal .card-header {
        padding: 0.75rem 1rem;
    }
    
    .script-creation-modal .card-body {
        padding: 1rem;
    }
    
    .script-creation-modal .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .script-creation-modal .table thead th,
    .script-creation-modal .table tbody td {
        padding: 0.5rem 0.25rem;
        font-size: 0.8rem;
    }
}

/* ===== SCRIPT HISTORY MODAL STYLES ===== -------------------------------------------------------------*/

/* History Modal Styling */
.modal-header.bg-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(23, 162, 184, 0.3);
}

.modal-header.bg-info .modal-title {
    color: #ffffff !important;
    font-weight: 600;
    font-size: 1.2rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Close Button Styling */
.modal-header.bg-info .close {
    color: #ffffff !important;
    opacity: 1 !important;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin: 0;
    padding: 0;
    font-size: 1.2rem;
    font-weight: bold;
    line-height: 1;
    text-shadow: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.modal-header.bg-info .close:hover {
    opacity: 1 !important;
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.modal-header.bg-info .close:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.3);
}

.modal-header.bg-info .close span {
    color: #ffffff !important;
    font-size: 1.2rem;
    font-weight: bold;
    line-height: 1;
    text-shadow: none;
}

/* History Content Styling */
.history-content-wrapper {
    padding: 1rem 0;
}

.history-content {
    background-color: #f8f9fc !important;
    border: 1px solid #e3e6f0 !important;
    border-radius: 8px !important;
    padding: 20px !important;
    max-height: 600px !important;
    overflow-y: auto !important;
    white-space: pre-line !important;
    font-family: 'Roboto', sans-serif !important;
    margin-left: 20px !important;
    color: #333333 !important;
    line-height: 1.6 !important;
    font-size: 0.9rem !important;
}

/* Loading State */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Empty State */
.text-muted {
    color: #333333 !important;
}

/* Button Styling */
.btn {
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    text-transform: none;
    letter-spacing: 0.5px;
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #5a6268 0%, #495057 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

.btn-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

.btn-info:hover {
    background: linear-gradient(135deg, #138496 0%, #117a8b 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(23, 162, 184, 0.4);
}

.btn-info:disabled {
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}

.btn-primary {
    background: linear-gradient(135deg, #196BB4 0%, #196BB4 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(78, 115, 223, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #224abe 0%, #1a3a8f 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(78, 115, 223, 0.4);
}

/* Modal Footer */
.modal-footer {
    background: linear-gradient(135deg, #f8f9fc 0%, #eaecf4 100%);
    border-top: 1px solid #e3e6f0;
    padding: 1rem 1.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal-header.bg-info .close {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }
    
    .history-content {
        font-size: 0.85rem;
        padding: 15px !important;
        margin-left: 10px !important;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 576px) {
    .modal-header.bg-info .close {
        width: 26px;
        height: 26px;
        font-size: 0.9rem;
    }
    
    .history-content {
        font-size: 0.8rem;
        padding: 12px !important;
        margin-left: 5px !important;
    }
}

/* Custom scrollbar for history content */
.history-content::-webkit-scrollbar {
    width: 8px;
}

.history-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.history-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    border-radius: 4px;
}

.history-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #138496 0%, #117a8b 100%);
}

/* ===== ADVANCED SEARCH STYLES ===== */
.advanced-search-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fc 100%);
    border: 1px solid #e3e6f0;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.advanced-search-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.advanced-search-header {
    background: linear-gradient(135deg, #4e73df 0%, #224abe 100%);
    color: white;
    padding: 1.5rem;
    border-bottom: 1px solid #e3e6f0;
}

.advanced-search-header h6 {
    margin: 0;
    font-weight: 600;
    font-size: 1.1rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Header buttons styling */
.advanced-search-header .advanced-search-btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    border-radius: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    margin-left: 0.5rem;
}

.advanced-search-header .advanced-search-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.advanced-search-header .advanced-search-btn:hover::before {
    left: 100%;
}

.advanced-search-header .advanced-search-btn-clean {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

.advanced-search-header .advanced-search-btn-clean:hover {
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
}

.advanced-search-header .advanced-search-btn-search {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.advanced-search-header .advanced-search-btn-search:hover {
    background: linear-gradient(135deg, #1e7e34 0%, #155724 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.advanced-search-header .advanced-search-btn:disabled {
    opacity: 0.6;
    transform: none;
    box-shadow: none;
    cursor: not-allowed;
}

.advanced-search-form {
    background: #ffffff;
    border-radius: 8px;
}

.advanced-search-row {
    margin-bottom: 1.5rem;
}

.advanced-search-form .form-group {
    display: flex;
    position: relative;
}

.advanced-search-form .form-label {
    display: block;
    margin-bottom: 0.75rem;
    color: #2c3e50;
    font-weight: 600;
    font-size: 13px;
    position: relative;
    width: 300px;
}

.advanced-search-form .form-label::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 30px;
    height: 2px;
    background: linear-gradient(135deg, #4e73df 0%, #224abe 100%);
    border-radius: 1px;
}

.advanced-search-form .form-control {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: #ffffff;
    color: #495057;
}

.advanced-search-form .form-control:focus {
    border-color: #4e73df;
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.15);
    background: #ffffff;
    transform: translateY(-1px);
}

.advanced-search-form .form-control::placeholder {
    color: #6c757d;
    font-style: italic;
}

.advanced-search-form select.form-control {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
    appearance: none;
}

.advanced-search-actions {
    background: linear-gradient(135deg, #f8f9fc 0%, #eaecf4 100%);
    padding: 1.5rem;
    border-top: 1px solid #e3e6f0;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.advanced-search-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.advanced-search-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.advanced-search-btn:hover::before {
    left: 100%;
}

.advanced-search-btn-clean {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.advanced-search-btn-clean:hover {
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

.advanced-search-btn-search {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.advanced-search-btn-search:hover {
    background: linear-gradient(135deg, #1e7e34 0%, #155724 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.advanced-search-btn:disabled {
    opacity: 0.6;
    transform: none;
    box-shadow: none;
    cursor: not-allowed;
}

/* Responsive design for advanced search */
@media (max-width: 768px) {
    .advanced-search-body {
        padding: 1rem;
    }
    
    .advanced-search-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .advanced-search-btn {
        width: 100%;
        padding: 1rem;
    }
    
    .advanced-search-form .form-group {
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    .advanced-search-header {
        padding: 1rem;
    }
    
    .advanced-search-header h6 {
        font-size: 1rem;
    }
    
    .advanced-search-body {
        padding: 0.75rem;
    }
    
    .advanced-search-form .form-control {
        padding: 0.625rem 0.875rem;
        font-size: 0.875rem;
    }
}

/* Animation for advanced search toggle */
.advanced-search-card {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== ADVANCED SEARCH MODAL STYLES ===== */
/* Modal styling for advanced search popup */

.advanced-search-modal-body {
    max-height: 70vh;
    overflow-y: auto;
    padding: 1.5rem;
}

.advanced-search-modal-form {
    background: #ffffff;
    border-radius: 8px;
    font-size: 14px; /* Base font size for modal */
}

.advanced-search-modal-form .form-group {
    display: flex;
    flex-direction: row; /* label and control on one line */
    align-items: center;
    gap: 10px;
    height: 100%;
    margin-bottom: 1rem;
}

.advanced-search-modal-form .form-label {
    display: block;
    margin: 0; /* keep on same line */
    color: #2c3e50;
    font-weight: 600;
    font-size: 14px; /* explicit 14px */
    text-transform: none;
    letter-spacing: 0;
    position: relative;
    min-height: 1.2rem;
    line-height: 1.2;
    width: 200px; /* fixed label width to align rows */
    flex: 0 0 200px;
}

.advanced-search-modal-form .form-label::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 30px;
    height: 2px;
    background: linear-gradient(135deg, #4e73df 0%, #224abe 100%);
    border-radius: 1px;
}

.advanced-search-modal-form .form-control {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px; /* explicit 14px */
    transition: all 0.3s ease;
    background: #ffffff;
    color: #495057;
    flex: 1 1 auto;
    min-width: 0; /* allow shrinking inside flex */
    height: 38px;
}

.advanced-search-modal-form .form-control:focus {
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.15);
    transform: translateY(-1px);
}

.advanced-search-modal-form .form-control::placeholder {
    color: #6c757d;
    font-style: italic;
}

.advanced-search-modal-form select.form-control {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
    appearance: none;
}

/* Modal header styling */
.modal-header.bg-primary {
    background: linear-gradient(135deg, #4e73df 0%, #224abe 100%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(78, 115, 223, 0.3);
}

.modal-header.bg-primary .modal-title {
    color: #ffffff !important;
    font-weight: 600;
    font-size: 1.2rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.modal-header.bg-primary .btn-close {
    color: #ffffff !important;
    opacity: 1 !important;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin: 0;
    padding: 0;
    font-size: 1.2rem;
    font-weight: bold;
    line-height: 1;
    text-shadow: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.modal-header.bg-primary .btn-close:hover {
    opacity: 1 !important;
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Modal footer styling */
.modal-footer {
    background: linear-gradient(135deg, #f8f9fc 0%, #eaecf4 100%);
    border-top: 1px solid #e3e6f0;
    padding: 1rem 1.5rem;
}

.modal-footer .btn {
    border-radius: 8px;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    transition: all 0.3s ease;
    border: none;
    text-transform: none;
    letter-spacing: 0.5px;
}

.modal-footer .btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.modal-footer .btn-secondary:hover {
    background: linear-gradient(135deg, #495057 0%, #343a40 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

.modal-footer .btn-primary {
    background: linear-gradient(135deg, #4e73df 0%, #224abe 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(78, 115, 223, 0.3);
}

.modal-footer .btn-primary:hover {
    background: linear-gradient(135deg, #224abe 0%, #1a3a8f 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(78, 115, 223, 0.4);
}

.modal-footer .btn:disabled {
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}

/* Responsive modal */
@media (max-width: 768px) {
    .advanced-search-modal-body {
        max-height: 60vh;
        padding: 1rem;
    }
    
    .advanced-search-modal-form .form-group {
        margin-bottom: 0.75rem;
        flex-direction: column; /* stack on small screens */
        align-items: stretch;
        gap: 6px;
    }
    
    .advanced-search-modal-form .form-label {
        font-size: 14px;
        margin-bottom: 0.25rem;
        width: auto;
        flex: 0 0 auto;
    }
    
    .advanced-search-modal-form .form-control {
        height: 36px;
        min-height: 36px;
        font-size: 14px;
        padding: 0.4rem 0.6rem;
    }
    
    .advanced-search-modal-form select.form-control {
        height: 36px;
        min-height: 36px;
    }
    
    .modal-footer {
        padding: 0.75rem 1rem;
    }
    
    .modal-footer .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 576px) {
    .advanced-search-modal-body {
        max-height: 50vh;
        padding: 0.75rem;
    }
    
    .advanced-search-modal-form .form-group {
        margin-bottom: 0.75rem;
    }
    
    .advanced-search-modal-form .form-label {
        font-size: 14px;
        margin-bottom: 0.3rem;
    }
    
    .advanced-search-modal-form .form-control {
        height: 34px;
        min-height: 34px;
        font-size: 14px;
        padding: 0.35rem 0.5rem;
    }
    
    .advanced-search-modal-form select.form-control {
        height: 34px;
        min-height: 34px;
    }
    
    .modal-header.bg-primary .modal-title {
        font-size: 1rem;
    }
    
    .modal-header.bg-primary .btn-close {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }
}

/* ==========================
   Call Info - Conversation & Tabs
   (moved from call-info.template.html)
   ========================== */

.nav-pills .nav-link {
    border-radius: 0;
    border-left: 3px solid transparent;
    margin-bottom: 2px;
    padding: 12px 15px;
    color: #6c757d;
    background-color: transparent;
    transition: all 0.3s ease;
}

.nav-pills .nav-link:hover {
    background-color: #f8f9fc;
    border-left-color: #196BB4;
    color: #196BB4;
}

.nav-pills .nav-link.active {
    background-color: #196BB4;
    color: white;
}

.nav-pills .nav-link i {
    margin-right: 8px;
    width: 16px;
    text-align: center;
}

.tab-content {
    min-height: 240px; /* shorter content height */
}

/* Modern Conversation Styles - Optimized for Content */
.modern-conversation-container {
    background: linear-gradient(135deg, #f8f9fc 0%, #ffffff 100%);
    padding: 15px;
    position: relative;
}

.modern-conversation-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, #e3e6f0 50%, transparent 100%);
}

.modern-message-item {
    margin-bottom: 16px;
    transition: all 0.3s ease;
    cursor: pointer;
    border-radius: 12px;
    padding: 8px;
    position: relative;
}

.modern-message-item:hover {
    background-color: rgba(102, 126, 234, 0.03);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.modern-message-item.selected {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    border: 1px solid #196BB4;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.12);
}

.modern-message-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    position: relative;
}

.customer-wrapper {
    flex-direction: row-reverse;
}

.agent-wrapper {
    flex-direction: row;
}

.modern-avatar {
    flex-shrink: 0;
    position: relative;
}

.avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.agent-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.customer-avatar {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.avatar-circle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 50%, rgba(255,255,255,0.1) 100%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.modern-message-item:hover .avatar-circle::before {
    transform: translateX(100%);
}

.modern-message-item:hover .avatar-circle {
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

.modern-message-bubble {
    flex: 1;
    border-radius: 16px;
    padding: 12px 16px;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    min-width: 0;
}

.customer-bubble {
    background: linear-gradient(135deg, #1D79CD 0%, #196BB4 100%);
    color: white;
    border-bottom-right-radius: 6px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.agent-bubble {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fc 100%);
    color: #2d3748;
    border: 1px solid rgba(226, 232, 240, 0.6);
    border-bottom-left-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.bubble-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 0.75rem;
}

.customer-bubble .bubble-header {
    color: rgba(255, 255, 255, 0.9);
}

.agent-bubble .bubble-header {
    color: #718096;
}

.speaker-label {
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.time-badge {
    background: rgba(255, 255, 255, 0.15);
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 400;
    backdrop-filter: blur(10px);
}

.agent-bubble .time-badge {
    background: rgba(102, 126, 234, 0.08);
    color: #667eea;
}

.bubble-content {
    position: relative;
}

.message-text {
    line-height: 1.5;
    word-wrap: break-word;
    font-size: 0.85rem;
    margin: 0;
    font-weight: 400;
}

.customer-bubble .message-text {
    color: white;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.agent-bubble .message-text {
    color: #2d3748;
}

.bubble-arrow {
    position: absolute;
    bottom: 0;
    width: 0;
    height: 0;
    border: 8px solid transparent;
}

.customer-arrow {
    right: -8px;
    border-left-color: #667eea;
    border-bottom: none;
    border-right: none;
}

.agent-arrow {
    left: -8px;
    border-right-color: #ffffff;
    border-bottom: none;
    border-left: none;
}

/* Enhanced scrollbar styling */
.modern-conversation-container::-webkit-scrollbar {
    width: 6px;
}

.modern-conversation-container::-webkit-scrollbar-track {
    background: rgba(241, 245, 249, 0.5);
    border-radius: 3px;
}

.modern-conversation-container::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.modern-conversation-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: scaleX(1.2);
}

/* Enhanced animations */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.modern-message-item {
    animation: slideInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.modern-message-item.selected {
    /* stop pulsating to avoid jiggling while reading */
    animation: none;
}

/* Responsive design */
@media (max-width: 768px) {
    .modern-message-wrapper {
        width: 100%;
        gap: 8px;
    }
    
    .modern-message-bubble {
        padding: 10px 12px;
    }
    
    .avatar-circle {
        width: 28px;
        height: 28px;
        font-size: 10px;
    }
    
    .speaker-label {
        font-size: 0.7rem;
    }
    
    .time-badge {
        font-size: 0.6rem;
        padding: 2px 4px;
    }
    
    .message-text {
        font-size: 0.8rem;
    }
}

/* ==========================
   Call Ticket Info - align visuals with Call Info
   ========================== */
.call-ticket-info .card,
.call-ticket-info .box {
    border: none;
    border-radius: 12px;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

.call-ticket-info .btn.btn-success,
.call-ticket-info .btn.btn-primary,
.call-ticket-info .btn.btn-info {
    border: none;
    border-radius: 10px;
    font-weight: 700;
}

.call-ticket-info .btn.btn-success { background: linear-gradient(135deg, #1cc88a 0%, #13855c 100%) !important; }
.call-ticket-info .btn.btn-primary { background: linear-gradient(135deg, #4e73df 0%, #224abe 100%) !important; }
.call-ticket-info .btn.btn-info { background: linear-gradient(135deg, #36b9cc 0%, #258ca4 100%) !important; }

.call-ticket-info .btn:hover { transform: translateY(-1px); }

.call-ticket-info .direct-chat .direct-chat-messages { background: #fff; }
.call-ticket-info .direct-chat .direct-chat-text { border-radius: 16px; }

/* Conversation stats styling */
.conversation-stats .badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-weight: 500;
    backdrop-filter: blur(10px);
}

/* ==========================
   QC History styling
   ========================== */
.qc-history {
    font-size: 13px;
}
.qc-history h6 {
    margin-bottom: 12px;
    color: #333333;
}

.qc-history .table {
    border-collapse: separate;
    border-spacing: 0 8px; /* row gap */
}

.qc-history .table thead th {
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    color: #334155;
    border: none !important;
    font-weight: 600;
}

.qc-history .table tbody tr {
    background: #ffffff;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

.qc-history .table tbody td {
    vertical-align: middle;
    border-top: none !important;
}

.qc-history .table tbody tr:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.qc-history .badge-success,
.qc-history .badge-warning,
.qc-history .badge-danger,
.qc-history .badge-info {
    border-radius: 999px;
    padding: 6px 10px;
}

.qc-history .collapse table thead.table-info th,
.qc-history .collapse table thead.table-primary th {
    border-radius: 6px 6px 0 0;
}

.qc-history .collapse .table {
    border-spacing: 0 4px;
}

.qc-history .collapse .table tbody tr {
    box-shadow: none;
}

/* ==========================
   QC Manual Form styling (align with history)
   ========================== */
.qc-form .qc-form-scroll {
    padding-top: 8px;
}

.qc-form .qc-form-inner {
    max-width: 98%;
    margin-left: auto;
    margin-right: auto;
}

.qc-form .qc-group-table thead th {
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    color: #334155;
    border: none !important;
    font-weight: 600;
}

.qc-form .qc-criteria-table thead th {
    background: #f1f5f9;
    border: none !important;
}

.qc-form .qc-group-table {
    border: none !important;
    margin-bottom: 16px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

.qc-form .table-bordered td,
.qc-form .table-bordered th {
    border: 1px solid #e8eef4 !important;
}

.qc-form .qc-group-table tbody td {
    background: #ffffff;
}

.qc-form .qc-criteria-table tbody tr.qc-item-row {
    background: #ffffff;
}

.qc-form .qc-criteria-table tbody tr.qc-item-history td {
    background: #f8fafc;
}

.qc-form textarea.form-control-sm {
    min-height: 32px;
}

.qc-form .badge {
    border-radius: 999px;
    padding: 6px 10px;
    font-weight: 600;
}

.qc-form .fas {
    color: #64748b;
}

.qc-form .fas:hover {
    color: #334155;
}

/* Summary row (one line) */
.qc-form .qc-summary .summary-item {
    margin-bottom: 8px;
}

.qc-form .summary-score-input {
    width: 100px;
}

/* Distinguish system vs user QC rows */
.qc-history .qc-row {
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.qc-history .qc-row.qc-row--system {
    background: linear-gradient(90deg, rgba(59,130,246,0.06) 0%, rgba(59,130,246,0.02) 100%);
}

.qc-history .qc-row.qc-row--user {
    background: linear-gradient(90deg, rgba(16,185,129,0.06) 0%, rgba(16,185,129,0.02) 100%);
}

.qc-history .creator-chip {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.8rem;
}

.qc-history .creator-system {
    background: rgba(59,130,246,0.15);
    color: #1e40af;
}

.qc-history .creator-user {
    background: rgba(16,185,129,0.15);
    color: #065f46;
}

.qc-history .qc-toggle {
    cursor: pointer;
}

.qc-history .qc-detail td {
    /* Make the indented gutter area white for clear visual indentation */
    background: #ffffff;
}

.qc-history .qc-detail-inner {
    max-width: 98%;
    margin-left: auto;
    margin-right: auto;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

.qc-history .qc-detail-body {
    padding-left: 8px;
    padding-right: 8px;
}

/* ==========================
   Player speed toggle (round buttons)
   ========================== */
.speed-toggle .btn {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50% !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 14px rgba(78, 115, 223, 0.12);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.speed-toggle .btn + .btn {
    margin-left: 10px;
}

.speed-toggle .btn-outline-primary {
    background: #f1f5ff;
    border-color: #c3d4ff;
    color: #3b5bdb;
}

.speed-toggle .btn-outline-primary:hover {
    background: #e7efff;
    color: #2f55cc;
}

.speed-toggle .btn-primary {
    background: linear-gradient(135deg, #4e73df 0%, #3358d4 100%);
    border-color: #3b5bdb;
}

.speed-toggle .btn:active,
.speed-toggle .btn:focus {
    outline: none;
    box-shadow: 0 6px 16px rgba(78, 115, 223, 0.25);
    transform: translateY(-1px);
}

/* ===== SAVE BUTTON STYLES ===== */
.btn-primary.btn-lg {
    background: linear-gradient(135deg, #4e73df 0%, #224abe 100%);
    border: none;
    border-radius: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 0.25rem 0.75rem rgba(78, 115, 223, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary.btn-lg:hover {
    background: linear-gradient(135deg, #224abe 0%, #1a3a8f 100%);
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1.5rem rgba(78, 115, 223, 0.4);
}

.btn-primary.btn-lg:active {
    transform: translateY(0);
    box-shadow: 0 0.25rem 0.75rem rgba(78, 115, 223, 0.3);
}

.btn-primary.btn-lg:disabled {
    background: linear-gradient(135deg, #858796 0%, #6e707e 100%);
    transform: none;
    box-shadow: none;
    cursor: not-allowed;
}

.btn-primary.btn-lg:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Loading animation for button */
.btn-primary.btn-lg:disabled::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== NOTIFICATION/ALERT Z-INDEX FIX ===== */
/* Ensure error notifications (SweetAlert/Swal2/Toastr) render above high z-index modals */
#toast-container,
#toast-container > .toast,
.sweet-alert,
.sweet-overlay,
.swal2-container,
.swal2-container .swal2-popup {
    z-index: 100500 !important;
}

/* ===== SIDEBAR BRAND TEXT HANDLING ===== */
/* These are handled by the main sidebar responsive section above */
/* ===== STRUCTURE UPLOAD FILE NAME MODAL STYLES ===== */
.structure-upload-modal .modal-dialog {
    max-width: 900px;
    width: 95%;
}

.structure-upload-modal .modal-body {
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
}

.structure-upload-modal .form-group {
    margin-bottom: 20px;
    padding: 15px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-left: 4px solid #007bff;
    transition: all 0.3s ease;
}

    .structure-upload-modal .form-group:hover {
        box-shadow: 0 4px 8px rgba(0,0,0,0.15);
        transform: translateY(-2px);
    }

.structure-upload-modal .control-label {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    display: block;
}

.structure-upload-modal .form-control {
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #ffffff;
}

    .structure-upload-modal .form-control:focus {
        box-shadow: 0 0 0 1px rgba(0,123,255,0.25);
        background: #ffffff;
    }

    .structure-upload-modal .form-control::placeholder {
        color: #6c757d;
        font-style: italic;
    }

/* Generate Structure Button */
.structure-upload-modal .btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: none;
    border-radius: 25px;
    padding: 12px 30px;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(0,123,255,0.3);
    transition: all 0.3s ease;
}

    .structure-upload-modal .btn-primary:hover {
        background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0,123,255,0.4);
    }

    .structure-upload-modal .btn-primary:active {
        transform: translateY(0);
    }

/* Structure Components Box */
.structure-upload-modal .box {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-top: 20px;
}

.structure-upload-modal .box-primary {
    border-top: 4px solid #007bff;
}

.structure-upload-modal .box-header {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    padding: 20px;
    border: none;
}

.structure-upload-modal .box-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
}

    .structure-upload-modal .box-title i {
        margin-right: 10px;
        font-size: 18px;
    }

.structure-upload-modal .box-body {
    padding: 25px;
    background: #ffffff;
}

    /* Structure Component Items */
    .structure-upload-modal .box-body .form-group {
        background: #f8f9fa;
        border-left: 4px solid #28a745;
        margin-bottom: 15px;
        padding: 20px;
        border-radius: 8px;
        transition: all 0.3s ease;
    }

        .structure-upload-modal .box-body .form-group:hover {
            background: #e9ecef;
            border-left-color: #20c997;
        }

    .structure-upload-modal .box-body .control-label {
        color: #495057;
        font-weight: 600;
        font-size: 14px;
    }

    .structure-upload-modal .box-body .form-control {
        border: 2px solid #dee2e6;
        background: #ffffff;
    }

        .structure-upload-modal .box-body .form-control:focus {
            box-shadow: 0 0 0 1px rgba(40,167,69,0.25);
        }

    /* Time Format Input */
    .structure-upload-modal .box-body .form-group:last-child {
        background: #fff3cd;
        border-left-color: #ffc107;
    }

        .structure-upload-modal .box-body .form-group:last-child:hover {
            background: #ffeaa7;
            border-left-color: #f39c12;
        }

/* Modal Footer */
.structure-upload-modal .modal-footer {
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 20px 25px;
    border-radius: 0 0 8px 8px;
}

.structure-upload-modal .btn-success {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    border: none;
    border-radius: 25px;
    padding: 12px 30px;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(40,167,69,0.3);
    transition: all 0.3s ease;
}

    .structure-upload-modal .btn-success:hover {
        background: linear-gradient(135deg, #1e7e34 0%, #155724 100%);
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(40,167,69,0.4);
    }

.structure-upload-modal .btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border: none;
    border-radius: 25px;
    padding: 12px 30px;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(220,53,69,0.3);
    transition: all 0.3s ease;
}

    .structure-upload-modal .btn-danger:hover {
        background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(220,53,69,0.4);
    }

/* Modal Header */
.structure-upload-modal .modal-header {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    border-radius: 8px 8px 0 0;
    padding: 20px 25px;
}

.structure-upload-modal .modal-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.structure-upload-modal .btn-close {
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

    .structure-upload-modal .btn-close:hover {
        background: rgba(255,255,255,0.3);
        border-color: rgba(255,255,255,0.5);
        transform: scale(1.1);
    }

/* Responsive Design */
@media (max-width: 768px) {
    .structure-upload-modal .modal-dialog {
        max-width: 95%;
        margin: 10px;
    }

    .structure-upload-modal .modal-body {
        padding: 15px;
    }

    .structure-upload-modal .form-group {
        padding: 10px;
    }

    .structure-upload-modal .box-body {
        padding: 15px;
    }

    .structure-upload-modal .btn {
        padding: 10px 20px;
        font-size: 12px;
    }
}

/* Animation for form elements */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.structure-upload-modal .form-group {
    animation: slideInUp 0.5s ease-out;
}

    .structure-upload-modal .form-group:nth-child(1) {
        animation-delay: 0.1s;
    }

    .structure-upload-modal .form-group:nth-child(2) {
        animation-delay: 0.2s;
    }

    .structure-upload-modal .form-group:nth-child(3) {
        animation-delay: 0.3s;
    }

    .structure-upload-modal .form-group:nth-child(4) {
        animation-delay: 0.4s;
    }

    .structure-upload-modal .form-group:nth-child(5) {
        animation-delay: 0.5s;
    }

/* Additional styling for better UX */
.structure-upload-modal .margin-bottom-20 {
    margin-bottom: 20px;
}

.structure-upload-modal .text-center {
    text-align: center;
}

/* Enhanced select styling - Fixed dropdown colors */
.structure-upload-modal select.form-control {
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%23666' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 35px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    border: 2px solid #dee2e6;
    color: #495057 !important;
}

    .structure-upload-modal select.form-control:focus {
        background: #ffffff !important;
        background-color: #ffffff !important;
        background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%23007bff' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E");
        border-color: #007bff;
        color: #495057 !important;
        box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
    }

    .structure-upload-modal select.form-control:active {
        background: #ffffff !important;
        background-color: #ffffff !important;
        color: #495057 !important;
    }

    .structure-upload-modal select.form-control option {
        background-color: #ffffff !important;
        color: #495057 !important;
        padding: 8px 12px;
    }

        .structure-upload-modal select.form-control option:hover {
            background-color: #f8f9fa !important;
            color: #495057 !important;
        }

        .structure-upload-modal select.form-control option:selected {
            background-color: #f8f9fa !important;
            color: #495057 !important;
        }

/* Loading state for button */
.structure-upload-modal .btn.loading {
    position: relative;
    color: transparent;
}

    .structure-upload-modal .btn.loading::after {
        content: "";
        position: absolute;
        width: 16px;
        height: 16px;
        top: 50%;
        left: 50%;
        margin-left: -8px;
        margin-top: -8px;
        border: 2px solid transparent;
        border-top-color: #ffffff;
        border-radius: 50%;
        animation: spin 1s linear infinite;
    }

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Success/Error states */
.structure-upload-modal .form-group.has-success .form-control {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40,167,69,0.25);
}

.structure-upload-modal .form-group.has-error .form-control {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220,53,69,0.25);
}

/* Tooltip styling */
.structure-upload-modal .tooltip {
    font-size: 12px;
}

.structure-upload-modal .tooltip-inner {
    background-color: #333;
    color: white;
    border-radius: 4px;
    padding: 8px 12px;
}

/* Enhanced box styling */
.structure-upload-modal .box {
    position: relative;
    overflow: hidden;
}

    .structure-upload-modal .box::before {
        content: "";
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
        transition: left 0.5s;
    }

    .structure-upload-modal .box:hover::before {
        left: 100%;
    }

/* Improved spacing */
.structure-upload-modal .modal-body {
    line-height: 1.6;
}

.structure-upload-modal .form-group label {
    margin-bottom: 8px;
    display: block;
    font-weight: 600;
    color: #495057;
}

/* Better focus states */
.structure-upload-modal .form-control:focus {
    outline: none;
    transform: scale(1.02);
}

/* Smooth transitions for all interactive elements */
.structure-upload-modal * {
    transition: all 0.3s ease;
}

/* Custom scrollbar for modal body */
.structure-upload-modal .modal-body::-webkit-scrollbar {
    width: 8px;
}

.structure-upload-modal .modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.structure-upload-modal .modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

    .structure-upload-modal .modal-body::-webkit-scrollbar-thumb:hover {
        background: #a8a8a8;
    }

/* ===== EMERGENCY SIDEBAR FIX - OVERRIDE ALL ===== */
/* This ensures sidebar works even with CSS conflicts */

@media (max-width: 768px) {
    /* Force sidebar positioning and hiding - WIDER for better text display */
    .sidebar,
    ul.sidebar,
    .navbar-nav.sidebar {
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        height: 100vh !important;
        width: 75vw !important;
        min-width: 280px !important;
        max-width: 320px !important;
        transform: translateX(-100%) !important;
        z-index: 1050 !important;
        transition: transform 0.3s ease-in-out !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        display: block !important;
        visibility: visible !important;
    }
    
    /* Force sidebar to show when toggled */
    body.sidebar-toggled .sidebar,
    body.sidebar-toggled ul.sidebar,
    body.sidebar-toggled .navbar-nav.sidebar {
        transform: translateX(0) !important;
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.3) !important;
        width: 75vw !important;
        min-width: 280px !important;
        max-width: 320px !important;
    }
    
    /* Force text layout on mobile - OPTIMIZED for max text display */
    .sidebar .nav-item .nav-link,
    body.sidebar-toggled .sidebar .nav-item .nav-link {
        display: flex !important;
        flex-wrap: nowrap !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        gap: 0.4rem !important;
        padding: 0.85rem 0.65rem !important;
        font-size: 0.875rem !important;
        width: max-content !important;
    }
    
    .sidebar .nav-item .nav-link span {
        flex: 1 !important;
        min-width: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }
    
    /* Icons smaller to save space */
    .sidebar .nav-item .nav-link > i:first-child {
        flex-shrink: 0 !important;
        width: 1.1rem !important;
        font-size: 0.85rem !important;
    }
    
    /* Chevron smaller */
    .sidebar .nav-item .nav-link .fa-chevron-down {
        flex-shrink: 0 !important;
        margin-left: auto !important;
        width: 0.8rem !important;
        font-size: 0.65rem !important;
    }
    
    /* Sidebar headings - smaller padding */
    .sidebar .sidebar-heading {
        padding: 0.5rem 0.65rem !important;
        font-size: 0.7rem !important;
    }
    
    /* Sidebar brand - smaller padding */
    .sidebar .sidebar-brand {
        padding: 1rem 0.65rem !important;
        font-size: 1rem !important;
    }
    
    /* Sidebar divider - Full width */
    .sidebar .sidebar-divider {
        margin: 0.5rem 0 !important;
        width: 100% !important;
    }
    
    /* Force backdrop behavior */
    .sidebar-backdrop {
        display: none !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        background-color: rgba(0, 0, 0, 0.5) !important;
        z-index: 1040 !important;
        opacity: 0 !important;
        transition: opacity 0.3s ease-in-out !important;
    }
    
    body.sidebar-toggled .sidebar-backdrop {
        display: block !important;
        opacity: 1 !important;
    }
    
    /* Ensure content doesn't overlap */
    #content-wrapper,
    .content-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    body.sidebar-toggled #content-wrapper,
    body.sidebar-toggled .content-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
    }
}

/* ===== CALL LIST PAGE RESPONSIVE ===== */

/* Page Heading Row - Flexible Layout */
.page-heading-row {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 1rem !important;
}

.page-title {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
}

.page-controls {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
    justify-content: flex-end !important;
}

/* Control elements default sizes */
.sort-dropdown {
    width: auto !important;
    min-width: 150px !important;
}

.upload-btn {
    white-space: nowrap !important;
}

.search-group {
    min-width: 200px !important;
    flex: 1 1 auto !important;
    max-width: 300px !important;
}

.date-picker-btn {
    min-width: 280px !important;
    max-width: 100% !important;
    white-space: nowrap !important;
}

/* Table Controls Row */
.table-controls-row {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 1rem !important;
}

.page-size-control {
    flex: 0 0 auto !important;
}

.export-controls {
    flex: 1 1 auto !important;
    justify-content: flex-end !important;
    flex-wrap: nowrap !important;
}

.export-dropdown {
    width: auto !important;
    min-width: 150px !important;
    max-width: 250px !important;
}

.export-btn {
    white-space: nowrap !important;
}

/* Table responsive - Smart width management */
.table-responsive {
    overflow-x: visible;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.table-responsive table {
    width: 100%;
    table-layout: auto;
}

.table-responsive table th,
.table-responsive table td {
    white-space: normal;
    word-wrap: break-word;
}

/* Only enable horizontal scroll on screens smaller than 1220px */
@media (max-width: 1220px) {
    .table-responsive {
        overflow-x: auto !important;
    }
    
    .table-responsive table {
        min-width: 1200px;
        width: auto !important;
    }
    
    .table-responsive table th,
    .table-responsive table td {
        white-space: nowrap !important;
        min-width: fit-content;
    }
}

/* Statistics Cards Responsive */
@media (max-width: 1200px) {
    .statistics-row .col-xl-3 {
        flex: 0 0 33.333333% !important;
        max-width: 33.333333% !important;
    }
}

@media (max-width: 992px) {
    .statistics-row .col-xl-3 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
}

/* Responsive Breakpoints */
@media (max-width: 1400px) {
    /* Date picker smaller on medium screens */
    .date-picker-btn {
        min-width: 240px !important;
        font-size: 0.9rem !important;
    }
    
    .search-group {
        max-width: 250px !important;
    }
}

@media (max-width: 1200px) {
    /* Controls start wrapping more */
    .page-controls {
        justify-content: flex-start !important;
    }
    
    .date-picker-btn {
        min-width: 220px !important;
    }
}

@media (max-width: 992px) {
    /* Controls wrap to new line */
    .page-heading-row {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
    
    .page-controls {
        width: 100% !important;
    }
    
    .sort-dropdown,
    .upload-btn,
    .search-group,
    .date-picker-btn {
        margin-bottom: 0.5rem !important;
    }
}

@media (max-width: 768px) {
    /* Mobile layout - stack everything */
    .page-title {
        font-size: 1.5rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .page-controls {
        flex-direction: column !important;
        width: 100% !important;
    }
    
    .sort-dropdown,
    .upload-btn,
    .search-group,
    .date-picker-btn {
        width: 100% !important;
        max-width: 100% !important;
        margin-right: 0 !important;
        margin-bottom: 0.5rem !important;
    }
    
    .date-picker-btn {
        min-width: 100% !important;
    }
    
    /* Statistics cards */
    .statistics-row .col-md-6 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
        margin-bottom: 1rem !important;
    }
    
    /* Table controls */
    .table-controls-row {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
    
    .page-size-control,
    .export-controls {
        width: 100% !important;
        justify-content: flex-start !important;
    }
    
    .export-dropdown {
        width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 0.5rem !important;
    }
    
    .export-btn {
        width: 100% !important;
    }
    
    /* Table font smaller */
    .table-responsive table {
        font-size: 12px !important;
    }
    
    /* Badge smaller */
    .badge {
        font-size: 0.7rem !important;
        padding: 0.25em 0.5em !important;
    }
    
    /* Pagination */
    .pagination {
        flex-wrap: wrap !important;
        justify-content: center !important;
    }
}

@media (max-width: 576px) {
    /* Very small screens */
    .statistics-row .col-xl-3,
    .statistics-row .col-md-6 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
    
    .page-title {
        font-size: 1.3rem !important;
    }
    
    /* Hide button text, keep icon */
    .btn-text {
        display: none !important;
    }
    
    .upload-btn,
    .export-btn {
        padding: 0.5rem 1rem !important;
    }
    
    /* Table even smaller */
    .table-responsive table {
        font-size: 11px !important;
    }
}

/* Table horizontal scroll indicator */
.table-responsive::-webkit-scrollbar {
    height: 8px !important;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1 !important;
    border-radius: 4px !important;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #888 !important;
    border-radius: 4px !important;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #555 !important;
}

/* ==========================
   Call Info Page - Responsive Title & Layout
   ========================== */

/* Call info title responsive */
.call-info-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.call-info-title .call-name {
    word-break: break-word;
    line-height: 1.3;
}

/* Speed control responsive */
.speed-control-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.speed-label {
    font-size: 1rem;
    margin-right: 5px;
}

.speed-toggle {
    display: flex;
    gap: 2px;
}

/* Responsive font sizes for call title */
@media (max-width: 575px) {
    .call-info-title {
        font-size: 1rem !important; /* Very small screens */
    }
    
    .call-info-title .btn-link {
        padding: 0 8px 0 0 !important;
    }
    
    .call-info-title .btn-link i {
        font-size: 14px;
    }
    
    /* Speed control - very small screens */
    .speed-label {
        font-size: 0.75rem !important;
    }
    
    .speed-btn {
        font-size: 0.7rem !important;
        padding: 0.25rem 0.4rem !important;
        border-radius: 0.15rem !important;
    }
    
    .speed-control-wrapper {
        gap: 4px;
    }
}

@media (min-width: 576px) and (max-width: 767px) {
    .call-info-title {
        font-size: 1.25rem !important; /* Small screens */
    }
    
    .call-info-title .btn-link i {
        font-size: 16px;
    }
    
    /* Speed control - small screens */
    .speed-label {
        font-size: 0.85rem !important;
    }
    
    .speed-btn {
        font-size: 0.8rem !important;
        padding: 0.3rem 0.5rem !important;
        border-radius: 0.2rem !important;
    }
    
    .speed-control-wrapper {
        gap: 6px;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .call-info-title {
        font-size: 1.5rem !important; /* Medium screens */
    }
    
    /* Speed control - medium screens */
    .speed-label {
        font-size: 0.9rem !important;
    }
    
    .speed-btn {
        font-size: 0.85rem !important;
        padding: 0.35rem 0.6rem !important;
    }
}

/* Export dropdown responsive */
@media (max-width: 767px) {
    .d-sm-flex.align-items-center.justify-content-between {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
    
    .d-sm-flex.align-items-center.justify-content-between > .d-flex {
        margin-top: 15px;
        width: 100%;
    }
    
    .d-sm-flex.align-items-center.justify-content-between .input-group {
        width: 100% !important;
    }
}

@media (max-width: 575px) {
    .d-sm-flex.align-items-center.justify-content-between .input-group select {
        font-size: 12px !important;
    }
    
    .d-sm-flex.align-items-center.justify-content-between .input-group .btn {
        font-size: 12px !important;
        padding: 0.375rem 0.5rem !important;
    }
}

/* ==========================
   Call Info Tab Fixes - Responsive & Overflow
   ========================== */

/* Tab navigation improvements */
.call-info-tabs .nav-link {
    white-space: nowrap;
    display: flex;
    align-items: center;
}

.call-info-tabs .nav-link span {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Ensure tab content doesn't overflow */
.tab-content {
    overflow: hidden;
}

.tab-pane {
    width: 100%;
}

/* Fix for very small screens - reduce size but keep text */
@media (max-width: 575px) {
    .call-info-tabs .nav-link {
        padding: 6px 8px !important;
        font-size: 11px !important;
    }
    
    .call-info-tabs .nav-link i {
        font-size: 12px;
        margin-right: 4px !important;
        min-width: 12px;
    }
    
    .call-info-tabs .nav-link span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* Fix for small screens */
@media (min-width: 576px) and (max-width: 767px) {
    .call-info-tabs .nav-link {
        padding: 8px 10px !important;
        font-size: 12px !important;
    }
    
    .call-info-tabs .nav-link i {
        font-size: 13px;
        margin-right: 5px !important;
    }
}

/* Medium screens */
@media (min-width: 768px) and (max-width: 991px) {
    .call-info-tabs .nav-link {
        padding: 10px 12px !important;
        font-size: 13px !important;
    }
    
    .call-info-tabs .nav-link i {
        font-size: 14px;
        margin-right: 6px !important;
    }
}

/* Tab content field styles - prevent overflow */
.tab-pane strong {
    display: block;
    margin-bottom: 4px;
    color: #5a5c69;
}

.tab-pane > div > div {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Badge wrapping for long content */
.badge {
    word-break: break-word;
}

/* Global font override: dùng system font giống các web/app hiện đại (gần giống ChatGPT) */
body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}
/* Call list page: spacing nhỏ hơn giữa các cột + border rất mờ chia cột */
.call-list-table th,
.call-list-table td {
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
    padding-left: 0.4rem;
    padding-right: 0.4rem;
    border-right: 1px solid rgba(0, 0, 0, 0.03);
}

/* Màu nền cho header của bảng call-list */
.call-list-table thead th {
    background-color: #196BB4 !important;
    color: #fff !important;
    border-right: 2px solid #e3e6f0;
}

/* bỏ border phải ở cột cuối cùng cho sạch */
.call-list-table th:last-child,
.call-list-table td:last-child {
    border-right: none;
}

/* Call list page: dưới 1500px thì cho phép scroll ngang bảng
   và ưu tiên giữ nguyên độ rộng cột để badge không phải xuống dòng */
@media (max-width: 1260px) {
    .call-list-table-wrapper {
        overflow-x: auto;
    }

    .call-list-table {
        min-width: 1300px;
    }
}

/* Call ticket list page: spacing nhỏ hơn giữa các cột + border rất mờ chia cột */
.call-ticket-list-table th,
.call-ticket-list-table td {
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
    padding-left: 0.4rem;
    padding-right: 0.4rem;
    border-right: 1px solid rgba(0, 0, 0, 0.03);
}

/* Màu nền cho header của bảng call-ticket-list */
.call-ticket-list-table thead th {
    background-color: #196BB4 !important;
    color: #fff !important;
    border-right: 2px solid #e3e6f0;
}

/* bỏ border phải ở cột cuối cùng cho sạch */
.call-ticket-list-table th:last-child,
.call-ticket-list-table td:last-child {
    border-right: none;
}

/* Scrollbar styling for tab content */
.tab-pane > div::-webkit-scrollbar {
    width: 6px;
}

.tab-pane > div::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.tab-pane > div::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.tab-pane > div::-webkit-scrollbar-thumb:hover {
    background: #555;
}
