/* ── FORM GRID ───────────────────────────────────────────── */
.fg { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fg .full { grid-column: 1 / -1; }
.factions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--bd); }
.fsec-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--tx3); margin: 18px 0 10px; border-bottom: 1px solid var(--bd); padding-bottom: 5px; }

/* ── FORM FIELDS ────────────────────────────────────────── */
.f label { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--tx3); margin-bottom: 6px; }
.f input, .f select, .f textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--bd); border-radius: var(--r2);
  font-family: inherit; font-size: 14px; background: var(--s); color: var(--tx); outline: none; transition: border .15s; min-height: 40px;
}
.f input:focus, .f select:focus, .f textarea:focus { border-color: var(--ac); }
.f textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
.hint { font-size: 12px; color: var(--tx2); margin-top: 4px; display: block; }

/* ── NUMBER + SUFFIX WIDGET ─────────────────────────────── */
.nw { display: flex; align-items: center; border: 1px solid var(--bd); border-radius: var(--r2); overflow: hidden; background: var(--s); }
.nw:focus-within { border-color: var(--ac); }
.np { padding: 9px 7px 9px 10px; font-size: 14px; color: var(--tx2); white-space: nowrap; background: var(--s2); border-right: 1px solid var(--bd2); }
.nw input { border: none; background: transparent; font-family: inherit; font-size: 14px; color: var(--tx); outline: none; padding: 9px 6px; flex: 1; min-width: 0; }
.nwsuf { font-size: 14px; color: var(--tx); padding: 9px 6px; white-space: nowrap; font-weight: 500; }
.nw select { border: none; background: var(--s2); font-family: inherit; font-size: 12px; color: var(--tx2); outline: none; padding: 4px; border-left: 1px solid var(--bd2); }
.sw { display: flex; align-items: center; border: 1px solid var(--bd); border-radius: var(--r2); overflow: hidden; background: var(--s); }
.sw:focus-within { border-color: var(--ac); }
.sw input { border: none; background: transparent; font-family: inherit; font-size: 14px; color: var(--tx); outline: none; padding: 9px 10px; flex: 1; min-width: 0; }
.sfx { padding: 8px 9px; font-size: 12px; color: var(--tx2); background: var(--s2); border-left: 1px solid var(--bd2); white-space: nowrap; }

/* ── AUTOCOMPLETE ───────────────────────────────────────── */
.acw { position: relative; }
.acl { position: absolute; top: 100%; left: 0; right: 0; background: var(--s); border: 1px solid var(--bd); border-radius: var(--r2); box-shadow: var(--sh2); z-index: 50; max-height: 200px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.acl div { padding: 10px 12px; cursor: pointer; font-size: 14px; }
.acl div:hover { background: var(--s2); }

/* ── SEARCH DROPDOWN (daily log job/assist pills) ───────── */
.input-wrap { position: relative; }
.dropdown-list { position: absolute; top: 100%; left: 0; right: 0; background: var(--s); border: 1px solid var(--bd); border-radius: var(--r2); box-shadow: var(--sh2); z-index: 50; max-height: 220px; overflow-y: auto; display: none; -webkit-overflow-scrolling: touch; }
.dropdown-list.open { display: block; }
.dl-opt { padding: 10px 12px; cursor: pointer; font-size: 14px; }
.dl-opt:hover { background: var(--s2); }

/* ── TAG PILLS (multi-select inputs) ────────────────────── */
.tag-pill-wrap { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 8px; border: 1px solid var(--bd); border-radius: var(--r2); min-height: 38px; cursor: text; background: var(--s); }
.tag-pill { background: var(--acl); color: var(--ac); border-radius: 12px; padding: 3px 9px; font-size: 12px; display: flex; align-items: center; gap: 4px; }
.tag-pill button { background: none; border: none; cursor: pointer; color: var(--ac); font-size: 14px; line-height: 1; padding: 0; }

/* ── PAYMENT TERMS BUTTONS ──────────────────────────────── */
.f-ptbtn { padding: 8px 13px; border: 1px solid var(--bd); border-radius: var(--r2); font-size: 13px; cursor: pointer; background: var(--s2); color: var(--tx); font-family: inherit; transition: all .15s; font-weight: 500; }
.f-ptbtn.sel { background: var(--bll); border-color: rgba(26,92,154,.3); color: var(--bl); }

/* ── BALL IN COURT BADGES ───────────────────────────────── */
.bic-eew { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; letter-spacing: .04em; background: var(--bll); color: var(--bl); border: 1px solid rgba(26,92,154,.2); }
.bic-cust { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; letter-spacing: .04em; background: var(--ppl); color: var(--pp); border: 1px solid rgba(107,63,160,.2); }

/* ── INLINE EDIT ────────────────────────────────────────── */
.ie { cursor: pointer; border-bottom: 1px dashed var(--bd); }
.ie:hover { color: var(--ac); }

/* ── MOBILE FORMS ───────────────────────────────────────── */
@media (max-width: 600px) {
  /* iOS Safari auto-zooms when input font-size < 16px — prevent it */
  .f input, .f select, .f textarea,
  .nw input, .sw input,
  .tag-pill-wrap input { font-size: 16px; }

  /* Comfortable tap targets */
  .f input, .f select { min-height: 46px; }
  .f textarea { min-height: 90px; }
  .nw, .sw { min-height: 46px; }

  /* Autocomplete dropdowns: taller tap rows on mobile */
  .acl div, .dl-opt { padding: 13px 14px; font-size: 15px; }

  /* Payment term buttons easier to tap */
  .f-ptbtn { padding: 11px 14px; font-size: 14px; min-height: 44px; }

  /* Form section grid: single col on phone */
  .fg { grid-template-columns: 1fr; }
  .fg .full { grid-column: 1; }

  /* Actions row stacks buttons */
  .factions { flex-wrap: wrap; }
  .factions .btn { flex: 1 1 auto; justify-content: center; }

  .bic-eew, .bic-cust { font-size: 12px; padding: 3px 9px; }
}
