form-body {
    font-family: Arial, Helvetica, sans-serif;
    color: #333;
    line-height: 1.6;
    padding-top: 80px; 
    margin: 0; 
}

/* --- Layout Containers --- */

.form-main-container {
    display: flex;
    min-height: calc(100vh - 80px); /* Example assuming 60px header */
    margin-top: 70px;
    margin-bottom: auto;
    flex-grow: 1; /* Takes remaining width */
    box-sizing: border-box;
    overflow-y: auto; /* Allow scrolling if content exceeds height */    
    background-color: white;
}

.form-container {
    width: 100%;
    height:100%;
    max-width: 800px; /* Or adjust as needed */
    margin: 20px auto;
    background: #f2f6fc;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: visible; /* Allow potential overflows like dropdowns */
}

.form-container-flex {
    display: flex;
    flex-grow: 1;
    width: 100%;
    height:100%;
    background: #f2f6fc;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: visible; /* Allow potential overflows like dropdowns */
    background-color: #f4f6f8;
}

.form-title {
    margin: 0 0 30px 0; /* Adjusted margin-bottom */
    padding-top: 0;
    color: #003366;
    font-size: 24px;
    text-align: center;
}

/* --- Form Structure --- */

.form {
    display: flex;
    flex-direction: column; /* Stack sections vertically */
    gap: 16px; /* Space between main sections (like .form-flex and button row) */
    width: 100%;
    box-sizing: border-box;
}

.form-flex {
    display: flex-direction: column;
    flex-wrap: wrap;
    gap: 10px 2%; /* Row gap, Column gap (adjust percentage for spacing) */
    /* flex: 1; */ /* Not needed if form is column direction */
    justify-content: space-between;
}

#form-section-title {margin: 0 0 50px 0;}

/* --- Form Elements (Rows, Labels, Inputs) --- */

.form-label {
    width: 160px; /* Fixed width for labels */
    flex-shrink: 0; /* Prevent label from shrinking */
    font-weight: bold;
    margin-right: 10px;
    text-align: left; /* Ensure labels align left */
    color: #333;
    display: block; /* Ensure it behaves like a block for alignment */
    box-sizing: border-box;
    font-size: 1.1em;
}

.form-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 48%; /* Creates two columns, adjust with gap */
    min-width: 250px; /* Prevent excessive shrinking */
    margin-bottom: 10px; /* Space below each row */
    box-sizing: border-box;
}

.form-row.full-width {
    width: 80%;
}

input[type="text"] {
  text-transform: uppercase;
}

.form-input {
    flex-grow: 1; /* Allows input to take remaining space */
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    text-align: left;
    text-transform: uppercase;
    width: auto; /* Let flexbox handle width */
}

.form-input:read-only {
    background-color: #e9ecef; /* Bootstrap style for readonly */
    cursor: not-allowed;
}

 /* For 'Age' field */
.form-input.small {
    width: 80px;
    flex-grow: 0; 
}

/* --- Buttons --- */

.form-button {
    padding: 8px 14px;
    font-size: 14px;
    font-weight: bold;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    min-width: 80px;
    text-align: center;
    transition: background-color 0.2s ease, opacity 0.3s ease;
}

.form-button:disabled {
    background-color: #cccccc;
    color: #666666;
    cursor: not-allowed;
    opacity: 0.65;
}

.inline-select-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.button-row-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 20px; /* Space above button row */
    padding-top: 10px; /* Optional: Extra space or border-top */
    border-top: 1px solid #eee; /* Optional separator */
}

.button-row {
    display: flex;
    flex-wrap: wrap; /* Allow buttons to wrap on small screens */
    gap: 10px; /* Space between buttons */
}

.button-row-reverse {
    display: flex;
    align-items: flex-end
    flex-wrap: wrap; /* Allow buttons to wrap on small screens */
    gap: 10px; /* Space between buttons */
}

/* Numeric input */
.currency-input {
    width: 200px;
    padding: 6px;
    font-size: 16px;
    text-align: right;
}

/* Specific action button colors */
.clear-button { background-color: #6c757d; }
.clear-button:hover:not(:disabled) { background-color: #5a6268; }

.search-button { background-color: #007BFF; }
.search-button:hover:not(:disabled) { background-color: #0056b3; }

.insert-button { background-color: #17a2b8; }
.insert-button:hover:not(:disabled) { background-color: #117a8b; }

.update-button { background-color: #28a745; }
.update-button:hover:not(:disabled) { background-color: #218838; }

.delete-button { background-color: #dc3545; }
.delete-button:hover:not(:disabled) { background-color: #c82333; }

.exit-button {background-color: #6c757d; color: white; font-weight: bold; }
.exit-button:hover:not(:disabled) {background-color: #5a6268; }

/* --- Optional: Responsive Adjustments --- */
@media (max-width: 500px) {
   .form-body {
    margin-left: 0; 
   }

    .form-container {
        padding: 20px;
    }
    .form-group input[type="text"],
    .form-group input[type="number"] {
        font-size: 15px;
    }
    .submit-button {
        font-size: 15px;
    }
}

@media (max-width: 768px) {
    .form-row {
        width: 100%; /* Stack fields vertically on smaller screens */
    }

    .form-label {
        width: auto; /* Allow label width to be flexible */
        margin-bottom: 5px; /* Space between label and input when stacked */
    }

    .form-row {
        flex-direction: column; /* Stack label above input */
        align-items: flex-start; /* Align items to the start */
    }

    .form-input {
        width: 100%; /* Make input take full width */
    }

    .form-flex {
        gap: 0 0; /* Remove column gap when stacked */
    }

     .button-row {
        justify-content: center; /* Center buttons */
     }
}
