<div style="

    width:320px;
    height:200px;
    background:#ffffff;
    border:2px solid #0d6efd;
    border-radius:12px;
    overflow:hidden;
    position:relative;
    box-shadow:0 2px 10px rgba(0,0,0,0.15);

">

    <!-- Header -->

    <div style="

        background:#0d6efd;
        color:#ffffff;
        padding:10px;
        text-align:center;

    ">

        <div style="
            font-size:18px;
            font-weight:bold;
        ">

            <?= htmlspecialchars($school['school_name'] ?? 'School Name') ?>

        </div>

        <div style="
            font-size:12px;
            margin-top:2px;
        ">

            STUDENT ID CARD

        </div>

    </div>

    <!-- Body -->

    <div style="
        display:flex;
        padding:12px;
    ">

        <!-- Photo -->

        <div style="
            width:90px;
            text-align:center;
        ">

            <?php if(!empty($student['photo'])): ?>

                <img
                    src="../uploads/students/<?= htmlspecialchars($student['photo']) ?>"
                    style="
                        width:80px;
                        height:90px;
                        object-fit:cover;
                        border:2px solid #0d6efd;
                        border-radius:8px;
                    ">

            <?php else: ?>

                <div style="

                    width:80px;
                    height:90px;
                    background:#e9ecef;
                    border:2px solid #0d6efd;
                    border-radius:8px;
                    display:flex;
                    align-items:center;
                    justify-content:center;
                    font-size:12px;
                    color:#666;

                ">

                    No Photo

                </div>

            <?php endif; ?>

        </div>

        <!-- Details -->

        <div style="
            flex:1;
            padding-left:12px;
            font-size:13px;
            line-height:1.7;
        ">

            <div>

                <strong>Name:</strong>

                <?= htmlspecialchars($student['name']) ?>

            </div>

            <div>

                <strong>Class:</strong>

                <?= htmlspecialchars($student['class_name']) ?>

            </div>

            <div>

                <strong>Section:</strong>

                <?= htmlspecialchars($student['section']) ?>

            </div>

            <div>

                <strong>Roll No:</strong>

                <?= htmlspecialchars($student['roll_no']) ?>

            </div>

            <div>

                <strong>Admission No:</strong>

                <?= htmlspecialchars($student['admission_no']) ?>

            </div>

            <div>

                <strong>Phone:</strong>

                <?= htmlspecialchars($student['phone']) ?>

            </div>

        </div>

    </div>

    <!-- Footer -->

    <div style="

        position:absolute;
        bottom:0;
        width:100%;
        background:#f1f1f1;
        text-align:center;
        font-size:11px;
        padding:6px;
        border-top:1px solid #ddd;

    ">

        Session:
        <?= htmlspecialchars($student['session_name']) ?>

    </div>

</div>