/* 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; }

/* Global Button Styling */
button, .action-link { 
    background-color: #6a1b9a; 
    color: white; 
    padding: 10px 15px; /* Default size */
    border: none; 
    border-radius: 4px; 
    cursor: pointer; 
    text-decoration: none; 
    display: inline-block;
    transition: background-color 0.3s;
    font-weight: bold;
    text-align: center; 
}
button:hover, .action-link:hover {
    background-color: #7c43bd; 
}

/* SMALLER BUTTONS FOR ADMIN PAGE */
.small-btn {
    padding: 6px 12px !important; /* Slightly larger small button for better click target */
    font-size: 0.85em;
    min-width: 65px; /* Ensures buttons are uniform in width */
}

/* Specific Button Colors for CRUD actions (AESTHETICS FIX) */
.delete-btn { 
    background-color: #d32f2f; /* Standard Red for Delete/Danger */
}
.delete-btn:hover {
    background-color: #ff5252;
}

.edit-btn { 
    background-color: #8bc34a; /* Accent Green for Update/Edit/Success */
    color: black;
}
.edit-btn:hover {
    background-color: #aed581;
}

/* Header Links for Navigation (VISIBILITY FIX) */
.header-link {
    color: #ffb74d; /* Warm Orange/Gold color for visibility */
    text-decoration: none;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s;
    border: 1px solid #ffb74d; 
}
.header-link:hover {
    background-color: #7c43bd; 
    color: #fff; 
    border-color: #fff;
}


/* 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; }
th, td { 
    border: 1px solid #555; /* Darker border */
    padding: 10px; 
    text-align: center; 
    font-size: 0.9em;
}
th { background-color: #6a1b9a; /* Deep Purple Header */ color: #fff; }
td { background-color: #4e4e4e; }

/* Input Fields */
input[type="text"], input[type="number"], input[type="date"], input[type="time"] { 
    width: 90%; 
    padding: 8px; 
    border: 1px solid #7c43bd; 
    background-color: #333; /* Dark input background */
    color: #fff;
    border-radius: 4px;
}
span { display: block; padding: 8px; }

/* 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; /* Ensures alignment */
    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; }

/* Admin-Specific Container Styles */
.container { 
    max-width: 1200px; 
    margin: 40px auto; 
    padding: 20px; 
    background-color: #424242; 
    border-radius: 8px; 
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); 
    color: #fff; 
}
.form-box, .list-box { 
    margin-bottom: 30px; 
    padding: 20px; 
    border: 1px solid #7c43bd; 
    border-radius: 5px; 
}
.form-box h3, .list-box h3 { 
    color: #8bc34a; 
    border-bottom: 1px solid #7c43bd; 
    padding-bottom: 10px; 
}
.success { color: #8bc34a; font-weight: bold; background: #2e4f2f; padding: 10px; border-radius: 4px; }
.error { color: #ff5252; font-weight: bold; background: #5a2e2f; padding: 10px; border-radius: 4px; }
.group-list, .member-table { 
    width: 100%; 
    border-collapse: collapse; 
    margin-top: 15px; 
}
.group-list th, .member-table th, .member-table td { 
    border: 1px solid #555; 
    padding: 8px; 
    text-align: left; 
    background-color: #4e4e4e; 
}
.group-list th, .member-table th { 
    background-color: #6a1b9a; 
    color: white; 
}
.member-table td { text-align: center; } /* Adjusted for better alignment in member list */


/* ... existing styles ... */

/* Admin-Specific Container Styles */
.container { 
    max-width: 1200px; 
    margin: 40px auto; 
    padding: 20px; 
    background-color: #424242; 
    border-radius: 8px; 
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); 
    color: #fff; 
}

/* OVERRIDE: Remove padding/border from form-box as the <details> element now handles the visual container */
.form-box { 
    margin-bottom: 30px; 
    padding: 0 !important; 
    border: none !important; 
    border-radius: 0 !important; 
    background-color: transparent !important;
}

/* New collapsible section styles */
.form-box details {
    border: 1px solid #7c43bd; 
    border-radius: 5px;
    background-color: #3a3a3a;
}
.form-box summary {
    cursor: pointer;
    padding: 15px;
    background-color: #5d3599; /* Medium Purple for the summary bar */
    border-radius: 5px;
    display: block;
    user-select: none; /* Prevents text selection on click */
}
.form-box summary:hover {
    background-color: #6a1b9a;
}
.form-box summary h3 {
    color: #fff; /* White title text */
    margin: 0;
    padding: 0;
    border-bottom: none; 
    display: inline-block;
}
.form-box details[open] summary {
    border-bottom: 1px solid #7c43bd; 
    border-radius: 5px 5px 0 0; /* Adjust border radius */
}
.details-content-wrapper {
    padding: 15px; /* Padding for the content inside the details block */
}

/* Existing Admin-specific styles (for context, ensure they remain) */
.group-list, .member-table { 
    width: 100%; 
    border-collapse: collapse; 
    margin-top: 15px; 
}
.group-list th, .member-table th, .member-table td { 
    border: 1px solid #555; 
    padding: 8px; 
    text-align: left; 
    background-color: #4e4e4e; 
}
.group-list th, .member-table th { 
    background-color: #6a1b9a; 
    color: white; 
}
.member-table td { text-align: center; } 

/* ... rest of the existing styles ... */