/**
 * 공통 스타일시트 - Toss 스타일
 * 전체 페이지에서 사용되는 기본 스타일
 */
body{
 -ms-overflow-style: none;
 }
 
::-webkit-scrollbar {
  display: none;
}

/* 기본 리셋 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #191f28;
  --secondary-color: #4e5968;
  --success-color: #191f28;
  --danger-color: #191f28;
  --warning-color: #191f28;
  --info-color: #191f28;
  --dark-color: #191f28;
  --light-color: #f2f4f6;
  --border-color: rgba(0, 0, 0, 0.06);
  --shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.3);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: #191f28;
  background: linear-gradient(180deg, #f9fafb 0%, #ffffff 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

/* 컨테이너 */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 24px;
  min-width: 1200px;
  overflow-x: auto;
}

.container-fluid {
  width: 100%;
  padding: 40px 24px;
}

/* 헤더 */
.header {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--dark-color);
  letter-spacing: -0.5px;
}

.header-nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.header-nav a {
  color: #4e5968;
  text-decoration: none;
  transition: var(--transition);
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
}

.header-nav a:hover {
  color: var(--primary-color);
  background-color: rgba(0, 0, 0, 0.04);
}

.header-nav a.active {
  color: var(--primary-color);
  background-color: rgba(0, 0, 0, 0.06);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background-color: rgba(0, 0, 0, 0.04);
  border-radius: 16px;
}

.user-info .user-name {
  font-weight: 600;
  font-size: 15px;
}

.user-info .user-role {
  font-size: 13px;
  color: #4e5968;
  background-color: rgba(255, 255, 255, 0.8);
  padding: 4px 10px;
  border-radius: 8px;
  font-weight: 500;
}

/* 사용자 메뉴 */
.user-menu {
  position: relative;
}

.user-icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: none;
  background-color: transparent;
  color: #4e5968;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.user-icon-btn:hover {
  background-color: rgba(0, 0, 0, 0.04);
  color: var(--primary-color);
}

.user-icon-btn.active {
  background-color: rgba(0, 0, 0, 0.06);
  color: var(--primary-color);
}

/* 드롭다운 메뉴 */
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.user-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-dropdown-header {
  padding: 16px;
}

.user-dropdown-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--dark-color);
  margin-bottom: 4px;
  letter-spacing: -0.3px;
}

.user-dropdown-id {
  font-size: 14px;
  color: #4e5968;
  font-weight: 500;
}

.user-dropdown-divider {
  height: 1px;
  background-color: rgba(0, 0, 0, 0.06);
  margin: 8px 0;
}

.user-dropdown-item {
  display: block;
  padding: 12px 16px;
  color: #191f28;
  text-decoration: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  transition: var(--transition);
}

.user-dropdown-item:hover {
  background-color: rgba(0, 0, 0, 0.04);
  color: var(--primary-color);
}

/* 버튼 */
.btn {
  display: inline-block;
  padding: 14px 24px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  text-align: center;
  letter-spacing: -0.3px;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background-color: #000000;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background-color: #f2f4f6;
  color: var(--dark-color);
}

.btn-secondary:hover:not(:disabled) {
  background-color: #e5e8eb;
  transform: translateY(-2px);
}

.btn-success {
  background-color: var(--dark-color);
  color: white;
}

.btn-success:hover:not(:disabled) {
  background-color: #000000;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-danger {
  background-color: var(--dark-color);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background-color: #000000;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-warning {
  background-color: var(--dark-color);
  color: white;
}

.btn-warning:hover:not(:disabled) {
  background-color: #000000;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 14px;
  border-radius: 10px;
}

.btn-lg {
  padding: 18px 32px;
  font-size: 18px;
  border-radius: 14px;
}

/* 카드 */
.card {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: 20px;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
  padding: 32px;
  margin-bottom: 24px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  min-width: 1200px;
  width: 100%;
}

.card-header {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  letter-spacing: -0.5px;
}

.card-body {
  padding: 10px 0;
}

/* 폼 */
.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--dark-color);
  font-size: 15px;
  letter-spacing: -0.3px;
}

.form-label.required::after {
  content: '*';
  color: #191f28;
  margin-left: 4px;
}

.form-control {
  width: 100%;
  padding: 16px 20px;
  border: 2px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  font-size: 16px;
  transition: var(--transition);
  background-color: #f9fafb;
  font-weight: 500;
}

.form-control:focus {
  outline: none;
  border-color: rgba(0, 0, 0, 0.2);
  background-color: white;
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.04);
}

.form-control:disabled {
  background-color: rgba(0, 0, 0, 0.02);
  cursor: not-allowed;
  opacity: 0.6;
}

select.form-control {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 20px;
  padding-right: 48px;
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

.form-help {
  font-size: 14px;
  color: #4e5968;
  margin-top: 8px;
  font-weight: 500;
}

.form-error {
  font-size: 14px;
  color: #191f28;
  margin-top: 8px;
  font-weight: 600;
}

/* 테이블 */
.table {
  width: 100%;
  border-collapse: collapse;
  background-color: white;
  border-radius: 16px;
  overflow: hidden;
}

.table th,
.table td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.table th {
  background-color: #f9fafb;
  font-weight: 700;
  color: var(--dark-color);
  font-size: 14px;
  letter-spacing: -0.2px;
}

.table td {
  font-size: 15px;
  color: #191f28;
  font-weight: 500;
}

.table tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

.table-responsive {
  overflow-x: auto;
  border-radius: 16px;
}

/* 뱃지 */
.badge {
  display: inline-block;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 20px;
  text-align: center;
  letter-spacing: -0.2px;
}

.badge-primary {
  background-color: #191f28;
  color: white;
}

.badge-success {
  background-color: #191f28;
  color: white;
}

.badge-danger {
  background-color: #191f28;
  color: white;
}

.badge-warning {
  background-color: #4e5968;
  color: white;
}

.badge-secondary {
  background-color: #e5e8eb;
  color: #191f28;
}

/* 토스트 메시지 컨테이너 */
#toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  max-width: 500px;
  width: calc(100% - 40px);
}

/* 토스트 메시지 */
.toast {
  background: white;
  border-radius: 14px;
  padding: 18px 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 60px;
  pointer-events: auto;
  cursor: pointer;
  user-select: none;
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.hide {
  opacity: 0;
  transform: translateY(-30px);
}

.toast-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1.5;
}

/* 토스트 타입별 스타일 */
.toast-success {
  background: #22c55e;
  color: white;
}

.toast-success .toast-icon {
  background: rgba(255, 255, 255, 0.2);
}

.toast-danger {
  background: #ef4444;
  color: white;
}

.toast-danger .toast-icon {
  background: rgba(255, 255, 255, 0.2);
}

.toast-warning {
  background: #f59e0b;
  color: white;
}

.toast-warning .toast-icon {
  background: rgba(255, 255, 255, 0.2);
}

.toast-info {
  background: #3b82f6;
  color: white;
}

.toast-info .toast-icon {
  background: rgba(255, 255, 255, 0.2);
}

/* 토스트 호버 효과 */
.toast:hover {
  transform: scale(1.02);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

/* 토스트 활성 효과 */
.toast:active {
  transform: scale(0.98);
}

/* 모달 */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: 24px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-lg);
}

.modal-header {
  padding: 32px 32px 20px 32px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.modal-close {
  font-size: 28px;
  cursor: pointer;
  color: #4e5968;
  transition: var(--transition);
  line-height: 1;
}

.modal-close:hover {
  color: #191f28;
}

.modal-body {
  padding: 32px;
}

.modal-footer {
  padding: 20px 32px 32px 32px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* 로딩 스피너 */
.spinner {
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  margin: 32px auto;
}

.spinner-sm {
  width: 24px;
  height: 24px;
  border-width: 2px;
}

/* 유틸리티 클래스 */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-left {
  text-align: left;
}

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.ml-10 { margin-left: 10px; }
.mr-10 { margin-right: 10px; }

.p-10 { padding: 10px; }
.p-20 { padding: 20px; }

.d-flex {
  display: flex;
}

.justify-between {
  justify-content: space-between;
}

.align-center {
  align-items: center;
}

.gap-10 {
  gap: 10px;
}

.gap-20 {
  gap: 20px;
}

.hidden {
  display: none !important;
}

/* 애니메이션 */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(40px) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 반응형 */
@media (max-width: 768px) {
  .container {
    padding: 24px 16px;
  }

  .header-content {
    flex-direction: column;
    gap: 16px;
  }

  .header-nav {
    width: 100%;
    justify-content: center;
  }

  .table {
    font-size: 14px;
  }

  .table th,
  .table td {
    padding: 12px 16px;
  }

  .modal-content {
    width: 95%;
    max-height: 95vh;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 24px;
  }

  /* 토스트 메시지 모바일 */
  #toast-container {
    top: 16px;
    width: calc(100% - 32px);
  }

  .toast {
    padding: 16px 20px;
    border-radius: 12px;
  }

  .toast-icon {
    width: 28px;
    height: 28px;
    font-size: 16px;
  }

  .toast-message {
    font-size: 14px;
  }
}

/* ==================== 재고 알림 스타일 ==================== */
.inventory-alerts {
  margin: 40px 0;
}

.alert-section {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
}

.alert-title {
  font-size: 24px;
  font-weight: 700;
  color: #191f28;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: -0.5px;
}

.alert-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.alert-item {
  display: grid;
  grid-template-columns: 50px 1fr auto;
  gap: 20px;
  padding: 24px;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background-color: rgba(0, 0, 0, 0.02);
  transition: var(--transition);
}

.alert-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  background-color: white;
}

.alert-item.alert-warning {
  background-color: rgba(78, 89, 104, 0.04);
  border-left: 3px solid #4e5968;
}

.alert-item.alert-danger {
  background-color: rgba(25, 31, 40, 0.04);
  border-left: 3px solid #191f28;
}

.alert-icon {
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.alert-content {
  flex: 1;
}

.alert-equipment-name {
  font-size: 18px;
  font-weight: 700;
  color: #191f28;
  margin-bottom: 12px;
  letter-spacing: -0.3px;
}

.alert-stock-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 15px;
  color: #4e5968;
  font-weight: 600;
}

.current-stock {
  font-weight: 700;
  color: #191f28;
}

.stock-ratio {
  font-weight: 700;
  color: #4e5968;
}

.alert-item.alert-danger .stock-ratio {
  color: #191f28;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background-color: rgba(0, 0, 0, 0.06);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #191f28 0%, #4e5968 100%);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 3px;
}

.alert-actions {
  display: flex;
  align-items: center;
}

.btn-link {
  padding: 10px 20px;
  background-color: #191f28;
  color: white;
  text-decoration: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  transition: var(--transition);
  letter-spacing: -0.2px;
}

.btn-link:hover {
  background-color: #000000;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
  .alert-item {
    grid-template-columns: 40px 1fr;
    gap: 16px;
    padding: 20px;
  }

  .alert-icon {
    font-size: 28px;
  }

  .alert-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
    margin-top: 12px;
  }
}