/* Form Details Styling */
.form-section {
    margin-bottom: var(--sp-6);
}

.form-section-title {
    font-size: 1em;
    font-weight: 700;
    color: var(--primary);
    padding-bottom: var(--sp-2);
    margin-bottom: var(--sp-4);
    border-bottom: 2px solid var(--accent);
    display: inline-block;
}

/* Header Sections for Vouchers */
.voucher-header {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--sp-4);
    background-color: var(--card-bg-alt);
    padding: var(--sp-4);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin-bottom: var(--sp-6);
}

.voucher-id {
    font-size: 1.5em;
    font-weight: 900;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}

/* Lot Highlight Badge */
.lot-badge {
    background-color: var(--accent);
    color: var(--primary);
    padding: var(--sp-2) var(--sp-4);
    border-radius: var(--radius-sm);
    font-weight: 900;
    font-size: 1.2em;
    display: inline-block;
    box-shadow: var(--shadow-sm);
}

/* Footer Totals Area */
.voucher-footer {
    margin-top: var(--sp-2);
    padding: var(--sp-4) var(--sp-6);
    background-color: var(--primary);
    color: #fff;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
}

.footer-amount-label {
    font-size: 1.1em;
    font-weight: 600;
}

.footer-amount-value {
    font-size: 2em;
    font-weight: 900;
    color: var(--accent);
}

/* Responsive Table Form Controls */
.table-form-control {
    border: 1px solid var(--border);
    padding: 0 var(--sp-2);
    width: 100%;
    height: 44px; /* Increased from 36px for better visibility */
    font-family: var(--font-urdu);
    border-radius: var(--radius-sm);
    font-size: 0.95em;
    background-color: #fff;
    transition: var(--transition);
}

.table-form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(212, 168, 67, 0.1);
}

.table-form-control-num {
    text-align: right !important;
    padding-right: var(--sp-2);
    font-size: 0.9em;
}

/* Fix for Select overlap in tables */
select.table-form-control {
    padding-right: 8px;
    padding-left: 8px;
    text-align: center;
}

/* +/- type toggle for Kharchay rows */
select.kharcha-type {
    font-weight: 900;
    font-size: 1.15em;
    text-align: center;
    border-width: 2px;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
select.kharcha-type[data-type="+"],
select.kharcha-type option[value="+"] { color: #1a7a4a; }
select.kharcha-type[data-type="-"],
select.kharcha-type option[value="-"] { color: #c0392b; }




.btn-delete-row {
    color: var(--danger);
    cursor: pointer;
    font-size: 1.2em;
    transition: var(--transition);
}

.btn-delete-row:hover {
    transform: scale(1.1);
}

/* Grid Layout for Forms */
.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-4);
}

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-4);
}

.form-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--sp-4);
}

@media (max-width: 992px) {
    .form-grid-3, .form-grid-4 {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .form-grid-2, .form-grid-3, .form-grid-4 {
        grid-template-columns: 1fr;
    }
    
    .voucher-footer {
        flex-direction: column;
        gap: var(--sp-4);
        text-align: center;
        padding: var(--sp-4);
    }
    
    .footer-amount-value {
        font-size: 1.8em;
    }

    .form-actions-buttons {
        width: 100%;
        flex-direction: column;
    }

    .form-actions-buttons .btn {
        width: 100%;
    }
}
