* {
    border: 0;
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header,
footer {
    background-color: #2C3E50;
    padding: .5rem;
    text-align: center;
    color: #E0E0E0;
}

main {
    flex: 1;
    display: flex;
}

h1 {
    font-size: 30px;
    font-weight: bolder;
}

h2 {
    font-size: 20px;
    font-weight: bold;
}

section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}


.login-form {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 300px;
}

input,
select,
textarea,
button {
    margin: 0.25rem 0;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

button {
    padding: 0.5rem;
    background-color: #2980B9;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 1rem;
}

button:hover {
    background-color: #0056b3;
}

input[type=submit] {
    padding: 0.5rem;
    background-color: #2980B9;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 1rem;
}

input[type=submit]:hover {
    background-color: #0056b3;
}

.wrapper {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.form-wrapper {
    position: relative;
    width: 100%;
}


.sidebar {
    background-color: #2C3E50;
    margin: 0;
    padding-top: 20px;
    width: 250px;
    height: 100vh;
    text-align: center;
    color: #E0E0E0;
    flex-shrink: 0;
}

.sidebar ul li.active {
    background-color: #34495e;
    /* A slightly lighter or different shade than your sidebar */
    border-left: 5px solid #3498db;
    /* Adds a nice blue vertical bar on the left */
}

.sidebar ul li.active a {
    color: #ffffff;
    font-weight: bold;
}

.sidebar-header {
    font-weight: bold;
    padding-bottom: 20px;
    border-bottom: 1px solid #34495e;
}

ul {
    list-style-type: none;
    padding: 0;
}

li a {
    display: block;
    color: #E0E0E0;
    padding: 15px;
    text-decoration: none;
}

li a:hover {
    background-color: #2980B9;
    color: #000;
}

.content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    height: 100vh;
}

.account {
    margin-top: 50px;
    border-top: 1px solid #34495e;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
    width: 100%;
    display: table;
    border: 1px solid #a5a5a5;
    table-layout: fixed;
    min-width: 800px;
    font-size: 12px;
    margin: 0;
}

table tr {
    border-bottom: 1px solid #a5a5a5
}

table td {
    padding: 8px 8px;
    display: table-cell;
    text-align: left;
    vertical-align: top;
    border-left: 1px solid #a5a5a5;
    border-right: 1px solid #a5a5a5;
}

table th {
    background-color: #2C3E50;
    color: #E0E0E0;
    padding: 8px 8px;
    display: table-cell;
    text-align: center;
    vertical-align: top;
    border-left: 1px solid #a5a5a5;
    border-right: 1px solid #a5a5a5;
    position: sticky;
    top: 0;
    z-index: 10;
}

#interfaceform {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    /* Fixed label width, flexible input width */
    align-items: center;
    gap: 10px;
    padding: 20px;
    background-color: #8f99a4;
    position: fixed;
    margin-bottom: 20px;
    width: calc(100% - 250px - 40px);
    box-sizing: border-box;
    bottom: 0;
}

#interfaceform label {
    font-weight: bold;
}

.form-group-s1 {
    grid-column-start: span 1;
}

.form-group-s2 {
    grid-column-start: span 2;
}

.form-group-s3 {
    grid-column-start: span 3;
}

.form-group-s4 {
    grid-column-start: span 4;
}

.form-group-s6 {
    grid-column-start: span 6;
}

.form-group-s8 {
    grid-column-start: span 8;
}

.form-group-s9 {
    grid-column-start: span 9;
}

.form-group-s10 {
    grid-column-start: span 10;
}

.form-group-s12 {
    grid-column-start: span 12;
}

.form-group-row-span2 {
    grid-row: span 2;
    display: flex;
    flex-direction: column;
}

.form-group-row-span2 textarea {
    flex-grow: 1;
    height: 100%;
    resize: none;
    /* Recommended so it doesn't break the grid layout */
}

.form-group-row-span4 {
    grid-row: span 4;
    display: flex;
    flex-direction: column;
}

.form-group-row-span5 {
    grid-row: span 5;
    display: flex;
    flex-direction: column;
}

.form-group-row-span6 {
    grid-row: span 6;
    display: flex;
    flex-direction: column;
}

.form-group-row-span4 textarea {
    flex-grow: 1;
    height: 100%;
    resize: none;
    /* Recommended so it doesn't break the grid layout */
}

#interfaceform input,
#interfaceform select {
    width: 100%;
}

#FormTitle {
    font-size: 24px;
    display: block;
    text-align: center;
}

.emptable th:nth-child(1) {
    width: 5%;
}

.emptable td:nth-child(1) {
    text-align: center;
}

.emptable th:nth-child(2) {
    width: 30%;
}

.emptable th:nth-child(3) {
    width: 30%;
}

.emptable th:nth-child(4) {
    width: 10%;
}

.emptable td:nth-child(4) {
    text-align: center;
}

.emptable th:nth-child(5) {
    width: 10%;
    text-align: center;
}

.emptable td:nth-child(5) {
    text-align: center;
    text-transform: uppercase;
    font-weight: bold;
}

.emptable th:nth-child(6) {
    width: 15%;
    text-align: center;
}

.emptable td:nth-child(6) {
    text-align: center;
}

#lookup {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    /* Fixed label width, flexible input width */
    align-items: center;
    gap: 10px;
    padding: 20px;
    border: 1px solid #8f99a4;
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
    min-width: 1100px;
    font-size: 12px;
}

#lookup input,
#lookup select,
#lookup button {
    width: 100%;
}

.custtable th:nth-child(1) {
    width: 20%;
}

.custtable th:nth-child(2) {
    width: 25%;
}

.custtable th:nth-child(3) {
    width: 10%;
}

.custtable th:nth-child(4) {
    width: 25%;
}

.custtable th:nth-child(5) {
    width: 10%;
    text-align: center;
}

.custtable td:nth-child(5) {
    text-align: center;
    text-transform: uppercase;
    font-weight: bold;
}

.custtable th:nth-child(6) {
    width: 10%;
    text-align: center;
}

.custtable td:nth-child(6) {
    text-align: center;
}

.catalogtable th:nth-child(1) {
    width: 20%;
}

.catalogtable th:nth-child(2) {
    width: 25%;
}

.catalogtable th:nth-child(3) {
    width: 10%;
}

.catalogtable th:nth-child(4) {
    width: 5%;
}

.catalogtable td:nth-child(4) {
    text-align: center;
}

.catalogtable th:nth-child(5) {
    width: 5%;
}

.catalogtable td:nth-child(5) {
    text-align: center;
}

.catalogtable th:nth-child(6) {
    width: 5%;
}

.catalogtable td:nth-child(6) {
    text-align: center;
}

.catalogtable th:nth-child(7) {
    width: 10%;
}

.catalogtable td:nth-child(7) {
    text-align: center;
}

#customerdetails {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 10px;
    padding: 10px;
    /*changed*/
    background-color: #8f99a4;
    position: fixed;
    margin-bottom: 20px;
    width: calc(100% - 250px - 40px);
    box-sizing: border-box;
    bottom: 0;
    font-size: 12px;
    /*added*/
    min-width: 1100px;
    /*added*/
}

/* Container for the checkbox */
.custom-checkbox {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    margin-bottom: 20px;
    cursor: pointer;
    font-size: 12px;
    user-select: none;
    width: 100%;
    gap: 8px;
}

/* Hide the browser's default checkbox */
.custom-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

/* Create the custom checkbox square */
.checkmark {
    position: relative;
    /* Stays in the flex flow */
    height: 22px;
    width: 22px;
    background-color: #eee;
    border-radius: 4px;
    transition: background-color 0.2s, transform 0.1s;
    display: block;
}

/* On mouse-over, add a grey background color */
.custom-checkbox:hover input~.checkmark {
    background-color: #ccc;
}

/* When the checkbox is checked, add the #2980B9 background */
.custom-checkbox input:checked~.checkmark {
    background-color: #2980B9;
}

/* Checkmark indicator logic */
.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.custom-checkbox input:checked~.checkmark:after {
    display: block;
}

/* Style the checkmark "L" shape */
.checkmark:after {
    left: 8px;
    top: 4px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

#customerdetails input,
#customerdetails select,
#customerdetails textarea,
#customerdetails button {
    width: 100%;
    box-sizing: border-box;
    padding: 5px;
}

#detailsheader {
    font-size: 14px;
    font-weight: bold;
}

#customerdetails table {
    min-width: 120px;
}

#customerdetails table td {
    padding: 8px 8px;
    display: table-cell;
    text-align: center;
    vertical-align: middle;
    border-left: 1px solid #a5a5a5;
    border-right: 1px solid #a5a5a5;
}

#customerdetails table th {
    background-color: #2C3E50;
    color: #E0E0E0;
    padding: 8px 8px;
    display: table-cell;
    text-align: center;
    font-weight: normal;
    vertical-align: middle;
    border-left: 1px solid #a5a5a5;
    border-right: 1px solid #a5a5a5;
}

.tablescroll {
    max-height: 400px;
    /* Adjust this value to fit your layout */
    overflow-y: auto;
    /* Adds vertical scrollbar only when needed */
    overflow-x: auto;
    /* Adds horizontal scrollbar for small screens */
    border: 1px solid #a5a5a5;
    /* Matches your existing table border */
    margin-bottom: 20px;
}

#catalogdetails {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    /* Fixed label width, flexible input width */
    gap: 10px;
    padding: 10px;
    background-color: #8f99a4;
    position: fixed;
    margin-bottom: 20px;
    width: calc(100% - 250px - 40px);
    box-sizing: border-box;
    bottom: 0;
    font-size: 12px;
    min-width: 1100px;
}

#catalogdetails input,
#catalogdetails select,
#catalogdetails textarea,
#catalogdetails button {
    width: 100%;
    box-sizing: border-box;
    padding: 5px;
}

#catalogdetails table {
    min-width: 120px;
}

#catalogdetails table td {
    padding: 8px 8px;
    display: table-cell;
    text-align: center;
    vertical-align: middle;
    border-left: 1px solid #a5a5a5;
    border-right: 1px solid #a5a5a5;
}

#catalogdetails table th {
    background-color: #2C3E50;
    color: #E0E0E0;
    padding: 8px 8px;
    display: table-cell;
    text-align: center;
    font-weight: normal;
    vertical-align: middle;
    border-left: 1px solid #a5a5a5;
    border-right: 1px solid #a5a5a5;
}

.invtable th:nth-child(1) {
    width: 10%;
}

.invtable td:nth-child(1) {
    text-align: center;
}

.invtable th:nth-child(2) {
    width: 55%;
}

.invtable th:nth-child(3) {
    width: 10%;
}

.invtable th:nth-child(4) {
    width: 5%;
}

.invtable td:nth-child(4) {
    text-align: center;
}

.invtable th:nth-child(5) {
    width: 5%;
}

.invtable td:nth-child(5) {
    text-align: center;
}

.invtable th:nth-child(6) {
    width: 5%;
}

.invtable td:nth-child(6) {
    text-align: center;
}

.invtable th:nth-child(7) {
    width: 10%;
}

.invtable td:nth-child(7) {
    text-align: center;
}

#catalogdetails input[readonly],
#catalogdetails select[disabled],
#catalogdetails input[disabled] {
    background-color: #f0f0f0 !important;
    /* Light grey background */
    color: #333 !important;
    /* Dark, legible text */
    border: 1px solid #ccc !important;
    /* Defined borders */
    cursor: not-allowed;
    /* Visual cue that it's locked */
    opacity: 1;
    /* Prevents browsers from "ghosting" the text */
    -webkit-text-fill-color: #333;
    /* Specifically for iOS/Safari legibility */
}

/* Optional: Make labels for locked fields look slightly different */
input[readonly]+label,
select[disabled]+label {
    color: #666;
}

.transaction {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    /* Fixed label width, flexible input width */
    gap: 10px;
    padding: 10px;
    box-sizing: border-box;
    font-size: 14px;
    min-width: 1100px;
}

.transaction-row {
    display: grid;
    gap: 30px;
    align-items: start;
}

.stats table {
    width: 100%;
    min-width: 100px;
}

.info-pane table {
    width: 100%;
    min-width: 100px;
}

.info-pane {
    background: #fff;
    border: 1px solid #afafaf;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.ref-item {
    margin-bottom: 10px;
}

.ref-item label {
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
}

.totals-panel {
    background: #eee;
    padding: 15px;
    border: 1px solid #ccc;
    margin-top: 10px;
}

.totals-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.totals-row input {
    text-align: right;
    width: 90px;
    padding: 3px;
    border: 1px solid #ccc;
    background: #fdfdfd;
}

.grand-total {
    font-weight: bold;
    color: #2980b9;
    border: 2px solid #2980b9 !important;
    font-size: 1.1rem;
}

.btn-blue {
    background: #2980b9;
    color: white;
    border: none;
    padding: 8px 15px;
    cursor: pointer;
    border-radius: 3px;
}

.btn-action {
    background: #27ae60;
    color: white;
    border: none;
    padding: 4px 10px;
    cursor: pointer;
    border-radius: 3px;
    font-size: 0.75rem;
}

.btn-pay {
    width: 100%;
    padding: 12px;
    background: #2980b9;
    color: white;
    border: none;
    font-weight: bold;
    font-size: 12px;
    cursor: pointer;
    margin-top: 10px;
}

.btn-cancel {
    width: 100%;
    padding: 12px;
    background: #b92929;
    color: white;
    border: none;
    font-weight: bold;
    font-size: 12px;
    cursor: pointer;
    margin-top: 10px;
}

.text-danger {
    color: #c0392b;
}



.trntable th:nth-child(1) {
    width: 10%;
}

.trntable td:nth-child(1) {
    text-align: center;
}

.trntable th:nth-child(2) {
    width: 40%;
}

.trntable th:nth-child(3) {
    width: 20%;
}

.trntable td:nth-child(3) {
    text-align: center;
}

.trntable th:nth-child(4) {
    width: 15%;
}

.trntable td:nth-child(4) {
    text-align: center;
}

.trntable th:nth-child(5) {
    width: 15%;
}

.trntable td:nth-child(5) {
    text-align: center;
}

.indent-block {
    padding-left: 20px;
    margin-top: 4px;
}

.custreftable {
    min-width: 100px;
    margin-top: 10px;
}

.custreftable td {
    text-align: center;
}

.text-overdue {
    color: #e74c3c;
    /* A professional 'Alizarin' Red */
    font-weight: bold;
}

.success-banner {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.1rem;
    animation: fadein 0.5s;
}

.notify-banner {
    background-color: #edebd4;
    color: #575615;
    border: 1px solid #e3e6c3;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.1rem;
    animation: fadein 0.5s;
}

.error-banner {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.1rem;
    animation: fadein 0.5s;
}

.admin-tabs {
    display: flex;
    border-bottom: 2px solid #ccc;
    margin-bottom: 20px;
}

.admin-tabs .tab {
    padding: 10px 20px;
    text-decoration: none;
    color: #333;
    border: 1px solid transparent;
    border-bottom: none;
    margin-right: 5px;
    border-radius: 5px 5px 0 0;
}

.admin-tabs .tab.active {
    background-color: #eee;
    border-color: #ccc;
    font-weight: bold;
    color: #2c3e50;
}
