:root {
    --primary-color: #4CAF50;
    --secondary-color: #45a049;
    --text-color: #333;
    --background-color: #f4f4f4;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    margin: 0;
    padding: 0;
}

header {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 1rem;
}

main {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

form {
    background-color: white;
    padding: 2rem;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
}

input[type="number"],
input[type="text"] {
    width: 95%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.radio-group {
    display: flex;
    gap: 1rem;
}

fieldset {
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 1rem;
}

legend {
    font-weight: bold;
    padding: 0 0.5rem;
}

button {
    background-color: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 1rem;
}

button:hover {
    background-color: var(--primary-color);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 2rem;
    border-radius: 5px;
    max-width: 600px;
}

/* --- Improve modal layout for wide tables --- */
.modal-dialog {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;  /* ensures vertical centering */
    margin: 0 auto;
    max-width: 90vw;    /* keeps it responsive */
}

.modal-content {
    width: 80vw;
    max-width: 1000px; /* optional upper limit */
    margin: auto;
    border-radius: 10px;
}

/* Center modal header title */
.modal-header {
    text-align: center;
    justify-content: center; /* centers child flex items */
    border-bottom: 1px solid #eee;
}

.modal-title {
    margin: 0 auto;
    font-weight: bold;
}

.modal-body {
    overflow-x: auto; /* enable horizontal scrolling if content too wide */
}

.modal-body table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.modal-body th,
.modal-body td {
    padding: 10px 15px;
    vertical-align: top;
    text-align: left;
    border-bottom: 1px solid #eee;
}

/* Optional: nicer table appearance */
.modal-body tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* for better mobile readable*/
@media (max-width: 768px) {
    .modal-content {
        width: 95vw;
        padding: 1rem;
    }
}



