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

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

body {
    font-family: 'Calibri', 'Segoe UI', Arial, sans-serif;
    background: #fff;
    color: #2c3e50;
    margin: 0;
    padding: 0;
}

/* Main Container */
.container_marksheet_template1 {
  width: 100%;
  height: auto;
  page-break-after: always;
  border: 1px solid #ddd;
  margin: 0 auto;
  background: #fff;
  position: relative;
}

.content_container_template1 {
  padding: 10px 2%;
}

/* Header Styling */
.header_template1 {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #eaeaea;
}

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

.header_institution {
  margin-left: 10px;
  text-align: center;
}

.heading_template1 {
  font-size: 20pt;
  text-transform: uppercase;
  font-weight: bold;
  color: #0b722d;
  letter-spacing: 1px;
  margin-bottom: 2px;
}

.heading_code_info_template1 {
  font-size: 10pt;
  font-weight: bold;
  color: #666;
}

.heading_address_template1, .contact_template1 {
  font-size: 9pt;
  font-weight: bold;
  color: #666;
}

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

.heading_report_template1 {
  font-size: 16pt;
  font-weight: bold;
  color: #0b722d;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.year_template1 {
  font-size: 12pt;
  color: #666;
  font-weight: bold;
}

/* Session Info */
.aligncenter {
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    color: #0b722d;
    margin: 5px 0 15px;
}

/* Student Info */
.student_info_table_template1 {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    margin-bottom: 15px;
    font-size: 14px;
    border: 1px solid #0b722d;
}

.student_info_table_template1 td {
    padding: 8px 10px;
}

.student_info_table_template1 tr:nth-child(odd) {
    background: #f0fff0; /* Light shade of green */
}

/* Marks Table */
.table1_template1 tbody .subject-row td:first-child {
    text-transform: uppercase;
}

.table1_container_template1 {
    margin-top: 15px;
}

.table1_template1 {
    width: 100%;
    border-collapse: collapse;
    font-size: 10pt;
    overflow: hidden;
    page-break-inside: avoid;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.table1_template1 th {
    background: #0b722d;
    color: #fff;
    padding: 8px;
    border: 1px solid #dfe6e9;
    text-transform: uppercase;
    font-weight: 600;
}

.table1_template1 td {
    padding: 8px;
    border: 1px solid #dfe6e9;
    text-align: center;
}

.table1_template1 tbody .subject-row:nth-child(odd) {
    background-color: #f0fff0; 
}

/* Notes Section */
.margintop20 { margin-top: 15px; }
.margintop35 { margin-top: 25px; }
.margintop50 { margin-top: 35px; }

.flex-row-info {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.flex-row-info p {
    margin: 0;
    font-size: 12pt;
    flex: 1;
}

.congratulate_message {
    font-size: 12pt;
    font-weight: 600;
    margin: 15px 0;
    padding: 10px 15px;
    /*background: #f0fff0;*/
    /*color: #055a47;*/
    /*border-radius: 5px;*/
}

.new_session {
    font-size: 12pt;
    color: #000;
}

/* Signatures */
.flexbox-row-spacearound-start {
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    margin-top: 30px;
    gap: 20px;
}

.signature_div {
    width: 28%;
    text-align: center;
    font-size: 10pt;
    color: #2d3436;
    border-top: 1px solid #0b722d;
    margin-top: 20px;
}

/* Footer Note */
.fontsize11 {
    font-size: 10pt;
    color: #e74c3c;
    margin-top: 20px;
    text-align: center;
    font-style: italic;
}

/* Utility Classes */
.flexbox-row-center-start {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 10px;
}

.transparent_table td, .transparent_table th {
    background: none !important;
    border: none !important;
    color: #000 !important;
}

.transparent_table tr:nth-child(odd) {
    background: none !important;
}

.fullstretch { width: 100%; }

/* Color combination for the main information block */
.margintop35.flex-row-info {
    background-color: #f0fff0;
    color: black;
    padding: 20px;
    border-radius: 8px;
    margin-top: 35px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 40px;
}

/* Style for input fields and select dropdowns */
.margintop35.flex-row-info input[type="text"],
.margintop35.flex-row-info select {
    background-color: white;
    border: 1px solid #0b722d;
    color: black;
    padding: 8px;
    border-radius: 4px;
    font-size: 14px;
    width: auto;
}

/* Specific styling for the date input to control its width */
input[type="date"] {
    background-color: white;
    border: 1px solid #0b722d;
    color: black;
    padding: 8px;
    border-radius: 4px;
    font-size: 14px;
    width: 200px;
}

.date-input {
    width: 150px;
}

/* Style for the 'Update' button */
.btn-primary {
    background-color: #0b722d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 20px;
    transition: background-color 0.3s ease;
}

.btn-primary:hover {
    background-color: #0a6627;
    color: white;
}

/* Print Styling */
@media print {
    .container_marksheet_template1 {
        width: auto !important;
        height: 100% !important;
        margin: 0 !important;
        padding: 8px !important;
        box-shadow: none !important;
        border: 1px solid #000 !important;
        background: #fff !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    body, html {
        font-size: 10px !important;
        width: 100% !important;
        height: 100% !important;
    }

    .header_template1 { margin-bottom: 8px !important; }
    .header_institution h2 { font-size: 16px !important; }
    .heading_report_template1 { font-size: 16px !important; margin: 4px 0 !important; }
    .aligncenter { font-size: 13px !important; margin: 4px 0 8px !important; }
    
    .header_template1 {
        margin: 8px 0 !important;
        padding: 4px 0 !important;
    }
    
    .logo_div_img_template1 {
        margin-right: 8px !important;
        width: 70px !important;
    }

    .header_institution h1 {
        font-size: 14px !important;
        margin-bottom: 1px !important;
        line-height: 1.2 !important;
    }
    
    .header_details {
        gap: 4px !important;
    }
    
    .header_details p {
        font-size: 10px !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .header_institution h2 {
        font-size: 16px !important;
        margin-bottom: 2px !important;
    }
    
    .heading_report_template1 {
        font-size: 16px !important;
        margin: 10px 0 !important;
        padding: 6px 0 !important;
    }
    
    .aligncenter {
        font-size: 13px !important;
        margin: 6px 0 12px !important;
        padding: 4px 0 !important;
    }
    
    .table1_template1 tbody .subject-row td:first-child {
        text-transform: uppercase !important;
    }
    
    /* Student Info - more padding for height */
    .student_info_table_template1 td {
        padding: 10px 12px !important;
        font-size: 11px !important;
        min-height: 22px !important;
    }

    /* Marks Table - more padding/margin */
    .table1_template1 {
        width: 100% !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        margin: 10px 0 !important;
        font-size: 11px !important;
    }

    .table1_template1 th, .table1_template1 td {
        padding: 8px 6px !important;
        border: 1px solid #000 !important;
        word-wrap: break-word !important;
        text-align: center;
        min-height: 25px !important;
    }
    
    .table1_template1 th {
        background: #0b722d !important;
        color: white !important;
    }

    /* Refined column widths */
    .table1_template1 th:nth-child(1), .table1_template1 td:nth-child(1) { width: 28% !important; }
    .table1_template1 th:nth-child(2), .table1_template1 td:nth-child(2) { width: 10% !important; }
    .table1_template1 th:nth-child(3), .table1_template1 td:nth-child(3) { width: 10% !important; }
    .table1_template1 th:nth-child(4), .table1_template1 td:nth-child(4) { width: 10% !important; }
    .table1_template1 th:nth-child(5), .table1_template1 td:nth-child(5) { width: 16% !important; }
    .table1_template1 th:nth-child(6), .table1_template1 td:nth-child(6) { width: 16% !important; }
    .table1_template1 th:nth-child(7), .table1_template1 td:nth-child(7) { width: 16% !important; }

    /* Form elements inside table */
    .table1_template1 input[type="text"], .table1_template1 input[type="number"] {
        width: 95% !important;
        font-size: 9px !important;
        padding: 2px !important;
        text-align: center;
    }
    
    .table1_template1 td:first-child input[type="text"] {
        width: 90% !important;
        text-align: left;
    }
    
    .table1_template1 input[type="checkbox"] {
        transform: scale(0.8);
        margin: 0 auto;
    }
    
    .additional-subject {
        display: inline-flex !important;
        align-items: center !important;
        gap: 3px !important;
        font-size: 10px !important;
    }
    
    .additional-subject input[type="checkbox"] {
        transform: scale(0.8);
    }
    
    .margintop20 { margin-top: 5px !important; }
    .margintop35, .margintop50 { margin-top: 10px !important; }
    .congratulate_message { font-size: 11px !important; margin: 8px 0 !important; padding: 8px 10px !important; }
    
    .flexbox-row-spacearound-start {
        justify-content: space-between !important;
        gap: 10px !important;
        margin-top: 15px !important;
    }
    
    .signature_div {
        width: 30% !important;
        font-size: 11px !important;
        padding-top: 6px !important;
    }

    .fontsize11 {
        font-size: 11px !important;
        margin-top: 10px !important;
    }
    
    .transparent_table td, .transparent_table th { padding: 4px !important; border: none !important; }
    
    .table1_container_template1, .student_info_table_template1 { page-break-inside: avoid !important; }
    
    .flex-row-info { flex-wrap: nowrap !important; justify-content: space-between !important; }
    .flex-row-info p { flex: 1 1 30% !important; margin: 0 4px !important; font-size: 12px !important; }
    
    hr { border: none; border-top: 1px solid #000; height: 1px; width: 100%; margin: 8px 0 !important; display: block !important; }
}