/* Reset & Base */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f9f9f9;
    margin: 0;
    padding: 0;
    color: #333;
}

h1, h2, h3 {
    color: #2c3e50;
    margin-top: 20px;
    text-align: center;
}

a {
    color: #007bff;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* Form Layout */
form {
    background-color: #fff;
    margin: 20px auto;
    padding: 30px;
    border-radius: 8px;
    max-width: 1000px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}

.form-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

label {
    font-weight: bold;
    margin-bottom: 5px;
}

input[type="text"],
input[type="email"],
input[type="date"],
input[type="number"],
select,
textarea {
    padding: 10px;
    font-size: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 100%;
}

textarea {
    resize: vertical;
    min-height: 60px;
}

/* Buttons */
button, .btn {
    display: inline-block;   /* ✅ Ensures button doesn’t stretch to full width */
    width: auto;             /* ✅ Keeps button to content size */
    max-width: 100%;         /* ✅ Still responsive inside small containers */
}

button:hover, .btn:hover {
    background-color: #218838;
}

button.secondary {
    background-color: #6c757d;
}

button.secondary:hover {
    background-color: #5a6268;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    margin: 20px 0;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #343a40;
    color: white;
    font-weight: bold;
}

tr:nth-child(even) {
    background-color: #f2f2f2;
}

tr:hover {
    background-color: #e9ecef;
}

/* Sectioning */
.section {
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: #fff;
}

/* Totals Box */
.totals {
    text-align: right;
    margin-top: 20px;
}

.totals div {
    margin: 5px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .form-container {
        grid-template-columns: 1fr;
    }

    .button-group {
        flex-direction: column;
        gap: 10px;
    }

    table, thead, tbody, th, td, tr {
        display: block;
    }

    thead {
        display: none;
    }

    td {
        position: relative;
        padding-left: 50%;
    }

    td:before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        top: 12px;
        font-weight: bold;
    }
}

/* Modal for "Quote To" Selection */
.modal {
    display: none;
    position: fixed;
    z-index: 999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 20px;
    width: 90%;
    max-width: 700px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

.close-modal {
    float: right;
    font-size: 24px;
    cursor: pointer;
}
/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    display: none; /* Initially hidden */
    align-items: center;
    justify-content: center;
    z-index: 1000;
body.modal-open .modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-box {
    background: white;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    padding: 20px;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close-btn {
    background: transparent;
    border: none;
    font-size: 24px;
    color: #888;
    cursor: pointer;
}

.modal-close-btn:hover {
    color: #000;
}

.modal-body {
    max-height: 65vh;
    overflow-y: auto;
}
{
    overflow: hidden;
}
}

/* Modal Content Box */
.modal-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    position: relative;
}

.quote-section {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: #fff;
}

.quote-box {
    width: 48%;
    text-align: right;
    margin-top: 20px;
}

.success-message {
    background-color: #d4edda;
    border: 1px solid #28a745;
    color: #00cc00;
    padding: 10px;
    margin: 10px 0;
}

.error-message {
    background-color: #f8d7da;
    border: 1px solid #dc3545;
    color: #ff0000;
    padding: 10px;
    margin: 10px 0;
}

