/* ===================================================
   신신엠앤씨 관리자 페이지 전용 스타일 v7
   =================================================== */

/* ── 로그인 힌트 ── */
.login-hint {
  text-align: center;
  font-size: .78rem;
  color: #9ca3af;
  margin-top: 18px;
}
.login-hint strong { color: #6b7280; }
.login-card-logo .logo-icon {
  font-size: 2.2rem;
  color: #1a3a6b;
  margin-bottom: 10px;
}

/* ── hidden 유틸 ── */
.hidden { display: none !important; }
.admin-app.hidden { display: none !important; }

/* ════════════════════════════════════════
   ADMIN TOOLBAR
════════════════════════════════════════ */
.admin-toolbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 56px;
  background: #1a3a6b;
  box-shadow: 0 2px 12px rgba(0,0,0,.28);
}
.admin-toolbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}
.admin-toolbar-brand i { color: #ffd166; }
.admin-toolbar-actions { display: flex; gap: 10px; }

/* ════════════════════════════════════════
   DB 모드 배너
════════════════════════════════════════ */
.db-mode-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 28px;
  background: #fef3c7;
  border-bottom: 2px solid #fbbf24;
  color: #92400e;
  font-size: .85rem;
  font-weight: 600;
}
.db-mode-banner i { color: #d97706; font-size: 1rem; flex-shrink: 0; }
.db-mode-banner strong { color: #b45309; }

/* ════════════════════════════════════════
   WRAP
════════════════════════════════════════ */
.admin-wrap {
  max-width: 1200px;
  margin: 28px auto;
  padding: 0 20px 48px;
}

/* ════════════════════════════════════════
   통계 카드
════════════════════════════════════════ */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 1px 6px rgba(0,0,0,.08);
  border: 1px solid #eef1f7;
  transition: box-shadow .18s;
}
.stat-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.12); }
.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: #fff;
  flex-shrink: 0;
}
.bg-blue   { background: #2557a7; }
.bg-indigo { background: #4f46e5; }
.bg-orange { background: #d97706; }
.bg-green  { background: #059669; }
.bg-gray   { background: #6b7280; }
.stat-value {
  font-size: 1.55rem;
  font-weight: 800;
  color: #1a1a2e;
  line-height: 1;
}
.stat-label {
  font-size: .74rem;
  color: #6b7280;
  margin-top: 4px;
}

/* ════════════════════════════════════════
   카드
════════════════════════════════════════ */
.admin-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,.09);
  overflow: hidden;
  margin-bottom: 24px;
  border: 1px solid #eef1f7;
}
.admin-card-header {
  background: #1a3a6b;
  color: #fff;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.admin-card-header h2 {
  font-size: .95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}
.admin-card-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.admin-card-body { padding: 22px; }

/* ── 결과 바 ── */
.admin-result-bar {
  padding: 8px 20px;
  background: #f8fafc;
  border-bottom: 1px solid #eef1f7;
  display: flex;
  align-items: center;
}
.result-count {
  font-size: .78rem;
  color: #6b7280;
  font-weight: 600;
}

/* ── 검색 / 필터 ── */
.admin-search-wrap {
  position: relative;
  flex-shrink: 0;
}
.admin-search-wrap i {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,.55);
  font-size: .8rem;
  pointer-events: none;
}
.admin-search-wrap input {
  padding: 7px 10px 7px 28px;
  border: 1.5px solid rgba(255,255,255,.35);
  border-radius: 6px;
  font-size: .83rem;
  background: rgba(255,255,255,.12);
  color: #fff;
  outline: none;
  width: 220px;
  transition: all .15s;
}
.admin-search-wrap input::placeholder { color: rgba(255,255,255,.5); }
.admin-search-wrap input:focus {
  background: rgba(255,255,255,.2);
  border-color: rgba(255,255,255,.65);
}
.admin-select-sm {
  padding: 7px 10px;
  border: 1.5px solid rgba(255,255,255,.35);
  border-radius: 6px;
  font-size: .83rem;
  background: rgba(255,255,255,.12);
  color: #fff;
  outline: none;
  cursor: pointer;
  transition: all .15s;
}
.admin-select-sm:hover { background: rgba(255,255,255,.2); }
.admin-select-sm option { color: #1a1a2e; background: #fff; }

/* ════════════════════════════════════════
   품목 테이블
════════════════════════════════════════ */
.admin-table-wrap {
  overflow-x: auto;
  min-height: 160px;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .83rem;
  min-width: 860px;
}

/* 헤더 */
.admin-table thead th {
  background: #f0f4fa;
  padding: 11px 14px;
  text-align: left;
  font-weight: 700;
  color: #1a3a6b;
  border-bottom: 2px solid #dce1ea;
  white-space: nowrap;
  position: sticky;
  top: 0;
}
.admin-table thead .th-idx    { width: 36px;  text-align: center; }
.admin-table thead .th-cat    { width: 110px; }
.admin-table thead .th-type   { width: 100px; }
.admin-table thead .th-name   { min-width: 160px; }
.admin-table thead .th-spec   { min-width: 180px; }
.admin-table thead .th-unit   { width: 56px;  text-align: center; }
.admin-table thead .th-price  { width: 130px; text-align: right; }
.admin-table thead .th-actions{ width: 120px; text-align: center; }

/* 바디 */
.admin-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid #f0f3f8;
  vertical-align: middle;
}
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover td { background: #f5f8ff; transition: background .1s; }

.td-idx   { text-align: center; color: #9ca3af; font-size: .76rem; }
.td-type-col { white-space: nowrap; }
.td-model { font-size: .77rem; color: #6b7280; }
.td-name  { font-weight: 600; color: #111827; }
.td-spec  {
  font-size: .76rem; color: #6b7280;
  max-width: 200px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.td-unit-col { text-align: center; font-size: .8rem; color: #374151; }
.td-price {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.price-sale   { color: #1a3a6b; }
.price-rental { color: #92400e; }
.price-rental small { font-size: .72rem; color: #b45309; }

/* 관리 버튼 */
.td-actions {
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: center;
}
.btn-edit-icon {
  background: #eff6ff;
  color: #2557a7;
  border: 1px solid #bfdbfe;
  font-size: .76rem;
  padding: 5px 10px;
}
.btn-edit-icon:hover {
  background: #2557a7;
  color: #fff;
  border-color: #2557a7;
}
.btn-delete-icon {
  background: #fff1f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  font-size: .76rem;
  padding: 5px 10px;
}
.btn-delete-icon:hover {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}

/* 빈 행 */
.empty-row {
  text-align: center !important;
  color: #9ca3af;
  font-style: italic;
  padding: 40px 0 !important;
}

/* ════════════════════════════════════════
   페이지네이션
════════════════════════════════════════ */
.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 14px 18px;
  border-top: 1px solid #f0f3f8;
}
.page-btn {
  padding: 6px 12px;
  border: 1.5px solid #dce1ea;
  border-radius: 6px;
  font-size: .8rem;
  font-weight: 600;
  background: #fff;
  color: #374151;
  cursor: pointer;
  transition: all .15s;
  min-width: 34px;
  text-align: center;
}
.page-btn:hover    { background: #edf2fb; border-color: #2557a7; color: #2557a7; }
.page-btn.active   { background: #1a3a6b; color: #fff; border-color: #1a3a6b; }
.page-btn:disabled { opacity: .38; cursor: default; pointer-events: none; }
.page-ellipsis     { padding: 0 6px; color: #9ca3af; line-height: 34px; }

/* ════════════════════════════════════════
   비밀번호 변경 폼
════════════════════════════════════════ */
.pw-change-form { max-width: 700px; }
.pw-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}
.pw-msg {
  font-size: .82rem;
  margin-top: 12px;
  font-weight: 600;
}
.pw-msg.success { color: #059669; }
.pw-msg.error   { color: #dc2626; }

/* ════════════════════════════════════════
   MODAL – 품목 추가/수정
════════════════════════════════════════ */
.product-modal-box {
  width: 560px;
  max-width: 96vw;
}
.modal-form-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}
.modal-form-row.two-col {
  flex-direction: row;
  gap: 16px;
}
.modal-form-row.two-col > .admin-form-item { flex: 1; }
.modal-form-row:last-child { margin-bottom: 0; }

.modal-select-highlight {
  border: 2px solid #2557a7 !important;
  background: #eff6ff !important;
  color: #1a3a6b !important;
  font-weight: 700;
}

/* ════════════════════════════════════════
   MODAL – 삭제 확인
════════════════════════════════════════ */
.delete-modal-box {
  width: 400px;
  max-width: 96vw;
}
.modal-header-danger {
  background: #dc2626 !important;
}
.delete-modal-body {
  text-align: center;
  padding: 32px 28px 20px;
}
.delete-icon-wrap {
  font-size: 2.4rem;
  color: #dc2626;
  margin-bottom: 14px;
  animation: deleteShake .4s ease;
}
@keyframes deleteShake {
  0%,100%{ transform: rotate(0); }
  25%    { transform: rotate(-8deg); }
  75%    { transform: rotate(8deg); }
}
.delete-confirm-text {
  font-size: .96rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 6px;
  line-height: 1.5;
}
.delete-warn-text {
  font-size: .8rem;
  color: #6b7280;
}

/* ════════════════════════════════════════
   TOAST
════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 26px;
  right: 26px;
  padding: 12px 22px;
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 600;
  color: #fff;
  box-shadow: 0 6px 28px rgba(0,0,0,.2);
  z-index: 9999;
  animation: toastIn .25s ease;
  pointer-events: none;
  max-width: 320px;
}
.toast-success { background: #059669; }
.toast-error   { background: #dc2626; }
.toast-info    { background: #2557a7; }
@keyframes toastIn {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════ */
@media (max-width: 1100px) {
  .admin-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .admin-toolbar  { padding: 0 14px; }
  .admin-wrap     { padding: 0 12px 40px; }
  .admin-stats    { grid-template-columns: 1fr 1fr; }
  .pw-form-row    { grid-template-columns: 1fr; }
  .admin-card-header { gap: 8px; }
  .admin-search-wrap input { width: 140px; }
  .modal-form-row.two-col { flex-direction: column; }
}
@media (max-width: 480px) {
  .admin-stats { grid-template-columns: 1fr; }
}
