/**
 * HamlyERP
 * Copyright (c) 2026 Nolwa Private Limited. All rights reserved.
 * Proprietary and confidential. Unauthorised copying, modification or distribution of this file is prohibited.
 */
/* PARTY-CARD-01 round 3 (owner 8 Nov, D-124): the customer / supplier box of Add sale, bill, purchase order, POS and
   purchase return (public/js/doc-form/party-card.js) and its History side panel. Everything is inside the box, nothing
   under it, no tooltip: the head line (name, code, B2B/B2C, buttons), the ids line (phone, VAT, CR, address) and the
   money line (balance, overdue, credit limit, terms); each line wraps item by item, so a phone just gets more lines. */
.df-party-card > .pc-box { flex: 1 1 auto; }
/* the box grows with its lines: the field's + button keeps its own height at the top */
.df-group:has(.df-party-card) > .df-btn-square { align-self: flex-start; }
.pc-box { min-width: 0; display: grid; gap: 4px; text-align: start; }
.pc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.pc-name { font-weight: var(--fw-semibold, 600); color: var(--ui-ink, #1f2328); overflow-wrap: anywhere; }
.pc-code { font-size: var(--fs-sm, 13px); color: var(--ui-muted, #5f6b66); unicode-bidi: isolate; }
.pc-kind { font-size: var(--fs-xs, 12px); font-weight: var(--fw-semibold, 600); padding: 1px 8px; border-radius: var(--r-pill, 999px); border: 1px solid var(--ui-line-soft, #e3e7e5); color: var(--ui-muted, #5f6b66); background: var(--ui-surface-2, #f6f7f6); white-space: nowrap; }
.pc-kind.is-b2b { color: var(--ui-ok, #1e7a4c); background: var(--ui-ok-wash, #e8f5ee); border-color: transparent; }
.pc-actions { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 6px; }
.pc-btn { font: inherit; font-size: var(--fs-sm, 13px); font-weight: var(--fw-semibold, 600); line-height: 1.2; color: var(--ui-brand-ink, #0f5c3a); background: var(--ui-surface, #fff); border: 1px solid var(--ui-line, #d5dbd8); border-radius: var(--r-md, 8px); padding: 4px 10px; min-height: 30px; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.pc-btn:hover, .pc-btn:focus-visible { background: var(--ui-hover, #eef2f0); text-decoration: none; }
.pc-btn.is-link { border-color: transparent; background: transparent; }
.pc-btn.is-primary { background: var(--ui-brand, #0f5c3a); color: var(--ui-on-brand, #fff); border-color: var(--ui-brand, #0f5c3a); min-height: 40px; padding: 8px 14px; }
.pc-line { display: flex; flex-wrap: wrap; gap: 2px 16px; margin: 0; font-size: var(--fs-sm, 13px); line-height: 1.45; }
.pc-money { border-top: 1px dashed var(--ui-line-soft, #e3e7e5); padding-top: 4px; }
.pc-item { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 0 4px; min-width: 0; max-width: 100%; }
.pc-item dt { margin: 0; color: var(--ui-muted, #5f6b66); font-weight: var(--fw-medium, 500); white-space: nowrap; }
.pc-item dd { margin: 0; color: var(--ui-ink, #1f2328); overflow-wrap: anywhere; min-width: 0; }
.pc-val { unicode-bidi: isolate; }
.pc-val a, .pc-fix { color: var(--ui-brand-ink, #0f5c3a); font-weight: var(--fw-semibold, 600); }
.pc-empty { color: var(--ui-muted, #5f6b66); }
.pc-note { font-size: var(--fs-xs, 12px); color: var(--ui-muted, #5f6b66); }
.pc-item.is-missing .pc-note, .pc-item.is-warn .pc-note { color: var(--ui-warn-ink, #8a5a00); background: var(--ui-warn-wash, #fff4dc); border-radius: var(--r-sm, 4px); padding: 0 6px; }
.pc-item.is-due .pc-val { color: var(--ui-error, #b42318); font-weight: var(--fw-semibold, 600); }
.pc-item.is-due .pc-note { color: var(--ui-error, #b42318); }
.pc-fix { font-size: var(--fs-xs, 12px); }
/* today's select2 (POS, purchase return): the box is drawn in the selection, which grows to hold it (the POS and the
   v2 skins pin the selection's height with !important, the POS under its form's id: only while a box is shown, pc-s2,
   it grows) */
:is(#add_pos_sell_form, #edit_pos_sell_form, #purchase_return_form, body) .select2-container.pc-s2 .select2-selection--single { height: auto !important; min-height: 34px; align-items: flex-start; }
:is(#add_pos_sell_form, #edit_pos_sell_form, #purchase_return_form, body) .select2-container.pc-s2 .select2-selection--single .select2-selection__rendered { white-space: normal !important; overflow: visible !important; text-overflow: clip; line-height: 1.35 !important; height: auto !important; margin: 0 !important; padding-block: 6px !important; padding-inline: 0 24px !important; flex: 1 1 auto; min-width: 0; }
.select2-container.pc-s2 .pc-box { gap: 2px; }
.input-group:has(.select2-container.pc-s2) > .input-group-btn { align-self: flex-start; }
/* the field's decorative person icon would sit over the name: the box says who it is */
.input-group:has(> .select2-container.pc-s2) > .input-group-addon { display: none; }
.pc-hist-btn[hidden] { display: none !important; }
/* the POS: its customer column is a third of the cart pane; with a box in it, the customer and the product search each
   take the full row (the search stays where the focus is) */
:is(#add_pos_sell_form, #edit_pos_sell_form) .row:has(> [class*="col-"] .select2-container.pc-s2) > [class*="col-"] { width: 100%; max-width: 100%; flex: 0 0 100%; float: none; }
/* a phone: the field's buttons take a row of their own above the box, so the box has the full width (nothing under it) */
@media (max-width: 575px) {
  .input-group:has(> .select2-container.pc-s2) { flex-wrap: wrap; row-gap: 6px; }
  :is(#add_pos_sell_form, #edit_pos_sell_form, #purchase_return_form, body) .input-group:has(> .select2-container.pc-s2) > .select2-container { order: 2; flex: 1 1 100% !important; width: 100% !important; }
  .input-group:has(> .select2-container.pc-s2) > .input-group-btn { order: 1; }
}

/* ---------- the History side panel ---------- */
.pc-scrim { position: fixed; inset: 0; background: var(--ui-scrim, rgba(16, 24, 20, .35)); z-index: var(--z-scrim, 1046); }
.pc-drawer { position: fixed; inset-block: 0; inset-inline-end: 0; width: min(440px, 100vw); background: var(--ui-surface, #fff); color: var(--ui-ink, #1f2328); z-index: var(--z-drawer, 1047); display: flex; flex-direction: column; box-shadow: var(--ui-shadow-modal, 0 20px 50px rgba(0, 0, 0, .2)); font-size: var(--fs-base, 14px); }
.pc-drawer-head { display: flex; align-items: center; gap: 10px; padding: 10px 8px 10px 16px; padding-inline: 16px 8px; border-bottom: 1px solid var(--ui-line, #d5dbd8); }
.pc-drawer-head h2 { flex: 1; margin: 0; font-size: var(--fs-lg, 17px); font-weight: var(--fw-semibold, 600); color: var(--ui-heading, #14201b); overflow-wrap: anywhere; }
.pc-x { width: 44px; height: 44px; border: 0; background: none; font-size: 24px; line-height: 1; color: var(--ui-muted, #5f6b66); border-radius: var(--r-md, 8px); cursor: pointer; }
.pc-x:hover, .pc-x:focus-visible { background: var(--ui-hover, #eef2f0); }
.pc-drawer-body { flex: 1; overflow: auto; padding: 12px 16px; display: grid; gap: 18px; align-content: start; }
.pc-drawer-body h3 { margin: 0 0 4px; font-size: var(--fs-md, 15px); font-weight: var(--fw-semibold, 600); color: var(--ui-heading, #14201b); }
.pc-list { list-style: none; margin: 0; padding: 0; }
.pc-row { padding: 8px 0; border-bottom: 1px solid var(--ui-line-soft, #e3e7e5); }
.pc-row-main { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: var(--fw-semibold, 600); }
.pc-row-main a { color: var(--ui-brand-ink, #0f5c3a); }
.pc-amt { unicode-bidi: isolate; white-space: nowrap; }
.pc-row-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; font-size: var(--fs-sm, 13px); color: var(--ui-muted, #5f6b66); }
.pc-row-sub b { color: var(--ui-ink, #1f2328); unicode-bidi: isolate; }
.pc-pill { padding: 0 8px; border-radius: var(--r-pill, 999px); font-size: var(--fs-xs, 12px); font-weight: var(--fw-semibold, 600); }
.pc-pill.is-ok { color: var(--ui-ok, #1e7a4c); background: var(--ui-ok-wash, #e8f5ee); }
.pc-pill.is-due { color: var(--ui-warn-ink, #8a5a00); background: var(--ui-warn-wash, #fff4dc); }
.pc-hnote { margin: 0; font-size: var(--fs-sm, 13px); color: var(--ui-muted, #5f6b66); background: var(--ui-surface-2, #f6f7f6); padding: 6px 10px; border-radius: var(--r-md, 8px); }
.pc-hnote.is-error { color: var(--ui-error, #b42318); background: var(--ui-error-wash, #fdecea); }
.pc-hempty { margin: 0; color: var(--ui-muted, #5f6b66); }
.pc-loading { height: 120px; border-radius: var(--r-md, 8px); background: var(--ui-surface-2, #f6f7f6); }
.pc-drawer-foot { padding: 12px 16px; border-top: 1px solid var(--ui-line, #d5dbd8); }
.pc-drawer-foot:empty { display: none; }
/* rules 11/39: on a touch screen the box's and the panel's buttons and links are 44px tall (.is-primary named too: its own
   40px rule is more specific, A2 P2) */
@media (hover: none) and (pointer: coarse) { .pc-btn, .pc-btn.is-primary, .pc-val a, .pc-fix, .pc-row-main a { min-height: 44px; display: inline-flex; align-items: center; } }
