/* === Base Styles === */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 40px;
  background-color: white;
  color: #333;
  max-width: 800px;
  font-size: 16px;
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}
#pageLoader {
  position: fixed;
  inset: 0; /* top:0; right:0; bottom:0; left:0; */
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  z-index: 9999;
  transition: opacity 0.4s ease;
  background-color: #121212; /* dark fallback */
  color: #fff;
}

/* Light-mode loader */
html.light-mode #pageLoader,
body.light-mode #pageLoader {
  background-color: #fff;
  color: #333;
}
input, textarea, button {
  font-size: 16px;
  padding: 8px 10px;
  line-height: 1.4;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
  transition: background-color 0.3s ease, color 0.3s ease;
  margin-bottom: 8px;
}

button {
  cursor: pointer;
}
/* === Sales Report Layout === */
.container {
  max-width: 800px;
  margin: auto;
  padding: 2em;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1em;
}

.header h1 {
  margin: 0;
  font-size: 1.8em;
}

/* === Sales Table === */
#salesTable {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  font-size: 0.9em;
}

#salesTable th,
#salesTable td {
  border: 1px solid #ccc;
  padding: 6px;
  text-align: left;
}

#salesTable th:nth-child(1),
#salesTable td:nth-child(1) {
  width: 80px;
}

#salesTable th:nth-child(2),
#salesTable td:nth-child(2) {
  width: 60px;
}

#salesTable th:nth-child(3),
#salesTable td:nth-child(3) {
  width: 180px;
}

#salesTable th:nth-child(4),
#salesTable td:nth-child(4) {
  width: 40px;
}

#salesTable th:nth-child(5),
#salesTable td:nth-child(5) {
  width: 80px;
}

#salesTable th:nth-child(6),
#salesTable td:nth-child(6) {
  width: 80px;
}

/* === Buttons === */
button {
  padding: 6px 10px;
  cursor: pointer;
}

/* === Header & Title Block === */
header {
  border-bottom: 1px solid #ccc;
  margin-bottom: 20px;
}

.title-block {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1px 15px;
  padding: 0 10px;
}

.title-block .line1,
.title-block .line2 {
  font-size: 36px;
  margin: 0;
}

.title-block .line1 {
  flex-basis: 100%;
}

.title-block .line2 {
  flex: 1;
}

.title-block img {
  height: 60px;
  transform: translate(-10px, -25px);
}

/* === Top Bar Navigation === */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px 0;
  flex-wrap: wrap;
  gap: 10px;
}

.left-buttons,
.right-button {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.left-buttons button,
.right-button button {
  padding: 6px 10px;
  font-size: 15px;
  background-color: #444;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.left-buttons button:hover,
.right-button button:hover {
  background-color: #555;
}


.nav-button {
  padding: 6px 10px;
  font-size: 15px;
  background-color: #444;
  color: white;
  border: none;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.nav-button:hover {
  background-color: #222;
}

/* === Dark Mode Toggle === */
#darkToggle {
  padding: 6px 10px;
  font-size: 15px;
  background-color: #444;
  color: white;
  border: none;
  border-radius: 4px;
}

#darkToggle:hover {
  background-color: #222;
}

/* === Dark Mode Styles === */
body.dark-mode {
  background-color: #121212;
  color: #eee;
}

body.dark-mode input,
body.dark-mode textarea,
body.dark-mode button {
  background-color: #333;
  color: #eee;
  border-color: #555;
}

body.dark-mode button:hover {
  background-color: #444;
}

body.dark-mode header {
  background-color: #121212;
  color: #eee;
}

body.dark-mode header h1,
body.dark-mode header button {
  color: #eee;
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
  color: #ccc !important;
  opacity: 1;
}
html.dark-mode input:-webkit-autofill,
body.dark-mode input:-webkit-autofill,
html.dark-mode input:-webkit-autofill:focus,
body.dark-mode input:-webkit-autofill:focus,
html.dark-mode input:-webkit-autofill:hover,
body.dark-mode input:-webkit-autofill:hover {
  -webkit-text-fill-color: #eee !important;
  background-color: #333 !important;
  box-shadow: 0 0 0px 1000px #333 inset !important;
  transition: background-color 0s ease-in-out 0s;
}

html.dark-mode textarea:-webkit-autofill,
body.dark-mode textarea:-webkit-autofill,
html.dark-mode textarea:-webkit-autofill:focus,
body.dark-mode textarea:-webkit-autofill:focus,
html.dark-mode textarea:-webkit-autofill:hover,
body.dark-mode textarea:-webkit-autofill:hover {
  -webkit-text-fill-color: #eee !important;
  background-color: #333 !important;
  box-shadow: 0 0 0px 1000px #333 inset !important;
  transition: background-color 0s ease-in-out 0s;
}

body.dark-mode textarea {
  background-color: #333 !important;
  color: #eee !important;
  border-color: #555 !important;
}
body.dark-mode #notesForm textarea {
  background-color: #333 !important;
  color: #eee !important;
  border-color: #555 !important;
}

/* === Form Layout === */
form > * {
  margin-bottom: 8px;
}

#reportForm label {
  display: block;
  margin-top: 2px;
  font-weight: 500;
}

#reportForm h2 {
  font-size: 20px;
  margin-bottom: 16px;
}

#reportForm input,
#reportForm textarea {
  width: 100%;
  max-width: 100%;
  margin-bottom: 5px;
}

#reportForm button {
  width: auto;
  max-width: 200px;
  display: inline-block;
  margin-bottom: 5px;
  background-color: #0078D4;
  color: white;
  border: none;
  border-radius: 5px;
}

#reportForm button:hover {
  background-color: #005A9E;
}
#inventoryForm input,
#inventoryForm select {
  width: 100%;
  max-width: 100%;
  margin-bottom: 8px;
  display: block;
  padding: 8px 10px;
  font-size: 16px;
}
#inventoryForm h2 {
  font-size: 20px;
  margin-bottom: 16px;
}
#inventoryForm label {
  display: block;
  margin-top: 2px;
  font-weight: 500;
}
#notesForm label {
  display: block;
  margin-top: 2px;
  font-weight: 500;
}

#notesForm h2 {
  font-size: 20px;
  margin-bottom: 16px;
}

#notesForm input,
#notesForm textarea {
  width: 100%;
  max-width: 100%;
  margin-bottom: 8px;
  display: block;
  padding: 8px 10px;
  font-size: 16px;
  line-height: 1.4;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* === Responsive Tweaks === */
@media (max-width: 650px) {
  body {
    margin: 20px;
    font-size: 16px;
  }
    .footer {
    font-size: 16px !important;
 
}
.cool-font {
  font-size: 60px !important;
}

  .title-block {
    padding: 0 8px;
  }

  .title-block .line1,
  .title-block .line2 {
    font-size: 36px;
  }

  header {
    margin-bottom: 16px;
  }
}
/* === Invoice Form Specific === */
#invoiceForm label {
  display: block;
  margin-top: 2px;
  font-weight: 500;
}

#invoiceForm h2 {
  font-size: 20px;
  margin-bottom: 16px;
}

#invoiceForm input,
#invoiceForm select {
  width: 100%;
  max-width: 100%;
  margin-bottom: 8px;
  display: block;
  padding: 8px 10px;
  font-size: 16px;
}

#invoiceForm button {
  width: auto;
  max-width: 200px;
  display: inline-block;
  margin-bottom: 8px;
  background-color: #0078D4;
  color: white;
  border: none;
  border-radius: 5px;
  padding: 8px 14px;
  font-size: 16px;
}

#invoiceForm button:hover {
  background-color: #005A9E;
}

.item-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.item-row input {
  flex: 1;
  min-width: 100px;
}

/* === Footer Buttons === */
.footer {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer button {
  background-color: #444;
  color: white;
  padding: 10px 20px;
  font-size: 15px;
  border: none;
  border-radius: 4px;
}

.footer button:hover {
  background-color: #222;
}
.button-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.cool-font {
  font-family: 'Segoe UI', 'Open Sans', sans-serif;
  font-size: 2.5em;
  font-style: italic;
  font-weight: bold;
  font-weight: 700;
}

.bold-italic {
  font-weight: bold;
  font-style: italic;
}

.line2 {
  font-size: 1.2em;
  margin-top: -10px;
  color: #555;
}

.title-block {
  text-align: left;
  margin-bottom: 20px;
}

.title-block img {
  max-height: 80px;
  margin-top: 10px;
  display: block;
}
body.dark-mode .footer {
  background-color: #121212 !important;
  color: #eee !important;
  border-top-color: #444 !important;
}
.footer {
  background-color: #f2f2f2;
  padding: 20px;
  font-size: 16px;
  color: #444;
  text-align: center;
  border-top: 1px solid #ccc;
}

.footer a {
  color: #0066cc;
}

body.dark-mode .footer {
  background-color: #121212 !important;
  color: #eee !important;
  border-top-color: #444 !important;
}

body.dark-mode .footer a {
  color: #66b2ff !important;
}
.form-group {
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
}

.form-group label {
  margin-bottom: 5px;
  font-weight: bold;
  color: #333;
}

.dropdown {
  background-color: #f2f2f2;
  color: #333;
  border: 1px solid #ccc;
  padding: 8px;
  font-size: 14px;
  border-radius: 4px;
}

/* Dark mode overrides */
body.dark-mode .form-group label {
  color: #eee;
}

body.dark-mode .dropdown {
  background-color: #1e1e1e;
  color: #eee;
  border: 1px solid #444;
}
#reportForm button#submitOrder {
  display: block;
  margin: 20px auto 0 auto;
}

.footer {
  font-size: 1rem !important;
  font-size: 14px !important;
}
/* restore blue on Add/Delete when dark-mode is active */
body.dark-mode button.add-btn,
body.dark-mode button.remove-btn {
  background-color: #007bff;
  color: #fff;
  border-color: #007bff;
}

  /* force each item row to be a flex‐row like Inventory */
  #items .item {
    display: flex !important;
    align-items: center;
    gap: 0.5em;
    margin-bottom: 0.75em;
  }
  /* inputs keep natural size unless otherwise desired */
  #items .item input {
    flex: none;
  }
  /* group remove/add buttons inline */
  .button-row, .item > button.remove-btn {
    display: flex;
    gap: 0.5em;
  }
 /* make each .item a horizontal flex row */
  #items .item {
    display: flex !important;
    align-items: center;
    gap: 0.5em;
    margin-bottom: 0.75em;
  }

  /* stop inputs from stretching full-width inside .item */
  #items .item input {
    display: inline-block !important;
    width: auto !important;
    flex: none !important;
  }

  /* keep the delete button inline too */
  #items .item .remove-btn {
    flex: none !important;
  }

  /* your bottom button row */
  .button-row {
    display: flex;
    gap: 0.5em;
    margin-top: 1em;
  }
  #items .item:first-child .remove-btn {
  display: none;
}
/* hide the delete button in the original first item-row only */
#items .item-row:first-child .remove-btn {
  display: none;
}
 /* 1) Force each row in the Quotes page to be a flex‐row */
  #items .item-row {
    display: flex !important;
    align-items: center;
    gap: 0.5em;
    margin-bottom: 0.75em;
  }

  /* 2) Prevent inputs from stretching 100% */
  #items .item-row input {
    display: inline-block !important;
    width: auto !important;
    flex: none !important;
  }

  /* 3) Hide the first‐row Delete button (you already did this for .remove-btn) */
  #items .item-row:first-child .remove-btn {
    display: none;
  }
  
  /* 1) Make each item-row a flex line */
  #items .item-row {
    display: flex !important;
    align-items: center;
    gap: 0.5em;
    margin-bottom: 0.75em;
  }

  /* 2) Prevent inputs from stretching full-width */
  #items .item-row input {
    display: inline-block !important;
    width: auto !important;
    flex: none !important;
  }

  /* 3) Hide the Delete button in the first/template row */
  #items .item-row:first-child .remove-btn {
    display: none;
  }

  /* 4) Keep your bottom buttons inline */
  .button-row {
    display: flex;
    gap: 0.5em;
    margin-top: 1em;
  }
button.add-btn,
button.remove-btn,
button[type="submit"],
#submitOrder,
#saveInventory {
  background-color: #007bff;
  color: white;
  border: none;
  padding: 6px 10px;
  font-size: 15px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

button.add-btn:hover,
button.remove-btn:hover,
button[type="submit"]:hover,
#submitOrder:hover,
#saveInventory:hover {
  background-color: #0056b3;
}
.button-row button.add-btn {
  background-color: #007bff;
  color: white;
  padding: 6px 10px;
  font-size: 15px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.button-row button.add-btn:hover {
  background-color: #0056b3;
}




/* one-line flex layout for each item row */
#items .item {
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin-bottom: 0.75em;
}

/* group bottom buttons inline */
.button-row {
  display: flex;
  gap: 0.5em;
  margin-top: 1em;
}

/* hide Delete on the very first row */
#items .item:first-child .remove-btn {
  display: none;
}
/* Inventory + global add/remove button look */
button.add-btn,
button.remove-btn,
#reportForm button#submitOrder {
  background-color: #007bff;
  color: #fff;
  border: none;
  padding: 0.5em 1em;
  border-radius: 4px;
  cursor: pointer;
}

/* Inline the Inventory button row */
#inventoryForm .button-row {
  display: flex;
  gap: 0.5em;
  margin-top: 1em;
}
/* Strong, final override so .add-btn and submit inside .button-row match darkToggle spacing while keeping blue */
.button-row button.add-btn,
.button-row button[type="submit"],
.button-row .add-btn,
.button-row .remove-btn,
button.add-btn,
button.remove-btn,
button[type="submit"] {
  padding: 6px 10px !important;      /* match #darkToggle */
  font-size: 15px !important;         /* match #darkToggle */
  background-color: #007bff !important; /* keep blue */
  color: #fff !important;
  border: none !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  transition: background-color 0.2s ease !important;
}

/* Hover state */
.button-row button.add-btn:hover,
.button-row button[type="submit"]:hover,
button.add-btn:hover,
button[type="submit"]:hover {
  background-color: #0056b3 !important;
}
/* Final override: ensure Save button on quote page matches .add-btn/darkToggle look */
#invoiceForm button.add-btn,
#invoiceForm button[type="submit"],
.button-row button.add-btn,
.button-row button[type="submit"],
button.add-btn,
button[type="submit"] {
  padding: 6px 10px !important;
  font-size: 15px !important;
  background-color: #007bff !important;
  color: #fff !important;
  border: none !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  transition: background-color 0.2s ease !important;
}

#invoiceForm button.add-btn:hover,
#invoiceForm button[type="submit"]:hover,
.button-row button.add-btn:hover,
.button-row button[type="submit"]:hover,
button.add-btn:hover,
button[type="submit"]:hover {
  background-color: #0056b3 !important;
}
