@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700&family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
    color-scheme: dark;
    --primary-color: #D4AF37;
    /* Soft Gold */
    --accent-color: #8C6239;
    /* Rich Bronze */
    --background-dark: #0B0B0B;
    /* Jet Black */
    --surface-dark: #2A2A2A;
    /* Charcoal Grey */
    --surface-light: #363636;
    --text-white: #F5F3EE;
    /* Warm Off-White */
    --text-muted: #A0A0A0;
    --danger-color: #C62828;
    --success-color: #2E7D32;
    --border-color: #3D3D3D;
    --border-radius: 10px;
    --input-bg: rgba(255, 255, 255, 0.05);
    /* Re-added for inline styles */
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --card-bg: var(--surface-dark);
    --sidebar-width: 250px;
}

/* Global Fix: Professional Number Inputs (No accidental changes) */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
}

.btn:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    filter: grayscale(0.5);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    /* Removed aggressive global word-breaking to protect structural layouts */
}

body {
    font-family: var(--font-body);
    background-color: var(--background-dark);
    color: var(--text-white);
    line-height: 1.6;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

.container {
    width: 95%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 1rem;
}

#mobileMenuBtn {
    display: none;
    background: none;
    border: none;
    color: var(--text-white);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
}

@media (max-width: 768px) {
    #mobileMenuBtn {
        display: block;
    }
}

h1,
h2,
h3 {
    font-family: var(--font-heading);
    font-weight: 700;
}

h1 {
    font-size: 2.2rem;
    color: var(--text-white);
    letter-spacing: -0.5px;
}

/* Cards */
.card {
    background-color: var(--surface-dark);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    /* Removed default overflow-x: auto to prevent ugly scrollbars on stat cards */
}

/* Responsive Stat Cards Container System */
#statsCards .card {
    container-type: inline-size;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden; /* Hard catch to prevent inner scrollbars */
}

.stat-card-value {
    /* Uses container queries (cqi) to adaptively scale text down on smaller cards */
    font-size: clamp(0.9rem, 12cqi, 1.6rem) !important;
    word-break: break-word; /* Safe fallback wrapping for extremely long numbers */
    line-height: 1.3;
}


header h1 {
    font-size: 1.5rem;
    margin: 0;
    color: var(--primary-color);
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.2rem;
    }
    
    header {
        padding: 1rem;
        gap: 10px;
    }
}

.hide-mobile {
    display: block;
}

h2 {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--accent-color);
    padding-bottom: 10px;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #aaa;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    background-color: #1e1e1e;
    /* Solid dark background */
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-white);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

select option {
    background-color: #2A2A2A !important;
    color: #F5F3EE !important;
    padding: 10px;
}

/* Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-family: var(--font-body);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: fit-content;
    max-width: 100%;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #000;
}

.btn-primary:hover {
    background-color: #e5c05b;
}

.btn-danger {
    background-color: transparent;
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
}

.btn-danger:hover {
    background-color: var(--danger-color);
    color: white;
}

.btn-secondary {
    background-color: var(--accent-color);
    color: white;
}

.btn-reset {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(140, 98, 57, 0.1));
    border: 1px solid rgba(212, 175, 55, 0.4);
    color: var(--primary-color);
}

.btn-reset:hover {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(140, 98, 57, 0.2));
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
    transform: translateY(-2px);
}

.btn-reset i {
    color: var(--primary-color);
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    text-decoration: underline;
}

/* Footer */
footer {
    text-align: center;
    font-size: 0.8rem;
    color: #666;
    margin-top: 2rem;
}




/* Sidebar */
#sidebar-container {
    width: 250px;
    flex-shrink: 0;
    background-color: var(--surface-dark);
    border-right: 1px solid var(--border-color);
    transition: transform 0.3s ease;
    z-index: 2000;
    overflow-y: auto;
}

@media (max-width: 768px) {
    #sidebar-container {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        width: 280px;
        box-shadow: 10px 0 20px rgba(0, 0, 0, 0.5);
        display: flex;
        flex-direction: column;
    }

    #sidebar-container.active {
        transform: translateX(0);
    }

    /* Sidebar Overlay */
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(4px);
        z-index: 1999;
    }

    .sidebar-overlay.active {
        display: block;
    }
}

#sidebar-container {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: var(--sidebar-width);
    flex-shrink: 0;
    overflow: hidden;
}

.sidebar {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    min-height: 100%;
    width: var(--sidebar-width);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.sidebar-collapsed #sidebar-container {
    width: 0;
}

body.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
}

.main-content {
    flex-grow: 1;
    padding: 2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 0;
}

.sidebar-header {
    margin-bottom: 2.5rem;
    color: var(--primary-color);
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.nav-links {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    overflow-y: auto;
}

.nav-links li:last-child {
    margin-top: auto;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    font-weight: 500;
}

.nav-links a:hover {
    background-color: rgba(212, 175, 55, 0.05);
    color: var(--primary-color);
    padding-left: 25px;
}

.nav-links a.active {
    background-color: rgba(212, 175, 55, 0.1);
    color: var(--primary-color);
    border-left: 3px solid var(--primary-color);
    border-radius: 0 8px 8px 0;
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
        padding-top: 1.5rem;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .card {
        padding: 1rem !important;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        padding: 14px; /* Slightly larger for touch */
    }

    /* Fixed vertical text in tables on mobile */
    .data-table td, .data-table th {
        min-width: 100px; /* Prevent columns from collapsing into single letters */
    }
    
    .item-name-cell {
        min-width: 200px !important;
    }

    .hide-mobile {
        display: none !important;
    }

    /* POS Modal Specific Fixes */
    #historyModal {
        width: 98% !important;
        padding: 1.2rem !important;
    }

    #historyFlexContainer {
        height: 85vh !important;
    }

    #historyListColumn {
        height: 200px !important;
    }
}

#historyFlexContainer {
    display: flex;
    flex-direction: column;
}

#historyListColumn {
    width: 100%;
    border-right: none !important;
    border-bottom: 1px solid var(--border-color);
}

#historyDetails {
    width: 100%;
}

.close-modal-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    width: 28px;
    height: 28px;
    min-width: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.8rem;
    background: var(--surface-light);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

.close-modal-btn:hover {
    background: var(--danger-color);
    color: white;
    border-color: var(--danger-color);
}

@media (min-width: 769px) {
    .hide-desktop {
        display: none !important;
    }
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: var(--surface-dark);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1.2rem;
    height: 100%;
    min-height: 130px;
    transition: all 0.3s ease;
}

.stat-card .icon {
    width: 45px;
    height: 45px;
    flex-shrink: 0;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--primary-color);
}

.stat-card.alert .icon {
    color: var(--danger-color);
    background-color: rgba(198, 40, 40, 0.1);
}

.stat-card .info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0; /* Enable text truncation/scaling */
}

.stat-card .info h3 {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0 0 5px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-card .info p {
    font-family: var(--font-mono);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-white);
    margin: 0;
    line-height: 1.2;
    word-break: break-all;
}

/* Secondary info scaling */
.stat-card .info span, 
.stat-card .info div:not(:first-child) {
    font-size: 0.75rem !important;
    color: rgba(255, 255, 255, 0.5) !important;
    margin-top: 4px;
}

/* Stat Card Links */
.stat-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card-link:hover {
    transform: translateY(-4px);
}

.stat-card-link:hover .stat-card {
    border-color: var(--primary-color);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.4);
}

.stat-card-link:hover .icon {
    background-color: rgba(212, 175, 55, 0.1);
}

/* Tables and Scrollable Lists */
.scrollable-list {
    max-height: 480px;
    overflow-y: auto;
    padding-right: 5px;
}

.scrollable-list::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.scrollable-list::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

/* Premium Grid Cards Design */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    margin-top: 1.5rem;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 5px;
}

.categories-grid::-webkit-scrollbar {
    width: 6px;
}

.categories-grid::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

.category-card {
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease;
    position: relative;
    min-height: 100px;
}

.category-card:hover {
    background: #333;
    transform: translateY(-2px);
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.category-card h4 {
    margin: 0 0 5px 0;
    color: #fff;
    font-size: 1.1rem;
}

/* Mobile Utilities */
.mobile-show { display: none; }

.category-card p {
    margin: 5px 0;
    color: #aaa;
    font-size: 0.9rem;
    line-height: 1.4;
}

.card-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #333;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.action-btn {
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.action-btn.edit {
    background: rgba(212, 175, 55, 0.1);
    color: var(--primary-color);
}

.action-btn.edit:hover {
    background: rgba(212, 175, 55, 0.2);
}

.action-btn.delete {
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
}

.action-btn.delete:hover {
    background: rgba(244, 67, 54, 0.2);
}

.data-table-container,
.dynamic-content-scroll {
    overflow-x: auto;
    overflow-y: auto;
    max-height: calc(100vh - var(--table-offset, 320px));
    margin-top: 1rem;
    padding: 10px;
    padding-right: 5px;
    position: relative;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--surface-dark); /* Ensure background for sticky headers */
    -webkit-overflow-scrolling: touch; /* Smooth mobile scroll */
    scrollbar-width: thin;
}

/* Mobile swipe hint */
@media (max-width: 768px) {
    .data-table-container::after {
        content: '← Swipe to scroll →';
        display: block;
        text-align: center;
        font-size: 0.7rem;
        color: var(--primary-color);
        opacity: 0.6;
        margin-top: 8px;
        text-transform: uppercase;
        letter-spacing: 1px;
    }
}

.data-table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--surface-dark);
    box-shadow: inset 0 -2px 0 var(--border-color);
}

.data-table-container::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.data-table-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 6px;
}

.data-table-container::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 6px;
    border: 2px solid transparent;
    background-clip: padding-box;
    transition: background 0.2s ease;
}

.data-table-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
    background-clip: padding-box;
}

.data-table-container::-webkit-scrollbar-corner {
    background: transparent;
}

.data-table {
    table-layout: fixed !important; /* Forces browser to follow column widths strictly */
    width: 1250px !important;       /* Desktop floor */
    min-width: 1250px !important;
    border-collapse: collapse;
}

@media (max-width: 768px) {
    .data-table {
        width: auto !important;
        min-width: 100% !important; /* Let columns drive the width */
    }
}

/* Universal Table Protection - Prevents mangled headers across all modules */
table th:not(.wrap-cell):not(.item-name-cell),
table td:not(.wrap-cell):not(.item-name-cell),
.data-table th:not(.wrap-cell):not(.item-name-cell),
.data-table td:not(.wrap-cell):not(.item-name-cell) {
    white-space: nowrap !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
}

/* Smart Wrapping Utilities */
.wrap-cell, 
.item-name-cell {
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
}

.item-name-cell {
    width: auto !important;
    min-width: 250px !important;
    max-width: 500px !important; /* Increased for better desktop experience */
    line-height: 1.5 !important;
    padding: 12px 40px 12px 12px !important; /* Safety buffer preserved */
    vertical-align: middle !important;
    white-space: normal !important;
    overflow: visible !important;
}

/* Hardened Helper Columns */
.col-code { width: 180px !important; min-width: 180px !important; }
.col-qty { width: 100px !important; min-width: 100px !important; }
.col-price { width: 140px !important; min-width: 140px !important; }
.col-unit { width: 80px !important; min-width: 80px !important; }
.col-status { width: 120px !important; min-width: 120px !important; }
.col-action { width: 130px !important; min-width: 130px !important; }
.col-date { width: 180px !important; min-width: 180px !important; }

.item-name-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    width: 100%;
    word-wrap: break-word;
    word-break: break-word;
}

.text-numeric {
    font-family: var(--font-mono);
    text-align: right;
}

.text-nowrap {
    white-space: nowrap !important;
}

.data-table tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.03);
}

.data-table tr:hover {
    background-color: rgba(212, 175, 55, 0.08);
    /* Highlight with primary color tint */
    transition: background-color 0.2s ease;
}

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-warning {
    background-color: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.badge-success {
    background-color: rgba(40, 167, 69, 0.2);
    color: #28a745;
}

/* POS Layout */
.pos-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    height: calc(100vh - 4rem);
}

.pos-left,
.pos-right {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cart-panel {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.cart-items {
    flex-grow: 1;
    overflow-y: auto;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin: 1rem 0;
    padding: 1rem 0;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    border-bottom: 1px solid #333;
}

/* POS UI Refinements */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    overflow-y: auto;
    padding: 5px;
    height: calc(100vh - 250px);
}

.product-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 1.2rem;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s, border-color 0.2s;
    user-select: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 140px;
}

.product-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-5px);
    border-color: var(--primary-color);
}

.product-card:active {
    transform: scale(0.95);
}

.product-card .item-name {
    font-weight: 500;
    font-size: 1rem;
    margin-bottom: 8px;
    color: var(--text-light);
}

.product-card .item-price {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.product-card .item-stock {
    font-size: 0.75rem;
    color: #888;
    margin-top: 5px;
}

.product-card.low-stock {
    border-color: var(--danger-color);
}

/* Category Filters */
.category-strip {
    display: flex;
    gap: 0.8rem;
    overflow-x: auto;
    padding: 10px 0;
    margin-bottom: 1rem;
    white-space: nowrap;
    scrollbar-width: thin;
}

.category-btn {
    padding: 8px 24px;
    border-radius: 20px;
    background: var(--surface-dark);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-btn.active {
    background: var(--primary-color);
    color: #000;
    border-color: var(--primary-color);
    font-weight: 600;
}

/* Cart Improvements */
.cart-qty-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid #444;
    background: #2c2c2c;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.cart-qty-btn:hover {
    background: #000;
}

/* --- Read-Only Store Mode --- */
.store-read-only .read-only-hidden {
    display: none !important;
}

.store-read-only .read-only-disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed !important;
}

/* Responsive Customization */
@media (max-width: 768px) {
    .pos-layout {
        height: auto;
        display: block;
    }

    .pos-right {
        margin-top: 2rem;
    }

    .product-grid {
        height: 60vh;
    }
}

/* Global Dialog Styles */
dialog {
    margin: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--surface-dark);
    color: var(--text-white);
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    max-width: 450px;
    width: 90%;
    outline: none;
}

@media (max-width: 480px) {
    dialog {
        padding: 1.5rem;
    }
}

dialog::backdrop {
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

dialog h3 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-size: 1.5rem;
}

dialog p {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

/* Legacy Modal Styles (Centering for existing div-based popups) */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 8000;
    /* Higher than announcements (5000) */
    justify-content: center;
    align-items: flex-start;
    overflow-y: auto;
    padding: 20px;
}

.modal.active {
    display: flex !important;
}

.modal-content,
.modal>.card {
    background: var(--surface-dark) !important;
    padding: 2.5rem !important;
    border-radius: var(--border-radius) !important;
    width: 90%;
    max-width: 600px;
    max-height: calc(100vh - 40px) !important;
    overflow-y: auto !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7) !important;
    margin: auto !important;
}

/* Wide modal variant — for data-heavy modals like fulfillment screens */
.modal-wide .modal-content {
    width: 96vw !important;
    max-width: 1500px !important;
}

@media (max-width: 480px) {

    .modal-content,
    .modal>.card {
        padding: 1.5rem !important;
    }
}

/* Announcement Banner */
/* Announcement Banner */
.announcement-banner {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 5000;
    /* Above sidebar (1000) but below modals (8000+) */
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    max-width: 350px;
    pointer-events: none;
    /* Let clicks pass through empty space */
}

.announcement-banner>* {
    pointer-events: auto;
    /* Re-enable for the actual box and close button */
}

.announcement-banner.visible {
    opacity: 1;
    transform: translateY(0);
}

.announcement-content {
    background: linear-gradient(135deg, var(--surface-dark), #1a1a1a);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px 25px 15px 15px;
    color: var(--text-white);
    font-weight: 500;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Variant Colors - Subtle Accents */
.announcement-info .announcement-content {
    border-left: 4px solid var(--primary-color);
    /* Gold */
}

.announcement-warning .announcement-content {
    border-left: 4px solid var(--accent-color);
    /* Bronze */
}

.announcement-success .announcement-content {
    border-left: 4px solid var(--success-color);
    /* Green */
}

/* Close Button */
.announcement-close {
    position: absolute;
    top: -10px;
    right: -10px;
    background: white;
    color: #333;
    border: 2px solid #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    transition: transform 0.2s;
}

.announcement-close:hover {
    transform: scale(1.1);
    background: #f8f9fa;
}

/* Content Elements */
.announcement-img {
    width: 100%;
    max-height: 150px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

.announcement-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.announcement-link:hover .announcement-text {
    text-decoration: underline;
}

/* Idle Screensaver Mode */
body.idle-active::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9998;
    pointer-events: none;
    /* Let clicks pass through to document listener */
}

body.idle-active .announcement-banner {
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    transform: translate(-50%, -50%) scale(1.2) !important;
    max-width: 90%;
    width: 500px;
    z-index: 9999;
}

body.idle-active .announcement-banner .announcement-content {
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    border: 2px solid var(--primary-color);
}

/* Financials Specific Improvements */
.last-pay-cell {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.last-pay-info {
    text-align: left;
    line-height: 1.3;
}

.last-pay-info .amount {
    font-size: 0.95rem;
    font-weight: 600;
}

.last-pay-info .date-subtext {
    font-size: 0.75rem;
    color: #888;
}

/* ==========================================================================
   MOBILE RESPONSIVENESS OVERHAUL
   ========================================================================== */

@media (max-width: 768px) {

    /* Fluid Layout & Typography */
    body {
        padding: 0;
    }

    .main-content {
        padding: 1rem;
        padding-top: 1.5rem;
    }

    /* Tab Menu Improvements */
    .tabs {
        padding-bottom: 0.8rem !important;
        margin-bottom: 1rem !important;
    }

    .tab-btn {
        padding: 8px 12px !important;
        font-size: 0.9rem !important;
        background: rgba(255, 255, 255, 0.03) !important;
    }

    h1 {
        font-size: 1.8rem !important;
    }

    h2 {
        font-size: 1.2rem !important;
    }

    .card {
        padding: 1.2rem;
        margin-bottom: 1rem;
    }

    /* Filter & Form Improvements */
    .filters,
    .form-row,
    .action-buttons,
    .filters-row,
    .mobile-stack {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 15px !important;
        width: 100% !important;
    }

    .mobile-stack > * {
        width: 100% !important;
        margin-right: 0 !important;
        flex: none !important;
    }

    .mobile-stack-flex {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
    }

    .mobile-hide {
        display: none !important;
    }

    .mobile-show {
        display: block !important;
    }

    .form-row {
        grid-template-columns: 1fr !important;
    }

    .btn {
        width: 100% !important;
        justify-content: center;
    }

    /* Settings Form Stacking - Highest Specificity Override */
    .tab-pane .settings-form-grid,
    form.settings-form-grid,
    .settings-form-grid {
        grid-template-columns: 1fr !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
    }

    .settings-form-grid .form-group {
        border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
        padding-bottom: 20px !important;
        margin-bottom: 10px !important;
        width: 100% !important;
    }

    .settings-form-grid .form-group:last-child {
        border-bottom: none;
    }

    /* Responsive Table Pattern (Card-based) */
    .data-table-container,
    .table-responsive {
        border: none !important;
        padding: 0 !important;
        max-height: none !important;
        overflow-x: visible !important;
    }

    .data-table:not(.static-table),
    .table:not(.static-table),
    .data-table:not(.static-table) thead,
    .table:not(.static-table) thead,
    .data-table:not(.static-table) tbody,
    .table:not(.static-table) tbody,
    .data-table:not(.static-table) th,
    .table:not(.static-table) th,
    .data-table:not(.static-table) td,
    .table:not(.static-table) td,
    .data-table:not(.static-table) tr,
    .table:not(.static-table) tr {
        display: block !important;
    }

    /* Hide table headers on mobile */
    .data-table thead,
    .table thead,
    .data-table thead tr,
    .table thead tr,
    .data-table th,
    .table th {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        height: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        border: none !important;
    }

    .data-table tr,
    .table tr {
        border: 1px solid var(--border-color);
        margin-bottom: 1.5rem;
        border-radius: var(--border-radius);
        background: var(--surface-light);
        padding: 1rem 0.5rem;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
        overflow: visible;
    }

    .data-table td,
    .table td {
        border: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
        position: relative !important;
        padding: 12px 10px 12px 42% !important;
        text-align: right !important;
        min-height: 45px;
        display: flex !important;
        align-items: center;
        justify-content: flex-end;
        font-size: 0.9rem !important;
        gap: 10px;
        width: 100% !important;
        box-sizing: border-box;
        /* Re-enable wrapping for Mobile Card View only */
        white-space: normal !important;
        word-break: break-word !important;
    }

    .data-table td:last-child {
        border-bottom: none !important;
        flex-direction: column !important;
        align-items: stretch !important;
        padding-left: 42% !important; /* Preserve label space */
        justify-content: center !important;
        margin-top: 10px;
        background: rgba(0, 0, 0, 0.1);
        border-radius: 4px;
        gap: 8px;
    }

    .data-table td:last-child .last-pay-info {
        text-align: right;
        width: 100%;
    }

    /* Summary Row Special Case - More Specific to override .data-table td */
    .data-table tfoot tr.summary-row,
    .table tfoot tr.summary-row {
        background: rgba(212, 175, 55, 0.05) !important;
        border: 2px solid var(--primary-color) !important;
        margin: 2rem 0 !important;
        width: 100% !important;
        display: block !important;
        padding: 0 !important; /* Reset generic tr padding */
    }

    .data-table tfoot tr.summary-row td,
    .table tfoot tr.summary-row td {
        padding: 15px 10px !important;
        padding-left: 10px !important;
        justify-content: center !important;
        text-align: center !important;
        background: transparent !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
        width: 100% !important;
        display: flex !important;
    }

    .data-table tfoot tr.summary-row td:before,
    .table tfoot tr.summary-row td:before {
        display: none !important;
    }

    /* Use data-label for pseudo-headers */
    .data-table td:before,
    .table td:before {
        position: absolute;
        left: 12px;
        width: 38%;
        padding-right: 10px;
        white-space: normal;
        text-align: left;
        font-weight: 700;
        color: var(--primary-color);
        content: attr(data-label);
        text-transform: uppercase;
        font-size: 0.62rem;
        letter-spacing: 0.5px;
        line-height: 1.2;
        display: block !important;
        top: 50%;
        transform: translateY(-50%);
    }

    /* Summary Card Stacking */
    .summary-cards,
    .dashboard-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-card .info p {
        font-size: 1.5rem;
    }

    /* Modal Adjustments */
    .modal-content,
    .modal > .card {
        padding: 1.5rem !important;
        width: 95% !important;
        max-width: 95% !important;
        margin: 10px auto !important;
        max-height: 95vh;
        overflow-y: auto;
    }

    /* Settings UI Tweaks */
    .field-header {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 15px !important;
        margin-bottom: 10px !important;
        width: 100% !important;
    }

    /* Target only the text label, not the toggle switch label */
    .field-header label:not(.toggle-switch) {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        white-space: normal !important;
        font-size: 0.9rem !important;
        line-height: 1.3 !important;
        margin: 0 !important;
        padding-right: 10px !important;
        text-align: left !important;
    }

    .field-header .toggle-switch {
        flex: 0 0 36px !important;
        margin-left: auto !important;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.4rem !important;
    }

    .data-table td {
        padding-left: 40% !important;
    }

    .data-table td:before {
        width: 35%;
    }
}

/******************************************************************************
 * DEFINITIVE PRINT OVERRIDES (RELOCATED TO END FOR PRECEDENCE)
 ******************************************************************************/
@media print {
    * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
    }

    /* Industry Standard Page Settings for Thermal Roll */
    @page { 
        size: 80mm auto; 
        margin: 0 !important; 
    }

    /* Standard Report Margins (A4/Letter) */
    body:not(.thermal-print) {
        padding: 10mm 15mm !important;
    }

    /* Reset Body for Print */
    body {
        background: white !important;
        color: black !important;
        margin: 0 !important;
        padding: 0 !important;
        display: block !important;
        visibility: visible !important;
    }

    /* Visibility Controls */
    .sidebar,
    #sidebar-container,
    header:not(.print-header),
    .no-print,
    .hide-print,
    .tabs,
    .action-buttons,
    button,
    .announcement-banner,
    .sidebar-overlay,
    #mobileMenuBtn,
    .scroll-btn,
    .control-panel,
    .filters {
        display: none !important;
    }

    /* Container Resets */
    .main-content,
    .card,
    .data-table-container,
    .table-responsive,
    .print-area,
    #printableArea,
    .modal-content {
        display: block !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
        color: black !important;
        border: none !important;
        box-shadow: none !important;
        visibility: visible !important;
        position: static !important;
    }

    /* DATA TABLES: PROFESSIONAL LOOK (ALL TABLES) */
    .data-table,
    .table {
        display: table !important;
        width: 100% !important;
        border-collapse: collapse !important;
        margin-top: 20px !important;
        background: white !important;
        color: black !important;
        border: 1px solid #ddd !important;
        table-layout: auto !important;
    }

    .data-table thead,
    .table thead {
        display: table-header-group !important;
        visibility: visible !important;
        opacity: 1 !important;
        height: auto !important;
    }

    .data-table thead tr,
    .table thead tr {
        display: table-row !important;
        background-color: #f8f9fa !important;
        height: auto !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .data-table th,
    .table th {
        display: table-cell !important;
        visibility: visible !important;
        opacity: 1 !important;
        height: auto !important;
        background-color: #f8f9fa !important;
        color: black !important;
        font-weight: 700 !important;
        padding: 12px 8px !important;
        border: 1px solid #ddd !important;
        text-align: left !important;
        font-size: 0.95rem !important;
        text-transform: none !important;
    }

    /* DATA ROWS */
    .data-table tbody,
    .table tbody {
        display: table-row-group !important;
    }

    .data-table tr,
    .table tr {
        display: table-row !important;
        background: white !important;
        border: 1px solid #ddd !important;
    }

    .data-table td,
    .table td {
        display: table-cell !important;
        padding: 10px 8px !important;
        border: 1px solid #ddd !important;
        color: black !important;
        font-size: 0.9rem !important;
        text-align: left !important;
        visibility: visible !important;
        vertical-align: middle !important;
        background: white !important;
    }

    /* HIDE MOBILE PSEUDO-HEADERS */
    .data-table td:before,
    .table td:before {
        display: none !important;
        content: none !important;
    }

    /* SCOPED: SHOP STATEMENT OPTIMIZATIONS */
    body.printing-statement .data-table,
    #printableArea .data-table {
        table-layout: fixed !important;
    }

    /* Statement Specific Column Widths */
    body.printing-statement .data-table thead th:nth-child(1),
    body.printing-statement .data-table tbody td:nth-child(1) {
        width: 20% !important;
        white-space: nowrap !important;
    }

    body.printing-statement .data-table thead th:nth-child(2),
    body.printing-statement .data-table tbody td:nth-child(2) {
        width: 15% !important;
        white-space: nowrap !important;
    }

    body.printing-statement .data-table thead th:nth-child(3),
    body.printing-statement .data-table tbody td:nth-child(3) {
        width: 12% !important;
    }

    /* Alignment for Financial Columns in Statement */
    body.printing-statement .data-table th:nth-child(4),
    body.printing-statement .data-table td:nth-child(4),
    body.printing-statement .data-table th:nth-child(5),
    body.printing-statement .data-table td:nth-child(5),
    body.printing-statement .data-table th:nth-child(6),
    body.printing-statement .data-table td:nth-child(6) {
        text-align: right !important;
    }

    body.printing-statement .data-table thead th:nth-child(4) {
        width: 13% !important;
    }

    body.printing-statement .data-table thead th:nth-child(5) {
        width: 13% !important;
    }

    body.printing-statement .data-table thead th:nth-child(6) {
        width: 27% !important;
        font-weight: 700 !important;
    }

    /* Branding & Titles */
    #statementHeader,
    #invoiceHeader,
    .print-header {
        display: block !important;
        margin-bottom: 25px !important;
        visibility: visible !important;
    }

    h1,
    h2,
    h3 {
        color: black !important;
        margin: 5px 0 !important;
    }

    /* --- INDUSTRY STANDARD 80MM THERMAL RECEIPT --- */
    body.thermal-print {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
        color: black !important;
        font-family: 'Courier New', Courier, monospace !important;
        font-size: 11pt !important; /* Slightly increased primary size */
        font-weight: bold !important; /* Force bold for deeper head penetration */
        line-height: normal !important;
        overflow: visible !important;
        -webkit-print-color-adjust: exact !important;
    }

    /* Force all child elements to be pure black and bold */
    body.thermal-print *,
    body.thermal-print p,
    body.thermal-print span,
    body.thermal-print div,
    body.thermal-print td,
    body.thermal-print th {
        color: black !important;
        font-weight: bold !important;
    }

    body.thermal-print #receiptPrint {
        display: block !important;
        width: 72mm !important; /* Standard printable width for 80mm roll */
        margin: 0 !important;
        padding: 2mm 0 !important;
        box-sizing: border-box !important;
        visibility: visible !important;
        position: static !important;
    }

    body.thermal-print .receipt-header {
        text-align: center;
        margin-bottom: 5mm;
        padding-bottom: 2mm;
        border-bottom: 2pt solid #000; /* Thicker solid line */
    }

    body.thermal-print #receiptShopName {
        font-size: 16pt !important; /* Increased branding size */
        font-weight: 800 !important;
        margin: 2mm 0 !important;
        text-transform: uppercase;
    }

    body.thermal-print .receipt-info-row {
        display: flex;
        justify-content: space-between;
        margin-bottom: 1.5mm;
        font-size: 10pt; /* Increased from 9pt */
    }

    body.thermal-print .receipt-table {
        width: 100% !important;
        border-collapse: collapse !important;
        margin: 5mm 0 !important;
        table-layout: fixed;
    }

    body.thermal-print .receipt-table th {
        border-bottom: 2pt solid #000 !important; /* Thicker header divider */
        padding: 2mm 0 !important;
        font-weight: bold !important;
        font-size: 10pt !important;
        text-align: left;
    }

    body.thermal-print .receipt-table td {
        padding: 2mm 0 !important;
        vertical-align: top !important;
        font-size: 10pt !important;
        word-wrap: break-word;
    }

    body.thermal-print .receipt-item-name {
        font-weight: bold;
        display: block;
    }

    body.thermal-print .receipt-item-details {
        font-size: 10pt; /* Increased for better SKU visibility */
        color: black !important;
    }

    body.thermal-print tfoot {
        border-top: 2pt solid #000 !important;
    }

    body.thermal-print tfoot tr td {
        padding: 2mm 0 !important;
    }

    body.thermal-print .total-row {
        font-size: 14pt !important; /* Larger impact for Total */
        font-weight: 900 !important;
        border-top: 2pt solid #000 !important;
        border-bottom: 2pt solid #000 !important;
    }

    body.thermal-print .receipt-footer {
        margin-top: 8mm;
        text-align: center;
        border-top: 2pt solid #000; /* Solid divider for footer */
        padding-top: 5mm;
        font-size: 10pt !important;
    }

    /* Hide everything else during thermal print */
    body.thermal-print > *:not(#receiptPrint) {
        display: none !important;
    }
        margin-top: 20px;
        text-align: center;
        border-top: 1px dashed #000;
        padding-top: 10px;
        font-size: 11px !important;
    }

    body.thermal-print .receipt-footer p {
        margin: 4px 0 !important;
    }

    /* Hide everything else during thermal print */
    body.thermal-print > *:not(#receiptPrint) {
        display: none !important;
    }
}

/* ==========================================================================
   Professional PDF Overhaul (Phase 19)
   ========================================================================== */
.pdf-mode {
    background: #ffffff !important;
    color: #1a1a1a !important;
    width: 800px !important; /* Keep fixed for html2canvas consistency */
    min-height: 1000px !important;
    padding: 45px !important;
    box-sizing: border-box !important;
    margin: 0 auto !important;
    font-family: 'Helvetica', 'Arial', sans-serif !important;
    display: block !important;
    position: relative !important;
}

.pdf-mode * {
    background-color: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
}

/* Document Header Branding (Shared across HTML Preview & PDF) */
.doc-header {
    display: block !important;
    text-align: center !important;
    border-bottom: 2pt solid #D4AF37 !important;
    padding-bottom: 15px !important;
    margin-bottom: 20px !important;
    width: 100% !important;
}

.doc-header img {
    max-height: 80px !important;
    max-width: 100% !important;
    margin-bottom: 10px !important;
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
    object-fit: contain !important;
}

/* Header Branding (Centered - Legacy PDF Only - Now inherited from base classes) */
.pdf-mode .doc-label {
    font-size: 14pt !important;
    font-weight: 700 !important;
    color: #666 !important;
    text-transform: uppercase !important;
    margin: 5px 0 !important;
}

.pdf-mode .business-name {
    font-size: 20pt !important;
    font-weight: 800 !important;
    color: #333 !important;
    margin: 5px 0 !important;
}

.pdf-mode .metadata-line {
    font-size: 9pt !important;
    color: #888 !important;
    margin: 5px 0 !important;
}

/* Info Blocks */
.pdf-mode .info-section {
    display: flex !important;
    justify-content: space-between !important;
    margin-bottom: 30px !important;
    width: 100% !important;
}

.pdf-mode .info-box {
    width: 48% !important;
}

.pdf-mode .info-box h4 {
    font-size: 9pt !important;
    color: #888 !important;
    text-transform: uppercase !important;
    margin: 0 0 5px 0 !important;
    border-bottom: 1px solid #eee !important;
}

.pdf-mode .info-box p {
    margin: 2px 0 !important;
    font-size: 10.5pt !important;
    color: #333 !important;
    line-height: 1.4 !important;
}

/* Data Table */
.pdf-mode .data-table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 20px 0 !important;
    table-layout: fixed !important; /* Forces column widths to be respected */
}

.pdf-mode .data-table th {
    background: #D4AF37 !important; /* Muriq Gold */
    color: #ffffff !important;
    font-size: 9.5pt !important;
    font-weight: 700 !important;
    padding: 10px !important;
    border: 1px solid #b8860b !important;
    text-align: center !important;
}

.pdf-mode .data-table td {
    padding: 10px !important;
    border: 1px solid #eee !important;
    font-size: 10pt !important;
    color: #333 !important;
}

/* Totals Area */
.pdf-mode .totals-area {
    width: 100% !important;
    margin-top: 25px !important;
}

.pdf-mode .total-row {
    display: flex !important;
    justify-content: flex-end !important;
    padding: 6px 0 !important;
    text-align: right !important;
}

.pdf-mode .total-row span:first-child {
    width: 150px !important;
    color: #666 !important;
}

.pdf-mode .total-row span:last-child {
    width: 150px !important;
    font-weight: 700 !important;
}

.pdf-mode .total-row.grand {
    margin-top: 10px !important;
    padding: 15px 0 !important;
    border-top: 2px solid #333 !important;
    border-bottom: 4px double #333 !important;
    font-size: 16pt !important;
    color: #D4AF37 !important;
}

/* Footer */
.pdf-mode .doc-footer {
    margin-top: 50px !important;
    padding-top: 20px !important;
    border-top: 1px solid #D4AF37 !important;
    text-align: center !important;
    font-size: 9pt !important;
    color: #666 !important;
}

/******************************************************************************
 * THE IRON-CLAD TABLE SAFEGUARD (SYSTEM-WIDE NO-WRAP)
 * This ensures that data tables never vertical-stack headers or values.
 * Tables will expand horizontally and provide a scrollbar instead.
 ******************************************************************************/
@media screen and (min-width: 769px) {
    .data-table-container table,
    table.data-table {
        width: auto !important;
        min-width: 100% !important;
        display: table !important;
    }

    .data-table th,
    .data-table td,
    table th,
    table td {
        white-space: nowrap !important;
        word-break: normal !important;
        overflow-wrap: normal !important;
        min-width: max-content !important;
    }
}

/* Global CSS replacement for legacy JS hardenTables fallback */
table:not(.data-table) {
    width: auto !important;
    min-width: 100% !important;
}
