* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #ffffff;  /* pure white, no gradient */
    color: #1a1a2e;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: #ffffff;
    padding: 20px;
}

/* Header */
.header-section {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    font-size: 32px;
    color: #1e3c72;
    margin-bottom: 8px;
}

.subtitle {
    color: #4a5568;
    font-size: 15px;
}

/* Form sections */
.form-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid #e2e8f0;
}

.form-section h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #1e3c72;
    border-left: 4px solid #1e3c72;
    padding-left: 12px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.invoice-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 25px;
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.logo-upload label, .invoice-number-area label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2d3748;
}

.invoice-number-input {
    display: flex;
    gap: 10px;
}
.invoice-number-input input { flex: 1; }

input, select, textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-size: 14px;
    background: #ffffff;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #1e3c72;
    box-shadow: 0 0 0 2px rgba(30,60,114,0.2);
}

/* Table */
.table-responsive { overflow-x: auto; margin: 15px 0; }
#itemsTable { width: 100%; border-collapse: collapse; }
#itemsTable th {
    background: #f1f5f9;
    padding: 12px;
    text-align: left;
    border-bottom: 2px solid #cbd5e0;
}
#itemsTable td { padding: 10px; border-bottom: 1px solid #e2e8f0; }
#itemsTable input { width: 100%; padding: 8px; }
.remove-row {
    background: #ef4444;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    cursor: pointer;
    border: none;
}
.remove-row:hover { background: #dc2626; }

/* Tax single */
.tax-single { max-width: 250px; }
.tax-single label { font-weight: 500; display: block; margin-bottom: 8px; }
.input-with-clear { display: flex; gap: 10px; align-items: center; }
.clear-btn {
    background: #64748b;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    border: none;
}
.clear-btn:hover { background: #475569; }

/* Totals */
.totals-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid #e2e8f0;
}
.total-breakdown {
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}
.total-line {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
}
.grand-total {
    font-size: 20px;
    font-weight: bold;
    color: #1e3c72;
    border-top: 2px solid #1e3c72;
    margin-top: 8px;
    padding-top: 12px;
    border-bottom: none;
}

/* Signature & Notes */
.signature-options {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}
.signature-text { flex: 2; }
.signature-upload { flex: 1; }

/* Buttons */
button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}
.btn-primary {
    background: #1e3c72;
    color: white;
}
.btn-primary:hover { background: #2a5298; }
.btn-secondary {
    background: #e2e8f0;
    color: #1e293b;
}
.btn-save { background: #10b981; color: white; }
.btn-danger { background: #ef4444; color: white; }
.btn-small { padding: 6px 12px; }
.actions { display: flex; gap: 15px; justify-content: center; margin-top: 25px; }

/* Saved invoices */
.saved-invoices-section {
    margin-top: 30px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}
.saved-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.saved-controls select { max-width: 300px; }

/* Responsive */
@media (max-width: 768px) {
    .grid-2, .invoice-header, .totals-section {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    .saved-controls select { max-width: 100%; }
    .signature-options { flex-direction: column; }
    .actions button { width: 100%; }
}

/* Print styles */
@media print {
    body, .container, .form-section, .invoice-header, .totals-section {
        background: white !important;
        padding: 0;
        margin: 0;
    }
    .actions, .saved-invoices-section, .logo-upload input, .remove-row, .clear-btn,
    #refreshInvoiceNumber, .btn-secondary, .btn-save, .btn-danger, #saveInvoiceBtn,
    #loadInvoiceBtn, #deleteInvoiceBtn {
        display: none !important;
    }
    .form-section {
        border: none;
        padding: 0;
    }
}