/* =========================================================================
   TRACE VERISYS - MAIN STYLESHEET (FULL - COMPACT PDF OPTIMIZED)
   ========================================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    background: #f1f5f9;
    font-family: 'Segoe UI', sans-serif;
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: #0f172a;
    color: white;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.main-content {
    flex-grow: 1;
    padding: 40px;
    width: 100%;
}

.nav-link {
    color: #94a3b8;
    padding: 12px 20px;
    transition: 0.2s;
    display: block;
    text-decoration: none;
}

.nav-link:hover,
.nav-link.active {
    color: white;
    background: #1e293b;
    border-left: 4px solid #3b82f6;
}

/* ==================== RESULT CARDS - COMPACT & CLEAN ==================== */

.result-card {
    background: white !important;
    border-radius: 6px !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 3px 10px rgba(0,0,0,0.06) !important;
    margin-bottom: 16px !important;
    overflow: hidden !important;
}

.result-header {
    background: #1e293b !important;
    color: white !important;
    padding: 10px 14px !important;
    font-size: 0.9rem !important;
    font-weight: bold !important;
    border-bottom: 2px solid #334155 !important;
}

.result-table {
    width: 100% !important;
    border-collapse: collapse !important;
}

.result-table td {
    padding: 9px 14px !important;
    border-bottom: 1px solid #f1f5f9 !important;
    font-size: 0.82rem !important;
    line-height: 1.4 !important;
}

.result-label {
    background: #f8fafc !important;
    width: 36% !important;
    color: #64748b !important;
    font-weight: bold !important;
    text-transform: uppercase !important;
    font-size: 0.74rem !important;
}

/* Image Styling */
.img-detect {
    max-width: 100%;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid #e2e8f0;
    display: block;
    margin: 8px auto;
}

/* Other cards */
.pkg-card, .stat-card, .card {
    border-radius: 12px !important;
}

/* ==================== COMPACT PDF STYLES (Like Khoji Layout) ==================== */
@media print {
    .sidebar, 
    .main-content > div:first-child, 
    .alert, 
    #download-pdf,
    button:not(.no-print) {
        display: none !important;
    }

    .main-content {
        padding: 15px !important;
        margin: 0 !important;
        background: white !important;
    }

    .result-card {
        margin-bottom: 14px !important;
        border: 1px solid #cbd5e1 !important;
        box-shadow: none !important;
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }

    .result-header {
        padding: 9px 13px !important;
        font-size: 0.92rem !important;
    }

    .result-table td {
        padding: 7px 13px !important;
        font-size: 0.79rem !important;
    }

    .result-label {
        width: 35% !important;
        font-size: 0.73rem !important;
    }

    img.img-detect {
        max-height: 320px !important;
        max-width: 100% !important;
    }

    .col-lg-4, .col-md-6 {
        width: 33.33% !important;
        float: left !important;
        padding: 0 6px !important;
    }
}

/* Extra Compact Class for PDF */
.pdf-compact .result-card {
    margin-bottom: 12px !important;
}

.pdf-compact .result-header {
    padding: 8px 12px !important;
}

.pdf-compact .result-table td {
    padding: 6px 12px !important;
    font-size: 0.77rem !important;
}

/* Responsive */
@media (max-width: 768px) {
    .main-content { 
        padding: 20px; 
    }
}