/* Global Styles - Orange Theme */
:root {
    --primary-color: #e67e22;
    --secondary-color: #d35400;
    --accent-color: #f39c12;
    --text-light: #fdf2e9;
    --text-dark: #2c1810;
    --background-light: #fef5e7;
    --background-secondary: #fdeddb;
    --border-color: #f8c471;
    --hover-color: #dc7633;
    --spacing: 1rem;
    --sidebar-width: 250px;
    --navbar-height: 60px;
    --bottom-nav-height: 70px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--background-light);
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    color: var(--text-dark);
}

/* Main App Container */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
}

/* Top Navigation */
.top-navbar {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-light);
    padding: var(--spacing);
    box-shadow: 0 4px 20px rgba(230, 126, 34, 0.3);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-height);
    z-index: 1000;
    display: flex;
    align-items: center;
}

/* Sidebar Navigation (Desktop/Landscape) */
.sidebar {
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    padding-top: var(--navbar-height);
    transition: transform 0.3s ease;
    z-index: 999;
    overflow-y: auto;
    box-shadow: 4px 0 20px rgba(230, 126, 34, 0.2);
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin: 0;
}

.sidebar-nav .nav-link {
    color: var(--text-light);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    position: relative;
    overflow: hidden;
}

.sidebar-nav .nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.sidebar-nav .nav-link:hover::before {
    left: 100%;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    background-color: var(--hover-color);
    border-left-color: var(--accent-color);
    color: var(--text-light);
    transform: translateX(5px);
}

.sidebar-nav .nav-link i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.sidebar-nav .nav-link span {
    font-weight: 500;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 20px;
    margin-top: var(--navbar-height);
    overflow-y: auto;
    background: var(--background-light);
    min-height: calc(100vh - var(--navbar-height));
}

/* Bottom Navigation (Mobile/Portrait) */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 4px 0;
    box-shadow: 0 -4px 20px rgba(230, 126, 34, 0.3);
    z-index: 1000;
    height: var(--bottom-nav-height);
    overflow: hidden;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
    align-items: stretch;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    padding: 4px 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    opacity: 0.7;
    position: relative;
    min-width: 0;
    width: 100%;
    max-width: none;
    flex-shrink: 0;
    flex-grow: 1;
    box-sizing: border-box;
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--accent-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-item:hover,
.nav-item.active {
    color: var(--accent-color);
    opacity: 1;
    transform: translateY(-2px);
}

.nav-item:hover::after,
.nav-item.active::after {
    width: 70%;
}

.nav-item i {
    font-size: 1rem;
    margin-bottom: 2px;
    flex-shrink: 0;
}

.nav-item span {
    font-size: 0.55rem;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1.1;
    display: block;
    margin: 0;
    padding: 0;
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(10px);
    }
    to { 
        opacity: 1; 
        transform: translateY(0);
    }
}


/* SEARCH DOCUMENTS */

.document-section {
    display: flex;
    flex-direction: column; /* default (mobile-first) → stacked */
    gap: 20px;
}
.document-tracker {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 🔸 Orange Gradient Header Section */
.search-section {
    background: linear-gradient(135deg, #ff7e5f 0%, #feb47b 100%);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(255,126,95,0.3);
}

.search-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
    max-width: 600px;
    margin: 0 auto;
}

.button-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    width: 100%;
}

.search-input {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    outline: none;
    transition: all 0.3s ease;
}

.search-input:focus {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255,126,95,0.3);
}

/* Action Buttons - Circular Style */
.btn-action {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.btn-action:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.btn-action:active {
    transform: translateY(-1px) scale(0.98);
}

.btn-search {
    background: linear-gradient(135deg, #ff6a00, #ff8c00);
}

.btn-search:hover {
    background: linear-gradient(135deg, #e65f00, #e67e00);
}

.btn-scan {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.btn-scan:hover {
    background: linear-gradient(135deg, #218838, #1ba87f);
}

.btn-print {
    background: linear-gradient(135deg, #6c757d, #495057);
}

.btn-print:hover {
    background: linear-gradient(135deg, #5a6268, #3d4349);
}

.btn-grab {
    background: linear-gradient(135deg, #007bff, #0056b3);
}

.btn-grab:hover {
    background: linear-gradient(135deg, #0069d9, #004494);
}

.codes-section {
    display: flex;
    flex-direction: column;
    margin-bottom: 30px;
    gap: 20px;
}

.code-container {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    text-align: center;
    flex: 1;
    transition: all 0.3s ease;
}

.code-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255,126,95,0.2);
}

.document-details {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.document-details:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255,126,95,0.15);
}

/* 🔸 Orange Header */
.card-header {
    background: linear-gradient(135deg, #ff6a00 0%, #ff8c00 100%);
    color: white;
    padding: 15px 25px;
    border-radius: 10px 10px 0 0;
    font-weight: 600;
    font-size: 18px;
    margin: -30px -30px 20px -30px;
}

.detail-row {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    align-items: center;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: #555;
    min-width: 180px;
}

.detail-value {
    color: #333;
    flex: 1;
}

.tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag {
    background: linear-gradient(45deg, #ffb347, #ffcc33);
    color: #333;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 500;
}

.timeline-container {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, #ff7e5f, #feb47b);
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    margin-bottom: 30px;
    padding: 20px;
    background: #fdf7f2;
    border-radius: 12px;
    margin-left: 20px;
    transition: all 0.3s ease;
}

.timeline-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(255,126,95,0.2);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -32px;
    top: 25px;
    width: 12px;
    height: 12px;
    background: #ff7e5f;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 3px #ff7e5f;
}

.timeline-item.forwarded::before {
    background: #ff8c00;
    box-shadow: 0 0 0 3px #ff8c00;
}

.timeline-item.received::before {
    background: #ffb347;
    box-shadow: 0 0 0 3px #ffb347;
}

.timeline-item.completed::before {
    background: #ff5e62;
    box-shadow: 0 0 0 3px #ff5e62;
}

.timeline-item.pending::before {
    background: #ffc107;
    box-shadow: 0 0 0 3px #ffc107;
}

.badge {
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    color: white;
}

.badge-success { background-color: #28a745; }
.badge-warning { background-color: #ffc107; color: #212529; }
.badge-danger { background-color: #dc3545; }
.badge-primary { background-color: #ff8c00; }
.badge-info { background-color: #ff5e62; }
.badge-secondary { background-color: #6c757d; }

.timeline-date {
    color: #ff6a00;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
}

.timeline-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    font-size: 16px;
}

.timeline-details {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.loading {
    display: none;
    text-align: center;
    padding: 40px;
}

.loading .spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #ff7e5f;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

.error {
    background: #fff4f0;
    border: 1px solid #ffccbc;
    color: #d35400;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    display: none;
}
@media (min-width: 992px) {
    .document-section {
        flex-direction: row;
        align-items: flex-start;
    }

    .document-details, 
    .timeline-container {
        flex: 1;              /* take equal width */
        max-width: 50%;       /* optional limit */
    }
    .fab {
        width: 60px;
        height: 60px;
        font-size: 2.5rem;
      }
}
/* Scanner Styles */
.btn-scan {
    background: linear-gradient(45deg, #28a745, #20c997);
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(40,167,69,0.3);
}

.btn-scan:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40,167,69,0.4);
}

.scanner-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
}

.scanner-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 90vw;
    max-height: 90vh;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.scanner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.scanner-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.close-scanner {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-scanner:hover {
    background: #f0f0f0;
    color: #666;
}

.scanner-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

#scanner-video {
    width: 100%;
    max-width: 400px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.scanner-controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-scanner-control {
    background: linear-gradient(45deg, #6c757d, #495057);
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.btn-scanner-control:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108,117,125,0.4);
}

.btn-scanner-control.active {
    background: linear-gradient(45deg, #28a745, #20c997);
}

.scanner-result {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 15px;
    margin-top: 15px;
    text-align: center;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scanner-result.success {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.scanner-result.error {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.scanner-instructions {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-top: 10px;
    line-height: 1.5;
}


/* Form Styles */
.form-group {
    margin-bottom: 1rem;
}

.form-control {
    border-radius: 8px;
    border: 2px solid var(--border-color);
    padding: 0.75rem;
    transition: all 0.3s ease;
    background-color: white;
}

.form-control:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.3rem rgba(243, 156, 18, 0.25);
    outline: none;
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border: none;
    transition: all 0.3s ease;
    border-radius: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--hover-color));
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(230, 126, 34, 0.3);
}

/* Cards */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(230, 126, 34, 0.15);
    transition: all 0.3s ease;
    margin-bottom: 20px;
    background: white;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(230, 126, 34, 0.25);
}

.card-header {
    background: linear-gradient(135deg, var(--background-secondary), var(--background-light));
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    color: var(--text-dark);
}

/* Table Styles */
.table-responsive {
    border-radius: 12px;
    /* overflow: hidden; */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 8px 25px rgba(230, 126, 34, 0.15);
}

.table {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 0;
}

.table thead th {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-light);
    border: none;
    font-weight: 600;
    padding: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody td {
    padding: 12px 15px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr:hover {
    background-color: var(--background-secondary);
    transform: scale(1.01);
    transition: all 0.2s ease;
}
th.sortable {
    cursor: pointer;
    position: relative;
    user-select: none;
    white-space: nowrap;
}

th.sortable:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

th.sortable i {
    opacity: 0.6;
    transition: opacity 0.2s;
}

th.sortable:hover i {
    opacity: 1;
}

/* modal tracking docs */
    .tracking-link {
        color: #007bff;
        text-decoration: none;
        font-weight: bold;
    }
    
    .tracking-link:hover {
        text-decoration: underline;
        cursor: pointer;
    }
/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

.hidden {
    display: none !important;
}

/* Additional Orange Theme Elements */
.alert-warning {
    background-color: var(--background-secondary);
    border: 2px solid var(--border-color);
    color: var(--text-dark);
    border-radius: 10px;
}

.badge-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: var(--text-light);
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
}

/* ========================================== */
/* RESPONSIVE DESIGN - MOBILE FIRST APPROACH */
/* ========================================== */

/* DEFAULT STATE: Mobile/Portrait - Bottom Navigation */
.sidebar {
    display: none;
}

.main-content {
    margin-left: 0;
    margin-bottom: var(--bottom-nav-height);
    padding: 15px;
}
.mobile-bottom-spacer {
    height: calc(var(--bottom-nav-height) + 30px);
    display: none;
}


/* DESKTOP AND LARGE TABLETS: Show sidebar, hide bottom nav */
@media (min-width: 769px) {
    .sidebar {
        display: block !important;
    }
    
    .bottom-nav {
        display: none !important;
    }
    
    .main-content {
        margin-left: var(--sidebar-width) !important;
        margin-bottom: 0 !important;
        padding: 20px;
    }
    .search-container {
        flex-direction: column;
    }
    
    .codes-section {
        flex-direction: column;
    }
    
    .detail-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .detail-label {
        min-width: auto;
        margin-bottom: 5px;
    }
    th.sortable {
        font-size: 0.9rem;
    }
    
    th.sortable i {
        font-size: 0.8em;
    }
    .button-group {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .codes-section {
        flex-direction: row;
        justify-content: space-between;
    }
    
    .code-container {
        flex: 1;
        max-width: 48%;
    }
}

/* LANDSCAPE ORIENTATION: Always prefer sidebar (even on smaller screens) */
@media (orientation: landscape) and (min-height: 400px) {
    .sidebar {
        display: block !important;
    }
    
    .bottom-nav {
        display: none !important;
    }
    
    .main-content {
        margin-left: var(--sidebar-width) !important;
        margin-bottom: 0 !important;
    }
    .button-group {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .codes-section {
        flex-direction: row;
    }
}

/* TABLETS IN PORTRAIT: Ensure bottom nav shows */
@media (max-width: 768px) and (orientation: portrait) {
    .sidebar {
        display: none !important;
    }
    
    .bottom-nav {
        display: grid !important;
        grid-template-columns: repeat(5, 1fr) !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        margin-bottom: calc(var(--bottom-nav-height) + 20px) !important; /* Add extra 20px buffer */
        padding: 15px 15px calc(var(--bottom-nav-height) + 30px) 15px; /* Extra bottom padding */
        min-height: calc(100vh - var(--navbar-height) - var(--bottom-nav-height) - 20px);
    }
    .fab {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
    .table-responsive {
        margin-bottom: 30px; /* Extra space after tables */
    }
    
    /* Pagination spacing */
    .pagination {
        margin-bottom: 30px !important;
    }
    
    /* Generic spacing for last elements */
    .main-content > *:last-child {
        margin-bottom: 30px !important;
    }
    .mobile-bottom-spacer {
        display: block;
    }
}

/* SMALL MOBILE DEVICES: Specific adjustments */
@media (max-width: 480px) and (orientation: portrait) {
    :root {
        --navbar-height: 50px;
        --bottom-nav-height: 65px;
    }
    
    .top-navbar {
        height: var(--navbar-height);
        padding: 8px 12px;
    }
    
    .top-navbar h4 {
        font-size: 1rem;
    }
    
    .main-content {
        padding: 10px;
        margin-top: var(--navbar-height);
        /*margin-bottom: var(--bottom-nav-height);*/
        margin-left: 0 !important;
        padding: 10px 10px calc(var(--bottom-nav-height) + 35px) 10px; /* Even more bottom padding */
        margin-bottom: calc(var(--bottom-nav-height) + 25px) !important;
    }
    .table-responsive {
        margin-bottom: 35px;
    }
    .card:last-child {
        margin-bottom: 35px !important;
    }
    
    .sidebar {
        display: none !important;
    }
    
    .bottom-nav {
        height: var(--bottom-nav-height);
        padding: 5px 0;
        display: grid !important;
        grid-template-columns: repeat(5, 1fr) !important;
    }
    
    .nav-item {
        padding: 5px;
    }
    
    .nav-item i {
        font-size: 1.1rem;
    }
    
    .nav-item span {
        font-size: 0.7rem;
    }
    
    .btn-sm {
        padding: 4px 8px;
        font-size: 0.8rem;
    }
    .table thead {
        display: none; /* hide table headers */
    }

    .table tbody, 
    .table tr, 
    .table td {
        display: block;
        width: 100%;
    }

    .table tr {
        margin-bottom: 15px;
        border: 1px solid var(--border-color);
        border-radius: 10px;
        padding: 10px;
        background: white;
    }

    .table td {
        display: block;
        width: 100%;
        text-align: left;
        padding-left: 15px; /* reset from earlier */
        position: relative;
    }

    .table td::before {
        content: attr(data-label) "\A"; /* label + line break */
        display: block;                /* put it on its own line */
        font-weight: bold;
        color: var(--secondary-color);
        margin-bottom: 4px;            /* little spacing before value */
        white-space: pre-wrap;         /* allow \A to work */
        position: static;              /* no more absolute overlap */
    }
    .fab {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
      }
}

/* VERY SMALL SCREENS: Override landscape preference */
@media (max-width: 640px) and (max-height: 400px) and (orientation: landscape) {
    .sidebar {
        display: none !important;
    }
    
    .bottom-nav {
        display: grid !important;
        grid-template-columns: repeat(5, 1fr) !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        margin-bottom: var(--bottom-nav-height) !important;
    }
}

/* WIDE DESKTOP SCREENS: Better spacing */
@media (min-width: 1200px) {
    .main-content {
        padding: 30px;
    }
    
    .container-fluid {
        max-width: 1400px;
        margin: 0 auto;
    }
}

/* PRINT STYLES: Clean layout for printing */
@media print {
    .top-navbar,
    .sidebar,
    .bottom-nav {
        display: none !important;
    }
    
    .main-content {
        margin: 0 !important;
        padding: 0 !important;
        height: auto !important;
        overflow: visible !important;
    }
    
    .app-container {
        height: auto !important;
        overflow: visible !important;
    }
    
    body {
        overflow: visible !important;
        height: auto !important;
    }
}