/* Medical Lab System CSS - Enterprise Commercial Edition */
:root {
    --primary-color: #0d9488;
    --primary-dark: #0f766e;
    --primary-light: #ccfbf1;
    --secondary-color: #0284c7;
    --dark-bg: #0f172a;
    --card-bg: #ffffff;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --accent-red: #ef4444;
    --accent-green: #10b981;
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f8fafc;
    color: var(--text-dark);
    margin: 0;
    padding: 0;
}

/* Sidebar & Navigation */
.sidebar {
    width: 260px;
    background: #0f172a;
    min-height: 100vh;
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: all 0.3s;
    box-shadow: 4px 0 15px rgba(0,0,0,0.1);
}

.sidebar .brand {
    padding: 1.5rem 1.25rem;
    font-size: 1.25rem;
    font-weight: 700;
    background: #1e293b;
    color: #38bdf8;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid #334155;
}

.sidebar .nav-link {
    color: #94a3b8;
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar .nav-link:hover, .sidebar .nav-link.active {
    color: #ffffff;
    background: #1e293b;
    border-left-color: #38bdf8;
}

.main-content {
    margin-left: 260px;
    padding: 2rem;
    min-height: 100vh;
}

/* Stats Cards */
.stat-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px -3px rgba(0,0,0,0.08);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.bg-teal-light { background-color: #ccfbf1; color: #0d9488; }
.bg-blue-light { background-color: #e0f2fe; color: #0284c7; }
.bg-amber-light { background-color: #fef3c7; color: #d97706; }
.bg-emerald-light { background-color: #d1fae5; color: #059669; }
.bg-red-light { background-color: #fee2e2; color: #dc2626; }

/* Critical Life Threatening Alert Animation */
.critical-alert-banner {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(220, 38, 38, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

/* Data Tables */
.custom-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.custom-table th {
    background: #f1f5f9;
    color: #475569;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.custom-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
}

.custom-table tr:last-child td {
    border-bottom: none;
}

.custom-table tr:hover td {
    background-color: #f8fafc;
}

/* Badges */
.badge-status {
    padding: 0.35em 0.75em;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-completed { background: #d1fae5; color: #065f46; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-abnormal { background: #fee2e2; color: #991b1b; }
.badge-critical { background: #991b1b; color: #ffffff; animation: pulse-red 1.5s infinite; }

/* Printable Lab Report Format (A4 Specific with Watermark) */
.report-paper {
    background: #ffffff;
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto;
    padding: 20mm;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

/* Official Lab Background Watermark */
.report-paper::before {
    content: "AL-SHIFA LAB";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-35deg);
    font-size: 80px;
    font-weight: 900;
    color: rgba(13, 148, 136, 0.04);
    pointer-events: none;
    white-space: nowrap;
    z-index: 0;
}

.lab-header {
    border-bottom: 3px double #0f766e;
    padding-bottom: 15px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
}

.patient-info-box {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 25px;
    position: relative;
    z-index: 1;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

.report-table th {
    background: #0f766e;
    color: #ffffff;
    padding: 8px 12px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
}

.report-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 13px;
}

.val-abnormal {
    color: #dc2626;
    font-weight: 700;
}

.val-critical {
    color: #991b1b;
    font-weight: 900;
    background-color: #fee2e2;
    padding: 2px 6px;
    border-radius: 4px;
}

.lab-footer {
    position: absolute;
    bottom: 25mm;
    left: 20mm;
    right: 20mm;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-top: 1px solid #e2e8f0;
    padding-top: 15px;
    z-index: 1;
}

/* Specimen Vial Barcode Sticker Format (50x25mm) */
.barcode-sticker {
    width: 50mm;
    height: 25mm;
    border: 1px dashed #94a3b8;
    padding: 4px;
    background: #fff;
    font-family: monospace;
    font-size: 10px;
    text-align: center;
    box-sizing: border-box;
    display: inline-block;
}

/* Print Stylesheet */
@media print {
    body {
        background: #ffffff !important;
    }
    .no-print, .sidebar, .navbar {
        display: none !important;
    }
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    .report-paper {
        box-shadow: none !important;
        margin: 0 !important;
        width: 100% !important;
        padding: 0 !important;
    }
}
