/* Color Palette: Dark Purple (#4a148c), Light Purple (#7c43bd), Accent Green (#8bc34a) */
body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    margin: 0; 
    background-color: #333; /* Dark background */
    color: #fff; 
}
header { 
    text-align: center; 
    padding: 20px 0; 
    background-color: #4a148c; /* Dark Purple Header */
    color: #fff; 
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}
h1, h2, h3 { color: #fff; margin-top: 0; }
h3 { border-bottom: 2px solid #7c43bd; padding-bottom: 5px; margin-bottom: 15px; }

/* Tabs */
.tabs { background-color: #383838; padding: 10px 0; display: flex; justify-content: center; }
.tab-button { 
    padding: 12px 25px; 
    cursor: pointer; 
    border: none; 
    background-color: #5d3599; /* Medium Purple for inactive */
    color: #fff; 
    font-weight: bold;
    margin: 0 5px;
    border-radius: 5px;
    transition: background-color 0.3s;
}
.tab-button:hover { background-color: #7c43bd; }
.tab-button.active { 
    background-color: #7c43bd; /* Light Purple for active */
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

/* Content & Boxes */
.tab-content { 
    display: none; 
    padding: 30px; 
    margin: 20px;
    background-color: #424242; /* Darker content background */
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}
.tab-content.active { display: block; }
.header-details label { margin-right: 30px; margin-bottom: 15px; display: inline-block; font-weight: 600; }

/* Table Styling */
table { width: 100%; border-collapse: collapse; margin-top: 20px; table-layout: fixed; } /* table-layout: fixed helps browser follow width rules */
th, td { 
    border: 1px solid #555; /* Darker border */
    padding: 5px 2px; /* Reduced padding for maximum space */
    text-align: center; 
    font-size: 0.9em;
    vertical-align: middle;
}
th { background-color: #6a1b9a; /* Deep Purple Header */ color: #fff; }
td { background-color: #4e4e4e; }


/* Input Fields (CRITICAL SIZING ADJUSTMENTS) */
input[type="text"], input[type="number"], input[type="date"], input[type="time"] { 
    width: 90%; 
    padding: 5px; 
    border: 1px solid #7c43bd; 
    background-color: #333; 
    color: #fff;
    border-radius: 4px;
    box-sizing: border-box; 
    height: 30px; /* Standardizing height to prevent stretching */
}

/* Specific width for inputs in the main ledger table */
#memberTable input[type="number"] {
    width: 98%; 
    min-width: 50px;
    padding: 4px 2px; 
    font-size: 0.85em;
    text-align: right; /* Ensure numbers hug the right edge */
    height: 30px;
}

/* Specific width for Name/Details column */
#memberTable input[type="text"] {
    width: 98%; 
    min-width: 100px;
    text-align: left;
    font-size: 0.85em;
}

/* Styling for the Advance Paid column cell (number input + select) */
.advance-paid-cell {
    padding: 3px !important;
}
.advance-paid-cell input[type="number"] {
    width: 98%; 
    margin-bottom: 2px;
    height: 25px; /* Slightly shorter input */
    padding: 2px;
}
.advance-paid-cell select.advance-method {
    width: 98%;
    padding: 2px 2px;
    border: 1px solid #7c43bd;
    background-color: #333;
    color: #fff;
    border-radius: 4px;
    font-size: 0.8em;
    height: 25px;
}


/* C/F Balances (Auto-Calculated Spans) */
span { 
    display: block; 
    padding: 4px 2px; 
    font-weight: bold;
    min-width: 60px;
    text-align: right; /* Ensure C/F values hug the right edge */
    background-color: #333; /* Match input background for better visual consistency */
    border-radius: 4px;
    height: 30px;
    line-height: 20px; /* Center text vertically */
}


/* Summary Boxes */
.section-box { 
    border: 2px solid #7c43bd; 
    padding: 20px; 
    margin-top: 25px; 
    border-radius: 8px; 
    background-color: #3a3a3a; 
}
.section-box label { display: block; margin-bottom: 15px; font-weight: 500; }
h4 { color: #8bc34a; /* Accent Green for section titles */ border-bottom: 1px dashed #7c43bd; padding-bottom: 5px; }

/* Highlight Totals */
.auto-total { 
    font-weight: bold; 
    color: #ffb74d; /* Warm Orange for visibility */ 
    font-size: 1.2em; 
    display: inline-block;
    min-width: 80px; 
    text-align: right;
    padding-left: 10px;
}
.final-reconciliation { 
    background-color: #5d3599; /* Strong Purple for final total */ 
    border: 3px solid #8bc34a; 
    color: #fff;
}
.final-reconciliation .auto-total { color: #8bc34a; font-size: 1.5em; }