/* 03-transactions-journals.css — Transactions page, journals list / form / voucher, journal import, confirmation dialog.
   Loaded after the files with a smaller number (later rules win). */

/* ---------- Transactions page ---------- */
.rep-table tr.txn-start td { border-top: 1px solid var(--border); }
.rep-table tr.txn-shade td { background: #fbfcfe; }
.rep-table tr.txn-shade:hover td, .rep-table tr:hover td { background: #f5f8ff; }
.against.ledger-own { font-weight: 600; }
.against.ledger-own .cr-ic { background: var(--blue-soft); color: var(--blue); }
.rep-pager { display: flex; justify-content: center; padding: 1rem; border-top: 1px solid var(--border); }
.rep-pager .pagination { margin: 0; gap: .25rem; }
.rep-pager .page-link { border: 0; border-radius: 8px !important; color: var(--muted); font-weight: 600; font-size: .85rem; }
.rep-pager .page-item.active .page-link { background: var(--blue); color: #fff; }
.rep-pager .page-link:hover { background: var(--hover); color: var(--text); }
.rep-pager nav > div:first-child { display: none; }
.against .amt { font-family: var(--mono); font-size: .74rem; color: var(--muted); white-space: nowrap; }
.against .amt b { font-family: var(--font); font-size: .64rem; color: var(--subtle); }
.hide-led .col-led, .hide-agl .col-agl { display: none; }

/* ---------- Journals ---------- */
.c-red { --c: #e41e3f; --cb: #fde8eb; }
.jn-code { font-family: var(--mono); font-weight: 600; color: var(--blue); text-decoration: none; white-space: nowrap; }
.jn-code:hover { text-decoration: underline; }
.jn-code.na { color: var(--subtle); font-weight: 500; }
.jn-actions { display: flex; gap: .3rem; justify-content: flex-end; }
.jn-actions .ca:not(.ca-view) { width: 26px; padding: 0; justify-content: center; }
.ca-post { color: var(--green); }
.ca-post:hover { color: #fff; background: var(--green); border-color: var(--green); }
.jn-lines td { vertical-align: top; }
.jn-lines .form-control-sm, .jn-lines .form-select-sm { padding-top: .45rem; padding-bottom: .45rem; font-size: .88rem; border-radius: 8px; }
.jn-lines .act { margin-top: 3px; }
.jn-diff { padding: .75rem 1.1rem; font-size: .88rem; font-weight: 600; border-top: 1px solid var(--border); }
.jn-diff.ok { background: var(--green-soft); color: #1d6b10; }
.jn-diff.bad { background: var(--red-soft); color: #a3122b; }
.jn-diff.empty { background: var(--hover); color: var(--muted); }
.jv-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .75rem; padding: 0 1.25rem 1.1rem; }
.jv-meta > div { background: var(--bg); border-radius: 12px; padding: .65rem .85rem; display: flex; flex-direction: column; }
.jv-meta span { font-size: .72rem; font-weight: 600; color: var(--muted); }
.jv-meta b { font-size: .95rem; }
.jv-narration { padding: 1rem 1.25rem 0; }
.jv-narration span { font-size: .7rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--subtle); }
.jv-narration p { margin: .3rem 0 0; white-space: pre-line; }
.jv-sign { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; padding: 2.5rem 1.25rem 1.5rem; }
@media (max-width: 767px) { .jv-sign { grid-template-columns: 1fr; } }
.jv-sign .line { border-top: 1.5px dashed var(--border-strong); margin-bottom: .45rem; }
.jv-sign b { display: block; font-size: .82rem; }
.jv-sign span { font-size: .78rem; color: var(--muted); }
.tb-btn:disabled { opacity: .5; }

/* ---------- Journals 2.0 ---------- */
.kbd-hints { gap: .9rem; font-size: .75rem; color: var(--muted); align-items: center; }
kbd { background: var(--card); color: var(--text); border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; padding: .05rem .35rem; font-family: var(--mono); font-size: .7rem; box-shadow: none; }

.jn-templates { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.tpl-chip { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--border); background: var(--card); color: var(--text); border-radius: 999px; padding: .38rem .85rem; font-size: .82rem; font-weight: 600; box-shadow: var(--shadow); transition: transform .15s, border-color .15s, color .15s, box-shadow .15s; }
.tpl-chip i { color: var(--violet); }
.tpl-chip:hover { transform: translateY(-1px); border-color: var(--blue); color: var(--blue); box-shadow: 0 6px 16px -8px rgba(24,119,242,.6); }
.tpl-chip.active { background: var(--blue-soft); border-color: var(--blue); color: var(--blue); }

.acc-pick { position: relative; }
.acc-pick .acc-dot { position: absolute; left: .7rem; top: 1.05rem; transform: translateY(-50%); pointer-events: none; z-index: 2; }
.acc-pick .acc-input { padding-left: 1.6rem; min-width: 220px; }
.acc-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; box-shadow: 0 0 0 2px rgba(255,255,255,.9); }
.acc-menu { position: fixed; z-index: 1080; max-height: 320px; overflow: auto; background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: .35rem; }
.acc-grp { font-size: .66rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--subtle); padding: .55rem .6rem .25rem; position: sticky; top: -.35rem; background: var(--card); }
.acc-opt { display: flex; align-items: center; gap: .55rem; padding: .45rem .6rem; border-radius: 8px; cursor: pointer; font-size: .88rem; }
.acc-opt .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-opt:hover, .acc-opt.hi { background: var(--blue-soft); color: var(--blue); }
.acc-empty { padding: .9rem; color: var(--muted); font-size: .85rem; text-align: center; }

.line-tools { white-space: nowrap; }
.line-tools .act { display: inline-grid; width: 28px; height: 28px; }
.auto-pill { display: none; font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--violet); background: var(--violet-soft); border-radius: 999px; padding: .12rem .45rem; vertical-align: middle; margin-right: .15rem; }
tr[data-auto="1"] .auto-pill { display: inline-block; }
tr[data-auto="1"] .amt-dr, tr[data-auto="1"] .amt-cr { border-style: dashed; }
.jn-lines tbody tr { transition: background .15s; }
.jn-lines tbody tr:focus-within { background: #f7fbff; }
.jn-add { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; padding: .75rem 1.1rem; border-top: 1px dashed var(--border); }

.jn-bar { position: sticky; bottom: .75rem; z-index: 20; margin-top: 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; padding: .7rem .9rem .7rem 1.2rem; background: rgba(255,255,255,.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); }
.jn-tot { display: flex; flex-direction: column; line-height: 1.15; }
.jn-tot span { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--subtle); }
.jn-tot b { font-size: 1.05rem; }
.jn-state { font-size: .82rem; font-weight: 600; padding: .4rem .8rem; border-radius: 999px; display: inline-flex; align-items: center; gap: .35rem; }
.jn-state.ok { background: var(--green-soft); color: #1d6b10; }
.jn-state.bad { background: var(--red-soft); color: #a3122b; }
.jn-state.empty { background: var(--hover); color: var(--muted); }
.jn-bar-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: .5rem; }
.jn-bar-actions .btn:disabled { opacity: .45; }
@media (max-width: 575.98px) { .jn-bar-actions { margin-left: 0; width: 100%; } .jn-bar-actions .btn { flex: 1; } }

.jn-bulk { position: sticky; top: .75rem; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .75rem; padding: .55rem .75rem; border-radius: 14px; background: var(--card); border: 1px solid var(--blue); box-shadow: 0 10px 24px -12px rgba(24,119,242,.55); animation: jnPop .18s ease-out; }
.jn-bulk[hidden] { display: none; }
.jn-bulk-count { font-size: .88rem; font-weight: 600; color: var(--blue); margin-right: .25rem; }
@keyframes jnPop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
#reportTable tr.picked td { background: var(--blue-soft); }

.flow { display: inline-flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.flow > .bi { color: var(--subtle); font-size: .8rem; }
.flow-led { display: inline-flex; align-items: center; gap: .35rem; background: var(--bg); border-radius: 999px; padding: .15rem .55rem; font-size: .8rem; font-weight: 500; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flow-led em { font-style: normal; font-size: .7rem; font-weight: 700; color: var(--muted); }

.status-pill { display: inline-flex; align-items: center; gap: .3rem; font-size: .74rem; font-weight: 700; padding: .22rem .6rem; border-radius: 999px; white-space: nowrap; }
.status-pill.posted { background: var(--green-soft); color: #1d6b10; }
.status-pill.saved { background: var(--amber-soft); color: #8a5a00; }
.status-pill.cancelled { background: var(--red-soft, #fde8eb); color: #b0122e; }   /* step 0.4: reversed, kept for the audit trail */

.tag-link { text-decoration: none; }
.tag-link:hover { background: var(--blue); color: #fff; }
.tag-link i { font-size: .65rem; }

/* Voucher */
.jv-nav { display: flex; gap: .4rem; }
.jv-nav .btn.disabled { opacity: .45; }
.jv-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1rem; align-items: start; }
@media (max-width: 1199.98px) { .jv-layout { grid-template-columns: minmax(0, 1fr); } .jv-side { position: static; } }
.jv-side { position: sticky; top: 1rem; }
.jv-hero { position: relative; overflow: hidden; color: #fff; background: var(--grad-ai); border-radius: 18px; padding: 1.3rem 1.4rem; box-shadow: 0 16px 34px -18px rgba(123,60,255,.7); }
.jv-hero::after { content: ''; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,.12); pointer-events: none; }
.jv-hero .tag-glass { display: inline-flex; align-items: center; gap: .3rem; background: rgba(255,255,255,.2); color: #fff; font-size: .75rem; font-weight: 600; padding: .25rem .65rem; border-radius: 999px; margin: 0 0 .3rem .3rem; }
.jv-amount { font-size: clamp(1.7rem, 4vw, 2.3rem); font-weight: 700; letter-spacing: -.02em; line-height: 1.1; margin: .1rem 0 .25rem; }
.jv-words { font-size: .85rem; opacity: .9; font-style: italic; }
.jv-flow { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr auto 1fr; gap: .75rem; align-items: center; margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,.25); }
.jv-flow .side { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.jv-flow .side:last-child { justify-content: flex-end; }
.jv-flow .lbl { width: 100%; font-size: .66rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.jv-flow .side:last-child .lbl { text-align: right; }
.jv-flow .arrow { font-size: 1.6rem; opacity: .9; }
.flow-chip { display: inline-flex; align-items: center; gap: .4rem; background: rgba(255,255,255,.95); color: var(--text); border-radius: 999px; padding: .25rem .7rem; font-size: .8rem; font-weight: 600; }
.flow-chip b { color: var(--muted); font-weight: 600; font-size: .75rem; }
@media (max-width: 575.98px) { .jv-flow { grid-template-columns: 1fr; } .jv-flow .arrow { transform: rotate(90deg); justify-self: center; } .jv-flow .side:last-child { justify-content: flex-start; } .jv-flow .side:last-child .lbl { text-align: left; } }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 13px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline li { position: relative; display: flex; gap: .7rem; padding-bottom: 1rem; }
.timeline li:last-child { padding-bottom: 0; }
.timeline .dot { position: relative; z-index: 1; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--card); display: grid; place-items: center; box-shadow: 0 0 0 1px var(--border); font-size: .9rem; }
.timeline .what { font-weight: 600; font-size: .88rem; }
.timeline .who { font-weight: 400; color: var(--muted); }
.timeline .note { font-size: .8rem; background: var(--bg); border-radius: 8px; padding: .25rem .5rem; margin-top: .2rem; }
.timeline .when { font-size: .74rem; color: var(--subtle); margin-top: .15rem; }
@media print { .jv-hero, .jv-side, .jv-nav, .jn-bar, .jn-bulk { display: none !important; } }

/* ---------- Journal import ---------- */
.imp-drop { display: flex; flex-direction: column; align-items: center; gap: .35rem; text-align: center; padding: 2.2rem 1rem; border: 2px dashed var(--border-strong); border-radius: 18px; background: var(--card); cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.imp-drop:hover, .imp-drop.over { border-color: var(--blue); background: var(--blue-soft); }
.imp-drop.over { transform: scale(1.01); }
.imp-ic { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; font-size: 1.7rem; color: var(--violet); background: var(--violet-soft); margin-bottom: .35rem; }
.imp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; }
.imp-stats > div { background: var(--card); border-radius: 14px; padding: .75rem 1rem; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.imp-stats span { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--subtle); }
.imp-stats b { font-size: 1.15rem; }
.imp-stats .ok b { color: #1d6b10; }
.imp-stats .bad b { color: #a3122b; }
.imp-errors { list-style: none; margin: 0; padding: .25rem 1.25rem 1.1rem; max-height: 320px; overflow: auto; }
.imp-errors li { padding: .45rem 0; border-bottom: 1px solid var(--border); font-size: .88rem; }
.imp-errors .rn { display: inline-block; min-width: 64px; margin-right: .5rem; font-family: var(--mono); font-size: .75rem; font-weight: 700; color: #a3122b; background: var(--red-soft); border-radius: 6px; padding: .1rem .4rem; text-align: center; }
.imp-j { cursor: pointer; }
.imp-j .bi { transition: transform .15s; color: var(--subtle); }
.imp-j.open .bi { transform: rotate(90deg); }
.imp-lines > td { background: var(--bg); padding: .4rem .75rem !important; }
.imp-sub { width: 100%; font-size: .82rem; }
.imp-sub td { padding: .3rem .5rem; border-bottom: 1px solid var(--border); }
.imp-sub tr:last-child td { border-bottom: 0; }
.imp-cols { width: 100%; font-size: .84rem; }
.imp-cols td { padding: .4rem 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.imp-cols td:first-child { width: 36%; padding-right: .6rem; white-space: nowrap; }
.imp-cols tr:last-child td { border-bottom: 0; }

/* ---------- Confirmation dialog ---------- */
.modal-backdrop.show { opacity: 1; background: rgba(15, 23, 42, .38); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal-content { border-radius: 22px; box-shadow: 0 30px 70px -20px rgba(15, 23, 42, .45), 0 2px 6px rgba(0, 0, 0, .06); }
.cf-modal .modal-dialog { max-width: 420px; }
.cf-modal.fade .modal-dialog { transform: translateY(14px) scale(.94); transition: transform .28s cubic-bezier(.2, .9, .3, 1.25), opacity .2s; }
.cf-modal.show .modal-dialog { transform: none; }
.cf-card { --tone: var(--blue); --tone-soft: var(--blue-soft); --tone-ink: var(--blue-dark); position: relative; overflow: hidden; text-align: center; padding: 2rem 1.6rem 1.5rem; }
.cf-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--tone); }
.cf-card[data-tone="danger"]  { --tone: var(--red);   --tone-soft: var(--red-soft);   --tone-ink: #b3122d; }
.cf-card[data-tone="warning"] { --tone: #e69b00;      --tone-soft: var(--amber-soft); --tone-ink: #8a5a00; }
.cf-card[data-tone="success"] { --tone: var(--green); --tone-soft: var(--green-soft); --tone-ink: #1d6b10; }
.cf-icon { position: relative; width: 68px; height: 68px; margin: 0 auto 1.1rem; border-radius: 50%; display: grid; place-items: center; font-size: 1.7rem; color: var(--tone-ink); background: var(--tone-soft); }
.cf-icon .bi { position: relative; z-index: 1; animation: cfPop .45s cubic-bezier(.2, .9, .3, 1.4) both; }
.cf-ring { position: absolute; inset: -7px; border-radius: 50%; border: 2px solid var(--tone); opacity: .25; animation: cfRing 1.8s ease-out infinite; }
@keyframes cfPop { from { transform: scale(.4) rotate(-20deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes cfRing { 0% { transform: scale(.85); opacity: .45; } 100% { transform: scale(1.25); opacity: 0; } }
.cf-title { font-weight: 800; font-size: 1.25rem; letter-spacing: -.01em; margin: 0 0 .4rem; }
.cf-message { color: var(--muted); font-size: .93rem; line-height: 1.5; margin: 0 auto; max-width: 330px; }
.cf-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; margin-top: .9rem; }
.cf-chips span { font-family: var(--mono); font-size: .76rem; font-weight: 600; background: var(--bg); color: var(--text); border-radius: 999px; padding: .25rem .7rem; }
.cf-actions { display: flex; gap: .6rem; margin-top: 1.5rem; }
.cf-actions .btn { flex: 1; padding: .65rem 1rem; border-radius: 12px; font-weight: 700; border: 0; }
.cf-cancel { background: var(--bg); color: var(--text); }
.cf-cancel:hover { background: var(--border); }
.cf-ok { background: var(--tone); color: #fff; box-shadow: 0 10px 20px -10px var(--tone); }
.cf-ok:hover, .cf-ok:focus-visible { background: var(--tone); color: #fff; filter: brightness(.93); transform: translateY(-1px); }
@media (prefers-reduced-motion: reduce) { .cf-ring, .cf-icon .bi { animation: none; } .cf-modal.fade .modal-dialog { transition: none; } }


/* Party (customer / supplier / employee) of a journal line */
.party-chip { display: inline-flex; align-items: center; gap: .35rem; padding: .15rem .55rem; border-radius: 99px; background: var(--violet-soft); color: #5b2bbf; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.party-chip .bi { font-size: .8rem; }

/* ==========================================================================
   Journal as an A4 voucher sheet (same look as the PDF "Redesign" style)
   ========================================================================== */
.jv-paper { background: #fff; max-width: 860px; min-height: 1123px; margin: 0 auto; padding: 34px 40px 48px; border: 1px solid #e6e8ec; border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,.05), 0 14px 34px -18px rgba(15,23,42,.25); color: #2d3340; font-size: .9rem; line-height: 1.5; }
.jv-paper.wide { max-width: none; min-height: 0; }
.jv-lh { width: 100%; background: #f6f7f9; border-radius: 10px; margin-bottom: 1.4rem; border-collapse: separate; }
.jv-lh td { padding: .85rem 1rem; vertical-align: top; }
.jv-lh-logo { max-height: 40px; max-width: 160px; margin-bottom: .35rem; display: block; }
.jv-lh-name { font-weight: 700; color: #1c2230; }
.jv-lh-doc { font-weight: 700; color: #1c2230; font-size: .9rem; }
.jv-lh-line { font-size: .78rem; color: #737a87; }
.jv-paper-title { font-size: 1.6rem; font-weight: 700; color: #1c2230; line-height: 1.2; }
.jv-paper-sub { font-size: .85rem; color: #5b6270; margin-top: .2rem; }
.jv-paper-rule { border-top: 1px solid #e6e8ec; margin: .9rem 0 1rem; }
.jv-paper-status { text-align: center; font-weight: 700; letter-spacing: 2px; color: #1c2230; margin-bottom: 1rem; }
.jv-paper-status.posted { color: #13804f; }
.jv-fields { width: 100%; margin-bottom: 1.1rem; }
.jv-fields td { padding: .25rem .6rem .25rem 0; vertical-align: top; }
.jv-fields td.k { width: 17%; color: #737a87; white-space: nowrap; }
.jv-fields.notes { margin-top: 1.2rem; }
.jv-grid { width: 100%; border-collapse: collapse; font-size: .84rem; }
.jv-grid th { font-weight: 500; color: #5b6270; padding: .5rem .55rem; border: 1px solid #e6e8ec; text-align: left; white-space: nowrap; }
.jv-grid td { padding: .45rem .55rem; border: 1px solid #e6e8ec; vertical-align: top; }
.jv-grid .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.jv-grid .sl { width: 36px; text-align: center; }
.jv-grid a { color: inherit; text-decoration: none; }
.jv-grid a:hover { color: var(--blue); text-decoration: underline; }
.jv-grid tr.total td { font-weight: 700; color: #1c2230; background: #f6f7f9; border-top: 1.2px solid #b9bec7; }
.jv-signs { width: 100%; margin-top: 4.5rem; border-collapse: separate; border-spacing: 1.4rem 0; }
.jv-signs td { width: 33%; text-align: center; font-size: .84rem; vertical-align: top; }
.jv-signs .line { border-top: 1px solid #8a909b; margin-bottom: .35rem; }
.jv-signs small { display: block; color: #737a87; font-size: .74rem; }

/* the form inside the sheet: no extra cards */
.jv-paper-sec { padding-bottom: .4rem; }
.jv-paper-lines { border: 1px solid #e6e8ec; border-radius: 10px; overflow: hidden; }
.jv-paper-lines .rep-head { background: #fafbfc; }

/* attachments */
.jv-attach-pick { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.jv-attach-pick input[type=file] { max-width: 420px; }
.jv-files { display: flex; flex-wrap: wrap; gap: .4rem; }
.jv-file { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .55rem; border-radius: 99px; background: var(--hover); font-size: .8rem; }
.jv-file a { color: var(--text); text-decoration: none; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jv-file small { color: var(--subtle); }
.jv-att { display: flex; align-items: center; gap: .6rem; padding: .45rem 0; border-bottom: 1px solid var(--border); }
.jv-att > .bi { font-size: 1.2rem; }
.jv-att .grow { flex: 1; min-width: 0; }
.jv-att a { display: block; color: var(--text); font-weight: 600; font-size: .86rem; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jv-att a:hover { color: var(--blue); }
.jv-att small { color: var(--muted); font-size: .74rem; }
.jv-att-del { border: 0; background: transparent; color: var(--subtle); width: 26px; height: 26px; border-radius: 6px; }
.jv-att-del:hover { background: var(--red-soft); color: var(--red); }
.jv-drop { display: flex; align-items: center; justify-content: center; gap: .4rem; padding: .6rem; border: 1.5px dashed var(--border-strong); border-radius: 10px; color: var(--muted); cursor: pointer; font-size: .86rem; font-weight: 600; }
.jv-drop:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }

/* A4 voucher: fit the whole table inside the sheet */
.jv-paper { padding: 30px 32px 44px; }
.jv-grid { font-size: .78rem; table-layout: auto; }
.jv-grid th, .jv-grid td { padding: .4rem .45rem; }
.jv-grid td { word-break: normal; overflow-wrap: anywhere; }
.jv-grid .num { overflow-wrap: normal; }
.jv-layout:has(.jv-paper) { grid-template-columns: minmax(0, 1fr) 270px; }
.jv-paper.wide { padding: 24px 24px 28px; }
.jv-paper-lines .jn-lines th, .jv-paper-lines .jn-lines td { padding-left: .4rem; padding-right: .4rem; }

/* Customer / Supplier and Employee boxes of a journal line: a drop-down list (like the account box) */
.pick-wrap { position: relative; }
.pick-wrap .form-control { padding-right: 1.6rem; cursor: pointer; text-overflow: ellipsis; }
.pick-wrap > .bi { position: absolute; right: .55rem; top: 50%; transform: translateY(-50%); font-size: .7rem; color: var(--subtle); pointer-events: none; }
.acc-opt > .bi { color: var(--muted); font-size: .9rem; }
.acc-opt.muted-opt { color: var(--muted); }
.jn-actions .ca:disabled { opacity: .35; cursor: not-allowed; }

/* ===== Receives (receives/index, form, show) ===== */
/* the five kinds as tabs above the list */
.rv-kinds { display: flex; flex-wrap: wrap; gap: .35rem; }
.rv-kinds a { display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .8rem; border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--muted); font-size: .84rem; font-weight: 600; text-decoration: none; transition: color .12s, border-color .12s, background .12s; }
.rv-kinds a:hover { color: var(--blue); border-color: var(--blue); }
.rv-kinds a.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.rv-who { display: inline-flex; align-items: center; gap: .35rem; color: var(--text); font-weight: 600; text-decoration: none; }
.rv-who .bi { color: var(--subtle); }
a.rv-who:hover { color: var(--blue); }
/* form */
.rv-help { display: flex; gap: .5rem; align-items: flex-start; padding: .55rem .8rem; border-radius: 10px; background: var(--blue-soft); color: #0c5ec4; font-size: .85rem; }
.rv-balance { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin-top: .4rem; font-size: .82rem; color: var(--muted); }
.rv-balance a { margin-left: auto; font-weight: 600; text-decoration: none; }
.rv-preview { border: 1px dashed var(--border-strong); border-radius: 10px; padding: .6rem .85rem; background: #fafbfc; }
.rv-preview-h { font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--subtle); margin-bottom: .3rem; }
.rv-preview-row { display: flex; align-items: baseline; gap: .5rem; padding: .15rem 0; font-size: .88rem; }
.rv-preview-row small { color: var(--muted); }
.rv-preview-row .dr, .rv-preview-row .cr { display: inline-block; width: 26px; text-align: center; font-size: .7rem; font-weight: 700; border-radius: 6px; padding: .05rem 0; }
.rv-preview-row .dr { background: var(--green-soft); color: #1d6b10; }
.rv-preview-row .cr { background: var(--violet-soft); color: var(--violet); }
.acc-opt .pk-sub { margin-left: auto; padding-left: .6rem; font-size: .75rem; color: var(--muted); white-space: nowrap; font-family: var(--mono, ui-monospace, monospace); }
/* voucher */
.rv-amount-box { display: flex; align-items: center; justify-content: space-between; margin: .4rem 0 1rem; padding: .7rem 1rem; border: 1px solid #e6e8ec; border-left: 4px solid var(--green); border-radius: 6px; background: #f7fbf6; }
.rv-amount-box span { font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #5b6270; }
.rv-amount-box b { font-size: 1.35rem; color: #1c2230; }
.rv-side-bal { display: flex; justify-content: space-between; align-items: baseline; padding: .55rem .7rem; border-radius: 10px; background: var(--bg-soft, #f4f6f9); font-size: .85rem; }
/* the amount box of a voucher, coloured by its group: money in green, out red, moved blue, transferred violet */
.rv-amount-box.payment { border-left-color: var(--red); background: #fdf6f7; }
.rv-amount-box.fund { border-left-color: var(--blue); background: #f5f9ff; }
.rv-amount-box.balance { border-left-color: var(--violet); background: #f9f6ff; }
/* Voucher pages (journal, receive, payment, transfers): the A4 sheet column is no wider than the sheet,
   so the side card sits right next to it; the pair is centred on wide screens */
@media (min-width: 1200px) {
    .jv-layout:has(.jv-paper) { grid-template-columns: minmax(0, 860px) 280px; justify-content: center; }
}

/* ===== Attachment box (components/attach-box + public/js/attach.js) ===== */
.ab { position: relative; }
.ab-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ab-drop { display: grid; grid-template-columns: auto 1fr; column-gap: .75rem; align-items: center; padding: .8rem 1rem; border: 1.5px dashed var(--border-strong); border-radius: 12px; background: #fafbfc; cursor: pointer; transition: border-color .12s, background .12s; }
.ab-drop:hover, .ab-drop:focus-visible, .ab.over .ab-drop { border-color: var(--blue); background: var(--blue-soft); outline: none; }
.ab-drop-ic { grid-row: span 2; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); font-size: 1.15rem; }
.ab.over .ab-drop-ic { background: var(--blue); color: #fff; }
.ab-drop-t { font-size: .88rem; color: var(--text); }
.ab-drop-t u { color: var(--blue); text-decoration: none; font-weight: 600; }
.ab-paste { color: var(--muted); }
.ab-drop-s { font-size: .74rem; color: var(--subtle); }
.ab-compact .ab-drop { padding: .6rem .75rem; }
.ab-compact .ab-drop-ic { width: 32px; height: 32px; font-size: 1rem; }
.ab-err { margin-top: .5rem; padding: .45rem .7rem; border-radius: 8px; background: var(--red-soft); color: #a3122b; font-size: .8rem; }
.ab-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .5rem; margin-top: .6rem; }
.ab-list:empty { display: none; }
.ab-compact .ab-list { grid-template-columns: minmax(0, 1fr); }
.ab-item { display: flex; align-items: center; gap: .6rem; min-width: 0; padding: .4rem .45rem .4rem .4rem; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.ab-item.new { border-color: #b9d7fb; background: #f7fbff; }
.ab-item.removing { opacity: .55; background: var(--red-soft); border-color: #f5c2cb; }
.ab-item.removing .ab-name { text-decoration: line-through; }
.ab-thumb { width: 38px; height: 38px; flex: none; border-radius: 7px; object-fit: cover; background: #f1f3f6; }
.ab-thumb-ic { display: grid; place-items: center; font-size: 1.2rem; }
.ab-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ab-name { font-size: .84rem; font-weight: 600; color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.ab-name:hover { color: var(--blue); }
.ab-meta small { font-size: .72rem; color: var(--muted); }
.ab-new { color: var(--blue); font-weight: 600; }
.ab-x { flex: none; border: 0; background: transparent; color: var(--subtle); width: 26px; height: 26px; border-radius: 6px; }
.ab-x:hover { background: var(--red-soft); color: var(--red); }
.ab-undo { display: none; flex: none; border: 0; background: #fff; color: var(--blue); font-size: .74rem; font-weight: 600; border-radius: 6px; padding: .15rem .45rem; }
.ab-item.removing .ab-x { display: none; }
.ab-item.removing .ab-undo { display: inline-block; }
.ab-actions { display: flex; gap: .4rem; margin-top: .6rem; }

/* journal page: the attached files, click to preview */
.jv-att .ab-thumb { cursor: zoom-in; }
.jv-att-open { border: 0; background: none; padding: 0; text-align: left; min-width: 0; display: block; width: 100%; }
.jv-att-open b { display: block; color: var(--text); font-weight: 600; font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jv-att-open:hover b { color: var(--blue); }
.jv-att-dl { border: 0; background: transparent; color: var(--subtle); width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; text-decoration: none; }
.jv-att-dl:hover { background: var(--blue-soft); color: var(--blue); }
.att-preview .modal-body { padding: 0; background: #f1f3f6; min-height: 60vh; display: grid; place-items: center; }
.att-preview img { max-width: 100%; max-height: 78vh; object-fit: contain; }
.att-preview iframe { width: 100%; height: 78vh; border: 0; background: #fff; }
/* compact box (narrow side panel): icon above the text, centred */
.ab-compact .ab-drop { grid-template-columns: 1fr; justify-items: center; text-align: center; row-gap: .25rem; }
.ab-compact .ab-drop-ic { grid-row: auto; }
/* voucher lists: one ledger per column (Deposit To / Pay From / From / To), so the chip gets room; a long name ends in "…" (full name on hover) */
.rv-led { display: inline-flex; align-items: center; gap: .35rem; max-width: 150px; padding: .12rem .55rem; border-radius: 999px; background: var(--bg); font-size: .78rem; font-weight: 500; vertical-align: middle; }
.rv-led .acc-dot { flex: none; }
.rv-led-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* journal list chips: the name ends in "…" when long (full name on hover) */
.flow-led .acc-dot, .flow-led em { flex: none; }
.flow-led .fl-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* voucher lists: "Edited by" only on wide screens, so the list fits without scrolling sideways (it is on the voucher page too) */
@media (max-width: 1599.98px) { .data-grid .col-editor { display: none; } }
.data-grid .cr-code { white-space: nowrap; }   /* reference numbers stay on one line */
/* Activity timeline: the fields an edit changed (partials/activity-timeline, roadmap 0.7) */
.timeline .changes { list-style: none; margin: .25rem 0 0; padding: .3rem .5rem; border-radius: 8px; background: var(--bg); font-size: .78rem; }
.timeline .changes li { display: block; padding: .05rem 0; }
.timeline .changes .f { color: var(--muted); }
.timeline .changes s { color: var(--subtle); }
.timeline .changes .bi { font-size: .7rem; color: var(--subtle); margin: 0 .15rem; }
.timeline .min-w-0 { min-width: 0; overflow-wrap: anywhere; }
/* Payment status of an invoice (partials/pay-pill, roadmap 1.4a) */
.status-pill.pay-unpaid { background: var(--amber-soft); color: #8a5a00; }
.status-pill.pay-partly { background: var(--blue-soft); color: #0c5ec4; }
.status-pill.pay-overdue { background: var(--red-soft, #fde8eb); color: #b0122e; }
.status-pill.pay-paid { background: var(--green-soft); color: #1d6b10; }
