.inv-wrap { max-width: 100%; margin: 0 auto; }

.inv-banner {
    background: #1e2a4a;
    color: #fff;
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
}

.inv-card {
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 20px;
}

.inv-card h2 {
    font-size: 16px;
    margin-bottom: 14px;
    color: #1e2a4a;
    border-bottom: 2px solid #10b981;
    padding-bottom: 8px;
}

.inv-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.inv-col { flex: 1; min-width: 220px; }
.inv-col label { display: block; font-size: 13px; margin-bottom: 4px; color: #4b5563; }
.inv-col input, .inv-col textarea, .inv-col select {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}
.inv-col input:focus, .inv-col textarea:focus { outline: none; border-color: #10b981; }
.inv-col input[readonly] { background: #f3f4f6; color: #6b7280; cursor: default; }

table.inv-items { width: 100%; border-collapse: collapse; margin-top: 10px; }
table.inv-items th {
    background: #f3f4f6;
    text-align: left;
    font-size: 12px;
    padding: 8px;
    color: #4b5563;
}
table.inv-items td { padding: 6px 4px; }
table.inv-items input { padding: 7px 8px; font-size: 13px; }

.inv-remove-row {
    background: none; border: none; color: #dc2626; cursor: pointer; font-size: 16px;
}

.inv-add-row {
    margin-top: 10px;
    background: #fff;
    border: 1px dashed #10b981;
    color: #10b981;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.inv-totals { margin-top: 16px; display: flex; justify-content: flex-end; }
.inv-totals-box { width: 260px; }
.inv-totals-box div { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.inv-totals-box .inv-grand { font-weight: 700; font-size: 16px; border-top: 2px solid #10b981; padding-top: 10px; color: #1e2a4a; }


/* =============================================
   PREVIEW MODAL — template tabs + footer
   ============================================= */
.inv-preview-tabs {
    display: flex;
    gap: 6px;
    padding: 10px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
    overflow-x: auto;
    white-space: nowrap;
}
.inv-preview-tab {
    flex-shrink: 0;
    padding: 7px 16px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.inv-preview-tab:hover { border-color: #10b981; color: #10b981; }
.inv-preview-tab.active {
    background: #10b981;
    border-color: #10b981;
    color: #fff;
}


/* =============================================
   HINT TEXT — template selector + preview modal
   ============================================= */
.inv-hint {
    display: block;
    font-size: 11.5px;
    color: #6b7280;
    margin-top: 4px;
    line-height: 1.4;
}

.inv-preview-hint {
    padding: 8px 20px 0;
    font-size: 12.5px;
    color: #6b7280;
    background: #f8fafc;
    flex-shrink: 0;
}

/* =============================================
   CURRENCY DROPDOWN TRIGGER — looks like a select, not a plain textbox
   ============================================= */
.inv-currency-trigger {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
}
.inv-currency-trigger input#currencySymbol {
    width: 100%;
    padding-right: 28px;
    background: #f3f4f6;
    color: #1f2937;
    font-weight: 600;
    cursor: pointer;
    pointer-events: none; /* clicks pass through to wrapper */
}
.inv-currency-arrow {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: #6b7280;
    pointer-events: none;
}
.inv-currency-trigger:hover input#currencySymbol {
    border-color: #10b981;
    background: #f0fdf9;
}
.inv-currency-trigger:hover .inv-currency-arrow { color: #10b981; }

/* =============================================
   INLINE NETWORK/ERROR MESSAGE (replaces alert())
   ============================================= */

/* =============================================
   LOGO UPLOAD PREVIEW
   ============================================= */
.inv-logo-preview-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    padding: 10px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}
.inv-logo-preview-wrap img {
    max-height: 48px;
    max-width: 120px;
    object-fit: contain;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 4px;
}
.inv-logo-remove {
    background: none;
    border: 1px solid #dc2626;
    color: #dc2626;
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
}
.inv-logo-remove:hover { background: #fef2f2; }

/* =============================================
   LOGO CROP MODAL
   ============================================= */
.inv-crop-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 100000;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.inv-crop-overlay.open { display: flex; }

.inv-crop-modal {
    background: #fff;
    width: 100%;
    max-width: 520px;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

.inv-crop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: #1e2a4a;
    color: #fff;
    flex-shrink: 0;
}
.inv-crop-header h3 { font-size: 15px; margin: 0; font-weight: 700; }

.inv-crop-body {
    padding: 16px;
    background: #f3f4f6;
}
.inv-crop-body img {
    display: block;
    max-width: 100%;
    max-height: 60vh;
}

.inv-crop-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .inv-crop-overlay { padding: 0; }
    .inv-crop-modal { max-width: 100%; height: 100vh; border-radius: 0; }
    .inv-crop-body { flex: 1; }
}