/* Law Firm Support - Compact Font Styling */

/* Import Google Fonts - Roboto Condensed for compact design */
@import url('https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600&display=swap');

/* Global font family override */
body,
.main-sidebar,
.navbar,
.content-wrapper,
.card,
.table,
.form-control,
.btn,
.nav-link,
.dropdown-item,
.badge,
.alert,
input,
textarea,
select {
    font-family: 'Roboto Condensed', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    font-weight: 500;
    letter-spacing: -0.02em;
}

/* Headings with condensed font */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: 'Roboto Condensed', sans-serif !important;
    font-weight: 500;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

/* Compact text sizes */
body {
    font-size: 14px;
    line-height: 1.4;
}

/* Table styling for better readability */
.table {
    font-size: 13px;
}

.table th {
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 12px;
}

.table td {
    padding: 6px 12px;
    vertical-align: middle;
}

/* DataTables styling improvements */
.dataTables_wrapper {
    padding: 0;
    margin: 0;
}

/* DataTable header spacing */
.dataTables_wrapper .dataTables_length {
    margin: 0.25rem 0 0.75rem 0;
    padding-left: 0.75rem; /* breathe from left edge */
}

.dataTables_wrapper .dataTables_length label {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 0;
    padding-right: 0.5rem;
}

.dataTables_wrapper .dataTables_length select {
    font-size: 13px;
    padding: 0.25rem 0.5rem;
    margin: 0 0.5rem;
    border-radius: 0.25rem;
}

/* DataTable search styling */
.dataTables_wrapper .dataTables_filter {
    margin: 0.25rem 0 0.75rem 0;
    text-align: right;
    padding-right: 0.75rem; /* breathe from right edge */
}

.dataTables_wrapper .dataTables_filter label {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 0;
    padding-left: 0.5rem;
}

.dataTables_wrapper .dataTables_filter input {
    font-size: 13px;
    padding: 0.375rem 0.75rem;
    margin-left: 0.5rem;
    border-radius: 0.25rem;
    border: 1px solid #ced4da;
    width: auto;
    display: inline-block;
}

/* DataTable info and pagination spacing */
.dataTables_wrapper .dataTables_info {
    padding: 0.75rem 0 0.75rem 0.75rem; /* add left padding */
    font-size: 13px;
    font-weight: 500;
    color: #6c757d;
}

.dataTables_wrapper .dataTables_paginate {
    padding: 0.75rem 0.75rem 0.75rem 0; /* add right padding */
    text-align: right;
}

/* DataTable pagination buttons */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    font-size: 13px;
    padding: 0.375rem 0.75rem;
    margin: 0 0.125rem;
    border-radius: 0.25rem;
    border: 1px solid #dee2e6;
    background-color: #fff;
    color: #495057;
    text-decoration: none;
    display: inline-block;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background-color: #007bff;
    border-color: #007bff;
    color: #fff;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    color: #6c757d;
    background-color: #fff;
    border-color: #dee2e6;
    cursor: not-allowed;
}

/* DataTable processing indicator */
.dataTables_wrapper .dataTables_processing {
    font-size: 13px;
    padding: 1rem;
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
}

/* DataTable container spacing */
.table-responsive .dataTables_wrapper {
    padding: 0;
}

.card-body .dataTables_wrapper {
    margin: -0.25rem 0 0 0;
}

/* Dashboard specific table improvements */
.dashboard-table-card {
    margin-bottom: 1.5rem;
}

.dashboard-table-card .card-header {
    padding: 0.75rem 1rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

/* Header actions (e.g., View all) */
.dashboard-table-card .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-header-actions a {
    font-size: 12px;
    font-weight: 600;
    color: #495057;
}
.card-header-actions a:hover {
    text-decoration: underline;
}

.dashboard-table-card .card-header h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    color: #495057;
}

.dashboard-table-card .table-responsive {
    border-radius: 0;
    margin-bottom: 0;
}

.dashboard-table-card .table {
    margin-bottom: 0;
    font-size: 12px;
}

.dashboard-table-card .table th {
    padding: 0.5rem 0.75rem;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    border-top: none;
}

.dashboard-table-card .table td {
    padding: 0.375rem 0.75rem;
    font-size: 12px;
    vertical-align: middle;
    border-top: 1px solid #f1f1f1;
    line-height: 1.3;
}

.dashboard-table-card .table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Dashboard table text overflow fix */
.dashboard-table-card .table td {
    white-space: normal; /* allow wrap to avoid horizontal scroll */
    overflow: visible;
    text-overflow: clip;
    max-width: none;
    position: relative;
    vertical-align: middle;
    padding: 0.5rem 0.75rem;
}

.dashboard-table-card .table td:first-child {
    max-width: none;
    min-width: 120px;
}

.dashboard-table-card .table td:last-child {
    max-width: none;
    white-space: normal;
    min-width: 100px;
}

/* Better column sizing for dashboard tables */
.dashboard-table-card .table {
    table-layout: auto;
    width: 100%;
}

.dashboard-table-card .table th {
    white-space: nowrap; /* keep headers compact */
    padding: 0.5rem 0.75rem;
    vertical-align: middle;
}

/* Ensure all text is visible */
.dashboard-table-card .table td,
.dashboard-table-card .table th {
    overflow: visible;
    text-overflow: clip;
}

/* Specific column widths for dashboard tables */
.dashboard-table-card .table th[width],
.dashboard-table-card .table td[width] {
    width: auto;
    min-width: unset;
    max-width: unset;
}

/* Badge styling in dashboard tables */
.dashboard-table-card .badge {
    font-size: 10px;
    padding: 0.2em 0.4em;
    white-space: nowrap;
}

/* Tooltip support for truncated text */
.dashboard-table-card .table td[title] {
    cursor: help;
}

/* Dashboard responsive improvements */
@media (max-width: 768px) {
    .dashboard-table-card .table td {
        max-width: 100px;
        font-size: 11px;
    }
    
    .dashboard-table-card .table th {
        font-size: 10px;
        padding: 0.375rem 0.5rem;
    }
    
    .dashboard-table-card .table td {
        padding: 0.25rem 0.5rem;
    }
}

/* Dashboard layout fixes */
.dashboard-table-card {
    overflow: hidden;
}

.dashboard-table-card .table-responsive {
    overflow-x: auto;
    overflow-y: hidden;
}

/* Fix for overlapping content */
.content-wrapper .content {
    overflow-x: hidden;
}

/* General table improvements */
.table-no-overflow {
    table-layout: fixed;
    width: 100%;
}

.table-no-overflow td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Card spacing improvements */
.card + .card {
    margin-top: 1rem;
}

/* Row spacing in dashboard */
.dashboard-row {
    margin-bottom: 1.5rem;
}

.dashboard-row:last-child {
    margin-bottom: 0;
}

/* General overlay fix */
.table-responsive {
    position: relative;
    z-index: 1;
}

/* Prevent horizontal scroll issues */
.container-fluid {
    overflow-x: hidden;
}

.row {
    margin-left: -7.5px;
    margin-right: -7.5px;
}

.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,
.col-auto, .col-sm, .col-sm-1, .col-sm-2, .col-sm-3, 
.col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, 
.col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12, .col-sm-auto,
.col-md, .col-md-1, .col-md-2, .col-md-3, .col-md-4, 
.col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, 
.col-md-10, .col-md-11, .col-md-12, .col-md-auto,
.col-lg, .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, 
.col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, 
.col-lg-10, .col-lg-11, .col-lg-12, .col-lg-auto {
    padding-left: 7.5px;
    padding-right: 7.5px;
}

/* Dashboard small-box adjustments */
.small-box {
    margin-bottom: 1rem;
}

.small-box .inner h3 {
    font-size: 28px;
    font-weight: 600;
    line-height: 1.1;
    margin: 0 0 0.25rem 0;
}

.small-box .inner p {
    font-size: 13px;
    font-weight: 500;
    margin: 0;
}

/* Dashboard row spacing */
.content .row {
    margin-bottom: 1rem;
}

.content .row:last-child {
    margin-bottom: 0;
}

/* Table header improvements */
.dataTables_wrapper table.dataTable thead th {
    padding: 0.75rem 0.75rem;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #dee2e6;
    background-color: #f8f9fa;
}

.dataTables_wrapper table.dataTable tbody td {
    padding: 0.5rem 0.75rem;
    font-size: 13px;
    vertical-align: middle;
    border-top: 1px solid #dee2e6;
}

/* Compact table variant for DataTables */
.table-compact.dataTable thead th {
    padding: 0.5rem 0.5rem;
    font-size: 11px;
}

.table-compact.dataTable tbody td {
    padding: 0.375rem 0.5rem;
    font-size: 12px;
}

/* DataTable responsive improvements */
@media (max-width: 768px) {
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        text-align: center;
        margin-bottom: 0.75rem;
    }
    
    .dataTables_wrapper .dataTables_filter input {
        width: 100%;
        margin-top: 0.25rem;
        margin-left: 0;
    }
    
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        text-align: center;
        padding-top: 0.75rem;
    }
    
    .dataTables_wrapper table.dataTable thead th,
    .dataTables_wrapper table.dataTable tbody td {
        padding: 0.375rem 0.25rem;
        font-size: 12px;
    }
}

/* Compact cards */
.card-header {
    padding: 0.75rem 1rem;
    font-size: 15px;
    font-weight: 500;
}

.card-body {
    padding: 1rem;
    font-size: 14px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

/* Card with table improvements */
.card .table-responsive {
    margin-bottom: 0;
    border-radius: 0;
}

.card-body .table-responsive {
    margin-left: -1rem;
    margin-right: -1rem;
    margin-bottom: -1rem;
}

.card-body .table-responsive:last-child {
    border-bottom-left-radius: calc(0.375rem - 1px);
    border-bottom-right-radius: calc(0.375rem - 1px);
}

/* Table title spacing */
.table-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #dee2e6;
    color: #495057;
}

/* Filter section styling */
.table-filters {
    background-color: #f8f9fa;
    padding: 1rem;
    margin: -1rem -1rem 1rem -1rem;
    border-bottom: 1px solid #dee2e6;
}

.table-filters .form-row {
    margin-bottom: 0;
}

.table-filters .form-group {
    margin-bottom: 0.5rem;
}

.table-filters .btn {
    margin-top: 0.25rem;
}

/* Table action buttons */
.table-actions {
    padding: 0.75rem 0;
    margin-bottom: 0.5rem;
    text-align: right;
}

.table-actions .btn {
    margin-left: 0.25rem;
}

/* Compact forms */
.form-control {
    font-size: 14px;
    padding: 0.375rem 0.75rem;
    height: calc(1.5em + 0.75rem + 2px);
}

.form-control-sm {
    font-size: 13px;
    padding: 0.25rem 0.5rem;
    height: calc(1.5em + 0.5rem + 2px);
}

.form-label,
.col-form-label {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

/* Compact buttons */
.btn {
    font-size: 13px;
    padding: 0.375rem 0.75rem;
    font-weight: 500;
    letter-spacing: 0.025em;
}

.btn-sm {
    font-size: 12px;
    padding: 0.25rem 0.5rem;
}

.btn-lg {
    font-size: 15px;
    padding: 0.5rem 1rem;
}

/* Compact navigation */
.nav-link {
    font-size: 14px;
    padding: 0.5rem 0.75rem;
}

.nav-sidebar .nav-link {
    font-size: 14px;
    padding: 0.5rem 1rem;
}

.nav-sidebar .nav-link p {
    font-size: 14px;
    margin-bottom: 0;
}

/* Compact badges and labels */
.badge {
    font-size: 10px;
    font-weight: 500;
    padding: 0.25em 0.6em;
}

/* Type/color variants for quick visual cues */
.badge-status-active { background-color: #28a745; color: #fff; }
.badge-status-pending { background-color: #ffc107; color: #212529; }
.badge-status-intake { background-color: #6c757d; color: #fff; }

.badge-comm-email { background-color: #0d6efd; color: #fff; }
.badge-comm-call { background-color: #20c997; color: #fff; }
.badge-comm-meeting { background-color: #6f42c1; color: #fff; }
.badge-comm-message { background-color: #17a2b8; color: #fff; }
.badge-comm-other { background-color: #6c757d; color: #fff; }

.badge-due-overdue { background-color: #dc3545; color: #fff; }
.badge-due-soon { background-color: #fd7e14; color: #212529; }
.badge-due-future { background-color: #6c757d; color: #fff; }

.label {
    font-size: 10px;
    font-weight: 500;
}

/* Compact alerts */
.alert {
    font-size: 14px;
    padding: 0.75rem 1rem;
}

/* Compact modals */
.modal-title {
    font-size: 17px;
    font-weight: 600;
}

.modal-body {
    font-size: 14px;
}

/* Compact breadcrumbs */
.breadcrumb {
    font-size: 12px;
    padding: 0.5rem 0;
    margin-bottom: 0.5rem;
}

/* Compact pagination */
.pagination .page-link {
    font-size: 12px;
    padding: 0.375rem 0.75rem;
}

/* Small boxes (info boxes) */
.small-box h3 {
    font-size: 28px;
    font-weight: 600;
    line-height: 1.1;
}

.small-box p {
    font-size: 13px;
    font-weight: 500;
}

.small-box small {
    font-size: 11px;
}

/* Progress bars */
.progress-group {
    margin-bottom: 0.75rem;
}

.progress-text {
    font-size: 12px;
    font-weight: 500;
}

.progress {
    height: 16px;
}

/* Timeline styling */
.timeline .timeline-header {
    font-size: 13px;
    font-weight: 500;
}

.timeline .timeline-body {
    font-size: 12px;
    line-height: 1.4;
}

.timeline .timeline-footer {
    font-size: 11px;
}

/* Description blocks */
.description-block .description-header {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.1;
}

.description-block .description-text {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Chart containers */
.chart-container {
    position: relative;
    height: 300px;
}

/* Content header */
.content-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

.content-header .breadcrumb {
    font-size: 12px;
}

/* Content header improvements */
.content-header {
    padding: 1rem 1rem 0.5rem 1rem;
    margin-bottom: 1rem;
}

.content-header h1 {
    margin-bottom: 0.5rem;
    font-size: 24px;
    font-weight: 600;
}

.content-header .d-flex {
    align-items: center;
    margin-bottom: 0.5rem;
}

/* Page content spacing */
.content-wrapper .content {
    padding: 0 1rem 1rem 1rem;
}

/* Table page layout */
.table-page-header {
    background-color: #fff;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.table-page-header h1 {
    margin-bottom: 0.25rem;
    font-size: 20px;
    font-weight: 600;
}

.table-page-header .table-description {
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 0;
}

/* Sidebar adjustments */
.main-sidebar .brand-text {
    font-size: 16px;
    font-weight: 600;
}

.sidebar .user-panel .info {
    font-size: 13px;
}

/* Footer */
.main-footer {
    font-size: 12px;
    background: #ffffff;
    border-top: 1px solid #e9ecef;
    color: #6c757d;
    padding: 0.5rem 1rem;
}

/* Footer links inherit text color and have gentle underline */
.main-footer a { color: inherit; text-decoration: underline; }
.main-footer a:hover { text-decoration: none; }

/* Dark mode footer adjustments */
.dark-mode .main-footer {
    background: #1f2937; /* slate-800 */
    border-top-color: #374151; /* slate-700 */
    color: #cbd5e1; /* slate-300 */
}
.dark-mode .main-footer a { color: #e5e7eb; }

/* Auth pages: keep footer at bottom */
.login-page .main-footer,
.register-page .main-footer,
.passwords-page .main-footer,
.verify-page .main-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
}
.login-page,
.register-page,
.passwords-page,
.verify-page { padding-bottom: 3rem; }

/* Ensure content is not hidden behind fixed footer */
.layout-footer-fixed .content-wrapper {
    padding-bottom: 3rem; /* space for fixed footer */
}

/* Responsive adjustments */
@media (max-width: 768px) {
    body {
        font-size: 13px;
    }
    
    .table {
        font-size: 12px;
    }
    
    .btn {
        font-size: 12px;
        padding: 0.25rem 0.5rem;
    }
    
    .card-header {
        padding: 0.5rem 0.75rem;
        font-size: 14px;
    }
    
    .small-box h3 {
        font-size: 24px;
    }
}

/* Print styles */
@media print {
    body {
        font-size: 11px;
        line-height: 1.3;
    }
    
    .table {
        font-size: 10px;
    }
    
    h1, h2, h3, h4, h5, h6 {
        font-weight: 600;
    }
}

/* Additional compact utilities */
.text-compact {
    font-size: 13px !important;
    line-height: 1.3 !important;
}

.text-extra-compact {
    font-size: 12px !important;
    line-height: 1.2 !important;
}

.font-condensed {
    font-family: 'Roboto Condensed', sans-serif !important;
}

/* Compact table styling */
.table-compact {
    font-size: 12px !important;
}

.table-compact th,
.table-compact td {
    padding: 4px 8px !important;
    vertical-align: middle;
}

.table-compact th {
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Density utility applied from config */
.table-density-compact .table,
.table-density-compact .table-modern,
.table-density-compact .dataTable {
    font-size: 12px;
}
.table-density-compact .table th,
.table-density-compact .table td { padding: 6px 10px; }

/* Super compact cards for dashboard */
.card-compact {
    margin-bottom: 1rem;
}

.card-compact .card-header {
    padding: 0.5rem 0.75rem;
    font-size: 12px;
    font-weight: 600;
}

.card-compact .card-body {
    padding: 0.75rem;
}

.card-compact .card-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Spacing adjustments for compact design */
.mb-compact {
    margin-bottom: 0.5rem !important;
}

.mt-compact {
    margin-top: 0.5rem !important;
}

.p-compact {
    padding: 0.5rem !important;
}

.px-compact {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
}

.py-compact {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

/* Timeline compact */
.timeline-compact .timeline-item {
    margin-bottom: 0.5rem;
}

.timeline-compact .timeline-header {
    font-size: 12px;
    font-weight: 500;
}

.timeline-compact .timeline-body {
    font-size: 11px;
    line-height: 1.3;
}

/* Compact buttons */
.btn-extra-sm {
    padding: 0.15rem 0.4rem;
    font-size: 10px;
    line-height: 1.2;
    border-radius: 0.25rem;
}

/* Compact form controls */
.form-control-xs {
    height: calc(1.2em + 0.5rem + 2px);
    padding: 0.25rem 0.5rem;
    font-size: 11px;
    line-height: 1.2;
}

/* Responsive spacing for mobile */
@media (max-width: 768px) {
    .p-compact {
        padding: 0.25rem !important;
    }
    
    .card-compact .card-header {
        padding: 0.375rem 0.5rem;
        font-size: 11px;
    }
    
    .card-compact .card-body {
        padding: 0.5rem;
    }
}

/* ===============================================
   TABLE VISIBILITY & OVERFLOW FIXES
   =============================================== */

/* Force all table content to be visible */
.table-full-visibility {
    table-layout: auto !important;
    width: 100% !important;
}

.table-full-visibility td,
.table-full-visibility th {
    white-space: normal !important; /* allow wrap */
    overflow: visible !important;
    text-overflow: clip !important;
    max-width: none !important;
    padding: 0.5rem 0.75rem;
    vertical-align: middle;
    border: 1px solid #dee2e6;
}

/* Allow some columns to wrap if needed */
.table-full-visibility td.text-wrap,
.table-full-visibility th.text-wrap {
    white-space: normal !important;
    word-wrap: break-word;
}

/* Dashboard table specific fixes */
.dashboard-table-container {
    overflow-x: hidden; /* hide horizontal scroll */
    -webkit-overflow-scrolling: touch;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    background-color: white;
    margin-bottom: 1rem;
}

.dashboard-table-container .table {
    margin-bottom: 0;
    width: 100%;
    table-layout: auto;
}

.dashboard-table-container .table td,
.dashboard-table-container .table th {
    padding: 0.5rem 0.75rem;
    vertical-align: middle;
    white-space: nowrap;
    overflow: visible;
    border-top: 1px solid #edf1f5;
    border-bottom: 1px solid #edf1f5;
}

/* Badge visibility in tables */
.table .badge {
    display: inline-block;
    white-space: nowrap;
    font-size: 11px;
    padding: 0.25rem 0.5rem;
    min-width: auto;
}

/* Card table improvements */
.card-body .table-responsive {
    margin: -0.75rem -0.75rem 0;
    border-radius: 0;
    border: none;
    border-top: 1px solid #dee2e6;
}

/* Modern table look */
.table-modern {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

.table-modern thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8f9fa;
    text-transform: uppercase;
    letter-spacing: .4px;
    font-weight: 600;
    padding: 0.5rem 0.75rem;
}

.table-modern tbody tr:hover {
    background: #f9fbfd;
}

.table-modern td {
    padding: 0.5rem 0.75rem;
}

/* DataTables spacing inside dashboard table container */
.dashboard-table-container .dataTables_wrapper {
    padding-top: 0.5rem;
}
.dashboard-table-container .dataTables_wrapper .dataTables_length {
    padding-left: 0.75rem;
    margin: 0.25rem 0 0.75rem 0;
}
.dashboard-table-container .dataTables_wrapper .dataTables_filter {
    padding-right: 0.75rem;
    margin: 0.25rem 0 0.75rem 0;
    text-align: right;
}
.dashboard-table-container .dataTables_wrapper .dataTables_length select {
    height: 30px;
    padding: 0.125rem 1.5rem 0.125rem 0.5rem;
    border-radius: 0.25rem;
}
.dashboard-table-container .dataTables_wrapper .dataTables_filter input[type="search"] {
    height: 30px;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}
.dashboard-table-container .dataTables_wrapper .dataTables_info {
    padding: 0.75rem 0 0.75rem 0.75rem;
    border-top: 1px solid #eaecef;
}
.dashboard-table-container .dataTables_wrapper .dataTables_paginate {
    padding: 0.75rem 0.75rem 0.75rem 0;
    border-top: 1px solid #eaecef;
    text-align: right;
}

/* Utility: prevent wrap for narrow technical fields only */
.text-nowrap {
    white-space: nowrap !important;
}

/* Softer card styling for dashboard tables */
.dashboard-table-card {
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.1);
    border: 1px solid #e7ebf0;
}

.dashboard-table-card .card-header {
    background: #fff;
    border-bottom: 1px solid #e7ebf0;
}

.dashboard-table-container {
    border: none;
    box-shadow: inset 0 -1px 0 #f0f2f5;
}

/* Compact sticky scrollbar */
.dashboard-table-container::-webkit-scrollbar {
    height: 8px;
}
.dashboard-table-container::-webkit-scrollbar-track {
    background: transparent;
}
.dashboard-table-container::-webkit-scrollbar-thumb {
    background-color: rgba(116, 124, 136, 0.35);
    border-radius: 4px;
}

/* Modern small-box tweaks */
.small-box-modern {
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.1);
    overflow: hidden;
}
.small-box-modern .inner h3 {
    font-weight: 700;
}
.small-box-modern .inner p {
    opacity: .9;
}
.small-box-modern .icon {
    opacity: .25;
}

/* Card spacing polish */
.dashboard-row .card {
    margin-bottom: 1rem;
}

/* Ensure proper scrolling for small screens */
@media (max-width: 768px) {
    .table-full-visibility,
    .dashboard-table-container .table {
        table-layout: fixed; /* more predictable wrapping on small screens */
        word-wrap: break-word;
    }
}
