/* Admin panel — reuses tokens from style.css, loaded alongside it */

.admin-shell { display: flex; min-height: 100vh; }

.admin-sidebar {
  width: 240px;
  background: var(--ink);
  color: var(--white);
  padding: 26px 18px;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 2px 0 12px rgba(14, 31, 53, 0.12);
}
.admin-sidebar .brand { margin-bottom: 26px; padding: 0 6px; }
.admin-sidebar .brand img { height: 40px; }
.admin-sidebar .brand-name { color: var(--white); font-size: 0.95rem; }
.admin-sidebar .brand-name span { color: rgba(255,255,255,0.55); }

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.75);
  border: none;
  background: transparent;
  text-align: left;
  width: 100%;
  transition: background 0.12s ease, color 0.12s ease;
}
.admin-nav-item:hover { background: rgba(255, 255, 255, 0.06); color: var(--white); }
.admin-nav-item.active { background: var(--orange); color: var(--white); box-shadow: 0 4px 12px rgba(244, 98, 46, 0.35); }

.admin-nav-spacer { flex: 1; }

.admin-main { flex: 1; padding: 32px 36px; max-width: 1200px; }

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
}
.admin-topbar h1 { font-size: 1.5rem; }
.admin-topbar p { color: var(--ink-soft); font-size: 0.9rem; margin-top: 4px; }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: var(--white); border: 1px solid var(--sand-line); border-radius: var(--radius-md);
  padding: 20px 22px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.stat-card:hover { box-shadow: var(--shadow-card); transform: translateY(-1px); }
.stat-card-text span { font-size: 0.78rem; color: var(--ink-soft); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.stat-card-text b { display: block; font-family: var(--font-display); font-size: 1.6rem; margin-top: 6px; }
.stat-card-icon {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 1.15rem;
  background: var(--sand); color: var(--orange-dark);
}
.stat-card-icon.icon-green { background: #E1F8EA; color: var(--green-dark); }
.stat-card-icon.icon-navy { background: #E4EAF3; color: var(--ink); }
.stat-card-icon.icon-red { background: #FCE4E4; color: #C23B3B; }

.dash-charts-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-bottom: 20px; }
.chart-wrap { padding: 18px 22px 22px; height: 240px; position: relative; }
.chart-wrap--donut { display: flex; align-items: center; justify-content: center; }

.admin-card { background: var(--white); border: 1px solid var(--sand-line); border-radius: var(--radius-md); overflow: hidden; margin-bottom: 20px; }
.admin-card-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--sand-line); }
.admin-card-head h2 { font-size: 1.05rem; }

table.admin-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
table.admin-table th {
  text-align: left; padding: 12px 22px; background: var(--sand);
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft);
}
table.admin-table td { padding: 12px 22px; border-bottom: 1px solid var(--sand-line); vertical-align: middle; }
table.admin-table tr:last-child td { border-bottom: none; }
table.admin-table tbody tr { transition: background 0.1s ease; }
table.admin-table tbody tr:hover { background: var(--cream); }
.admin-thumb { width: 40px; height: 40px; border-radius: 10px; background: var(--sand); display: flex; align-items: center; justify-content: center; }
.admin-thumb svg { width: 70%; height: 70%; }

.pill { display: inline-block; padding: 4px 12px; border-radius: var(--radius-pill); font-size: 0.74rem; font-weight: 700; }
.pill-green { background: #E1F8EA; color: #1DAE55; }
.pill-orange { background: var(--sand); color: var(--orange-dark); }
.pill-red { background: #FCE4E4; color: #C23B3B; }
.pill-gray { background: #EEF0F3; color: var(--ink-soft); }

.row-actions { display: flex; gap: 8px; }
.row-actions button {
  border: none; background: var(--sand); border-radius: 8px; padding: 6px 12px;
  font-size: 0.78rem; font-weight: 700; color: var(--ink);
}
.row-actions button.danger { background: #FCE4E4; color: #C23B3B; }

.status-select {
  padding: 6px 10px; border-radius: 8px; border: 1px solid var(--sand-line);
  font-size: 0.78rem; font-family: var(--font-body); font-weight: 600;
}

/* Login screen */
.admin-login {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--ink);
}
.admin-login[hidden], .admin-shell[hidden] { display: none; }
.login-card {
  background: var(--white); border-radius: var(--radius-lg); padding: 40px 36px;
  width: 100%; max-width: 380px; box-shadow: var(--shadow-lift); text-align: center;
}
.login-card img { height: 56px; margin: 0 auto 18px; }
.login-card h1 { font-size: 1.3rem; margin-bottom: 6px; }
.login-card p { color: var(--ink-soft); font-size: 0.88rem; margin-bottom: 22px; }

/* Product form modal reuses .modal from style.css */
.admin-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 28px 30px; }
.admin-form-grid .form-field.full { grid-column: 1 / -1; }
.admin-form-actions { grid-column: 1 / -1; display: flex; gap: 10px; justify-content: flex-end; padding-top: 8px; }

/* Image upload dropzone */
.image-dropzone {
  border: 2px dashed var(--sand-line);
  border-radius: var(--radius-md);
  background: var(--sand);
  padding: 18px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.image-dropzone.dragover { border-color: var(--orange); background: #FFF3EA; }
.image-dropzone-empty span { color: var(--ink-soft); font-size: 0.88rem; font-weight: 600; }
.image-dropzone-preview { display: flex; align-items: center; gap: 16px; justify-content: center; }
.image-dropzone-preview img { width: 88px; height: 88px; object-fit: cover; border-radius: 10px; background: var(--white); }

/* Quill rich text editor, restyled to match admin form fields */
#pf_description_editor { background: var(--white); border-radius: var(--radius-md); }
#pf_description_editor .ql-toolbar { border-color: var(--sand-line); border-radius: var(--radius-md) var(--radius-md) 0 0; }
#pf_description_editor .ql-container { border-color: var(--sand-line); border-radius: 0 0 var(--radius-md) var(--radius-md); font-family: var(--font-body); font-size: 0.92rem; min-height: 100px; }

.admin-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }

/* Multi-photo gallery grid */
.image-gallery-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.gallery-thumb { position: relative; width: 76px; height: 76px; border-radius: 10px; overflow: hidden; background: var(--sand); cursor: grab; }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb.cover::after { content: 'Cover'; position: absolute; bottom: 0; left: 0; right: 0; background: rgba(14,31,53,0.75); color: var(--white); font-size: 0.62rem; text-align: center; padding: 2px 0; font-weight: 700; }
.gallery-thumb .thumb-remove {
  position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: rgba(14,31,53,0.85); color: var(--white); border: none; font-size: 0.7rem; line-height: 1; cursor: pointer;
}
.gallery-thumb.drag-over { outline: 2px dashed var(--orange); }

/* Variant rows */
.variant-row { display: grid; grid-template-columns: 1.4fr 1fr 0.9fr 0.9fr 0.7fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.variant-row input { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--sand-line); font-family: var(--font-body); font-size: 0.85rem; }
.variant-row button { border: none; background: #FCE4E4; color: #C23B3B; border-radius: 8px; width: 30px; height: 30px; font-weight: 700; }
.variant-row-labels { display: grid; grid-template-columns: 1.4fr 1fr 0.9fr 0.9fr 0.7fr auto; gap: 8px; font-size: 0.7rem; text-transform: uppercase; color: var(--ink-soft); font-weight: 700; margin-bottom: 6px; }

.coming-soon { padding: 40px 26px; text-align: center; color: var(--ink-soft); font-size: 0.92rem; line-height: 1.6; max-width: 480px; margin: 0 auto; }

.bulk-action-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--ink); color: var(--white); border-radius: var(--radius-md);
  padding: 12px 18px; margin-bottom: 14px;
}
.bulk-action-bar-actions { display: flex; align-items: center; gap: 8px; }
.bulk-action-bar-actions select {
  padding: 7px 10px; border-radius: 8px; border: none; font-size: 0.82rem; font-family: var(--font-body); font-weight: 600;
}
.bulk-action-bar .btn--ghost { background: rgba(255,255,255,0.12); color: var(--white); border-color: rgba(255,255,255,0.2); padding: 7px 14px; font-size: 0.82rem; }
.stock-badge { font-size: 0.78rem; font-weight: 700; padding: 4px 10px; border-radius: var(--radius-pill); }
.stock-adjust { display: flex; align-items: center; gap: 6px; }
.stock-adjust button { width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--sand-line); background: var(--white); font-weight: 700; }
.stock-adjust span { min-width: 24px; text-align: center; font-weight: 700; }

@media (max-width: 900px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; flex-direction: row; overflow-x: auto; }
  .admin-main { padding: 20px; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .dash-charts-row { grid-template-columns: 1fr; }
  table.admin-table { display: block; overflow-x: auto; }
  .admin-form-grid { grid-template-columns: 1fr; }
}
