.top-bar .brand img {
    width: 70px !important;
    height: 70px !important;
    max-width: 70px !important;
    max-height: 70px !important;
    object-fit: contain !important;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #eef2f7;
    color: #0f172a;
}

.order-page {
    max-width: 1180px;
    margin: auto;
    padding: 35px 22px;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.brand img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    background: white;
    border-radius: 16px;
    padding: 8px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.brand h1 {
    margin: 0;
    font-size: 32px;
}

.brand p {
    margin: 6px 0 0;
    color: #64748b;
}

.back-link {
    background: #005f2f;
    color: white;
    text-decoration: none;
    padding: 13px 18px;
    border-radius: 14px;
    font-weight: 800;
}

.order-card {
    background: white;
    border-radius: 26px;
    padding: 32px;
    margin-bottom: 28px;
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
}

.section-title {
    margin-top: 0;
    margin-bottom: 22px;
    font-size: 24px;
}

.order-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label,
.signature-section label {
    font-weight: 800;
    margin-bottom: 8px;
    color: #334155;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    font-size: 15px;
    background: #f8fafc;
}

.wide-field,
.signature-section,
.order-actions {
    grid-column: span 2;
}

#signatureCanvas {
    width: 100%;
    height: 150px;
    border: 2px dashed #94a3b8;
    border-radius: 18px;
    background: #f8fafc;
    touch-action: none;
}

.order-actions {
    display: flex;
    justify-content: flex-end;
    gap: 14px;
}

.clear-btn,
.save-btn,
.primary-btn {
    border: none;
    padding: 15px 24px;
    border-radius: 14px;
    font-weight: 900;
    cursor: pointer;
    font-size: 15px;
}

.clear-btn {
    background: #e2e8f0;
    color: #0f172a;
}

.save-btn,
.primary-btn {
    background: #005f2f;
    color: white;
}

.table-wrap {
    overflow-x: auto;
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
}

.orders-table th,
.orders-table td {
    padding: 16px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
}

.orders-table th {
    background: #f8fafc;
    color: #334155;
}

.invoice-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(6px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 22px;
    overflow-y: auto;
}

.invoice-modal-content {
    background: #ffffff;
    width: 100%;
    max-width: 880px;
    max-height: 92vh;
    border-radius: 28px;
    overflow-y: auto;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.38);
}

.invoice-header {
    background: linear-gradient(135deg, #004225, #007a3d);
    color: white;
    padding: 30px 34px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.invoice-header h2 {
    margin: 0;
    font-size: 28px;
}

.invoice-header p {
    margin: 8px 0 0;
    font-weight: 600;
}

.close-invoice-btn {
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.16);
    color: white;
    font-size: 20px;
    font-weight: 900;
}

.invoice-body {
    padding: 34px;
}

.invoice-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    margin-bottom: 28px;
}

.invoice-grid div {
    background: #f8fafc;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid #e2e8f0;
}

.invoice-grid strong {
    display: block;
    color: #64748b;
    font-size: 13px;
    text-transform: uppercase;
}

.invoice-grid p {
    margin: 8px 0 0;
    font-weight: 800;
}

.invoice-total-box {
    background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
    border: 1px solid #bbf7d0;
    padding: 26px;
    border-radius: 24px;
    margin-bottom: 26px;
    text-align: right;
}

.invoice-total-box h3 {
    margin: 0;
    color: #166534;
}

.invoice-total-box h1 {
    margin: 10px 0 0;
    color: #005f2f;
    font-size: 42px;
}

.invoice-notes {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 24px;
}

.invoice-signature {
    padding: 20px;
    border: 1px dashed #94a3b8;
    border-radius: 20px;
    background: #f8fafc;
}

.invoice-signature img {
    width: 100%;
    max-width: 320px;
    min-height: 90px;
    object-fit: contain;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    margin-top: 12px;
    background: white;
}

.invoice-actions {
    padding: 24px 34px;
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.store-summary-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 28px;
}

.summary-box {
    background: linear-gradient(135deg, #004225, #007a3d);
    color: white;
    padding: 22px;
    border-radius: 24px;
    box-shadow: 0 14px 34px rgba(0, 66, 37, 0.16);
}

.summary-box strong {
    display: block;
    opacity: 0.88;
    margin-bottom: 10px;
}

.summary-box h3 {
    margin: 0;
    font-size: 28px;
}

@media (max-width: 900px) {

    .store-summary-strip {
        grid-template-columns: repeat(2, 1fr);
    }

}

@media (max-width: 768px) {

    .top-bar,
    .order-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .order-grid,
    .invoice-grid {
        grid-template-columns: 1fr;
    }

    .wide-field,
    .signature-section,
    .order-actions {
        grid-column: span 1;
    }

    .brand h1 {
        font-size: 26px;
    }

    .store-summary-strip {
        grid-template-columns: 1fr;
    }

}

/* =========================================
   BUILD MY RETAIL STORE SIDEBAR CTA
========================================= */

.store-sidebar-cta {
    margin: 28px 20px 0;
    padding: 20px;
    border-radius: 22px;
    background: linear-gradient(135deg, #ffffff, #e8fff2);
    color: #003b22;
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.22);
}

.store-sidebar-cta span {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: #007a3d;
    margin-bottom: 6px;
}

.store-sidebar-cta strong {
    display: block;
    font-size: 1.15rem;
    line-height: 1.25;
    margin-bottom: 8px;
}

.store-sidebar-cta p {
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 14px;
    color: #315644;
}

.store-sidebar-cta a {
    display: block;
    text-align: center;
    padding: 12px 14px;
    border-radius: 999px;
    background: #005f2f;
    color: #ffffff;
    font-weight: 800;
    text-decoration: none;
}

.store-sidebar-cta a:hover {
    background: #008f4a;
}

/* =========================================
   FORCE LOGO SIZE FIX
========================================= */

.top-bar .brand img {
    width: 70px !important;
    height: 70px !important;
    max-width: 70px !important;
    max-height: 70px !important;
    object-fit: contain !important;
    display: block;
}

.invoice-company img {
    width: 90px !important;
    height: auto !important;
    max-width: 90px !important;
    object-fit: contain !important;
}

@media print {
    body * {
        visibility: hidden !important;
    }

    #invoiceModal,
    #invoiceModal * {
        visibility: visible !important;
    }

    #invoiceModal {
        position: absolute !important;
        inset: 0 !important;
        display: block !important;
        background: white !important;
        overflow: visible !important;
        padding: 0 !important;
    }

    .invoice-modal-content {
        max-width: 100% !important;
        max-height: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        overflow: visible !important;
    }

    .invoice-preview-header,
    .invoice-actions,
    .close-invoice-btn {
        display: none !important;
    }
}