/* ======================================
   SALE PEN PAGE
====================================== */

.sale-pen-page {
  width: 100%;

  display: flex;

  flex-direction: column;

  gap: 15px;
}

/* ======================================
   SALE PEN HEADER
====================================== */

.sale-pen-header-widget {
  padding: 20px;
}

.sale-pen-header-widget h2 {
  margin: 0 0 8px 0;

  font-size: 26px;

  color: #ffffff;
}

.sale-pen-header-widget p {
  margin: 0;

  color: #cbd5e1;
}

/* ======================================
   STATS WIDGET
====================================== */

.sale-pen-stats-widget {
  padding: 15px;
}

.stats-grid {
  display: grid;

  grid-template-columns: repeat(3, 1fr);

  gap: 15px;
}

.stat-box {
  background: linear-gradient(145deg, #111827, #020617);

  border-radius: 12px;

  padding: 18px;

  text-align: center;

  border: 1px solid rgba(56, 189, 248, 0.15);

  transition: 0.25s ease;
}

.stat-box:hover {
  transform: translateY(-3px);

  border-color: #38bdf8;
}

.stat-title {
  display: block;

  color: #94a3b8;

  font-size: 14px;

  margin-bottom: 8px;
}

.stat-value {
  display: block;

  font-size: 24px;

  font-weight: bold;

  color: white;
}

/* ======================================
   FILTER WIDGET
====================================== */

.sale-pen-filters-widget {
  padding: 15px;
}

.filter-grid {
  display: grid;

  grid-template-columns: 2fr 1fr 1fr auto;

  gap: 12px;

  align-items: end;
}

.filter-item label {
  display: block;

  margin-bottom: 5px;

  color: #cbd5e1;

  font-size: 14px;
}

.filter-item input,
.filter-item select {
  width: 100%;

  padding: 10px;

  border-radius: 8px;

  border: 1px solid #334155;

  background: #020617;

  color: white;
}

.filter-item input:focus,
.filter-item select:focus {
  outline: none;

  border-color: #38bdf8;
}

.filter-action button {
  padding: 10px 18px;

  border: none;

  border-radius: 8px;

  background: #2563eb;

  color: white;

  cursor: pointer;

  font-weight: bold;
}

.filter-action button:hover {
  background: #1d4ed8;
}

/* ======================================
   SALE LIST
====================================== */

.sale-pen-list-widget {
  padding: 15px;
}

.sale-list-container {
  display: flex;

  flex-direction: column;

  gap: 12px;
}

.sale-cattle-card {
  background: linear-gradient(145deg, #111827, #020617);

  border-radius: 14px;

  padding: 18px;

  display: flex;

  justify-content: space-between;

  align-items: center;

  border: 1px solid rgba(148, 163, 184, 0.15);

  transition: 0.25s ease;
}

.sale-cattle-card:hover {
  transform: translateY(-3px);

  border-color: #38bdf8;
}

.cattle-name {
  font-size: 20px;

  font-weight: bold;

  color: white;
}

.cattle-details {
  display: flex;

  gap: 15px;

  color: #cbd5e1;

  font-size: 14px;
}

.sale-cattle-card button {
  background: #dc2626;

  border: none;

  padding: 10px 18px;

  border-radius: 8px;

  color: white;

  cursor: pointer;

  font-weight: bold;
}

.sale-cattle-card button:hover {
  background: #b91c1c;
}

/* ======================================
   EMPTY SALE PEN
====================================== */

.empty-sale-pen {
  text-align: center;

  padding: 40px;

  color: #94a3b8;
}

/* ======================================
   SHARED WIDGET POLISH
====================================== */

.sale-pen-page .widget {
  background: linear-gradient(
    145deg,
    rgba(15, 23, 42, 0.95),
    rgba(2, 6, 23, 0.95)
  );

  border: 1px solid rgba(148, 163, 184, 0.15);

  border-radius: 14px;

  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

.sale-pen-page .widget-header {
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);

  padding-bottom: 12px;

  margin-bottom: 15px;
}
/* ======================================
   MARKETPLACE LISTING WIDGET
====================================== */

.sale-pen-market-widget {
  padding: 15px;
}

/* MARKETPLACE CARD */

.sale-pen-market-card {
  background: linear-gradient(145deg, #111827, #020617);

  border-radius: 14px;

  padding: 20px;

  margin-bottom: 15px;

  border: 1px solid rgba(56, 189, 248, 0.15);

  transition: 0.25s ease;
}

.sale-pen-market-card:hover {
  transform: translateY(-3px);

  border-color: #38bdf8;
}

.sale-pen-market-card h4 {
  color: white;

  font-size: 20px;

  margin-bottom: 10px;
}

.sale-pen-market-card p {
  color: #cbd5e1;

  margin: 8px 0;
}

/* ======================================
   FORM ELEMENTS
====================================== */

.sale-pen-market-card label {
  display: block;

  margin-top: 12px;

  margin-bottom: 6px;

  color: #cbd5e1;

  font-size: 14px;

  font-weight: 600;
}

.sale-pen-market-card input,
.sale-pen-market-card textarea {
  width: 100%;

  padding: 12px;

  border-radius: 10px;

  background: #020617;

  border: 1px solid #334155;

  color: white;
}

.sale-pen-market-card textarea {
  min-height: 100px;

  resize: vertical;
}

.sale-pen-market-card input:focus,
.sale-pen-market-card textarea:focus {
  outline: none;

  border-color: #2563eb;
}

/* ======================================
   GENERAL SALE PEN FORMS
====================================== */

.sale-pen-page .widget-body form {
  background: linear-gradient(145deg, #111827, #020617);

  border-radius: 14px;

  padding: 20px;

  margin-bottom: 20px;

  border: 1px solid rgba(148, 163, 184, 0.15);
}

.sale-pen-page .widget-body form h4 {
  color: white;

  font-size: 20px;

  margin-bottom: 12px;
}

.sale-pen-page .widget-body form p {
  color: #cbd5e1;
}

.sale-pen-page .widget-body form label {
  display: block;

  color: #cbd5e1;

  margin-top: 15px;

  margin-bottom: 6px;

  font-weight: 600;
}

.sale-pen-page .widget-body form input,
.sale-pen-page .widget-body form textarea,
.sale-pen-page .widget-body form select {
  width: 100%;

  padding: 12px;

  border-radius: 10px;

  background: #020617;

  border: 1px solid #334155;

  color: white;
}

.sale-pen-page .widget-body form textarea {
  min-height: 120px;
}

/* ======================================
   BUTTON SYSTEM
====================================== */

.sale-pen-page .widget-button {
  margin-top: 20px;

  width: 100%;

  padding: 12px;

  border-radius: 10px;

  background: #2563eb;

  color: white;

  font-weight: bold;

  border: none;

  cursor: pointer;

  transition: 0.2s ease;
}

.sale-pen-page .widget-button:hover {
  background: #1d4ed8;

  transform: translateY(-2px);
}

/* ======================================
   SUCCESS / ERROR
====================================== */

.widget-success {
  padding: 12px;

  margin-bottom: 15px;

  border-radius: 10px;

  background: rgba(34, 197, 94, 0.15);

  border: 1px solid rgba(34, 197, 94, 0.35);

  color: #bbf7d0;
}

.widget-error {
  padding: 12px;

  margin-bottom: 15px;

  border-radius: 10px;

  background: rgba(239, 68, 68, 0.15);

  border: 1px solid rgba(239, 68, 68, 0.35);

  color: #fecaca;
}

/* ======================================
   SALE PEN LIST CARDS
====================================== */

.sale-pen-page .widget-body > div {
  background: linear-gradient(145deg, #111827, #020617);

  border-radius: 14px;

  padding: 20px;

  margin-bottom: 15px;

  border: 1px solid rgba(148, 163, 184, 0.15);

  transition: 0.25s ease;
}

.sale-pen-page .widget-body > div:hover {
  transform: translateY(-3px);

  border-color: #38bdf8;
}

.sale-pen-page .widget-body h3,
.sale-pen-page .widget-body h4 {
  color: white;

  font-size: 20px;

  margin-bottom: 12px;
}

.sale-pen-page .widget-body p {
  color: #cbd5e1;

  margin: 8px 0;
}

/* ======================================
   CARD BUTTONS
====================================== */

.sale-pen-page .widget-body a,
.sale-pen-page .widget-body button {
  display: inline-block;

  padding: 10px 18px;

  border-radius: 8px;

  border: none;

  text-decoration: none;

  color: white;

  font-weight: bold;

  cursor: pointer;

  margin-right: 8px;
}

/* VIEW */

.sale-pen-page .widget-body a {
  background: #2563eb;
}

.sale-pen-page .widget-body a:hover {
  background: #1d4ed8;
}

/* DELETE */

.sale-pen-page .widget-body button {
  background: #dc2626;
}

.sale-pen-page .widget-body button:hover {
  background: #b91c1c;
}

/* REMOVE OLD HR LOOK */

.sale-pen-page .widget-body hr {
  display: none;
}
/* ======================================
   SALE PEN COMMAND CENTER
====================================== */

.sale-pen-command-widget {
  padding: 20px;
}

.sale-pen-command-grid {
  display: grid;

  grid-template-columns: repeat(3, 1fr);

  gap: 20px;
}

/* BASE CARD */

.sale-command-card {
  position: relative;

  border: none;

  border-radius: 16px;

  padding: 25px;

  text-align: center;

  color: white;

  cursor: pointer;

  transition: 0.25s ease;

  overflow: hidden;
}

/* CREATE SALE PEN BLUE */

.sale-command-card:nth-child(1) {
  background: linear-gradient(145deg, #2563eb, #1e3a8a);
}

/* MARKETPLACE GREEN */

.sale-command-card:nth-child(2) {
  background: linear-gradient(145deg, #16a34a, #14532d);
}

/* MANAGE RED */

.sale-command-card:nth-child(3) {
  background: linear-gradient(145deg, #dc2626, #7f1d1d);
}

.sale-command-card:hover {
  transform: translateY(-6px);

  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.45);
}

/* ICON */

.command-icon {
  font-size: 45px;

  margin-bottom: 15px;
}

/* TITLE */

.sale-command-card h4 {
  color: white;

  font-size: 22px;

  margin-bottom: 10px;
}

/* TEXT */

.sale-command-card p {
  color: #e2e8f0;

  font-size: 14px;

  line-height: 1.5;
}
.sale-pen-command-widget button.sale-command-card {
  background: inherit;
}
/* ======================================
   ACTION SECTIONS
====================================== */

.sale-action-section {
  margin-top: 20px;
}

.sale-action-section.hidden {
  display: none;
}

/* ======================================
   SALE PEN MODALS
====================================== */

.sale-pen-modal {
  display: none;

  position: fixed;

  inset: 0;

  width: 100%;

  height: 100%;

  z-index: 99999;
}

.sale-pen-modal.active {
  display: flex !important;

  justify-content: flex-start;

  align-items: center;

  padding-left: 260px;
}

.sale-pen-modal-overlay {
  position: absolute;

  inset: 0;

  background: rgba(0, 0, 0, 0.78);
}

.sale-pen-modal-box {
  position: relative;

  z-index: 100000;

  width: 90%;

  max-width: 700px;

  max-height: 85vh;

  overflow-y: auto;

  padding: 30px;

  background: linear-gradient(145deg, #111827, #020617);

  border-radius: 18px;
  margin-left: 20px;
  border: 1px solid rgba(56, 189, 248, 0.25);

  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75);
}

/* MODAL CLOSE */

.sale-pen-modal-close {
  position: absolute;

  top: 15px;

  right: 15px;

  width: 36px;

  height: 36px;

  border-radius: 50%;

  border: none;

  background: #dc2626;

  color: white;

  cursor: pointer;

  font-size: 20px;
}

.sale-pen-modal-close:hover {
  background: #b91c1c;
}
/* ======================================
   SALE PEN MODAL COMMAND WINDOWS
====================================== */

.sale-pen-modal-box {
  background: linear-gradient(145deg, #0f172a, #020617);

  border: 1px solid rgba(56, 189, 248, 0.35);

  border-radius: 18px;

  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75);

  animation: saleModalOpen 0.25s ease;
}

/* OPEN ANIMATION */

@keyframes saleModalOpen {
  from {
    opacity: 0;

    transform: translateY(-20px) scale(0.95);
  }

  to {
    opacity: 1;

    transform: translateY(0) scale(1);
  }
}

/* ======================================
   MODAL WIDGET OVERRIDE
====================================== */

.sale-pen-modal-box .widget {
  background: transparent;

  border: none;

  box-shadow: none;
}

/* MODAL HEADER */

.sale-pen-modal-box .widget-header {
  border-bottom: 1px solid rgba(56, 189, 248, 0.25);

  padding-bottom: 15px;

  margin-bottom: 20px;
}

.sale-pen-modal-box .widget-header h3 {
  color: white;

  font-size: 24px;
}

/* MODAL BODY */

.sale-pen-modal-box .widget-body {
  color: white;
}

/* ======================================
   MODAL INPUTS
====================================== */

.sale-pen-modal-box input,
.sale-pen-modal-box textarea,
.sale-pen-modal-box select {
  background: #020617;

  border: 1px solid #334155;

  color: white;

  padding: 12px;

  border-radius: 10px;
}

.sale-pen-modal-box input:focus,
.sale-pen-modal-box textarea:focus,
.sale-pen-modal-box select:focus {
  outline: none;

  border-color: #38bdf8;

  box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}

/* ======================================
   MODAL BUTTONS
====================================== */

.sale-pen-modal-box .widget-button {
  background: #2563eb;

  border-radius: 10px;

  padding: 14px;

  font-size: 16px;
}

.sale-pen-modal-box .widget-button:hover {
  background: #1d4ed8;

  transform: translateY(-2px);
}

/* ======================================
   CREATE MODAL ACCENT
====================================== */

#salePenCreateModal .sale-pen-modal-box {
  border-color: rgba(37, 99, 235, 0.45);
}

/* ======================================
   MARKET MODAL ACCENT
====================================== */

#salePenMarketModal .sale-pen-modal-box {
  border-color: rgba(34, 197, 94, 0.45);
}

#salePenMarketModal .widget-button {
  background: #16a34a;
}

#salePenMarketModal .widget-button:hover {
  background: #15803d;
}

/* ======================================
   CLOSE BUTTON
====================================== */

.sale-pen-modal-close {
  background: #dc2626;

  box-shadow: 0 5px 15px rgba(220, 38, 38, 0.35);
}

.sale-pen-modal-close:hover {
  background: #b91c1c;

  transform: rotate(90deg);
}

/* ======================================
   MOBILE MODALS
====================================== */

@media (max-width: 900px) {
  .sale-pen-modal-box {
    max-height: 90vh;

    overflow-y: auto;

    border-radius: 14px;
  }

  .sale-pen-modal-box .widget-header h3 {
    font-size: 20px;
  }

  .sale-pen-modal.active {
    justify-content: center;

    padding-left: 0;
  }
}

/* ======================================
   SALE PEN MODAL POSITIONING
====================================== */

.sale-pen-modal.active {
  justify-content: flex-start;
  align-items: flex-start;
  padding-left: 320px; /* leaves room for sidebar */
  padding-top: 80px;
}

/* Modal box */

.sale-pen-modal-box {
  width: 600px;

  max-width: calc(100vw - 360px);

  max-height: calc(100vh - 120px);

  overflow-y: auto;

  padding: 30px;
}

/* ======================================
   MARKETPLACE FORM VERTICAL LAYOUT
====================================== */

.sale-pen-modal-box form {
  display: flex;

  flex-direction: column;

  gap: 12px;
}

.sale-pen-modal-box form label {
  margin-top: 10px;
}

.sale-pen-modal-box form input,
.sale-pen-modal-box form textarea,
.sale-pen-modal-box form select {
  width: 100%;

  box-sizing: border-box;
}

.sale-pen-modal-box textarea {
  min-height: 120px;
}

/* Button */

.sale-pen-modal-box .widget-button {
  width: 100%;

  margin-top: 20px;
}
/* ======================================
   MODAL MODERN SCROLLBAR
====================================== */

.sale-pen-modal-box::-webkit-scrollbar {
  width: 10px;
}

/* scrollbar track */

.sale-pen-modal-box::-webkit-scrollbar-track {
  background: #020617;

  border-radius: 20px;
}

/* scrollbar handle */

.sale-pen-modal-box::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #2563eb, #1e40af);

  border-radius: 20px;

  border: 2px solid #020617;
}

/* hover */

.sale-pen-modal-box::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #38bdf8, #2563eb);
}

/* Firefox support */

.sale-pen-modal-box {
  scrollbar-width: thin;

  scrollbar-color: #2563eb #020617;
}
/* ======================================
   SALE PEN ACTION BUTTONS FIX
====================================== */

.sale-pen-actions {
  display: flex;

  flex-direction: row;

  align-items: center;

  gap: 10px;

  margin-top: 15px;
}

/* VIEW PEN BUTTON */

.sale-pen-actions .widget-button {
  display: inline-flex !important;

  width: auto !important;

  flex: 0 0 auto;

  padding: 10px 18px;

  background: #2563eb;

  border-radius: 8px;

  color: white;

  text-decoration: none;

  font-weight: bold;

  justify-content: center;

  align-items: center;
}

/* DELETE BUTTON */

.sale-pen-actions .delete-button {
  display: inline-flex !important;

  width: auto !important;

  flex: 0 0 auto;

  padding: 10px 18px;

  background: #dc2626;

  border-radius: 8px;

  color: white;

  text-decoration: none;

  font-weight: bold;

  justify-content: center;

  align-items: center;
}

/* HOVER */

.sale-pen-actions .widget-button:hover {
  background: #1d4ed8;
}

.sale-pen-actions .delete-button:hover {
  background: #b91c1c;
}

/* MOBILE */

@media (max-width: 900px) {
  .sale-pen-actions {
    width: 100%;

    flex-direction: column;
  }

  .sale-pen-actions a {
    width: 100% !important;
  }
} /* ======================================
   SALE PEN ACTION BUTTONS
====================================== */

.sale-pen-actions {
  display: flex;

  gap: 10px;

  align-items: center;

  flex-wrap: wrap;
}

.sale-pen-actions a {
  display: inline-flex;

  align-items: center;

  justify-content: center;

  width: auto;

  min-width: 110px;

  padding: 10px 18px;

  border-radius: 8px;

  text-decoration: none;

  color: white;

  font-weight: bold;

  font-size: 14px;

  transition: 0.2s ease;
}

/* VIEW PEN */

.sale-pen-actions .widget-button {
  background: #2563eb;
}

.sale-pen-actions .widget-button:hover {
  background: #1d4ed8;

  transform: translateY(-2px);
}

/* DELETE */

.sale-pen-actions .delete-button {
  background: #dc2626;
}

.sale-pen-actions .delete-button:hover {
  background: #b91c1c;

  transform: translateY(-2px);
}

/* SALE PEN CARD */

.sale-pen-card {
  display: flex;

  justify-content: space-between;

  align-items: center;

  gap: 20px;
}

/* MOBILE */

@media (max-width: 900px) {
  .sale-pen-card {
    flex-direction: column;

    align-items: flex-start;
  }

  .sale-pen-actions {
    width: 100%;
  }

  .sale-pen-actions a {
    flex: 1;
  }
} /* ======================================
   SALE PEN ACTION BUTTONS FIX
====================================== */

.sale-pen-actions {
  display: flex;

  align-items: stretch;

  gap: 10px;
}

.sale-pen-actions a {
  display: flex !important;

  align-items: center;

  justify-content: center;

  height: 42px;

  box-sizing: border-box;

  margin: 0 !important;

  padding: 0 20px !important;

  border-radius: 8px;

  text-decoration: none;

  color: white;

  font-weight: bold;

  font-size: 14px;

  line-height: 1;
}

/* VIEW PEN */

.sale-pen-actions .widget-button {
  background: #2563eb !important;
}

/* DELETE */

.sale-pen-actions .delete-button {
  background: #dc2626 !important;
}

.sale-pen-actions a:hover {
  transform: translateY(-2px);
}
/* ======================================
   MOBILE MODAL
====================================== */

@media (max-width: 900px) {
  .sale-pen-modal.active {
    padding-left: 0;

    padding-top: 60px;
  }

  .sale-pen-modal-box {
    width: 95%;

    max-width: none;
  }
}
/* ======================================
   MOBILE
====================================== */

@media (max-width: 900px) {
  .sale-pen-command-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .filter-grid {
    grid-template-columns: 1fr;
  }

  .sale-cattle-card {
    flex-direction: column;

    align-items: flex-start;

    gap: 15px;
  }

  .cattle-details {
    flex-direction: column;

    gap: 5px;
  }

  .sale-pen-modal-box {
    width: 95%;

    padding: 20px;
  }
}
