/* =========================================================
   AKABER WAREHOUSE V1
   Inventory frontend
========================================================= */

#page-inventory {
  direction: rtl;
}

.warehouse-page-shell {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.warehouse-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px;
  background: #fff;
  border: 1px solid #e2e8e4;
  border-radius: 16px;
}

.warehouse-header h1 {
  margin: 4px 0 6px;
  font-size: 24px;
}

.warehouse-header span {
  color: #69766f;
  font-size: 13px;
}

.warehouse-eyebrow {
  margin: 0;
  color: #69766f;
  font-size: 13px;
}

.warehouse-stats {
  display: grid;
  grid-template-columns:
    repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.warehouse-stats article {
  background: #fff;
  border: 1px solid #e2e8e4;
  border-radius: 14px;
  padding: 18px;
}

.warehouse-stats span {
  display: block;
  color: #69766f;
  font-size: 13px;
  margin-bottom: 8px;
}

.warehouse-stats strong {
  font-size: 26px;
}

.warehouse-section {
  background: #fff;
  border: 1px solid #e2e8e4;
  border-radius: 16px;
  padding: 20px;
}

.warehouse-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.warehouse-section-heading h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.warehouse-section-heading p {
  margin: 0;
  color: #69766f;
  font-size: 13px;
}

.warehouse-location-grid {
  display: grid;
  grid-template-columns:
    repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.warehouse-location-card {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 14px;
  background: #f7faf8;
  border: 1px solid #edf1ee;
  border-radius: 12px;
}

.warehouse-location-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef8f1;
  color: #176043;
}

.warehouse-location-card strong {
  display: block;
  font-size: 14px;
}

.warehouse-location-card small {
  display: block;
  margin-top: 3px;
  color: #69766f;
}

.warehouse-location-count {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.warehouse-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.warehouse-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}

.warehouse-table th,
.warehouse-table td {
  padding: 12px 10px;
  border-bottom: 1px solid #edf1ee;
  text-align: right;
  vertical-align: middle;
  font-size: 13px;
}

.warehouse-table th {
  color: #69766f;
  font-weight: 600;
  background: #fafafa;
}

.warehouse-table tbody tr:hover {
  background: #fafcfb;
}

.warehouse-empty {
  text-align: center !important;
  padding: 36px !important;
  color: #69766f;
}

.warehouse-loading,
.warehouse-error {
  background: #fff;
  border: 1px solid #e2e8e4;
  border-radius: 16px;
  padding: 32px;
  text-align: center;
}

.warehouse-loading i {
  margin-left: 8px;
}

.warehouse-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: #991b1b;
}

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

@media (max-width: 760px) {
  .warehouse-header {
    flex-direction: column;
  }

  .warehouse-stats {
    grid-template-columns: 1fr;
  }

  .warehouse-location-grid {
    grid-template-columns: 1fr;
  }
}

/* Initial stocktake form */

.warehouse-stocktake-form {
  margin-top: 16px;
  padding-top: 18px;
  border-top: 1px solid #edf1ee;
}

.warehouse-form-grid {
  display: grid;
  grid-template-columns:
    repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.warehouse-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.warehouse-form-grid label > span {
  font-size: 13px;
  font-weight: 600;
  color: #56605c;
}

.warehouse-form-grid input,
.warehouse-form-grid select,
.warehouse-form-grid textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d8dce3;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
}

.warehouse-form-grid textarea {
  resize: vertical;
}

.warehouse-form-wide {
  grid-column: 1 / -1;
}

.warehouse-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.warehouse-form-message {
  margin-top: 14px;
  min-height: 20px;
  font-size: 13px;
}

@media (max-width: 900px) {
  .warehouse-form-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .warehouse-form-grid {
    grid-template-columns: 1fr;
  }

  .warehouse-form-wide {
    grid-column: auto;
  }
}

.warehouse-form-message.success {
  color: #166534;
  font-weight: 600;
}

.warehouse-form-message.error {
  color: #b91c1c;
  font-weight: 600;
}

.warehouse-stocktake-form button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* =========================================================
   Warehouse asset detail drawer
========================================================= */

.warehouse-asset-row {
  cursor: pointer;
}

.warehouse-asset-row:focus {
  outline: 2px solid #176043;
  outline-offset: -2px;
}

.warehouse-stock-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: #176043;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.warehouse-drawer {
  position: fixed;
  inset: 0;
  z-index: 10000;
}

.warehouse-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.warehouse-drawer-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: min(720px, 94vw);
  overflow-y: auto;
  background: #f7f8fa;
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.16);
  padding: 22px;
}

.warehouse-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.warehouse-drawer-header h2 {
  margin: 4px 0 0;
  font-size: 25px;
}

.warehouse-icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid #d6e1db;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.warehouse-detail-grid {
  display: grid;
  grid-template-columns:
    repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.warehouse-detail-grid > div {
  background: #fff;
  border: 1px solid #e2e8e4;
  border-radius: 12px;
  padding: 13px;
}

.warehouse-detail-grid span,
.warehouse-detail-note > span {
  display: block;
  color: #69766f;
  font-size: 12px;
  margin-bottom: 5px;
}

.warehouse-detail-grid strong {
  font-size: 14px;
}

.warehouse-detail-note {
  margin-top: 12px;
  padding: 14px;
  background: #fff;
  border: 1px solid #e2e8e4;
  border-radius: 12px;
}

.warehouse-detail-note p {
  margin: 0;
}

.warehouse-detail-section {
  margin-top: 18px;
  padding: 18px;
  background: #fff;
  border: 1px solid #e2e8e4;
  border-radius: 14px;
}

.warehouse-detail-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.warehouse-detail-heading h3 {
  margin: 0 0 4px;
  font-size: 17px;
}

.warehouse-detail-heading p {
  margin: 0;
  color: #69766f;
  font-size: 12px;
}

.warehouse-detail-empty {
  color: #69766f;
  text-align: center;
  padding: 22px;
  background: #fafafa;
  border-radius: 10px;
}

.warehouse-unit-form {
  margin-bottom: 16px;
  padding: 14px;
  background: #f7faf8;
  border-radius: 12px;
}

.warehouse-unit-list {
  display: grid;
  gap: 10px;
}

.warehouse-unit-card {
  padding: 13px;
  border: 1px solid #e2e8e4;
  border-radius: 11px;
}

.warehouse-unit-card > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.warehouse-unit-card span {
  color: #69766f;
  font-size: 12px;
}

.warehouse-unit-card p {
  margin: 8px 0 0;
  color: #56605c;
}

.warehouse-unit-meta {
  display: flex;
  gap: 12px;
  margin-top: 7px;
}

.warehouse-movement-list {
  display: grid;
}

.warehouse-movement-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid #edf1ee;
}

.warehouse-movement-row:last-child {
  border-bottom: 0;
}

.warehouse-movement-row strong,
.warehouse-movement-row span {
  display: block;
}

.warehouse-movement-row span,
.warehouse-movement-row time {
  color: #69766f;
  font-size: 12px;
  margin-top: 3px;
}

.warehouse-manager-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #dfe3e8;
}

.warehouse-danger-button {
  border: 1px solid #fecaca;
  background: #fff;
  color: #b91c1c;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font: inherit;
}

@media (max-width: 700px) {
  .warehouse-drawer-panel {
    width: 100%;
    max-width: none;
    padding: 14px;
  }

  .warehouse-detail-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .warehouse-detail-heading {
    flex-direction: column;
  }

  .warehouse-detail-heading .primary-action {
    width: 100%;
  }

  .warehouse-movement-row {
    flex-direction: column;
    gap: 4px;
  }

  .warehouse-manager-actions {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .warehouse-detail-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   Warehouse batch unit builder
========================================================= */

.warehouse-batch-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.warehouse-batch-toolbar strong {
  display: block;
  margin-bottom: 4px;
}

.warehouse-batch-toolbar p {
  margin: 0;
  color: #69766f;
  font-size: 12px;
}

.warehouse-batch-rows {
  display: grid;
  gap: 12px;
}

.warehouse-batch-row {
  padding: 14px;
  border: 1px solid #e1e5ea;
  border-radius: 12px;
  background: #fff;
}

.warehouse-batch-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.warehouse-batch-remove {
  width: 34px;
  height: 34px;
  border: 1px solid #e5e7eb;
  border-radius: 9px;
  background: #fff;
  color: #69766f;
  cursor: pointer;
}

.warehouse-batch-remove:hover {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fff7f7;
}

.warehouse-batch-row input[type="number"] {
  direction: ltr;
  text-align: left;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 700px) {
  .warehouse-batch-toolbar {
    flex-direction: column;
  }

  .warehouse-batch-toolbar
  .secondary-action {
    width: 100%;
  }
}

/* Unit details / contents */

.warehouse-unit-clickable {
  cursor: pointer;
}

.warehouse-unit-clickable:hover {
  border-color: #95c9a9;
  background: #f9fcfa;
}

.warehouse-unit-clickable:focus {
  outline: 2px solid #176043;
  outline-offset: 2px;
}

.warehouse-unit-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: #176043;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.warehouse-back-link {
  border: 0;
  padding: 0;
  margin-bottom: 8px;
  background: transparent;
  color: #176043;
  cursor: pointer;
  font: inherit;
}

.warehouse-content-list {
  display: grid;
  gap: 10px;
}

.warehouse-content-card {
  padding: 13px;
  border: 1px solid #e2e8e4;
  border-radius: 11px;
  background: #fff;
}

.warehouse-content-card strong,
.warehouse-content-card span {
  display: block;
}

.warehouse-content-card span {
  color: #69766f;
  font-size: 12px;
}

.warehouse-content-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

@media (max-width: 600px) {
  .warehouse-content-meta {
    flex-direction: column;
    gap: 4px;
  }
}


/* WAREHOUSE MOVE / DISPATCH / SEARCH / QR V1 */

.warehouse-filter-bar {
  display: grid;
  grid-template-columns:
    minmax(240px, 2fr)
    repeat(3, minmax(140px, 1fr))
    auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.warehouse-filter-bar input,
.warehouse-filter-bar select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #d8e0dc;
  border-radius: 10px;
  padding: 9px 11px;
  background: #fff;
  font: inherit;
}

.warehouse-search-field {
  position: relative;
}

.warehouse-search-field i {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #69766f;
}

.warehouse-search-field input {
  padding-right: 36px;
}

#warehouse-filter-count {
  white-space: nowrap;
  color: #69766f;
  font-size: 13px;
}

.warehouse-asset-utility-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 16px;
  padding: 12px;
  background: #fff;
  border: 1px solid #e2e8e4;
  border-radius: 12px;
}

.warehouse-move-backdrop {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.46);
}

.warehouse-move-backdrop.open {
  display: flex;
}

.warehouse-move-modal {
  width: min(560px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 18px;
  padding: 22px;
  box-shadow:
    0 24px 70px
    rgba(15, 23, 42, 0.22);
}

.warehouse-move-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 18px;
}

.warehouse-move-head h2 {
  margin: 5px 0;
}

.warehouse-move-head p {
  margin: 0;
  color: #69766f;
  font-size: 13px;
}

.warehouse-move-modal form {
  display: grid;
  gap: 14px;
}

.warehouse-move-modal label {
  display: grid;
  gap: 6px;
}

.warehouse-move-modal select,
.warehouse-move-modal textarea {
  width: 100%;
  border: 1px solid #d8e0dc;
  border-radius: 10px;
  padding: 10px 11px;
  background: #fff;
  font: inherit;
}

@media (max-width: 900px) {
  .warehouse-filter-bar {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .warehouse-search-field {
    grid-column: 1 / -1;
  }
}

@media (max-width: 600px) {
  .warehouse-filter-bar {
    grid-template-columns: 1fr;
  }

  .warehouse-search-field {
    grid-column: auto;
  }

  .warehouse-asset-utility-actions {
    flex-direction: column;
  }

  .warehouse-asset-utility-actions button {
    width: 100%;
  }

  .warehouse-move-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .warehouse-move-modal {
    width: 100%;
    border-radius: 20px 20px 0 0;
    padding: 18px 15px;
  }
}



/* WAREHOUSE VISIBLE ASSET LINK UI V1 */

.warehouse-link-backdrop {
  position: fixed;
  inset: 0;
  z-index: 13000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.46);
}

.warehouse-link-backdrop.open {
  display: flex;
}

.warehouse-link-modal {
  width: min(620px, 100%);
  background: #fff;
  border-radius: 18px;
  padding: 22px;
  box-shadow:
    0 24px 70px
    rgba(15, 23, 42, 0.24);
}

.warehouse-link-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.warehouse-link-head h2 {
  margin: 5px 0;
}

.warehouse-link-head p {
  margin: 0;
  color: #69766f;
  font-size: 13px;
}

.warehouse-link-value {
  display: grid;
  gap: 7px;
}

.warehouse-link-value span {
  color: #69766f;
  font-size: 13px;
}

.warehouse-link-value input {
  width: 100%;
  border: 1px solid #d8e0dc;
  border-radius: 10px;
  padding: 11px;
  background: #f8faf9;
  font: inherit;
  font-size: 13px;
}

.warehouse-link-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

@media (max-width: 600px) {

  .warehouse-link-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .warehouse-link-modal {
    width: 100%;
    border-radius: 20px 20px 0 0;
    padding: 18px 15px;
  }

  .warehouse-link-actions {
    flex-direction: column;
  }

  .warehouse-link-actions button {
    width: 100%;
  }
}



/* WAREHOUSE SECURE QR PRINT AND DEEP LINK V1 */

.warehouse-qr-backdrop {
  position: fixed;
  inset: 0;
  z-index: 14000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    rgba(15, 23, 42, 0.48);
}

.warehouse-qr-backdrop.open {
  display: flex;
}

.warehouse-qr-modal {
  width: min(680px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 18px;
  padding: 22px;
  box-shadow:
    0 24px 70px
    rgba(15, 23, 42, 0.24);
}

.warehouse-qr-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.warehouse-qr-head h2 {
  margin: 5px 0;
}

.warehouse-qr-head p {
  margin: 0;
  color: #69766f;
  font-size: 13px;
  line-height: 1.7;
}

.warehouse-qr-loading {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #69766f;
}

.warehouse-qr-preview {
  display: grid;
  grid-template-columns:
    minmax(180px, 240px)
    minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  padding: 18px;
  border: 1px solid #e2e8e4;
  border-radius: 15px;
  background: #fafcfb;
}

.warehouse-qr-svg {
  aspect-ratio: 1;
  background: #fff;
  border: 1px solid #edf1ee;
  border-radius: 12px;
  padding: 10px;
}

.warehouse-qr-svg svg {
  display: block;
  width: 100%;
  height: 100%;
}

.warehouse-qr-info span {
  display: block;
  color: #69766f;
  font-size: 12px;
  margin-bottom: 7px;
}

.warehouse-qr-info strong {
  display: block;
  font-size: 20px;
  word-break: break-word;
}

.warehouse-qr-info p {
  margin: 8px 0 0;
  color: #56605c;
}

.warehouse-qr-link-field {
  display: grid;
  gap: 7px;
  margin-top: 16px;
}

.warehouse-qr-link-field span {
  color: #69766f;
  font-size: 12px;
}

.warehouse-qr-link-field input {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid #d8e0dc;
  border-radius: 10px;
  background: #f8faf9;
  font: inherit;
  font-size: 12px;
}

.warehouse-qr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

@media (max-width: 600px) {

  .warehouse-qr-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .warehouse-qr-modal {
    width: 100%;
    max-height: 94vh;
    border-radius:
      20px 20px 0 0;
    padding: 17px 14px;
  }

  .warehouse-qr-preview {
    grid-template-columns: 1fr;
  }

  .warehouse-qr-svg {
    width: min(
      250px,
      80vw
    );
    margin-inline: auto;
  }

  .warehouse-qr-info {
    text-align: center;
  }

  .warehouse-qr-actions {
    flex-direction: column;
  }

  .warehouse-qr-actions button {
    width: 100%;
  }
}

