/* -------------------------------------------------------
   MOBILE-FIRST BASE STYLES
------------------------------------------------------- */

#red-scoping .dashboard {
  max-width: 1400px;
  margin: 0 auto;
}

/* GRID */
#red-scoping .top-grid {
  display: block;
  margin-bottom: 1rem;
}

#red-scoping .left-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

#red-scoping .right-stats {
  margin-top: 1rem;
}

/* STATS CARD */
#red-scoping .stats-card {
  background: white;
  border: 2px solid #04A;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

#red-scoping .stats-title {
  font-weight: bold;
  color: #04A;
  margin-bottom: 0.5rem;
}

/* BUTTONS */
#red-scoping .btn {
  padding: 0.6rem 1rem;
  border-radius: 6px;
  border: none;
  background: #04A;
  color: white;
  cursor: pointer;
  font-size: 0.9rem;
}

#red-scoping .btn:hover {
  background: #217aff;
}

#red-scoping .add-product {
  font-weight: bold;
}

/* DELETE ICON */
#red-scoping .product-cell {
  position: relative;
}

#red-scoping .delete-icon {
  position: absolute;
  top: 6px;
  right: 6px;
  background: transparent;
  border: none;
  color: #e53935;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

#red-scoping .delete-icon:hover {
  color: red;
}

/* TABLE */
#red-scoping table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 10px;
  overflow: visible;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  table-layout: fixed;
}

#red-scoping th, #red-scoping td {
  border: 1px solid #ddd;
  padding: 0.5rem; /* MOBILE SMALLER */
  vertical-align: top;
  text-align: left;
  font-size: 0.85rem; /* MOBILE SMALLER */
}

#red-scoping th {
  background: #04a;
  color: white;
  font-weight: bold;
  position: relative;
  min-height: 40px; /* MOBILE SMALLER */
}

/* PRODUCT NAME */
#red-scoping .product-name {
  font-size: 0.9rem; /* MOBILE SMALLER */
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

#red-scoping .product-name:hover .edit-icon {
  opacity: 1;
}

#red-scoping .edit-icon {
  opacity: 0;
  transition: opacity 0.2s;
  color: #04A;
  font-size: 0.9rem;
}

#red-scoping .product-input {
  width: 90%;
  padding: 0.35rem; /* MOBILE SMALLER */
  font-size: 0.9rem;
  box-sizing: border-box;
}

/* CARD TOGGLES */
#red-scoping .card-toggle {
  padding: 0.4rem; /* MOBILE SMALLER */
  margin-bottom: 0.35rem;
  border-radius: 8px;
  border: 2px solid #ccc;
  cursor: pointer;
  user-select: none;
  text-align: center;
  transition: 0.15s;
  font-size: 0.8rem; /* MOBILE SMALLER */
  background: #fafafa;
}

#red-scoping .card-toggle.active {
  border-color: #04A;
  background: #04a;
  color: white;
  font-weight: 600;
}

#red-scoping .card-toggle h3 {
  margin: 0;
  font-size: 0.85rem; /* MOBILE SMALLER */
}

#red-scoping .card-toggle.active h3 {
  color: white;
}

/* SCOPE BLOCK */
#red-scoping .scope-block {
  margin-top: 0.5rem;
  font-size: 0.75rem; /* MOBILE SMALLER */
  line-height: 1.2;
}

#red-scoping .scope-in,
#red-scoping .scope-out,
#red-scoping .scope-warning {
  display: inline-block;
  width: 1rem;
  text-align: center;
  font-weight: bold;
}

#red-scoping .scope-in { color: green; }
#red-scoping .scope-out { color: red; }
#red-scoping .scope-warning { color: #b85a00; }

/* TOOLTIP */
#red-scoping .tooltip {
  position: relative;
  cursor: help;
}

#red-scoping .delete-tooltip {
  //position: relative;
  cursor: help;
}

#red-scoping .tooltip::after, #red-scoping .delete-tooltip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-10%);
  background: #F1F1F1;
  color: #000;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: bold;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease-out;
  z-index: 9999;
}

#red-scoping .tooltip:hover::after,
#red-scoping .tooltip:hover::before,
#red-scoping .delete-tooltip:hover::after,
#red-scoping .delete-tooltip:hover::before {
  opacity: 1;
}

/* -------------------------------------------------------
   FILTERS — MOBILE FIRST
------------------------------------------------------- */

/* Desktop filter hidden on mobile */
#red-scoping .filter-container {
  display: none;
}

/* Force filter text to black */
#red-scoping .filter-panel label {
  color: black;
}

/* Mobile filter button */
#red-scoping .mobile-filter-btn {
  display: block;
  background: #04A;
  color: white;
  padding: 0.7rem 1rem;
  border-radius: 6px;
  text-align: center;
  margin-bottom: 0.5rem;
  font-weight: 600;
  cursor: pointer;
}

/* Mobile filter panel */
#red-scoping .mobile-filter-panel {
  display: none;
  background: white;
  border: 1px solid #ccc;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-weight: bold;
  font-size: 0.9rem;
}

#red-scoping .mobile-filter-panel.active {
  display: block;
}

#red-scoping .mobile-filter-panel label {
  display: block;
  margin-bottom: 0.5rem;
}

/* -------------------------------------------------------
   STICKY ADD PRODUCT BUTTON (MOBILE)
------------------------------------------------------- */

#red-scoping .add-product-bottom {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 0.75rem;
    box-shadow: 0 -2px 6px rgba(0,0,0,0.15);
    text-align: center;
    z-index: 999;
}

#red-scoping .add-product-bottom .btn {
    width: 100%;
    font-size: 1rem;
    padding: 0.9rem;
}

@media (min-width: 700px) {

  #red-scoping .add-product-bottom {
    display: initial;
    position: initial;
    padding: initial;
    background: transparent;
    box-shadow: initial;
    text-align: initial;
  }

  #red-scoping .add-product-bottom .btn {
    margin-top: 1rem;
    width: initial;
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
  }
}

/* -------------------------------------------------------
   DESKTOP OVERRIDES
------------------------------------------------------- */
@media (min-width: 700px) {

  #red-scoping .top-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: start;
  }

  #red-scoping .right-stats {
    min-width: 260px;
    margin-top: 0;
  }

  /* Desktop filter visible */
  #red-scoping .filter-container {
    display: block;
    position: absolute;
    right: 0.75rem;
    top: 0.75rem;
    text-align: left;
  }

  #red-scoping .filter-panel {
    position: absolute;
    left: 0;
    top: 2rem;
    background: white;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 0.75rem;
    width: 220px;
    display: none;
    z-index: 9999;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  }

  #red-scoping .filter-panel.active {
    display: block;
  }

  /* Hide mobile filter on desktop */
  #red-scoping .mobile-filter-btn,
  #red-scoping .mobile-filter-panel {
    display: none;
  }

  #red-scoping th, #red-scoping td {
    padding: 0.75rem;
    font-size: 1rem;
  }

  #red-scoping .card-toggle {
    padding: 0.6rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
  }

  #red-scoping .card-toggle h3 {
    font-size: 1rem;
  }

  #red-scoping .scope-block {
    font-size: 0.85rem;
  }

  #red-scoping .scope-in,
  #red-scoping .scope-out,
  #red-scoping .scope-warning {
    width: 1.2rem;
  }
}