* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: monospace;
}

body {
    line-height: 1.6;
    background-color: #f5f5f5;
    color: #333;
}

.container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.invoice-form {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.logo-section {
    flex: 1;
}

.logo-placeholder {
    width: 200px;
    height: 100px;
    border: 2px dashed #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    cursor: pointer;
    margin-bottom: 1rem;
}

.company-info textarea {
    border: none;
    width: 100%;
    resize: none;
    font-size: 0.9rem;
}

.invoice-header {
    text-align: right;
}

.invoice-header h1 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 1rem;
}

.invoice-details {
    min-width: 250px;
}

.detail-row {
    display: flex;
    justify-content: flex-end;
    align-items: right;
    margin-bottom: 0.5rem;
    gap: 2rem;
}

.detail-row .label {
    color: #666;
    font-size: 0.9rem;
    font-weight: 400;
    min-width: 100px;
    text-align: right;
    line-height: 1.6;
}

.detail-row input,
.detail-row select {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Courier New', Courier, monospace;
}

.detail-row select {
    background-color: white;
    cursor: pointer;
}

.address-section {
    display: flex;
    gap: 4rem;
    margin-bottom: 2rem;
}

.bill-to, .ship-to {
    flex: 1;
}

h3 {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

textarea {
    width: 100%;
    border: none;
    resize: none;
    font-size: 0.9rem;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.items-section {
    margin-bottom: 2rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    table-layout: fixed;
}

thead {
    background-color: #1a237e;
    color: white;
}

th, td {
    padding: 0.75rem;
    text-align: left;
}

th:last-child, td:last-child {
    width: 50px;
    text-align: center;
}

td input {
    width: 100%;
    border: none;
    padding: 0.25rem;
    font-size: 0.9rem;
}

.line-item-btn {
    color: #3498db;
    background: none;
    border: none;
    padding: 0;
    font-size: 0.9rem;
    cursor: pointer;
}

.bottom-section {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 2rem;
}

.totals-section {
    width: 300px;
    margin-right: 2rem;
}

.notes-section {
    margin-bottom: 2rem;
}

.notes {
    max-width: 600px;
}

.notes textarea {
    width: 100%;
    border: none;
    resize: none;
    font-size: 0.9rem;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.9rem;
}

.total-row.total {
    font-weight: bold;
    font-size: 1rem;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    margin: 0.5rem 0;
    padding: 0.5rem 0;
}

.total-row.balance {
    font-weight: bold;
    color: #2ecc71;
}

.amount-paid {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.amount-paid input {
    width: 100px;
    text-align: right;
    border: none;
    border-bottom: 1px solid #eee;
    padding: 0.25rem;
}

.discount button, .shipping button {
    color: #3498db;
    background: none;
    border: none;
    padding: 0;
    font-size: 0.9rem;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

.delete-row {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    padding: 0.25rem;
}

.actions {
    margin-top: 2rem;
    text-align: right;
}

#generatePDF {
    background-color: #2ecc71;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

#generatePDF:hover {
    background-color: #27ae60;
}

/* Add column widths */
#itemsTable th:nth-child(1),
#itemsTable td:nth-child(1) {
    width: 50%;  /* Item description column */
    text-align: left;
}

#itemsTable th:nth-child(2),
#itemsTable td:nth-child(2) {
    width: 15%;  /* Quantity column */
    text-align: right;
}

#itemsTable th:nth-child(3),
#itemsTable td:nth-child(3) {
    width: 15%;  /* Rate column */
    text-align: right;
}

#itemsTable th:nth-child(4),
#itemsTable td:nth-child(4) {
    width: 15%;  /* Amount column */
    text-align: right;
}

#itemsTable th:nth-child(5),
#itemsTable td:nth-child(5) {
    width: 5%;   /* Delete button column */
    text-align: center;
}

#itemsTable input {
    width: 100%;
    text-align: inherit;
}

#itemsTable .item-amount {
    padding-right: 1rem;
}

.twitter-link {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    text-decoration: none;
    color: #666;
    font-size: 14px;
    transition: all 0.2s ease;
}

.twitter-link:hover {
    background: rgba(0, 0, 0, 0.2);
    color: #333;
}

.total-row input[type="number"] {
    border: none;
    background: transparent;
    font-size: inherit;
    font-family: inherit;
    color: inherit;
    text-align: center;
    -moz-appearance: textfield;
}

.total-row input[type="number"]::-webkit-outer-spin-button,
.total-row input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
} 