* {
    box-sizing: border-box;
}

body {
    background: #121212;
    font-family: "Segoe UI", Roboto, sans-serif;
    color: #f5f5f5;
    margin: 0;
    padding: 40px;
}

/* Paper */
.paper {
    width: 210mm;
    min-height: 297mm;
    background: #1e1e1e;
    margin: auto;
    padding: 25mm;
    border-radius: 14px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.6);
}

/* Sections */
.header,
.body,
.footer {
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 10px;
    padding: 18px 22px;
    margin-bottom: 22px;
}

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

.logo {
    width: 85px;
    height: 85px;
    border-radius: 50%;
    overflow: hidden;
    background: #121212;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.title {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.details {
    text-align: right;
    font-size: 0.95rem;
    color: #aaa;
}

.divider {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, #444, #2a2a2a, #444);
    margin: 25px 0;
    border-radius: 1px;
}

h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

/* Battery Builder */
.battery-builder {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px 18px;
    margin-bottom: 15px;
}

.battery-builder label {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 4px;
    display: block;
}

.battery-builder select {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #555;
    background: #2a2a2a;
    font-size: 0.95rem;
    color: #f5f5f5;
    transition: border 0.2s, background 0.2s;
}

.battery-builder select:focus {
    outline: none;
    border-color: #ff9800;
    background: #333;
}

#bms-amp-wrapper {
    display: none;
}

/* Buttons */
button {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    margin: 8px 4px;
}

#add-to-quote,
#save-quote,
#place-order,
#confirm-order {
    background: #ff9800;
    color: #121212;
}

#add-to-quote:hover,
#save-quote:hover,
#place-order:hover,
#confirm-order:hover {
    background: #e68a00;
}

#cancel {
    background-color: #d32f2f;
    color: #fff;
}

#cancel:hover {
    background-color: #b71c1c;
}

/* Quote Table */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    margin-top: 10px;
}

th,
td {
    border: 1px solid #444;
    padding: 8px 10px;
    text-align: left;
}

th {
    background: #2a2a2a;
    font-weight: 700;
    color: #ff9800;
}

td[contenteditable="true"]:focus {
    outline: 2px solid #ff9800;
    background: #333;
}

.remove-item {
    background: none;
    border: none;
    color: #d32f2f;
    font-size: 1.1rem;
    cursor: pointer;
}

/* Totals */
.totals {
    margin-top: 20px;
    width: 100%;
    border-top: 2px solid #555;
    font-size: 1rem;
}

.totals table {
    width: 100%;
    margin-top: 8px;
}

.totals td {
    padding: 6px 10px;
}

.totals td:last-child {
    text-align: right;
    font-weight: 600;
}

.totals tr:last-child td {
    font-size: 1.1rem;
    color: #ff9800;
}

/* Order Builder */
#order-builder {
    display: none;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 10px;
    padding: 20px;
    margin-top: 25px;
}

.order-form-wrapper,
#save-quote-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px 18px;
    font-size: 0.95rem;
}

.order-form-wrapper label,
#save-quote-container label {
    font-weight: 600;
    margin-bottom: 4px;
    display: block;
}

.order-form-wrapper input,
.order-form-wrapper select,
#save-quote-container input,
#save-quote-container select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #555;
    border-radius: 6px;
    background: #1e1e1e;
    font-size: 0.95rem;
    color: #f5f5f5;
}

/* Payment Note */
.payment-note {
    background: #333;
    border: 1px solid #555;
    padding: 10px;
    border-radius: 6px;
    grid-column: span 2;
}

/* Editable fields */
[contenteditable="true"] {
    display: inline-block;
    min-width: 50px;
    padding: 4px 6px;
    border: 1px solid transparent;
    border-radius: 4px;
    background-color: #2a2a2a;
    transition: all 0.2s ease-in-out;
    cursor: text;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    color: #f5f5f5;
}

[contenteditable="true"]:hover {
    border-color: #555;
    background-color: #333;
}

[contenteditable="true"]:focus {
    outline: none;
    border-color: #ff9800;
    background-color: #333;
    box-shadow: 0 0 0 2px rgba(255, 152, 0, 0.25);
}

.qty,
.price,
.total {
    text-align: right;
    white-space: nowrap;
}

td[contenteditable="true"]::after {
    content: "✎";
    font-size: 10px;
    color: #bbb;
    margin-left: 4px;
    opacity: 0.5;
}

/* Print */
@media print {
    [contenteditable="true"]::after {
        display: none;
    }

    #add-to-quote,
    .remove-item,
    #save-quote,
    #place-order,
    #confirm-order,
    #cancel {
        display: none;
    }

    .paper {
        box-shadow: none;
        border-radius: 0;
        padding: 10mm;
    }
}



.terms {
    background-color: #181818;
    padding: 3rem 2rem;
    max-width: 900px;
    margin: 4rem auto;
    line-height: 1.6;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}
.terms h2 {
    color: #ff9800;
    text-align: center;
    margin-bottom: 1.5rem;
}
.terms h3 {
    color: #fff;
    margin-top: 1.5rem;
}
.terms p, .terms ul {
    color: #ccc;
}
.terms ul {
    padding-left: 1.2rem;
}


#payment-amount-display{
    color: white;
}