/* Payment / Receipt (Pages/PaymentVoucherForm.razor) and Journal Entry (Pages/JournalEntryForm.razor):
   one static screen, approved as Demo/VoucherEntryCompactDemo.html. Strip / own account panel /
   the lines grid taking the height that is left (it scrolls inside, header and Total row pinned) /
   a 150px band of Remarks | Summary with Save / Cancel.

   The grid borrows InvoiceItemGrid's class names (.iig, .iig-wrap, .iig-table, .iig-in ...) so it
   gets that grid's look, its keys (invoicegrid.js) and its dropdown placement; what differs is here.
   A phone or a very short window gets an ordinary scrolling page (bottom of this file). */

.vc-page {
    padding: 6px 8px;
    overflow: hidden;
}

.vc-frame {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.vc-card {
    background: #ffffff;
    border-radius: 4px;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.18);
    padding: 8px 10px;
    min-width: 0;
}

.vc-page .invoice-detail-header {
    margin: 0;
    font-size: 13px;
    white-space: nowrap;
}

/*------------------------------ fields: 26px tall ------------------------------*/
.vc-page .invoice-form-item select,
.vc-page .invoice-form-item input {
    height: 26px;
    padding: 0 8px;
}
.vc-page .invoice-form-item label { top: 7px; left: 10px; }
.vc-page .invoice-form-item .sbdropdown-item label { top: -8px; left: 10px; }
.vc-page .vc-strip .vd-trigger,
.vc-page .vc-own .vd-trigger { height: 22px; padding: 4px 8px; }

/*------------------------------ Bank / Cash and Single / Multi switches ------------------------------*/
.vc-switch {
    display: inline-grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    border: 1px solid #007BFF;
    border-radius: 4px;
    overflow: hidden;
    flex: none;
}
.vc-switch button {
    border: none;
    background: #ffffff;
    color: #007BFF;
    font-size: 11.5px;
    font-weight: 600;
    padding: 0 18px;
    height: 26px;
    cursor: pointer;
    white-space: nowrap;
}
.vc-switch button + button { border-left: 1px solid #007BFF; }
.vc-switch button.on { background: #007BFF; color: #ffffff; }
.vc-switch button:disabled { cursor: default; }
.vc-switch button:disabled:not(.on) { color: #9bb9dd; }

/*------------------------------ 1. strip ------------------------------*/
.vc-strip {
    display: flex;
    align-items: center;
    gap: 12px;
}
.vc-fields {
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px 8px;
    padding-top: 6px;
}
.vc-fields-2 { max-width: 420px; }

/*------------------------------ 2. the bank / cash account ------------------------------*/
.vc-own {
    display: flex;
    align-items: center;
    gap: 12px;
}
.vc-own > .invoice-detail-header { min-width: 100px; }
.vc-own-acc { width: 320px; flex: none; padding-top: 6px; }
.vc-fig {
    flex: 1;
    min-width: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    height: 26px;
    margin-top: 6px;
    padding: 0 10px;
    background: #f5f8ff;
    border: 1px solid #dbe5f5;
    border-radius: 4px;
    font-size: 11.5px;
    font-weight: 600;
    color: #605e5c;
    white-space: nowrap;
}
.vc-fig b {
    color: #323130;
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
    overflow: hidden;
    text-overflow: ellipsis;
}
.vc-fig b.amt-due { color: #c62828; }
.vc-fig b.amt-settled { color: #2e7d32; }

/*------------------------------ 3. the lines grid ------------------------------*/
.vc-grid-card {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.vc-grid-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    min-height: 26px;
    margin-bottom: 8px;
}
.vc-grid {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.vc-grid .iig-wrap {
    flex: 1;
    min-height: 0;
    max-height: none;
}
/* Fixed columns that fill the box (the invoice grid sizes to its content and scrolls sideways). */
.vc-grid .iig-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    height: 100%;
}
.vc-grid .iig-table td {
    height: 30px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.vc-grid .iig-table tr.editing td { overflow: visible; }
.vc-grid .iig-table tr.editing td.iig-static { padding: 0 8px; overflow: hidden; }
.vc-grid .iig-table .iig-idx { width: auto; min-width: 0; }
.vc-grid .iig-table td.iig-dd { min-width: 0; }
.vc-grid .iig-table td.vc-acc { color: #323130; }
.vc-grid .iig-table .iig-in { height: 29px; min-width: 0; }
.vc-grid .iig-table .iig-in[type="date"] { padding: 0 4px; }
.vc-grid .iig-table select.iig-in { padding: 0 4px; }
.vc-grid .iig-table .iig-in:disabled { background: #f4f5f7; color: #b0b4bb; }
.vc-grid .iig-table td.iig-hint { color: #8a8f98; font-style: italic; font-weight: normal; }
.vc-grid .iig-table td.iig-act { text-align: center; }
.vc-del {
    color: #c62828;
    cursor: pointer;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 3px;
}
.vc-del:hover { background: #ffebee; }

.vc-keys {
    margin-top: 5px;
    font-size: 10.5px;
    color: #8a8f98;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}
.vc-keys kbd {
    font: bold 10px "Segoe UI", sans-serif;
    background: #f3f4f6;
    border: 1px solid #d6d9de;
    border-radius: 3px;
    padding: 0 4px;
    color: #4b5563;
    box-shadow: none;
}

/* The all-accounts list's "Add account in" menu. */
.aad { position: relative; }
.aad-groups {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 100000;
    width: 240px;
    background: #ffffff;
    border: 1px solid #c8c6c4;
    border-radius: 4px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
    padding: 6px;
    display: grid;
    gap: 3px;
}
.aad-groups-title { font-size: 11px; font-weight: bold; color: #605e5c; padding: 2px 4px 4px; }
.aad-groups button {
    text-align: left;
    border: 1px solid transparent;
    background: #f5f8ff;
    border-radius: 3px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.aad-groups button:hover { border-color: #0078d4; }
.aad-groups .aad-groups-cancel { background: #ffffff; color: #605e5c; text-align: center; }

/*------------------------------ 4. footer band ------------------------------*/
.vc-foot {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 6px;
    height: 150px;
    flex: none;
}
/* Balance has a fourth line (Status), so the journal's band is a little taller. */
.vc-journal .vc-foot { height: 162px; }
.vc-remarks,
.vc-summary {
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.vc-remarks > .invoice-detail-header,
.vc-summary > .invoice-detail-header { margin-bottom: 8px; }
.vc-rem-of { color: #605e5c; font-size: 11.5px; font-weight: 600; }
.vc-remarks .invoice-form-item { flex: 1; min-height: 0; }
.vc-remarks textarea {
    height: 100%;
    width: 100%;
    resize: none;
    padding: 6px 8px;
}
.vc-remarks textarea:disabled { background: #f7f8fa; }

.vc-sum {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 3px 10px;
    font-size: 12px;
}
.vc-sum span { color: #605e5c; font-weight: 600; }
.vc-sum b { text-align: right; font-variant-numeric: tabular-nums; }
.vc-sum .vc-net { color: #007BFF; }
.vc-status { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; }
.vc-status.ok { background: #e8f5e9; color: #2e7d32; }
.vc-status.due { background: #ffebee; color: #c62828; }

.vc-btns {
    margin-top: auto;
    padding-top: 8px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.vc-btns .btn { font-weight: bold; height: 30px; padding: 0; }

/*------------------------------ phone / short window: an ordinary scrolling page ------------------------------*/
@media (max-width: 900px), (max-height: 560px) {
    .vc-page { overflow: auto; }
    .vc-frame { height: auto; }
    .vc-strip,
    .vc-own {
        flex-direction: column;
        align-items: stretch;
    }
    .vc-own-acc { width: auto; }
    .vc-fig { flex: none; }
    .vc-grid-card { flex: none; height: 360px; }
    .vc-foot { grid-template-columns: 1fr; height: auto; }
    .vc-remarks textarea { height: 90px; }
    .vc-keys { display: none; }
}
