/* Service Log Management Specific Styles - v65 */

/* Inherit base styles from shared-sidebar.css */

/* Hide dashboard button on desktop */
@media (min-width: 768px) {
    .content-header .dashboard-btn {
        display: none !important;
    }
}

/* Clickable rows */
#serviceLogTableBody tr.clickable-row {
    cursor: pointer;
}

/* Ensure action buttons don't show pointer cursor */
#serviceLogTableBody tr.clickable-row .action-buttons,
#serviceLogTableBody tr.clickable-row .action-btn {
    cursor: default;
}

/* Clickable rows for recurrent ticket table */
#recurrentTicketTableBody tr.clickable-row {
    cursor: pointer;
}

/* Ensure action buttons don't show pointer cursor */
#recurrentTicketTableBody tr.clickable-row .action-buttons,
#recurrentTicketTableBody tr.clickable-row .action-btn {
    cursor: default;
}

/* Breadcrumb Navigation Styles */
.breadcrumb-nav {
    margin-bottom: 1rem;
}

.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin: 0;
    font-size: 0.9rem;
}

.breadcrumb-item {
    display: inline-flex;
    align-items: center;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    color: #6c757d;
    font-weight: 500;
    margin: 0 0.5rem;
}

.breadcrumb-link {
    color: #0d6efd;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.2s ease;
}

.breadcrumb-link:hover {
    color: #0a58ca;
    text-decoration: underline;
}

.breadcrumb-link i {
    font-size: 0.8rem;
}

.breadcrumb-item.active {
    color: #6c757d;
    font-weight: 500;
}

/* Responsive breadcrumb */
@media (max-width: 768px) {
    .breadcrumb-nav {
        margin-bottom: 0.75rem;
    }
    
    .breadcrumb {
        font-size: 0.85rem;
    }
    
    .breadcrumb-item + .breadcrumb-item::before {
        margin: 0 0.375rem;
    }
}

/* Table Styles */
.table th {
    font-weight: 600;
    font-size: 0.9rem;
    border-top: none;
    background-color: #343a40;
    color: white;
    padding: 12px 8px;
}

.table td {
    padding: 10px 8px;
    vertical-align: middle;
    font-size: 0.9rem;
    border-top: 1px solid #dee2e6;
}

/* General table hover effect */
.table tbody tr:hover {
    background-color: #e3f2fd;
}

/* Specific service log table hover effect */
#serviceLogTable.table-hover tbody tr:hover,
#serviceLogTable tbody tr:hover,
#serviceLogTable tr:hover {
    background-color: #e3f2fd !important;
    transition: background-color 0.2s ease;
}

#serviceLogTable.table-hover tbody tr:hover td,
#serviceLogTable tbody tr:hover td,
#serviceLogTable tr:hover td {
    background-color: #e3f2fd !important;
    transition: background-color 0.2s ease;
}

/* Priority Badge Styles */
.priority-badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.priority-low {
    background-color: #d4edda;
    color: #155724;
}

.priority-medium {
    background-color: #fff3cd;
    color: #856404;
}

.priority-high {
    background-color: #f8d7da;
    color: #721c24;
}

.priority-critical {
    background-color: #f5c6cb;
    color: #721c24;
    font-weight: 600;
}

/* Status Badge Styles */
.status-badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.status-pending {
    background-color: #6c757d;
    color: white;
}

.status-pending-merchant {
    background-color: #856404;
    color: white;
}

.status-working {
    background-color: #28a745;
    color: white;
}

.status-resolved {
    background-color: #007bff;
    color: white;
}

.status-second-resolve {
    background-color: #ffc107;
    color: #212529;
}

/* Type Badge Styles */
.type-badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 500;
    background-color: #e9ecef;
    color: #495057;
}

/* Product Badge Styles */
.product-badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 500;
    background-color: #d1ecf1;
    color: #0c5460;
}

/* Action Buttons */
.action-btn {
    padding: 3px 6px;
    margin: 0 1px;
    font-size: 0.75rem;
    border-radius: 4px;
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Message Preview */
.message-preview {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.message-preview:hover {
    color: #0d6efd;
}

/* Expired Row Styling */
.table tbody tr.expired {
    background-color: #f8f9fa;
    opacity: 0.7;
}

.table tbody tr.expired td {
    color: #6c757d;
}

/* Team Assignment Highlighting */
.assigned-to-team {
    color: #0d6efd !important;
    font-weight: bold;
}

/* Unassigned Highlighting */
.assigned-to-unassigned {
    color: #6c757d !important;
    font-style: italic;
    font-weight: 500;
}

/* Modal Styles */
.modal-body .form-label {
    font-weight: 500;
    color: #495057;
}

.modal-body .form-control,
.modal-body .form-select {
    border-radius: 6px;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.modal-body .form-control:focus,
.modal-body .form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Search Container */
.search-container {
    position: relative;
    width: 300px;
}

.search-container .form-control {
    padding-right: 40px;
    border-radius: 20px;
}

.search-container .search-icon,
.search-container .clear-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    z-index: 10;
}

.search-container .clear-icon:hover {
    color: #dc3545;
}

/* Action Bar */
.action-bar {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.action-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* Filter Panel Styles */
#filterPanel {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

#filterPanel .card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 12px 16px;
}

#filterPanel .card-body {
    padding: 15px;
}

#filterPanel .form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.25rem;
}

#filterPanel .form-label.small {
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.2rem;
}

#filterPanel .form-control,
#filterPanel .form-select {
    border-radius: 6px;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

#filterPanel .form-control:focus,
#filterPanel .form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Ensure autocomplete components in filter panel are small */
#filterPanel #merchantSearchContainer input,
#filterPanel #reasonCategorySearchContainer input {
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    height: calc(1.5em + 0.5rem + 2px);
}

#filterPanel #merchantSearchContainer .input-group,
#filterPanel #reasonCategorySearchContainer .input-group {
    font-size: 0.875rem;
}

/* Autocomplete Suggestions */
.merchant-suggestions,
.category-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ced4da;
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
}

.suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f8f9fa;
    transition: background-color 0.2s ease;
}

.suggestion-item:hover {
    background-color: #f8f9fa;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item.selected {
    background-color: #e3f2fd;
    color: #1976d2;
}

/* Filter Toggle Button */
#toggleFiltersBtn {
    transition: all 0.3s ease;
}

#toggleFiltersBtn.active {
    background-color: #0d6efd;
    color: white;
    border-color: #0d6efd;
}

#filterArrow {
    transition: transform 0.3s ease;
}

#filterArrow.rotated {
    transform: rotate(180deg);
}

/* Filter Panel Animation */
#filterPanel {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Filter Form Styling */
#filterForm .form-text {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

#filterForm .btn {
    border-radius: 6px;
    font-weight: 500;
}

#filterForm .btn i {
    margin-right: 4px;
}

/* Active Filter Indicators */
.filter-active {
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

.filter-active .form-control,
.filter-active .form-select {
    background-color: #d1ecf1;
}

/* User Dropdown Container */
.user-dropdown-container {
    position: relative;
}

.user-dropdown-toggle {
    text-align: left;
    cursor: pointer;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 0.375rem 0.75rem;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    background-image: none !important;
}

.user-dropdown-toggle:hover {
    border-color: #adb5bd;
}

.user-dropdown-toggle:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    outline: 0;
}

.user-dropdown-toggle i {
    transition: transform 0.2s ease;
}

.user-dropdown-toggle[aria-expanded="true"] i {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ced4da;
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    background-color: #fff;
    z-index: 1000;
    padding: 0.5rem 0;
}

.user-dropdown-item {
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
}

.user-dropdown-item:hover {
    background-color: #f8f9fa;
}

/* Ensure checkbox and label are clickable */
.user-dropdown-item .form-check-input,
.user-dropdown-item .form-check-label {
    z-index: 1;
    position: relative;
}

.user-dropdown-item .form-check-input {
    margin-right: 0.75rem;
    margin-top: 0;
    cursor: pointer;
    pointer-events: auto;
}

.user-dropdown-item .form-check-label {
    margin-bottom: 0;
    cursor: pointer;
    flex: 1;
    font-size: 0.9rem;
    pointer-events: auto;
    user-select: none;
}

.user-dropdown-item .form-check-input:checked + .form-check-label {
    font-weight: 500;
    color: #0d6efd;
}

/* Selected users display */
.user-selected-text {
    color: #495057;
    font-size: 0.875rem;
}

.user-selected-text.has-selection {
    color: #0d6efd;
    font-weight: 500;
}

/* Custom scrollbar for user dropdown */
.user-dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.user-dropdown-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.user-dropdown-menu::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.user-dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* User Filter Options */
.user-filter-options {
    display: flex;
    flex-direction: row;
    gap: 8px;
    padding: 6px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    flex-wrap: wrap;
    align-items: center;
}

.user-filter-options .form-check {
    margin-bottom: 0;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.user-filter-options .form-check-label {
    font-size: 0.75rem;
    color: #495057;
    cursor: pointer;
    margin-left: 0.25rem;
    margin-bottom: 0;
}

.user-filter-options .form-check-input {
    cursor: pointer;
    margin-top: 0;
    margin-right: 0.25rem;
    flex-shrink: 0;
}

.user-filter-options .form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

/* Responsive Filter Panel */
@media (max-width: 768px) {
    #filterPanel .card-body {
        padding: 15px;
    }
    
    #filterPanel .row .col-md-6,
    #filterPanel .row .col-md-3 {
        margin-bottom: 15px;
    }
    
    #filterForm .d-flex {
        flex-direction: column;
        gap: 10px;
    }
    
    #filterForm .btn {
        width: 100%;
    }
    
    .user-filter-options {
        padding: 6px;
        gap: 8px;
    }
    
    .user-filter-options .form-check-label {
        font-size: 0.8rem;
    }
}

/* Small screens - shrink further if needed */
@media (max-width: 576px) {
    .user-filter-options {
        gap: 6px;
        padding: 6px;
    }
    
    .user-filter-options .form-check-label {
        font-size: 0.75rem;
    }
    
    .user-filter-options .form-check-input {
        width: 0.875rem;
        height: 0.875rem;
        margin-right: 0.2rem;
    }
}

/* Filter Dropdown */
.dropdown-menu {
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.dropdown-item {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    color: #0d6efd;
}

/* Pagination */
.pagination .page-link {
    border-radius: 6px;
    margin: 0 2px;
    border: 1px solid #dee2e6;
    color: #28a745;
    background-color: #fff;
    transition: all 0.2s ease;
}

.pagination .page-link:hover {
    background-color: #28a745;
    border-color: #28a745;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

.pagination .page-item.active .page-link {
    background-color: #28a745;
    border-color: #28a745;
    color: #fff;
    font-weight: 600;
}

.pagination .page-item.disabled .page-link {
    color: #6c757d;
    background-color: #f8f9fa;
    border-color: #dee2e6;
    cursor: not-allowed;
}

.pagination .page-item.disabled .page-link:hover {
    color: #6c757d;
    background-color: #f8f9fa;
    border-color: #dee2e6;
    transform: none;
    box-shadow: none;
}

/* Loading States */
.loading-component {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.progress-container-component {
    width: 200px;
    height: 4px;
    background-color: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar-component {
    height: 100%;
    background: linear-gradient(90deg, #0d6efd, #6610f2);
    border-radius: 2px;
    animation: progress-animation 1.5s ease-in-out infinite;
}

.loading-text-component {
    color: #6c757d;
    font-size: 0.9rem;
}

@keyframes progress-animation {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Table Wrapper for Top Scrollbar */
.table-wrapper {
    position: relative;
}

/* Top Scrollbar */
.table-scrollbar-top {
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid #dee2e6;
    border-bottom: none;
    border-radius: 0.375rem 0.375rem 0 0;
    height: 17px;
    margin-bottom: -1px;
}

.table-scrollbar-content {
    height: 1px;
    width: 100%;
}

/* Custom Scrollbar for Top Scrollbar */
.table-scrollbar-top::-webkit-scrollbar {
    height: 8px;
}

.table-scrollbar-top::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-scrollbar-top::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.table-scrollbar-top::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Table Responsive Fixes for Mobile Horizontal Scrolling */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #dee2e6;
    border-radius: 0 0 0.375rem 0.375rem;
}

/* Ensure table has minimum width for horizontal scrolling */
#serviceLogTable {
    min-width: 1000px;
    width: 100%;
}

/* Responsive Design */
@media (max-width: 768px) {
    .search-container {
        width: 100%;
        margin-bottom: 15px;
    }
    
    .action-left {
        flex-direction: column;
        align-items: stretch;
    }
    
    .action-left .btn {
        margin: 2px 0;
    }
    
    .table-responsive {
        font-size: 0.8rem;
        margin: 0 -15px; /* Extend to full width on mobile */
        border-left: none;
        border-right: none;
        border-radius: 0;
    }
    
    .table th,
    .table td {
        padding: 8px 4px;
        white-space: nowrap; /* Prevent text wrapping */
    }
    
    .message-preview {
        max-width: 120px;
    }
    
    .action-btn {
        padding: 2px 4px;
        font-size: 0.7rem;
    }
}

@media (max-width: 576px) {
    /* All columns are now shown and scrollable horizontally */
    
    .merchant-column {
        min-width: 100px;
        max-width: 130px;
    }
    
    .merchant-info {
        gap: 4px;
    }
    
    .merchant-id-badge {
        font-size: 0.65rem;
        padding: 2px 6px;
        min-width: 30px;
    }
    
    .merchant-name-text {
        font-size: 0.7rem;
    }
    
    .modal-dialog {
        margin: 10px;
    }
    
    .modal-body .row .col-md-6 {
        margin-bottom: 10px;
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #dee2e6;
}

.empty-state h4 {
    color: #495057;
    margin-bottom: 10px;
}

.empty-state p {
    margin-bottom: 20px;
}

/* Toast Notifications */
.toast {
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.toast-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.toast-icon {
    margin-right: 8px;
}

/* Data Table Enhancements */
.table tbody tr {
    transition: all 0.2s ease;
}

/* Enhanced table hover effect with transform */
.table tbody tr:hover {
    background-color: #e3f2fd;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Specific service log table enhanced hover effect */
#serviceLogTable.table-hover tbody tr:hover,
#serviceLogTable tbody tr:hover,
#serviceLogTable tr:hover {
    background-color: #e3f2fd !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

/* Form Validation */
.is-invalid {
    border-color: #dc3545;
}

.invalid-feedback {
    display: block;
    font-size: 0.875rem;
    color: #dc3545;
}

/* Custom Scrollbar */
.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* User's Own Service Log Highlighting */
.service-log-row-own {
    background-color: #e3f2fd !important;
    border-left: 5px solid #2196f3 !important;
    box-shadow: 0 2px 4px rgba(33, 150, 243, 0.1) !important;
}

.service-log-row-own:hover {
    background-color: #bbdefb !important;
    box-shadow: 0 4px 8px rgba(33, 150, 243, 0.2) !important;
}

.service-log-row-own td {
    border-top: 1px solid #bbdefb !important;
    border-bottom: 1px solid #bbdefb !important;
}

.service-log-row-own .assigned-to-own {
    font-weight: 600;
    color: #1976d2;
}

/* Highlight the title column for user's own service logs */
.service-log-row-own td:first-child {
    background-color: rgba(33, 150, 243, 0.1) !important;
    font-weight: bold;
}

.service-log-row-own td:first-child:hover {
    background-color: rgba(33, 150, 243, 0.2) !important;
}

/* Time remaining styling */
.time-remaining-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Created date column styling - same as expire date */
.created-date-column .time-remaining-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.created-date-column .time-remaining {
    font-size: 0.85rem;
    font-weight: 500;
    color: #495057;
}

.created-date-column .expire-date {
    font-size: 0.75rem;
    color: #6c757d;
    opacity: 0.8;
    white-space: nowrap;
}

/* New created date container styling */
.created-date-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.created-date-message {
    font-size: 0.85rem;
    font-weight: 500;
    color: #495057;
    white-space: nowrap;
}

.created-date-value {
    font-size: 12px;
    color: #6c757d;
    opacity: 0.8;
    white-space: nowrap;
}

.time-remaining {
    font-weight: 500;
    white-space: nowrap;
}

.time-remaining i {
    margin-right: 4px;
}

.expire-date {
    font-size: 0.8rem;
    opacity: 0.8;
    white-space: nowrap;
}

/* Merchant column - horizontal layout */
.merchant-column {
    min-width: 140px;
    max-width: 180px;
    font-size: 0.8rem;
}

.merchant-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.merchant-id-badge {
    background-color: #e9ecef;
    color: #495057;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-block;
    min-width: 35px;
    text-align: center;
    flex-shrink: 0;
}

.merchant-name-text {
    color: #495057;
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    font-weight: 500;
    flex: 1;
    min-width: 0;
}

/* Make the table more compact overall */
#serviceLogTable {
    font-size: 0.85rem;
}

#serviceLogTable th,
#serviceLogTable td {
    padding: 0.4rem 0.5rem;
}

/* Make the Created Date column compact */
.table th:nth-child(7),
.table td:nth-child(7) {
    min-width: 100px;
    width: 100px;
}

/* Make the Follow Up Due column wider to accommodate both time and date */
.table th:nth-child(8),
.table td:nth-child(8) {
    min-width: 140px;
    width: 140px;
}

/* Make the Priority column compact */
.table th:nth-child(9),
.table td:nth-child(9) {
    min-width: 70px;
    width: 70px;
    text-align: center;
}

/* Make the Status column compact */
.table th:nth-child(10),
.table td:nth-child(10) {
    min-width: 100px;
    width: 100px;
}

/* Make the Dependency column compact */
.table th:nth-child(11),
.table td:nth-child(11) {
    min-width: 80px;
    width: 80px;
}

/* Make the actions column compact for Edit/Delete buttons */
.table th:nth-child(12),
.table td:nth-child(12) {
    min-width: 100px;
    width: 100px;
}

/* Resolved service log row styling - grayed out */
.service-log-row-resolved {
    background-color: #ffffff !important;
    opacity: 0.7;
    color: #6c757d !important;
}

.service-log-row-resolved:hover {
    background-color: #f8f9fa !important;
    opacity: 0.8;
}

.service-log-row-resolved td {
    border-top: 1px solid #e9ecef !important;
    border-bottom: 1px solid #e9ecef !important;
    color: #6c757d !important;
}

.service-log-row-resolved strong {
    color: #6c757d !important;
    text-decoration: line-through;
}

.service-log-row-resolved .status-badge {
    opacity: 0.6;
}

.service-log-row-resolved .priority-badge {
    opacity: 0.6;
}

.service-log-row-resolved .type-badge {
    opacity: 0.6;
}

/* Expired service log row styling - highlighted with red (same as overdue reminder card) */
#serviceLogTable tbody tr.service-log-row-expired {
    background-color: #ffeaea !important; /* Light red - same as overdue reminder card */
    border-left: 4px solid #dc3545 !important;
}

#serviceLogTable tbody tr.service-log-row-expired:hover {
    background-color: #ffd6d6 !important;
}

#serviceLogTable tbody tr.service-log-row-expired:hover td {
    background-color: #ffd6d6 !important;
}

#serviceLogTable tbody tr.service-log-row-expired td {
    background-color: #ffeaea !important; /* Light red - same as overdue reminder card */
    border-top: 1px solid #ffd6d6 !important;
    border-bottom: 1px solid #ffd6d6 !important;
}

.service-log-row-expired strong {
    color: #721c24 !important;
    font-weight: bold;
}

/* Pending service log row styling - highlighted with yellow (same as pending reminder card) */
#serviceLogTable tbody tr.service-log-row-pending {
    background-color: #fffaca !important; /* Light yellow - same as pending reminder card */
    border-left: 4px solid #ffc107 !important;
}

#serviceLogTable tbody tr.service-log-row-pending:hover {
    background-color: #fff8b3 !important;
}

#serviceLogTable tbody tr.service-log-row-pending:hover td {
    background-color: #fff8b3 !important;
}

#serviceLogTable tbody tr.service-log-row-pending td {
    background-color: #fffaca !important; /* Light yellow - same as pending reminder card */
    border-top: 1px solid #fff8b3 !important;
    border-bottom: 1px solid #fff8b3 !important;
}

.service-log-row-pending strong {
    color: #856404 !important;
    font-weight: bold;
}

/* Ensure expired/overdue always overrides pending when both classes are present */
#serviceLogTable tbody tr.service-log-row-expired.service-log-row-pending,
#serviceLogTable tbody tr.service-log-row-pending.service-log-row-expired {
    background-color: #ffeaea !important; /* Override to red when overdue */
}

#serviceLogTable tbody tr.service-log-row-expired.service-log-row-pending:hover,
#serviceLogTable tbody tr.service-log-row-pending.service-log-row-expired:hover {
    background-color: #ffd6d6 !important;
}

#serviceLogTable tbody tr.service-log-row-expired.service-log-row-pending td,
#serviceLogTable tbody tr.service-log-row-pending.service-log-row-expired td {
    background-color: #ffeaea !important; /* Override to red when overdue */
}

#serviceLogTable tbody tr.service-log-row-expired.service-log-row-pending:hover td,
#serviceLogTable tbody tr.service-log-row-pending.service-log-row-expired:hover td {
    background-color: #ffd6d6 !important;
}

/* Priority-based row background colors - ONLY for overdue and pending tickets */
/* Intensity increases with priority level */

/* Overdue tickets with priority colors - deeper red for higher priority */
/* Low priority overdue: lightest red (default expired color) */
#serviceLogTable tbody tr.service-log-row-expired.service-log-row-priority-low {
    background-color: #ffeaea !important;
}

#serviceLogTable tbody tr.service-log-row-expired.service-log-row-priority-low:hover {
    background-color: #ffd6d6 !important;
}

#serviceLogTable tbody tr.service-log-row-expired.service-log-row-priority-low:hover td {
    background-color: #ffd6d6 !important;
}

#serviceLogTable tbody tr.service-log-row-expired.service-log-row-priority-low td {
    background-color: #ffeaea !important;
    border-top: 1px solid #ffd6d6 !important;
    border-bottom: 1px solid #ffd6d6 !important;
}

/* Medium priority overdue: deeper red */
#serviceLogTable tbody tr.service-log-row-expired.service-log-row-priority-medium {
    background-color: #ffcccc !important;
}

#serviceLogTable tbody tr.service-log-row-expired.service-log-row-priority-medium:hover {
    background-color: #ffb3b3 !important;
}

#serviceLogTable tbody tr.service-log-row-expired.service-log-row-priority-medium:hover td {
    background-color: #ffb3b3 !important;
}

#serviceLogTable tbody tr.service-log-row-expired.service-log-row-priority-medium td {
    background-color: #ffcccc !important;
    border-top: 1px solid #ffb3b3 !important;
    border-bottom: 1px solid #ffb3b3 !important;
}

/* High priority overdue: even deeper red */
#serviceLogTable tbody tr.service-log-row-expired.service-log-row-priority-high {
    background-color: #ff9999 !important;
}

#serviceLogTable tbody tr.service-log-row-expired.service-log-row-priority-high:hover {
    background-color: #ff8080 !important;
}

#serviceLogTable tbody tr.service-log-row-expired.service-log-row-priority-high:hover td {
    background-color: #ff8080 !important;
}

#serviceLogTable tbody tr.service-log-row-expired.service-log-row-priority-high td {
    background-color: #ff9999 !important;
    border-top: 1px solid #ff8080 !important;
    border-bottom: 1px solid #ff8080 !important;
}

/* Critical priority overdue: deepest red */
#serviceLogTable tbody tr.service-log-row-expired.service-log-row-priority-critical {
    background-color: #ff6666 !important;
}

#serviceLogTable tbody tr.service-log-row-expired.service-log-row-priority-critical:hover {
    background-color: #ff4d4d !important;
}

#serviceLogTable tbody tr.service-log-row-expired.service-log-row-priority-critical:hover td {
    background-color: #ff4d4d !important;
}

#serviceLogTable tbody tr.service-log-row-expired.service-log-row-priority-critical td {
    background-color: #ff6666 !important;
    border-top: 1px solid #ff4d4d !important;
    border-bottom: 1px solid #ff4d4d !important;
}

/* Pending tickets with priority colors - warmer yellow for higher priority */
/* More obvious color differences between priority levels */
/* Low priority pending: lightest yellow */
#serviceLogTable tbody tr.service-log-row-pending.service-log-row-priority-low {
    background-color: #fffaca !important;
}

#serviceLogTable tbody tr.service-log-row-pending.service-log-row-priority-low:hover {
    background-color: #fff8b3 !important;
}

#serviceLogTable tbody tr.service-log-row-pending.service-log-row-priority-low:hover td {
    background-color: #fff8b3 !important;
}

#serviceLogTable tbody tr.service-log-row-pending.service-log-row-priority-low td {
    background-color: #fffaca !important;
    border-top: 1px solid #fff8b3 !important;
    border-bottom: 1px solid #fff8b3 !important;
}

/* Medium priority pending: noticeably darker/warmer yellow than Low */
#serviceLogTable tbody tr.service-log-row-pending.service-log-row-priority-medium {
    background-color: #fff8d0 !important;
}

#serviceLogTable tbody tr.service-log-row-pending.service-log-row-priority-medium:hover {
    background-color: #fff6b8 !important;
}

#serviceLogTable tbody tr.service-log-row-pending.service-log-row-priority-medium:hover td {
    background-color: #fff6b8 !important;
}

#serviceLogTable tbody tr.service-log-row-pending.service-log-row-priority-medium td {
    background-color: #fff8d0 !important;
    border-top: 1px solid #fff6b8 !important;
    border-bottom: 1px solid #fff6b8 !important;
}

/* High priority pending: much warmer yellow */
#serviceLogTable tbody tr.service-log-row-pending.service-log-row-priority-high {
    background-color: #fff5b0 !important;
}

#serviceLogTable tbody tr.service-log-row-pending.service-log-row-priority-high:hover {
    background-color: #fff398 !important;
}

#serviceLogTable tbody tr.service-log-row-pending.service-log-row-priority-high:hover td {
    background-color: #fff398 !important;
}

#serviceLogTable tbody tr.service-log-row-pending.service-log-row-priority-high td {
    background-color: #fff5b0 !important;
    border-top: 1px solid #fff398 !important;
    border-bottom: 1px solid #fff398 !important;
}

/* Critical priority pending: warmest yellow-orange */
#serviceLogTable tbody tr.service-log-row-pending.service-log-row-priority-critical {
    background-color: #fff084 !important;
}

#serviceLogTable tbody tr.service-log-row-pending.service-log-row-priority-critical:hover {
    background-color: #ffee6c !important;
}

#serviceLogTable tbody tr.service-log-row-pending.service-log-row-priority-critical:hover td {
    background-color: #ffee6c !important;
}

#serviceLogTable tbody tr.service-log-row-pending.service-log-row-priority-critical td {
    background-color: #fff084 !important;
    border-top: 1px solid #ffee6c !important;
    border-bottom: 1px solid #ffee6c !important;
}

/* Urgent time remaining (less than 1 hour) */
.time-urgent {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Status buttons styling */
.status-buttons {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Quick status buttons - more compact */
.status-buttons .status-btn {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    min-width: 70px;
}

/* Disabled status buttons */
.status-buttons .status-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.status-buttons .status-btn.disabled:hover {
    opacity: 0.5;
    transform: none;
}

.status-btn {
    font-size: 0.75rem;
    padding: 4px 8px;
    white-space: nowrap;
    min-width: 80px;
}

.status-btn i {
    margin-right: 4px;
}

/* New Service Ticket Modal Styles */
.modal-body .form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

.modal-body .form-control,
.modal-body .form-select {
    border-radius: 6px;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.modal-body .form-control:focus,
.modal-body .form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Date picker input group styling */
.input-group .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left: 0;
}

.input-group .btn:hover {
    background-color: #e9ecef;
    border-color: #ced4da;
}

/* Time input styling */
input[type="time"] {
    font-family: monospace;
    position: relative;
    z-index: 1;
}

input[type="time"]::-webkit-calendar-picker-indicator {
    background: transparent;
    bottom: 0;
    color: transparent;
    cursor: pointer;
    height: auto;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    width: auto;
    z-index: 2;
}

/* Ensure time inputs don't interfere with other form elements */
input[type="time"]:focus {
    z-index: 3;
    position: relative;
}

/* Fix for flatpickr z-index issues */
.flatpickr-calendar {
    z-index: 9999 !important;
}

/* Ensure form elements have proper stacking context */
.modal-body .form-control,
.modal-body .form-select {
    position: relative;
    z-index: 1;
}

.modal-body .form-control:focus,
.modal-body .form-select:focus {
    z-index: 2;
}

/* Character counter styling */
.form-text {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* Required field indicator */
.text-danger {
    color: #dc3545 !important;
}

/* Hidden field styling */
.mb-3[style*="display: none"] {
    display: none !important;
}

/* Auto-populated field styling */
#merchantName {
    background-color: #f8f9fa;
    color: #6c757d;
    font-style: italic;
}

#merchantName:focus {
    background-color: #fff;
    color: #495057;
    font-style: normal;
}

/* Hide merchant selected info display for service log modal and filter */
#merchantAutocompleteContainer #merchantId_selectedInfo,
#merchantSearchContainer #merchantSearch_selectedInfo {
    display: none !important;
}

/* Readonly date field styling */
.readonly-field {
    background-color: #e9ecef !important;
    color: #495057 !important;
    cursor: not-allowed !important;
    opacity: 0.8;
}

.readonly-field:focus {
    background-color: #e9ecef !important;
    border-color: #ced4da !important;
    box-shadow: none !important;
}

/* Compact date fields styling */
.form-label.small {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.input-group-sm .form-control {
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    height: calc(1.5em + 0.5rem + 2px);
}

.input-group-sm .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    height: calc(1.5em + 0.5rem + 2px);
}

/* Responsive date fields - stack on mobile */
@media (max-width: 768px) {
    .row.mb-3 .col-md-6 {
        margin-bottom: 0.75rem;
    }
    
    .input-group-sm .form-control {
        font-size: 0.8rem;
        padding: 0.2rem 0.4rem;
    }
    
    .input-group-sm .btn {
        font-size: 0.8rem;
        padding: 0.2rem 0.4rem;
    }
}

/* Disabled calendar button styling */
#dateIssueReportedBtn.disabled {
    background-color: #e9ecef !important;
    border-color: #ced4da !important;
    color: #6c757d !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

#dateIssueReportedBtn.disabled:hover {
    background-color: #e9ecef !important;
    border-color: #ced4da !important;
    color: #6c757d !important;
}

/* Textarea character limit styling */
textarea[maxlength] {
    resize: vertical;
}

/* Product Dropdown Checkbox Styles */
.product-dropdown-container {
    position: relative;
}

.product-dropdown-toggle {
    text-align: left;
    cursor: pointer;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 0.375rem 0.75rem;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    background-image: none !important;
}

.product-dropdown-toggle:hover {
    border-color: #adb5bd;
}

.product-dropdown-toggle:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    outline: 0;
}

.product-dropdown-toggle i {
    transition: transform 0.2s ease;
}

.product-dropdown-toggle[aria-expanded="true"] i {
    transform: rotate(180deg);
}

.product-dropdown-menu {
    width: 100%;
    max-height: none;
    overflow-y: visible;
    border: 1px solid #ced4da;
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    background-color: #fff;
    z-index: 1000;
    padding: 0.5rem 0;
}

.product-dropdown-item {
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
}

.product-dropdown-item:hover {
    background-color: #f8f9fa;
}

/* Ensure checkbox and label are clickable */
.product-dropdown-item .form-check-input,
.product-dropdown-item .form-check-label {
    z-index: 1;
    position: relative;
}

.product-dropdown-item .form-check-input {
    margin-right: 0.75rem;
    margin-top: 0;
    cursor: pointer;
    pointer-events: auto;
}

.product-dropdown-item .form-check-label {
    margin-bottom: 0;
    cursor: pointer;
    flex: 1;
    font-size: 0.9rem;
    pointer-events: auto;
    user-select: none;
}

.product-dropdown-item .form-check-input:checked + .form-check-label {
    font-weight: 500;
    color: #0d6efd;
}

/* Custom scrollbar for dropdown */
.product-dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.product-dropdown-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.product-dropdown-menu::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.product-dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Selected products display */
.product-selected-text {
    color: #495057;
    font-size: 0.9rem;
}

.product-selected-text.has-selection {
    color: #0d6efd;
    font-weight: 500;
}

/* Validation styling */
.product-dropdown-toggle.is-invalid {
    border-color: #ced4da;
    background-image: none !important;
    padding-right: 0.75rem !important;
}

.product-dropdown-toggle.is-invalid:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    background-image: none !important;
}

/* Hide validation feedback icon */
.product-dropdown-container .invalid-feedback,
.product-dropdown-container .is-invalid ~ .invalid-feedback,
.product-dropdown-toggle.is-invalid::after {
    display: none !important;
    content: none !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .product-dropdown-menu {
        max-height: none;
        overflow-y: visible;
    }
    
    .product-dropdown-item {
        padding: 0.4rem 0.8rem;
    }
    
    .product-dropdown-item .form-check-label {
        font-size: 0.85rem;
    }
}

/* Calendar button styling */
.btn-outline-secondary {
    border-color: #ced4da;
    color: #6c757d;
}

.btn-outline-secondary:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
    color: #495057;
}

/* Form validation styling */
.form-control.is-invalid {
    border-color: #dc3545;
}

.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #dc3545;
}

/* Table Sorting Styles */
.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.sortable:hover {
    background-color: #4d5154;
}

.sortable i {
    transition: color 0.2s ease;
}

.sortable:hover i {
    color: #fff;
}

/* New Table Column Styles */
.reason-badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 500;
    background-color: #e3f2fd;
    color: #1976d2;
}

.reason-detail-preview {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    font-size: 0.85rem;
}

.reason-detail-preview:hover {
    color: #0d6efd;
}

.contact-mode-badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 500;
    background-color: #f3e5f5;
    color: #7b1fa2;
}

.time-spent-badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 500;
    background-color: #e8f5e8;
    color: #2e7d32;
}

.date-column {
    font-size: 0.8rem;
    white-space: nowrap;
}

.follow-up-column {
    font-size: 0.8rem;
    white-space: normal;
}

.follow-up-container {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.follow-up-message {
    display: block;
}

.follow-up-date {
    font-size: 12px;
    color: #6c757d;
    margin-top: 2px;
}

.follow-up-today {
    color: #dc3545;
    font-weight: bold;
}

.follow-up-expired {
    color: #dc3545;
    font-weight: bold;
}

/* Action buttons styling */
.action-buttons {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.action-buttons .action-btn {
    padding: 4px 8px;
    font-size: 0.75rem;
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* CSV Export Container */
.csv-export-container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0 15px;
}

.csv-export-container .btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.csv-export-container .btn:hover {
    transform: translateY(-1px);
}

.csv-export-container .btn-outline-success:hover {
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

.csv-export-container .btn-outline-primary:hover {
    box-shadow: 0 2px 4px rgba(13, 110, 253, 0.3);
}

.csv-export-container .btn:active {
    transform: translateY(0);
}

.csv-export-container .btn i {
    margin-right: 6px;
}

/* Table responsive adjustments */
@media (max-width: 1200px) {
    .table th,
    .table td {
        padding: 0.3rem 0.4rem;
        font-size: 0.8rem;
    }
    
    .merchant-name-text {
        max-width: 100px;
    }
    
    .reason-detail-preview {
        max-width: 80px;
    }
}

@media (max-width: 992px) {
    .table th,
    .table td {
        padding: 0.25rem 0.3rem;
        font-size: 0.75rem;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 2px;
    }
    
    .action-buttons .action-btn {
        min-width: 28px;
        height: 28px;
        font-size: 0.7rem;
    }
    
    .csv-export-container {
        padding: 0 10px;
    }
    
    .csv-export-container .btn {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Service Log Reminder Widgets */
.service-log-reminders {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

/* Medium desktop view (768px to 1199px) - same as mobile style (two columns, reordered) */
@media (min-width: 768px) and (max-width: 1199px) {
    .service-log-reminders {
        grid-template-columns: repeat(2, 1fr);
        display: flex;
        flex-wrap: wrap;
    }
    
    /* Reorder cards: My Overdue, All Overdue, My Pending, All Pending, My Open, All Open */
    .service-log-reminders .reminder-card:nth-child(1) {
        order: 1; /* My Overdue */
    }
    
    .service-log-reminders .reminder-card:nth-child(4) {
        order: 2; /* All Overdue */
    }
    
    .service-log-reminders .reminder-card:nth-child(2) {
        order: 3; /* My Pending */
    }
    
    .service-log-reminders .reminder-card:nth-child(5) {
        order: 4; /* All Pending */
    }
    
    .service-log-reminders .reminder-card:nth-child(3) {
        order: 5; /* My Open */
    }
    
    .service-log-reminders .reminder-card:nth-child(6) {
        order: 6; /* All Open */
    }
    
    .service-log-reminders .reminder-card {
        min-width: auto;
        padding: 10px;
        width: calc(50% - 5px); /* Two columns with gap */
    }
    
    .service-log-reminders .reminder-icon {
        width: 35px;
        height: 35px;
        font-size: 1rem;
        margin-right: 8px;
    }
    
    .service-log-reminders .reminder-info h5 {
        font-size: 0.75rem;
    }
    
    .service-log-reminders .reminder-number {
        font-size: 1.1rem;
    }
}

/* Medium-large desktop view (1200px to 1301px) - shrunk to fit one row, original order */
@media (min-width: 1200px) and (max-width: 1301px) {
    .service-log-reminders {
        flex-wrap: nowrap; /* Force single row */
    }
    
    .service-log-reminders .reminder-card {
        flex: 1 1 0; /* Flexible width to fit in one row */
        min-width: 0; /* Allow shrinking */
        padding: 10px; /* Reduced padding */
        order: 0; /* Original order */
    }
    
    /* Add padding between My Open (3rd card) and All Overdue (4th card) */
    .service-log-reminders .reminder-card:nth-child(4) {
        margin-left: 35px;
    }
    
    .service-log-reminders .reminder-icon {
        width: 35px; /* Reduced size */
        height: 35px; /* Reduced size */
        font-size: 1rem; /* Reduced size */
        margin-right: 8px; /* Reduced margin */
    }
    
    .service-log-reminders .reminder-info h5 {
        font-size: 0.75rem; /* Reduced size */
    }
    
    .service-log-reminders .reminder-number {
        font-size: 1.1rem; /* Reduced size */
    }
}

/* Large desktop view (1302px and above) - previous desktop style (fixed width, original order) */
@media (min-width: 1302px) {
    .service-log-reminders .reminder-card {
        width: 160px;
        flex: 0 0 160px; /* Fixed width, don't grow or shrink */
        min-width: 140px; /* Restore original min-width */
        padding: 12px; /* Restore original padding */
        order: 0; /* Reset order to original */
    }
    
    /* Add padding between My Open (3rd card) and All Overdue (4th card) */
    .service-log-reminders .reminder-card:nth-child(4) {
        margin-left: 35px;
    }
    
    .service-log-reminders .reminder-icon {
        width: 40px; /* Restore original size */
        height: 40px; /* Restore original size */
        font-size: 1.2rem; /* Restore original size */
        margin-right: 10px; /* Restore original margin */
    }
    
    .service-log-reminders .reminder-info h5 {
        font-size: 0.85rem; /* Restore original size */
    }
    
    .service-log-reminders .reminder-number {
        font-size: 1.3rem; /* Restore original size */
    }
}

.service-log-reminders-mobile {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.reminder-card {
    background-color: white;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    min-width: 140px;
}

.reminder-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.05);
}

.reminder-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-right: 10px;
    flex-shrink: 0;
}

/* Overdue cards - Light red background */
.reminder-overdue {
    background-color: #ffeaea; /* Light red */
}

.reminder-overdue.zero-count {
    background-color: #ffffff; /* White when count is zero */
}

.reminder-overdue .reminder-icon {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

/* Pending cards - Light yellow background */
.reminder-pending {
    background-color: #fffaca; /* Light yellow */
}

.reminder-pending.zero-count {
    background-color: #ffffff; /* White when count is zero */
}

.reminder-pending .reminder-icon {
    background-color: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

/* Open cards - Light green background */
.reminder-open {
    background-color: #e8ffec; /* Light green */
}

.reminder-open.zero-count {
    background-color: #ffffff; /* White when count is zero */
}

.reminder-open .reminder-icon {
    background-color: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.reminder-info {
    flex: 1;
}

.reminder-info h5 {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 4px;
    margin: 0 0 4px 0;
}

.reminder-number {
    font-size: 1.3rem;
    font-weight: 600;
    color: #212529;
    margin: 0;
}

/* Mobile adjustments */
@media (max-width: 767.98px) {
    .service-log-reminders-mobile {
        grid-template-columns: repeat(2, 1fr);
        display: flex;
        flex-wrap: wrap;
    }
    
    /* Reorder cards for mobile: My Overdue, All Overdue, My Pending, All Pending, My Open, All Open */
    .service-log-reminders-mobile .reminder-card:nth-child(1) {
        order: 1; /* My Overdue */
    }
    
    .service-log-reminders-mobile .reminder-card:nth-child(4) {
        order: 2; /* All Overdue */
    }
    
    .service-log-reminders-mobile .reminder-card:nth-child(2) {
        order: 3; /* My Pending */
    }
    
    .service-log-reminders-mobile .reminder-card:nth-child(5) {
        order: 4; /* All Pending */
    }
    
    .service-log-reminders-mobile .reminder-card:nth-child(3) {
        order: 5; /* My Open */
    }
    
    .service-log-reminders-mobile .reminder-card:nth-child(6) {
        order: 6; /* All Open */
    }
    
    .reminder-card {
        min-width: auto;
        padding: 10px;
        width: calc(50% - 5px); /* Two columns with gap */
    }
    
    .reminder-icon {
        width: 35px;
        height: 35px;
        font-size: 1rem;
        margin-right: 8px;
    }
    
    .reminder-info h5 {
        font-size: 0.75rem;
    }
    
    .reminder-number {
        font-size: 1.1rem;
    }
}
