@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:wght@400;600;700&family=Inter:wght@300;400;500;600&display=swap');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --M: #7B1D2E;
  --ML: #9E2B40;
  --MD: #5A1220;
  --G: #B8960C;
  --GL: #D4AC0D;
  --CR: #ffffff;
  --CV: #ffffff;
  --DV: #ffffff;
  --OA: #ffffff;
  --JS: #ffffff;
  --W: #fff;
  --G50: #F9F7F3;
  --G100: #EDE9E2;
  --G200: #D4CFC4;
  --G400: #9A9488;
  --G600: #6B6560;
  --G800: #2C2A26;
  --T: #1A1816;
  --sh: 0 2px 16px rgba(0,0,0,0.09);
}

body {
  font-family: 'Inter', sans-serif;
  background: #F3EFE8;
  color: var(--T);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ===LOGIN=== */
#LS {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: radial-gradient(ellipse at 60% 40%, #8B2535 0%, #5A1220 55%, #3A0D18 100%);
  padding: 1rem;
}

.lc {
  background: var(--W);
  border-radius: 18px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.4);
}

.llogo {
  text-align: center;
  margin-bottom: 2rem;
}

.lcrest {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--M);
  border: 3px solid var(--G);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-family: 'EB Garamond', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--G);
}

.llogo h1 {
  font-family: 'EB Garamond', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--M);
  line-height: 1.3;
}

.llogo p {
  font-size: 11px;
  color: var(--G400);
  margin-top: 3px;
}

.fg {
  margin-bottom: 1.1rem;
}

.fg label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--G600);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 5px;
}

.fg input, .fg select {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--G200);
  border-radius: 8px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  background: var(--G50);
  color: var(--T);
  transition: border .2s;
}

.fg input:focus, .fg select:focus {
  outline: none;
  border-color: var(--M);
  background: var(--W);
}

.lbtn {
  width: 100%;
  padding: 12px;
  background: var(--M);
  color: var(--W);
  border: none;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

.lbtn:hover {
  background: var(--MD);
}

.add-new-btn {
  font-size: 11px;
  color: var(--M);
  background: var(--W);
  border: 1px solid var(--M);
  border-radius: 4px;
  padding: 3px 6px;
  text-decoration: none;
  margin-left: 5px;
  cursor: pointer;
  display: inline-block;
  line-height: 1.2;
  transition: all 0.2s ease;
  font-weight: 500;
}

.add-new-btn:hover {
  background: var(--M);
  color: var(--W);
}

.lerr {
  color: #c0392b;
  font-size: 12px;
  text-align: center;
  margin-top: 8px;
  display: none;
}

.lhint {
  font-size: 10px;
  color: var(--G400);
  text-align: center;
  margin-top: 1rem;
  line-height: 1.7;
}

/* ===APP=== */
#APP {
  display: none;
  min-height: 100vh;
}

.tb {
  background: var(--M);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.tbl {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tbcrest {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--G);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'EB Garamond', serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--MD);
}

.tbl h2 {
  color: var(--W);
  font-family: 'EB Garamond', serif;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}

.tbl p {
  color: rgba(255,255,255,.55);
  font-size: 10px;
}

.tbr {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ubadge {
  background: rgba(255,255,255,.15);
  padding: 4px 11px;
  border-radius: 20px;
  color: var(--W);
  font-size: 11px;
  font-weight: 500;
}

.lobtn {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.3);
  color: var(--W);
  padding: 4px 13px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 11px;
  font-family: 'Inter', sans-serif;
}

.lobtn:hover {
  background: rgba(255,255,255,.25);
}

.body {
  display: flex;
  min-height: calc(100vh - 56px);
}

.sb {
  width: 210px;
  background: var(--W);
  border-right: 1px solid var(--G100);
  padding: 1.2rem 0;
  flex-shrink: 0;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
}

.ns p {
  font-size: 10px;
  font-weight: 600;
  color: var(--G400);
  text-transform: uppercase;
  letter-spacing: .7px;
  padding: 0 1rem 5px;
  margin-top: 12px;
}

.ni {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  margin: 1px 8px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--G600);
  font-size: 12.5px;
  border: none;
  background: none;
  width: calc(100% - 16px);
  text-align: left;
  transition: all .15s;
}

.ni:hover {
  background: var(--G50);
  color: var(--T);
}

.ni.act {
  background: var(--M);
  color: var(--W);
}

.ni svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.mc {
  flex: 1;
  padding: 1.8rem;
  overflow-y: auto;
}

/* ===SECTIONS=== */
.sec {
  display: none;
}

.sec.act {
  display: block;
}

.ph {
  margin-bottom: 1rem;
}

.ph h1 {
  font-family: 'EB Garamond', serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--M);
}

.ph p {
  color: var(--G600);
  font-size: 12px;
  margin-top: 3px;
}

/* ===STATS=== */
.sg {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 1.8rem;
}

.sc {
  background: var(--W);
  border-radius: 11px;
  padding: 1.1rem;
  border: 1px solid var(--G100);
}

.sc .lbl {
  font-size: 10px;
  font-weight: 600;
  color: var(--G400);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 5px;
}

.sc .val {
  font-size: 24px;
  font-weight: 700;
  color: var(--M);
  font-family: 'EB Garamond', serif;
}

.sc .sub {
  font-size: 11px;
  color: var(--G600);
  margin-top: 2px;
}

/* ===CARD=== */
.card {
  background: var(--W);
  border-radius: 10px;
  border: 1px solid var(--G100);
  padding: 1rem;
  margin-bottom: 1rem;
}

.ch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.1rem;
}

.ct {
  font-family: 'EB Garamond', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--M);
}

/* ===VOUCHER TYPE PILLS=== */
.vtg {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: .8rem;
}

.vtc {
  background: var(--W);
  border: 1.5px solid var(--G100);
  border-radius: 8px;
  padding: .45rem .35rem;
  cursor: pointer;
  transition: all .2s;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.vtc:hover {
  border-color: var(--M);
}

.vtc.sel {
  border-color: var(--M);
  background: #FDF0F2;
}

.vtc .vi {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 3px;
  font-size: 13px;
}

.vtc .vi.vi-debit { background: #FFF3D6; }
.vtc .vi.vi-onaccount { background: #E0F2FE; }
.vtc .vi.vi-credit { background: #F1F5F9; }
.vtc .vi.vi-vendor { background: #E8EEF9; }

.vtc-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.vtc h3 {
  font-size: 11px;
  font-weight: 600;
  color: var(--T);
  margin-bottom: 1px;
  line-height: 1.2;
}

.vtc p {
  font-size: 9px;
  color: var(--G600);
  line-height: 1.2;
  margin: 0;
}

.vtc.vtc-action {
  background: #FAFBFE;
  border-color: #CBD5E1;
}

.vtc.vtc-action:hover {
  border-color: #002D72;
}

.vtc.vtc-action h3 {
  color: #002D72;
}

/* ===FORM=== */
.fr {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .6rem;
  margin-bottom: .6rem;
}

.fr.t {
  grid-template-columns: 1fr 1fr 1fr;
}

.fr.f {
  grid-template-columns: 1fr;
}

.fi label {
  display: block;
  font-size: 9.5px;
  font-weight: 600;
  color: var(--G600);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 2px;
}

.fi input, .fi select, .fi textarea {
  width: 100%;
  padding: 5px 9px;
  border: 1.5px solid var(--G200);
  border-radius: 6px;
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  background: var(--G50);
  color: var(--T);
  transition: border .2s;
}

.fi input:focus, .fi select:focus, .fi textarea:focus {
  outline: none;
  border-color: var(--M);
  background: var(--W);
}

.fi textarea {
  resize: vertical;
  min-height: 50px;
}

.fi input[readonly] {
  background: #f0ede8;
  color: #888;
}

/* ===BUTTONS=== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 16px;
  border-radius: 7px;
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
}

.bp {
  background: var(--M);
  color: var(--W);
}

.bp:hover {
  background: var(--MD);
}

.bs {
  background: var(--G100);
  color: var(--G800);
}

.bs:hover {
  background: var(--G200);
}

.bg {
  background: var(--G);
  color: #3A0D18;
}

.bg:hover {
  background: var(--GL);
}

.br, .bd {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.br:hover, .bd:hover {
  background: #fecaca;
  color: #7f1d1d;
}

.bsm {
  padding: 5px 11px;
  font-size: 11.5px;
}

.bg-btn {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: .7rem;
}

/* ===LINE ITEMS=== */
.twrap {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 500px;
  border-radius: 9px;
  border: 1px solid var(--G100);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

th {
  background: var(--M);
  color: var(--W);
  padding: 8px 12px;
  text-align: left;
  font-weight: 500;
  font-size: 11.5px;
  position: sticky;
  top: 0;
  z-index: 10;
}

td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--G100);
  color: var(--G800);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: var(--G50);
}

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 500;
}

.bc {
  background: #EEF5FF;
  color: #1B4F9E;
}

.bd {
  background: #FFF3E0;
  color: #7A3800;
}

.bo {
  background: #FCE4EC;
  color: #880E4F;
}

.oa-status {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.oa-pending {
  background: #FFF3CD;
  color: #7A5200;
  border: 1px solid #E8C968;
}

.oa-cleared {
  background: #E4F5E9;
  color: #176B36;
  border: 1px solid #9BD0AA;
}

tr.oa-cleared-row td {
  color: var(--G600);
  background: #F7FAF7;
}

.bj {
  background: #E8F5E9;
  color: #1B5E20;
}

/* ===SEARCH=== */
.sb2 {
  display: flex;
  gap: 8px;
  margin-bottom: 1.1rem;
  flex-wrap: wrap;
}

.sb2 input, .sb2 select {
  padding: 8px 12px;
  border: 1.5px solid var(--G200);
  border-radius: 7px;
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  background: var(--W);
  color: var(--T);
}

.sb2 input {
  flex: 1;
  min-width: 160px;
}

.sb2 input:focus, .sb2 select:focus {
  outline: none;
  border-color: var(--M);
}

.date-filter-field {
  position: relative;
  flex: 1 1 160px;
  min-width: 160px;
}

.date-filter-display {
  width: 100%;
  min-width: 0;
  padding-right: 38px;
  cursor: pointer;
}

.date-filter-native {
  position: absolute;
  right: 8px;
  bottom: 2px;
  width: 1px;
  height: 1px;
  min-width: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.date-filter-button {
  position: absolute;
  top: 50%;
  right: 6px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transform: translateY(-50%);
}

/* ===ANALYTICS=== */
.ag {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 1.4rem;
}

.ac {
  background: var(--W);
  border-radius: 11px;
  border: 1px solid var(--G100);
  padding: 1.2rem;
}

.ac h3 {
  font-family: 'EB Garamond', serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--M);
  margin-bottom: .9rem;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  margin-bottom: 6px;
}

.bar-lbl {
  width: 130px;
  color: var(--G600);
  text-align: right;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-trk {
  flex: 1;
  background: var(--G100);
  border-radius: 4px;
  height: 16px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding-left: 5px;
  color: var(--W);
  font-size: 9.5px;
}

.dw {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.ll {
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ld {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ===MODAL=== */
.mo {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

#PM,
#VENDOR_FILE_MODAL {
  z-index: 600;
}

.mo.h {
  display: none;
}

.md {
  background: var(--W);
  border-radius: 16px;
  width: 100%;
  max-width: 860px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,.35);
}

.mh {
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--G100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--W);
  z-index: 10;
  border-radius: 16px 16px 0 0;
}

.mh h2 {
  font-family: 'EB Garamond', serif;
  font-size: 19px;
  font-weight: 700;
  color: var(--M);
}

.mb {
  padding: 1.5rem;
}

.cbtn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--G400);
  padding: 3px;
  line-height: 1;
}

.cbtn:hover {
  color: var(--T);
}

/* ===PRINT VOUCHERS - EXACT MATCH=== */
#PA {
  background: var(--W);
  user-select: text !important;
  -webkit-user-select: text !important;
}

.pv-wrap,
.dv-print,
.oa-print,
.cv-print,
.vendor-agreement-sheet,
.vendor-ledger-sheet {
  user-select: text !important;
  -webkit-user-select: text !important;
}

.pv-wrap {
  width: 148mm;
  min-height: 100mm;
  margin: 0 auto;
  font-family: 'Inter', sans-serif;
  background: var(--W);
  position: relative;
}

/* DEBIT VOUCHER - white */
.dv-print {
  background: #fff;
  border: 2px solid #111;
  padding: 0;
  width: 148mm;
  min-height: 105mm;
  position: relative;
  font-size: 10pt;
}

.dv-header {
  display: grid;
  grid-template-columns: auto 1fr;
  border-bottom: 2px solid #111;
}

.dv-crest {
  width: 48px;
  height: 48px;
  border: 2px solid #111;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin: 4px;
}

.dv-crest img {
  width: 100%;
}

.dv-crest-text {
  font-size: 9px;
  font-weight: 700;
  text-align: center;
  padding: 4px 2px;
  line-height: 1.2;
}

.dv-title-block {
  border-left: 2px solid #111;
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.dv-inst {
  font-size: 13pt;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: .3px;
}

.dv-formerly {
  font-size: 7pt;
  color: #333;
  margin-top: 2px;
  line-height: 1.4;
}

.dv-vtype {
  background: #222;
  color: #fff;
  font-size: 13pt;
  font-weight: 900;
  letter-spacing: 2px;
  text-align: center;
  padding: 5px 8px;
  text-transform: uppercase;
}

.dv-date-row {
  display: flex;
  justify-content: flex-end;
  border-bottom: 1px solid #999;
  padding: 3px 6px;
  font-size: 9pt;
}

.dv-date-row span {
  border-bottom: 1px dotted #333;
  min-width: 80px;
  display: inline-block;
  margin-left: 4px;
}

.dv-fields {
  padding: 6px 8px;
}

.dv-field-row {
  display: flex;
  align-items: baseline;
  margin-bottom: 5px;
  font-size: 9.5pt;
}

.dv-field-lbl {
  min-width: 82px;
  font-weight: 600;
  flex-shrink: 0;
}

.dv-field-val {
  border-bottom: 1px dotted #555;
  flex: 1;
  min-height: 16px;
  padding-bottom: 1px;
  padding-left: 4px;
}

.dv-bottom {
  display: grid;
  grid-template-columns: 80px 1fr 1fr;
  border-top: 1.5px solid #111;
  margin-top: 4px;
}

.dv-rs-box {
  border-right: 1.5px solid #111;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.dv-rs-label {
  font-size: 13pt;
  font-weight: 900;
  letter-spacing: 2px;
}

.dv-rs-amount {
  border: 2px solid #111;
  min-width: 62px;
  min-height: 30px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10pt;
  font-weight: 700;
  padding: 2px 4px;
}

.dv-checked {
  border-right: 1.5px solid #111;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.dv-checked label {
  font-size: 8.5pt;
  font-weight: 600;
  display: block;
  border-top: 1px solid #333;
  padding-top: 3px;
  margin-top: 24px;
}

.dv-sig {
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.dv-sig label {
  font-size: 8.5pt;
  font-weight: 600;
  display: block;
  border-top: 1px solid #333;
  padding-top: 3px;
  margin-top: 24px;
}

/* CREDIT VOUCHER - light blue */
.cv-print {
  background: #fff;
  border: 2px solid #111;
  padding: 0;
  width: 148mm;
  min-height: 105mm;
  font-size: 10pt;
}

.cv-header {
  display: grid;
  grid-template-columns: auto 1fr;
  border-bottom: 2px solid #111;
  background: #fff;
}

.cv-vtype {
  background: #222;
  color: #fff;
  font-size: 13pt;
  font-weight: 900;
  letter-spacing: 2px;
  text-align: center;
  padding: 5px 8px;
  text-transform: uppercase;
}

.cv-fields {
  padding: 6px 8px;
  background: #fff;
}

.cv-bottom {
  display: grid;
  grid-template-columns: 80px 1fr 1fr;
  border-top: 1.5px solid #111;
  margin-top: 4px;
  background: #fff;
}

/* ON ACCOUNT VOUCHER - pink */
.oa-print {
  background: #fff;
  border: 2px solid #111;
  padding: 0;
  width: 148mm;
  min-height: 105mm;
  font-size: 10pt;
}

.oa-header {
  display: grid;
  grid-template-columns: auto 1fr;
  border-bottom: 2px solid #111;
  background: #fff;
}

.oa-vtype {
  background: #222;
  color: #fff;
  font-size: 13pt;
  font-weight: 900;
  letter-spacing: 2px;
  text-align: center;
  padding: 5px 8px;
  text-transform: uppercase;
}

.oa-fields {
  padding: 6px 8px;
  background: #fff;
}

.oa-bottom {
  display: grid;
  grid-template-columns: 80px 1fr 1fr;
  border-top: 1.5px solid #111;
  margin-top: 4px;
  background: #fff;
}

/* === ANIMATIONS === */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(184,150,12,.55);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(184,150,12,0);
  }
}

@keyframes pop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

.sec.act {
  animation: fadeInUp .35s ease-out both;
}

.sc {
  animation: scaleIn .35s ease-out both;
}

.sc:nth-child(1) { animation-delay: .02s; }
.sc:nth-child(2) { animation-delay: .06s; }
.sc:nth-child(3) { animation-delay: .10s; }
.sc:nth-child(4) { animation-delay: .14s; }
.sc:nth-child(5) { animation-delay: .18s; }
.sc:nth-child(6) { animation-delay: .22s; }

.vtc {
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.vtc:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
}

.vtc.sel {
  animation: pop .25s ease;
}

.btn {
  transition: transform .12s ease, box-shadow .15s ease, background .2s ease, opacity .15s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
}

.btn:active {
  transform: translateY(0) scale(.98);
}

.bp {
  animation: none;
}

.bp.saving {
  animation: pulseGlow 1.2s ease-in-out infinite;
}

.ni {
  transition: background .15s, color .15s, transform .12s;
}

.ni:active {
  transform: scale(.97);
}

.lc {
  animation: scaleIn .4s ease-out both;
}

.mo:not(.h) {
  animation: fadeInUp .25s ease-out both;
}

.toast {
  position: fixed;
  top: 74px;
  right: 20px;
  background: var(--M);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  animation: slideInRight .3s ease-out both;
}

.toast.ok { background: #1B7A3E; }
.toast.warn { background: #A36A00; }
.toast.err { background: #9A2A2A; }

.linkpill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.15);
  color: #fff;
  padding: 4px 11px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,.3);
  transition: background .2s;
}

.linkpill:hover {
  background: rgba(255,255,255,.28);
}

.linkpill.linked {
  background: #1B7A3E;
  border-color: #2BA85A;
}

.linkpill.needs-grant {
  background: #A36A00;
  border-color: #D69A1A;
  animation: pulseGlow 1.6s ease-in-out infinite;
}

tbody tr {
  animation: fadeInUp .25s ease-out both;
}

/* === COLLEGE PICKER === */
#CP {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: radial-gradient(ellipse at 60% 40%, #8B2535 0%, #5A1220 55%, #3A0D18 100%);
  padding: 1rem;
  flex-direction: column;
  gap: 1.4rem;
}

#CP h1 {
  font-family: 'EB Garamond', serif;
  color: #fff;
  font-size: 26px;
  text-align: center;
  margin-bottom: .3rem;
}

#CP p.subt {
  color: rgba(255,255,255,.7);
  font-size: 13px;
  text-align: center;
  margin-bottom: 1rem;
}

.cpg {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 1040px;
}

.cpc {
  background: #fff;
  border-radius: 18px;
  padding: 1.6rem 1.4rem;
  width: 320px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.4);
  cursor: pointer;
  transition: transform .18s, box-shadow .18s;
  border: 2px solid transparent;
  text-align: center;
}

.cpc:hover {
  transform: translateY(-4px);
  border-color: #B8960C;
  box-shadow: 0 28px 72px rgba(0,0,0,0.5);
}

.cpc .cplogo {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 3px solid #B8960C;
  margin: 0 auto 14px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

.cpc .cplogo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cpc h2 {
  font-family: 'EB Garamond', serif;
  color: #8B2535;
  font-size: 17px;
  line-height: 1.3;
  margin-bottom: 6px;
}

.cpc p {
  font-size: 11.5px;
  color: #666;
}

.cpc button {
  margin-top: 14px;
  width: 100%;
  padding: 10px;
  background: #8B2535;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
}

.cpc button:hover {
  background: #6e1c2a;
}

.cpback {
  position: absolute;
  top: 14px;
  left: 18px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.35);
  color: #fff;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11px;
  cursor: pointer;
}

.cpback:hover {
  background: rgba(255,255,255,.28);
}

/* === UI STABILITY + POLISH LAYER === */
@media screen {
  :root {
    --page-bg: #f6f4ef;
    --surface: #ffffff;
    --surface-soft: #fbfaf7;
    --line: #e3ded5;
    --line-strong: #cfc7ba;
    --text-muted: #746d63;
    --focus: 0 0 0 3px rgba(123,29,46,.14);
    --shadow-soft: 0 10px 28px rgba(35,28,22,.08);
    --shadow-panel: 0 18px 48px rgba(35,28,22,.12);
  }

  body {
    background: var(--page-bg);
    color: var(--T);
    overflow-x: hidden;
  }

  button,
  input,
  select,
  textarea {
    font: inherit;
  }

  button:focus-visible,
  input:focus-visible,
  select:focus-visible,
  textarea:focus-visible,
  .cpc:focus-visible,
  .linkpill:focus-visible {
    outline: none;
    box-shadow: var(--focus);
  }

  #APP {
    background: var(--page-bg);
  }

  .tb {
    min-height: 64px;
    height: auto;
    gap: 16px;
    padding: 10px 22px;
    background: linear-gradient(90deg, #641625 0%, #7b1d2e 54%, #8d2637 100%);
    box-shadow: 0 1px 0 rgba(255,255,255,.08), 0 8px 28px rgba(42,15,20,.22);
  }

  .tbl {
    min-width: 0;
  }

  .tbcrest,
  .tbcrest img {
    width: 38px;
    height: 38px;
  }

  .tbl h2 {
    font-size: 17px;
    white-space: nowrap;
  }

  .tbl p {
    font-size: 11px;
    color: rgba(255,255,255,.68);
  }

  .tbr {
    justify-content: flex-end;
    flex-wrap: wrap;
    min-width: 0;
  }

  .ubadge,
  .linkpill,
  .lobtn {
    min-height: 32px;
    border-radius: 8px;
    padding: 6px 11px;
    line-height: 1.2;
    white-space: nowrap;
  }

  .body {
    align-items: flex-start;
    min-height: calc(100vh - 64px);
  }

  .sb {
    top: 64px;
    width: 232px;
    height: calc(100vh - 64px);
    padding: 16px 10px;
    background: var(--surface);
    border-right: 1px solid var(--line);
  }

  .ns {
    margin-bottom: 12px;
  }

  .ns p {
    padding: 0 10px 7px;
    margin-top: 10px;
    color: #8b8378;
  }

  .ni {
    min-height: 38px;
    width: 100%;
    margin: 2px 0;
    padding: 9px 10px;
    border-radius: 8px;
    color: #5f574d;
  }

  .ni:hover {
    background: #f2eee7;
  }

  .ni.act {
    background: #7b1d2e;
    box-shadow: 0 8px 18px rgba(123,29,46,.18);
  }

  .mc {
    width: calc(100vw - 232px);
    max-width: 1440px;
    padding: 24px;
  }

  .sec.act {
    max-width: 1400px;
    margin: 0 auto;
  }

  .ph {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
  }

  .ph h1 {
    font-size: 28px;
    line-height: 1.1;
  }

  .ph p {
    color: var(--text-muted);
  }

  .sg {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
  }

  .sc,
  .card,
  .ac {
    border-radius: 8px;
    border-color: var(--line);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
  }

  .sc {
    min-height: 112px;
    padding: 16px;
  }

  .sc .val {
    font-size: 28px;
    line-height: 1.05;
  }

  .card,
  .ac {
    padding: 16px;
    margin-bottom: 16px;
  }

  .ch {
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
  }

  .ct {
    font-size: 19px;
    line-height: 1.15;
  }

  .vtg {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 9px;
    margin-bottom: 12px;
  }

  .vtc {
    min-height: 70px;
    border-radius: 8px;
    padding: 8px 8px;
    background: var(--surface-soft);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 1.5px solid var(--line);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background-color .18s ease;
  }

  .vtc:hover {
    border-color: var(--M);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(123, 29, 46, 0.08);
  }

  .vtc.sel {
    border-color: var(--M);
    background: #FFF5F6;
    box-shadow: 0 2px 8px rgba(123, 29, 46, 0.12);
  }

  .vtc .vi {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 4px;
    font-size: 13px;
  }

  .vtc .vi.vi-debit { background: #FFF3D6; }
  .vtc .vi.vi-onaccount { background: #E0F2FE; }
  .vtc .vi.vi-credit { background: #F1F5F9; }
  .vtc .vi.vi-vendor { background: #E8EEF9; }

  .vtc-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  .vtc h3 {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--T);
    margin-bottom: 2px;
    line-height: 1.2;
  }

  .vtc.sel h3 {
    color: var(--M);
  }

  .vtc p {
    font-size: 9.5px;
    color: var(--G600);
    line-height: 1.2;
    margin: 0;
  }

  .vtc.vtc-action {
    background: #FAFBFE;
    border-color: #CBD5E1;
  }

  .vtc.vtc-action:hover {
    border-color: #002D72;
    background: #F0F5FF;
    box-shadow: 0 4px 12px rgba(0, 45, 114, 0.1);
  }

  .vtc.vtc-action h3 {
    color: #002D72;
  }

  .fr,
  .fr.t,
  .fr.f {
    gap: 12px;
    margin-bottom: 12px;
  }

  .fi label,
  .fg label {
    margin-bottom: 5px;
    color: #62594f;
  }

  .fi input,
  .fi select,
  .fi textarea,
  .fg input,
  .fg select,
  .sb2 input,
  .sb2 select,
  .inp {
    min-height: 38px;
    border-radius: 8px;
    border-color: var(--line-strong);
    background: #fff;
    color: var(--T);
  }

  .fi input,
  .fi select,
  .fi textarea {
    padding: 8px 10px;
    font-size: 13px;
  }

  .fi textarea {
    min-height: 72px;
  }

  .head-dropdown-wrap {
    min-width: 0;
  }

  .custom-head-dropdown {
    border-radius: 8px !important;
    border-color: var(--line-strong) !important;
    box-shadow: var(--shadow-panel) !important;
  }

  .bg-btn {
    align-items: center;
    gap: 8px;
    margin-top: 12px;
  }

  .btn {
    min-height: 34px;
    border-radius: 8px;
    justify-content: center;
    white-space: nowrap;
  }

  .bsm {
    min-height: 30px;
    padding: 6px 10px;
  }

  .sb2 {
    align-items: center;
    gap: 10px;
    padding: 12px;
    margin-bottom: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
  }

  .sb2 input,
  .sb2 select {
    min-width: 150px;
  }

  .twrap {
    border-color: var(--line);
    border-radius: 8px;
    background: var(--surface);
  }

  table {
    min-width: 760px;
  }

  th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 10px 12px;
    background: #6e1b2a;
    font-size: 11px;
  }

  td {
    padding: 10px 12px;
    vertical-align: middle;
  }

  tbody tr:nth-child(even) td {
    background: #fcfbf8;
  }

  tbody tr:hover td {
    background: #f5efe7;
  }

  .badge {
    border-radius: 8px;
    padding: 4px 8px;
    line-height: 1.1;
  }

  .ag {
    gap: 16px;
  }

  .bar-row {
    gap: 10px;
  }

  .bar-lbl {
    width: 150px;
  }

  .mo {
    padding: 18px;
    align-items: flex-start;
  }

  .md,
  .lc,
  .cpc {
    border-radius: 8px;
  }

  .md {
    margin-top: 18px;
    box-shadow: var(--shadow-panel);
  }

  .mh {
    border-radius: 8px 8px 0 0;
  }

  #LS,
  #CP {
    padding: 24px;
  }

  .lc {
    max-width: 430px;
    padding: 28px;
  }

  .cpg {
    gap: 16px;
  }

  .cpc {
    width: min(340px, 92vw);
    padding: 24px 22px;
  }

  .toast {
    max-width: min(420px, calc(100vw - 32px));
    border-radius: 8px;
  }
}

@media screen and (max-width: 1100px) {
  .fr.t {
    grid-template-columns: 1fr 1fr;
  }

  .ag {
    grid-template-columns: 1fr;
  }
}

@media screen and (max-width: 900px) {
  .tb {
    position: relative;
    padding: 12px 14px;
  }

  .tbl h2 {
    white-space: normal;
  }

  .body {
    display: block;
  }

  .sb {
    position: sticky;
    top: 0;
    z-index: 90;
    width: 100%;
    height: auto;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .ns {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
    margin-bottom: 0;
  }

  .ns p {
    display: none;
  }

  .ni {
    width: auto;
    min-width: max-content;
  }

  .mc {
    width: 100%;
    padding: 16px;
  }

  .ph {
    align-items: stretch;
    flex-direction: column;
  }

  .ph > div {
    width: 100%;
  }

  .ph > div[style*="display:flex"] {
    flex-wrap: wrap;
  }

  .ph input[type="date"] {
    flex: 1 1 140px;
  }

  .fr,
  .fr.t {
    grid-template-columns: 1fr;
  }

  .sg {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vtg {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}

@media screen and (max-width: 640px) {
  body {
    font-size: 13px;
  }

  .tb {
    align-items: flex-start;
  }

  .tbl {
    width: 100%;
  }

  .tbr {
    width: 100%;
    justify-content: flex-start;
  }

  .ubadge,
  .linkpill,
  .lobtn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .mc {
    padding: 12px;
  }

  .sg,
  .vtg {
    grid-template-columns: 1fr;
  }

  .card,
  .ac,
  .sc {
    padding: 14px;
  }

  .ch {
    align-items: flex-start;
    flex-direction: column;
  }

  .sb2 {
    display: grid;
    grid-template-columns: 1fr;
  }

  .sb2 input,
  .sb2 select,
  .sb2 .btn {
    width: 100%;
  }

  .bg-btn {
    display: grid;
    grid-template-columns: 1fr;
  }

  .btn {
    width: 100%;
  }

  .bar-row {
    align-items: stretch;
    flex-direction: column;
  }

  .bar-lbl {
    width: auto;
    text-align: left;
  }

  .dw {
    flex-direction: column;
  }

  .lc {
    padding: 22px 18px;
  }

  #CP h1 {
    font-size: 24px;
  }
}

/* === CREATE TOP NAV SWITCHER TABS === */
.create-nav-tabs {
  display: inline-flex;
  gap: 6px;
  background: var(--G100);
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 1rem;
  border: 1px solid var(--G200);
}

.create-nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  border-radius: 7px;
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  background: transparent;
  color: var(--G600);
  transition: all 0.2s ease;
  text-decoration: none;
}

.create-nav-tab:hover {
  color: var(--T);
  background: rgba(255,255,255,0.6);
}

.create-nav-tab.active {
  background: var(--M);
  color: var(--W);
  box-shadow: 0 2px 6px rgba(123, 29, 46, 0.25);
}

/* === VENDOR FILE UPLOAD & CHIPS === */
.vendor-upload-zone {
  border: 1.5px dashed var(--G200);
  border-radius: 8px;
  padding: 12px 16px;
  background: var(--G50);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.vendor-upload-zone:hover {
  border-color: var(--M);
  background: #fdfbf7;
}

.vendor-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--W);
  border: 1.5px solid var(--G200);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  max-width: 260px;
}

.vendor-file-chip .file-icon {
  font-size: 11px;
  font-weight: 700;
  background: #f0ede8;
  color: var(--M);
  padding: 2px 6px;
  border-radius: 4px;
}

.vendor-file-chip .file-meta {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.vendor-file-chip .file-name {
  font-weight: 600;
  color: var(--T);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11.5px;
}

.vendor-file-chip .file-size {
  font-size: 10px;
  color: var(--G600);
}

.btn-file-preview {
  background: var(--G50);
  border: 1px solid var(--G200);
  border-radius: 4px;
  padding: 2px 6px;
  cursor: pointer;
  font-size: 11px;
  color: var(--G800);
  transition: all 0.15s;
}

.btn-file-preview:hover {
  background: var(--G200);
}

.btn-file-remove {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #991b1b;
  border-radius: 4px;
  padding: 2px 6px;
  cursor: pointer;
  font-size: 10px;
  font-weight: bold;
  transition: all 0.15s;
}

.btn-file-remove:hover {
  background: #ef4444;
  color: #fff;
}

.file-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  background: #EDE9FE;
  color: #5B21B6;
  border: 1px solid #DDD6FE;
  border-radius: 12px;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  margin: 1px;
}

.file-badge-pill:hover {
  background: #DDD6FE;
  color: #4C1D95;
}

/* === VENDOR FORM SECTION STYLING (MATCHING DESIGN) === */
.vendor-form-wrapper {
  background: #ffffff;
  border: 1.5px solid #dbeafe;
  border-radius: 12px;
  padding: 1.6rem;
  box-shadow: 0 4px 20px rgba(0, 45, 114, 0.05);
  margin-bottom: 1.5rem;
}

.vendor-sec-block {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 14px;
  background: #ffffff;
  position: relative;
}

.vendor-sec-tag {
  display: inline-block;
  background: #002D72;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 4px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.vendor-addon-wrap {
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--G200);
  border-radius: 6px;
  background: var(--G50);
  overflow: hidden;
  transition: border .2s;
}

.vendor-addon-wrap:focus-within {
  border-color: #002D72;
  background: #ffffff;
}

.vendor-addon {
  background: #f1f5f9;
  color: #334155;
  font-weight: 700;
  font-size: 13px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--G200);
}

.vendor-addon-input {
  border: none !important;
  background: transparent !important;
  flex: 1;
  padding: 7px 10px !important;
  font-size: 13px !important;
  outline: none !important;
}

.vendor-file-slots-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.vendor-file-slot {
  border: 1.5px dashed #cbd5e1;
  border-radius: 6px;
  padding: 8px 12px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
  min-height: 44px;
}

.vendor-file-slot:hover {
  border-color: #002D72;
  background: #f0f7ff;
}

.vendor-file-slot.active {
  border: 1.5px solid #93c5fd;
  background: #eff6ff;
}

.slot-icon {
  font-size: 18px;
  color: #002D72;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slot-title {
  font-size: 12px;
  font-weight: 600;
  color: #1e293b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slot-sub {
  font-size: 10px;
  color: #64748b;
}

.slot-btn-view {
  background: #ffffff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  border-radius: 4px;
  padding: 3px 7px;
  font-size: 11px;
  cursor: pointer;
}

.slot-btn-remove {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
  border-radius: 4px;
  padding: 3px 7px;
  font-size: 11px;
  cursor: pointer;
  font-weight: bold;
}

.vendor-action-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 14px;
  margin-top: 10px;
  border-top: 1px solid #e2e8f0;
}

.vendor-btn-outline {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #334155;
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.vendor-btn-outline:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.vendor-btn-primary {
  background: #002D72;
  border: 1.5px solid #002D72;
  color: #ffffff;
  padding: 7px 20px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.vendor-btn-primary:hover {
  background: #001f52;
  border-color: #001f52;
}

/* === VENDOR LEDGER STYLING === */
.vendor-ledger-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 1.2rem;
}

.vl-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  position: relative;
  overflow: hidden;
}

.vl-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--G400);
}

.vl-card.blue::before { background: #002D72; }
.vl-card.green::before { background: #16a34a; }
.vl-card.amber::before { background: #d97706; }
.vl-card.purple::before { background: #7c3aed; }

.vl-lbl {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.vl-val {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  font-family: 'Inter', sans-serif;
}

.vl-sub {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

.progress-track {
  width: 100%;
  height: 7px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
}

.progress-fill {
  height: 100%;
  background: #16a34a;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.badge-paid {
  background: #dcfce7;
  color: #15803d;
  font-weight: 600;
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 10px;
}

.badge-partial {
  background: #fef3c7;
  color: #b45309;
  font-weight: 600;
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 10px;
}

.badge-unpaid {
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 600;
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 10px;
}

/* Agreement Automatic Status Badges */
.badge-ag-active {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
  font-weight: 600;
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.badge-ag-expiring {
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #fde047;
  font-weight: 600;
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.badge-ag-expired {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  font-weight: 600;
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.badge-ag-notstarted {
  background: #e0e7ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
  font-weight: 600;
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.badge-ag-completed {
  background: #e0f2fe;
  color: #075985;
  border: 1px solid #bae6fd;
  font-weight: 600;
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.badge-ag-terminated {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  font-weight: 600;
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

/* Modal Tabs */
.modal-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1.5px solid #e2e8f0;
  padding-bottom: 8px;
  margin-bottom: 14px;
}

.modal-tab-btn {
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 12.5px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s;
}

.modal-tab-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.modal-tab-btn.active {
  background: #002D72;
  color: #ffffff;
}

/* === TOP SEARCH BAR IN VENDOR LEDGER === */
.vendor-top-search-card {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 1.2rem;
  box-shadow: 0 4px 16px rgba(0, 45, 114, 0.05);
}

.vendor-search-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: 4px 12px;
  transition: all 0.2s ease;
}

.vendor-search-input-wrap:focus-within {
  border-color: #002D72;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(0, 45, 114, 0.1);
}

.vendor-search-icon {
  font-size: 16px;
  color: #002D72;
}

.vendor-top-search-inp {
  flex: 1;
  border: none !important;
  background: transparent !important;
  padding: 8px 6px !important;
  font-size: 13.5px !important;
  color: #0f172a !important;
  outline: none !important;
  font-family: 'Inter', sans-serif !important;
}

.vendor-search-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s;
}

.vendor-search-chip:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.vendor-search-chip.active {
  background: #002D72;
  border-color: #002D72;
  color: #ffffff;
}

/* === A4 DOCUMENT PREVIEW & PRINT UNIFICATION === */
.vendor-agreement-sheet,
.vendor-ledger-sheet {
  background: #ffffff;
  color: #111111;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  box-sizing: border-box;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
}

@media screen {
  .vendor-agreement-sheet {
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
    border: 1.5px solid #cbd5e1;
    border-radius: 4px;
  }
  .vendor-ledger-sheet {
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
    border: 1px solid #cbd5e1;
    border-radius: 4px;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 8mm 10mm;
  }
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  body {
    background: #fff !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .vendor-agreement-sheet,
  .vendor-ledger-sheet {
    width: 100% !important;
    max-width: 100% !important;
    box-shadow: none !important;
    margin: 0 auto !important;
  }
  .vendor-agreement-sheet {
    page-break-inside: avoid !important;
    page-break-after: avoid !important;
  }
}

/* === CASH BOOK MODAL & BREAKDOWN === */
#CASHBOOK_MODAL .cb-date-badge {
  transition: all 0.2s ease;
}
#CASHBOOK_MODAL .cb-date-badge:hover {
  transform: translateY(-1px);
  border-color: #002D72 !important;
}
#CB_TABLE_BODY tr:hover {
  background: #fdf2f4 !important;
}
#CB_TABLE_BODY td {
  padding: 6px 8px;
  border-bottom: 1px solid #e2e8f0;
}
#CB_TABLE_FOOT td {
  padding: 8px 10px;
  border-top: 2px solid #7B1D2E;
}
