/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-light: #eef2ff;
  --sidebar-bg: #1e1e2d;
  --sidebar-text: #a0a0b8;
  --sidebar-active: #ffffff;
  --sidebar-width: 240px;
  --topbar-height: 60px;
  --bg: #f5f6fa;
  --white: #ffffff;
  --border: #e5e7eb;
  --text: #1f2937;
  --text-muted: #6b7280;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --radius: 10px;
  --transition: 0.2s ease;
}

html, body {
  height: 100%;
  font-family: 'Pretendard', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  outline: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  outline: none;
  border: none;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}

/* ===== Login Page ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  position: relative;
  background: var(--white);
  border-radius: 16px;
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}

.login-back {
  position: absolute;
  top: 20px;
  left: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.login-back:hover {
  color: var(--primary);
}

.login-back svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo .logo-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.login-logo .logo-icon svg {
  width: 28px;
  height: 28px;
  color: white;
  fill: white;
}

.login-logo h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.login-logo p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.login-form .form-group {
  margin-bottom: 18px;
}

.login-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.login-form .input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--bg);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.login-form .input-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
  background: white;
}

.login-form .input-wrap svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.login-form input {
  flex: 1;
  padding: 10px 0;
  border: none;
  outline: none;
  box-shadow: none;
  background: transparent;
  font-size: 14px;
  -webkit-appearance: none;
  appearance: none;
  min-width: 0;
}

.login-form input:focus {
  outline: none;
}

.login-form input.error {
  border-color: var(--danger);
}

.login-error {
  display: none;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--danger);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
}

.login-error.show {
  display: block;
}

.btn-login {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  color: white;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  transition: opacity var(--transition), transform var(--transition);
  margin-top: 8px;
}

.btn-login:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.btn-login:active {
  transform: translateY(0);
}

.login-hint {
  text-align: center;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.login-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== Admin Layout ===== */
.admin-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width var(--transition);
  z-index: 100;
}

.sidebar-header {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  gap: 10px;
}

.sidebar-header .brand-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-header .brand-icon svg {
  width: 18px;
  height: 18px;
  fill: white;
}

.sidebar-header .brand-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--sidebar-active);
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.25);
  padding: 16px 20px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--transition);
  border-radius: 0;
  cursor: pointer;
  position: relative;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-item:hover {
  color: var(--sidebar-active);
  background: rgba(255,255,255,0.06);
}

.nav-item:hover svg {
  opacity: 1;
}

.nav-item.active {
  color: var(--sidebar-active);
  background: rgba(79, 70, 229, 0.25);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}

.nav-item.active svg {
  opacity: 1;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  color: white;
}

.user-meta .user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--sidebar-active);
}

.user-meta .user-role {
  font-size: 11px;
  color: var(--sidebar-text);
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  background: rgba(239,68,68,0.12);
  color: #f87171;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  transition: background var(--transition);
}

.btn-logout:hover {
  background: rgba(239,68,68,0.22);
}

.btn-logout svg {
  width: 16px;
  height: 16px;
}

/* ===== Main Content ===== */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ===== Topbar ===== */
.topbar {
  height: var(--topbar-height);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  flex-shrink: 0;
}

.topbar-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-badge {
  background: var(--primary-light);
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

/* ===== Page Content ===== */
.page-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* main-content가 img-manager를 직접 담을 때 */
.main-content > .img-manager {
  flex: 1;
  overflow: hidden;
}

/* ===== Cards ===== */
.card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.card-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.card-body {
  padding: 20px;
}

/* ===== Stat Cards ===== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon svg {
  width: 22px;
  height: 22px;
}

.stat-icon.purple { background: #ede9fe; color: #7c3aed; }
.stat-icon.blue   { background: #dbeafe; color: #2563eb; }
.stat-icon.green  { background: #d1fae5; color: #059669; }
.stat-icon.orange { background: #ffedd5; color: #d97706; }

.stat-info .stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.stat-info .stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.stat-info .stat-change {
  font-size: 11px;
  font-weight: 600;
  margin-top: 4px;
}

/* ===== Visit Chart ===== */
.visit-chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 160px;
  padding: 8px 0 0;
}

.chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  gap: 6px;
}

.chart-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  min-height: 18px;
  line-height: 1;
}

.chart-bar-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.chart-bar {
  width: 70%;
  min-height: 4px;
  background: var(--primary-light);
  border-radius: 4px 4px 0 0;
  transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.chart-bar:hover {
  background: var(--primary);
  cursor: default;
}

.chart-bar.today {
  background: var(--primary);
}

.chart-bar.today:hover {
  background: var(--primary-dark);
}

.chart-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.chart-label.today {
  color: var(--primary);
  font-weight: 700;
}

/* ===== Image Manager Layout ===== */
.img-manager {
  display: flex;
  gap: 0;
  height: 100%;
}

/* 좌측 필터 패널 */
.filter-panel {
  width: 200px;
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 16px 0;
}

.filter-section {
  margin-bottom: 4px;
}

.filter-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 16px 6px;
}

.filter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  border-radius: 0;
  transition: background var(--transition);
}

.filter-item:hover {
  background: var(--bg);
}

.filter-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.filter-count {
  font-size: 11px;
  background: var(--border);
  color: var(--text-muted);
  padding: 1px 7px;
  border-radius: 10px;
  font-weight: 600;
}

.filter-item.active .filter-count {
  background: var(--primary);
  color: white;
}

/* 우측 메인 */
.img-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

/* 이미지 탑바 */
.img-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 0;
  gap: 12px;
}

.img-topbar-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}

/* 탭 */
.tab-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 14px 20px 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.tab-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color var(--transition);
}

.tab-item:hover { color: var(--text); }

.tab-item.active {
  color: var(--primary);
  font-weight: 700;
  border-bottom-color: var(--primary);
}

.tab-badge {
  background: var(--border);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
}

.tab-item.active .tab-badge {
  background: var(--primary);
  color: white;
}

/* 툴바 */
.img-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
}

.toolbar-search {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  gap: 8px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.toolbar-search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.08);
}

.toolbar-search svg {
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.toolbar-search input {
  border: none;
  background: none;
  padding: 8px 0;
  font-size: 13px;
  color: var(--text);
  width: 100%;
}

.toolbar-search input::placeholder { color: var(--text-muted); }

/* 테이블 영역 */
.img-table-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 0 20px 20px;
}

.img-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 13px;
}

.img-table thead {
  background: #f9fafb;
  border-bottom: 1px solid var(--border);
}

.img-table th {
  padding: 11px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  user-select: none;
}

.img-table th.sortable {
  cursor: pointer;
}

.img-table th.sortable:hover { color: var(--primary); }

.img-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.img-table tr:last-child td { border-bottom: none; }

.img-table tbody tr {
  transition: background var(--transition);
}

.img-table tbody tr:hover {
  background: #f9fafb;
}

/* 썸네일 셀 */
.td-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--bg);
  display: block;
}

.td-thumb-placeholder {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: linear-gradient(135deg, #e0e7ff, #f3f0ff);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.td-thumb-placeholder svg {
  width: 20px;
  height: 20px;
  color: #a5b4fc;
}

/* 이미지명 */
.td-name {
  font-weight: 600;
  color: var(--text);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.td-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* 카테고리 뱃지 */
.cat-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary);
}

.cat-badge.banner     { background: #dbeafe; color: #2563eb; }
.cat-badge.product    { background: #d1fae5; color: #059669; }
.cat-badge.gallery    { background: #ede9fe; color: #7c3aed; }
.cat-badge.icon       { background: #ffedd5; color: #d97706; }
.cat-badge.background { background: #fce7f3; color: #be185d; }
.cat-badge.etc        { background: #f3f4f6; color: #6b7280; }

/* 액션 버튼 */
.td-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--transition);
}

.img-table tbody tr:hover .td-actions { opacity: 1; }

.act-btn {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.act-btn svg { width: 15px; height: 15px; }

.act-btn.copy   { background: var(--primary-light); color: var(--primary); }
.act-btn.copy:hover   { background: var(--primary); color: white; }
.act-btn.delete { background: #fef2f2; color: var(--danger); }
.act-btn.delete:hover { background: var(--danger); color: white; }
.act-btn.view   { background: #f0fdf4; color: var(--success); }
.act-btn.view:hover   { background: var(--success); color: white; }

/* 빈 상태 */
.table-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.table-empty svg {
  display: block;
  margin: 0 auto 14px;
  opacity: 0.25;
}

.table-empty p { font-size: 13px; margin-bottom: 12px; }

/* ===== 업로드 모달 ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--white);
  border-radius: 14px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--text-muted);
  transition: all var(--transition);
}

.modal-close:hover { background: #fee2e2; color: var(--danger); }
.modal-close svg { width: 16px; height: 16px; }

.modal-body { padding: 22px; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid var(--border);
}

/* ===== Image Upload ===== */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg);
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-zone .upload-icon {
  width: 56px;
  height: 56px;
  background: var(--primary-light);
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.upload-zone .upload-icon svg {
  width: 28px;
  height: 28px;
  color: var(--primary);
}

.upload-zone h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}

.upload-zone p {
  font-size: 13px;
  color: var(--text-muted);
}

.upload-zone .upload-formats {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Image Form */
.image-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
}

.image-form .full-width {
  grid-column: 1 / -1;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--text);
  background: var(--bg);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
  background: white;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.btn {
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  transition: all var(--transition);
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1.5px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

/* Image Gallery */
.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.image-item {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow);
  transition: all var(--transition);
}

.image-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.image-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: var(--bg);
}

.image-thumb-placeholder {
  width: 100%;
  aspect-ratio: 1;
  background: linear-gradient(135deg, #e0e7ff, #f3f0ff);
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-thumb-placeholder svg {
  width: 36px;
  height: 36px;
  color: #a5b4fc;
}

.image-meta {
  padding: 10px 12px;
}

.image-meta .image-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.image-meta .image-size {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.image-item-actions {
  display: flex;
  gap: 6px;
  padding: 0 12px 10px;
}

.btn-icon {
  flex: 1;
  padding: 5px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all var(--transition);
}

.btn-icon.copy {
  background: var(--primary-light);
  color: var(--primary);
}

.btn-icon.copy:hover {
  background: var(--primary);
  color: white;
}

.btn-icon.delete {
  background: #fef2f2;
  color: var(--danger);
}

.btn-icon.delete:hover {
  background: var(--danger);
  color: white;
}

/* ===== Toast ===== */
.toast-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: #1f2937;
  color: white;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInToast 0.3s ease;
  pointer-events: auto;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.info    { border-left: 3px solid var(--primary); }

@keyframes slideInToast {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -240px;
    top: 0;
    bottom: 0;
    transition: left var(--transition);
  }
  .sidebar.open { left: 0; }
  .image-form { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
