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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    padding: 15px;
    line-height: 1.5;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background-color: white;
    padding: 20px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 3px solid #007bff;
    font-size: 1.6em;
}

.form-section {
    margin-bottom: 18px;
    padding: 12px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

    .form-section h2 {
        color: #007bff;
        margin-bottom: 10px;
        font-size: 1.1em;
    }

.form-group {
    margin-bottom: 10px;
}

    .form-group label {
        display: block;
        margin-bottom: 4px;
        color: #555;
        font-weight: 600;
        font-size: 0.85em;
    }

    .form-group input[type="text"],
    .form-group input[type="email"],
    .form-group input[type="tel"],
    .form-group input[type="url"],
    .form-group input[type="number"],
    .form-group input[type="date"],
    .form-group textarea {
        width: 100%;
        padding: 6px 8px;
        border: 1px solid #ddd;
        border-radius: 3px;
        font-size: 13px;
    }

    .form-group input[type="file"] {
        padding: 3px;
        font-size: 12px;
    }

    .form-group textarea {
        resize: vertical;
        font-family: inherit;
    }

.compact-field {
    padding: 5px 7px !important;
    font-size: 12px !important;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-row-multi {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 8px;
}

/* Cabinet count field - smaller and right-aligned */
.cabinet-count input[type="number"] {
    max-width: 70px;
    text-align: right;
}

/* Accounting Format Table */
.accounting-table {
    margin-top: 12px;
    background-color: white;
    padding: 10px;
    border-radius: 3px;
}

.accounting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #eee;
}

    .accounting-row:last-child {
        border-bottom: none;
    }

    .accounting-row label {
        flex: 1;
        font-weight: 500;
        color: #555;
        font-size: 0.9em;
        margin: 0;
    }

    .accounting-row .input-wrapper {
        display: flex;
        align-items: center;
        min-width: 140px;
        justify-content: flex-end;
    }

    .accounting-row .currency {
        font-weight: 500;
        margin-right: 4px;
        color: #333;
        font-size: 0.9em;
    }

    .accounting-row input {
        width: 110px;
        padding: 5px 7px;
        border: 1px solid #ddd;
        border-radius: 3px;
        text-align: right;
        font-size: 13px;
        font-family: 'Courier New', monospace;
    }

.subtotal-row {
    border-top: 2px solid #333;
    margin-top: 4px;
    padding-top: 8px;
}

    .subtotal-row label,
    .total-row label {
        font-weight: 700;
        color: #333;
    }

.total-row {
    border-top: 3px double #333;
    margin-top: 4px;
    padding-top: 8px;
}

    .total-row input {
        font-weight: 700;
        font-size: 14px;
    }

.checkbox-row label {
    display: flex;
    align-items: center;
}

.checkbox-row input[type="checkbox"] {
    width: auto;
    margin-right: 6px;
    cursor: pointer;
}

.input-wrapper-inline {
    display: flex;
    align-items: center;
}

    .input-wrapper-inline .currency {
        font-weight: 500;
        margin-right: 3px;
        color: #333;
        font-size: 0.85em;
    }

    .input-wrapper-inline input {
        width: 85px;
        padding: 5px;
        border: 1px solid #ddd;
        border-radius: 3px;
        text-align: right;
        font-size: 12px;
    }

.form-row-multi .form-group label {
    font-size: 0.8em;
}

.form-row-multi .form-group input[type="number"] {
    padding: 5px;
    font-size: 12px;
}

.note {
    font-style: italic;
    color: #666;
    margin-top: 10px;
    font-size: 0.8em;
}

.note-inline {
    font-style: italic;
    color: #666;
    font-size: 0.75em;
    font-weight: 400;
    margin-left: 8px;
}

.actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.btn {
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
}

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

    .btn-primary:hover {
        background-color: #0056b3;
    }

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

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

.btn-success {
    background-color: #28a745;
    color: white;
}

    .btn-success:hover {
        background-color: #218838;
    }

.btn-disabled {
    background-color: #999;
    color: #fff;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 25px;
    border-radius: 6px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.close {
    color: #aaa;
    float: right;
    font-size: 26px;
    font-weight: bold;
    cursor: pointer;
}

    .close:hover {
        color: #000;
    }

.modal-content h2 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.3em;
}

.modal-content p {
    margin-bottom: 15px;
    color: #555;
}

.modal-content small {
    display: block;
    margin-top: 4px;
    color: #666;
    font-size: 0.85em;
}

.print-preview-info {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

    .print-preview-info p {
        margin-bottom: 10px;
        font-weight: 600;
    }

    .print-preview-info ul {
        margin-left: 20px;
        color: #555;
    }

    .print-preview-info li {
        margin-bottom: 5px;
    }

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

input[readonly] {
    background-color: #f8f9fa;
    cursor: not-allowed;
    color: #333;
}

@media print {
    body {
        background-color: white;
    }

    .actions {
        display: none;
    }
}

@media (max-width: 768px) {
    .form-row-multi {
        grid-template-columns: 1fr 1fr;
    }
}
