/* ============================================================
   VERTICAL (PORTRAIT) STUDENT ID CARD (CR80: 54mm x 85.6mm)
   Strictly complies with <= 350 lines limit per GEMINI.md
   ============================================================ */

.student-id-card.layout-vertical {
    width: var(--id-card-width, 54mm);
    height: var(--id-card-height, 85.6mm);
    min-width: var(--id-card-width, 54mm);
    min-height: var(--id-card-height, 85.6mm);
    max-width: var(--id-card-width, 54mm);
    max-height: var(--id-card-height, 85.6mm);
    border-radius: 2.5mm;
}

/* ── Front Side (Vertical) ─────────────────────────────────── */
.id-vert-header {
    background: #1e293b;
    color: #ffffff;
    padding: 1.6mm 2.2mm 1.4mm 2.2mm;
    border-bottom: 0.6mm solid var(--tenant-primary, #2563eb);
    display: flex;
    align-items: center;
    gap: 1.8mm;
    flex-shrink: 0;
}

.id-vert-logo-wrap {
    width: 8.5mm;
    height: 8.5mm;
    background: #ffffff;
    border-radius: 1.4mm;
    padding: 0.4mm;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.id-vert-logo-wrap img { max-width: 100%; max-height: 100%; object-fit: contain; }

.id-vert-titles { flex: 1; min-width: 0; overflow: hidden; }
.school-title-vert {
    font-family: 'Outfit', sans-serif;
    font-size: 6.8pt;
    font-weight: 800;
    line-height: 1.15;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.school-subtitle-vert {
    font-size: 4.4pt;
    color: #cbd5e1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 0.2mm;
}

.id-vert-badge {
    font-size: 4.2pt;
    font-weight: 700;
    background: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
    border: 0.3mm solid rgba(56, 189, 248, 0.4);
    padding: 0.3mm 1.2mm;
    border-radius: 0.8mm;
    text-transform: uppercase;
    flex-shrink: 0;
}

.id-vert-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1.8mm 2.4mm 1.4mm 2.4mm;
    background: #ffffff;
    justify-content: space-between;
    align-items: center;
    min-height: 0;
}

.id-vert-photo-wrap {
    display: flex;
    justify-content: center;
    width: 100%;
}

.id-vert-photo-box {
    width: 21mm;
    height: 25.5mm;
    background: #f1f5f9;
    border: 0.5mm solid var(--tenant-primary, #2563eb);
    border-radius: 2mm;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    flex-shrink: 0;
}
.id-vert-photo-box img { width: 100%; height: 100%; object-fit: cover; }

.id-vert-name-plate {
    width: 100%;
    text-align: center;
    margin-top: 0.5mm;
    margin-bottom: 0.5mm;
}

.id-vert-student-name {
    font-family: 'Outfit', sans-serif;
    font-size: 7.4pt;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.id-vert-class-badge {
    display: inline-block;
    background: rgba(37, 99, 235, 0.08);
    color: var(--tenant-primary, #2563eb);
    font-size: 5pt;
    font-weight: 700;
    padding: 0.2mm 1.4mm;
    border-radius: 0.8mm;
    margin-top: 0.3mm;
}

.id-vert-details-table {
    width: 100%;
    font-size: 5.2pt;
    line-height: 1.35;
    color: #1e293b;
    display: flex;
    flex-direction: column;
    gap: 0.4mm;
    background: #f8fafc;
    padding: 1mm 1.4mm;
    border-radius: 1.2mm;
    border: 0.25mm solid #e2e8f0;
}

.id-vert-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}
.id-vert-row strong { color: #475569; font-weight: 600; }
.truncate-line {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-width: 100%;
}

.id-vert-footer {
    background: #f8fafc;
    border-top: 0.3mm solid #e2e8f0;
    padding: 1mm 2.2mm;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 4.6pt;
    color: #64748b;
    flex-shrink: 0;
    width: 100%;
}

.id-vert-session { font-weight: 500; }

/* ── Back Side (Vertical) ──────────────────────────────────── */
.id-vert-back-header {
    background: #0f172a;
    color: #ffffff;
    padding: 1.4mm 2mm;
    font-size: 5.4pt;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    flex-shrink: 0;
}

.id-vert-back-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1.8mm 2.4mm;
    gap: 1.2mm;
    background: #ffffff;
    justify-content: space-between;
    min-height: 0;
}

.id-vert-back-section {
    border-bottom: 0.25mm solid #f1f5f9;
    padding-bottom: 0.8mm;
}

.id-vert-label {
    font-size: 4.8pt;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.2mm;
}

.id-vert-subtext {
    font-size: 4.6pt;
    color: #334155;
    line-height: 1.25;
}

.id-vert-rules {
    font-size: 4.2pt;
    color: #64748b;
    background: #f8fafc;
    border: 0.25mm dashed #cbd5e1;
    padding: 0.8mm 1.2mm;
    border-radius: 0.8mm;
    line-height: 1.2;
}

.id-vert-back-footer {
    background: #f8fafc;
    border-top: 0.3mm solid #e2e8f0;
    padding: 1mm 2mm;
    font-size: 4.2pt;
    color: #64748b;
    text-align: center;
    flex-shrink: 0;
    line-height: 1.2;
}

/* ── A4 Bulk Layout Sheet (Vertical 3x3 Grid - 9 cards/page) ─ */
.a4-page.a4-vertical-grid {
    padding: 12mm 15mm;
    grid-template-columns: repeat(3, 54mm);
    grid-template-rows: repeat(3, 85.6mm);
    gap: 4.5mm 9mm;
}
