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

@page {
    size: A4;
    margin: 0.5cm;
}

body {
    font-family: 'Calibri', 'Segoe UI', Arial, sans-serif;
    background: #f7f9fc;
    color: #2c3e50;
    line-height: 1.5;
}

/* --- Main Container --- */
.container_marksheet_template {
    width: 100%;
    height: auto;
    border: 1px solid #003366;
    background: #fff;
    box-shadow: 0 6px 18px rgba(0,0,0,0.1);
    margin: 0 auto;
}

.content_container {
    padding: 10px 2%;
}

/* --- Header Section --- */
.header_template {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #003366;
}

.logo_div img {
    width: 70px;
    height: auto;
    margin-right: 20px;
}

.header_institution {
    text-align: center;
}

.heading_template {
    font-size: 20pt;
    font-weight: 700;
    color: #003366;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.heading_code_info, .heading_address, .contact_info {
    font-size: 10pt;
    color: #636e72;
}

.report_header {
    text-align: center;
    margin: 10px 0;
}

.heading_report {
    font-size: 14pt;
    font-weight: 700;
    color: #3498db;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.academic_session {
    font-size: 14px;
    color: #7f8c8d;
}

/* --- Student Info --- */
.student_info_container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 20px;
    margin-bottom: 15px;
    border: 1px solid #dfe6e9;
    padding: 10px;
    background: #f1f2f6;
    border-radius: 8px;
}

.student_info_item {
    font-size: 14px;
}

.student_info_item label {
    font-weight: 600;
    color: #2c3e50;
    margin-right: 5px;
}

.student_info_item .student_data {
    font-weight: 400;
}

/* --- Form and Table --- */
.form-container {
    margin: 15px 0;
}

.stream-selector {
    margin-bottom: 15px;
    text-align: center;
}

.form-control {
    padding: 8px 12px;
    border: 1px solid #dfe6e9;
    border-radius: 4px;
    font-size: 14px;
    color: #2c3e50;
    cursor: pointer;
}

.subjects-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    page-break-inside: avoid;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.subjects-table thead th {
    background: #3498db;
    color: #fff;
    padding: 8px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    border: 1px solid #dfe6e9;
}

.subjects-table tbody td {
    padding: 6px;
    border: 1px solid #dfe6e9;
    text-align: center;
}

.subjects-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.subjects-table .subject-name-input,
.subjects-table .theory-marks-obtained,
.subjects-table .practical-marks-obtained {
    width: 90%;
    padding: 4px;
    border: 1px solid #ccc;
    border-radius: 3px;
}

.subjects-table .subject-type-select {
    padding: 4px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 12px;
}

.submit-row {
    text-align: left;
    margin-top: 10px;
}

.btn-primary {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.btn-primary:hover {
    background-color: #2980b9;
}

/* --- Summary and Footer --- */
.divider {
    border: none;
    border-top: 1px solid #dfe6e9;
    margin: 15px 0;
}

.summary-container {
    background: #eef0f3;
    margin: 20px 0;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.summary-item {
    flex: 1;
    font-size: 14px;
}

.summary-item p {
    margin: 5px 0;
}

.summary-item strong {
    color: #2c3e50;
}

/* --- Promotion Message --- */
.promotion-container {
    background: #eef0f3;
    padding: 8px;
    border-radius: 6px;
    margin: 20px 0;
    text-align: left;
}

.promotion-table {
    width: 100%;
    border-collapse: collapse;
}

.promotion-table td {
    padding: 5px;
}

.promotion-label {
    font-weight: 700;
    color: #2c3e50;
    font-size: 10pt;
    padding-right: 15px; 
    white-space: nowrap;
}

.congratulate_message {
    font-size: 16px;
    font-weight: 600;
    padding: 10px 15px;
    border-left: 5px solid #27ae60;
    background: #e9f5ed;
    color: #27ae60;
    border-radius: 5px;
}

.new_session {
    font-size: 14px;
    font-weight: 600;
    padding: 0px 15px;
    color: #2c3e50;
}

.signature_container {
    display: flex;
    justify-content: space-around;
    margin-top: 40px;
}

.signature_div {
    text-align: center;
    width: 28%;
}

.signature-line {
    border-top: 1px solid #7f8c8d;
    margin-bottom: 5px;
}

.signature_div span {
    font-size: 12px;
    font-weight: 600;
    color: #2d3436;
}

.footer_note {
    font-size: 10pt;
    font-style: italic;
    color: #e74c3c;
    margin-top: 10px;
    text-align: center;
}

/* --- Utility Classes for Printing --- */
@media print {
    body {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .container_marksheet_template {
        page-break-after: always !important;
    }

}