/**
 * SMART-PGS — Accounting module compact form controls (32px uniform height)
 */

.account-module {
    --account-field-height: 32px;
    --payment-cell-height: 32px;
    --account-field-radius: 6px;
    --account-field-font: 0.8125rem;
    --account-field-border: #e2e8f0;
    --account-field-padding-x: 0.5rem;
}

/* ── Standard inputs (journal, contacts, reports, etc.) ── */
.account-module .form-control:not(textarea):not(.form-control-plaintext):not([type="file"]),
.account-module .form-select,
.account-module select.form-select {
    height: var(--account-field-height);
    min-height: var(--account-field-height);
    max-height: var(--account-field-height);
    padding: 0 var(--account-field-padding-x);
    font-size: var(--account-field-font);
    line-height: calc(var(--account-field-height) - 2px);
    border: 1px solid var(--account-field-border);
    border-radius: var(--account-field-radius);
    box-sizing: border-box;
}

.account-module .form-control:not(textarea)::placeholder {
    color: #94a3b8;
    opacity: 1;
    line-height: inherit;
}

.account-module .form-select,
.account-module select.form-select {
    padding-right: 1.75rem;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.45rem center;
    background-size: 12px 8px;
}

.account-module .form-control-sm:not(textarea),
.account-module .form-select-sm {
    height: var(--account-field-height);
    min-height: var(--account-field-height);
    padding: 0 var(--account-field-padding-x);
    font-size: var(--account-field-font);
    line-height: calc(var(--account-field-height) - 2px);
}

.account-module .form-label {
    font-size: 0.8125rem;
    margin-bottom: 0.25rem;
    color: #475569;
}

/* ── Floating-label fields (voucher details, filters, banking forms) ── */
.account-module .float-field > .form-control:not(textarea),
.account-module .float-field > .form-select,
.account-module .float-field > select,
.account-module .float-field-control > .form-control:not(textarea),
.account-module .float-field-control > .form-select,
.account-module .float-field-control > select {
    height: var(--account-field-height) !important;
    min-height: var(--account-field-height) !important;
    max-height: var(--account-field-height) !important;
    padding: 0 var(--account-field-padding-x) !important;
    font-size: var(--account-field-font) !important;
    line-height: calc(var(--account-field-height) - 2px) !important;
    border: 1px solid var(--account-field-border) !important;
    border-radius: var(--account-field-radius) !important;
    box-sizing: border-box !important;
}

.account-module .float-field > .form-control:not(textarea)::placeholder,
.account-module .float-field-control > .form-control:not(textarea)::placeholder {
    color: #94a3b8;
    opacity: 1;
    line-height: inherit;
}

.account-module .float-field > .form-select,
.account-module .float-field > select,
.account-module .float-field-control > .form-select,
.account-module .float-field-control > select {
    padding-right: 1.75rem !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.45rem center !important;
    background-size: 12px 8px !important;
}

/* Label as placeholder — centered inside input shell only (not date fields) */
.account-module .float-field:not(.is-active):not(.is-focused):not(.float-field-date) .float-field-control > .float-field-label,
.account-module .float-field:not(.is-active):not(.is-focused):not(.float-field-date) .float-field-control > .banking-field-label,
.account-module .float-field:not(.is-active):not(.is-focused):not(.float-field-date) .float-field-control > label {
    top: 50% !important;
    transform: translateY(-50%) !important;
    font-size: var(--account-field-font);
    font-weight: 400;
    color: #94a3b8;
    background: transparent;
}

.account-module .float-field .float-field-control > .float-field-label,
.account-module .float-field .float-field-control > .banking-field-label,
.account-module .float-field .float-field-control > label {
    left: 0.5rem;
}

.account-module .float-field.is-active .float-field-control > .float-field-label,
.account-module .float-field.is-focused .float-field-control > .float-field-label,
.account-module .float-field.is-active .float-field-control > label,
.account-module .float-field.is-focused .float-field-control > label,
.account-module .float-field-control > .form-control:focus + label,
.account-module .float-field-control > .form-control:not(:placeholder-shown) + label,
.account-module .float-field-control > .form-select:focus + label,
.account-module .float-field-control > select:focus + label {
    top: 0 !important;
    transform: translateY(-50%) !important;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--smart-primary, #5b8def);
    background: #fff;
}

/* Date fields — always show label on top border (filled-input behaviour) */
.account-module .float-field.float-field-date .float-field-control > .float-field-label,
.account-module .float-field.float-field-date .float-field-control > .banking-field-label,
.account-module .float-field.float-field-date .float-field-control > label {
    top: 0 !important;
    transform: translateY(-50%) !important;
    font-size: 0.65rem !important;
    font-weight: 600 !important;
    color: var(--smart-primary, #5b8def) !important;
    background: #fff !important;
}

.account-module .float-field.float-field-date:not(.is-focused) .float-field-control > label {
    color: #64748b !important;
}

.account-module .float-field.float-field-date.is-focused .float-field-control > label {
    color: var(--smart-primary, #5b8def) !important;
}

.account-module .float-field.float-field-date .float-field-control > input[type="date"] {
    color: #334155;
}

/* Legacy fields without inner shell */
.account-module .float-field:not(.is-active):not(.is-focused) > .float-field-label,
.account-module .float-field:not(.is-active):not(.is-focused) > .banking-field-label {
    top: calc(var(--account-field-height) / 2) !important;
    transform: translateY(-50%) !important;
}

.account-module .float-field > textarea.form-control {
    min-height: 72px;
    padding-top: 1rem;
    font-size: var(--account-field-font);
    border-radius: var(--account-field-radius);
}

.account-module .float-field > .input-group .form-control:not(textarea) {
    height: var(--account-field-height) !important;
    min-height: var(--account-field-height) !important;
    padding: 0 var(--account-field-padding-x) !important;
    font-size: var(--account-field-font) !important;
    line-height: calc(var(--account-field-height) - 2px) !important;
}

.account-module .payment-filter-card .float-field > .form-control:not(textarea),
.account-module .payment-filter-card .float-field > .form-select,
.account-module .payment-filter-card .float-field > select {
    height: var(--account-field-height) !important;
    min-height: var(--account-field-height) !important;
}

.account-module .banking-form-field.float-field {
    margin-bottom: 0;
}

.account-module .banking-form-field .float-field-hint,
.account-module .banking-form-field .banking-field-hint {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.75rem;
    color: #94a3b8;
    line-height: 1.35;
}

.account-module .float-field > .recon-diff-panel {
    min-height: var(--account-field-height);
    padding: 0.25rem var(--account-field-padding-x);
    border: 1px solid var(--account-field-border);
    border-radius: var(--account-field-radius);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ── Line-item tables (journal, simple voucher, etc.) ── */
.account-module .account-lines-table .form-control:not(textarea),
.account-module .account-lines-table .form-select,
.account-module .account-lines-table select,
.account-module #simpleLinesTable .form-control:not(textarea),
.account-module #simpleLinesTable .form-select,
.account-module #simpleLinesTable select {
    width: 100% !important;
    height: var(--account-field-height) !important;
    min-height: var(--account-field-height) !important;
    max-height: var(--account-field-height) !important;
    padding: 0 var(--account-field-padding-x) !important;
    font-size: var(--account-field-font) !important;
    line-height: calc(var(--account-field-height) - 2px) !important;
    border: 1px solid var(--account-field-border) !important;
    border-radius: var(--account-field-radius) !important;
    box-sizing: border-box !important;
    margin: 0 !important;
}

.account-module .account-lines-table .form-select,
.account-module .account-lines-table select,
.account-module #simpleLinesTable .form-select,
.account-module #simpleLinesTable select {
    padding-right: 1.75rem !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.45rem center !important;
    background-size: 12px 8px !important;
}

.account-module .account-lines-table input[type="number"],
.account-module #simpleLinesTable input[type="number"] {
    text-align: right;
}

.account-module .account-lines-table td,
.account-module #simpleLinesTable td {
    vertical-align: middle;
    padding: 0.35rem 0.4rem !important;
}
