html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  background-color: #f8f9fa;
}

/* Custom Styles for Multi-Tenant Application */

/* Responsive Table Styles */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Mobile-first responsive table design */
@media (max-width: 767.98px) {
    .table-responsive {
        border: 0;
    }
    
    .table-responsive table {
        border: 0;
    }
    
    .table-responsive thead {
        display: none;
    }
    
    .table-responsive tbody {
        display: block;
        width: 100%;
    }
    
    .table-responsive 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-responsive td {
        display: block;
        text-align: left;
        padding: 0.75rem;
        border: none;
        border-bottom: 1px solid #f8f9fa;
        position: relative;
        padding-left: 50%;
    }
    
    .table-responsive td:last-child {
        border-bottom: none;
    }
    
    .table-responsive td::before {
        content: attr(data-label);
        position: absolute;
        left: 0.75rem;
        width: 45%;
        font-weight: 600;
        color: #495057;
        font-size: 0.875rem;
    }
    
    .table-responsive .btn-group {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
        justify-content: flex-start;
    }
    
    .table-responsive .btn-group .btn {
        flex: 1;
        min-width: 44px;
        font-size: 0.875rem;
        padding: 0.375rem 0.5rem;
    }
    
    /* Lawyer table specific mobile styles */
    .table-responsive td[data-label="Lawyer Name"] {
        padding-left: 0.75rem;
    }
    
    .table-responsive td[data-label="Lawyer Name"]::before {
        display: none;
    }
    
    .table-responsive td[data-label="Lawyer Name"] strong {
        font-size: 1.1rem;
        color: #495057;
    }
    
    .table-responsive td[data-label="Legal Office"] {
        padding-left: 0.75rem;
    }
    
    .table-responsive td[data-label="Legal Office"]::before {
        display: none;
    }
    
    .table-responsive td[data-label="Work Address"] {
        padding-left: 0.75rem;
    }
    
    .table-responsive td[data-label="Work Address"]::before {
        display: none;
    }
    
    .table-responsive td[data-label="License Date"] {
        padding-left: 0.75rem;
    }
    
    .table-responsive td[data-label="License Date"]::before {
        display: none;
    }
    
    .table-responsive td[data-label="Status"] {
        padding-left: 0.75rem;
    }
    
    .table-responsive td[data-label="Status"]::before {
        display: none;
    }
    
    .table-responsive td[data-label="Actions"] {
        padding-left: 0.75rem;
        padding-top: 1rem;
    }
    
    .table-responsive td[data-label="Actions"]::before {
        display: none;
    }
    
    .table-responsive td[data-label="Actions"] .btn-group {
        width: 100%;
        justify-content: center;
    }
    
    /* User-Lawyer assignments specific styles */
    .table-responsive td[data-label="User"] {
        padding-left: 0.75rem;
    }
    
    .table-responsive td[data-label="User"]::before {
        display: none;
    }
    
    .table-responsive td[data-label="User"] .d-flex {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .table-responsive td[data-label="User"] .avatar-sm {
        margin-bottom: 0.5rem;
    }
    
    .table-responsive td[data-label="Lawyer Assignment"] {
        padding-left: 0.75rem;
    }
    
    .table-responsive td[data-label="Lawyer Assignment"]::before {
        display: none;
    }
    
    .table-responsive td[data-label="Lawyer Assignment"] .d-flex {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .table-responsive td[data-label="Lawyer Assignment"] .avatar-sm {
        margin-bottom: 0.5rem;
    }
    
    .table-responsive td[data-label="Legal Office"] .badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    
    .table-responsive td[data-label="Status"] .badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* Enhanced mobile card styling for lawyer tables */
    .table-responsive tr {
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    
    .table-responsive tr:hover {
        transform: translateY(-2px);
        box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
    }
    
    /* Mobile-specific spacing improvements */
    .table-responsive td {
        margin-bottom: 0.5rem;
    }
    
    .table-responsive td:last-child {
        margin-bottom: 0;
    }
    
    /* Mobile avatar improvements */
    .table-responsive .avatar-sm {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }
    
    /* Mobile button improvements */
    .table-responsive .btn-group .btn {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Mobile badge improvements */
    .table-responsive .badge {
        display: inline-flex;
        align-items: center;
        gap: 0.25rem;
    }
    
    /* Mobile text improvements */
    .table-responsive strong {
        font-size: 1rem;
        line-height: 1.2;
    }
    
    .table-responsive small {
        font-size: 0.75rem;
        line-height: 1.2;
    }
    
    /* Extra small screen improvements */
    @media (max-width: 575.98px) {
        .table-responsive tr {
            margin-bottom: 1.5rem;
            border-radius: 0.5rem;
        }
        
        .table-responsive td {
            padding: 1rem 0.75rem;
        }
        
        .table-responsive .btn-group {
            flex-direction: column;
            gap: 0.5rem;
        }
        
        .table-responsive .btn-group .btn {
            width: 100%;
            justify-content: center;
        }
        
        .table-responsive .avatar-sm {
            width: 3rem;
            height: 3rem;
            font-size: 1.25rem;
        }
        
        .table-responsive strong {
            font-size: 1.1rem;
        }
        
            .table-responsive .badge {
        font-size: 0.8rem;
        padding: 0.375rem 0.75rem;
    }
    
    /* Mobile search improvements */
    .table-responsive + .row .col-md-6 .input-group {
        margin-bottom: 1rem;
    }
    
    .table-responsive + .row .col-md-6 .input-group .form-control {
        border-radius: 0.375rem 0 0 0.375rem;
        font-size: 1rem;
        padding: 0.75rem;
    }
    
    .table-responsive + .row .col-md-6 .input-group .btn {
        border-radius: 0 0.375rem 0.375rem 0;
        padding: 0.75rem 1rem;
    }
    
    /* Mobile header improvements */
    .card-header .row .col-12.col-md-auto {
        display: flex;
        justify-content: center;
    }
    
    .card-header .btn-group-vertical {
        width: 100%;
    }
    
    .card-header .btn-group-vertical .btn {
        width: 100%;
        margin-bottom: 0.25rem;
    }
    
    .card-header .btn-group-vertical .btn:last-child {
        margin-bottom: 0;
    }
    
    @media (min-width: 768px) {
        .card-header .btn-group-vertical {
            width: auto;
        }
        
        .card-header .btn-group-vertical .btn {
            width: auto;
            margin-bottom: 0;
        }
    }
}
    
    /* Enhanced mobile table styles for LegalEntities */
    .table-responsive td[data-label="Назва"] {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        border-bottom: 2px solid #e9ecef;
        background-color: #f8f9fa;
    }
    
    .table-responsive td[data-label="Назва"]::before {
        display: none;
    }
    
    .table-responsive td[data-label="Назва"] strong {
        font-size: 1rem;
        color: #495057;
    }
    
    .table-responsive td[data-label="Назва"] small {
        display: block;
        margin-top: 0.25rem;
        font-size: 0.8rem;
    }
    
    .table-responsive td[data-label="ЄДРПОУ"] {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .table-responsive td[data-label="ЄДРПОУ"] .badge {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
    }
    
    .table-responsive td[data-label="Юридична форма"] .badge,
    .table-responsive td[data-label="Статус"] .badge {
        font-size: 0.8rem;
        padding: 0.375rem 0.5rem;
    }
    
    .table-responsive td[data-label="Основна діяльність"] small {
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    .table-responsive td[data-label="Дата реєстрації"] {
        font-weight: 500;
    }
    
    .table-responsive td[data-label="Адреса"] small {
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    .table-responsive td[data-label="Дії"] {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        background-color: #f8f9fa;
        border-top: 1px solid #e9ecef;
    }
    
    .table-responsive td[data-label="Дії"]::before {
        display: none;
    }
    
    .table-responsive td[data-label="Дії"] .btn-group {
        width: 100%;
        justify-content: center;
    }
    
    .table-responsive td[data-label="Дії"] .btn {
        min-width: 48px;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1rem;
    }
    
    /* Card-style table for mobile */
    .mobile-table-card {
        background: #fff;
        border-radius: 0.5rem;
        box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
        margin-bottom: 1rem;
        overflow: hidden;
    }
    
    .mobile-table-card .card-header {
        background-color: #f8f9fa;
        border-bottom: 1px solid #dee2e6;
        padding: 0.75rem 1rem;
        font-weight: 600;
        color: #495057;
    }
    
    .mobile-table-card .card-body {
        padding: 0;
    }
    
    .mobile-table-card .table {
        margin-bottom: 0;
    }
    
    .mobile-table-card .table td {
        padding: 0.75rem 1rem;
        border-bottom: 1px solid #f8f9fa;
    }
    
    .mobile-table-card .table td:last-child {
        border-bottom: none;
    }
}

/* Tablet responsive adjustments */
@media (min-width: 768px) and (max-width: 991.98px) {
    .table-responsive .btn-group {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .table-responsive .btn-group .btn {
        width: 100%;
        text-align: center;
    }
}

/* Extra small screen adjustments */
@media (max-width: 575.98px) {
    .table-responsive td {
        padding: 0.5rem;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .table-responsive td::before {
        left: 0.5rem;
        width: 40%;
        font-size: 0.8rem;
    }
    
    .table-responsive td[data-label="Назва"] strong {
        font-size: 0.95rem;
    }
    
    .table-responsive td[data-label="Назва"] small {
        font-size: 0.75rem;
    }
    
    .table-responsive td[data-label="ЄДРПОУ"] .badge {
        font-size: 0.8rem;
        padding: 0.375rem 0.5rem;
    }
    
    .table-responsive td[data-label="Юридична форма"] .badge,
    .table-responsive td[data-label="Статус"] .badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.375rem;
    }
    
    .table-responsive td[data-label="Основна діяльність"] small,
    .table-responsive td[data-label="Адреса"] small {
        font-size: 0.8rem;
    }
    
    .table-responsive td[data-label="Дії"] .btn {
        min-width: 44px;
        min-height: 44px;
        font-size: 0.9rem;
        padding: 0.375rem 0.5rem;
    }
    
    /* Improve search form layout on very small screens */
    .card-body .row .col-lg-8 .row .col-md-4,
    .card-body .row .col-lg-8 .row .col-md-3,
    .card-body .row .col-lg-8 .row .col-md-2 {
        margin-bottom: 0.5rem;
    }
    
    .card-body .row .col-lg-4 .row .col-md-8,
    .card-body .row .col-lg-4 .row .col-md-4 {
        margin-bottom: 0.5rem;
    }
    
    /* Stack search forms vertically on very small screens */
    .card-body .row .col-lg-8,
    .card-body .row .col-lg-4 {
        margin-bottom: 1rem;
    }
}

/* Responsive statistics cards */
@media (max-width: 767.98px) {
    .row .col-md-3 {
        margin-bottom: 1rem;
    }
    
    .row .col-md-3 .card {
        margin-bottom: 0;
    }
    
    .row .col-md-3 .card-body {
        padding: 1rem;
    }
    
    .row .col-md-3 .card h4 {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }
    
    .row .col-md-3 .card small {
        font-size: 0.75rem;
    }
    
    .row .col-md-3 .card i {
        font-size: 1.5rem !important;
    }
}

@media (max-width: 575.98px) {
    .row .col-md-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .row .col-md-3 .card-body {
        padding: 0.75rem;
    }
    
    .row .col-md-3 .card h4 {
        font-size: 1.25rem;
    }
    
    .row .col-md-3 .card i {
        font-size: 1.25rem !important;
    }
}

/* Navbar styling */
.navbar-dark.bg-dark {
    background-color: #343a40 !important;
}

/* Card styling */
.card {
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 1.5rem;
}

.card-header {
    border-top-left-radius: 0.5rem !important;
    border-top-right-radius: 0.5rem !important;
}

/* Tenant selector dropdown styling */
.tenant-selector-dropdown .dropdown-toggle {
    font-weight: 500;
    padding: 0.5rem 1rem;
}

/* Dashboard card styling */
.dashboard-card {
    transition: transform 0.2s;
}

.dashboard-card:hover {
    transform: translateY(-5px);
}

/* Footer styling */
.footer {
    background-color: #343a40;
    color: #fff;
    padding: 1rem 0;
}

.footer a {
    color: #adb5bd;
}

.footer a:hover {
    color: #fff;
    text-decoration: none;
}

/* Custom dropdown item for forms */
.dropdown-item-form {
    margin: 0;
}

.dropdown-item-form button {
    background: none;
    border: none;
    padding: 0.25rem 1rem;
    width: 100%;
    text-align: left;
}

.dropdown-item-form button:hover {
    background-color: #f8f9fa;
}

/* Tenant badge styling */
.tenant-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    margin-left: 0.5rem;
}

/* Custom alert styling */
.alert {
    border-radius: 0.5rem;
}

/* Page header styling */
.page-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #dee2e6;
}

/* Tenant card styling */
.tenant-card {
    border: none;
    transition: transform 0.3s, box-shadow 0.3s;
}

.tenant-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.tenant-selector-dropdown {
    position: relative;
}

/* Authorization-related styles */
.auth-disabled {
    opacity: 0.6;
    cursor: not-allowed !important;
    pointer-events: none;
}

.disabled, .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Tooltip styling for authorization messages */
[data-bs-toggle="tooltip"] {
    cursor: help;
}

/* Style for disabled buttons that show tooltips */
.btn.auth-disabled:hover {
    opacity: 0.6;
}

/* Alternative styling for disabled elements with tooltips */
.auth-disabled-with-tooltip {
    opacity: 0.6;
    cursor: help;
    border: 1px dashed #6c757d;
    background-color: #f8f9fa;
    color: #6c757d;
}

.auth-disabled-with-tooltip:hover {
    opacity: 0.8;
}

/* Document Processing Pagination Styles */
.documents-editor-container {
    max-height: calc(100vh - 300px);
    overflow-y: auto;
}

.document-item {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    background-color: #fff;
    transition: box-shadow 0.2s;
}

.document-item:hover {
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

.document-count-info {
    font-size: 0.875rem;
}

.pagination-sm .page-link {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.pagination .page-item.disabled .page-link {
    color: #6c757d;
    pointer-events: none;
    cursor: not-allowed;
}

.pagination .page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

.documents-pagination-controls {
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    padding: 0.5rem;
}

.page-range-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-range-inputs input {
    flex: 1;
    min-width: 60px;
}

.page-range-inputs span {
    font-size: 0.875rem;
    color: #6c757d;
    flex-shrink: 0;
}

.metadata-section {
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-top: 1rem;
}

.metadata-section h6 {
    color: #495057;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

/* Search highlighting */
.search-highlight {
    background-color: #fff3cd;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
}

/* Loading state for pagination */
.documents-loading {
    opacity: 0.6;
    pointer-events: none;
}

.documents-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 #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Editing state for newly added documents */
.document-item.editing {
    border-color: #28a745;
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.3);
    animation: pulse-green 2s ease-in-out;
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 10px rgba(40, 167, 69, 0.3); }
    50% { box-shadow: 0 0 20px rgba(40, 167, 69, 0.6); }
    100% { box-shadow: 0 0 10px rgba(40, 167, 69, 0.3); }
}

/* Document Relationship Manager Styles */

/* Document card styling */
.document-card {
    transition: all 0.2s ease;
    border: 2px solid transparent;
    cursor: pointer;
}

.document-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.document-card.selected {
    border-color: #007bff;
    background-color: #e3f2fd;
}

.document-card.drag-over {
    border-color: #28a745;
    background-color: #d4edda;
    transform: scale(1.02);
}

.document-card.dragging {
    opacity: 0.6;
    transform: rotate(2deg) scale(0.95);
}

.document-card .document-actions {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.document-card:hover .document-actions {
    opacity: 1;
}

/* Relationship item styling */
.relationship-item {
    background: linear-gradient(90deg, #f8f9fa 0%, #e9ecef 100%);
    margin-bottom: 10px;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #007bff;
    transition: all 0.2s ease;
}

.relationship-item:hover {
    background: linear-gradient(90deg, #e9ecef 0%, #dee2e6 100%);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateX(2px);
}

.relationship-item[data-relationship-type="Related"] {
    border-left-color: #007bff;
}

.relationship-item[data-relationship-type="Dependent"] {
    border-left-color: #dc3545;
}

.relationship-item[data-relationship-type="Supersedes"] {
    border-left-color: #fd7e14;
}

.relationship-item[data-relationship-type="Amendment"] {
    border-left-color: #6f42c1;
}

.relationship-item[data-relationship-type="Reference"] {
    border-left-color: #20c997;
}

/* Relationship type colors */
.text-related { color: #007bff; }
.text-dependent { color: #dc3545; }
.text-supersedes { color: #fd7e14; }
.text-amendment { color: #6f42c1; }
.text-reference { color: #20c997; }

/* Relationship Zones Styling */
.relationship-zones {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.relationship-zone {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 10px;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
}

.relationship-zone[data-relationship-type="Related"] {
    border-color: #007bff;
    background-color: rgba(0, 123, 255, 0.05);
}

.relationship-zone[data-relationship-type="Dependent"] {
    border-color: #dc3545;
    background-color: rgba(220, 53, 69, 0.05);
}

.relationship-zone[data-relationship-type="Supersedes"] {
    border-color: #fd7e14;
    background-color: rgba(253, 126, 20, 0.05);
}

.relationship-zone[data-relationship-type="Amendment"] {
    border-color: #6f42c1;
    background-color: rgba(111, 66, 193, 0.05);
}

.relationship-zone[data-relationship-type="Reference"] {
    border-color: #20c997;
    background-color: rgba(32, 201, 151, 0.05);
}

.zone-header {
    margin-bottom: 10px;
}

.zone-content {
    min-height: 60px;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
}

.zone-content.drag-over {
    background-color: rgba(40, 167, 69, 0.1);
    border: 2px dashed #28a745;
    transform: scale(1.02);
}

.drop-zone-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border: 2px dashed #dee2e6;
    border-radius: 6px;
    color: #6c757d;
    transition: all 0.3s ease;
}

.drop-zone-placeholder:hover {
    border-color: #adb5bd;
    background-color: rgba(0, 0, 0, 0.02);
}

.drop-zone-placeholder i {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

/* Relationship Type Dialog */
.relationship-type-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.relationship-type-btn {
    min-width: 120px;
    text-align: left;
}

.relationship-type-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Graph edge styles for different relationship types */
.graph-edge.related {
    stroke: #007bff;
}

.graph-edge.dependent {
    stroke: #dc3545;
}

.graph-edge.supersedes {
    stroke: #ffc107;
}

.graph-edge.amendment {
    stroke: #17a2b8;
}

.graph-edge.reference {
    stroke: #28a745;
}

.graph-edge.unknown {
    stroke: #6c757d;
}

.graph-node {
    stroke: #333;
    stroke-width: 2px;
    cursor: pointer;
}

.graph-node:hover {
    stroke-width: 3px;
    stroke: #007bff;
}

/* Optimistic relationship styles */
.optimistic-relationship {
    opacity: 0.7;
    border-left: 3px solid #007bff;
    background-color: #f8f9fa;
}

.optimistic-relationship .relationship-icon {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .relationship-manager {
        height: auto;
        min-height: 400px;
    }
    
    .document-grid,
    .relationships-panel {
        max-height: 300px;
    }
    
    .graph-view-toggle {
        bottom: 20px;
        right: 20px;
    }
    
    .bulk-actions {
        flex-direction: column;
        text-align: center;
    }
    
    .bulk-actions .btn-group {
        margin-top: 10px;
    }
}

/* Print styles */
@media print {
    .document-relationship-manager,
    .graph-container {
        background: white !important;
    }
    
    .btn,
    .bulk-actions,
    .loading-overlay {
        display: none !important;
    }
}

/* Accessibility improvements */
.document-card:focus,
.relationship-item:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .document-card {
        border: 2px solid #000;
    }
    
    .relationship-item {
        border-left-width: 6px;
    }
    
    .graph-edge {
        stroke-width: 3px;
    }
}

/* Enhanced Footer Responsive Styles */
.footer {
    background-color: #343a40;
    color: #fff;
    padding: 1rem 0;
    position: relative;
    z-index: 1000;
}

.footer a {
    color: #adb5bd;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #fff;
    text-decoration: none;
}

/* Responsive footer adjustments */
@media (max-width: 768px) {
    .footer {
        padding: 1rem 0;
    }
    
    .footer .col-lg-4,
    .footer .col-lg-2,
    .footer .col-lg-3 {
        margin-bottom: 1.5rem;
    }
    
    .footer h5,
    .footer h6 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .footer ul {
        margin-bottom: 0;
    }
    
    .footer li {
        margin-bottom: 0.5rem;
    }
    
    .footer .d-flex {
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .footer {
        padding: 0.75rem 0;
    }
    
    .footer .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .footer .row {
        margin: 0;
    }
    
    .footer .col-md-6 {
        padding: 0.5rem 0;
        text-align: center;
    }
    
    .footer h5 {
        font-size: 0.9rem;
    }
    
    .footer h6 {
        font-size: 0.8rem;
    }
    
    .footer small {
        font-size: 0.75rem;
    }
    
    .footer .d-flex {
        justify-content: center;
        gap: 1rem;
    }
    
    .footer .d-flex a {
        font-size: 1.2rem;
    }
}

/* Ensure footer doesn't overlap content */
.main-content-wrapper {
    min-height: calc(100vh - 200px);
    padding-bottom: 2rem;
}

/* Fix for mobile devices */
@media (max-width: 480px) {
    .footer {
        font-size: 0.875rem;
    }
    
    .footer .row > div {
        margin-bottom: 1rem;
    }
    
    .footer hr {
        margin: 1rem 0;
    }
}

/* Task Management Responsive Styles */
.task-card {
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #007bff;
}

.task-card.clickable {
    cursor: pointer;
}

.task-card.clickable:hover {
    background-color: #f8f9fa;
}

.task-card-header {
    display: flex;
    justify-content: between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.task-card-title {
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.task-card-description {
    color: #6c757d;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.task-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.task-card-actions {
    display: flex;
    gap: 0.25rem;
    justify-content: flex-end;
}

.task-card-actions .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Responsive table to cards conversion */
@media (max-width: 768px) {
    .task-table-container {
        display: none;
    }
    
    .task-cards-container {
        display: block !important;
    }
    
    .task-card {
        background: white;
        padding: 1rem;
        border-radius: 0.5rem;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    
    .task-card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .task-card-meta {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .task-card-actions {
        justify-content: flex-start;
        margin-top: 0.5rem;
    }
    
    /* Hide table headers on mobile */
    .table-responsive {
        display: none;
    }
    
    /* Show cards on mobile */
    .mobile-cards-view {
        display: block !important;
    }
}

@media (max-width: 576px) {
    .task-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .task-controls .btn-group {
        width: 100%;
    }
    
    .task-controls .input-group {
        width: 100%;
    }
    
    .task-controls .form-select {
        width: 100%;
    }
    
    .task-card {
        padding: 0.75rem;
    }
    
    .task-card-title {
        font-size: 1rem;
    }
    
    .task-card-description {
        font-size: 0.8rem;
    }
    
    .task-card-actions .btn {
        padding: 0.375rem 0.5rem;
        font-size: 0.8rem;
    }
}

/* Task status and priority badges */
.task-status-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Clickable table rows */
.task-row.clickable {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.task-row.clickable:hover {
    background-color: #f8f9fa !important;
}

.task-row.clickable:active {
    background-color: #e9ecef !important;
}

.task-priority-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Task type badge */
.task-type-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    background-color: #6c757d;
    color: white;
    border-radius: 0.25rem;
}

/* Due date styling */
.task-due-date {
    font-size: 0.8rem;
    font-weight: 500;
}

.task-due-date.overdue {
    color: #dc3545;
}

.task-due-date.warning {
    color: #fd7e14;
}

.task-due-date.normal {
    color: #6c757d;
}

/* Assignee styling */
.task-assignee {
    font-size: 0.8rem;
    color: #6c757d;
}

.task-assignee-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    background-color: #17a2b8;
    color: white;
    border-radius: 0.25rem;
    margin-right: 0.25rem;
}

/* Board View Styles */
.task-board-desktop {
    overflow-x: auto;
}

.task-board-column {
    min-height: 400px;
    height: calc(100vh - 300px);
    overflow-y: auto;
}

.task-board-column .card-header {
    position: sticky;
    top: 0;
    background-color: #fff;
    z-index: 10;
    border-bottom: 2px solid #dee2e6;
}

.task-column {
    min-height: 200px;
}

.task-column .task-card {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #dee2e6;
}

.task-column .task-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

.task-column .task-card .card-body {
    padding: 0.75rem;
}

.task-column .task-card .card-title {
    font-size: 0.875rem;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.task-column .task-card .card-title a {
    color: #495057;
    font-weight: 500;
}

.task-column .task-card .card-title a:hover {
    color: #007bff;
}

/* Mobile Board View Styles */
.task-board-mobile {
    margin-top: 1rem;
}

.task-board-mobile .accordion-item {
    border: 1px solid #dee2e6;
    margin-bottom: 0.5rem;
    border-radius: 0.5rem;
    overflow: hidden;
}

.task-board-mobile .accordion-button {
    background-color: #f8f9fa;
    border: none;
    padding: 1rem;
    font-weight: 500;
}

.task-board-mobile .accordion-button:not(.collapsed) {
    background-color: #e9ecef;
    color: #495057;
    box-shadow: none;
}

.task-board-mobile .accordion-button:focus {
    box-shadow: none;
    border-color: #dee2e6;
}

.task-board-mobile .accordion-body {
    padding: 0;
    background-color: #fff;
}

.task-column-mobile {
    max-height: 400px;
    overflow-y: auto;
}

.task-card-mobile {
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    margin: 0.5rem;
    padding: 1rem;
    background-color: #fff;
    transition: box-shadow 0.2s;
}

.task-card-mobile:hover {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.task-card-mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.task-card-mobile-title {
    flex: 1;
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.3;
}

.task-card-mobile-title a {
    color: #495057;
}

.task-card-mobile-title a:hover {
    color: #007bff;
}

.task-card-mobile-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

.task-card-mobile-actions .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.task-card-mobile-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.task-card-mobile-description {
    font-size: 0.8rem;
    color: #6c757d;
    line-height: 1.4;
    margin-top: 0.5rem;
}

/* Responsive adjustments for board view */
@media (max-width: 1200px) {
    .task-board-desktop .col-lg-2 {
        flex: 0 0 20%;
        max-width: 20%;
    }
}

@media (max-width: 992px) {
    .task-board-desktop .col-lg-2 {
        flex: 0 0 25%;
        max-width: 25%;
    }
    
    .task-board-column {
        height: calc(100vh - 250px);
    }
}

@media (max-width: 768px) {
    .task-board-desktop {
        display: none !important;
    }
    
    .task-board-mobile {
        display: block !important;
    }
    
    .task-card-mobile {
        margin: 0.25rem;
        padding: 0.75rem;
    }
    
    .task-card-mobile-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .task-card-mobile-actions {
        align-self: flex-end;
    }
    
    .task-card-mobile-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}

@media (max-width: 576px) {
    .task-board-mobile .accordion-button {
        padding: 0.75rem;
        font-size: 0.875rem;
    }
    
    .task-card-mobile {
        margin: 0.25rem;
        padding: 0.5rem;
    }
    
    .task-card-mobile-title {
        font-size: 0.8rem;
    }
    
    .task-card-mobile-actions .btn {
        padding: 0.2rem 0.4rem;
        font-size: 0.7rem;
    }
    
    .task-card-mobile-description {
        font-size: 0.75rem;
    }
}

/* Touch-friendly improvements for mobile */
@media (hover: none) and (pointer: coarse) {
    .task-card-mobile {
        min-height: 60px;
    }
    
    .task-card-mobile-actions .btn {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .task-board-mobile .accordion-button {
        min-height: 48px;
    }
}

/* Loading states for board view */
.task-board-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    color: #6c757d;
}

.task-board-loading::after {
    content: '';
    width: 2rem;
    height: 2rem;
    border: 2px solid #dee2e6;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Empty state styling */
.task-column:empty::after {
    content: 'No tasks in this status';
    display: block;
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 2rem;
}

.task-column-mobile:empty::after {
    content: 'No tasks in this status';
    display: block;
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 1rem;
    font-size: 0.875rem;
}

/* Task Court Cases Module Styles */
.court-cases-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.court-case-item {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1rem;
    background-color: #fff;
    transition: all 0.2s ease;
}

.court-case-item:hover {
    border-color: #007bff;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 123, 255, 0.1);
}

.court-case-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.court-case-title {
    flex: 1;
    margin-right: 1rem;
}

.court-case-number {
    color: #6c757d;
    font-size: 0.875rem;
}

.court-case-actions {
    flex-shrink: 0;
}

.court-case-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.court-case-status,
.court-case-priority {
    display: inline-block;
}

.court-case-description {
    width: 100%;
    color: #6c757d;
    font-size: 0.875rem;
    line-height: 1.4;
}

.court-case-footer {
    border-top: 1px solid #f8f9fa;
    padding-top: 0.75rem;
}

.court-case-search-results {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    background-color: #fff;
}

.court-case-search-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid #f8f9fa;
    transition: background-color 0.2s ease;
}

.court-case-search-item:last-child {
    border-bottom: none;
}

.court-case-search-item:hover {
    background-color: #f8f9fa;
}

.court-case-info {
    flex: 1;
    margin-right: 1rem;
}

.court-case-info strong {
    display: block;
    margin-bottom: 0.25rem;
}

.court-case-info small {
    color: #6c757d;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    margin-bottom: 1rem;
}

/* Responsive styles for court cases */
@media (max-width: 768px) {
    .court-case-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .court-case-actions {
        align-self: flex-end;
    }
    
    .court-case-details {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .court-case-search-item {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .court-case-info {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
}

/* Task Module Styles */
.task-module {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.task-module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f8f9fa;
    background-color: #f8f9fa;
    border-radius: 0.5rem 0.5rem 0 0;
}

.task-module-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #495057;
    font-size: 1rem;
}

.task-module-title i {
    color: #6c757d;
    font-size: 1.1rem;
}

.task-module-actions {
    display: flex;
    gap: 0.5rem;
}

.task-module-content {
    padding: 1.25rem;
}

.task-module-content .empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: #6c757d;
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    margin: 0;
}

.task-module-content .empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
    color: #6c757d;
}

.task-module-content .empty-state p {
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    color: #6c757d;
}

.task-module-content .empty-state .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border-radius: 0.375rem;
}

/* Court cases list within task modules */
.task-module-content .court-cases-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.task-module-content .court-case-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    padding: 1rem;
    transition: all 0.2s ease;
}

.task-module-content .court-case-item:hover {
    background: #e9ecef;
    border-color: #dee2e6;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.task-module-content .court-case-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.task-module-content .court-case-title {
    flex: 1;
    margin-right: 1rem;
}

.task-module-content .court-case-title strong {
    display: block;
    margin-bottom: 0.25rem;
    color: #495057;
    font-size: 0.95rem;
}

.task-module-content .court-case-number {
    color: #6c757d;
    font-size: 0.85rem;
    font-weight: normal;
}

.task-module-content .court-case-actions {
    flex-shrink: 0;
}

.task-module-content .court-case-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.task-module-content .court-case-status,
.task-module-content .court-case-priority {
    display: inline-block;
}

.task-module-content .court-case-description {
    width: 100%;
    color: #6c757d;
    font-size: 0.875rem;
    line-height: 1.4;
    margin-top: 0.5rem;
}

.task-module-content .court-case-footer {
    border-top: 1px solid #e9ecef;
    padding-top: 0.75rem;
    margin-top: 0.5rem;
}

.task-module-content .court-case-footer small {
    color: #6c757d;
    font-size: 0.8rem;
}

/* Responsive styles for task modules */
@media (max-width: 768px) {
    .task-module-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 1rem;
    }
    
    .task-module-title {
        justify-content: center;
    }
    
    .task-module-actions {
        justify-content: center;
    }
    
    .task-module-content {
        padding: 1rem;
    }
    
    .task-module-content .empty-state {
        padding: 1.5rem 1rem;
    }
    
    .task-module-content .empty-state i {
        font-size: 2.5rem;
    }
    
    .task-module-content .court-case-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .task-module-content .court-case-actions {
        align-self: flex-end;
    }
    
    .task-module-content .court-case-details {
        flex-direction: column;
        gap: 0.25rem;
    }
}

@media (max-width: 576px) {
    .task-module {
        margin-bottom: 1rem;
        border-radius: 0.375rem;
    }
    
    .task-module-header {
        border-radius: 0.375rem 0.375rem 0 0;
        padding: 0.75rem;
    }
    
    .task-module-title {
        font-size: 0.95rem;
    }
    
    .task-module-content {
        padding: 0.75rem;
    }
    
    .task-module-content .empty-state {
        padding: 1rem 0.75rem;
    }
    
    .task-module-content .empty-state i {
        font-size: 2rem;
    }
    
    .task-module-content .empty-state p {
        font-size: 0.9rem;
    }
    
    .task-module-content .court-case-item {
        padding: 0.75rem;
    }
    
    .task-module-content .court-case-title strong {
        font-size: 0.9rem;
    }
    
    .task-module-content .court-case-number {
        font-size: 0.8rem;
    }
    
    .task-module-content .court-case-description {
        font-size: 0.8rem;
    }
}

/* Additional Sidebar Enhancement Styles */

/* Improved tooltip positioning and styling */
.sidebar.collapsed .menu-link::after {
    content: attr(data-title);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.2s ease;
    z-index: 1001;
    margin-left: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 200px;
    word-wrap: break-word;
}

/* Tooltip for collapsed sidebar menu */
.sidebar.collapsed .sidebar-collapsed-menu .menu-link::after {
    content: attr(data-title);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.2s ease;
    z-index: 1001;
    margin-left: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 200px;
    word-wrap: break-word;
}

.sidebar.collapsed .menu-link:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.sidebar.collapsed .sidebar-collapsed-menu .menu-link:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* Add arrow to tooltip */
.sidebar.collapsed .menu-link::before {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1001;
    margin-left: 0.25rem;
}

.sidebar.collapsed .menu-link:hover::before {
    opacity: 1;
}

.sidebar.collapsed .sidebar-collapsed-menu .menu-link::before {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1001;
    margin-left: 0.25rem;
}

.sidebar.collapsed .sidebar-collapsed-menu .menu-link:hover::before {
    opacity: 1;
}

/* Enhanced collapsed state styling */
.sidebar.collapsed .menu-link {
    justify-content: center;
    padding: 0.75rem 0.5rem;
    border-radius: 6px;
    margin: 0.25rem 0.5rem;
    transition: all 0.3s ease;
}

.sidebar.collapsed .menu-link:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

.sidebar.collapsed .menu-icon {
    margin-right: 0;
    font-size: 1.3rem;
    transition: all 0.3s ease;
}

/* Mobile menu enhancements */
@media (max-width: 767.98px) {
    .sidebar.mobile-open {
        animation: slideInLeft 0.3s ease-out;
    }
    
    .sidebar-overlay.show {
        animation: fadeIn 0.3s ease-out;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Improved touch targets for mobile */
@media (max-width: 767.98px) {
    .sidebar.mobile-open .menu-link,
    .sidebar.mobile-open .submenu-link {
        min-height: 60px;
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
        border-radius: 8px;
        margin: 0.25rem 0.5rem;
    }
    
    .sidebar.mobile-open .menu-icon {
        font-size: 1.4rem;
        margin-right: 1rem;
    }
    
    .sidebar.mobile-open .submenu-link {
        padding-left: 3.5rem;
        font-size: 1rem;
    }
}

/* Accessibility improvements */
.sidebar-toggle:focus,
.mobile-menu-toggle:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.menu-link:focus,
.submenu-link:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: -2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .sidebar.collapsed .menu-link::after {
        background: #000;
        border: 2px solid #fff;
    }
    
    .sidebar.collapsed .menu-link::before {
        border-right-color: #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .sidebar,
    .sidebar *,
    .main-content,
    .footer {
        transition: none !important;
        animation: none !important;
    }
    
    .sidebar.collapsed .menu-link::after,
    .sidebar.collapsed .menu-link::before {
        transition: none !important;
    }
}

        /* Show/hide expanded vs collapsed menu states */
        .sidebar-expanded-menu {
            display: block;
        }

        .sidebar-collapsed-menu {
            display: none;
        }

        .sidebar.collapsed .sidebar-expanded-menu {
            display: none !important;
        }

        .sidebar.collapsed .sidebar-collapsed-menu {
            display: block !important;
        }

        /* Hide recent items section in collapsed state */
.sidebar.collapsed .sidebar-recent {
    display: none !important;
}

/* Hide favorite stars in collapsed state */
.sidebar.collapsed .menu-favorite,
.sidebar.collapsed .favorite-star,
.sidebar.collapsed .menu-item-favorite,
.sidebar.collapsed .fa-star,
.sidebar.collapsed .fas.fa-star,
.sidebar.collapsed .far.fa-star {
    display: none !important;
}

        /* Specific styling for the new .sidebar.collapsed .sidebar-collapsed-menu elements */

/* Legal Entities specific responsive styles */
.legal-entities-table {
    transition: all 0.3s ease;
}

/* Mobile-first responsive table design for LegalEntities */
@media (max-width: 767.98px) {
    /* Hide table on mobile */
    .legal-entities-table {
        display: none !important;
    }
    
    /* Show mobile cards */
    .legal-entities-mobile-cards {
        display: block !important;
    }
    
    .legal-entity-card {
        background: #fff;
        border: 1px solid #dee2e6;
        border-radius: 0.5rem;
        padding: 1rem;
        margin-bottom: 1rem;
        box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
        transition: all 0.2s ease;
    }
    
    .legal-entity-card:hover {
        box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
        border-color: #007bff;
    }
    
    .legal-entity-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 0.75rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .legal-entity-name {
        flex: 1;
        min-width: 0;
    }
    
    .legal-entity-name .full-name {
        font-weight: 600;
        color: #212529;
        font-size: 1rem;
        line-height: 1.3;
        margin-bottom: 0.25rem;
        word-wrap: break-word;
    }
    
    .legal-entity-name .short-name {
        color: #6c757d;
        font-size: 0.875rem;
        font-style: italic;
    }
    
    .legal-entity-actions {
        flex-shrink: 0;
        display: flex;
        gap: 0.25rem;
    }
    
    .legal-entity-actions .btn {
        padding: 0.375rem 0.5rem;
        font-size: 0.875rem;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .legal-entity-details {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        margin-bottom: 0.75rem;
    }
    
    .legal-entity-detail-row {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    
    .legal-entity-detail-label {
        font-weight: 600;
        color: #495057;
        font-size: 0.875rem;
        min-width: 80px;
        flex-shrink: 0;
    }
    
    .legal-entity-detail-value {
        flex: 1;
        min-width: 0;
        font-size: 0.875rem;
    }
    
    .legal-entity-badges {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-bottom: 0.75rem;
    }
    
    .legal-entity-badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
        border-radius: 0.25rem;
        font-weight: 500;
    }
    
    .legal-entity-address {
        color: #6c757d;
        font-size: 0.875rem;
        line-height: 1.4;
        margin-bottom: 0.75rem;
    }
    
    .legal-entity-activity {
        color: #6c757d;
        font-size: 0.875rem;
        font-style: italic;
        margin-bottom: 0.75rem;
    }
    
    .legal-entity-date {
        color: #6c757d;
        font-size: 0.875rem;
        font-weight: 500;
    }
}

/* Tablet responsive adjustments for legal entities */
@media (min-width: 768px) and (max-width: 991.98px) {
    .legal-entity-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .legal-entity-actions {
        align-self: flex-end;
    }
    
    .legal-entity-detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .legal-entity-detail-label {
        min-width: auto;
    }
}

/* Desktop styles - show table, hide cards */
@media (min-width: 768px) {
    .legal-entities-mobile-cards {
        display: none !important;
    }
    
    .legal-entities-table {
        display: block !important;
    }
}

/* Touch-friendly improvements for mobile */
@media (hover: none) and (pointer: coarse) {
    .legal-entity-card {
        min-height: 60px;
    }
    
    .legal-entity-actions .btn {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Accessibility improvements */
.legal-entity-card:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .legal-entity-card {
        border: 2px solid #000;
    }
}

/* Responsive button utilities */
@media (max-width: 767.98px) {
    .w-md-auto {
        width: auto !important;
    }
}

@media (min-width: 768px) {
    .w-md-auto {
        width: auto !important;
    }
}

/* Batch Processing Duplicate Warning Styles */
.duplicate-warning-indicator {
    display: flex;
    align-items: center;
    margin-left: 0.5rem;
    padding: 0.25rem 0.5rem;
    background-color: rgba(255, 193, 7, 0.1);
    border-radius: 0.25rem;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.duplicate-warning-indicator i {
    font-size: 0.875rem;
}

.duplicate-warning-indicator .small {
    font-size: 0.75rem;
    font-weight: 500;
}

.card.border-warning {
    border-color: #ffc107 !important;
    box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.25);
}

.duplicate-warnings-list {
    max-height: 300px;
    overflow-y: auto;
}

.duplicate-warning-item {
    border-left: 3px solid #ffc107;
    padding-left: 1rem;
    background-color: rgba(255, 193, 7, 0.05);
    border-radius: 0.25rem;
    padding: 0.75rem;
}

.duplicate-details-list {
    max-height: 400px;
    overflow-y: auto;
}

.duplicate-detail-item {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    background-color: #f8f9fa;
}

/* Modal Loading Overlay Styles */
.modal-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1060;
    border-radius: 0.5rem;
}

.modal-loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-loading-text {
    font-size: 1.125rem;
    font-weight: 500;
    text-align: center;
}

.success-checkmark {
    animation: checkmark-pop 0.3s ease-in-out;
}

@keyframes checkmark-pop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Ensure modal content has relative positioning for overlay */
.modal-content {
    position: relative;
}