/* =========================================================
   A4 INDUSTRIAL PRINT SHEET — 8 CARDS (FRONT+BACK MERGED)
   Bleed: 3mm | Safe zone: 2mm | CMYK-ready
========================================================= */
@page {
    size: A4;
    margin: 0;
}

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

body {
    margin: 0;
    background: #f8fafc;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

.sheet {
    width: 210mm;
    height: 297mm;
    padding: 6mm;
    background: white;
    margin: 0 auto;
}

.grid-8 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: auto;
    gap: 8mm;
}

/* =========================================================
   CARD — ISO 7810 (CR80)
   Finished: 85.6 × 53.98 mm
   With bleed: +3mm each side
========================================================= */
.card {
    width: 340px;
    height: 215px;
    min-width: 340px;
    padding: 3mm;
    position: relative;
    overflow: hidden;
    border-radius: 4mm;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Holographic Security Strip */
.holo-strip {
    position: absolute;
    top: 0;
    left: 0;
    height: 6mm;
    width: 100%;
    background: linear-gradient(
        120deg,
        rgba(255,255,255,0.1) 0%,
        rgba(0,255,200,0.3) 25%,
        rgba(150,100,255,0.4) 50%,
        rgba(255,200,100,0.3) 75%,
        rgba(255,255,255,0.15) 100%
    );
    mix-blend-mode: overlay;
    background-size: 300% 100%;
    animation: holoMove 8s linear infinite;
    pointer-events: none;
}

@keyframes holoMove {
    0% { background-position: 0% 0%; }
    100% { background-position: 300% 0%; }
}

/* FRONT + BACK shared surface */
.front-inner,
.back-inner {
    background: linear-gradient(135deg, #050912 0%, #0a0f1e 50%, #0d1425 100%);
    color: #f1f5f9;
    height: 100%;
    padding: 4mm;
    border-radius: 3mm;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

/* Header Section */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2mm;
    z-index: 2;
}

.logo {
    display: flex;
    align-items: center;
    gap: 2mm;
}

.logo img {
    height: 6mm;
    width: auto;
}

.logo span {
    font-weight: 900;
    letter-spacing: 0.15em;
    font-size: 3mm;
    color: #f1f5f9;
}

.qr-container img {
    width: 11mm;
    height: 11mm;
    padding: 0.8mm;
    border-radius: 1.6mm;
    background: white;
    display: block;
}

/* Body Section - FIXED */
.card-body {
    display: flex;
    flex-direction: column;
    margin-top: 0;
    gap: 1.5mm;
    flex-grow: 1;
}

.card-images {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2mm;
    width: 100%;
}

.photo {
    width: 15mm;
    height: 15mm;
    border-radius: 2mm;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.1);
}

.qr {
    width: 17mm;
    height: 17mm;
    padding: 1mm;
    border-radius: 2mm;
    background: white;
    display: block;
}

/* Metadata Section - FIXED */
.card-info {
    z-index: 2;
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.card-info > .name,
.card-info > .role {
    margin-bottom: 0;
}



.temp-badge {
    background: #ef4444;
    color: white;
    padding: 1mm 3mm;
    border-radius: 999px;
    font-size: 2.4mm;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: absolute;
    bottom: 4mm;
    right: 4mm;
    z-index: 3;
}

.name {
    font-size: 4mm;
    font-weight: 800;
    color: #f1f5f9;
    margin-bottom: 0.6mm;
    line-height: 1.2;
}

.role {
    font-size: 2.5mm;
    color: #94a3b8;
    margin-bottom: 0.6mm;
}

.serial {
    font-size: 2.2mm;
    color: #cbd5e1;
    font-family: 'Courier New', monospace;
}

/* Back Side Styling */
.security-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4mm;
}

.security-title {
    font-weight: 900;
    letter-spacing: 0.12em;
    font-size: 3mm;
    color: #f1f5f9;
}

.encrypted-badge {
    background: linear-gradient(90deg, #10b981, #06b6d4);
    padding: 1mm 3mm;
    border-radius: 999px;
    font-size: 2.3mm;
    font-weight: 700;
    color: #022c22;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.details {
    margin-top: 5mm;
    font-size: 2.6mm;
    line-height: 4mm;
    color: #cbd5e1;
}

.details div {
    display: flex;
    gap: 2mm;
}

.details strong {
    color: #f1f5f9;
    font-weight: 600;
    min-width: 15mm;
}

.footer-info {
    position: absolute;
    bottom: 4mm;
    right: 4mm;
    font-size: 2.3mm;
    color: #94a3b8;
    line-height: 3.5mm;
    text-align: right;
}

/* Print Optimizations */
@media print {
    body {
        background: white;
    }
    
    .sheet {
        page-break-after: always;
        box-shadow: none;
        width: 210mm;
        height: 297mm;
    }
    
    .card {
        box-shadow: none;
    }
}