
/* ════════════════════════════════════════════════════════════
   FINANCE MODULE — Vendors · Customers · Notifications · Settings
   Prefix: fm-  cust-  notif-  fset-  dr-
════════════════════════════════════════════════════════════ */

/* ── Shared: NPR equivalent sub-label ── */
.fm-npr { font-size: 11px; color: var(--ink4); margin-left: 4px; font-weight: 400; }

/* ── Shared: status badges ── */
.fm-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 99px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.fm-badge::before { content:''; width:5px; height:5px; border-radius:50%; background:currentColor; }
.fm-badge--green  { background:var(--gdim); color:var(--green); }
.fm-badge--amber  { background:var(--adim); color:var(--amber); }
.fm-badge--red    { background:var(--rdim); color:var(--red); }
.fm-badge--gray   { background:var(--bg2);  color:var(--ink3); }
.fm-badge--blue   { background:var(--bdim); color:var(--blue); }

/* ── Shared: row highlights ── */
.fm-row--amber { border-left: 3px solid var(--amber) !important; }
.fm-row--red   { border-left: 3px solid var(--red)   !important; }

/* ── Shared: data table ── */
.fm-table-wrap { overflow-x: auto; }
.fm-table {
  width: 100%; border-collapse: collapse;
  font-size: 13.5px; color: var(--ink);
}
.fm-table th {
  padding: 9px 12px; text-align: left;
  font-size: 11px; font-weight: 700; color: var(--ink3);
  text-transform: uppercase; letter-spacing: .5px;
  background: var(--s2); border-bottom: 1px solid var(--bd);
  white-space: nowrap;
}
.fm-table td { padding: 10px 12px; border-bottom: 1px solid var(--bg2); vertical-align: middle; }
.fm-table tbody tr:last-child td { border-bottom: none; }
.fm-row { transition: background .1s; }
.fm-row:hover td { background: var(--s2); }
.fm-name    { font-weight: 700; color: var(--ink); }
.fm-cat     { font-size: 12.5px; color: var(--ink3); }
.fm-country { font-size: 11.5px; color: var(--ink4); display: block; }
.fm-cell-amt     { font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.fm-cell-dates   { font-size: 12.5px; color: var(--ink2); white-space: nowrap; }
.fm-cell-actions { white-space: nowrap; }
.fm-empty-cell   { padding: 0 !important; }
.fm-muted    { font-size: 12.5px; color: var(--ink4); }
.fm-muted-sm { font-size: 12px; color: var(--ink4); padding: 6px 0; }
.fm-tag {
  display: inline-block; padding: 1px 6px; border-radius: 4px;
  font-size: 10px; font-weight: 700; background: var(--bg2);
  color: var(--ink3); text-transform: uppercase; margin-left: 4px;
}

/* ── Amount colouring ── */
.fm-amt--red   { color: var(--red);   font-weight: 700; }
.fm-amt--amber { color: var(--amber); font-weight: 700; }
.fm-amt--green { color: var(--green); font-weight: 700; }

/* ── Expiry / days chip ── */
.fm-chip {
  display: inline-block; padding: 1px 7px; border-radius: 99px;
  font-size: 10.5px; font-weight: 700; margin-left: 5px;
}
.fm-chip.amber { background: var(--adim); color: var(--amber); }
.fm-chip.red   { background: var(--rdim); color: var(--red); }

/* ── Billing type pill ── */
.fm-billing-pill {
  display: inline-block; padding: 2px 9px; border-radius: 5px;
  font-size: 11.5px; font-weight: 600;
  background: var(--bg2); color: var(--ink3);
}
.fm-billing-pill.recurring { background: var(--gdim); color: var(--green); }
.fm-billing-pill.irregular { background: var(--adim); color: var(--amber); }
.fm-billing-pill.one-time  { background: var(--bdim); color: var(--blue); }
.fm-billing-pill.milestone { background: var(--vdim); color: var(--violet); }
.fm-billing-pill.retainer  { background: var(--cdim); color: var(--cyan); }

/* ── Delete button tint ── */
.fm-btn-del               { color: var(--red) !important; }
.fm-btn-del:hover         { background: var(--red) !important; color: #fff !important; }

/* ── Service chips ── */
.fm-svcs { display: flex; flex-wrap: wrap; gap: 4px; }
.fm-svc-chip {
  display: inline-block; padding: 2px 8px; border-radius: 5px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
  background: var(--bdim); color: var(--blue);
}
.fm-svc-chip.more { background: var(--bg2); color: var(--ink4); }

/* ── Filters bar ── */
.fm-filters {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
  padding: 12px 16px; background: var(--s2);
  border-bottom: 1px solid var(--bd);
}
.fm-filters .filter-group { display: flex; flex-direction: column; gap: 3px; }
.fm-filters .filter-lbl {
  font-size: 10.5px; font-weight: 700; color: var(--ink3);
  text-transform: uppercase; letter-spacing: .4px;
}
.fm-filters .fsel, .fm-filters .finp-sm {
  padding: 6px 10px; border: 1.5px solid var(--bd); border-radius: var(--rsm);
  font-size: 13px; color: var(--ink); background: var(--white);
  font-family: var(--sans); outline: none; transition: border-color .15s; min-width: 130px;
}
.fm-filters .finp-sm { min-width: 190px; }
.fm-filters .fsel:focus, .fm-filters .finp-sm:focus { border-color: var(--blue2); }

/* ════════ CUSTOMER ROW clickable ════════ */
.cust-row { cursor: pointer; }

/* ════════ SHARED DRAWER BASE ════════ */
.fin-drawer {
  position: fixed; top: var(--th); right: 0; bottom: 0;
  width: 560px; max-width: 100vw;
  background: var(--white); box-shadow: var(--shl);
  border-left: 1.5px solid var(--bd);
  display: flex; flex-direction: column;
  transform: translateX(105%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  z-index: 50; overflow: hidden;
}
.fin-drawer.open { transform: translateX(0); }

.fin-drawer-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(13,27,62,.4); z-index: 49;
  backdrop-filter: blur(2px);
}
.fin-drawer-backdrop.open { display: block; }

/* Topbar */
.fin-drawer-topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px; height: 54px; flex-shrink: 0;
  background: linear-gradient(135deg, #0d1b3e 0%, #122c53 100%);
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.fin-drawer-back {
  width: 28px; height: 28px; background: rgba(255,255,255,.1); border: none;
  border-radius: var(--rsm); cursor: pointer; color: rgba(255,255,255,.7);
  display: grid; place-items: center; font-size: 17px; transition: all .15s; flex-shrink: 0;
}
.fin-drawer-back:hover { background: rgba(255,255,255,.18); color: #fff; }
.fin-drawer-title { flex: 1; font-size: 14px; font-weight: 700; color: #fff; }
.fin-drawer-actions { display: flex; gap: 6px; }

/* Hero strip */
.fin-drawer-hero {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 22px 16px;
  background: linear-gradient(135deg, #f8faff 0%, #eef3ff 100%);
  border-bottom: 1px solid var(--bd);
  flex-shrink: 0;
}
.fin-drawer-avatar {
  width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--blue), var(--blue2));
  color: #fff; display: grid; place-items: center;
  font-size: 22px; font-weight: 800;
  box-shadow: 0 4px 12px rgba(36,96,224,.3);
}
.fin-drawer-hero-info { flex: 1; min-width: 0; }
.fin-drawer-hero-name { font-size: 20px; font-weight: 800; color: var(--ink); line-height: 1.2; }
.fin-drawer-hero-sub  { font-size: 13px; color: var(--ink3); margin-top: 3px; }
.fin-drawer-hero-badge { flex-shrink: 0; }

/* Body / scroll */
.fin-drawer-body { flex: 1; overflow-y: auto; }
.fin-drawer-body::-webkit-scrollbar { width: 5px; }
.fin-drawer-body::-webkit-scrollbar-track { background: transparent; }
.fin-drawer-body::-webkit-scrollbar-thumb { background: var(--bd2); border-radius: 99px; }

/* Section */
.fin-dr-section {
  padding: 18px 22px;
  border-bottom: 1px solid var(--bg2);
}
.fin-dr-section:last-child { border-bottom: none; }
.fin-dr-sec-hd {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.fin-dr-sec-title {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .8px; color: var(--ink4);
  display: flex; align-items: center; gap: 6px;
}
.fin-dr-sec-title::before {
  content: ''; width: 3px; height: 13px; border-radius: 99px;
  background: var(--blue); display: inline-block;
}

/* Grid of info fields */
.fin-dr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fin-dr-field { display: flex; flex-direction: column; gap: 3px; }
.fin-dr-field-lbl {
  font-size: 10px; font-weight: 700; color: var(--ink4);
  text-transform: uppercase; letter-spacing: .5px;
}
.fin-dr-field-val {
  font-size: 13.5px; color: var(--ink); font-weight: 500; line-height: 1.4;
}
.fin-dr-field-val a { color: var(--blue); }

/* Payment progress bar */
.fin-dr-progress { margin-top: 2px; }
.fin-dr-prog-bar  { height: 8px; background: var(--bg2); border-radius: 99px; overflow: hidden; margin-bottom: 6px; }
.fin-dr-prog-fill { height: 100%; background: linear-gradient(90deg, var(--green), var(--green2)); border-radius: 99px; transition: width .5s; }
.fin-dr-prog-row  { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink3); }

/* Amount trio cards */
.fin-dr-amounts {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 14px;
}
.fin-dr-amt-card {
  background: var(--bg); border: 1px solid var(--bd); border-radius: var(--r);
  padding: 10px 12px; display: flex; flex-direction: column; gap: 3px;
}
.fin-dr-amt-card-lbl { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--ink4); }
.fin-dr-amt-card-val { font-size: 15px; font-weight: 800; font-family: var(--mono); color: var(--ink); }
.fin-dr-amt-card-val.green  { color: var(--green); }
.fin-dr-amt-card-val.amber  { color: var(--amber); }
.fin-dr-amt-card-val.red    { color: var(--red); }

/* History rows */
.fin-dr-hist-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; background: var(--bg); border: 1px solid var(--bd);
  border-radius: var(--r); margin-bottom: 6px; transition: background .1s;
}
.fin-dr-hist-row:hover { background: var(--bdim); }
.fin-dr-hist-date { font-size: 12.5px; color: var(--ink3); white-space: nowrap; min-width: 90px; }
.fin-dr-hist-amt  { font-family: var(--mono); font-weight: 700; color: var(--green); font-size: 13.5px; flex: 1; }
.fin-dr-hist-note { font-size: 12px; color: var(--ink4); flex: 2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fin-dr-del-btn {
  width: 24px; height: 24px; background: none; border: none;
  border-radius: var(--rsm); cursor: pointer; color: var(--ink4);
  display: grid; place-items: center; font-size: 14px;
  transition: all .15s; flex-shrink: 0;
}
.fin-dr-del-btn:hover { background: var(--rdim); color: var(--red); }

/* Invoice rows */
.fin-dr-inv-row {
  display: grid; grid-template-columns: auto 1fr auto auto;
  align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--bg); border: 1px solid var(--bd);
  border-radius: var(--r); margin-bottom: 6px;
}
.fin-dr-inv-status  { display: flex; flex-direction: column; gap: 4px; }
.fin-dr-inv-amt     { font-family: var(--mono); font-weight: 700; font-size: 14px; color: var(--ink); }
.fin-dr-inv-actions { display: flex; gap: 4px; align-items: center; }

/* Notes box */
.fin-dr-notes {
  font-size: 13px; color: var(--ink2); line-height: 1.65;
  background: var(--bg); padding: 12px 14px; border-radius: var(--r);
  border: 1px solid var(--bd);
}

/* ════════ CUSTOMER DRAWER (alias to fin-drawer) ════════ */
.cust-drawer {
  position: fixed; top: var(--th); right: 0; bottom: 0;
  width: 560px; max-width: 100vw;
  background: var(--white); box-shadow: var(--shl);
  border-left: 1.5px solid var(--bd);
  display: flex; flex-direction: column;
  transform: translateX(105%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  z-index: 50; overflow: hidden;
}
.cust-drawer.open { transform: translateX(0); }

.cust-drawer-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(13,27,62,.4); z-index: 49;
  backdrop-filter: blur(2px);
}
.cust-drawer-backdrop.open { display: block; }

.cust-drawer-topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px; height: 54px; flex-shrink: 0;
  background: linear-gradient(135deg, #0d1b3e 0%, #122c53 100%);
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.cust-drawer-label { font-size: 14px; font-weight: 700; color: #fff; flex: 1; }
.cust-drawer-close {
  width: 28px; height: 28px; background: rgba(255,255,255,.1); border: none;
  border-radius: var(--rsm); cursor: pointer; color: rgba(255,255,255,.8);
  display: grid; place-items: center; font-size: 18px; transition: all .15s;
}
.cust-drawer-close:hover { background: rgba(255,255,255,.2); color: #fff; }

#cust-drawer-body { flex: 1; overflow-y: auto; padding-bottom: 28px; }
#cust-drawer-body::-webkit-scrollbar { width: 5px; }
#cust-drawer-body::-webkit-scrollbar-thumb { background: var(--bd2); border-radius: 99px; }

/* Legacy selectors kept for backward compat inside drawer HTML */
.cust-dr-hd { padding: 18px 22px 16px; border-bottom: 1px solid var(--bg2); background: linear-gradient(135deg,#f8faff,#eef3ff); }
.cust-dr-name { font-size: 20px; font-weight: 800; color: var(--ink); }
.cust-dr-meta { font-size: 13px; color: var(--ink3); margin-top: 3px; }

.cust-dr-section { padding: 18px 22px; border-bottom: 1px solid var(--bg2); }
.cust-dr-section:last-child { border-bottom: none; }
.cust-dr-sec-title {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .8px; color: var(--ink4); margin-bottom: 12px;
  display: flex; align-items: center; gap: 6px;
}
.cust-dr-sec-title::before {
  content: ''; width: 3px; height: 13px; border-radius: 99px;
  background: var(--blue); display: inline-block;
}
.cust-dr-sec-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cust-dr-sec-hd .cust-dr-sec-title { margin-bottom: 0; }

.cust-dr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cust-dr-field { display: flex; flex-direction: column; gap: 3px; }
.cust-dr-field-lbl { font-size: 10px; font-weight: 700; color: var(--ink4); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 2px; }
.cust-dr-field-val { font-size: 13.5px; color: var(--ink); line-height: 1.45; font-weight: 500; }
.cust-dr-field-val a { color: var(--blue); }
.cust-dr-notes { font-size: 13px; color: var(--ink2); line-height: 1.65; background: var(--bg); padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--bd); }

/* Amount trio */
.cust-amounts-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.cust-amt-card { background: var(--bg); border: 1px solid var(--bd); border-radius: var(--r); padding: 10px 12px; }
.cust-amt-card-lbl { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--ink4); margin-bottom: 4px; }
.cust-amt-card-val { font-size: 15px; font-weight: 800; font-family: var(--mono); color: var(--ink); }
.cust-amt-card-val.green { color: var(--green); }
.cust-amt-card-val.amber { color: var(--amber); }
.cust-amt-card-val.red   { color: var(--red); }

/* Payment progress */
.cust-progress-wrap { margin-top: 2px; }
.cust-progress-bar  { height: 8px; background: var(--bg2); border-radius: 99px; overflow: hidden; }
.cust-progress-fill { height: 100%; background: linear-gradient(90deg, var(--green), var(--green2)); border-radius: 99px; transition: width .5s; }
.cust-progress-lbl  { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink3); margin-top: 6px; }

/* Contract cards */
.cust-ctr-card { background: var(--s2); border: 1px solid var(--bd); border-radius: var(--r); padding: 12px; margin-bottom: 8px; }
.cust-ctr-top  { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; gap: 8px; }
.cust-ctr-name { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.cust-ctr-desc { font-size: 12px; color: var(--ink3); margin-bottom: 6px; line-height: 1.5; }
.cust-ctr-meta { font-size: 11.5px; color: var(--ink4); }
.cust-ctr-actions { margin-top: 8px; display: flex; gap: 6px; }

/* Milestones */
.cust-ms-list { display: flex; flex-direction: column; gap: 6px; }
.cust-ms-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; background: var(--s2);
  border: 1px solid var(--bd); border-radius: var(--r);
}
.cust-ms-row.overdue { border-left: 3px solid var(--red); background: var(--rdim); }
.cust-ms-check {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--bd2); display: grid; place-items: center;
  font-size: 11px; color: #fff;
}
.cust-ms-check.done { background: var(--green); border-color: var(--green); }
.cust-ms-body { flex: 1; min-width: 0; }
.cust-ms-name { font-size: 13px; font-weight: 600; color: var(--ink); }
.cust-ms-meta { font-size: 11.5px; color: var(--ink3); margin-top: 2px; }

/* Payment history */
.cust-pay-list { display: flex; flex-direction: column; gap: 4px; }
.cust-pay-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; background: var(--s2); border-radius: var(--rsm); font-size: 13px;
}
.cust-pay-date { color: var(--ink3); white-space: nowrap; min-width: 95px; }
.cust-pay-amt  { font-family: var(--mono); font-weight: 700; color: var(--green); white-space: nowrap; }
.cust-pay-note { color: var(--ink4); font-size: 12px; flex: 1; }

/* Invoices */
.cust-inv-list { display: flex; flex-direction: column; gap: 6px; }
.cust-inv-row {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  padding: 8px 12px; background: var(--s2); border: 1px solid var(--bd); border-radius: var(--r);
}
.cust-inv-meta    { display: flex; align-items: center; gap: 8px; }
.cust-inv-date    { font-size: 12.5px; color: var(--ink3); }
.cust-inv-amt     { font-family: var(--mono); font-weight: 700; color: var(--ink); flex: 1; }
.cust-inv-actions { display: flex; gap: 4px; }

/* Inline add forms */
.dr-inline-form {
  background: var(--bg); border: 1px solid var(--bd);
  border-radius: var(--r); padding: 12px; margin-bottom: 10px;
}
.dr-inline-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.dr-inline-actions { display: flex; justify-content: flex-end; gap: 6px; }

/* ════════ NOTIFICATION BELL (topbar) ════════ */
.notif-bell-wrap { position: relative; }

.notif-bell-btn {
  width: 34px; height: 34px; background: none;
  border: 1.5px solid var(--bd); border-radius: var(--rsm);
  cursor: pointer; display: grid; place-items: center;
  color: var(--ink3); transition: all .15s; position: relative;
}
.notif-bell-btn:hover { background: var(--bg2); border-color: var(--bd2); color: var(--ink); }
.notif-bell-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.notif-badge {
  position: absolute; top: -5px; right: -5px;
  min-width: 16px; height: 16px; border-radius: 99px;
  background: var(--blue); color: #fff;
  font-size: 9px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px; pointer-events: none; border: 2px solid var(--white);
}
.notif-badge.critical { background: var(--red); }

/* Dropdown panel */
.notif-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 340px; background: var(--white);
  border: 1px solid var(--bd); border-radius: var(--rlg);
  box-shadow: var(--shl); z-index: 200;
  display: none; flex-direction: column; overflow: hidden;
}
.notif-dropdown.open { display: flex; }

.notif-dd-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px 10px; border-bottom: 1px solid var(--bg2);
}
.notif-dd-title { font-size: 13px; font-weight: 800; color: var(--ink); }
.notif-dd-all { font-size: 11.5px; color: var(--blue); cursor: pointer; background: none; border: none; font-family: var(--sans); }
.notif-dd-all:hover { text-decoration: underline; }

#notif-list-wrap { max-height: 360px; overflow-y: auto; }
.notif-empty { padding: 24px; text-align: center; font-size: 13px; color: var(--ink4); }

.notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px; cursor: pointer; transition: background .1s;
  border-bottom: 1px solid var(--bg2);
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--s2); }
.notif-item.read  { opacity: .6; }

.notif-ico            { font-size: 15px; flex-shrink: 0; padding-top: 1px; }
.notif-ico--critical  { color: var(--red); }
.notif-ico--warning   { color: var(--amber); }
.notif-ico--info      { color: var(--blue); }

.notif-item-body { flex: 1; min-width: 0; }
.notif-item-name { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.notif-item-msg  { font-size: 12px; color: var(--ink2); margin-top: 2px; line-height: 1.4; }
.notif-item-time { font-size: 10.5px; color: var(--ink4); margin-top: 3px; }

.notif-item-btns { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

.notif-check {
  background: none; border: 1.5px solid var(--bd2); border-radius: 50%;
  width: 20px; height: 20px; flex-shrink: 0; cursor: pointer;
  display: grid; place-items: center; font-size: 11px; color: var(--ink3);
  transition: all .15s; margin-top: 1px;
}
.notif-check:hover { background: var(--green); border-color: var(--green); color: #fff; }

.notif-dismiss {
  background: none; border: 1.5px solid var(--bd2); border-radius: 50%;
  width: 20px; height: 20px; flex-shrink: 0; cursor: pointer;
  display: grid; place-items: center; font-size: 13px; color: var(--ink3);
  transition: all .15s; margin-top: 1px; line-height: 1;
}
.notif-dismiss:hover { background: var(--red, #e53935); border-color: var(--red, #e53935); color: #fff; }

.notif-dd-footer { padding: 10px 14px; border-top: 1px solid var(--bg2); text-align: center; font-size: 12px; }
.notif-dd-footer a { color: var(--blue); cursor: pointer; }
.notif-dd-footer a:hover { text-decoration: underline; }

/* Full page notifications */
.notif-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; background: var(--white);
  border: 1px solid var(--bd); border-radius: var(--r);
  margin-bottom: 8px; transition: box-shadow .15s;
}
.notif-row:hover { box-shadow: var(--shm); }
.notif-row.read  { opacity: .6; }
.notif-row--critical { border-left: 3px solid var(--red); }
.notif-row--warning  { border-left: 3px solid var(--amber); }

.notif-row-sev     { font-size: 18px; flex-shrink: 0; padding-top: 1px; }
.notif-row-body    { flex: 1; min-width: 0; }
.notif-row-name    { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 3px; }
.notif-row-msg     { font-size: 13px; color: var(--ink2); }
.notif-row-time    { font-size: 11.5px; color: var(--ink4); margin-top: 4px; }
.notif-row-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.notif-read-lbl    { font-size: 11px; color: var(--ink4); }
.notif-empty-page  { text-align: center; padding: 48px 20px; }

/* ════════ FINANCE SETTINGS PAGE ════════ */
.fset-card { max-width: none; }
.fset-section-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--ink3);
  padding: 14px 18px 6px; border-top: 1px solid var(--bg2); margin: 0;
}
.fset-section-title:first-child { border-top: none; }
.fset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 16px; padding: 4px 18px 10px; }
.fset-grid .fg { padding: 8px 0 0; }
.fset-live-rate { font-size: 11px; color: var(--ink4); margin-top: 3px; }
.fset-err { font-size: 12px; color: var(--red); min-height: 16px; padding: 0 18px 6px; }
.fset-actions { padding: 14px 18px 18px; display: flex; gap: 8px; border-top: 1px solid var(--bg2); }

/* ════════ DASHBOARD FINANCE WIDGET ════════ */
.fin-widget { background: var(--white); border: 1px solid var(--bd); border-radius: var(--rlg); padding: 16px 18px; box-shadow: var(--sh); }
.fin-widget-title { font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.fin-widget-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0; border-bottom: 1px solid var(--bg2); font-size: 13px;
}
.fin-widget-row:last-child { border-bottom: none; }
.fin-widget-lbl { color: var(--ink3); }
.fin-widget-val { font-weight: 700; font-family: var(--mono); color: var(--ink); }
.fin-widget-val.red   { color: var(--red); }
.fin-widget-val.amber { color: var(--amber); }
.fin-widget-val.green { color: var(--green); }

/* ════════ WIDE MODAL (customer form) ════════ */
.modal-wide {
  width: min(600px, 95vw);
  max-height: min(90vh, 720px);
  display: flex;
  flex-direction: column;
}
.modal-body { flex: 1; overflow-y: auto; min-height: 0; }
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; }
.modal-grid .fg { padding-bottom: 2px; }
.modal-grid .fg-wide { grid-column: 1 / -1; }

/* ════════ RESPONSIVE ════════ */
@media (max-width: 1024px) {
  .fin-widget { display: none; }
}
@media (max-width: 768px) {
  .cust-drawer { width: 100vw; }
  .cust-dr-grid { grid-template-columns: 1fr; }
  .dr-inline-grid { grid-template-columns: 1fr; }
  .fset-grid { grid-template-columns: 1fr; }
  .notif-dropdown { width: 290px; right: -40px; }
  .modal-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .modal-grid { grid-template-columns: 1fr; }
}

/* ════════ PROJECT TASKS (inside contract cards) ════════ */
.cust-tasks-section { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--bg2); }
.cust-tasks-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cust-tasks-lbl { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--ink4); }

.cust-task-list { display: flex; flex-direction: column; gap: 4px; }
.cust-task-row {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 7px 10px; background: var(--white);
  border: 1px solid var(--bd); border-radius: var(--rsm); font-size: 12.5px;
}
.cust-task-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 4px;
  background: var(--bd2);
}
.cust-task-dot.in_progress { background: var(--blue); }
.cust-task-dot.done { background: var(--green); }
.cust-task-body { flex: 1; min-width: 0; }
.cust-task-name { font-weight: 600; color: var(--ink); line-height: 1.3; }
.cust-task-name--done { text-decoration: line-through; opacity: .55; }
.cust-task-meta { font-size: 11px; color: var(--ink4); margin-top: 2px; display: flex; flex-wrap: wrap; gap: 6px; }
.cust-task-actions { display: flex; gap: 3px; flex-shrink: 0; }

/* task priority mini-badge */
.task-pri {
  display: inline-block; padding: 0 5px; border-radius: 4px;
  font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px;
}
.task-pri--low    { background: var(--bg2);  color: var(--ink4); }
.task-pri--medium { background: var(--adim); color: var(--amber); }
.task-pri--high   { background: var(--rdim); color: var(--red); }

/* task status mini-badge */
.task-st {
  display: inline-block; padding: 0 5px; border-radius: 4px;
  font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px;
}
.task-st--todo        { background: var(--bg2);  color: var(--ink3); }
.task-st--in_progress { background: var(--bdim); color: var(--blue); }
.task-st--done        { background: var(--gdim); color: var(--green); }

/* ════════ DRAWER SIGNED-BY HIGHLIGHT ════════ */
.cust-dr-signed { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--blue); background: var(--bdim); padding: 2px 8px; border-radius: 99px; }

/* ════════ VENDOR CARDS ════════ */
.vnd-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px; padding: 16px;
}
.vnd-card {
  background: var(--white); border: 1.5px solid var(--bd);
  border-radius: var(--rlg); padding: 16px;
  cursor: pointer; transition: box-shadow .15s, border-color .15s;
  display: flex; flex-direction: column; gap: 10px;
}
.vnd-card:hover { box-shadow: var(--shm); border-color: var(--bd2); }
.vnd-card--expiring { border-left: 3px solid var(--amber); }
.vnd-card--expired  { border-left: 3px solid var(--red); }
.vnd-card-top { display: flex; align-items: flex-start; gap: 11px; }
.vnd-card-avatar {
  width: 40px; height: 40px; border-radius: var(--r);
  background: var(--bdim); color: var(--blue);
  display: grid; place-items: center;
  font-size: 17px; font-weight: 800; flex-shrink: 0; text-transform: uppercase;
}
.vnd-card-info { flex: 1; min-width: 0; }
.vnd-card-name { font-size: 14.5px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vnd-card-cat  { font-size: 12px; color: var(--ink3); margin-top: 2px; }
.vnd-card-svcs { display: flex; flex-wrap: wrap; gap: 4px; }
.vnd-card-footer {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 8px;
  padding-top: 8px; border-top: 1px solid var(--bg2);
}
.vnd-card-amt     { font-family: var(--mono); font-size: 14px; font-weight: 700; color: var(--ink); }
.vnd-card-billing { font-size: 11px; color: var(--ink4); margin-top: 2px; }
.vnd-card-expiry  { font-size: 11px; color: var(--ink4); text-align: right; }
.vnd-card-actions { display: flex; gap: 5px; justify-content: flex-end; }

/* ════════ VENDOR DRAWER ════════ */
.vnd-drawer {
  position: fixed; top: var(--th); right: 0; bottom: 0;
  width: 560px; max-width: 100vw;
  background: var(--white); box-shadow: var(--shl);
  border-left: 1.5px solid var(--bd);
  display: flex; flex-direction: column;
  transform: translateX(105%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  z-index: 50; overflow: hidden;
}
.vnd-drawer.open { transform: translateX(0); }
.vnd-drawer-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(13,27,62,.4); z-index: 49;
  backdrop-filter: blur(2px);
}
.vnd-drawer-backdrop.open { display: block; }
.vnd-drawer-topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px; height: 54px; flex-shrink: 0;
  background: linear-gradient(135deg, #0d1b3e 0%, #122c53 100%);
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.vnd-drawer-label { font-size: 14px; font-weight: 700; color: #fff; flex: 1; }
.vnd-drawer-close {
  width: 28px; height: 28px; background: rgba(255,255,255,.1); border: none;
  border-radius: var(--rsm); cursor: pointer; color: rgba(255,255,255,.8);
  display: grid; place-items: center; font-size: 18px; transition: all .15s;
}
.vnd-drawer-close:hover { background: rgba(255,255,255,.2); color: #fff; }
#vnd-drawer-body { flex: 1; overflow-y: auto; padding-bottom: 28px; }
#vnd-drawer-body::-webkit-scrollbar { width: 5px; }
#vnd-drawer-body::-webkit-scrollbar-thumb { background: var(--bd2); border-radius: 99px; }

/* ════════ CUSTOMER CARDS ════════ */
.cust-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px; padding: 16px;
}
.cust-card {
  background: var(--white); border: 1.5px solid var(--bd);
  border-radius: var(--rlg); padding: 16px;
  cursor: pointer; transition: box-shadow .15s, border-color .15s;
  display: flex; flex-direction: column; gap: 10px;
}
.cust-card:hover { box-shadow: var(--shm); border-color: var(--bd2); }
.cust-card--overdue { border-left: 3px solid var(--red); }
.cust-card--due     { border-left: 3px solid var(--amber); }
.cust-card-top  { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.cust-card-name { font-size: 15px; font-weight: 700; color: var(--ink); }
.cust-card-meta { font-size: 12px; color: var(--ink3); margin-top: 2px; }
.cust-card-svcs { display: flex; flex-wrap: wrap; gap: 4px; }
.cust-card-progress { margin-top: 2px; }
.cust-card-prog-bar  { height: 6px; background: var(--bg2); border-radius: 99px; overflow: hidden; }
.cust-card-prog-fill { height: 100%; background: linear-gradient(90deg, var(--green2), var(--cyan2)); border-radius: 99px; transition: width .4s; }
.cust-card-prog-lbl  { font-size: 11px; color: var(--ink3); margin-top: 4px; display: flex; justify-content: space-between; }
.cust-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 8px; border-top: 1px solid var(--bg2); gap: 8px;
}
.cust-card-due-lbl { font-size: 12px; color: var(--ink4); }
.cust-card-due-lbl.overdue { color: var(--red); font-weight: 700; }
.cust-card-actions { display: flex; gap: 5px; }

/* ════════ PROOF / FILE UPLOAD ════════ */
.inv-proof-row { grid-column: 1 / -1; }
.inv-proof-input { display: none; }
.inv-proof-label {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border: 1.5px dashed var(--bd2);
  border-radius: var(--rsm); cursor: pointer;
  font-size: 12.5px; color: var(--ink3); font-family: var(--sans);
  transition: border-color .15s, color .15s, background .15s;
  background: var(--bg); margin-top: 3px;
}
.inv-proof-label:hover { border-color: var(--blue2); color: var(--blue); background: var(--bdim); }
.inv-proof-name { font-size: 11.5px; color: var(--green); margin-top: 4px; font-weight: 600; }
.inv-proof-link {
  font-size: 11.5px; color: var(--blue); cursor: pointer;
  display: inline-flex; align-items: center; gap: 3px;
}
.inv-proof-link:hover { text-decoration: underline; }

/* ════════ TAG PICKER ════════ */
.tag-picker { display: flex; flex-direction: column; gap: 6px; }
.tag-picker-input-row { display: flex; gap: 6px; }
.tag-picker-input-row .finp  { flex: 1; }
.tag-picker-tags {
  display: flex; flex-wrap: wrap; gap: 5px;
  min-height: 28px;
}
.tag-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px 3px 10px; border-radius: 99px;
  font-size: 12px; font-weight: 600;
  background: var(--bdim); color: var(--blue);
  border: 1px solid var(--blue3);
}
.tag-pill-del {
  width: 14px; height: 14px; border: none; background: none;
  cursor: pointer; display: grid; place-items: center;
  color: var(--blue3); font-size: 13px; padding: 0; line-height: 1;
  border-radius: 50%; transition: color .1s, background .1s;
}
.tag-pill-del:hover { color: var(--red); background: var(--rdim); }

/* ════════ RESPONSIVE (fin additions) ════════ */
@media (max-width: 900px) {
  .vnd-card-grid  { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); padding: 12px; }
  .cust-card-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); padding: 12px; }
}
@media (max-width: 768px) {
  .cust-drawer { width: 100vw; }
  .cust-amounts-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .vnd-drawer  { width: 100vw; }
  .vnd-card-grid  { grid-template-columns: 1fr; padding: 10px; }
  .cust-card-grid { grid-template-columns: 1fr; padding: 10px; }
  .cust-amounts-row { grid-template-columns: 1fr; }
  .fin-dr-amounts   { grid-template-columns: 1fr; }
}
