/* AgroLidya portal brand — logo green instead of Xintra purple */
:root {
  --primary-rgb: 20, 116, 21;
  --primary-color: rgb(var(--primary-rgb));
  --primary-border: rgb(var(--primary-rgb));
  --primary01: rgba(var(--primary-rgb), 0.1);
  --primary02: rgba(var(--primary-rgb), 0.2);
  --primary03: rgba(var(--primary-rgb), 0.3);
  --primary04: rgba(var(--primary-rgb), 0.4);
  --primary05: rgba(var(--primary-rgb), 0.5);
  --primary06: rgba(var(--primary-rgb), 0.6);
  --primary07: rgba(var(--primary-rgb), 0.7);
  --primary08: rgba(var(--primary-rgb), 0.8);
  --primary09: rgba(var(--primary-rgb), 0.9);

  /* Slate instead of the theme purple, matching the design's neutral status colour */
  --secondary-rgb: 15, 43, 70;
  --secondary-color: rgb(var(--secondary-rgb));
  --secondary-border: rgb(var(--secondary-rgb));
}

.btn-primary {
  --bs-btn-bg: #147415;
  --bs-btn-border-color: #147415;
  --bs-btn-hover-bg: #0f5c11;
  --bs-btn-hover-border-color: #0f5c11;
  --bs-btn-active-bg: #0c4d0e;
  --bs-btn-active-border-color: #0c4d0e;
  --bs-btn-disabled-bg: #147415;
  --bs-btn-disabled-border-color: #147415;
  --bs-btn-focus-shadow-rgb: var(--primary-rgb);
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(var(--primary-rgb), 0.55);
  box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.2);
}

/* Production — Cycle progress (horizontal stepper, matches design pack) */
.portal-cycle-steps {
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: 6px 0 0;
}

.portal-cycle-step {
  flex: 1;
  text-align: center;
  position: relative;
  min-width: 0;
}

.portal-cycle-step::before {
  content: "";
  position: absolute;
  top: 13px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: #dbe3ea;
}

.portal-cycle-step:first-child::before {
  display: none;
}

.portal-cycle-step--done::before,
.portal-cycle-step--now::before {
  background: #147415;
}

.portal-cycle-dot {
  position: relative;
  z-index: 1;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  margin: 0 auto 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 2px solid #dbe3ea;
  color: #8a9aab;
  font-size: 14px;
  line-height: 1;
}

.portal-cycle-step--done .portal-cycle-dot {
  background: #147415;
  border-color: #147415;
  color: #fff;
}

.portal-cycle-step--now .portal-cycle-dot {
  border-color: #147415;
  color: #147415;
}

.portal-cycle-step--now .portal-cycle-dot > i:not([class]) {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #147415;
  display: block;
}

.portal-cycle-step b {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: #0f2b46;
}

.portal-cycle-step span:not(.portal-cycle-dot) {
  display: block;
  font-size: 11.5px;
  color: #667c93;
  margin-top: 2px;
}

.portal-cycle-step--pending b {
  color: #8a9aab;
}

.portal-cycle-progress {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 20px;
}

.portal-cycle-bar {
  flex: 1;
  height: 8px;
  background: #dbe3ea;
  border-radius: 999px;
  overflow: hidden;
  display: block;
}

.portal-cycle-bar > i {
  display: block;
  height: 100%;
  background: #147415;
  border-radius: 999px;
}

.portal-cycle-progress > b {
  font-size: 12.5px;
  font-weight: 700;
  color: #0f2b46;
  white-space: nowrap;
}

@media (max-width: 620px) {
  .portal-cycle-steps {
    flex-direction: column;
    gap: 0;
    padding-left: 4px;
  }

  .portal-cycle-step {
    display: grid;
    grid-template-columns: 26px 1fr;
    grid-template-rows: auto auto;
    column-gap: 12px;
    text-align: left;
    padding-bottom: 16px;
  }

  .portal-cycle-step:last-child {
    padding-bottom: 0;
  }

  .portal-cycle-step::before {
    top: 26px;
    left: 12px;
    width: 2px;
    height: calc(100% - 10px);
  }

  .portal-cycle-dot {
    grid-row: 1 / span 2;
    margin: 0;
  }

  .portal-cycle-step b {
    grid-column: 2;
  }

  .portal-cycle-step span:not(.portal-cycle-dot) {
    grid-column: 2;
  }
}

/* Production — Live production metrics (2×2 tile grid) */
.portal-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: #e8eef3;
  border: 1px solid #e8eef3;
  border-radius: 0.5rem;
  overflow: hidden;
}

.portal-metric {
  background: #fff;
  padding: 14px 16px;
}

.portal-metric-icon {
  display: inline-block;
  color: #147415;
  font-size: 18px;
  line-height: 1;
  margin-bottom: 8px;
}

.portal-metric-label {
  margin: 0;
  font-size: 12px;
  color: #667c93;
}

.portal-metric-value {
  margin: 2px 0 0;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0f2b46;
  line-height: 1.25;
}

.portal-metric-foot {
  margin: 7px 0 0;
  font-size: 11.5px;
  color: #8a9aab;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.portal-delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 22px;
  padding: 0 8px;
  border-radius: 0.35rem;
  font-size: 11.5px;
  font-weight: 700;
}

.portal-delta i {
  font-size: 12px;
  line-height: 1;
}

.portal-delta--up,
.portal-delta--down {
  background: #e9f4ed;
  color: #147415;
}

@media (max-width: 575.98px) {
  .portal-metric-grid {
    grid-template-columns: 1fr;
  }
}

/* Production — hero photo fills the card (no white gap under the image) */
.portal-hero-card {
  display: flex;
  flex-direction: column;
  min-height: 230px;
}

.portal-hero-media {
  position: relative;
  flex: 1 1 auto;
  min-height: 230px;
  width: 100%;
}

.portal-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.portal-hero-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.25rem;
  background: linear-gradient(180deg, rgba(7, 23, 41, 0), rgba(7, 23, 41, 0.86));
}
