/* =========================================================
   RK FARM ENTERPRISE — CENTRAL INVENTORY
   ========================================================= */

.rk-ci-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
}

.rk-ci-title {
  margin: 0 !important;
  font-size: 29px !important;
  line-height: 1.1;
  font-weight: 850 !important;
  letter-spacing: -.7px;
  color: #093f31 !important;
}

.rk-ci-subtitle {
  margin: 7px 0 0;
  max-width: 760px;
  font-size: 14px;
  line-height: 1.65;
  color: #70847a;
}

.rk-ci-refresh {
  min-height: 43px;
  padding: 0 16px;
  border: 1px solid #c8ddd2;
  border-radius: 10px;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
  color: #08644b;
  cursor: pointer;
}

.rk-ci-refresh:hover {
  background: #f1f9f5;
}


/* KPI */

.rk-ci-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.rk-ci-kpi {
  position: relative;
  min-height: 145px;
  padding: 21px 22px;
  border: 1px solid #d8e6df;
  border-radius: 18px;
  background:
    linear-gradient(
      145deg,
      #ffffff 0%,
      #f7fbf9 100%
    );
  box-shadow:
    0 15px 38px rgba(15, 66, 48, .07);
  overflow: hidden;
}

.rk-ci-kpi::after {
  content: "";
  position: absolute;
  top: -32px;
  right: -28px;
  width: 105px;
  height: 105px;
  border-radius: 50%;
  background: rgba(10, 126, 90, .055);
}

.rk-ci-kpi-accent {
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background:
    linear-gradient(
      180deg,
      #087455,
      #22a474
    );
}

.rk-ci-kpi-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rk-ci-kpi-icon {
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #e9f6f0;
  font-size: 16px;
  color: #087254;
}

.rk-ci-kpi-label {
  font-size: 10px;
  line-height: 1.3;
  font-weight: 850;
  letter-spacing: .75px;
  text-transform: uppercase;
  color: #6b8076;
}

.rk-ci-kpi-value {
  position: relative;
  z-index: 2;
  margin-top: 16px;
  font-size: 30px;
  line-height: 1;
  font-weight: 850;
  letter-spacing: -.8px;
  color: #093f31;
}

.rk-ci-kpi-note {
  position: relative;
  z-index: 2;
  margin-top: 10px;
  font-size: 11px;
  color: #82928a;
}


/* CONTROL BAR */

.rk-ci-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.rk-ci-search-wrap {
  position: relative;
  width: min(440px, 100%);
}

.rk-ci-search {
  width: 100%;
  min-height: 46px;
  padding: 0 15px 0 42px;
  border: 1px solid #ceded6;
  border-radius: 11px;
  background: #fff;
  font-size: 13px;
  color: #183f33;
}

.rk-ci-search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #7c9187;
  pointer-events: none;
}

.rk-ci-filter {
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid #ceded6;
  border-radius: 11px;
  background: #fff;
  font-size: 12px;
  color: #284c40;
}


/* TABLE */

.rk-ci-table-card {
  overflow: hidden;
  border: 1px solid #d7e5de;
  border-radius: 18px;
  background: #fff;
  box-shadow:
    0 16px 42px rgba(14, 64, 47, .075);
}

.rk-ci-table-wrap {
  overflow-x: auto;
}

.rk-ci-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: separate;
  border-spacing: 0;
}

.rk-ci-table th {
  height: 59px;
  padding: 0 15px;
  border-bottom: 1px solid #dce7e2;
  background:
    linear-gradient(
      180deg,
      #f8fbf9,
      #f3f8f5
    );
  text-align: left;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .55px;
  text-transform: uppercase;
  color: #667b72;
  white-space: nowrap;
}

.rk-ci-table td {
  padding: 17px 15px;
  border-bottom: 1px solid #edf2ef;
  font-size: 12px;
  line-height: 1.45;
  color: #294b40;
  vertical-align: middle;
}

.rk-ci-table tbody tr {
  transition:
    background .15s ease,
    transform .15s ease;
}

.rk-ci-table tbody tr:hover {
  background: #f9fcfa;
}

.rk-ci-table tbody tr:last-child td {
  border-bottom: 0;
}

.rk-ci-product {
  min-width: 170px;
}

.rk-ci-product-name {
  display: block;
  font-size: 13px;
  font-weight: 850;
  color: #093f31;
}

.rk-ci-product-local {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  font-weight: 650;
  color: #517267;
}

.rk-ci-product-code {
  display: block;
  margin-top: 4px;
  font-size: 9px;
  letter-spacing: .45px;
  color: #899991;
}

.rk-ci-number {
  font-size: 13px;
  font-weight: 800;
  color: #193f33;
}

.rk-ci-money {
  font-size: 13px;
  font-weight: 850;
  color: #075b44;
}

.rk-ci-zero {
  color: #93a29a;
}

.rk-ci-lots {
  display: inline-flex;
  min-width: 29px;
  height: 29px;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border-radius: 999px;
  background: #edf7f2;
  font-size: 11px;
  font-weight: 850;
  color: #087253;
}

.rk-ci-status {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .2px;
}

.rk-ci-status.in-stock {
  background: #e5f7ed;
  color: #08714f;
}

.rk-ci-status.out-of-stock {
  background: #f2f4f3;
  color: #798881;
}

.rk-ci-status.fully-reserved {
  background: #fff3dc;
  color: #966817;
}

.rk-ci-actions {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}

.rk-ci-action {
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid #cbded4;
  border-radius: 8px;
  background: #fff;
  font-size: 10px;
  font-weight: 800;
  color: #0b654b;
  cursor: pointer;
}

.rk-ci-action:hover {
  border-color: #9bc7b4;
  background: #edf8f2;
}

.rk-ci-action.primary {
  border-color: #087354;
  background: #087354;
  color: #fff;
}

.rk-ci-empty {
  padding: 55px 20px !important;
  text-align: center;
  font-size: 13px !important;
  color: #778a81 !important;
}


/* MODAL */

.rk-ci-modal {
  width: min(1120px, 96vw) !important;
  max-height: 91vh !important;
  overflow-y: auto !important;
  border-radius: 20px !important;
}

.rk-ci-modal-subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: #74887e;
}

.rk-ci-product-summary {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.rk-ci-product-summary > div {
  padding: 16px;
  border: 1px solid #dbe7e1;
  border-radius: 13px;
  background: #fbfdfc;
}

.rk-ci-product-summary span {
  display: block;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: #71847b;
}

.rk-ci-product-summary strong {
  display: block;
  margin-top: 7px;
  font-size: 17px;
  font-weight: 850;
  color: #093f31;
}

.rk-ci-detail-table-card {
  overflow: hidden;
  border: 1px solid #dbe7e1;
  border-radius: 13px;
  background: #fff;
}

.rk-ci-detail-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

.rk-ci-detail-table th {
  height: 48px;
  padding: 0 12px;
  border-bottom: 1px solid #dce7e2;
  background: #f5f9f7;
  text-align: left;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .45px;
  text-transform: uppercase;
  color: #687c73;
  white-space: nowrap;
}

.rk-ci-detail-table td {
  padding: 14px 12px;
  border-bottom: 1px solid #edf2ef;
  font-size: 11px;
  color: #294b40;
  vertical-align: middle;
}

.rk-ci-detail-table tbody tr:last-child td {
  border-bottom: 0;
}

.rk-ci-direction {
  display: inline-flex;
  min-width: 28px;
  height: 23px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 850;
}

.rk-ci-direction.in {
  background: #e1f6eb;
  color: #087252;
}

.rk-ci-direction.out {
  background: #fff0e7;
  color: #a75a29;
}

@media (max-width: 1100px) {
  .rk-ci-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rk-ci-product-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .rk-ci-header,
  .rk-ci-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .rk-ci-kpis,
  .rk-ci-product-summary {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   PURCHASE LOT TRACEABILITY — DESKTOP FIT
   ========================================================= */

.rk-ci-modal {
  width: min(1380px, 97vw) !important;
}

.rk-ci-detail-table {
  width: 100%;
  min-width: 0 !important;
  table-layout: fixed;
}

.rk-ci-detail-table th,
.rk-ci-detail-table td {
  padding-left: 9px;
  padding-right: 9px;
  white-space: normal;
  word-break: break-word;
}

.rk-ci-detail-table th:nth-child(1),
.rk-ci-detail-table td:nth-child(1) {
  width: 20%;
}

.rk-ci-detail-table th:nth-child(2),
.rk-ci-detail-table td:nth-child(2) {
  width: 13%;
}

.rk-ci-detail-table th:nth-child(3),
.rk-ci-detail-table td:nth-child(3) {
  width: 17%;
}

.rk-ci-detail-table th:nth-child(4),
.rk-ci-detail-table td:nth-child(4),
.rk-ci-detail-table th:nth-child(5),
.rk-ci-detail-table td:nth-child(5),
.rk-ci-detail-table th:nth-child(6),
.rk-ci-detail-table td:nth-child(6),
.rk-ci-detail-table th:nth-child(7),
.rk-ci-detail-table td:nth-child(7) {
  width: 6%;
  text-align: right;
}

.rk-ci-detail-table th:nth-child(8),
.rk-ci-detail-table td:nth-child(8),
.rk-ci-detail-table th:nth-child(9),
.rk-ci-detail-table td:nth-child(9) {
  width: 8%;
  text-align: right;
}

.rk-ci-detail-table th:nth-child(10),
.rk-ci-detail-table td:nth-child(10) {
  width: 9%;
}

.rk-ci-detail-table th:nth-child(11),
.rk-ci-detail-table td:nth-child(11) {
  width: 7%;
  text-align: center;
}

.rk-ci-detail-table-card .rk-ci-table-wrap {
  overflow-x: visible;
}

@media (max-width: 1050px) {
  .rk-ci-detail-table {
    min-width: 1000px !important;
    table-layout: auto;
  }

  .rk-ci-detail-table-card .rk-ci-table-wrap {
    overflow-x: auto;
  }
}
