/* SCUT Lemezkereső - Modernizált Ipari Lemez Adatlap és Közvetlen Szerkesztő Stílusok */

/* Fő kártya konténer */
.sheet-detail-card {
  position: relative;
  background: linear-gradient(170deg, #151921 0%, #101319 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.07) !important;
  border-radius: 18px !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.42), 0 1px 0 rgba(255, 255, 255, 0.04) inset !important;
  padding: 22px 24px !important;
  margin-bottom: 20px !important;
  overflow: hidden;
  box-sizing: border-box;
}

/* Kód Fejléc */
.sheet-hero-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-wrap: wrap;
  width: 100%;
  box-sizing: border-box;
}

.sheet-code-section {
  flex: 1 1 240px;
  min-width: 0;
  max-width: 100%;
  position: relative;
  border-radius: 12px;
  padding: 6px 10px;
  margin: -6px -10px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.sheet-code-section.can-edit {
  cursor: pointer;
}

.sheet-code-section.can-edit:hover {
  background: rgba(255, 255, 255, 0.04);
}

.sheet-code-section.can-edit:hover .sheet-affordance-icon {
  opacity: 0.85;
  color: #ff3b46;
  transform: translateY(-1px);
}

.sheet-code-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 12px;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.sheet-code-val {
  font-size: clamp(24px, 4.5vw, 32px) !important;
  font-weight: 900 !important;
  letter-spacing: -0.02em !important;
  color: #ffffff !important;
  line-height: 1.15 !important;
  word-break: break-word;
}

.sheet-affordance-icon {
  font-size: 13px;
  color: #64748b;
  opacity: 0;
  transition: all 0.18s ease;
  user-select: none;
  display: inline-flex;
  align-items: center;
}

.sheet-editable-row.can-edit:hover .sheet-affordance-icon {
  opacity: 0.75;
  color: #ff3b46;
}

/* Felső státusz jelvények */
.sheet-quick-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.sheet-badge-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 750;
  letter-spacing: 0.01em;
  user-select: none;
  border: 1px solid transparent;
}

.sheet-badge-loc {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.sheet-badge-stock {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

/* Rács és Mezők Elrendezése */
.sheet-grid-section {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.sheet-grid-full {
  grid-column: 1 / -1;
}

/* Egyedi Szerkeszthető Kártya Mező */
.sheet-field-card {
  position: relative;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.045);
  border-radius: 12px;
  padding: 11px 14px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
}

.sheet-field-card.can-edit {
  cursor: pointer;
}

.sheet-field-card.can-edit:hover {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.sheet-field-card.can-edit:active {
  transform: translateY(0);
}

.field-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
}

.field-label {
  font-size: 11px !important;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 800;
  color: #7d8b9d !important;
  user-select: none;
}

.sheet-field-card .field-value {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: #f1f5f9;
  word-break: break-word;
}

.sheet-field-card .field-value-empty {
  color: #556272;
  font-weight: 500;
  font-size: 13.5px;
  font-style: italic;
}

.sheet-field-card.can-edit:hover .field-value-empty {
  color: #ff6b76;
}

/* Megjegyzés Mező */
.sheet-note-card {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-left: 3px solid #ff3b46;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.sheet-note-card.can-edit {
  cursor: pointer;
}

.sheet-note-card.can-edit:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  border-left-color: #ff3b46;
}

/* Aktív Szerkesztési Állapot */
@keyframes inlinePopIn {
  from {
    opacity: 0;
    transform: scale(0.985);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.sheet-field-card.is-editing,
.sheet-code-section.is-editing,
.sheet-note-card.is-editing {
  background: #0f131a !important;
  border: 1px solid rgba(227, 6, 19, 0.5) !important;
  box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.15), 0 10px 28px rgba(0, 0, 0, 0.45) !important;
  cursor: default !important;
  animation: inlinePopIn 0.16s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  z-index: 10;
  box-sizing: border-box !important;
}

.sheet-code-section.is-editing {
  padding: 10px 14px !important;
  margin: -4px 0 6px 0 !important;
  flex: 1 1 100% !important;
  width: 100% !important;
}

.inline-edit-box {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  margin-top: 4px !important;
  overflow: hidden !important;
}

.inline-edit-box.is-vertical {
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 10px !important;
}

.inline-edit-input {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 42px !important;
  padding: 6px 12px !important;
  background: #090b0e !important;
  color: #ffffff !important;
  border: 1px solid #2e3540 !important;
  border-radius: 9px !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  outline: none !important;
  transition: all 0.15s ease !important;
  font-family: inherit !important;
  box-sizing: border-box !important;
}

.inline-edit-input-code {
  font-size: 19px !important;
  font-weight: 850 !important;
  letter-spacing: -0.01em !important;
  height: 44px !important;
  padding: 6px 12px !important;
  color: #ffffff !important;
}

.inline-edit-textarea {
  width: 100% !important;
  min-height: 80px !important;
  padding: 10px 12px !important;
  background: #090b0e !important;
  color: #ffffff !important;
  border: 1px solid #2e3540 !important;
  border-radius: 9px !important;
  font-size: 14.5px !important;
  line-height: 1.45 !important;
  resize: vertical;
  outline: none !important;
  font-family: inherit !important;
  box-sizing: border-box !important;
}

.inline-edit-input:focus,
.inline-edit-textarea:focus {
  border-color: #ff3b46 !important;
  box-shadow: 0 0 0 2px rgba(255, 59, 70, 0.22) !important;
  background: #0d1015 !important;
}

.inline-btn-group {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 6px !important;
  flex-shrink: 0 !important;
  flex-wrap: nowrap !important;
}

.inline-btn-save {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  min-height: 40px !important;
  padding: 0 !important;
  flex-shrink: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: linear-gradient(180deg, #e30613, #b8000b) !important;
  border: 1px solid #ff4d58 !important;
  border-radius: 9px !important;
  color: #ffffff !important;
  font-size: 18px !important;
  font-weight: 900 !important;
  cursor: pointer !important;
  transition: transform 0.12s ease, filter 0.12s ease !important;
  box-shadow: 0 4px 12px rgba(227, 6, 19, 0.3) !important;
  box-sizing: border-box !important;
}

.inline-btn-save:hover {
  filter: brightness(1.12) !important;
  transform: translateY(-1px) !important;
}

.inline-btn-save:active {
  transform: scale(0.96) !important;
}

.inline-btn-save:disabled {
  opacity: 0.5 !important;
  cursor: wait !important;
}

.inline-btn-cancel {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  min-height: 40px !important;
  padding: 0 !important;
  flex-shrink: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #20252e !important;
  border: 1px solid #363e4c !important;
  border-radius: 9px !important;
  color: #94a3b8 !important;
  font-size: 17px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  transition: all 0.12s ease !important;
  box-sizing: border-box !important;
}

.inline-btn-cancel:hover {
  background: #2c3340 !important;
  color: #ffffff !important;
}

.inline-btn-cancel:active {
  transform: scale(0.96) !important;
}

.inline-edit-err {
  font-size: 12px;
  color: #f87171;
  font-weight: 750;
  margin-top: 6px;
  display: none;
}

/* Mentési villanás */
@keyframes inlineSaveFlash {
  0% {
    background: rgba(34, 197, 94, 0.22);
    border-color: rgba(34, 197, 94, 0.5);
  }
  100% {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.045);
  }
}

.inline-save-flash {
  animation: inlineSaveFlash 0.9s ease-out forwards;
}

/* Tartozékok Szekció */
.sheet-acc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 10px 0;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sheet-acc-title {
  margin: 0 !important;
  font-size: 16px !important;
  font-weight: 850 !important;
  color: #ffffff !important;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sheet-acc-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.sheet-acc-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.045);
  border-radius: 12px;
  padding: 12px 14px;
  transition: all 0.16s ease;
  cursor: pointer;
  box-sizing: border-box;
}

.sheet-acc-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.09);
}

.sheet-acc-name {
  font-size: 15px;
  font-weight: 750;
  color: #ffffff;
}

.sheet-acc-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  font-size: 13px;
  color: #94a3b8;
  flex-wrap: wrap;
}

/* Fotó Akció Sáv */
.sheet-photo-action-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.sheet-photo-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 15px;
  border-radius: 10px;
  background: #191e26;
  border: 1px solid #2d3542;
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sheet-photo-upload-btn:hover {
  background: #222934;
  border-color: #404b5c;
  color: #ffffff;
}

/* Lábléc Akciógombok */
.sheet-footer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .sheet-detail-card {
    padding: 16px 14px !important;
    border-radius: 15px !important;
  }
  .sheet-hero-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding-bottom: 12px;
    margin-bottom: 12px;
  }
  .sheet-code-section {
    width: 100%;
    flex: 1 1 100%;
    margin: -4px 0;
    padding: 4px 0;
  }
  .sheet-grid-section {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .sheet-field-card {
    padding: 10px 12px;
    min-height: 56px;
  }
  .inline-edit-box {
    gap: 6px !important;
    width: 100% !important;
  }
  .inline-edit-input {
    height: 42px !important;
    font-size: 15px !important;
    padding: 6px 10px !important;
  }
  .inline-edit-input-code {
    height: 44px !important;
    font-size: 17px !important;
  }
  .inline-btn-save,
  .inline-btn-cancel {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    min-height: 42px !important;
    font-size: 18px !important;
  }
}
