.storage-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.module-page {
  width: 100%;
}

.module-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.module-title {
  font-size: 19px;
  font-weight: 700;
  color: #20180C;
}

.module-sub {
  margin-top: 4px;
  font-size: 12px;
  color: #8E816D;
}

.storage-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.storage-add-btn {
  height: 40px;
  padding: 0 16px;
  border: 1px solid #8DB35A;
  border-radius: 10px;
  background: linear-gradient(180deg, #D5E9AE 0%, #C4DD95 100%);
  color: #23410A;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 7px rgba(50, 85, 18, 0.12);
}

.storage-add-btn:hover {
  filter: brightness(1.03);
}

.storage-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.storage-search-wrap {
  flex: 1;
}

.storage-search,
.storage-sort {
  width: 100%;
  height: 42px;
  border: 1px solid #CABFAE;
  border-radius: 10px;
  background: linear-gradient(180deg, #F8F3E9 0%, #EFE7D8 100%);
  color: #20180C;
  font-family: inherit;
  font-size: 13px;
  padding: 0 14px;
  outline: none;
}

.storage-search:focus,
.storage-sort:focus {
  border-color: #C8943C;
  box-shadow: 0 0 0 3px rgba(200, 148, 60, 0.12);
}

.storage-filter-wrap {
  width: 180px;
  flex-shrink: 0;
}

.storage-list-wrap {
  border: 1px solid #CEC3B2;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(180deg, #F7F1E7 0%, #EEE5D6 100%);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
}

.storage-list-head,
.storage-item {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) 140px 140px 160px;
  gap: 12px;
  align-items: center;
}

.storage-list-head {
  padding: 13px 16px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #756956;
  border-bottom: 1px solid #D9CFBE;
  background: linear-gradient(180deg, #ECE3D3 0%, #E4D9C7 100%);
}

.storage-list {
  min-height: 120px;
}

.storage-item {
  padding: 14px 16px;
  border-bottom: 1px solid #E1D6C6;
}

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

.storage-item:hover {
  background: rgba(255, 255, 255, 0.28);
}

.storage-name-cell {
  min-width: 0;
}

.storage-name {
  font-size: 14px;
  font-weight: 700;
  color: #20180C;
  word-break: break-word;
}

.storage-desc {
  margin-top: 3px;
  font-size: 11px;
  color: #8E816D;
  line-height: 1.4;
}

.storage-tags {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.storage-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid #C8B58D;
  background: linear-gradient(180deg, #F2E6C8 0%, #E8D8B4 100%);
  color: #6B4A10;
  font-size: 11px;
  font-weight: 700;
}

.storage-stock,
.storage-price {
  font-size: 13px;
  font-weight: 700;
  color: #2B2214;
}

.storage-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.storage-edit-btn,
.storage-delete-btn {
  height: 34px;
  min-width: 74px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.storage-edit-btn {
  background: linear-gradient(180deg, #D4E4F8 0%, #BDD6F3 100%);
  border-color: #93B7E8;
  color: #18416E;
}

.storage-delete-btn {
  background: linear-gradient(180deg, #F3D0C8 0%, #E9BBB0 100%);
  border-color: #D89D90;
  color: #7A2413;
}

.storage-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  padding: 20px;
  font-size: 13px;
  color: #988B75;
}

.storage-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(19, 14, 8, 0.44);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, visibility 0.18s ease;
  z-index: 8500;
}

.storage-drawer-backdrop.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.storage-drawer {
  position: fixed;
  top: 0;
  right: -440px;
  width: 440px;
  max-width: calc(100vw - 24px);
  height: 100vh;
  background: linear-gradient(180deg, #FBF6EE 0%, #F3EBDD 100%);
  border-left: 1px solid #D8CCB8;
  box-shadow: -16px 0 38px rgba(0, 0, 0, 0.18);
  z-index: 8600;
  transition: right 0.22s ease;
  display: flex;
  flex-direction: column;
}

.storage-drawer.show {
  right: 0;
}

.storage-drawer-head {
  padding: 18px 18px 14px;
  border-bottom: 1px solid #E2D6C4;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.storage-drawer-head h3 {
  font-size: 18px;
  font-weight: 700;
  color: #20180C;
}

.storage-drawer-head p {
  margin-top: 4px;
  font-size: 12px;
  color: #8E816D;
}

.storage-drawer-close {
  width: 36px;
  height: 36px;
  border: 1px solid #D4C6B2;
  border-radius: 10px;
  background: #F8F1E6;
  color: #5A4C38;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.storage-form {
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.storage-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.storage-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.storage-form-group label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #766A56;
}

.storage-form-group input,
.storage-form-group textarea {
  width: 100%;
  border: 1px solid #CDBEAA;
  border-radius: 10px;
  background: linear-gradient(180deg, #F9F4EB 0%, #EFE7D8 100%);
  color: #20180C;
  font-family: inherit;
  font-size: 13px;
  padding: 11px 12px;
  outline: none;
}

.storage-form-group textarea {
  resize: vertical;
  min-height: 82px;
}

.storage-form-group input:focus,
.storage-form-group textarea:focus,
.storage-tag-input:focus {
  border-color: #C8943C;
  box-shadow: 0 0 0 3px rgba(200, 148, 60, 0.12);
}

.storage-tags-box {
  border: 1px solid #CDBEAA;
  border-radius: 10px;
  background: linear-gradient(180deg, #F9F4EB 0%, #EFE7D8 100%);
  padding: 8px;
}

.storage-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.storage-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, #EBDDBE 0%, #E1D0AB 100%);
  border: 1px solid #CCB88A;
  color: #6C4A0F;
  font-size: 12px;
  font-weight: 700;
}

.storage-tag-remove {
  border: none;
  background: transparent;
  color: #6C4A0F;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0;
}

.storage-tag-input {
  width: 100%;
  height: 38px;
  border: 1px solid #D5C8B7;
  border-radius: 8px;
  background: #FBF7EF;
  color: #20180C;
  font-family: inherit;
  font-size: 13px;
  padding: 0 12px;
  outline: none;
}

.storage-help {
  display: block;
  margin-top: 6px;
  color: #938673;
  font-size: 11px;
}

.storage-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
  padding-top: 6px;
}

.storage-cancel-btn,
.storage-save-btn {
  height: 40px;
  padding: 0 18px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
}

.storage-cancel-btn {
  background: linear-gradient(180deg, #EFE6D9 0%, #E3D7C7 100%);
  border-color: #D6C8B6;
  color: #564938;
}

.storage-save-btn {
  background: linear-gradient(180deg, #D5E9AE 0%, #BDD885 100%);
  border-color: #8FB35A;
  color: #25420A;
}

@media (max-width: 900px) {
  .storage-list-head,
  .storage-item {
    grid-template-columns: minmax(0, 1fr);
  }

  .storage-list-head {
    display: none;
  }

  .storage-item {
    gap: 10px;
  }

  .storage-actions {
    justify-content: flex-start;
  }

  .storage-filter-wrap {
    width: 150px;
  }
}

@media (max-width: 720px) {
  .storage-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .storage-filter-wrap {
    width: 100%;
  }

  .storage-form-row {
    grid-template-columns: 1fr;
  }

  .storage-drawer {
    width: 100%;
    max-width: 100%;
  }
}
/* ===== KOYU TEMA ===== */
body.dark .storage-add-btn {
  background: linear-gradient(180deg, #2a4010 0%, #1e3008 100%);
  border-color: #4a8020;
  color: #a0d870;
}
body.dark .storage-search, body.dark .storage-sort {
  background: linear-gradient(180deg, #2a2218 0%, #221c14 100%);
  border-color: #3a3028;
  color: #e0d4c0;
}
body.dark .storage-search:focus, body.dark .storage-sort:focus { border-color: #c8943c; }
body.dark .storage-list-wrap {
  background: linear-gradient(180deg, #252018 0%, #1e1810 100%);
  border-color: #3a3028;
}
body.dark .storage-list-head {
  background: linear-gradient(180deg, #2a2218 0%, #221c14 100%);
  color: #6a5a48;
  border-color: #3a3028;
}
body.dark .storage-item { border-color: #3a3028; }
body.dark .storage-item:hover { background: rgba(255,255,255,0.04); }
body.dark .storage-name { color: #e0d4c0; }
body.dark .storage-desc { color: #7a6a58; }
body.dark .storage-tag {
  background: linear-gradient(180deg, #3a2e18 0%, #2e2410 100%);
  border-color: #5a4828;
  color: #c8943c;
}
body.dark .storage-stock, body.dark .storage-price { color: #e0d4c0; }
body.dark .storage-edit-btn {
  background: linear-gradient(180deg, #1a2a3a 0%, #14202e 100%);
  border-color: #2a4060;
  color: #80b8e8;
}
body.dark .storage-delete-btn {
  background: linear-gradient(180deg, #3a1a14 0%, #2e1410 100%);
  border-color: #5a2820;
  color: #e8725a;
}
body.dark .storage-empty { color: #6a5a48; }
body.dark .storage-drawer {
  background: linear-gradient(180deg, #252018 0%, #1e1810 100%);
  border-color: #3a3028;
}
body.dark .storage-drawer-head { border-color: #3a3028; }
body.dark .storage-drawer-head h3 { color: #e0d4c0; }
body.dark .storage-drawer-head p { color: #7a6a58; }
body.dark .storage-drawer-close {
  background: #2a2218;
  border-color: #3a3028;
  color: #8a7a68;
}
body.dark .storage-form-group label { color: #7a6a58; }
body.dark .storage-form-group input, body.dark .storage-form-group textarea,
body.dark .storage-tags-box, body.dark .storage-tag-input {
  background: linear-gradient(180deg, #2a2218 0%, #221c14 100%);
  border-color: #3a3028;
  color: #e0d4c0;
}
body.dark .storage-form-group input:focus, body.dark .storage-form-group textarea:focus,
body.dark .storage-tag-input:focus { border-color: #c8943c; }
body.dark .storage-tag-chip {
  background: linear-gradient(180deg, #3a2e18 0%, #2e2410 100%);
  border-color: #5a4828;
  color: #c8943c;
}
body.dark .storage-tag-remove { color: #c8943c; }
body.dark .storage-help { color: #6a5a48; }
body.dark .storage-cancel-btn {
  background: linear-gradient(180deg, #2a2218 0%, #221c14 100%);
  border-color: #3a3028;
  color: #a09080;
}
body.dark .storage-save-btn {
  background: linear-gradient(180deg, #2a4010 0%, #1e3008 100%);
  border-color: #4a8020;
  color: #a0d870;
}
