.nz-invoice-generator {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    max-width: 1200px;
    margin: 0 auto 2em;
    padding: 1em;
}

.nz-invoice-generator h2 {
    color: #006341;
    margin-top: 0;
    font-size: 1.5em;
    border-bottom: 2px solid #006341;
    padding-bottom: 0.5em;
}

.nz-invoice-generator p {
    margin-bottom: 1.5em;
    color: #666;
}

.generator-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2em;
    margin-bottom: 2em;
}

.input-section, .items-section, .preview-section {
    background: white;
    padding: 1.5em;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border: 1px solid #e1e1e1;
}

.preview-section {
    grid-column: span 2;
}

.input-section h3, .items-section h3, .preview-section h3 {
    color: #006341;
    margin-top: 0;
    margin-bottom: 1em;
    font-size: 1.2em;
    padding-bottom: 0.5em;
    border-bottom: 1px solid #e1e1e1;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1em;
    margin-bottom: 1.5em;
}

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

.form-group label {
    margin-bottom: 0.5em;
    font-weight: 600;
    color: #444;
    font-size: 0.9em;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.6em;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9em;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #006341;
    box-shadow: 0 0 0 2px rgba(0, 99, 65, 0.1);
}

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

/* GST Toggle Styles */
.gst-option {
    grid-column: span 2;
    padding-top: 0.5em;
    margin-top: 0.5em;
    border-top: 1px solid #eee;
}

.gst-toggle {
    display: flex;
    align-items: center;
    gap: 1em;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: #006341;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.gst-toggle-label {
    font-weight: 600;
    color: #006341;
    font-size: 0.9em;
}

/* Items Table */
.items-table-container {
    margin-bottom: 1.5em;
}

.items-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1em;
}

.items-table th {
    background: #f8f9fa;
    padding: 0.75em;
    text-align: left;
    font-weight: 600;
    color: #444;
    border-bottom: 2px solid #e1e1e1;
    font-size: 0.9em;
}

.items-table td {
    padding: 0.5em;
    border-bottom: 1px solid #eee;
}

.item-row input {
    width: 100%;
    padding: 0.5em;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 0.9em;
    box-sizing: border-box;
}

.item-amount {
    font-weight: 600;
    color: #006341;
    text-align: right;
    padding-right: 1em;
}

.remove-item {
    width: 30px;
    height: 30px;
    border: none;
    background: #ff6b6b;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2em;
    line-height: 1;
    transition: background-color 0.3s;
}

.remove-item:hover {
    background: #ff5252;
}

.remove-item:disabled {
    background: #ddd;
    cursor: not-allowed;
}

.add-item-btn {
    background: #006341;
    color: white;
    border: none;
    padding: 0.5em 1em;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.3s;
}

.add-item-btn:hover {
    background: #004d33;
}

/* Bank Details */
.bank-details {
    background: #f8f9fa;
    padding: 1em;
    border-radius: 6px;
    margin-bottom: 1.5em;
}

.bank-details h4 {
    margin-top: 0;
    margin-bottom: 1em;
    color: #444;
    font-size: 1em;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1em;
    flex-wrap: wrap;
}

.primary-btn, .secondary-btn, .clear-btn {
    padding: 0.75em 1.5em;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.3s;
}

.primary-btn {
    background: #006341;
    color: white;
}

.primary-btn:hover {
    background: #004d33;
}

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

.secondary-btn:hover {
    background: #545b62;
}

.clear-btn {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #ddd;
}

.clear-btn:hover {
    background: #e9ecef;
}

/* Invoice Preview */
.invoice-preview {
    background: white;
    border: 1px solid #e1e1e1;
    padding: 2em;
    border-radius: 4px;
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2em;
    padding-bottom: 1em;
    border-bottom: 2px solid #006341;
}

.invoice-title h2 {
    color: #006341;
    margin: 0 0 0.5em 0;
    font-size: 1.5em;
    border: none;
    padding: 0;
}

.invoice-number {
    font-weight: 600;
    color: #666;
}

.invoice-dates {
    text-align: right;
    color: #666;
}

.invoice-dates div {
    margin-bottom: 0.25em;
}

.invoice-parties {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3em;
    margin-bottom: 2em;
    padding-bottom: 1em;
    border-bottom: 1px solid #eee;
}

.from-party h4, .to-party h4 {
    margin-top: 0;
    margin-bottom: 0.75em;
    color: #006341;
    font-size: 1.1em;
}

.from-party div, .to-party div {
    margin-bottom: 0.25em;
    color: #666;
}

.invoice-items-preview {
    margin-bottom: 2em;
}

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

.preview-items-table th {
    background: #f8f9fa;
    padding: 0.75em;
    text-align: left;
    font-weight: 600;
    color: #444;
    border-bottom: 2px solid #e1e1e1;
}

.preview-items-table td {
    padding: 0.75em;
    border-bottom: 1px solid #eee;
    color: #666;
}

.preview-items-table td:last-child {
    text-align: right;
    font-weight: 600;
    color: #006341;
}

.no-items {
    text-align: center;
    color: #999;
    font-style: italic;
}

.invoice-totals {
    text-align: right;
    margin-bottom: 2em;
    padding: 1em;
    background: #f8f9fa;
    border-radius: 4px;
}

.totals-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5em;
    padding-bottom: 0.5em;
    border-bottom: 1px solid #eee;
}

.gst-row {
    display: flex;
}

.totals-row.total {
    font-size: 1.2em;
    font-weight: 700;
    color: #006341;
    border-bottom: 2px solid #006341;
    padding-bottom: 0.5em;
    margin-bottom: 0;
}

.invoice-footer {
    padding-top: 2em;
    border-top: 1px solid #eee;
}

.payment-terms {
    margin-bottom: 1em;
    color: #666;
}

.bank-details-preview {
    background: #f8f9fa;
    padding: 1em;
    border-radius: 4px;
    margin-bottom: 1em;
    font-size: 0.9em;
    color: #666;
}

.invoice-note {
    text-align: center;
    color: #999;
    font-style: italic;
    margin-top: 2em;
}

/* Tips Section */
.invoice-tips {
    background: #e8f4f0;
    padding: 1.5em;
    border-radius: 8px;
    border-left: 4px solid #006341;
}

.invoice-tips h4 {
    margin-top: 0;
    color: #006341;
    margin-bottom: 0.75em;
}

.invoice-tips ul {
    margin: 0;
    padding-left: 1.2em;
    color: #666;
}

.invoice-tips li {
    margin-bottom: 0.5em;
}

/* Responsive design */
@media (max-width: 992px) {
    .generator-container {
        grid-template-columns: 1fr;
    }
    
    .preview-section {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .nz-invoice-generator {
        padding: 0.8em;
    }
    
    .input-section, .items-section, .preview-section {
        padding: 1em;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .invoice-parties {
        grid-template-columns: 1fr;
        gap: 1.5em;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .items-table th, .items-table td {
        padding: 0.25em;
        font-size: 0.85em;
    }
    
    .gst-option {
        grid-column: span 1;
    }
}

@media print {
    .input-section, .items-section, .action-buttons, .invoice-tips {
        display: none;
    }
    
    .invoice-preview {
        border: none;
        padding: 0;
        box-shadow: none;
    }
}