 /* Modern, clean styling */
.ba-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.ba-title, .ba-section-title {
    color: #333;
    margin-bottom: 15px;
}
.ba-form {
    display: flex;
    flex-direction: column;
}
.ba-section {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 4px;
}
.ba-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}
.ba-field {
    display: flex;
    flex-direction: column;
}
.ba-field label {
    font-weight: bold;
    margin-bottom: 5px;
    color: #555;
}
.ba-field input, .ba-field select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}
.ba-items .item-row {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr auto;
    gap: 10px;
    align-items: end;
    margin-bottom: 15px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 4px;
    border-bottom: 1px solid #eee;
}
.ba-items .item-row:last-child {
    border-bottom: none;
}
.ba-items input {
    min-width: 100px;
}
.ba-items .remove-item {
    background: #ff4d4d;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
}
.ba-table-wrapper {
    overflow-x: auto;
}
.ba-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}
.ba-table th, .ba-table td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: center;
}
.ba-table th {
    background: #f0f0f0;
}
.ba-summary p {
    font-weight: bold;
    margin: 5px 0;
}
.ba-button {
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
}
.ba-button-primary {
    background: #007bff;
    color: white;
}
.ba-button-primary:hover {
    background: #0056b3;
}
.ba-button-submit {
    background: #28a745;
    color: white;
    margin-top: 20px;
}
.ba-button-submit:hover {
    background: #218838;
}
.ba-button-danger {
    background: #dc3545;
    color: white;
}
.ba-button-danger:hover {
    background: #c82333;
}
.ba-loading {
    display: none;
    text-align: center;
    color: #007bff;
}
.ba-message {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
}
.ba-error {
    color: #dc3545;
    background: #f8d7da;
}
.ba-success {
    color: #28a745;
    background: #d4edda;
}
/* Improved Mobile Responsiveness */
@media (max-width: 768px) {
    .ba-grid {
        grid-template-columns: 1fr; /* Stack all fields vertically */
    }
    .ba-items .item-row {
        grid-template-columns: 1fr; /* Stack item inputs vertically */
        gap: 5px; /* Tighter spacing */
    }
    .ba-field input, .ba-field select {
        font-size: 14px; /* Smaller text for better fit */
        padding: 8px; /* Slimmer inputs */
    }
    .ba-button {
        width: 100%; /* Full-width buttons */
        font-size: 14px;
        padding: 10px;
        margin-bottom: 10px; /* Space between buttons */
    }
    .ba-items input {
        min-width: auto; /* Allow full width */
        width: 100%;
    }
    .ba-section {
        padding: 10px; /* Reduce padding */
    }
    .ba-desktop-submit {
        display: none !important;
    }
    .ba-mobile-submit {
        display: block !important;
        margin-top: 20px !important;
        margin-bottom: 20px !important;
    }
    .ba-table th, .ba-table td {
        font-size: 12px;
        padding: 6px;
    }
}
/* Desktop - hide mobile buttons */
@media (min-width: 769px) {
    .ba-mobile-submit {
        display: none !important;
    }
}
.ba-valid {
    color: green;
}
.ba-invalid {
    color: red;
}
#valid {
    font-weight: bold;
}
/* Ensure mobile submit buttons are visible and positioned under sections */
.ba-mobile-submit {
    margin-top: 20px !important; /* Space below sections */
}
/* Button container for side-by-side */
.ba-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}
.ba-buttons .ba-button {
    flex: 1; /* Equal width */
}
@media (max-width: 768px) {
    .ba-buttons {
        flex-direction: row; /* Keep side by side */
        flex-wrap: wrap; /* Wrap if too narrow */
    }
}