.inventory-page {
  background: #e6e6e6;
  min-height: 100vh;
  padding: 30px 10px 60px;
}

.inventory-page .container {
  max-width: 1050px;
  margin: 0 auto;
  padding: 0 20px;
}

.back-link {
  display: inline-block;
  font-size: 0.85rem;
  color: #379cd0;
  text-decoration: none;
  margin-bottom: 8px;
  transition: color 0.15s;
}
.back-link:hover {
  color: #379cd0;
}

.inv-stats-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.inv-stat {
  flex: 1;
  min-width: 100px;
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.inv-stat__num {
  font-size: 1.8rem;
  font-weight: 900;
  color: #379cd0;
}
.inv-stat__num--ok {
  color: #4caf50;
}
.inv-stat__num--moyen {
  color: #ff9800;
}
.inv-stat__num--hs {
  color: #f44336;
}

.inv-stat__label {
  font-size: 0.75rem;
  color: #000;
  font-weight: 500;
}

.inv-lists-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.inv-lists-header h3 {
  font-size: 1.3rem;
  color: #379cd0;
}

.btn-inv {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 18px;
  background: #379cd0;
  color: #fff;
  border: 1.5px solid #379cd0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-inv:hover {
  background: #2a7db0;
  border-color: #2a7db0;
}
.btn-inv--sm {
  padding: 4px 10px;
  font-size: 0.78rem;
}
.btn-inv--outline {
  background: transparent;
  color: #379cd0;
}
.btn-inv--outline:hover {
  background: #379cd0;
  color: #fff;
}
.btn-inv--danger {
  background: #f44336;
  border-color: #f44336;
}
.btn-inv--danger:hover {
  background: #c62828;
  border-color: #c62828;
}

.inv-lists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.inv-list-card {
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
  text-decoration: none;
  color: inherit;
  border: 1.5px solid transparent;
  transition: all 0.18s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.inv-list-card:hover {
  border-color: #379cd0;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(55, 156, 208, 0.15);
}

.inv-list-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.inv-list-card__name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #777;
  margin: 0;
}

.inv-list-card__desc {
  font-size: 0.82rem;
  color: #555;
  flex: 1;
}

.inv-list-card__stats {
  display: flex;
  gap: 10px;
  font-size: 0.78rem;
  color: #777;
}

.inv-list-card__cta {
  font-size: 0.82rem;
  font-weight: 600;
  color: #379cd0;
  margin-top: auto;
}

.inv-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}
.inv-badge--private {
  background: #f5f5f5;
  color: #757575;
}
.inv-badge--loanable {
  background: #e8f5e9;
  color: #388e3c;
}
.inv-badge--pending {
  background: #fff3e0;
  color: #e65100;
}
.inv-badge--danger {
  background: #ffebee;
  color: #c62828;
}

.inv-state-dot {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 8px;
}
.inv-state-dot--ok {
  background: #e8f5e9;
  color: #388e3c;
}
.inv-state-dot--hs {
  background: #ffebee;
  color: #c62828;
}

.inv-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.inv-detail-header h3 {
  font-size: 1.4rem;
  font-weight: 800;
  color: #222;
  display: flex;
  align-items: center;
  gap: 8px;
}

.inv-detail-desc {
  color: #444;
  font-size: 0.9rem;
  margin-top: 4px;
}

.inv-detail-value {
  font-size: 0.85rem;
  color: #444;
  margin-top: 4px;
}

.inv-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
  background: #fff;
  padding: 12px 16px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.inv-filter-search {
  flex: 1;
  min-width: 180px;
  padding: 7px 12px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.88rem;
}

.inv-filter-search:focus {
  outline: none;
  border-color: #379cd0;
}

.inv-filters select {
  padding: 7px 10px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.85rem;
  background: #fff;
  cursor: pointer;
}

.inv-table-wrap {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
  overflow: auto;
}

.inv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.inv-table thead th {
  background: #f8f8f8;
  padding: 12px 14px;
  text-align: left;
  font-weight: 700;
  color: #555;
  border-bottom: 2px solid #eee;
  white-space: nowrap;
}

.inv-table-row td {
  padding: 12px 14px;
  border-bottom: 1px solid #f5f5f5;
  vertical-align: middle;
}

.inv-table-row:last-child td {
  border-bottom: none;
}
.inv-table-row--hs {
  background: #fff8f8;
}
.inv-table-row--overdue {
  background: #fff3e0;
}

.inv-item-name-cell {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.inv-item-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  cursor: zoom-in;
  flex-shrink: 0;
  border: 1px solid #eee;
}

.inv-serial {
  display: block;
  font-size: 0.72rem;
  color: #aaa;
  font-family: monospace;
}

.inv-item-desc {
  font-size: 0.75rem;
  color: #888;
  margin: 2px 0 0;
}

.inv-qty {
  font-weight: 700;
  color: #333;
}
.inv-qty--zero {
  color: #f44336;
}

.inv-state-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}
.inv-state-badge--ok {
  background: #e8f5e9;
  color: #388e3c;
}
.inv-state-badge--moyen {
  background: #fff8e1;
  color: #f57f17;
}
.inv-state-badge--hs {
  background: #ffebee;
  color: #c62828;
}

.inv-table-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
}

.inv-loan-status {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
}
.inv-loan-status--pending {
  background: #fff3e0;
  color: #e65100;
}
.inv-loan-status--approved {
  background: #e8f5e9;
  color: #388e3c;
}
.inv-loan-status--returned {
  background: #f5f5f5;
  color: #757575;
}
.inv-loan-status--rejected {
  background: #ffebee;
  color: #c62828;
}
.inv-loan-status--overdue {
  background: #fce4ec;
  color: #880e4f;
}

.inv-loan-item-preview {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 16px;
  background: #f8fbfd;
  border-radius: 10px;
  border: 1.5px solid #e0eef6;
}

.inv-loan-item-photo {
  width: 80px;
  height: 80px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.inv-photo-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.inv-photo-modal.open {
  display: flex;
}
.inv-photo-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}
.inv-photo-modal__box {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  max-width: 90vw;
  text-align: center;
}
.inv-photo-modal__box img {
  max-width: 80vw;
  max-height: 70vh;
  border-radius: 8px;
  object-fit: contain;
}
.inv-photo-modal__box p {
  margin-top: 8px;
  font-weight: 600;
  color: #222;
}
.inv-photo-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border: none;
  background: #eee;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.8rem;
}

.inv-empty {
  text-align: center;
  padding: 50px 20px;
  color: #aaa;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}
.inv-empty p {
  margin-bottom: 16px;
  font-size: 1rem;
}

.inv-asso-lists {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.inv-asso-list-block {
  background: #f8f8f8;
  border-radius: 12px;
  padding: 18px;
  border: 1px solid #eee;
}

.inv-asso-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.inv-asso-list-title {
  font-size: 1rem;
  font-weight: 700;
  color: #000;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.inv-asso-list-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.inv-asso-list-desc {
  font-size: 0.82rem;
  color: #555;
  margin-bottom: 12px;
}

.inv-asso-items-preview {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.inv-asso-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}

.inv-asso-item:last-child {
  border-bottom: none;
}

.inv-asso-item__left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.inv-asso-item__thumb {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.inv-asso-item__thumb--placeholder {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #e8f0fe;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.inv-asso-item__name {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inv-asso-item__cat {
  display: block;
  font-size: 0.72rem;
  color: #000;
}

.inv-asso-item__loc {
  display: block;
  font-size: 0.72rem;
  color: #000;
}

.inv-asso-item__right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.inv-asso-item__qty {
  font-size: 0.78rem;
  color: #444;
  font-weight: 600;
}

.inv-asso-item__edit-btn {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.75rem;
  text-decoration: none;
  transition: all 0.15s;
}

.inv-asso-item__edit-btn:hover {
  background: #379cd0;
  border-color: #379cd0;
}

.inv-asso-see-more {
  text-align: right;
  margin-top: 8px;
  font-size: 0.82rem;
}

.inv-asso-see-more a {
  color: #379cd0;
  text-decoration: none;
  font-weight: 600;
}

.inv-asso-empty {
  font-size: 0.85rem;
  color: #aaa;
  padding: 12px 0;
}

.inv-asso-empty a {
  color: #379cd0;
  font-weight: 600;
  text-decoration: none;
}

.admin-bar-export {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
}

.admin-bar-export span {
  opacity: 0.6;
}

.inv-file-input {
  padding: 8px;
  border: 1.5px dashed #ddd;
  border-radius: 8px;
  width: 100%;
  cursor: pointer;
  font-family: inherit;
  background: #fafafa;
}

.inv-import-guide {
  margin-top: 24px;
  padding: 16px;
  background: #f8fbfd;
  border-radius: 10px;
  border: 1px solid #d6eef6;
}

.inv-import-guide h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #379cd0;
  margin-bottom: 8px;
}

.inv-import-guide p {
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 8px;
}

.inv-import-cols {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.inv-import-cols code {
  background: #e8f0fe;
  color: #1a56c4;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-family: monospace;
}

.inv-import-result {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: #e8f5e9;
  border-radius: 10px;
  margin-bottom: 20px;
}

.inv-import-result__num {
  font-size: 2rem;
  font-weight: 900;
  color: #388e3c;
}

.inv-import-result__label {
  font-size: 0.85rem;
  color: #555;
}

.inv-import-result__sep {
  font-size: 1.5rem;
  color: #ccc;
}
