d/* General Body Styling */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f4f8; /* Light blue-grey background */
    color: #333;
    margin: 0;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    background-color: #ffffff; /* White container background */
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

h1, h2, h3 {
    color: #1a5f7a; /* Dark teal for headings */
    margin-bottom: 15px;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2.5em;
    color: #1572a1; /* Slightly brighter blue for main title */
}

hr {
    border: 0;
    height: 1px;
    background-image: linear-gradient(to right, rgba(21, 114, 161, 0), rgba(21, 114, 161, 0.75), rgba(21, 114, 161, 0));
    margin: 30px 0;
}

/* Tab Navigation Styling */
.tab-nav {
    border-bottom: 2px solid #1572a1; /* Primary color border */
    margin-bottom: 0;
    display: flex; /* Use flexbox for alignment */
}

.tab-btn {
    background-color: #e1f0f7; /* Lighter blue for inactive tabs */
    border: 1px solid #b0d9ec;
    border-bottom: none;
    padding: 12px 20px;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    margin-right: 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
    color: #1a5f7a;
    font-weight: 500;
    flex-grow: 1; /* Make buttons fill the space */
    text-align: center; /* Center text in buttons */
}

.tab-btn:hover {
    background-color: #cce4f0;
    color: #1572a1;
}

.tab-btn.active {
    background-color: #ffffff; /* White background for active tab */
    border: 2px solid #1572a1; /* Match bottom border */
    border-bottom: 2px solid #ffffff; /* White bottom border to blend */
    color: #1572a1; /* Primary color text */
    font-weight: bold;
    position: relative;
    top: 1px; /* Align with content */
}

/* Tab Content Styling */
.tab-content {
    display: none;
    padding: 25px;
    border: 2px solid #1572a1; /* Match tab nav border */
    border-top: none;
    border-radius: 0 0 8px 8px;
    background-color: #ffffff;
    margin-top: -2px; /* Overlap slightly */
}

.tab-content.active {
    display: block;
}

/* Form Styling */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1a5f7a;
}

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box; /* Include padding and border in element's total width and height */
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #1572a1; /* Highlight focus */
    outline: none;
    box-shadow: 0 0 5px rgba(21, 114, 161, 0.3);
}

/* Button Styling */
button, input[type="button"] {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: background-color 0.3s ease, transform 0.1s ease;
    margin: 5px; /* Add some spacing between buttons */
}

button.primary, input[type="button"].primary {
    background-color: #1572a1; /* Primary blue */
    color: white;
}

button.primary:hover, input[type="button"].primary:hover {
    background-color: #1a5f7a; /* Darker blue on hover */
}

button.delete-btn {
    background-color: #e74c3c; /* Red for delete */
    color: white;
}

button.delete-btn:hover {
    background-color: #c0392b; /* Darker red on hover */
}

button:not(.primary):not(.delete-btn) {
    background-color: #f0f4f8; /* Light grey for secondary buttons */
    color: #333;
    border: 1px solid #ccc;
}

button:not(.primary):not(.delete-btn):hover {
    background-color: #dce4ea;
}

button:active {
    transform: translateY(1px); /* Slight press effect */
}

.form-actions {
    margin-top: 25px;
    text-align: right; /* Align buttons to the right */
}

/* Table Styling */
.table-container {
    overflow-x: auto; /* Allow horizontal scrolling on small screens */
    margin-top: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0; /* Lighter border */
}

thead th {
    background-color: #1a5f7a; /* Dark teal header */
    color: white;
    font-weight: 600;
    cursor: pointer; /* Indicate sortable columns */
    position: relative; /* For sort indicators */
}

/* Add sort indicators */
thead th::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: 4px solid transparent;
    opacity: 0.5;
}
thead th.sort-asc::after {
    border-bottom-color: white;
    opacity: 1;
}
thead th.sort-desc::after {
    border-top-color: white;
    opacity: 1;
}


tbody tr:nth-child(even) {
    background-color: #f8fafd; /* Very light blue for even rows */
}

tbody tr:hover {
    background-color: #e1f0f7; /* Highlight row on hover */
}

td .edit-btn {
    color: #ff9800; /* Orange for edit */
    cursor: pointer;
    margin-right: 10px;
}
td .delete-btn-icon { /* Style for icon-like delete */
    color: #e74c3c; /* Red for delete */
    cursor: pointer;
}

.numeric-cell {
    text-align: right;
    font-family: 'Courier New', Courier, monospace;
}

/* Summary Styling */
.overall-summary {
    background-color: #e1f0f7;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    border: 1px solid #b0d9ec;
}

.overall-summary p {
    margin: 10px 0;
    font-size: 1.1em;
}

.overall-summary strong {
    color: #1572a1;
}

#totalAssets {
    font-weight: bold;
    font-size: 1.2em;
}

/* Calculator Styling */
.calculator-section {
    background-color: #f8fafd;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
}

.result-box {
    margin-top: 20px;
    padding: 15px;
    background-color: #e1f0f7;
    border: 1px solid #b0d9ec;
    border-radius: 6px;
    font-family: 'Courier New', Courier, monospace;
    white-space: pre-wrap; /* Preserve line breaks */
    word-wrap: break-word;
}

/* Search Container */
.search-container {
    margin-bottom: 20px;
}

.search-container input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.95em;
    transition: border-color 0.3s ease;
}

.search-container input[type="text"]:focus {
    border-color: #6b46c1;
    outline: none;
    box-shadow: 0 0 5px rgba(107, 70, 193, 0.2);
}

/* Table Actions (like Bulk Delete) */
.table-actions {
    margin-bottom: 10px;
    text-align: right;
}

/* Print Section - Keep hidden unless printing */
#printSection {
    display: none;
}

/* Modal Dialog Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.6); /* Black w/ opacity */
    padding-top: 60px; /* Location of the box */
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto; /* 5% from the top and centered */
    padding: 30px;
    border: 1px solid #888;
    width: 80%; /* Could be more or less, depending on screen size */
    max-width: 900px; /* Maximum width */
    border-radius: 10px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.modal-close-btn {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
}

.modal-close-btn:hover,
.modal-close-btn:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

#modalPersonName {
    margin-top: 0;
    color: #1572a1; /* Match theme */
    text-align: center;
    margin-bottom: 25px;
}

/* Style the table inside the modal */
#modalTransactionTableContainer table {
    margin-top: 15px;
}
#modalTransactionTableContainer th {
     background-color: #1a5f7a; /* Match theme */
     color: white;
}
#modalTransactionTableContainer td button {
    padding: 5px 10px; /* Smaller buttons for table actions */
    font-size: 0.9em;
    background-color: #ff9800; /* Orange for calculate button */
    color: white;
}
#modalTransactionTableContainer td button:hover {
    background-color: #e68a00; /* Darker orange */
}
.calculate-btn {
    color: #222 !important; /* Dark text for high contrast */
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    h1 {
        font-size: 2em;
    }
    .tab-nav {
        flex-direction: column; /* Stack tabs vertically */
    }
    .tab-btn {
        margin-right: 0;
        margin-bottom: 2px;
        border-radius: 8px 8px 0 0; /* Adjust radius if needed */
    }
    .tab-btn.active {
         border-radius: 8px 8px 0 0;
         border-bottom: 2px solid #1572a1; /* Ensure border shows when stacked */
    }
     .tab-content {
        border-top: 2px solid #1572a1; /* Add top border when tabs are stacked */
        border-radius: 0 0 8px 8px;
        margin-top: 0;
    }

    .form-actions {
        text-align: center;
    }
    .form-actions button {
        width: 100%;
        margin-bottom: 10px;
    }
    .search-container {
        flex-direction: column;
        align-items: stretch;
    }
    .search-container button {
        width: 100%;
    }
}


/* General Table Styling (if you want it for all tables with .data-table) */
.data-table {
    border-collapse: collapse; /* Merge cell borders */
    width: 100%;             /* Make table take full width */
    margin-top: 10px;        /* Add some space above */
    margin-bottom: 20px;     /* Add space below */
    border: 1px solid #ccc;  /* Add outer border */
    font-size: 0.9em;        /* Slightly smaller font for tables */
}

.data-table th,
.data-table td {
    border: 1px solid #ddd;  /* Add borders to all cells */
    padding: 8px 10px;       /* Add padding inside cells (vertical horizontal) */
    text-align: left;        /* Align text left by default */
    vertical-align: top;     /* Align content to the top */
}

.data-table th {
    background-color: #e9ecef; /* Lighter grey background for headers */
    font-weight: 600;          /* Slightly bolder font */
    color: #495057;          /* Darker text color for headers */
    white-space: nowrap;     /* Prevent headers from wrapping */
}

.data-table tbody tr:nth-child(even) {
    background-color: #f8f9fa; /* Subtle zebra striping for rows */
}

.data-table tbody tr:hover {
    background-color: #e9ecef; /* Highlight row on hover */
}

/* Specific styling for the calculator results table */
.calculator-results-table th {
     background-color: #007bff; /* Example: Blue header for calculator */
     color: white;
}

.calculator-results-table .numeric-cell {
    text-align: right; /* Keep numeric cells right-aligned */
    font-family: monospace; /* Optional: Use monospace font for numbers */
}

/* Styling for the summary below the calculator table */
.summary-total {
    margin-top: 15px;
    padding: 10px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 1.0em; /* Slightly larger font for summary */
    line-height: 1.6;
}

.summary-total strong {
    color: #495057;
}

/* Error message styling (if not already defined) */
.error-message {
    color: #dc3545; /* Bootstrap danger color */
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
}

/* Add responsive container for tables */
.result-box {
    overflow-x: auto;
    margin: 1rem 0;
    max-width: 100%;
}

/* Responsive table adjustments */
@media (max-width: 600px) {
    .calculator-results-table {
        font-size: 0.85em;
    }
    
    .calculator-results-table th,
    .calculator-results-table td {
        padding: 6px 8px;
        min-width: 80px; /* Prevent column collapse */
    }
    
    .calculator-results-table th {
        white-space: nowrap; /* Keep header text in one line */
    }
    
    .summary-total {
        font-size: 0.9em;
        padding: 8px;
    }
}

/* Mobile-first media query for very small screens */
@media (max-width: 400px) {
    .calculator-results-table {
        font-size: 0.78em;
    }
    
    .calculator-results-table th,
    .calculator-results-table td {
        padding: 4px 6px;
    }
}
/* ===== Updated Color Scheme ===== */
/* Tabs */
.tab-nav {
    border-bottom: 2px solid #6b46c1; /* Deep purple */
    background: linear-gradient(145deg, #ffffff, #f5f3ff);
}

.tab-btn {
    background: linear-gradient(145deg, #e9d8fd, #d6bcfa);
    border-color: #9f7aea;
    color: #553c9a; /* Deep purple text */
}

.tab-btn:hover {
    background: linear-gradient(145deg, #d6bcfa, #b794f4);
}

.tab-btn.active {
    background: linear-gradient(145deg, #ffffff, #faf5ff);
    border-color: #6b46c1;
    color: #44337a;
    box-shadow: 0 2px 15px rgba(107, 70, 193, 0.2);
}

/* Buttons */
button.primary {
    background: linear-gradient(145deg, #667eea, #764ba2); /* Purple gradient */
    color: white;
    border: 1px solid #553c9a;
}

button.primary:hover {
    background: linear-gradient(145deg, #764ba2, #667eea);
    box-shadow: 0 3px 12px rgba(102, 126, 234, 0.4);
}

button.delete-btn {
    background: linear-gradient(145deg, #fc8181, #f56565); /* Red gradient */
}

button.delete-btn:hover {
    background: linear-gradient(145deg, #f56565, #e53e3e);
}

button:not(.primary):not(.delete-btn) {
    background: linear-gradient(145deg, #e9d8fd, #d6bcfa);
    color: #553c9a;
}

/* Tables */
thead th {
    background: linear-gradient(145deg, #6b46c1, #805ad5); /* Purple header */
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

tbody tr:nth-child(even) {
    background-color: #faf5ff; /* Very light purple */
}

tbody tr:hover {
    background-color: #ebf4ff; /* Light blue for contrast */
}

/* Numeric Cells */
.numeric-cell {
    background-color: #fff5f7; /* Soft pink background */
    border-right: 2px solid #fed7e2;
}

/* Calculator Section */
.calculator-section {
    background: linear-gradient(145deg, #f5f3ff, #e9d8fd);
    border-color: #9f7aea;
}

/* Summary Section */
.overall-summary {
    background: linear-gradient(145deg, #ebf4ff, #e3e8ff);
    border-color: #a3bffa;
}

/* Modal */
.modal-content {
    background: linear-gradient(145deg, #ffffff, #f5f3ff);
    border: 2px solid #9f7aea;
}

/* Print Styles */
.calculator-summary h3 {
    margin-top: 15px;
}

/* Print specific styles */
@media print {
    body { 
        margin: 0.5in;
        font-family: sans-serif;
        line-height: 1.4;
    }
    h1, h2, h3 { 
        margin-bottom: 0.5em; 
    }
    .numeric { 
        text-align: right; 
    }
    .summary { 
        margin-top: 1.5em;
        padding-top: 1em;
        border-top: 1px solid #999; 
    }
    .summary p { 
        margin: 0.3em 0; 
    }
    button { 
        display: none; 
    }
}

/* Enhanced Button Colors */
button[onclick*="calculate"] {
    background: linear-gradient(145deg, #2ecc71, #27ae60);
    color: white;
}

button[onclick*="calculate"]:hover {
    background: linear-gradient(145deg, #27ae60, #219a52);
    box-shadow: 0 3px 12px rgba(46, 204, 113, 0.4);
}

button[onclick*="delete"] {
    background: linear-gradient(145deg, #e74c3c, #c0392b);
    color: white;
}

button[onclick*="delete"]:hover {
    background: linear-gradient(145deg, #c0392b, #a93226);
    box-shadow: 0 3px 12px rgba(231, 76, 60, 0.4);
}

button[onclick*="print"] {
    background: linear-gradient(145deg, #3498db, #2980b9);
    color: white;
}

button[onclick*="print"]:hover {
    background: linear-gradient(145deg, #2980b9, #2471a3);
    box-shadow: 0 3px 12px rgba(52, 152, 219, 0.4);
}