/* static/css/styles.css */

/* Enhanced Responsive Design - Making all pages responsive */
/* This section ensures all HTML pages are fully responsive */

/* Base responsive improvements */
* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-x: hidden;
    /* Theme-aware background and text colors */
    background-color: var(--light-bg-primary);
    color: var(--light-text-primary);
}

/* Container responsive improvements */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 15px;
    padding-right: 15px;
}

.container-fluid {
    padding-left: 15px;
    padding-right: 15px;
}

/* Responsive typography */
h1, h2, h3, h4, h5, h6 {
    word-wrap: break-word;
    line-height: 1.2;
}

/* Responsive images */
img {
    max-width: 100%;
    height: auto;
}

/* Responsive tables - Enhanced */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    border: 0;
}

.table {
    width: 100%;
    margin-bottom: 1rem;
    background-color: transparent;
}

/* Mobile-first table approach */
@media (max-width: 768px) {
    .table-responsive {
        border: 0;
    }
    
    .table {
        border: 0;
    }
    
    .table thead {
        display: none;
    }
    
    .table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #dee2e6;
        border-radius: 0.375rem;
        background-color: #fff;
        box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    }
    
    .table tbody td {
        display: block;
        text-align: left;
        padding: 0.75rem;
        border: none;
        border-bottom: 1px solid #dee2e6;
        position: relative;
        padding-left: 50%;
    }
    
    .table tbody td:last-child {
        border-bottom: none;
    }
    
    .table tbody td:first-child {
        border-top-left-radius: 0.375rem;
        border-top-right-radius: 0.375rem;
        font-weight: bold;
        background-color: #f8f9fa;
    }
    
    .table tbody td::before {
        content: attr(data-label) ": ";
        position: absolute;
        left: 0.75rem;
        width: 45%;
        font-weight: bold;
        text-align: left;
    }
    
    /* Special handling for action buttons in mobile view */
    .table tbody td[data-label="Actions"] {
        /* behave like other cells: label on left, content on right */
        padding-left: 50%;
        text-align: left;
    }
    
    .table tbody td[data-label="Actions"]::before {
        /* same positioning as default label */
        content: attr(data-label) ": ";
        position: absolute;
        left: 0.75rem;
        width: 45%;
        font-weight: bold;
        text-align: left;
        font-size: 0.875rem;
    }
    
    .table tbody td[data-label="Actions"] .btn-group {
        display: inline-flex;
        justify-content: flex-start;
        align-items: center;
        gap: 0.375rem;
        flex-wrap: nowrap;
        width: auto;
    }
    
    .table tbody td[data-label="Actions"] .btn-group .btn {
        flex: 0 0 auto; /* keep natural size */
        width: 36px;
        height: 36px;
        padding: 0; /* square, icon only */
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 0.375rem;
    }
    
    .table tbody td[data-label="Actions"] .btn-group .btn i {
        font-size: 0.95rem;
        line-height: 1;
    }
}

/* Responsive forms */
.form-group {
    margin-bottom: 1rem;
}

.form-control {
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Responsive buttons */
.btn {
    display: inline-block;
    font-weight: 400;
    text-align: center;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.375rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    text-decoration: none;
    cursor: pointer;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Responsive cards */
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    word-wrap: break-word;
    background-color: #fff;
    background-clip: border-box;
    border: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.card-header {
    padding: 0.75rem 1.25rem;
    margin-bottom: 0;
    background-color: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    font-weight: bold;
    font-size: 1.2em;
}

.card-body {
    flex: 1 1 auto;
    padding: 1.25rem;
}

/* Responsive navigation */
.navbar {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
}

.navbar-brand {
    display: inline-block;
    padding-top: 0.3125rem;
    padding-bottom: 0.3125rem;
    margin-right: 1rem;
    font-size: 1.25rem;
    line-height: inherit;
    white-space: nowrap;
}

.navbar-nav {
    display: flex;
    flex-direction: column;
    padding-left: 0;
    margin-bottom: 0;
    list-style: none;
}

.navbar-nav .nav-link {
    padding-right: 0;
    padding-left: 0;
}

.navbar-toggler {
    padding: 0.25rem 0.75rem;
    font-size: 1.25rem;
    line-height: 1;
    background-color: transparent;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    transition: box-shadow 0.15s ease-in-out;
}

/* Responsive modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1055;
    display: none;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    outline: 0;
}

.modal-dialog {
    position: relative;
    width: auto;
    margin: 0.5rem;
    pointer-events: none;
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 0.375rem;
    outline: 0;
}

.modal-header {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    border-top-left-radius: calc(0.375rem - 1px);
    border-top-right-radius: calc(0.375rem - 1px);
}

.modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 1rem;
}

/* Responsive grid system */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -0.75rem;
    margin-left: -0.75rem;
}

.col, .col-1, .col-2, .col-3, .col-4, .col-5, .col-6, 
.col-7, .col-8, .col-9, .col-10, .col-11, .col-12 {
    position: relative;
    width: 100%;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}

/* Responsive pagination */
.pagination {
    display: flex;
    padding-left: 0;
    list-style: none;
    border-radius: 0.375rem;
    flex-wrap: wrap;
    justify-content: center;
}

.page-link {
    position: relative;
    display: block;
    padding: 0.5rem 0.75rem;
    margin-left: -1px;
    line-height: 1.25;
    color: #007bff;
    background-color: #fff;
    border: 1px solid #dee2e6;
    text-decoration: none;
}

/* Responsive alerts */
.alert {
    position: relative;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
}

/* Responsive jumbotron */
.jumbotron {
    padding: 2rem 1rem;
    margin-bottom: 2rem;
    background-color: #e9ecef;
    border-radius: 0.375rem;
}

/* Responsive list groups */
.list-group {
    display: flex;
    flex-direction: column;
    padding-left: 0;
    margin-bottom: 0;
    border-radius: 0.375rem;
}

.list-group-item {
    position: relative;
    display: block;
    padding: 0.75rem 1.25rem;
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.125);
    text-decoration: none;
    color: inherit;
}

.list-group-item:first-child {
    border-top-left-radius: inherit;
    border-top-right-radius: inherit;
}

.list-group-item:last-child {
    border-bottom-right-radius: inherit;
    border-bottom-left-radius: inherit;
}

/* Enhanced mobile responsiveness */
@media (max-width: 768px) {
    /* Typography adjustments */
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.125rem; }
    h5 { font-size: 1rem; }
    h6 { font-size: 0.875rem; }
    
    /* Container adjustments */
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* Button adjustments */
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
        padding: 0.75rem 1rem;
        font-size: 1rem;
        min-height: 44px;
    }
    
    .btn + .btn {
        margin-left: 0;
    }
    
    /* Form adjustments */
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem;
        min-height: 44px;
    }
    
    /* Modal adjustments */
    .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    .modal-content {
        border-radius: 0.5rem;
    }
    
    /* Navigation adjustments */
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        border-bottom: 1px solid #dee2e6;
    }
    
    .navbar-nav .nav-link:last-child {
        border-bottom: none;
    }
    
    /* Card adjustments */
    .card {
        margin-bottom: 1rem;
        border-radius: 0.5rem;
    }
    
    .card-header {
        padding: 1rem;
        font-size: 1.1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    /* Table adjustments */
    .table tbody td {
        padding: 1rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .table tbody td::before {
        font-size: 0.85rem;
        font-weight: 600;
    }
    
    /* Pagination adjustments */
    .pagination .page-link {
        padding: 0.75rem;
        min-width: 44px;
        text-align: center;
    }
    
    /* Alert adjustments */
    .alert {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    /* Jumbotron adjustments */
    .jumbotron {
        padding: 1.5rem 1rem;
        margin-bottom: 1.5rem;
    }
    
    /* List group adjustments */
    .list-group-item {
        padding: 1rem;
        font-size: 1rem;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    /* Input group adjustments */
    .input-group {
        flex-direction: column;
    }
    
    .input-group > .form-control,
    .input-group > .input-group-append > .btn,
    .input-group > .input-group-prepend > .btn {
        border-radius: 0.375rem;
        margin-bottom: 0.5rem;
    }
    
    .input-group > .form-control:not(:last-child),
    .input-group > .input-group-append > .btn:not(:last-child),
    .input-group > .input-group-prepend > .btn:not(:last-child) {
        border-bottom-right-radius: 0;
        border-bottom-left-radius: 0;
        margin-bottom: 0;
    }
    
    .input-group > .form-control:not(:first-child),
    .input-group > .input-group-append > .btn:not(:first-child),
    .input-group > .input-group-prepend > .btn:not(:first-child) {
        border-top-left-radius: 0;
        border-top-right-radius: 0;
    }
}

/* Extra small devices */
@media (max-width: 576px) {
    .container {
        padding-left: 8px;
        padding-right: 8px;
    }
    
    .btn {
        padding: 0.875rem 1rem;
        font-size: 1rem;
    }
    
    .form-control {
        padding: 0.875rem;
    }
    
    .modal-dialog {
        margin: 5px;
        max-width: calc(100% - 10px);
    }
    
    .card-header {
        padding: 0.875rem;
    }
    
    .card-body {
        padding: 0.875rem;
    }
    
    .table tbody td {
        padding: 0.875rem 0.5rem;
        font-size: 0.85rem;
    }
    
    .table tbody td::before {
        font-size: 0.8rem;
        left: 0.5rem;
        width: 40%;
    }
    
    .pagination .page-link {
        padding: 0.875rem 0.5rem;
        font-size: 0.9rem;
    }
    
    .alert {
        padding: 0.875rem;
    }
    
    .jumbotron {
        padding: 1.25rem 0.875rem;
    }
    
    .list-group-item {
        padding: 0.875rem;
    }
}

/* Landscape orientation adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .modal-dialog {
        margin: 5px auto;
        max-height: calc(100vh - 10px);
    }
    
    .modal-body {
        max-height: calc(100vh - 120px);
        overflow-y: auto;
    }
    
    .navbar {
        padding: 0.25rem 1rem;
    }
    
    .container {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn:hover,
    .nav-link:hover,
    .dropdown-item:hover,
    .list-group-item:hover {
        transform: none;
        box-shadow: none;
    }
    
    .btn:active,
    .nav-link:active,
    .dropdown-item:active,
    .list-group-item:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    .table-responsive,
    .modal-body {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Improve touch targets */
    .btn,
    .nav-link,
    .dropdown-item,
    .list-group-item,
    .page-link {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* High DPI display optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .btn,
    .form-control,
    .card,
    .modal-content {
        border-width: 0.5px;
    }
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    .modal,
    .pagination {
        display: none !important;
    }
    
    .container {
        width: 100% !important;
        max-width: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
    
    .table {
        border-collapse: collapse !important;
    }
    
    .table td,
    .table th {
        border: 1px solid #000 !important;
        padding: 0.5rem !important;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus improvements for keyboard navigation */
.btn:focus,
.form-control:focus,
.nav-link:focus,
.dropdown-item:focus,
.page-link:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Existing styles continue below */
.table th, .table td {
    vertical-align: middle;

}
.pagination {
    flex-wrap: wrap;
}
.table-responsive {
    margin-top: 20px;
}
.card-header {
    font-weight: bold;
    font-size: 1.2em;
}
.photo-upload-box {
    position: relative;
    margin-top: 10px;
}
.upload-info {
    display: none;
    margin-top: 10px;
    font-size: 0.9em;
    color: green;
}
.error-info {
    display: none;
    margin-top: 10px;
    font-size: 0.9em;
    color: red;
}


.photo-upload-box {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px; /* Add spacing between elements */
    margin-top: 10px; /* Space from the top */
}

.file-input-group {
    display: flex;
    gap: 10px; /* Add spacing between the input and the button */
    align-items: center;
}

.upload-info,
.error-info {
    font-size: 0.9em;
    margin-top: 10px;
    display: none; /* Hide initially */
}

.upload-info.alert-success {
    color: #28a745; /* Success green */
}

.error-info.alert-danger {
    color: #dc3545; /* Error red */
}

a[data-toggle="modal"] {
    font-weight: normal;
    color: #007bff;
}



a[data-toggle="modal"]:hover {
    color: #0056b3;
    text-decoration: underline;
}
/* Color scheme for row backgrounds based on status */
.table-row-assigned {
    background-color: white; /* No background change */
    
}

.table-row-completed {
    background-color: #c6d4c6; /* Light green for completed tasks */
    
}

.table-row-started {
    background-color: #eaddbe; /* Light yellow for started tasks */
}

.table-row-order-0 {
    background-color: #f8f9fa;  /* Light gray */
}

.table-row-order-1 {
    background-color: #e8f5e9;  /* Very light green */
}

.table-row-order-2 {
    background-color: #c8e6c9;  /* Light green */
}

.table-row-order-3 {
    background-color: #a5d6a7;  /* Medium light green */
}

.table-row-order-4 {
    background-color: #81c784;  /* Medium green */
}

.table-row-order-5 {
    background-color: #66bb6a;  /* Darker green */
}

.table-row-default {
    background-color: white;    /* Fallback for values outside 0-5 */
}
.dashboard-container {
    padding: 20px;
}

.card {
    margin-bottom: 20px;
    border-radius: 10px;
}

.card-body {
    padding: 20px;
}

.image-thumbnail {
    width: 100px;
    height: 100px;
    object-fit: cover;
    margin-right: 10px;
    cursor: pointer;
    border-radius: 5px;
}

.modal-content img {
    width: 100%;
    height: auto;
}

.modal-body {
    padding: 25px;
}

.filter-container {
    margin-bottom: 20px;
}

.filter-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.apply-filters-btn {
    margin-top: 20px;
}

.assignment-info {
    margin-bottom: 10px;
}

.btn-info {
    margin-top: 15px;
}

.modal-header {
    border-bottom: 1px solid #dee2e6;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: bold;
}

.related-contacts-list {
    padding-left: 0;
}

.related-contacts-list li {
    list-style-type: none;
    margin-bottom: 8px;
}

.photos-container img {
    margin-bottom: 10px;
    border-radius: 5px;
}

.updated-row {
    background-color: #d4edda; /* Light green background */
}


/* changes from here */


    .status-created {
    background-color: #d1ecf1;
    color: #0c5460;
    }

    .status-submitted {
    background-color: #fff3cd;
    color: #856404;
    }

    .file-input-group {
        display: flex;
    gap: 10px;
    align-items: center;
    }

    .table-responsive {
        overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    }

/* Enhanced mobile table styles */
@media (max-width: 768px) {
    .table-responsive table {
        border: 0;
    }
  
    .table thead {
      display: none;
    }
  
    .table tbody tr {
      display: block;
      margin-bottom: 1rem;
      border: 1px solid #dee2e6;
        border-radius: 0.375rem;
        background-color: #fff;
        box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    }
  
    .table tbody td {
      display: block;
      text-align: left;
        padding: 0.75rem;
        border: none;
        border-bottom: 1px solid #dee2e6;
      position: relative;
        padding-left: 50%;
    }
  
    .table tbody td:first-child {
        border-top-left-radius: 0.375rem;
        border-top-right-radius: 0.375rem;
        font-weight: bold;
        background-color: #f8f9fa;
    }
  
    .table tbody td::before {
        content: attr(data-label) ": ";
        position: absolute;
        left: 0.75rem;
        width: 45%;
      font-weight: bold;
        text-align: left;
    }
}

.table td {
    vertical-align: middle;
    word-wrap: break-word;
}

.exicuter-dropdown {
    min-width: 200px;
    max-width: 300px;
}

.select2-container .select2-selection--single {
    height: 38px;
}

@media (max-width: 768px) {
    .exicuter-dropdown {
        min-width: 100%;
        max-width: 100%;
    }
}

.file-name-text {
    word-break: break-all;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background-color: #222 !important;
    color: #fff !important;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 4px;
    min-width: 120px;
    text-align: left;
}

#uploadProgressModal .modal-content {
    border-radius: 15px;
}

.progress {
    height: 25px;
    border-radius: 12px;
}

.progress-bar {
    border-radius: 12px;
    font-size: 14px;
    font-weight: bold;
    line-height: 25px;
}

#uploadStatusText {
    font-size: 16px;
    font-weight: bold;
    margin-top: 10px;
}

.btn-uploading {
    position: relative;
    pointer-events: none;
}

.btn-uploading:after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .btn {
        width: 100%;
        margin-bottom: 8px;
        padding: 12px 16px;
        font-size: 16px;
        min-height: 44px;
    }
    
    .btn-sm {
        padding: 8px 12px;
        font-size: 14px;
        min-height: 36px;
    }
    
    .form-control {
        font-size: 16px;
        padding: 12px 16px;
        min-height: 44px;
    }
    
    .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    .modal-content {
        border-radius: 12px;
    }
    
    .modal-header .close {
        min-width: 44px;
        min-height: 44px;
        font-size: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .dropdown-toggle {
        min-height: 44px;
        padding: 12px 16px;
    }
    
    .dropdown-menu {
        width: 100%;
        border-radius: 8px;
    }
    
    .dropdown-item {
        min-height: 44px;
        padding: 12px 16px;
        display: flex;
        align-items: center;
    }
    
    .table-responsive {
        border: 0;
    }
    
    .table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #dee2e6;
        border-radius: 8px;
        background-color: #fff;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    
    .table tbody td {
        display: block;
        text-align: left;
        padding: 12px;
        border: none;
        border-bottom: 1px solid #dee2e6;
        position: relative;
        padding-left: 50%;
    }
    
    .table tbody td:first-child {
        border-top-left-radius: 8px;
        border-top-right-radius: 8px;
        font-weight: bold;
        background-color: #f8f9fa;
    }
    
    .table tbody td:last-child {
        border-bottom: none;
        border-bottom-left-radius: 8px;
        border-bottom-right-radius: 8px;
    }
    
    .navbar-nav .nav-link {
        padding: 12px 16px;
        border-bottom: 1px solid #dee2e6;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .navbar-toggler {
        min-width: 44px;
        min-height: 44px;
        padding: 8px 12px;
    }
    
    .card {
        border-radius: 12px;
        margin-bottom: 16px;
    }
    
    .card-header {
        padding: 16px 20px;
        border-radius: 12px 12px 0 0;
    }
    
    .card-body {
        padding: 20px;
    }
    
    .pagination .page-link {
        min-width: 44px;
        min-height: 44px;
        padding: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .custom-file-label {
        min-height: 44px;
        padding: 12px 16px;
        display: flex;
        align-items: center;
    }
    
    .alert {
        padding: 16px;
        border-radius: 8px;
        margin-bottom: 16px;
    }
    
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .row {
        margin-left: -8px;
        margin-right: -8px;
    }
    
    .col, .col-1, .col-2, .col-3, .col-4, .col-5, .col-6, 
    .col-7, .col-8, .col-9, .col-10, .col-11, .col-12 {
        padding-left: 8px;
        padding-right: 8px;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 8px;
    }
    
    .btn + .btn {
        margin-left: 0;
    }
    
    .modal-dialog {
        margin: 8px;
        max-width: calc(100% - 16px);
    }
    
    .table tbody td {
        padding: 10px 8px;
        font-size: 14px;
    }
    
    .table tbody td::before {
        font-size: 13px;
        left: 8px;
        width: 40%;
    }
    
    .form-group {
        margin-bottom: 16px;
    }
    
    .form-row > .col,
    .form-row > [class*="col-"] {
        padding-right: 8px;
        padding-left: 8px;
    }
}

@media (hover: none) and (pointer: coarse) {
    .btn:hover,
    .nav-link:hover,
    .dropdown-item:hover {
        transform: none;
        box-shadow: none;
    }
    
    .btn:active,
    .nav-link:active,
    .dropdown-item:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    .table-responsive,
    .modal-body {
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 768px) and (orientation: landscape) {
    .modal-dialog {
        margin: 5px auto;
        max-height: calc(100vh - 10px);
    }
    
    .modal-body {
        max-height: calc(100vh - 120px);
        overflow-y: auto;
    }
    
    .navbar {
        padding: 0.25rem 1rem;
    }
    
    .container {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
}

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .btn,
    .form-control,
    .card,
    .modal-content {
        border-width: 0.5px;
    }
}

@media (max-width: 768px) {
    .text-muted {
        font-size: 14px;
    }
    
    .btn:focus,
    .form-control:focus,
    .nav-link:focus,
    .dropdown-item:focus {
        outline: 2px solid #007bff;
        outline-offset: 2px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 16px;
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.125rem; }
    h5 { font-size: 1rem; }
    h6 { font-size: 0.875rem; }
}

@media (max-width: 768px) {
    .table tbody td {
        padding-left: 7em !important;
        position: relative;
        display: block;
        min-height: 2.5em;
        word-break: break-word;
    }
    .table tbody td::before {
        display: block;
        position: absolute;
        top: 0.75em;
        left: 0.75em;
        width: 6em;
        font-size: 0.85rem;
        font-weight: 700;
        white-space: normal;
        color: #222;
        line-height: 1.3;
        margin-bottom: 2px;
        background: none;
    }
    .table tbody td[data-label="Actions"] {
        background: #fff !important;
    }
    .table tbody td[data-label="Actions"] .btn {
        margin-bottom: 8px;
        width: 100%;
    }
    .table tbody td[data-label="Actions"] .btn:last-child {
        margin-bottom: 0;
    }
}

@media (max-width: 768px) {
    .input-group, .input-group.flex-nowrap {
        flex-direction: column;
        align-items: stretch;
    }
    .input-group .form-control,
    .input-group .input-group-append,
    .input-group .input-group-prepend {
        width: 100%;
        min-width: 0;
    }
    .input-group-append, .input-group-prepend {
        margin-top: 8px;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    .input-group-append .btn, .input-group-prepend .btn {
        width: 100%;
        margin-bottom: 0;
    }
}

/* Responsive table for mobile: show data-labels */
@media (max-width: 600px) {
  table, thead, tbody, th, td, tr {
    display: block;
    width: 100%;
  }
  thead tr {
    display: none;
  }
  tr {
    margin-bottom: 1.2em;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    padding: 0.5em 0.5em 0.5em 0;
  }
  td {
    position: relative;
    padding-left: 48%;
    border: none;
    border-bottom: 1px solid #eee;
    min-height: 40px;
    padding-top: 1em;
    padding-bottom: 1em;
    background: none;
  }
  td:before {
    position: absolute;
    top: 1em;
    left: 1em;
    width: 45%;
    white-space: pre-wrap;
    font-weight: 600;
    content: attr(data-label);
    color: #1976d2;
    background: #f0f4f8;
    border-radius: 4px;
    padding: 2px 8px;
    margin-bottom: 4px;
    font-size: 0.98em;
    display: inline-block;
  }
  td:last-child {
    border-bottom: none;
  }
}

@media (max-width: 600px) {
  td {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-left: 0;
    padding-top: 0.7em;
    padding-bottom: 0.7em;
    border: none;
    border-bottom: 1px solid #eee;
    min-height: 40px;
    background: none;
    gap: 0.2em;
  }
  td:before {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    word-break: normal;
    font-weight: 600;
    font-size: 0.98em;
    line-height: 1.2;
    display: block;
    margin-bottom: 2px;
    margin-right: 0;
    color: #1976d2;
    background: #f0f4f8;
    border-radius: 4px;
    padding: 2px 8px;
  }
  td:last-child {
    border-bottom: none;
  }
}

/* Mobile touch target improvements */
@media (max-width: 576px) {
  .btn, .form-control, select, input {
    min-height: 44px !important;
    font-size: 1rem !important;
  }
}

@media (max-width: 768px) {
    .table tbody tr {
        background-color: var(--light-card-bg) !important;
        color: var(--light-text-primary) !important;
        box-shadow: 0 2px 8px var(--light-shadow);
    }
    .table tbody td {
        background-color: var(--light-card-bg) !important;
        color: var(--light-text-primary) !important;
        border-color: var(--light-border) !important;
    }
    .table tbody td::before {
        color: var(--light-text-secondary) !important;
        background: none !important;
    }
    .card, .jumbotron {
        background-color: var(--light-card-bg) !important;
        color: var(--light-text-primary) !important;
        border-color: var(--light-border) !important;
    }
    .btn, .btn-primary, .btn-warning, .btn-danger {
        color: #fff;
    }
    [data-theme="dark"] .actions-row,
    [data-theme="dark"] .table .actions-row,
    [data-theme="dark"] .card .actions-row {
        background-color: var(--light-card-bg) !important;
        color: var(--light-text-primary) !important;
        border-color: var(--light-border) !important;
    }
    [data-theme="dark"] .actions-row label,
    [data-theme="dark"] .table .actions-row label,
    [data-theme="dark"] .card .actions-row label {
        color: var(--light-text-secondary) !important;
    }
    [data-theme="dark"] .actions-row,
    [data-theme="dark"] td.actions-row,
    [data-theme="dark"] tr.actions-row,
    [data-theme="dark"] td:has(.btn-warning),
    [data-theme="dark"] td:has(.btn-danger),
    [data-theme="dark"] td:has(.btn-primary),
    [data-theme="dark"] td:has(.btn-secondary),
    [data-theme="dark"] td:has(button),
    [data-theme="dark"] div.actions-row {
        background-color: #222 !important;
        color: var(--light-text-primary) !important;
        border-color: var(--light-border) !important;
    }
    [data-theme="dark"] .actions-row label,
    [data-theme="dark"] td.actions-row label,
    [data-theme="dark"] div.actions-row label {
        color: var(--light-text-secondary) !important;
    }
    [data-theme="dark"] .dark-bg-actions {
        background-color: #18191a !important;
        color: var(--light-text-primary) !important;
        border-color: var(--light-border) !important;
    }
}

/* Dark mode modal and card background fix */
[data-theme="dark"] .modal-content,
[data-theme="dark"] .card {
    background-color: #23272b !important;
    color: #f8f9fa !important;
    border-color: #444 !important;
}
[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
    background-color: #23272b !important;
    border-color: #444 !important;
}

@media (max-width: 768px) {
    [data-theme="dark"] .table tbody td[data-label="Actions"] {
        background: #23272b !important;
        color: #f8f9fa !important;
    }
    
    /* PagarBook Dashboard Mobile Alignment Fixes */
    .card-header .d-flex {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    .card-header .btn-group {
        width: 100%;
        margin-top: 10px;
    }
    
    .card-header .btn-group .btn {
        flex: 1;
        margin-right: 5px;
    }
    
    .card-header .btn-group .btn:last-child {
        margin-right: 0;
    }
    
    /* Stats cards mobile alignment */
    .card.bg-primary,
    .card.bg-success,
    .card.bg-warning,
    .card.bg-info {
        margin-bottom: 15px;
    }
    
    .card-body .d-flex {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .card-body .d-flex .align-self-center {
        align-self: flex-end;
        margin-top: 10px;
    }
    
    /* Button alignment in cards */
    .card-body .row .col-12 .btn-block,
    .card-body .row .col-sm-6 .btn-block {
        margin-bottom: 10px;
    }
    
    /* Ensure proper spacing between sections */
    .row.mb-4 {
        margin-bottom: 20px !important;
    }
    
    /* Fix text alignment for mobile */
    .text-md-right {
        text-align: left !important;
    }
    
    /* Ensure cards have consistent height */
    .card.h-100 {
        min-height: 200px;
    }
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.task-overview-table {
  width: 100%;
  max-width: 500px;
  margin: 0 auto 20px auto;
  border-collapse: collapse;
  background: #222;
  color: #fff;
  border-radius: 8px;
  overflow: hidden;
  font-size: 1rem;
}

.task-overview-table th, .task-overview-table td {
  padding: 10px;
  text-align: center;
  border-bottom: 1px solid #444;
}

.task-overview-table th {
  background: #e6f6fa;
  color: #222;
  font-weight: bold;
}

.task-overview-table tfoot .total-row td {
  background: #b2e6ee;
  color: #222;
  font-weight: bold;
}

@media (max-width: 600px) {
  .task-overview-table {
    font-size: 0.95rem;
  }
}

@media (max-width: 600px) {
  .task-overview-table, 
  .task-overview-table thead, 
  .task-overview-table tbody, 
  .task-overview-table th, 
  .task-overview-table td, 
  .task-overview-table tr {
    display: table !important;
    width: auto !important;
    background: inherit !important;
    color: inherit !important;
  }
}

/* Filter Styles */
.filter-card {
    border: 1px solid #e3e6f0;
    border-radius: 0.35rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

.filter-card .card-header {
    background-color: #f8f9fc;
    border-bottom: 1px solid #e3e6f0;
    padding: 0.75rem 1.25rem;
}

.filter-card .card-header h6 {
    color: #5a5c69;
    font-weight: 600;
    margin: 0;
}

.filter-form .form-control {
    border-radius: 0.35rem;
    border: 1px solid #d1d3e2;
    padding: 0.375rem 0.75rem;
    font-size: 0.9rem;
}

.filter-form .form-control:focus {
    border-color: #bac8f3;
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
}

.filter-form label {
    font-weight: 600;
    color: #5a5c69;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.filter-buttons .btn {
    border-radius: 0.35rem;
    font-size: 0.9rem;
    padding: 0.375rem 0.75rem;
}

.filter-buttons .btn-primary {
    background-color: #4e73df;
    border-color: #4e73df;
}

.filter-buttons .btn-primary:hover {
    background-color: #2e59d9;
    border-color: #2653d4;
}

.filter-buttons .btn-outline-secondary {
    color: #858796;
    border-color: #d1d3e2;
}

.filter-buttons .btn-outline-secondary:hover {
    background-color: #858796;
    border-color: #858796;
    color: white;
}

/* Summary Cards */
.summary-card {
    border: none;
    border-radius: 0.35rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

.summary-card .card-body {
    padding: 1.25rem;
}

.summary-card h5 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.1rem;
}

.summary-card h3 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

/* Table Styles */
.table-responsive {
    border-radius: 0.35rem;
    overflow: hidden;
}

.table thead th {
    background-color: #5a5c69;
    border-color: #5a5c69;
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.1rem;
    padding: 0.75rem;
}

.table tbody td {
    padding: 0.75rem;
    vertical-align: middle;
    border-color: #e3e6f0;
}

.table tbody tr:hover {
    background-color: #f8f9fc;
}

/* Badge Styles */
.badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
}

.badge-success {
    background-color: #1cc88a;
    color: white;
}

.badge-danger {
    background-color: #e74a3b;
    color: white;
}

.badge-warning {
    background-color: #f6c23e;
    color: white;
}

.badge-info {
    background-color: #36b9cc;
    color: white;
}

.badge-secondary {
    background-color: #858796;
    color: white;
}

/* Button Styles */
.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 0.2rem;
}

.btn-group .btn {
    margin-right: 0.25rem;
}

.btn-group .btn:last-child {
    margin-right: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .filter-form .row > div {
        margin-bottom: 1rem;
    }
    
    .filter-buttons .d-flex {
        flex-direction: column;
    }
    
    .filter-buttons .btn {
        margin-bottom: 0.5rem;
    }
    
    .summary-card h3 {
        font-size: 1.5rem;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Pagination Styles */
.pagination {
    justify-content: center;
    margin-top: 1rem;
}

.pagination .page-link {
    color: #4e73df;
    border-color: #e3e6f0;
    padding: 0.5rem 0.75rem;
}

.pagination .page-link:hover {
    color: #2e59d9;
    background-color: #f8f9fc;
    border-color: #d1d3e2;
}

.pagination .page-item.active .page-link {
    background-color: #4e73df;
    border-color: #4e73df;
}

/* Modal Styles */
.modal-content {
    border: none;
    border-radius: 0.35rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

.modal-header {
    background-color: #f8f9fc;
    border-bottom: 1px solid #e3e6f0;
    border-radius: 0.35rem 0.35rem 0 0;
}

.modal-title {
    color: #5a5c69;
    font-weight: 600;
}

/* Utility Classes */
.gap-2 {
    gap: 0.5rem;
}

.flex-fill {
    flex: 1 1 auto;
}

.text-muted {
    color: #858796 !important;
}

/* 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;
}