/* ═══════════════════════════════════════════════════════════
   VENDOR MANAGEMENT PORTAL — Global Stylesheet
   Peak Process Partners
═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,600;0,700;1,600&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ── CSS VARIABLES ── */
:root {
  --ink:        #0d0c0b;
  --ink2:       #1e1913;
  --inkM:       #3a3630;
  --paper:      #f7f4ef;
  --cream:      #ede9e1;
  --gold:       #b8922a;
  --gold-light: #e8d49a;
  --gold-pale:  #fdf6e3;
  --rust:       #a0412a;
  --teal:       #1a5c52;
  --muted:      #7a7568;
  --border:     #d8d3c8;
  --white:      #ffffff;
  --shadow:     0 4px 20px rgba(13,12,11,0.09);
  --shadow-lg:  0 12px 48px rgba(13,12,11,0.14);
  --radius:     12px;
  --radius-sm:  7px;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; }
a { color: inherit; text-decoration: none; }

/* ── TYPOGRAPHY ── */
h1, h2, h3 { font-family: 'Playfair Display', serif; line-height: 1.1; }
label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 4px;
}

/* ── FORM ELEMENTS ── */
input[type=text],
input[type=number],
input[type=date],
select,
textarea {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
  outline: none;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  -webkit-appearance: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(184,146,42,0.1);
}
textarea { resize: vertical; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%237a7568' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

/* ── FORM GRID ── */
.fg  { display: flex; flex-direction: column; }
.fg.full { grid-column: 1 / -1; }
.fgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
@media (max-width: 500px) { .fgrid { grid-template-columns: 1fr; } }

/* ── HEADER ── */
.site-header {
  background: var(--ink);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 200;
  border-bottom: 1px solid #222;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.logo-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--gold), #d4a83a);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.logo-name {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  color: #fff;
  line-height: 1.2;
}
.logo-name span { color: var(--gold-light); }
.logo-sub {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #444;
  margin-top: 1px;
}
.hdr-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.hbtn {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 7px 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s;
  white-space: nowrap;
}
.hbtn-gen  { background: #1e4a3f; color: #a8d8cf; border: 1px solid #2a6b5e; }
.hbtn-gen:hover { background: #265e51; color: #c8ede8; }
.hbtn-load { background: transparent; color: #aaa; border: 1px solid #333; }
.hbtn-load:hover { border-color: #666; color: #fff; }
.hbtn-save { background: var(--gold); color: #fff; }
.hbtn-save:hover { background: #c9a03a; transform: translateY(-1px); }
.save-ind {
  font-size: 10px;
  color: #555;
  display: flex;
  align-items: center;
  gap: 5px;
}
.sdot { width: 6px; height: 6px; border-radius: 50%; background: #444; flex-shrink: 0; }
.sdot.saved   { background: #4caf7d; }
.sdot.unsaved { background: #e6a817; }

@media (max-width: 600px) {
  .site-header { padding: 0 16px; height: 56px; }
  .save-ind, .hbtn-load { display: none; }
  .hbtn { padding: 6px 10px; font-size: 10px; }
}

/* ── HERO ── */
.hero {
  background: linear-gradient(160deg, #161310, #1e1a15, #251e16);
  padding: 52px 32px 44px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -80px; right: -100px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(184,146,42,0.14), transparent 65%);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(184,146,42,0.4), transparent);
}
.hero-in {
  max-width: 860px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-light);
  margin-bottom: 14px;
}
.hero-tag::before {
  content: '';
  display: block;
  width: 24px; height: 1px;
  background: var(--gold);
}
.hero h1 {
  font-size: 38px;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 12px;
}
.hero h1 em { color: var(--gold-light); font-style: italic; }
.hero p { font-size: 13px; color: #888; font-weight: 300; max-width: 420px; line-height: 1.7; }

@media (max-width: 600px) {
  .hero { padding: 36px 16px 30px; }
  .hero h1 { font-size: 28px; }
}

/* ── MAIN CONTAINER ── */
.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 18px 100px;
}

/* ── STEP CARDS ── */
.step-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 22px;
  overflow: hidden;
}
.step-hd {
  padding: 14px 26px;
  background: var(--cream);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 13px;
}
.step-badge {
  width: 24px; height: 24px;
  background: var(--ink);
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.step-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.step-body { padding: 26px; }

/* ── MONTH GRID ── */
.month-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 7px;
}
@media (max-width: 560px) { .month-grid { grid-template-columns: repeat(4, 1fr); } }
.mbtn {
  padding: 10px 4px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  letter-spacing: 0.04em;
}
.mbtn:hover { border-color: var(--gold); color: var(--ink); background: var(--gold-pale); }
.mbtn.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  box-shadow: 0 2px 10px rgba(13,12,11,0.2);
}
.month-ok {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--gold-pale);
  border: 1.5px solid var(--gold-light);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  display: none;
  align-items: center;
  gap: 7px;
}
.month-ok.on { display: flex; }

/* ── VENDOR CARDS ── */
#vendors-wrap { display: flex; flex-direction: column; gap: 16px; }
.vc {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--paper);
  overflow: hidden;
  animation: popIn 0.2s ease;
}
@keyframes popIn {
  from { opacity: 0; transform: translateY(-5px) scale(0.99); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.vc-hd {
  padding: 11px 16px;
  background: var(--cream);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.vc-num {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.vc-rm {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 15px;
  width: 24px; height: 24px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.vc-rm:hover { color: var(--rust); background: #fde8e2; }
.vc-body { padding: 18px 18px 20px; }

/* ── TYPE CHIPS ── */
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.chip {
  padding: 5px 11px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s;
  background: var(--white);
  color: var(--muted);
  white-space: nowrap;
}
.chip:hover { border-color: var(--gold); color: var(--ink); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ── DROP ZONE ── */
.dz {
  border: 2px dashed var(--border);
  border-radius: 9px;
  padding: 20px 14px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--white);
  position: relative;
}
.dz.over, .dz:hover { border-color: var(--gold); background: var(--gold-pale); }
.dz input[type=file] {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer;
  width: 100%; height: 100%;
  border: none; padding: 0; box-shadow: none;
}
.dz-icon { font-size: 20px; margin-bottom: 4px; }
.dz-txt  { font-size: 12px; color: var(--muted); font-weight: 500; }
.dz-txt strong { color: var(--gold); }
.dz-sub  { font-size: 10px; color: #bbb; margin-top: 3px; }

.inv-prev {
  margin-top: 9px;
  padding: 9px 12px;
  background: #edf7f2;
  border: 1.5px solid #b5dfc8;
  border-radius: 7px;
  font-size: 12px;
  color: var(--teal);
  font-weight: 500;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.inv-left { display: flex; align-items: center; gap: 7px; flex: 1; min-width: 0; }
.inv-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-amt  { font-size: 13px; font-weight: 700; color: var(--teal); white-space: nowrap; padding-left: 10px; }
.inv-amt.spin { color: var(--gold); }
.inv-amt.err  { color: var(--rust); font-size: 11px; font-weight: 500; }

/* ── SUMMARY BAR ── */
.sumbar {
  display: none;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 11px 15px;
  background: var(--cream);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.sb-lbl { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.pill {
  font-size: 11px; font-weight: 500;
  padding: 3px 9px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--ink);
}
.pill.ok { border-color: #b5dfc8; color: var(--teal); background: #edf7f2; }

/* ── ADD VENDOR BUTTON ── */
.add-btn {
  width: 100%;
  padding: 12px;
  border: 2px dashed var(--border);
  border-radius: 9px;
  background: transparent;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px; font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.18s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 4px;
}
.add-btn:hover { border-color: var(--gold); color: var(--ink); background: var(--gold-pale); }
.add-circle {
  width: 20px; height: 20px;
  background: var(--gold);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; line-height: 1;
  flex-shrink: 0;
}

/* ── EXPORT PANEL ── */
.exp-panel {
  background: linear-gradient(135deg, #131110, #1e1913);
  border-radius: 13px;
  padding: 28px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid #2a2520;
}
.exp-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.exp-left h3 { font-size: 20px; color: #fff; margin-bottom: 4px; }
.exp-left p  { font-size: 12px; color: #666; line-height: 1.6; }
.exp-btns { display: flex; gap: 9px; flex-wrap: wrap; }
.bxl {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.04em;
  padding: 12px 20px;
  border-radius: 7px;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  transition: all 0.18s;
  white-space: nowrap;
}
.bxl-excel { background: var(--gold); color: #fff; }
.bxl-excel:hover { background: #c9a03a; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(184,146,42,0.4); }
.bxl-zip { background: transparent; color: #ccc; border: 1.5px solid #333; }
.bxl-zip:hover { border-color: #666; color: #fff; }
.bxl:disabled { opacity: 0.35; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.exp-stat { display: flex; align-items: center; gap: 5px; font-size: 11px; color: #555; margin-top: 9px; }
.sdot2 { width: 5px; height: 5px; border-radius: 50%; background: #555; flex-shrink: 0; }
.sdot2.live { background: #4caf7d; }

/* ── MODAL ── */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-bg.on { display: flex; }
.modal {
  background: var(--white);
  border-radius: 13px;
  width: 460px;
  max-width: 92vw;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.modal-hd {
  padding: 18px 22px;
  background: var(--cream);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 17px; color: var(--ink); }
.modal-x {
  background: none; border: none;
  font-size: 17px; cursor: pointer;
  color: var(--muted); padding: 4px;
  border-radius: 4px; transition: color 0.15s;
}
.modal-x:hover { color: var(--rust); }
.modal-body { padding: 18px 22px; max-height: 58vh; overflow-y: auto; }
.saved-item {
  padding: 13px 15px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  margin-bottom: 9px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.saved-item:hover { border-color: var(--gold); background: var(--gold-pale); }
.si-title { font-size: 14px; font-weight: 600; color: var(--ink); }
.si-meta  { font-size: 11px; color: var(--muted); margin-top: 2px; }
.si-del {
  background: none; border: none;
  cursor: pointer; color: var(--muted);
  font-size: 14px; padding: 4px;
  border-radius: 4px; transition: color 0.15s;
  flex-shrink: 0; margin-left: 10px;
}
.si-del:hover { color: var(--rust); }
.modal-empty { text-align: center; padding: 30px 0; color: var(--muted); font-size: 13px; }

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 22px; right: 22px;
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  border-radius: 9px;
  font-size: 12px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  max-width: 340px;
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex; align-items: center; gap: 9px;
  pointer-events: none;
}
.toast.show  { transform: translateY(0); opacity: 1; pointer-events: auto; }
.toast.ok    { background: var(--teal); }
.toast.err   { background: #7a1c1c; }
.toast.info  { background: #1e3a5a; }

/* ══════════════════════════════════════════
   INVOICE PAGE STYLES
══════════════════════════════════════════ */
.inv-container {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 18px 80px;
}
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px; font-weight: 600;
  color: var(--muted);
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 7px 14px;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 22px;
  font-family: 'DM Sans', sans-serif;
  text-decoration: none;
}
.back-btn:hover { border-color: var(--gold); color: var(--ink); }
.inv-page-hd { margin-bottom: 26px; }
.inv-page-hd h2 { font-size: 28px; color: var(--ink); margin-bottom: 6px; }
.inv-page-hd p { font-size: 13px; color: var(--muted); }

.inv-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
}
.inv-card-hd {
  padding: 13px 24px;
  background: var(--cream);
  border-bottom: 1px solid var(--border);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted);
}
.inv-card-body { padding: 22px 24px; }

.inv-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 620px) { .inv-2col { grid-template-columns: 1fr; } }

.inv-4col { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 640px) { .inv-4col { grid-template-columns: 1fr 1fr; } }
@media (max-width: 380px) { .inv-4col { grid-template-columns: 1fr; } }

.party-section-label {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  margin-bottom: 14px; padding-bottom: 8px;
  border-bottom: 2px solid;
}
.party-section-label.from { color: var(--gold); border-color: var(--gold); }
.party-section-label.to   { color: var(--teal); border-color: var(--teal); }

/* ── LINE ITEMS TABLE ── */
.line-table { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
.line-table th {
  background: var(--ink);
  color: #fff;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 10px 10px;
  text-align: left;
}
.line-table th:last-child,
.line-table td:last-child { text-align: right; }
.line-table th:nth-child(3),
.line-table td:nth-child(3) { text-align: center; }
.line-table th.right,
.line-table td.right { text-align: right; }
.line-table td {
  padding: 9px 10px;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.line-table tr:nth-child(even) td { background: var(--paper); }
.line-table input {
  border: none;
  background: transparent;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: var(--ink);
  outline: none;
  width: 100%;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
}
.line-table input:focus {
  background: var(--gold-pale);
  border-radius: 3px;
  padding: 0 3px;
  box-shadow: none;
}
.li-remove {
  background: none; border: none;
  cursor: pointer; color: var(--muted);
  font-size: 13px; padding: 2px 5px;
  border-radius: 3px; transition: color 0.15s;
}
.li-remove:hover { color: var(--rust); }
.add-line-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px; font-weight: 600;
  color: var(--gold);
  background: none;
  border: 1.5px dashed var(--gold-light);
  border-radius: 6px;
  padding: 7px 14px;
  cursor: pointer;
  transition: all 0.15s;
}
.add-line-btn:hover { background: var(--gold-pale); }

/* ── TOTALS BLOCK ── */
.totals-block {
  margin-left: auto;
  width: 300px;
  max-width: 100%;
}
.totals-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.totals-row span:last-child { font-weight: 600; }
.totals-row.grand {
  padding: 12px 0;
  border-bottom: none;
  font-size: 16px;
  font-weight: 700;
}
.totals-row input[type=number] {
  width: 60px;
  text-align: right;
  font-size: 12px;
  border-radius: 4px;
}

/* ── DOWNLOAD BUTTON ── */
.dl-inv-wrap {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}
.bxl-inv {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px; font-weight: 700;
  padding: 13px 26px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; gap: 9px;
  transition: all 0.18s;
  background: var(--ink);
  color: #fff;
}
.bxl-inv:hover { background: #2a2520; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(13,12,11,0.25); }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
