/* vendors.css */

/* Base */
body {
  margin: 0;
  padding: 0;
  background-color: #f0f4f8;
  font-family: 'Segoe UI', sans-serif;
  color: #333;
  overflow-x: hidden;
}

.page-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem;
}
/* Tabs */
.tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1rem auto;
  padding: 0 1rem;
  max-width: 800px;
}

.tab {
  background-color: #e0e7ef;
  color: #003366;
  border: none;
  padding: 0.6rem 1.1rem;
  border-radius: 10px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.3s ease;
}

.tab:hover {
  background-color: #d0dae7;
}

.tab.active {
  background-color: #003366;
  color: white;
  font-weight: bold;
}

.tab.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}



/* Buttons */
.button {
  background-color: #003366;
  color: white;
  padding: 0.6rem 1.2rem;
  margin-top: 1rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background 0.3s ease;
}

.button:hover {
  background-color: #0050a0;
}

/* ------------------------------------------------------------------- VENDOR CARD FIXES --------------------------------------------------- */

.card {
  background: #d6d5d5;
  padding: 1rem;
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  margin: 0 auto;
  width: 100%;
  max-width: 960px;
  text-align: left;
  align-items: center!important;
  margin-left: auto!important;
  margin-right: auto!important;
}


/*-------------------------------------------vendor card header styling-------------------*/
.card-header h3 {
  margin: 0;
  color: #003366;
  font-size: 1.2rem;
}

.card-header p {
  margin: 0;
  font-size: 0.95rem;
  color: #666;
}



.card-details.hidden {
  display: none;
}



.invoice-heading {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.1em;
  border-bottom: 1px solid #ddd;
  padding-bottom: 5px;
  
}


.invoice-total-row {
  margin-top: 10px;
  font-weight: bold;
}

.no-invoice-text {
  font-style: italic;
  color: #777;
  margin: 10px 0;
}

.vendor-page .invoice-row {
  margin: 4px 0;
  font-size: 0.85rem;
}

.invoice-card {
  background: #f7faff;
  border: 4px solid #ccddee;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
  box-shadow: 1px 1px 5px rgba(0,0,0,0.05);
  align-items: center!important;
  margin-left: auto!important;
  margin-right: auto!important;
}

/* Responsive Enhancements */
@media (max-width: 600px) {
  .tabs {
    flex-direction: column;
    align-items: center;
  }

  .vendor-header img {
    width: 64px;
    height: 64px;
  }

  .vendor-header h1 {
    font-size: 1.4rem;
  }

  .vendor-header p {
    font-size: 0.9rem;
  }
}

.vendor-page .add-invoice-btn {
  background-color: #056805;
  color: #fff;
  font-size: 0.85rem;
  padding: 0.4rem 1rem;
  margin-top: 8px;
  border-radius: 6px;
  width: 120px;
}
.list-container {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 1100px;
  margin: auto;
  width: 100%!important; /* <- add this line */
  align-items: center!important;
  margin-left: auto!important;
  margin-right: auto!important;
}
.vendor-page .add-invoice-btn:hover {
  background-color: #0c5fa3;
}

.vendor-page .save-vendor-btn,
.vendor-page .cancel-vendor-btn {
  font-size: 0.7rem;
  padding: 0.5rem 1.2rem;
  border-radius: 6px;
  width: 130px;
  height: 34px;
  text-align: center;
}

/* Save-specific colors */
.vendor-page .save-vendor-btn {
  background-color: #2a6d1c;
  color: #fff;
}

.vendor-page .save-vendor-btn:hover {
  background-color: #378c25;
}

/* Cancel-specific colors */
.vendor-page .cancel-vendor-btn {
  background-color: #fcb4b4;
  color: white;
}

.vendor-page .cancel-vendor-btn:hover {
  background-color: #c94444;
}

/* Invoice Buttons Styled to Match Other UI */
.vendor-page .btn-edit-invoice,
.vendor-page .btn-delete-invoice {
  font-size: 0.75rem;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  width: 80px;
  text-align: center;
  color: white;
}

/* Green Edit Button */
.vendor-page .btn-edit-invoice {
  background-color: #2a6d1c;
}

.vendor-page .btn-edit-invoice:hover {
  background-color: #378c25;
}

/* Red Delete Button */
.vendor-page .btn-delete-invoice {
  background-color: #c94444;
}

.vendor-page .btn-delete-invoice:hover {
  background-color: #9e2e2e;
}
.po-meta {
  font-size: 0.85em;
  color: #555;
  margin-top: 2px;
}
.po-meta {
  font-size: 0.85em;
  color: #555;
  margin-top: 2px;
}

.header-card {
  background-color: #e6e6e8;
  padding: 1rem;
  margin: 1rem auto;
  border-radius: 10px;
  max-width: 960px;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  text-align: center;
  align-items: center!important;
  margin-left: auto!important;
  margin-right: auto!important;
}

/* Logged-in user */
#userCard {
  font-size: 0.95em;
  color: #000000;
  font-weight: bold;
  justify-content: center;
  align-items: center!important;
  margin-left: auto!important;
  margin-right: auto!important;
}

.header-title h1 {
  color: #222;
}

.header-title p {
  color: #444;
}

/* Logo + title */
#appHeaderCard {
  flex-direction: column;
  align-items: center!important;
  margin-left: auto!important;
  margin-right: auto!important;
}

.header-logo {
  width: 80px;
  height: auto;
  border-radius: 8px;
}

.header-title h1 {
  margin: 0.2em 0 0 0;
  font-size: 1.4em;
}

.header-title p {
  margin: 0.3em 0 0 0;
  font-size: 0.95em;
  color: #555;
}

form.card label {
  display: block;
  margin-top: 0.75rem;
  font-weight: bold;
  font-size: 0.9rem;
}

form.card input,
form.card select,
form.card textarea {
  display: block;
  width: 100%;
  padding: 0.5rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  margin-top: 0.25rem;
  box-sizing: border-box;
}

.card-section {
  background: #f8fafd;
  padding: 1rem;
  border-radius: 10px;
  margin-top: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  align-items: center!important;
}

form.card input[type="checkbox"] {
  display: inline-block;
  width: auto;
  margin-right: 0.5rem;
}

form.card input,
form.card select,
form.card textarea {
  width: 100% !important;
  font-size: 1rem;
}

form.card {
  padding: 1rem;
  width: 90%;
  margin: 1rem auto;
}

.card-section {
  padding: 1rem;
  margin-top: 1rem;
  border-radius: 10px;
}

.centered-mobile {
  margin-left: auto;
  margin-right: auto;
}

.list-container {
  display: flex!important;
  flex-direction: column!important;
  align-items: center!important;
  margin-left: auto!important;
  margin-right: auto!important;
}

@media (max-width: 600px) {
  .list-container,
  #vendorList,
  form.card,
  .card {
    width: 94vw; /* responsive width */
    max-width: 100%;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 1rem;
    padding-right: 1rem;
    box-sizing: border-box;
    text-align: left;
  }

  .list-container {
    display: flex;
    flex-direction: column;
    align-items: center!important;
  }

  .card {
    text-align: left;
  }
}

/* Fix invoice overflow inside card */
.invoice-section {
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Ensure invoice card fits and doesn't push outside */
.invoice-card {
  width: 100%;
  box-sizing: border-box;
  margin: 0.5rem 0;
  overflow-x: auto;
}

/* Prevent flex child over-expansion if used in the future */
.invoice-row {
  word-break: break-word;
}


/*---------------------------------billing system-------------------------*/

.modal {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  background-color: rgba(0, 0, 0, 0.65);
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-content {
  max-width: 700px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--card-bg, #fff);
  padding: 1.2rem;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.modal.hidden {
  display: none;
}

#addMoreContactsBtn {
  margin-top: 1rem;
}

.help-button {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background-color: #007bff;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  z-index: 1000;
  transition: background-color 0.2s ease;
}

.help-button:hover {
  background-color: #0056b3;
}
@media (max-width: 600px) {
  .help-button {
    top: unset;
    right: 1rem;
    bottom: 1rem;
    position: fixed;
  }
}

/*--------------------------------------------vendor help modal styling  ------------------------------*/



/* Modal Overlay */
.modal {
  display: none;
  position: fixed;
  z-index: 1001;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: rgba(0,0,0,0.5);
}

/* Modal Content */
.modal-content {
  position: relative;
  margin: 5% auto;
  padding: 0;
  width: 90%;
  max-width: 1000px;
  height: 80%;
  background-color: white;
  border-radius: 10px;
  overflow: hidden;
}

/* Close Button */
.close {
  color: #aaa;
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  z-index: 1002;
}

.close:hover {
  color: black;
}

/* iframe inside modal */
.modal-content iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/*----------------------------search and filter vendors----------------------*/

.vendor-filters {
  margin-bottom: 1rem;
  padding: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  color: #000000;
}

.filter-controls label {
  margin-right: 0.3em;
  font-weight: bold;
}

.filter-controls input,
.filter-controls select {
  padding: 0.4em;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.vendorFilter {
  text-align: center;
  font-weight: bold;
  margin-top: 10px;
}

.button.btn-new {
  text-align: center;
  font-weight: bold;
  margin-top: 10px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}


