/* STANDARD DOCUMENT STYLES START */

.document-preview {
    padding: 40px;
}

.document-title-container {
    padding: 10px 14px;
    background-color: rgb(236, 236, 236);
    font-weight: bold;
    margin-bottom: 10px;
}

@media screen and (max-width: 768px) {
    .document-preview {
        padding: 12px;
    }
}

.terms-title {
    color: gray;
    padding-bottom: 20px;
}

.document-footer {
    white-space: pre-wrap;
    padding: 30px;
    font-size: 14px;
}

.document-table td span {
    display: block;
}

.bottom-total-received {
    text-align: right;
    margin-top: 10px;
    margin-bottom: 10px;
    font-weight: bold;
}

.bottom-balance-due {
    text-align: right;
    font-weight: bold;
}

.bottom-amount {
    display: inline-block;
    padding: 4px;
    border: 1px solid rgb(201, 201, 201);
}

/* STANDARD DOCUMENT STYLES END */

.document-header {
    padding: 10px 0;
    margin-bottom: 16px;
}

.document-header .document-info {
    display: flex;
    flex-direction: row;
}

.invoice-box-1 {
    flex: 0 0 38%;
    padding-right: 10px;
}

.invoice-box-2 {
    flex: 0 0 22%;
    padding-right: 10px;
}

.invoice-box-3 {
    flex: 0 0 40%;
    padding-right: 10px;
    display: flex;
    flex-direction: row;
}

.invoice-number-box {
    padding-right: 10px;
    flex: 1 1 auto;
}

.invoice-amount-box {
    flex: 1 1 auto;
}
    
.logo-container img {
    max-width: 200px;
}

.company-info-container {
    text-align: right;
    margin: 20px 0;
}

.customer-info-title {
    color: rgb(42, 41, 46);
    font-weight: 600;
}

.document-total-container {
    font-weight: bold;
    margin-bottom: 10px;
    text-align: right;
}

.document-total-inner-container {
    display: inline-block;
    padding: 10px 14px;
    background-color: rgb(236, 236, 236);
}

.document-settings {
    padding: 20px;
    background: rgb(245, 245, 245);
    border: 1px solid rgb(219, 219, 219);
}


.line-item-row {
    background-color: white;
    border-left: 3px solid transparent;
}

.line-item-row:hover {
    background-color: #f8f9fa;
    border-left: 3px solid #e9ecef;
}

.line-item-row.dragging {
    opacity: 0.9;
    background-color: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-left: 3px solid #007bff;
}

.drag-handle {
    cursor: grab;
    padding: 8px;
    color: #adb5bd;
    font-size: 1.2em;
    text-align: center;
    width: 40px;
    user-select: none;
}

.drag-handle:active {
    cursor: grabbing;
}

.line-item-row.drop-target-above {
    border-top: 2px solid #007bff;
}

.line-item-row.drop-target-below {
    border-bottom: 2px solid #007bff;
}

.delete-btn {
    color: #dc3545;
    border: none;
    background: none;
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 4px;
}

.delete-btn:hover {
    background-color: #fee;
    color: #dc3545;
}

.deleted-row {
    display: none;
}

.document-box {
    padding: 40px 40px 40px 40px;
}

.document-table {
    width: 100%;
    table-layout: fixed;
    margin-bottom: 20px;
}

.document-table th,
.document-table td {
    text-align: left;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
    padding: 8px;
    word-wrap: break-word;
    font-size: 0.9rem;
}

/* Set widths for both headers and cells */
.document-table th:first-child,
.document-table td:first-child {
    width: 70%;
}

.document-table th:nth-child(2),
.document-table td:nth-child(2),
.document-table th:nth-child(3),
.document-table td:nth-child(3) {
    width: 15%;
}

.document-table th:last-child,
.document-table td:last-child {
    width: 15%;
}

/* Additional header specific styles */
.document-table th {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
    color: #495057;
}

/* Rest of the styles remain the same */
.document-line-items input[type="text"],
.document-line-items input[type="number"] {
    width: 100%;
    padding: 6px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
}

.document-line-items input[type="text"]:focus,
.document-line-items input[type="number"]:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.description-container textarea {
    width: 100%;
    min-height: 60px;
    resize: vertical;
    white-space: pre-wrap;
}

#add-line-item {
    margin-top: 20px;
}

@media screen and (max-width: 768px) {
    .document-info {
        font-size: 13px;
    }
    .invoice-box-3 {
        flex-direction: column;
        align-items: flex-end;
        padding-right: 0;
    }
    .invoice-number-box {
        padding-right: 0;
    }
    .invoice-number-box p {
        text-align: right;
    }
    .document-box {
    }
    .logo-container img {
        max-width: 160px;
    }
    .company-info-container {
        margin: 0;
        font-size: 14px;
    }
    .document-preview {
        padding: 12px;
    }
    #add-line-item {
        display: block;
        width: 100%;
    }
    .document-table th:first-child,
    .document-table td:first-child {
        width: 48%;
    }

    .document-table th:nth-child(2),
    .document-table td:nth-child(2) {
        width: 18%;
    }
    .document-table th:nth-child(3),
    .document-table td:nth-child(3) {
        width: 17%;
    }

    .document-table th:last-child,
    .document-table td:last-child {
        width: 17%;
    }
}

@media screen and (max-width: 480px) {
    .document-table th,
    .document-table td {
        padding: 6px;
        font-size: 0.8rem;
    }
}