/* customerportal.css */
html{
  font-size: 62.5%;
}

/* Reset and base font styles */
body {
  font-family: 'Roboto', sans-serif;
  background-color: #f9f9f9;
  color: #333;
  margin: 0;
  padding: 2rem;
  font-size: 1.6rem;
}
h2 {
  font-size: 2.6rem;
}

.copyright {
  font-size: 1.3rem;
}

/* Container layout */
.container {
  max-width: 960px;
  margin: auto;
  background: #fff;
  padding: 2rem;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  font-size: 1.6rem;
}

/* Desktop Header and navigation */
header h1 {
  margin-bottom: 0;
}

header p {
  font-size: 1.6rem;
  color: #666;
}

a {
  color: #1565c0;
  text-decoration: none;
}

a:hover {
  /*text-decoration: underline;*/
}

.main-nav {
  margin-top: 1rem;
  background: #2a5d84;
  border-radius: 4px;
}

.nav-list {
  display: flex;
  align-items: center;
  list-style: none;
  padding-left: 1rem;
  gap: 1.25rem;
}

.nav-list li {
  margin: 0;
  font-size: 1.6rem;
}

.nav-list a {
  text-decoration: none;
  font-weight: 500;
  color: #ffffff;
  padding: 0.25rem 0.5rem;
  transition: color 0.2s ease;
}

.nav-list a:hover {
  color: wheat;
}

.nav-spacer {
  flex-grow: 1;
}

.nav-list > li:not(.logout-container) {
  /* Normal nav items group left */
  flex: 0 0 auto;
}

.logout-container {
  margin-left: auto; /* 👈 Pushes logout all the way right */
}

.nav-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-left {
    display: flex;
    gap: 2.25rem;
    list-style: none;
    padding-left: 1.5rem;
    margin: 0;
}

ul.nav-left {
    font-size: 1.6rem;
    gap: 4rem;
    padding-left: 2rem;
}

.nav-right {
    display: flex;
    gap: .25rem;
    list-style: none;
    padding-left: 1rem;
    margin: 0;
}

.nav-left a,
.nav-right button {
  font-weight: 500;
  color: #ffffff;
  text-decoration: none;
}
.nav-left a:hover {
  color: wheat;
}


.logout-btn {
  display: flex;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 1.6rem;
  font-weight: 500;
  color: #ffffff;
  cursor: pointer;
  align-items: center;
  padding: 0 1.25rem;
  text-decoration: none;
}

.logout-icon {
  margin-right: 0.15em;
  font-size: 1.6rem;
}

ul.nav-right {
    display: flex;
    align-items: center;
}

/* Base layout: flex row */
.nav-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  list-style: none;
  gap: 1rem;
  padding: 0;
  margin: 0;
}

/* Section headings */
h2, h3 {
  color: #2b2b2b;
  margin-top: 2rem;
}

/* Lists and data */
ul {
  padding-left: 1.3rem;
}

ul li {
  margin-bottom: 0;
}

/* Form styles */
form {
  margin-top: 1rem;
}

input, button, select, textarea {
  padding: 0.5rem;
  margin-bottom: 1rem;
  border-radius: 4px;
  border: 1px solid #ccc;
  width: 100%;
  font-size: 1.6rem;
  box-sizing: border-box;
}

button {
  background-color: #1565c0;
  color: white;
  border: none;
  cursor: pointer;
}

button:hover {

}

/* Customer Login */
body.customer-login {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}
h2.login-title {
  color: wheat;
  margin: auto;
}
.login-wrapper {
  max-width: 400px;
  border-radius: 4px;
  background: #183059;
  padding: 20px;
}
label {
    color: white;
}
p.login-error {
  color: red;
}
ul.errorlist.nonfield li {
  color: white;
}
/* Product Request Form */
form.product-request-form label {
    color: black;
}

/* Custom Alert */

alert-warning {
  background-color: #fff8e1;
  border-color: #ffe082;
  color: #8c6d1f;
}
.alert-error {
  background-color: #fdecea;
  border-color: #f5c6cb;
  color: #842029;
}
.alert-info {
  background-color: #e6f0fa;
  border-color: #a5c2e2;
  color: #2c679a;
}
.alert-success {
  background-color: #e6f7e6;
  border: 1px solid #c5e1c5;
  color: #2e7d32;
  padding: 12px 18px;
  border-radius: 4px;
  font-size: 1.6rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.alert-success .btn-close {
  background: none;
  color: #2e7d32;
  opacity: 0.7;
}

@keyframes fadeInSlide {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.alert-success {
  animation: fadeInSlide 0.4s ease-out;
}
.custom-alert {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #e6f7e6;
  border: 1px solid #c5e1c5;
  color: #2e7d32;
  padding: 12px 18px;
  border-radius: 4px;
  margin-bottom: 1rem;
  font-size: 1.6rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: opacity 0.4s ease, transform 0.3s ease;
}
.custom-alert.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: auto;
  z-index: 9999;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.dismiss-btn {
  background: none;
  border: none;
  font-size: 1.6rem;
  color: #2e7d32;
  cursor: pointer;
  opacity: 0.7;
  margin-left: 12px;
}
.dismiss-btn:hover {
  opacity: 1;
}

.custom-alert {
  transition: opacity 0.4s ease, transform 0.3s ease;
}

.custom-alert.fade-out {
  opacity: 0;
  transform: translateY(-4px);
}

/* Main dashboard section */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.top-row {
  display: flex;
  gap: 1rem;
  align-items: stretch;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.dashboard-tile {
  display: flex;
  align-items: center;
  background: #f0f4f8;
  border: 1px solid #d0d7de;
  border-radius: 4px;
  padding: 1rem 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  min-width: 280px;
}
.calendar-tile {
  background: #fff;
  border-radius: 4px;
  width: 100px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  font-family: 'Roboto', sans-serif;
  padding: 0.5rem 0.75rem;
}

.calendar-header {
  color: #d64541; /* soft red for day name */
  font-weight: 600;
  font-size: 1.6rem;
}

.calendar-day {
  color: #222;
  font-size: 3.2rem;
  font-weight: 700;
  margin-top: 0.25rem;
}

/* Logo and Header */
.header-branding {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin: .5rem 0 2.5rem 0;
}

.company-logo {
  height: 48px;
  width: auto;
  object-fit: contain;
  border-radius: 4px;
}

h1.portal-heading {
    font-size: 3.8rem;
    margin-top: 0;
    font-family: 'Roboto';
    font-weight: 100;
    padding-left: 2rem;
}
li.session-user {
    display: flex;
    justify-content: center;
    align-items: center;
    font-style: italic;;
}
p.logged-in-user {
    color: wheat;
}

/* Dashboard Cards */
.dashboard-card {
  background: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.dashboard-card:hover, .schedule-tile:hover {
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.top-row .dashboard-card {
  padding: 2rem;
  font-weight: 500;
  font-size: 1.6rem;
}
.request-tile {
  background-color: #f0f8ff;
  border: 1.8px dashed #0c6efd;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 4px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.schedule-tile .btn-success {
    background-color: #ececec;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 4px;
    padding: 4.2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.schedule-tile .btn-icon {
    font-size: 18px;
}

.btn-icon {
  margin-right: 0.5em;
}

.calendar-year {
    font-size: 1.6rem;
  }

.dashboard-card h3 {
  font-size: 1.8rem;
  margin-top: 0.1rem;
  margin-bottom: 1rem;
  color: #2a5d84;
}

.dashboard-card table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1.3rem;
}

.dashboard-card th,
.dashboard-card td {
  padding: 0.5rem;
  border-bottom: 1px solid #ddd;
}

tr.db-card-table-header {
    text-align: left;
}

.see-all-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-weight: 500;
  font-size: 1.3rem;
  color: #0056b3;
}

footer {
    margin-top: 1rem;
}

/* Details Tables */
.table-wrapper,
.card-wrapper,
.general-info-wrapper {
  background: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  margin-bottom: 1rem;
}

.table-wrapper:hover,
.card-wrapper:hover,
.general-info-wrapper:hover {
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.table-wrapper h3,
.card-wrapper h3,
.general-info-wrapper h3 {
  font-size: 2rem;
  margin-top: 0.1rem;
  margin-bottom: 1rem;
  color: #2a5d84;
}

.table-wrapper table,
.card-wrapper table,
.general-info-wrapper table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1.3rem;
}

.table-wrapper th,
.table-wrapper td {
  font-size: 1.6rem;
  text-align: left;
  padding: 0.5rem;
  border-bottom: 1px solid #ddd;
}

.general-info-wrapper th,
.general-info-wrapper td,
.card-wrapper th,
.card-wrapper td {
  font-size: 1.6rem;
  text-align: left;
  padding: 0.5rem;
  vertical-align: top;
  /*border-bottom: 1px solid #ddd;*/
}


/* Mobile navigation toggle visibility */
.nav-toggle {
  display: none; /* hidden by default on desktop */
}

footer {
  margin-top: 1rem;
  font-size: 1.3rem;
}
footer p {
    text-align: center;
}

/* Make responsive to small screens */
@media (max-width: 768px) {
  body {
    padding: .5rem;
  }
  .nav-toggle {
    display: block;
    font-size: 2.6rem;
    cursor: pointer;
    padding: 0.5rem;
    margin-left: auto;
  }

  .company-logo {
    max-height: 100%;
    max-width: 345px;
    margin: 2rem 0 .5rem 0;
  }
  .header-branding {
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
    margin-bottom: .5rem;
    justify-content: center;
  }
  h1.portal-heading {
    font-size: 3rem;
    margin-top: 0;
    font-family: 'Roboto';
    font-weight: 100;
    padding: 1rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

  .nav-container {
    position: relative;
    z-index: 100;
  }
  .nav-wrapper {
    display: none; /* 👈 collapse by default */
    flex-direction: column;
    padding: 0.5rem 0;
    background-color: #e3f2fd;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease-out;
  }

  .nav-wrapper.expanded {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #e3f2fd;
    max-height: 400px;
    z-index: 1000;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    padding: 0.5rem 0;
    align-items: normal;
  }

  .nav-left,
  .nav-right {
    flex-direction: column;
    width: 100%;
    padding: 0;
    margin: 0;
    gap: 0;
  }

  ul.nav-left {
    font-size: 1.6rem;
    gap: 0;
    padding-left: 0;
}

  .nav-left li {
    list-style: none;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  }

  .nav-right li {
    list-style: none;
  }

  .nav-left a,
  .logout-btn {
    font-size: 1.6rem;
    color: #1565c0;
    width: 100%;
    text-align: left;
    padding: 0.4rem 0.3rem;
  }

  .nav-left a:hover,
  .logout-btn:hover {
    background-color: rgba(21, 101, 192, 0.1);
    color: #0d47a1;
  }
  li.session-user {
    display: none;
  }
  .nav-footer {
    margin-top: auto;
    padding: 0.5rem 1rem;
  }

  .nav-right {
    padding: 0;
    margin: 0;
    gap: 0;
    color: #0c6efd;
  }
  p.logged-in-user {
    margin: 0;
    color: black;
  }
  .nav-right button {
    font-weight: 500;
    text-decoration: none;
    color: black;
    font-size: 1.6rem;
    margin-bottom: 0;
  }

  .logout-btn {
    font-size: 0.95rem;
    width: 100%;
    text-align: left;
  }
  .dashboard-grid {
    margin: 1rem 0 1rem 0;
    gap: 1rem;
  }
  .top-row {
    margin-top: 1rem;
  }
  .calendar-request-row {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    justify-content: space-between;
    align-items: stretch;
    flex-wrap: wrap;
  }

  .calendar-tile {
    flex: 0 0 auto;
    max-width: 100px;
  }

  .request-tile {
    flex: 1;
    min-width: 0;
  }

  form {
    margin-top: 0;
  }
  select#per_page {
    margin: 0;
  }
  #event-list h3 {
    font-size: 1.8rem;
  }

}

/* Finished Product Details Page */
.fp-details-page {
    /*padding: 0 1rem;*/
}

.vertical-header-table th {
  background-color: #f4f6f8;
  font-weight: 600;
  padding: 0.5rem;
  white-space: nowrap;
  border-right: 1px solid #ddd;
  width: 1%; /* Forces th to shrink to its content */
}

.vertical-header-table td {
  padding: 0.5rem;
  background-color: #fff;
  border-bottom: 1px solid #eee;
}
.product-image img {
  max-width: 300px;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 0 6px rgba(0,0,0,0.1);
}
.carton-label-image img {
  max-width: 300px;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 0 6px rgba(0,0,0,0.1);
}
.pallet-build-image img {
  max-width: 300px;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 0 6px rgba(0,0,0,0.1);
}

/* List Page Pagination */
.custom-paginator {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.page-buttons a,
.page-buttons .current {
  padding: 0.4rem 0.8rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  text-decoration: none;
  color: #333;
  background-color: #f8f8f8;
  font-size: 1.3rem;
}

.page-buttons a:hover {
  background-color: #e0e0e0;
}

.page-buttons .current {
  background-color: #005ea2;
  color: white;
  border-color: #005ea2;
  font-weight: bold;
}

.per-page-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.per-page-form select {
  padding: 0.3rem 0.4rem;
  font-size: 1.3rem;
}

.per-page-label {
  font-size: 1.3rem;
  color: black;
}

.page-buttons a.disabled {
  pointer-events: none;
  color: #aaa;
  background-color: #f2f2f2;
  border: 1px solid #ddd;
  cursor: not-allowed;
}

.page-buttons .current {
  background-color: #005ea2;
  color: white;
  font-weight: bold;
  border-color: #005ea2;
}

/* Search Section on List Pages*/
.search-form {
  margin: 1rem 0;
}
.search-container {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  max-width: 600px;  /* Optional: restrict total width */
}

.search-container input[type="text"] {
  flex: 1;
  padding: 0.6rem 0.8rem;
  font-size: 1.3rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.search-container button {
  width: 20%;
  padding: 0.6rem 0.5rem;
  font-size: 1.3rem;
  background-color: #005ea2;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}

.search-container button:hover {
  background-color: #004a86;
}

/* Mobile View */
@media (max-width: 768px) {
  h2 {
    font-size: 2.1rem;
    text-align: left;
  }

  .detail-table th,
  .detail-table td {
    padding: 0.4rem;
    font-size: 0.85rem;
  }

  .detail-table th {
    background-color: #f9f9f9;
  }

  .table-wrapper {
    margin-bottom: 1rem;
    padding: .05rem;
    width: 100%;
    overflow-x: auto;
  }

  .formula-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .desktop-only {
    display: none;
  }

  .summary-row {
    cursor: pointer;
    background-color: #fff;
    border-bottom: 1px solid #ddd;
  }

  .summary-row td {
    font-size: 1.2rem;
  }

  .details-row td {
    padding: 0.1rem;
    background-color: #f9f9f9;
  }

  .mobile-detail-table {
    width: 100%;
    border-collapse: collapse;
  }

  .mobile-detail-table th {
    text-align: left;
    width: 40%;
    padding: .5rem 1rem 0.5rem 0.5rem;
    font-size: 0.85rem;
    background-color: #eef;
    color: #333;
  }

  .mobile-detail-table td {
    padding: 0.5rem;
    font-size: 0.85rem;
  }

  td.expand-icon-cell {
    text-align: center;
  }

  th.col-source, th.col-claim, th.col-qty, th.col-input {
    font-size: 1.2rem;
    padding: 0.5rem;
  }
  td.col-source, td.col-claim, td.col-qty, td.col-input {
    font-size: 1.1rem;
    padding: 0.5rem;
  }
  .list-table th, .list-table td {
    font-size: 1.2rem;
  }
  .mobile-detail-table th, .mobile-detail-table td {
    font-size: 1.2rem;
    padding: 0.5rem 1rem;
  }
  th.col-qty, th.col-input {
    text-align: center;
  }
  td.col-input, td.col-qty {
    text-align: right;
  }
  .detail-table th {
    font-size: 1.2rem;
  }

  .detail-image-table tr {
    display: flex;
    flex-direction: column-reverse; /* stacks image first, then details */
  }
  td.details-cell p {
    font-size: 1.4rem;
    padding: 0.25rem;
  }

  .details-cell,
  .image-cell {
    display: block;
    width: 100%;
  }

  .product-image,
  .carton-label-image,
  .pallet-build-image {
    text-align: center;
    margin-bottom: 1rem;
  }

  .details-cell p {
    font-size: 0.95rem;
    margin: 0.4rem 0;
  }

  tbody.packaging-rows tr td {
    font-size: 1.2rem;
  }

  .vertical-header-table {
    width: 100%;
    border-collapse: collapse;
  }

  .vertical-header-table tr {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0;
    border-bottom: 1px solid #ddd;
  }

  .vertical-header-table th,
  .vertical-header-table td {
    padding: 0.6rem 0.8rem;
    font-size: 1.3rem;
  }

  .vertical-header-table th {
    display: flex;
    width: inherit;
    background-color: #f2f2f2;
    font-weight: bold;
    color: #333;
    border-bottom: none;
  }

  .vertical-header-table td {
    display: block;
    background-color: #fff;
  }

}

/* Hide icon on desktop */
@media (min-width: 769px) {
  .expand-icon-cell {
    display: none;
  }
}

/* Desktop view - everything visible */
@media (min-width: 769px) {
  .details-row {
    display: none !important;
  }
  .summary-row {
    cursor: default;
  }
}

.expand-icon-cell {
  text-align: center;
  vertical-align: middle;
  width: 2rem;
}

.expand-icon {
  font-size: 1.2rem;
  color: #555;
  display: inline-block;
  transition: transform 0.3s ease;
}

/* Rotate icon when row is open */
.summary-row.open .expand-icon {
  transform: rotate(45deg); /* Changes '+' to '×' feel */
}


/* New Product Request Form */
.form-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.form-grid > div label {
  font-weight: 600;
  display: block;
  margin-bottom: 0.3rem;
}

.form-grid > div input,
.form-grid > div select,
.form-grid > div textarea {
  width: 100%;
  padding: 0.5rem;
}

@media (min-width: 769px) {
  .form-grid.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem 2rem;
  }
}

/* Finished Product Details */
td.col-qty, td.col-input, td.desktop-only {
    text-align: right;
}
th.col-qty, th.col-input, th.desktop-only {
    text-align: right;
}

/* Test Result List */
@media (max-width: 768px) {
  table.list-table th, td {
    font-size: 1.2rem;
  }
  td.col-lot, td.col-date {
    text-align: center;
  }
  th.col-lot, th.col-date {
    text-align: center;
  }
}

/* Customer Calendar */
.fc .fc-toolbar.fc-header-toolbar {
     margin-bottom: 1rem !important;
}

.fc-toolbar-chunk {
    display: flex !important;
}

table.fc-col-header {
    background: aliceblue;
}

.header-branding {
    margin: 2rem 1rem;
}

.show-all-list {
  display: flex;
  flex-direction: row;
  color: black;
}

#event-list h3 {
  font-size: 2.3rem;
}

.highlighted-group {
  animation: highlightFade 2s ease-in-out;
  background-color: #fff8dc; /* light yellow */
  border-left: 4px solid #ffa500;
  padding-left: 8px;
}

@keyframes highlightFade {
  0%   { background-color: #fff8dc; }
  100% { background-color: transparent; }
}

input[type="checkbox"][name$="-DELETE"] {
  display: none;
}

.dismiss-btn {
  display: flex;
  justify-content: right;
}

.ingredient-row th, .packaging-row th {
    text-align: left;
}

.claim-preserved {
  background-color: #fff3cd;
  color: #856404;
}

.group-label {
  font-weight: bold;
  background-color: #f5f5f5; /* Light gray */
  text-align: left;
}